@unbrained/pm-cli 2026.5.12 → 2026.5.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/PRD.md +7 -28
  3. package/README.md +2 -9
  4. package/dist/cli/commander-usage.js +27 -0
  5. package/dist/cli/commander-usage.js.map +1 -1
  6. package/dist/cli/commands/activity.js +19 -4
  7. package/dist/cli/commands/activity.js.map +1 -1
  8. package/dist/cli/commands/calendar.js +5 -2
  9. package/dist/cli/commands/calendar.js.map +1 -1
  10. package/dist/cli/commands/contracts.js +56 -18
  11. package/dist/cli/commands/contracts.js.map +1 -1
  12. package/dist/cli/commands/create.js +58 -3
  13. package/dist/cli/commands/create.js.map +1 -1
  14. package/dist/cli/commands/extension.d.ts +5 -1
  15. package/dist/cli/commands/extension.js +245 -39
  16. package/dist/cli/commands/extension.js.map +1 -1
  17. package/dist/cli/commands/index.d.ts +0 -8
  18. package/dist/cli/commands/index.js +0 -8
  19. package/dist/cli/commands/index.js.map +1 -1
  20. package/dist/cli/commands/reindex.d.ts +8 -0
  21. package/dist/cli/commands/reindex.js +96 -23
  22. package/dist/cli/commands/reindex.js.map +1 -1
  23. package/dist/cli/commands/search.js +51 -25
  24. package/dist/cli/commands/search.js.map +1 -1
  25. package/dist/cli/help-content.js +17 -18
  26. package/dist/cli/help-content.js.map +1 -1
  27. package/dist/cli/main.js +73 -7
  28. package/dist/cli/main.js.map +1 -1
  29. package/dist/cli/register-list-query.js +24 -142
  30. package/dist/cli/register-list-query.js.map +1 -1
  31. package/dist/cli/register-mutation.js +49 -257
  32. package/dist/cli/register-mutation.js.map +1 -1
  33. package/dist/cli/register-operations.js +29 -198
  34. package/dist/cli/register-operations.js.map +1 -1
  35. package/dist/cli/register-setup.js +32 -133
  36. package/dist/cli/register-setup.js.map +1 -1
  37. package/dist/cli/registration-helpers.d.ts +2 -2
  38. package/dist/cli/registration-helpers.js +1 -19
  39. package/dist/cli/registration-helpers.js.map +1 -1
  40. package/dist/core/extensions/loader.js +7 -1
  41. package/dist/core/extensions/loader.js.map +1 -1
  42. package/dist/core/packages/manifest.d.ts +26 -1
  43. package/dist/core/packages/manifest.js +82 -0
  44. package/dist/core/packages/manifest.js.map +1 -1
  45. package/dist/core/search/embedding-batches.d.ts +13 -1
  46. package/dist/core/search/embedding-batches.js +19 -1
  47. package/dist/core/search/embedding-batches.js.map +1 -1
  48. package/dist/core/store/front-matter-cache.d.ts +8 -1
  49. package/dist/core/store/front-matter-cache.js +20 -11
  50. package/dist/core/store/front-matter-cache.js.map +1 -1
  51. package/dist/mcp/server.d.ts +8 -0
  52. package/dist/mcp/server.js +93 -43
  53. package/dist/mcp/server.js.map +1 -1
  54. package/dist/sdk/cli-contracts/commander-mutation-options.d.ts +7 -0
  55. package/dist/sdk/cli-contracts/commander-mutation-options.js +477 -0
  56. package/dist/sdk/cli-contracts/commander-mutation-options.js.map +1 -0
  57. package/dist/sdk/cli-contracts/commander-types.d.ts +21 -0
  58. package/dist/sdk/cli-contracts/commander-types.js +92 -0
  59. package/dist/sdk/cli-contracts/commander-types.js.map +1 -0
  60. package/dist/sdk/cli-contracts.d.ts +6 -17
  61. package/dist/sdk/cli-contracts.js +19 -262
  62. package/dist/sdk/cli-contracts.js.map +1 -1
  63. package/dist/sdk/index.d.ts +2 -1
  64. package/dist/sdk/index.js +1 -0
  65. package/dist/sdk/index.js.map +1 -1
  66. package/dist/sdk/runtime.d.ts +29 -0
  67. package/dist/sdk/runtime.js +28 -0
  68. package/dist/sdk/runtime.js.map +1 -0
  69. package/docs/COMMANDS.md +3 -0
  70. package/docs/EXTENSIONS.md +60 -35
  71. package/docs/QUICKSTART.md +1 -0
  72. package/docs/RELEASING.md +4 -2
  73. package/docs/SDK.md +78 -441
  74. package/package.json +4 -3
  75. package/packages/pm-beads/extensions/beads/index.js +90 -101
  76. package/packages/pm-beads/extensions/beads/index.ts +2 -2
  77. package/packages/pm-beads/extensions/beads/runtime.js +2 -17
  78. package/packages/pm-beads/extensions/beads/runtime.ts +41 -18
  79. package/packages/pm-beads/package.json +33 -0
  80. package/packages/pm-calendar/README.md +13 -0
  81. package/packages/pm-calendar/extensions/calendar/index.js +56 -0
  82. package/packages/pm-calendar/extensions/calendar/index.ts +62 -0
  83. package/packages/pm-calendar/extensions/calendar/manifest.json +7 -0
  84. package/packages/pm-calendar/extensions/calendar/runtime.js +95 -0
  85. package/packages/pm-calendar/extensions/calendar/runtime.ts +104 -0
  86. package/packages/pm-calendar/package.json +51 -0
  87. package/packages/pm-governance-audit/README.md +23 -0
  88. package/packages/pm-governance-audit/extensions/governance-audit/index.js +117 -0
  89. package/packages/pm-governance-audit/extensions/governance-audit/index.ts +118 -0
  90. package/packages/pm-governance-audit/extensions/governance-audit/manifest.json +7 -0
  91. package/packages/pm-governance-audit/extensions/governance-audit/runtime.js +159 -0
  92. package/packages/pm-governance-audit/extensions/governance-audit/runtime.ts +176 -0
  93. package/packages/pm-governance-audit/package.json +52 -0
  94. package/packages/pm-guide-shell/README.md +23 -0
  95. package/packages/pm-guide-shell/extensions/guide-shell/index.js +76 -0
  96. package/packages/pm-guide-shell/extensions/guide-shell/index.ts +81 -0
  97. package/packages/pm-guide-shell/extensions/guide-shell/manifest.json +7 -0
  98. package/packages/pm-guide-shell/extensions/guide-shell/runtime.js +263 -0
  99. package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +327 -0
  100. package/packages/pm-guide-shell/package.json +52 -0
  101. package/packages/pm-linked-test-adapters/README.md +24 -0
  102. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/index.js +101 -0
  103. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/index.ts +102 -0
  104. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/manifest.json +7 -0
  105. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/runtime.js +142 -0
  106. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/runtime.ts +173 -0
  107. package/packages/pm-linked-test-adapters/package.json +53 -0
  108. package/packages/pm-search-advanced/README.md +27 -0
  109. package/packages/pm-search-advanced/extensions/search-advanced/index.js +93 -0
  110. package/packages/pm-search-advanced/extensions/search-advanced/index.ts +94 -0
  111. package/packages/pm-search-advanced/extensions/search-advanced/manifest.json +7 -0
  112. package/packages/pm-search-advanced/extensions/search-advanced/runtime.js +120 -0
  113. package/packages/pm-search-advanced/extensions/search-advanced/runtime.ts +144 -0
  114. package/packages/pm-search-advanced/package.json +54 -0
  115. package/packages/pm-templates/README.md +20 -0
  116. package/packages/pm-templates/extensions/templates/index.js +101 -0
  117. package/packages/pm-templates/extensions/templates/index.ts +109 -0
  118. package/packages/pm-templates/extensions/templates/manifest.json +7 -0
  119. package/packages/pm-templates/extensions/templates/runtime.js +226 -0
  120. package/packages/pm-templates/extensions/templates/runtime.ts +283 -0
  121. package/packages/pm-templates/package.json +50 -0
  122. package/packages/pm-todos/extensions/todos/index.js +105 -116
  123. package/packages/pm-todos/extensions/todos/index.ts +3 -2
  124. package/packages/pm-todos/extensions/todos/runtime.js +2 -17
  125. package/packages/pm-todos/extensions/todos/runtime.ts +40 -18
  126. package/packages/pm-todos/package.json +34 -0
  127. package/plugins/pm-cli-claude/scripts/pm-mcp-server.mjs +4 -2
  128. package/plugins/pm-cli-codex/scripts/pm-mcp-server.mjs +4 -2
