@unbrained/pm-cli 2026.5.11 → 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 (171) hide show
  1. package/AGENTS.md +3 -116
  2. package/CHANGELOG.md +18 -0
  3. package/PRD.md +18 -39
  4. package/README.md +8 -5
  5. package/dist/cli/commander-usage.js +27 -0
  6. package/dist/cli/commander-usage.js.map +1 -1
  7. package/dist/cli/commands/activity.js +19 -4
  8. package/dist/cli/commands/activity.js.map +1 -1
  9. package/dist/cli/commands/calendar.js +5 -2
  10. package/dist/cli/commands/calendar.js.map +1 -1
  11. package/dist/cli/commands/contracts.js +63 -19
  12. package/dist/cli/commands/contracts.js.map +1 -1
  13. package/dist/cli/commands/create.js +58 -3
  14. package/dist/cli/commands/create.js.map +1 -1
  15. package/dist/cli/commands/extension.d.ts +14 -3
  16. package/dist/cli/commands/extension.js +481 -95
  17. package/dist/cli/commands/extension.js.map +1 -1
  18. package/dist/cli/commands/index.d.ts +1 -8
  19. package/dist/cli/commands/index.js +1 -8
  20. package/dist/cli/commands/index.js.map +1 -1
  21. package/dist/cli/commands/reindex.d.ts +8 -0
  22. package/dist/cli/commands/reindex.js +96 -23
  23. package/dist/cli/commands/reindex.js.map +1 -1
  24. package/dist/cli/commands/search.js +51 -25
  25. package/dist/cli/commands/search.js.map +1 -1
  26. package/dist/cli/commands/test.js +14 -6
  27. package/dist/cli/commands/test.js.map +1 -1
  28. package/dist/cli/commands/upgrade.d.ts +63 -0
  29. package/dist/cli/commands/upgrade.js +260 -0
  30. package/dist/cli/commands/upgrade.js.map +1 -0
  31. package/dist/cli/guide-topics.js +18 -16
  32. package/dist/cli/guide-topics.js.map +1 -1
  33. package/dist/cli/help-content.js +57 -18
  34. package/dist/cli/help-content.js.map +1 -1
  35. package/dist/cli/main.js +73 -7
  36. package/dist/cli/main.js.map +1 -1
  37. package/dist/cli/register-list-query.js +24 -142
  38. package/dist/cli/register-list-query.js.map +1 -1
  39. package/dist/cli/register-mutation.js +49 -257
  40. package/dist/cli/register-mutation.js.map +1 -1
  41. package/dist/cli/register-operations.js +29 -198
  42. package/dist/cli/register-operations.js.map +1 -1
  43. package/dist/cli/register-setup.js +181 -204
  44. package/dist/cli/register-setup.js.map +1 -1
  45. package/dist/cli/registration-helpers.d.ts +2 -2
  46. package/dist/cli/registration-helpers.js +1 -19
  47. package/dist/cli/registration-helpers.js.map +1 -1
  48. package/dist/core/extensions/loader.js +7 -1
  49. package/dist/core/extensions/loader.js.map +1 -1
  50. package/dist/core/packages/manifest.d.ts +38 -0
  51. package/dist/core/packages/manifest.js +221 -0
  52. package/dist/core/packages/manifest.js.map +1 -0
  53. package/dist/core/search/embedding-batches.d.ts +13 -1
  54. package/dist/core/search/embedding-batches.js +19 -1
  55. package/dist/core/search/embedding-batches.js.map +1 -1
  56. package/dist/core/store/front-matter-cache.d.ts +8 -1
  57. package/dist/core/store/front-matter-cache.js +20 -11
  58. package/dist/core/store/front-matter-cache.js.map +1 -1
  59. package/dist/mcp/server.d.ts +8 -0
  60. package/dist/mcp/server.js +100 -43
  61. package/dist/mcp/server.js.map +1 -1
  62. package/dist/sdk/cli-contracts/commander-mutation-options.d.ts +7 -0
  63. package/dist/sdk/cli-contracts/commander-mutation-options.js +477 -0
  64. package/dist/sdk/cli-contracts/commander-mutation-options.js.map +1 -0
  65. package/dist/sdk/cli-contracts/commander-types.d.ts +21 -0
  66. package/dist/sdk/cli-contracts/commander-types.js +92 -0
  67. package/dist/sdk/cli-contracts/commander-types.js.map +1 -0
  68. package/dist/sdk/cli-contracts.d.ts +22 -32
  69. package/dist/sdk/cli-contracts.js +155 -296
  70. package/dist/sdk/cli-contracts.js.map +1 -1
  71. package/dist/sdk/index.d.ts +2 -0
  72. package/dist/sdk/index.js +2 -0
  73. package/dist/sdk/index.js.map +1 -1
  74. package/dist/sdk/runtime.d.ts +29 -0
  75. package/dist/sdk/runtime.js +28 -0
  76. package/dist/sdk/runtime.js.map +1 -0
  77. package/docs/ARCHITECTURE.md +1 -1
  78. package/docs/COMMANDS.md +17 -1
  79. package/docs/EXTENSIONS.md +169 -61
  80. package/docs/QUICKSTART.md +11 -2
  81. package/docs/README.md +4 -6
  82. package/docs/RELEASING.md +4 -2
  83. package/docs/SDK.md +79 -438
  84. package/package.json +6 -23
  85. package/packages/pm-beads/README.md +10 -0
  86. package/packages/pm-beads/extensions/beads/index.js +113 -0
  87. package/{.agents/pm/extensions/beads/index.js → packages/pm-beads/extensions/beads/index.ts} +42 -20
  88. package/{.agents/pm → packages/pm-beads}/extensions/beads/runtime.js +2 -17
  89. package/{.agents/pm → packages/pm-beads}/extensions/beads/runtime.ts +41 -18
  90. package/packages/pm-beads/package.json +50 -0
  91. package/packages/pm-calendar/README.md +13 -0
  92. package/packages/pm-calendar/extensions/calendar/index.js +56 -0
  93. package/packages/pm-calendar/extensions/calendar/index.ts +62 -0
  94. package/packages/pm-calendar/extensions/calendar/manifest.json +7 -0
  95. package/packages/pm-calendar/extensions/calendar/runtime.js +95 -0
  96. package/packages/pm-calendar/extensions/calendar/runtime.ts +104 -0
  97. package/packages/pm-calendar/package.json +51 -0
  98. package/packages/pm-governance-audit/README.md +23 -0
  99. package/packages/pm-governance-audit/extensions/governance-audit/index.js +117 -0
  100. package/packages/pm-governance-audit/extensions/governance-audit/index.ts +118 -0
  101. package/packages/pm-governance-audit/extensions/governance-audit/manifest.json +7 -0
  102. package/packages/pm-governance-audit/extensions/governance-audit/runtime.js +159 -0
  103. package/packages/pm-governance-audit/extensions/governance-audit/runtime.ts +176 -0
  104. package/packages/pm-governance-audit/package.json +52 -0
  105. package/packages/pm-guide-shell/README.md +23 -0
  106. package/packages/pm-guide-shell/extensions/guide-shell/index.js +76 -0
  107. package/packages/pm-guide-shell/extensions/guide-shell/index.ts +81 -0
  108. package/packages/pm-guide-shell/extensions/guide-shell/manifest.json +7 -0
  109. package/packages/pm-guide-shell/extensions/guide-shell/runtime.js +263 -0
  110. package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +327 -0
  111. package/packages/pm-guide-shell/package.json +52 -0
  112. package/packages/pm-linked-test-adapters/README.md +24 -0
  113. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/index.js +101 -0
  114. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/index.ts +102 -0
  115. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/manifest.json +7 -0
  116. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/runtime.js +142 -0
  117. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/runtime.ts +173 -0
  118. package/packages/pm-linked-test-adapters/package.json +53 -0
  119. package/packages/pm-search-advanced/README.md +27 -0
  120. package/packages/pm-search-advanced/extensions/search-advanced/index.js +93 -0
  121. package/packages/pm-search-advanced/extensions/search-advanced/index.ts +94 -0
  122. package/packages/pm-search-advanced/extensions/search-advanced/manifest.json +7 -0
  123. package/packages/pm-search-advanced/extensions/search-advanced/runtime.js +120 -0
  124. package/packages/pm-search-advanced/extensions/search-advanced/runtime.ts +144 -0
  125. package/packages/pm-search-advanced/package.json +54 -0
  126. package/packages/pm-templates/README.md +20 -0
  127. package/packages/pm-templates/extensions/templates/index.js +101 -0
  128. package/packages/pm-templates/extensions/templates/index.ts +109 -0
  129. package/packages/pm-templates/extensions/templates/manifest.json +7 -0
  130. package/packages/pm-templates/extensions/templates/runtime.js +226 -0
  131. package/packages/pm-templates/extensions/templates/runtime.ts +283 -0
  132. package/packages/pm-templates/package.json +50 -0
  133. package/packages/pm-todos/README.md +11 -0
  134. package/packages/pm-todos/extensions/todos/index.js +130 -0
  135. package/{.agents/pm/extensions/todos/index.js → packages/pm-todos/extensions/todos/index.ts} +47 -23
  136. package/{.agents/pm → packages/pm-todos}/extensions/todos/runtime.js +3 -18
  137. package/{.agents/pm → packages/pm-todos}/extensions/todos/runtime.ts +42 -20
  138. package/packages/pm-todos/package.json +51 -0
  139. package/plugins/pm-cli-claude/README.md +1 -2
  140. package/plugins/pm-cli-claude/hooks/session-start.mjs +4 -55
  141. package/plugins/pm-cli-claude/scripts/pm-mcp-server.mjs +4 -2
  142. package/plugins/pm-cli-codex/scripts/pm-mcp-server.mjs +4 -2
  143. package/.agents/pm/extensions/.managed-extensions.json +0 -42
  144. package/.agents/skills/HARNESS_COMPATIBILITY.md +0 -45
  145. package/.agents/skills/README.md +0 -21
  146. package/.agents/skills/pm-developer/SKILL.md +0 -73
  147. package/.agents/skills/pm-developer/references/COMMAND_PLAYBOOK.md +0 -48
  148. package/.agents/skills/pm-developer/references/PROMPTS.md +0 -17
  149. package/.agents/skills/pm-extensions/SKILL.md +0 -57
  150. package/.agents/skills/pm-extensions/references/LIFECYCLE.md +0 -40
  151. package/.agents/skills/pm-extensions/references/TROUBLESHOOTING.md +0 -25
  152. package/.agents/skills/pm-sdk/SKILL.md +0 -50
  153. package/.agents/skills/pm-sdk/references/INTEGRATION_CHECKLIST.md +0 -31
  154. package/.agents/skills/pm-sdk/references/PROMPTS.md +0 -13
  155. package/.agents/skills/pm-user/SKILL.md +0 -59
  156. package/.agents/skills/pm-user/references/PROMPTS.md +0 -17
  157. package/.agents/skills/pm-user/references/WORKFLOWS.md +0 -35
  158. package/.pi/README.md +0 -35
  159. package/.pi/agents/pm-triage-agent.md +0 -19
  160. package/.pi/agents/pm-verification-agent.md +0 -21
  161. package/.pi/chains/pm-native-delivery.chain.md +0 -11
  162. package/.pi/extensions/pm-cli/index.js +0 -387
  163. package/.pi/prompts/pm-workflow.md +0 -5
  164. package/.pi/skills/pm-native/SKILL.md +0 -44
  165. package/.pi/skills/pm-release/SKILL.md +0 -35
  166. package/dist/pi/native.d.ts +0 -5
  167. package/dist/pi/native.js +0 -236
  168. package/dist/pi/native.js.map +0 -1
  169. package/docs/PI_PACKAGE.md +0 -141
  170. /package/{.agents/pm → packages/pm-beads}/extensions/beads/manifest.json +0 -0
  171. /package/{.agents/pm → packages/pm-todos}/extensions/todos/manifest.json +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unbrained/pm-cli",
