Make Project Management a native feature

- Move the storage and model of the plugin into src/lib/features/pm/ as pure TypeScript, so the skill can still bundle them.
- Move the DOM interface onto the host menus, the shared tooltip, and the host icons.
- A ribbon button opens Project Management. Board tabs keep the owner runestone.pm and the board-<hex> view IDs through view patterns.
- Read only .runestone/pm/. Offer the plugin migration, with backups, for legacy notes.
- A save, move, or delete reads only that card again. Watcher paths reach the feature.
- Add Settings → Project Management and the projectManagement section. View states move to localStorage.
- Background reads the boards from workspace.json. Remove api.backgrounds and the boards service.
- Add yaml 2.9.1. Use the host markdown-it.
- Move 18 plugin test files to tests/unit/features/pm/ and add native tests.
This commit is contained in:
Knotty Wyvern
2026-10-29 20:54:29 -07:00
parent e6deecc092
commit e66f089176
100 changed files with 14412 additions and 290 deletions
+7 -5
View File
@@ -45,11 +45,13 @@ test("feature checks find optional members, and missing members give an update m
assert.throws(() => requireFeature(api, "files"), (error: unknown) => error instanceof MissingFeatureError
&& error.name === "MissingFeatureError" && error.features.length === 1 && error.features[0] === "files"
&& error.message === "This plugin needs the folder grant API (api.files). Update RuneStone to a version that has this feature.");
assert.throws(() => requireFeatures(api, ["files", "backgrounds", "workspace.readBytes"]), {
message: "This plugin needs the folder grant API (api.files) and the background API (api.backgrounds). Update RuneStone to a version that has these features.",
assert.throws(() => requireFeatures(api, ["files", "workspace.readBytes", "openFile"]), {
message: "This plugin needs the folder grant API (api.files) and opening files in the RuneStone editor (api.openFile). Update RuneStone to a version that has these features.",
});
// The terminal API (api.pty) left the SDK when Terminal became a native feature.
// The terminal API (api.pty) left the SDK when Terminal became a native feature, and the background API
// (api.backgrounds) when Project Management became one.
assert.throws(() => hasFeature(api, "pty" as never), TypeError);
assert.throws(() => hasFeature(api, "backgrounds" as never), TypeError);
assert.doesNotThrow(() => requireFeatures(api, ["services", "workspace.readBytes"]));
assert.throws(() => hasFeature(api, "workspace.read" as never), TypeError);
assert.equal(describeFeature("ui.showActionMenu"), "the shared action menu (api.ui.showActionMenu)");
@@ -66,7 +68,7 @@ test("a required function stays bound to its parent object", async () => {
test("the current host gives every SDK feature when all services are present", async () => {
const files = { chooseFolder: async () => null, pictureFolder: async () => ({ id: "g", path: "p", name: "n" }), grants: async () => [], revoke: async () => false, list: async () => [], readBytes: async () => new Uint8Array(), readSidecar: async () => null, writeSidecar: async () => {} };
const { api, session } = await hostApi({
files, backgrounds: true, serviceHub: new ServiceHub(), openFile: async () => {}, completionTransport: async () => {},
files, serviceHub: new ServiceHub(), openFile: async () => {}, completionTransport: async () => {},
workspace: { ...base.workspace, listMarkdown: async () => [], readMany: async () => [], readBytes: async () => new Uint8Array(), readOptional: async () => null, create: async () => {}, subscribe: () => () => {} },
settings: { ...base.settings, subscribe: () => () => {} },
}, true);
@@ -77,7 +79,7 @@ test("the current host gives every SDK feature when all services are present", a
test("the host without optional services lacks only the features that depend on them", async () => {
const { api, session } = await hostApi({});
assert.deepEqual(missingFeatures(api, pluginFeatures).sort(), [
"backgrounds", "closeView", "completion.transport", "files",
"closeView", "completion.transport", "files",
"openFile", "renameDocument", "replaceDocumentWithView", "replaceView", "settings.subscribe",
"workspace.create", "workspace.listMarkdown", "workspace.readBytes", "workspace.readMany", "workspace.readOptional", "workspace.subscribe",
]);