@@ -1,141 +1,130 @@
1
1
  import path from "node:path";
2
2
  import { fileURLToPath, pathToFileURL } from "node:url";
3
-
4
3
  const PM_PACKAGE_ROOT_ENV = "PM_CLI_PACKAGE_ROOT";
5
4
  const CURRENT_EXTENSION_ROOT = path.dirname(fileURLToPath(import.meta.url));
6
-
7
5
  export const manifest = {
8
- name: "builtin-todos-import-export",
9
- version: "0.1.0",
10
- entry: "./index.js",
11
- priority: 0,
12
- capabilities: ["commands", "schema"],
6
+ name: "builtin-todos-import-export",
7
+ version: "0.1.0",
8
+ entry: "./index.js",
9
+ priority: 0,
10
+ capabilities: ["commands", "schema"],
13
11
  };
14
-
15
12
  function asOptionalString(value) {
16
- return typeof value === "string" ? value : undefined;
13
+ return typeof value === "string" ? value : undefined;
17
14
  }
18
-
19
15
  function toImportOptions(options) {
20
- return {
21
- folder: asOptionalString(options.folder),
22
- author: asOptionalString(options.author),
23
- message: asOptionalString(options.message),
24
- };
16
+ return {
17
+ folder: asOptionalString(options.folder),
18
+ author: asOptionalString(options.author),
19
+ message: asOptionalString(options.message),
20
+ };
25
21
  }