3
- "version": "2026.5.11",
3
+ "version": "2026.5.14",
4
4
  "description": "Git-native project management CLI for humans and agents.",
5
5
  "type": "module",
6
6
  "author": "unbrained",
@@ -48,22 +48,21 @@
48
48
  "docs/**",
49
49
  ".claude-plugin/**",
50
50
  "plugins/**",
51
- ".pi/**",
52
- ".agents/skills/**",
53
- ".agents/pm/extensions/**",
51
+ "packages/pm-*/**",
54
52
  "scripts/install.sh",
55
53
  "scripts/install.ps1",
56
54
  "marketplace.json"
57
55
  ],
58
56
  "scripts": {
59
57
  "build": "tsc -p tsconfig.json",
60
- "typecheck": "tsc --noEmit -p tsconfig.json",
58
+ "typecheck": "tsc --noEmit -p tsconfig.json && tsc -p tsconfig.packages.json",
61
59
  "start": "node dist/cli.js",
62
60
  "dev": "tsx src/cli.ts",
63
61
  "test": "node scripts/run-tests.mjs test",
64
62
  "test:coverage": "node scripts/run-tests.mjs coverage",
65
63
  "quality:static": "node scripts/release/static-quality-gate.mjs",
66
64
  "quality:docs-skills": "node scripts/release/docs-skills-gate.mjs",
65
+ "dogfood:package-first": "node scripts/dogfood-package-first.mjs",
67
66
  "smoke:codex-plugin": "node scripts/smoke-codex-plugin-mcp.mjs",
68
67
  "smoke:claude-plugin": "node scripts/smoke-claude-plugin.mjs",
69
68
  "version:check": "node scripts/release-version.mjs check",
@@ -73,6 +72,7 @@
73
72
  "release:gates": "node scripts/release/run-gates.mjs --telemetry-mode best-effort",
74
73
  "release:pipeline": "node scripts/release/run-release-pipeline.mjs",
75
74
  "release:pipeline:dry-run": "node scripts/release/run-release-pipeline.mjs --dry-run",
75
+ "release:verify-published": "node scripts/release/verify-published-release.mjs",
76
76
  "security:scan": "node scripts/check-secrets.mjs",
77
77
  "smoke:npx": "node scripts/smoke-npx-from-pack.mjs",
78
78
  "sentry:inject": "sentry-cli sourcemaps inject dist/",
@@ -88,36 +88,19 @@
88
88
  "git-native",
89
89
  "typescript",
90
90
  "task-tracker",
91
- "coding-agents",
92
- "pi-package",
93
- "pi-extension"
91
+ "coding-agents"
94
92
  ],