26
-
27
22
  function toExportOptions(options) {
28
- return {
29
- folder: asOptionalString(options.folder),
30
- };
23
+ return {
24
+ folder: asOptionalString(options.folder),
25
+ };
31
26
  }
32
-
33
27
  function resolvePackageRootCandidates() {
34
- const candidates = [];
35
- const envRoot = process.env[PM_PACKAGE_ROOT_ENV];
36
- if (typeof envRoot === "string" && envRoot.trim().length > 0) {
37
- candidates.push(path.resolve(envRoot.trim()));
38
- }
39
- const argvEntry = typeof process.argv[1] === "string" ? process.argv[1].trim() : "";
40
- if (argvEntry.length > 0) {
41
- const resolvedEntry = path.resolve(argvEntry);
42
- const entryDir = path.dirname(resolvedEntry);
43
- candidates.push(path.resolve(entryDir, ".."));
44
- candidates.push(path.resolve(entryDir, "../.."));
45
- candidates.push(path.resolve(entryDir, "../../.."));
46
- }
47
- return [...new Set(candidates)];
28
+ const candidates = [];
29
+ const envRoot = process.env[PM_PACKAGE_ROOT_ENV];
30
+ if (typeof envRoot === "string" && envRoot.trim().length > 0) {
31
+ candidates.push(path.resolve(envRoot.trim()));
32
+ }
33
+ const argvEntry = typeof process.argv[1] === "string" ? process.argv[1].trim() : "";
34
+ if (argvEntry.length > 0) {
35
+ const resolvedEntry = path.resolve(argvEntry);
36
+ const entryDir = path.dirname(resolvedEntry);
37
+ candidates.push(path.resolve(entryDir, ".."));
38
+ candidates.push(path.resolve(entryDir, "../.."));
39
+ candidates.push(path.resolve(entryDir, "../../.."));
40
+ }
41
+ return [...new Set(candidates)];
48
42
  }
49
-
50
43
  async function loadRuntimeModule() {
51
- const attempted = [];
52
- for (const packageRoot of resolvePackageRootCandidates()) {
53
- const modulePaths = [
54
- path.join(packageRoot, ".agents", "pm", "extensions", "todos", "runtime.js"),
55
- path.join(packageRoot, "packages", "pm-todos", "extensions", "todos", "runtime.js"),
56
- ];
57
- for (const modulePath of modulePaths) {
58
- attempted.push(modulePath);
59
- try {
60
- return await import(pathToFileURL(modulePath).href);
61
- } catch {
62
- // Try the next package-root candidate.
63
- }
44
+ const attempted = [];
45
+ for (const packageRoot of resolvePackageRootCandidates()) {
46
+ const modulePaths = [
47
+ path.join(packageRoot, ".agents", "pm", "extensions", "todos", "runtime.js"),
48
+ path.join(packageRoot, "packages", "pm-todos", "extensions", "todos", "runtime.js"),
49
+ ];
50
+ for (const modulePath of modulePaths) {
51
+ attempted.push(modulePath);
52
+ try {
53
+ return await import(pathToFileURL(modulePath).href);
54
+ }
55
+ catch {
56
+ // Try the next package-root candidate.
57
+ }
58
+ }
59
+ }
60
+ const localRuntimePath = path.join(CURRENT_EXTENSION_ROOT, "runtime.js");
61
+ attempted.push(localRuntimePath);
62
+ try {
63
+ return await import(pathToFileURL(localRuntimePath).href);
64
64
  }
65
- }
66
-
67
- const localRuntimePath = path.join(CURRENT_EXTENSION_ROOT, "runtime.js");
68
- attempted.push(localRuntimePath);
69
- try {
70
- return await import(pathToFileURL(localRuntimePath).href);
71
- } catch {
72
- // Fall through to the diagnostic below.
73
- }
74
-
75
- throw new Error(
76
- "Unable to resolve packaged todos extension runtime module. " +
77
- `Tried: ${attempted.join(", ")}. Ensure the installed extension includes runtime.js or PM_CLI_PACKAGE_ROOT points to an installed pm package root.`,
78
- );
65
+ catch {
66
+ // Fall through to the diagnostic below.
67
+ }
68
+ throw new Error("Unable to resolve packaged todos extension runtime module. " +
69
+ `Tried: ${attempted.join(", ")}. Ensure the installed extension includes runtime.js or PM_CLI_PACKAGE_ROOT points to an installed pm package root.`);
79
70
  }
80
-
81
71
  async function runTodosImportFromRuntime(options, global) {
82
- const runtime = await loadRuntimeModule();
83
- if (typeof runtime.runTodosImport !== "function") {
84
- throw new Error('Bundled todos runtime module is missing runTodosImport().');
85
- }
86
- return runtime.runTodosImport(options, global);
72
+ const runtime = await loadRuntimeModule();
73
+ if (typeof runtime.runTodosImport !== "function") {
74
+ throw new Error("Bundled todos runtime module is missing runTodosImport().");
75
+ }
76
+ return runtime.runTodosImport(options, global);
87
77
  }
88
-
89
78
  async function runTodosExportFromRuntime(options, global) {
90
- const runtime = await loadRuntimeModule();
91
- if (typeof runtime.runTodosExport !== "function") {
92
- throw new Error('Bundled todos runtime module is missing runTodosExport().');
93
- }
94
- return runtime.runTodosExport(options, global);
79
+ const runtime = await loadRuntimeModule();
80
+ if (typeof runtime.runTodosExport !== "function") {
81
+ throw new Error("Bundled todos runtime module is missing runTodosExport().");
82
+ }
83
+ return runtime.runTodosExport(options, global);
95
84
  }
96
-
97
85
  export function activate(api) {
98
- api.registerCommand({
99
- name: "todos import",
100
- description: "Import Todo markdown files into pm items.",
101
- flags: [
102
- {
103
- long: "--folder",
104
- value_name: "path",
105
- value_type: "string",
106
- description: "Source folder containing Todo markdown files.",
107
- },
108
- {
109
- long: "--author",
110
- value_name: "author",
111
- value_type: "string",
112
- description: "Override import mutation author.",
113
- },
114
- {
115
- long: "--message",
116
- value_name: "text",
117
- value_type: "string",
118
- description: "Override import history message.",
119
- },
120
- ],
121
- run: async (context) => runTodosImportFromRuntime(toImportOptions(context.options), context.global),
122
- });
123
- api.registerCommand({
124
- name: "todos export",
125
- description: "Export pm items into Todo markdown files.",
126
- flags: [
127
- {
128
- long: "--folder",
129
- value_name: "path",
130
- value_type: "string",
131
- description: "Destination folder for exported Todo markdown files.",
132
- },
133
- ],
134
- run: async (context) => runTodosExportFromRuntime(toExportOptions(context.options), context.global),
135
- });
86
+ api.registerCommand({
87
+ name: "todos import",
88
+ action: "todos-import",
89
+ description: "Import Todo markdown files into pm items.",
90
+ flags: [
91
+ {
92
+ long: "--folder",
93
+ value_name: "path",
94
+ value_type: "string",
95
+ description: "Source folder containing Todo markdown files.",
96
+ },
97
+ {
98
+ long: "--author",
99
+ value_name: "author",
100
+ value_type: "string",
101
+ description: "Override import mutation author.",
102
+ },
103
+ {
104
+ long: "--message",
105
+ value_name: "text",
106
+ value_type: "string",
107
+ description: "Override import history message.",
108
+ },
109
+ ],
110
+ run: async (context) => runTodosImportFromRuntime(toImportOptions(context.options), context.global),
111
+ });
112
+ api.registerCommand({
113
+ name: "todos export",
114
+ action: "todos-export",
115
+ description: "Export pm items into Todo markdown files.",
116
+ flags: [
117
+ {
118
+ long: "--folder",
119
+ value_name: "path",
120
+ value_type: "string",
121
+ description: "Destination folder for exported Todo markdown files.",
122
+ },
123
+ ],
124
+ run: async (context) => runTodosExportFromRuntime(toExportOptions(context.options), context.global),
125
+ });
136
126
  }
137
-
138
127
  export default {
139
- manifest,
140
- activate,
128
+ manifest,
129
+ activate,
141
130
  };
@@ -1,7 +1,6 @@
1
1
  import path from "node:path";
2
2
  import { fileURLToPath, pathToFileURL } from "node:url";
3
- import type { CommandDefinition, ExtensionApi } from "../../../../src/core/extensions/loader.js";
4
- import type { GlobalOptions } from "../../../../src/core/shared/command-types.js";
3
+ import type { CommandDefinition, ExtensionApi, GlobalOptions } from "../../../../src/sdk/index.js";
5
4
  import type { TodosExportOptions, TodosExportResult, TodosImportOptions, TodosImportResult } from "./runtime.js";
6
5
 
7
6
  const PM_PACKAGE_ROOT_ENV = "PM_CLI_PACKAGE_ROOT";
@@ -105,6 +104,7 @@ async function runTodosExportFromRuntime(options: TodosExportOptions, global: Gl
105
104
  export function activate(api: ExtensionApi): void {
106
105
  api.registerCommand({
107
106
  name: "todos import",
107
+ action: "todos-import",
108
108
  description: "Import Todo markdown files into pm items.",
109
109
  flags: [
110
110
  {
@@ -130,6 +130,7 @@ export function activate(api: ExtensionApi): void {
130
130
  } satisfies CommandDefinition);
131
131
  api.registerCommand({
132
132
  name: "todos export",
133
+ action: "todos-export",
133
134
  description: "Export pm items into Todo markdown files.",
134
135
  flags: [
135
136
  {
@@ -1,21 +1,6 @@
1
1
  import fs from "node:fs/promises";
2
2
  import path from "node:path";
3
- import { getActiveExtensionRegistrations, runActiveOnReadHooks, runActiveOnWriteHooks } from "../../../../dist/core/extensions/index.js";
4
- import { pathExists, removeFileIfExists, writeFileAtomic } from "../../../../dist/core/fs/fs-utils.js";
5
- import { appendHistoryEntry, createHistoryEntry } from "../../../../dist/core/history/history.js";
6
- import { generateItemId, normalizeItemId } from "../../../../dist/core/item/id.js";
7
- import { canonicalDocument, normalizeFrontMatter, serializeItemDocument, splitFrontMatter } from "../../../../dist/core/item/item-format.js";
8
- import { normalizeStatusInput } from "../../../../dist/core/item/status.js";
9
- import { resolveItemTypeRegistry } from "../../../../dist/core/item/type-registry.js";
10
- import { parseTags } from "../../../../dist/core/item/parse.js";
11
- import { acquireLock } from "../../../../dist/core/lock/lock.js";
12
- import { EXIT_CODE } from "../../../../dist/core/shared/constants.js";
13
- import { PmCliError } from "../../../../dist/core/shared/errors.js";
14
- import { nowIso } from "../../../../dist/core/shared/time.js";
15
- import { listAllFrontMatter, locateItem, readLocatedItem } from "../../../../dist/core/store/item-store.js";
16
- import { getHistoryPath, getItemPath, getSettingsPath, resolvePmRoot } from "../../../../dist/core/store/paths.js";
17
- import { readSettings } from "../../../../dist/core/store/settings.js";
18
- import { CONFIDENCE_TEXT_VALUES, ISSUE_SEVERITY_VALUES, RISK_VALUES } from "../../../../dist/types/index.js";
3
+ import { CONFIDENCE_TEXT_VALUES, EXIT_CODE, ISSUE_SEVERITY_VALUES, PmCliError, RISK_VALUES, acquireLock, appendHistoryEntry, canonicalDocument, createHistoryEntry, generateItemId, getActiveExtensionRegistrations, getHistoryPath, getItemPath, getSettingsPath, listAllFrontMatter, locateItem, normalizeFrontMatter, normalizeItemId, normalizeStatusInput, nowIso, parseTags, pathExists, readLocatedItem, readSettings, removeFileIfExists, resolveItemTypeRegistry, resolvePmRoot, runActiveOnReadHooks, runActiveOnWriteHooks, serializeItemDocument, splitFrontMatter, writeFileAtomic, } from "../../../../dist/sdk/index.js";
19
4
  const DEFAULT_TODOS_FOLDER = ".pm/todos";
20
5
  function isRecord(value) {
21
6
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -467,4 +452,4 @@ export async function runTodosExport(options, global) {
467
452
  ids,
468
453
  warnings,
469
454
  };
470
- }
455
+ }
@@ -1,24 +1,46 @@
1
1
  import fs from "node:fs/promises";
2
2
  import type { Dirent } from "node:fs";
3
3
  import path from "node:path";
4
- import { getActiveExtensionRegistrations, runActiveOnReadHooks, runActiveOnWriteHooks } from "../../../../src/core/extensions/index.js";
5
- import { pathExists, removeFileIfExists, writeFileAtomic } from "../../../../src/core/fs/fs-utils.js";
6
- import { appendHistoryEntry, createHistoryEntry } from "../../../../src/core/history/history.js";
7
- import { generateItemId, normalizeItemId } from "../../../../src/core/item/id.js";
8
- import { canonicalDocument, normalizeFrontMatter, serializeItemDocument, splitFrontMatter } from "../../../../src/core/item/item-format.js";
9
- import { normalizeStatusInput } from "../../../../src/core/item/status.js";
10
- import { resolveItemTypeRegistry } from "../../../../src/core/item/type-registry.js";
11
- import { parseTags } from "../../../../src/core/item/parse.js";
12
- import { acquireLock } from "../../../../src/core/lock/lock.js";
13
- import { EXIT_CODE } from "../../../../src/core/shared/constants.js";
14
- import type { GlobalOptions } from "../../../../src/core/shared/command-types.js";
15
- import { PmCliError } from "../../../../src/core/shared/errors.js";
16
- import { nowIso } from "../../../../src/core/shared/time.js";
17
- import { listAllFrontMatter, locateItem, readLocatedItem } from "../../../../src/core/store/item-store.js";
18
- import { getHistoryPath, getItemPath, getSettingsPath, resolvePmRoot } from "../../../../src/core/store/paths.js";
19
- import { readSettings } from "../../../../src/core/store/settings.js";
20
- import { CONFIDENCE_TEXT_VALUES, ISSUE_SEVERITY_VALUES, RISK_VALUES } from "../../../../src/types/index.js";
21
- import type { ItemDocument, ItemMetadata, ItemStatus, ItemType, PmSettings } from "../../../../src/types/index.js";
4
+ import {
5
+ CONFIDENCE_TEXT_VALUES,
6
+ EXIT_CODE,
7
+ ISSUE_SEVERITY_VALUES,
8
+ PmCliError,
9
+ RISK_VALUES,
10
+ acquireLock,
11
+ appendHistoryEntry,
12
+ canonicalDocument,
13
+ createHistoryEntry,
14
+ generateItemId,
15
+ getActiveExtensionRegistrations,
16
+ getHistoryPath,
17
+ getItemPath,
18
+ getSettingsPath,
19
+ listAllFrontMatter,
20
+ locateItem,
21
+ normalizeFrontMatter,
22
+ normalizeItemId,
23
+ normalizeStatusInput,
24
+ nowIso,
25
+ parseTags,
26
+ pathExists,
27
+ readLocatedItem,
28
+ readSettings,
29
+ removeFileIfExists,
30
+ resolveItemTypeRegistry,
31
+ resolvePmRoot,
32
+ runActiveOnReadHooks,
33
+ runActiveOnWriteHooks,
34
+ serializeItemDocument,
35
+ splitFrontMatter,
36
+ writeFileAtomic,
37
+ type GlobalOptions,
38
+ type ItemDocument,
39
+ type ItemMetadata,
40
+ type ItemStatus,
41
+ type ItemType,
42
+ type PmSettings,
43
+ } from "../../../../src/sdk/index.js";
22
44
 
23
45
  const DEFAULT_TODOS_FOLDER = ".pm/todos";
24
46
 
@@ -4,14 +4,48 @@
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "First-party pm package for Todo markdown import and export.",
7
+ "homepage": "https://github.com/unbraind/pm-cli/tree/main/packages/pm-todos#readme",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/unbraind/pm-cli.git",
11
+ "directory": "packages/pm-todos"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/unbraind/pm-cli/issues"
15
+ },
7
16
  "keywords": [
8
17
  "pm-package",
9
18
  "project-management",
10
19
  "todos"
11
20
  ],
12
21
  "pm": {
22
+ "aliases": [
23
+ "todos"
24
+ ],
13
25
  "extensions": [
14
26
  "extensions/todos"
27
+ ],
28
+ "catalog": {
29
+ "display_name": "Todos Import/Export",
30
+ "category": "migration",
31
+ "summary": "Import and export Todo markdown tasks through pm package commands.",
32
+ "tags": [
33
+ "migration",
34
+ "todos",
35
+ "import",
36
+ "export"
37
+ ],
38
+ "links": {
39
+ "docs": "https://github.com/unbraind/pm-cli/tree/main/packages/pm-todos#readme",
40
+ "repository": "https://github.com/unbraind/pm-cli/tree/main/packages/pm-todos",
41
+ "report": "https://github.com/unbraind/pm-cli/issues"
42
+ }
43
+ },
44
+ "docs": [
45
+ "README.md"
46
+ ],
47
+ "examples": [
48
+ "README.md"
15
49
  ]
16
50
  }
17
51
  }
@@ -39,11 +39,13 @@ async function findRepoServer() {
39
39
 
40
40
  const explicitServer = process.env.PM_CLI_MCP_SERVER;
41
41
  if (explicitServer && (await exists(explicitServer))) {
42
- await import(pathToFileURL(explicitServer).href);
42
+ const server = await import(pathToFileURL(explicitServer).href);
43
+ server.startMcpServer();
43
44
  } else {
44
45
  const repoServer = await findRepoServer();
45
46
  if (repoServer) {
46
- await import(pathToFileURL(repoServer).href);
47
+ const server = await import(pathToFileURL(repoServer).href);
48
+ server.startMcpServer();
47
49
  } else {
48
50
  const child = spawn("npx", ["-y", "--package=@unbrained/pm-cli@latest", "pm-mcp"], {
49
51
  stdio: "inherit",
@@ -33,11 +33,13 @@ async function findRepoServer() {
33
33
 
34
34
  const explicitServer = process.env.PM_CLI_MCP_SERVER;
35
35
  if (explicitServer && await exists(explicitServer)) {
36
- await import(pathToFileURL(explicitServer).href);
36
+ const server = await import(pathToFileURL(explicitServer).href);
37
+ server.startMcpServer();
37
38
  } else {
38
39
  const repoServer = await findRepoServer();
39
40
  if (repoServer) {
40
- await import(pathToFileURL(repoServer).href);
41
+ const server = await import(pathToFileURL(repoServer).href);
42
+ server.startMcpServer();
41
43
  } else {
42
44
  const child = spawn("npx", ["-y", "@unbrained/pm-cli@latest", "pm-mcp"], {
43
45
  stdio: "inherit",