95
93
  "license": "MIT",
96
94
  "publishConfig": {
97
95
  "access": "public"
98
96
  },
99
- "pi": {
100
- "extensions": [
101
- "./.pi/extensions/pm-cli/index.js"
102
- ],
103
- "skills": [
104
- "./.pi/skills"
105
- ],
106
- "prompts": [
107
- "./.pi/prompts"
108
- ]
109
- },
110
97
  "engines": {
111
98
  "node": ">=20"
112
99
  },
113
100
  "peerDependencies": {
114
- "@earendil-works/pi-coding-agent": "*",
115
101
  "typebox": "*"
116
102
  },
117
103
  "peerDependenciesMeta": {
118
- "@earendil-works/pi-coding-agent": {
119
- "optional": true
120
- },
121
104
  "typebox": {
122
105
  "optional": true
123
106
  }
@@ -0,0 +1,10 @@
1
+ # pm Beads Package
2
+
3
+ First-party pm package for importing Beads JSONL records.
4
+
5
+ ```bash
6
+ pm install ./packages/pm-beads --project
7
+ pm beads import --file .beads/issues.jsonl
8
+ ```
9
+
10
+ The package exposes the `beads import` extension command through the `pm.extensions` package manifest. Runtime sources are authored in TypeScript and shipped with JavaScript entry artifacts for Node extension loading.
@@ -0,0 +1,113 @@
1
+ import path from "node:path";
2
+ import { fileURLToPath, pathToFileURL } from "node:url";
3
+ const PM_PACKAGE_ROOT_ENV = "PM_CLI_PACKAGE_ROOT";
4
+ const CURRENT_EXTENSION_ROOT = path.dirname(fileURLToPath(import.meta.url));
5
+ export const manifest = {
6
+ name: "builtin-beads-import",
7
+ version: "0.1.0",
8
+ entry: "./index.js",
9
+ priority: 0,
10
+ capabilities: ["commands", "schema"],
11
+ };
12
+ function asOptionalString(value) {
13
+ return typeof value === "string" ? value : undefined;
14
+ }
15
+ function asBoolean(value) {
16
+ return typeof value === "boolean" ? value : undefined;
17
+ }
18
+ function toBeadsImportOptions(options) {
19
+ return {
20
+ file: asOptionalString(options.file),
21
+ author: asOptionalString(options.author),
22
+ message: asOptionalString(options.message),
23
+ preserveSourceIds: asBoolean(options.preserveSourceIds),
24
+ };
25
+ }
26
+ function resolvePackageRootCandidates() {
27
+ const candidates = [];
28
+ const envRoot = process.env[PM_PACKAGE_ROOT_ENV];
29
+ if (typeof envRoot === "string" && envRoot.trim().length > 0) {
30
+ candidates.push(path.resolve(envRoot.trim()));
31
+ }
32
+ const argvEntry = typeof process.argv[1] === "string" ? process.argv[1].trim() : "";
33
+ if (argvEntry.length > 0) {
34
+ const resolvedEntry = path.resolve(argvEntry);
35
+ const entryDir = path.dirname(resolvedEntry);
36
+ candidates.push(path.resolve(entryDir, ".."));
37
+ candidates.push(path.resolve(entryDir, "../.."));
38
+ candidates.push(path.resolve(entryDir, "../../.."));
39
+ }
40
+ return [...new Set(candidates)];
41
+ }
42
+ async function loadRuntimeModule() {
43
+ const attempted = [];
44
+ for (const packageRoot of resolvePackageRootCandidates()) {
45
+ const modulePaths = [
46
+ path.join(packageRoot, ".agents", "pm", "extensions", "beads", "runtime.js"),
47
+ path.join(packageRoot, "packages", "pm-beads", "extensions", "beads", "runtime.js"),
48
+ ];
49
+ for (const modulePath of modulePaths) {
50
+ attempted.push(modulePath);
51
+ try {
52
+ return await import(pathToFileURL(modulePath).href);
53
+ }
54
+ catch {
55
+ // Try the next package-root candidate.
56
+ }
57
+ }
58
+ }
59
+ const localRuntimePath = path.join(CURRENT_EXTENSION_ROOT, "runtime.js");
60
+ attempted.push(localRuntimePath);
61
+ try {
62
+ return await import(pathToFileURL(localRuntimePath).href);
63
+ }
64
+ catch {
65
+ // Fall through to the diagnostic below.
66
+ }
67
+ throw new Error("Unable to resolve packaged beads extension runtime module. " +
68
+ `Tried: ${attempted.join(", ")}. Ensure the installed extension includes runtime.js or PM_CLI_PACKAGE_ROOT points to an installed pm package root.`);
69
+ }
70
+ async function runBeadsImportFromRuntime(options, global) {
71
+ const runtime = await loadRuntimeModule();
72
+ if (typeof runtime.runBeadsImport !== "function") {
73
+ throw new Error("Bundled beads runtime module is missing runBeadsImport().");
74
+ }
75
+ return runtime.runBeadsImport(options, global);
76
+ }
77
+ export function activate(api) {
78
+ api.registerCommand({
79
+ name: "beads import",
80
+ action: "beads-import",
81
+ description: "Import Beads JSONL records into pm items.",
82
+ flags: [
83
+ {
84
+ long: "--file",
85
+ value_name: "path",
86
+ value_type: "string",
87
+ description: "Path to the Beads JSONL source file.",
88
+ },
89
+ {
90
+ long: "--author",
91
+ value_name: "author",
92
+ value_type: "string",
93
+ description: "Override import mutation author.",
94
+ },
95
+ {
96
+ long: "--message",
97
+ value_name: "text",
98
+ value_type: "string",
99
+ description: "Override import history message.",
100
+ },
101
+ {
102
+ long: "--preserve-source-ids",
103
+ value_type: "boolean",
104
+ description: "Preserve source IDs from Beads payload records when possible.",
105
+ },
106
+ ],
107
+ run: async (context) => runBeadsImportFromRuntime(toBeadsImportOptions(context.options), context.global),
108
+ });
109
+ }
110
+ export default {
111
+ manifest,
112
+ activate,
113
+ };
@@ -1,7 +1,10 @@
1
1
  import path from "node:path";
2
- import { pathToFileURL } from "node:url";
2
+ import { fileURLToPath, pathToFileURL } from "node:url";
3
+ import type { CommandDefinition, ExtensionApi, GlobalOptions } from "../../../../src/sdk/index.js";
4
+ import type { BeadsImportOptions, BeadsImportResult } from "./runtime.js";
3
5
 
4
6
  const PM_PACKAGE_ROOT_ENV = "PM_CLI_PACKAGE_ROOT";
7
+ const CURRENT_EXTENSION_ROOT = path.dirname(fileURLToPath(import.meta.url));
5
8
 
6
9
  export const manifest = {
7
10
  name: "builtin-beads-import",
@@ -11,15 +14,19 @@ export const manifest = {
11
14
  capabilities: ["commands", "schema"],
12
15
  };
13
16
 
14
- function asOptionalString(value) {
17
+ type RuntimeModule = {
18
+ runBeadsImport?: (options: BeadsImportOptions, global: GlobalOptions) => Promise<BeadsImportResult>;
19
+ };
20
+
21
+ function asOptionalString(value: unknown): string | undefined {
15
22
  return typeof value === "string" ? value : undefined;
16
23
  }
17
24
 
18
- function asBoolean(value) {
25
+ function asBoolean(value: unknown): boolean | undefined {
19
26
  return typeof value === "boolean" ? value : undefined;
20
27
  }
21
28
 
22
- function toBeadsImportOptions(options) {
29
+ function toBeadsImportOptions(options: Record<string, unknown>): BeadsImportOptions {
23
30
  return {
24
31
  file: asOptionalString(options.file),
25
32
  author: asOptionalString(options.author),
@@ -28,8 +35,8 @@ function toBeadsImportOptions(options) {
28
35
  };
29
36
  }
30
37
 
31
- function resolvePackageRootCandidates() {
32
- const candidates = [];
38
+ function resolvePackageRootCandidates(): string[] {
39
+ const candidates: string[] = [];
33
40
  const envRoot = process.env[PM_PACKAGE_ROOT_ENV];
34
41
  if (typeof envRoot === "string" && envRoot.trim().length > 0) {
35
42
  candidates.push(path.resolve(envRoot.trim()));
@@ -45,34 +52,49 @@ function resolvePackageRootCandidates() {
45
52
  return [...new Set(candidates)];
46
53
  }
47
54
 
48
- async function loadRuntimeModule() {
49
- const attempted = [];
55
+ async function loadRuntimeModule(): Promise<RuntimeModule> {
56
+ const attempted: string[] = [];
50
57
  for (const packageRoot of resolvePackageRootCandidates()) {
51
- const modulePath = path.join(packageRoot, ".agents", "pm", "extensions", "beads", "runtime.js");
52
- attempted.push(modulePath);
53
- try {
54
- return await import(pathToFileURL(modulePath).href);
55
- } catch {
56
- // Try the next package-root candidate.
58
+ const modulePaths = [
59
+ path.join(packageRoot, ".agents", "pm", "extensions", "beads", "runtime.js"),
60
+ path.join(packageRoot, "packages", "pm-beads", "extensions", "beads", "runtime.js"),
61
+ ];
62
+ for (const modulePath of modulePaths) {
63
+ attempted.push(modulePath);
64
+ try {
65
+ return await import(pathToFileURL(modulePath).href) as RuntimeModule;
66
+ } catch {
67
+ // Try the next package-root candidate.
68
+ }
57
69
  }
58
70
  }
71
+
72
+ const localRuntimePath = path.join(CURRENT_EXTENSION_ROOT, "runtime.js");
73
+ attempted.push(localRuntimePath);
74
+ try {
75
+ return await import(pathToFileURL(localRuntimePath).href) as RuntimeModule;
76
+ } catch {
77
+ // Fall through to the diagnostic below.
78
+ }
79
+
59
80
  throw new Error(
60
- "Unable to resolve bundled beads extension runtime module. " +
61
- `Tried: ${attempted.join(", ")}. Ensure PM_CLI_PACKAGE_ROOT points to an installed pm package root.`,
81
+ "Unable to resolve packaged beads extension runtime module. " +
82
+ `Tried: ${attempted.join(", ")}. Ensure the installed extension includes runtime.js or PM_CLI_PACKAGE_ROOT points to an installed pm package root.`,
62
83
  );
63
84
  }
64
85
 
65
- async function runBeadsImportFromRuntime(options, global) {
86
+ async function runBeadsImportFromRuntime(options: BeadsImportOptions, global: GlobalOptions): Promise<BeadsImportResult> {
66
87
  const runtime = await loadRuntimeModule();
67
88
  if (typeof runtime.runBeadsImport !== "function") {
68
- throw new Error('Bundled beads runtime module is missing runBeadsImport().');
89
+ throw new Error("Bundled beads runtime module is missing runBeadsImport().");
69
90
  }
70
91
  return runtime.runBeadsImport(options, global);
71
92
  }
72
93
 
73
- export function activate(api) {
94
+ export function activate(api: ExtensionApi): void {
74
95
  api.registerCommand({
75
96
  name: "beads import",
97
+ action: "beads-import",
76
98
  description: "Import Beads JSONL records into pm items.",
77
99
  flags: [
78
100
  {
@@ -100,7 +122,7 @@ export function activate(api) {
100
122
  },
101
123
  ],
102
124
  run: async (context) => runBeadsImportFromRuntime(toBeadsImportOptions(context.options), context.global),
103
- });
125
+ } satisfies CommandDefinition);
104
126
  }
105
127
 
106
128
  export default {
@@ -1,21 +1,6 @@
1
1
  import fs from "node:fs/promises";
2
2
  import path from "node:path";
3
- import { pathExists, removeFileIfExists, writeFileAtomic } from "../../../../dist/core/fs/fs-utils.js";
4
- import { getActiveExtensionRegistrations, runActiveOnReadHooks, runActiveOnWriteHooks } from "../../../../dist/core/extensions/index.js";
5
- import { appendHistoryEntry, createHistoryEntry } from "../../../../dist/core/history/history.js";
6
- import { generateItemId, normalizeItemId, normalizeRawItemId } from "../../../../dist/core/item/id.js";
7
- import { canonicalDocument, normalizeFrontMatter, serializeItemDocument } 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 { isTimestampLiteral, nowIso } from "../../../../dist/core/shared/time.js";
15
- import { locateItem } 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 { DEPENDENCY_KIND_VALUES } from "../../../../dist/types/index.js";
3
+ import { DEPENDENCY_KIND_VALUES, EXIT_CODE, PmCliError, acquireLock, appendHistoryEntry, canonicalDocument, createHistoryEntry, generateItemId, getActiveExtensionRegistrations, getHistoryPath, getItemPath, getSettingsPath, isTimestampLiteral, locateItem, normalizeFrontMatter, normalizeItemId, normalizeRawItemId, normalizeStatusInput, nowIso, parseTags, pathExists, readSettings, removeFileIfExists, resolveItemTypeRegistry, resolvePmRoot, runActiveOnReadHooks, runActiveOnWriteHooks, serializeItemDocument, writeFileAtomic, } from "../../../../dist/sdk/index.js";
19
4
  const PRIMARY_AUTO_DISCOVERY_FILES = [
20
5
  ".beads/issues.jsonl",
21
6
  "issues.jsonl",
@@ -583,4 +568,4 @@ export async function runBeadsImport(options, global) {
583
568
  ids,
584
569
  warnings,
585
570
  };
586
- }
571
+ }
@@ -1,23 +1,46 @@
1
1
  import fs from "node:fs/promises";
2
2
  import path from "node:path";
3
- import { pathExists, removeFileIfExists, writeFileAtomic } from "../../../../src/core/fs/fs-utils.js";
4
- import { getActiveExtensionRegistrations, runActiveOnReadHooks, runActiveOnWriteHooks } from "../../../../src/core/extensions/index.js";
5
- import { appendHistoryEntry, createHistoryEntry } from "../../../../src/core/history/history.js";
6
- import { generateItemId, normalizeItemId, normalizeRawItemId } from "../../../../src/core/item/id.js";
7
- import { canonicalDocument, normalizeFrontMatter, serializeItemDocument } from "../../../../src/core/item/item-format.js";
8
- import { normalizeStatusInput } from "../../../../src/core/item/status.js";
9
- import { resolveItemTypeRegistry } from "../../../../src/core/item/type-registry.js";
10
- import { parseTags } from "../../../../src/core/item/parse.js";
11
- import { acquireLock } from "../../../../src/core/lock/lock.js";
12
- import { EXIT_CODE } from "../../../../src/core/shared/constants.js";
13
- import type { GlobalOptions } from "../../../../src/core/shared/command-types.js";
14
- import { PmCliError } from "../../../../src/core/shared/errors.js";
15
- import { isTimestampLiteral, nowIso } from "../../../../src/core/shared/time.js";
16
- import { locateItem } from "../../../../src/core/store/item-store.js";
17
- import { getHistoryPath, getItemPath, getSettingsPath, resolvePmRoot } from "../../../../src/core/store/paths.js";
18
- import { readSettings } from "../../../../src/core/store/settings.js";
19
- import type { Dependency, ItemDocument, ItemMetadata, ItemStatus, ItemType, LogNote, LinkedFile, LinkedTest, LinkedDoc } from "../../../../src/types/index.js";
20
- import { DEPENDENCY_KIND_VALUES } from "../../../../src/types/index.js";
3
+ import {
4
+ DEPENDENCY_KIND_VALUES,
5
+ EXIT_CODE,
6
+ PmCliError,
7
+ acquireLock,
8
+ appendHistoryEntry,
9
+ canonicalDocument,
10
+ createHistoryEntry,
11
+ generateItemId,
12
+ getActiveExtensionRegistrations,
13
+ getHistoryPath,
14
+ getItemPath,
15
+ getSettingsPath,
16
+ isTimestampLiteral,
17
+ locateItem,
18
+ normalizeFrontMatter,
19
+ normalizeItemId,
20
+ normalizeRawItemId,
21
+ normalizeStatusInput,
22
+ nowIso,
23
+ parseTags,
24
+ pathExists,
25
+ readSettings,
26
+ removeFileIfExists,
27
+ resolveItemTypeRegistry,
28
+ resolvePmRoot,
29
+ runActiveOnReadHooks,
30
+ runActiveOnWriteHooks,
31
+ serializeItemDocument,
32
+ writeFileAtomic,
33
+ type Dependency,
34
+ type GlobalOptions,
35
+ type ItemDocument,
36
+ type ItemMetadata,
37
+ type ItemStatus,
38
+ type ItemType,
39
+ type LinkedDoc,
40
+ type LinkedFile,
41
+ type LinkedTest,
42
+ type LogNote,
43
+ } from "../../../../src/sdk/index.js";
21
44
 
22
45
  const PRIMARY_AUTO_DISCOVERY_FILES = [
23
46
  ".beads/issues.jsonl",
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@unbrained/pm-package-beads",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "description": "First-party pm package for importing Beads JSONL records.",
7
+ "homepage": "https://github.com/unbraind/pm-cli/tree/main/packages/pm-beads#readme",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/unbraind/pm-cli.git",
11
+ "directory": "packages/pm-beads"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/unbraind/pm-cli/issues"
15
+ },
16
+ "keywords": [
17
+ "pm-package",
18
+ "project-management",
19
+ "beads"
20
+ ],
21
+ "pm": {
22
+ "aliases": [
23
+ "beads"
24
+ ],
25
+ "extensions": [
26
+ "extensions/beads"
27
+ ],
28
+ "catalog": {
29
+ "display_name": "Beads Import",
30
+ "category": "migration",
31
+ "summary": "Import Beads JSONL records into pm while preserving source IDs.",
32
+ "tags": [
33
+ "migration",
34
+ "beads",
35
+ "import"
36
+ ],
37
+ "links": {
38
+ "docs": "https://github.com/unbraind/pm-cli/tree/main/packages/pm-beads#readme",
39
+ "repository": "https://github.com/unbraind/pm-cli/tree/main/packages/pm-beads",
40
+ "report": "https://github.com/unbraind/pm-cli/issues"
41
+ }
42
+ },
43
+ "docs": [
44
+ "README.md"
45
+ ],
46
+ "examples": [
47
+ "README.md"
48
+ ]
49
+ }
50
+ }
@@ -0,0 +1,13 @@
1
+ # pm Calendar Package
2
+
3
+ `@unbrained/pm-package-calendar` provides agenda and calendar views as an installable pm package.
4
+
5
+ ```bash
6
+ pm install calendar
7
+ pm calendar --view week --full-period
8
+ pm cal --json --view agenda --include reminders,events
9
+ ```
10
+
11
+ The package owns presentation commands for deadline, reminder, and scheduled event views. Core pm still owns item metadata such as `deadline`, `reminders`, and `events`, plus create/update parsing for those fields.
12
+
13
+ Runtime sources are authored in TypeScript and use only the public `@unbrained/pm-cli/sdk` surface.
@@ -0,0 +1,56 @@
1
+ import { renderCalendarPackageOutput, runCalendarPackage } from "./runtime.js";
2
+
3
+ export const manifest = {
4
+ name: "builtin-calendar",
5
+ version: "0.1.0",
6
+ entry: "./index.js",
7
+ priority: 0,
8
+ capabilities: ["commands", "schema", "services"],
9
+ };
10
+
11
+ const calendarFlags = [
12
+ { long: "--view", value_name: "value", value_type: "string", description: "Calendar view: agenda|day|week|month." },
13
+ { long: "--date", value_name: "value", value_type: "string", description: "Anchor date/time for view calculations." },
14
+ { long: "--from", value_name: "value", value_type: "string", description: "Agenda lower bound." },
15
+ { long: "--to", value_name: "value", value_type: "string", description: "Agenda upper bound." },
16
+ { long: "--past", value_type: "boolean", description: "Include past entries." },
17
+ { long: "--full-period", value_type: "boolean", description: "Include the full anchored day/week/month period." },
18
+ { long: "--type", value_name: "value", value_type: "string", description: "Filter by item type." },
19
+ { long: "--tag", value_name: "value", value_type: "string", description: "Filter by tag." },
20
+ { long: "--priority", value_name: "value", value_type: "string", description: "Filter by priority." },
21
+ { long: "--status", value_name: "value", value_type: "string", description: "Filter by status." },
22
+ { long: "--assignee", value_name: "value", value_type: "string", description: "Filter by assignee." },
23
+ { long: "--assignee-filter", value_name: "value", value_type: "string", description: "Filter assignee presence." },
24
+ { long: "--sprint", value_name: "value", value_type: "string", description: "Filter by sprint." },
25
+ { long: "--release", value_name: "value", value_type: "string", description: "Filter by release." },
26
+ { long: "--include", value_name: "value", value_type: "string", description: "Include sources: deadlines|reminders|events|all." },
27
+ { long: "--recurrence-lookahead-days", value_name: "n", value_type: "string", description: "Bound open-ended recurrence lookahead days." },
28
+ { long: "--recurrence-lookback-days", value_name: "n", value_type: "string", description: "Bound open-ended recurrence lookback days." },
29
+ { long: "--occurrence-limit", value_name: "n", value_type: "string", description: "Cap generated occurrences per recurring event." },
30
+ { long: "--limit", value_name: "n", value_type: "string", description: "Limit returned event count." },
31
+ { long: "--format", value_name: "value", value_type: "string", description: "Calendar output override: markdown|toon|json." },
32
+ ];
33
+
34
+ function calendarCommand(name) {
35
+ return {
36
+ name,
37
+ action: "calendar",
38
+ description: "Show deadline, reminder, and scheduled event calendar views.",
39
+ flags: [...calendarFlags],
40
+ run: async (context) => runCalendarPackage(context.options, context.global),
41
+ };
42
+ }
43
+
44
+ export function activate(api) {
45
+ api.registerCommand(calendarCommand("calendar"));
46
+ api.registerCommand(calendarCommand("cal"));
47
+ api.registerService("output_format", (context) => {
48
+ const rendered = renderCalendarPackageOutput(context);
49
+ return rendered ?? context.payload;
50
+ });
51
+ }
52
+
53
+ export default {
54
+ manifest,
55
+ activate,
56
+ };
@@ -0,0 +1,62 @@
1
+ import type {
2
+ CommandDefinition,
3
+ ExtensionApi,
4
+ ServiceOverrideContext,
5
+ } from "../../../../src/sdk/index.js";
6
+ import type { CalendarOptions } from "../../../../src/sdk/runtime.js";
7
+ import { renderCalendarPackageOutput, runCalendarPackage } from "./runtime.js";
8
+
9
+ export const manifest = {
10
+ name: "builtin-calendar",
11
+ version: "0.1.0",
12
+ entry: "./index.js",
13
+ priority: 0,
14
+ capabilities: ["commands", "schema", "services"],
15
+ };
16
+
17
+ const calendarFlags = [
18
+ { long: "--view", value_name: "value", value_type: "string", description: "Calendar view: agenda|day|week|month." },
19
+ { long: "--date", value_name: "value", value_type: "string", description: "Anchor date/time for view calculations." },
20
+ { long: "--from", value_name: "value", value_type: "string", description: "Agenda lower bound." },
21
+ { long: "--to", value_name: "value", value_type: "string", description: "Agenda upper bound." },
22
+ { long: "--past", value_type: "boolean", description: "Include past entries." },
23
+ { long: "--full-period", value_type: "boolean", description: "Include the full anchored day/week/month period." },
24
+ { long: "--type", value_name: "value", value_type: "string", description: "Filter by item type." },
25
+ { long: "--tag", value_name: "value", value_type: "string", description: "Filter by tag." },
26
+ { long: "--priority", value_name: "value", value_type: "string", description: "Filter by priority." },
27
+ { long: "--status", value_name: "value", value_type: "string", description: "Filter by status." },
28
+ { long: "--assignee", value_name: "value", value_type: "string", description: "Filter by assignee." },
29
+ { long: "--assignee-filter", value_name: "value", value_type: "string", description: "Filter assignee presence." },
30
+ { long: "--sprint", value_name: "value", value_type: "string", description: "Filter by sprint." },
31
+ { long: "--release", value_name: "value", value_type: "string", description: "Filter by release." },
32
+ { long: "--include", value_name: "value", value_type: "string", description: "Include sources: deadlines|reminders|events|all." },
33
+ { long: "--recurrence-lookahead-days", value_name: "n", value_type: "string", description: "Bound open-ended recurrence lookahead days." },
34
+ { long: "--recurrence-lookback-days", value_name: "n", value_type: "string", description: "Bound open-ended recurrence lookback days." },
35
+ { long: "--occurrence-limit", value_name: "n", value_type: "string", description: "Cap generated occurrences per recurring event." },
36
+ { long: "--limit", value_name: "n", value_type: "string", description: "Limit returned event count." },
37
+ { long: "--format", value_name: "value", value_type: "string", description: "Calendar output override: markdown|toon|json." },
38
+ ] as const;
39
+
40
+ function calendarCommand(name: "calendar" | "cal"): CommandDefinition {
41
+ return {
42
+ name,
43
+ action: "calendar",
44
+ description: "Show deadline, reminder, and scheduled event calendar views.",
45
+ flags: [...calendarFlags],
46
+ run: async (context) => runCalendarPackage(context.options as CalendarOptions, context.global),
47
+ };
48
+ }
49
+
50
+ export function activate(api: ExtensionApi): void {
51
+ api.registerCommand(calendarCommand("calendar"));
52
+ api.registerCommand(calendarCommand("cal"));
53
+ api.registerService("output_format", (context) => {
54
+ const rendered = renderCalendarPackageOutput(context as ServiceOverrideContext);
55
+ return rendered ?? context.payload;
56
+ });
57
+ }
58
+
59
+ export default {
60
+ manifest,
61
+ activate,
62
+ };
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "builtin-calendar",
3
+ "version": "0.1.0",
4
+ "entry": "./index.js",
5
+ "priority": 0,
6
+ "capabilities": ["commands", "schema", "services"]
7
+ }