@unbrained/pm-cli 2026.5.6 → 2026.5.11
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.
- package/.agents/pm/extensions/.managed-extensions.json +2 -2
- package/.agents/pm/extensions/beads/runtime.js +4 -4
- package/.agents/pm/extensions/beads/runtime.ts +5 -5
- package/.agents/pm/extensions/todos/runtime.js +7 -7
- package/.agents/pm/extensions/todos/runtime.ts +10 -10
- package/.agents/skills/HARNESS_COMPATIBILITY.md +45 -0
- package/.agents/skills/README.md +21 -0
- package/.agents/skills/pm-developer/SKILL.md +73 -0
- package/.agents/skills/pm-developer/references/COMMAND_PLAYBOOK.md +48 -0
- package/.agents/skills/pm-developer/references/PROMPTS.md +17 -0
- package/.agents/skills/pm-extensions/SKILL.md +57 -0
- package/.agents/skills/pm-extensions/references/LIFECYCLE.md +40 -0
- package/.agents/skills/pm-extensions/references/TROUBLESHOOTING.md +25 -0
- package/.agents/skills/pm-sdk/SKILL.md +50 -0
- package/.agents/skills/pm-sdk/references/INTEGRATION_CHECKLIST.md +31 -0
- package/.agents/skills/pm-sdk/references/PROMPTS.md +13 -0
- package/.agents/skills/pm-user/SKILL.md +59 -0
- package/.agents/skills/pm-user/references/PROMPTS.md +17 -0
- package/.agents/skills/pm-user/references/WORKFLOWS.md +35 -0
- package/.claude-plugin/marketplace.json +38 -0
- package/.pi/README.md +35 -0
- package/.pi/agents/pm-triage-agent.md +19 -0
- package/.pi/agents/pm-verification-agent.md +21 -0
- package/.pi/chains/pm-native-delivery.chain.md +11 -0
- package/.pi/extensions/pm-cli/index.js +387 -0
- package/.pi/prompts/pm-workflow.md +5 -0
- package/.pi/skills/pm-native/SKILL.md +44 -0
- package/.pi/skills/pm-release/SKILL.md +35 -0
- package/AGENTS.md +1 -1
- package/CHANGELOG.md +13 -0
- package/PRD.md +16 -16
- package/README.md +30 -4
- package/dist/cli/argv-utils.d.ts +5 -0
- package/dist/cli/argv-utils.js +34 -0
- package/dist/cli/argv-utils.js.map +1 -0
- package/dist/cli/bootstrap-args.d.ts +15 -0
- package/dist/cli/bootstrap-args.js +211 -0
- package/dist/cli/bootstrap-args.js.map +1 -1
- package/dist/cli/commander-usage.js +109 -3
- package/dist/cli/commander-usage.js.map +1 -1
- package/dist/cli/commands/claim.js +6 -6
- package/dist/cli/commands/claim.js.map +1 -1
- package/dist/cli/commands/close.js +9 -9
- package/dist/cli/commands/close.js.map +1 -1
- package/dist/cli/commands/comments.d.ts +2 -0
- package/dist/cli/commands/comments.js +57 -8
- package/dist/cli/commands/comments.js.map +1 -1
- package/dist/cli/commands/completion.js +40 -7
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/config.js +6 -3
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/contracts.d.ts +19 -0
- package/dist/cli/commands/contracts.js +36 -1
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/create.d.ts +2 -2
- package/dist/cli/commands/create.js +116 -55
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/docs.js +13 -6
- package/dist/cli/commands/docs.js.map +1 -1
- package/dist/cli/commands/extension.d.ts +3 -1
- package/dist/cli/commands/extension.js +174 -2
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/files.js +19 -12
- package/dist/cli/commands/files.js.map +1 -1
- package/dist/cli/commands/get.js +5 -5
- package/dist/cli/commands/get.js.map +1 -1
- package/dist/cli/commands/guide.d.ts +55 -0
- package/dist/cli/commands/guide.js +260 -0
- package/dist/cli/commands/guide.js.map +1 -0
- package/dist/cli/commands/health.js +1 -1
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history.js +30 -10
- package/dist/cli/commands/history.js.map +1 -1
- package/dist/cli/commands/index.d.ts +1 -0
- package/dist/cli/commands/index.js +1 -0
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.d.ts +2 -0
- package/dist/cli/commands/init.js +21 -1
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/learnings.js +3 -3
- package/dist/cli/commands/learnings.js.map +1 -1
- package/dist/cli/commands/metadata-normalizers.d.ts +4 -0
- package/dist/cli/commands/metadata-normalizers.js +37 -0
- package/dist/cli/commands/metadata-normalizers.js.map +1 -0
- package/dist/cli/commands/notes.js +3 -3
- package/dist/cli/commands/notes.js.map +1 -1
- package/dist/cli/commands/reindex.js +180 -156
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/restore.d.ts +2 -2
- package/dist/cli/commands/restore.js +44 -24
- package/dist/cli/commands/restore.js.map +1 -1
- package/dist/cli/commands/search.d.ts +2 -0
- package/dist/cli/commands/search.js +45 -26
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/test-all.d.ts +2 -0
- package/dist/cli/commands/test-all.js +2 -0
- package/dist/cli/commands/test-all.js.map +1 -1
- package/dist/cli/commands/test.d.ts +1 -0
- package/dist/cli/commands/test.js +13 -5
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/update.js +188 -157
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/validate.js +1 -1
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/error-guidance.d.ts +9 -1
- package/dist/cli/error-guidance.js +147 -6
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/guide-topics.d.ts +25 -0
- package/dist/cli/guide-topics.js +283 -0
- package/dist/cli/guide-topics.js.map +1 -0
- package/dist/cli/help-content.js +25 -1
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/help-json-payload.js +11 -1
- package/dist/cli/help-json-payload.js.map +1 -1
- package/dist/cli/main.js +69 -6
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.js +38 -1
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +17 -4
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-setup.js +15 -1
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/telemetry-flush.d.ts +2 -0
- package/dist/cli/telemetry-flush.js +4 -0
- package/dist/cli/telemetry-flush.js.map +1 -0
- package/dist/cli.js +1 -2
- package/dist/cli.js.map +1 -1
- package/dist/core/extensions/extension-types.d.ts +72 -0
- package/dist/core/extensions/extension-types.js +24 -0
- package/dist/core/extensions/extension-types.js.map +1 -1
- package/dist/core/extensions/loader.d.ts +1 -0
- package/dist/core/extensions/loader.js +766 -7
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/history/history.js +32 -11
- package/dist/core/history/history.js.map +1 -1
- package/dist/core/item/item-format.d.ts +2 -2
- package/dist/core/item/item-format.js +16 -16
- package/dist/core/item/item-format.js.map +1 -1
- package/dist/core/lock/lock.js +2 -0
- package/dist/core/lock/lock.js.map +1 -1
- package/dist/core/schema/runtime-field-filters.js +1 -1
- package/dist/core/schema/runtime-field-filters.js.map +1 -1
- package/dist/core/schema/runtime-field-values.js +2 -2
- package/dist/core/schema/runtime-field-values.js.map +1 -1
- package/dist/core/schema/runtime-schema.d.ts +1 -1
- package/dist/core/schema/runtime-schema.js +3 -3
- package/dist/core/schema/runtime-schema.js.map +1 -1
- package/dist/core/search/cache.js +7 -21
- package/dist/core/search/cache.js.map +1 -1
- package/dist/core/search/corpus.d.ts +13 -0
- package/dist/core/search/corpus.js +74 -0
- package/dist/core/search/corpus.js.map +1 -0
- package/dist/core/search/embedding-batches.js +90 -30
- package/dist/core/search/embedding-batches.js.map +1 -1
- package/dist/core/sentry/instrument.d.ts +18 -1
- package/dist/core/sentry/instrument.js +128 -12
- package/dist/core/sentry/instrument.js.map +1 -1
- package/dist/core/shared/constants.d.ts +1 -1
- package/dist/core/shared/constants.js +21 -1
- package/dist/core/shared/constants.js.map +1 -1
- package/dist/core/shared/errors.d.ts +8 -0
- package/dist/core/shared/errors.js.map +1 -1
- package/dist/core/shared/levenshtein.d.ts +1 -0
- package/dist/core/shared/levenshtein.js +37 -0
- package/dist/core/shared/levenshtein.js.map +1 -0
- package/dist/core/store/front-matter-cache.d.ts +1 -1
- package/dist/core/store/front-matter-cache.js +13 -13
- package/dist/core/store/front-matter-cache.js.map +1 -1
- package/dist/core/store/item-format-migration.js +5 -2
- package/dist/core/store/item-format-migration.js.map +1 -1
- package/dist/core/store/item-store.js +16 -15
- package/dist/core/store/item-store.js.map +1 -1
- package/dist/core/store/paths.js +35 -2
- package/dist/core/store/paths.js.map +1 -1
- package/dist/core/store/settings.js +216 -2
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/telemetry/runtime.d.ts +1 -0
- package/dist/core/telemetry/runtime.js +102 -3
- package/dist/core/telemetry/runtime.js.map +1 -1
- package/dist/core/test/item-test-run-tracking.js +2 -2
- package/dist/core/test/item-test-run-tracking.js.map +1 -1
- package/dist/mcp/server.d.ts +2 -0
- package/dist/mcp/server.js +407 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/pi/native.d.ts +5 -0
- package/dist/pi/native.js +236 -0
- package/dist/pi/native.js.map +1 -0
- package/dist/sdk/cli-contracts.d.ts +24 -2
- package/dist/sdk/cli-contracts.js +317 -2
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/sdk/index.d.ts +12 -1
- package/dist/sdk/index.js +8 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/types.d.ts +51 -2
- package/dist/types.js.map +1 -1
- package/docs/AGENT_GUIDE.md +15 -0
- package/docs/ARCHITECTURE.md +2 -2
- package/docs/CLAUDE_CODE_PLUGIN.md +225 -0
- package/docs/CODEX_PLUGIN.md +33 -0
- package/docs/COMMANDS.md +6 -2
- package/docs/CONFIGURATION.md +2 -8
- package/docs/EXTENSIONS.md +688 -0
- package/docs/MIGRATION_CLI_SIMPLIFICATION.md +64 -0
- package/docs/PI_PACKAGE.md +141 -0
- package/docs/QUICKSTART.md +1 -0
- package/docs/README.md +30 -1
- package/docs/RELEASING.md +4 -2
- package/docs/SDK.md +444 -2
- package/docs/examples/ci/github-actions-pm-extension-gate.yml +53 -0
- package/docs/examples/ci/gitlab-ci-pm-extension-gate.yml +41 -0
- package/docs/examples/ci/jenkins-pm-extension-gate.Jenkinsfile +45 -0
- package/docs/examples/policy-restricted-extension/README.md +74 -0
- package/docs/examples/policy-restricted-extension/index.js +21 -0
- package/docs/examples/policy-restricted-extension/manifest.json +21 -0
- package/docs/examples/policy-restricted-extension/package.json +8 -0
- package/docs/examples/sdk-app-embedding/README.md +39 -0
- package/docs/examples/sdk-app-embedding/package.json +9 -0
- package/docs/examples/sdk-app-embedding/run-embedded-pm.mjs +61 -0
- package/docs/examples/sdk-contract-consumer/README.md +57 -0
- package/docs/examples/sdk-contract-consumer/inspect-contracts.mjs +47 -0
- package/docs/examples/sdk-contract-consumer/package.json +10 -0
- package/docs/examples/starter-extension/README.md +57 -42
- package/docs/examples/starter-extension/manifest.json +15 -0
- package/marketplace.json +34 -0
- package/package.json +38 -4
- package/plugins/pm-cli-claude/.claude-plugin/plugin.json +23 -0
- package/plugins/pm-cli-claude/.mcp.json +12 -0
- package/plugins/pm-cli-claude/README.md +225 -0
- package/plugins/pm-cli-claude/agents/pm-coordinator.md +48 -0
- package/plugins/pm-cli-claude/agents/pm-delivery-chain.md +88 -0
- package/plugins/pm-cli-claude/agents/pm-triage-agent.md +83 -0
- package/plugins/pm-cli-claude/agents/pm-verification-agent.md +88 -0
- package/plugins/pm-cli-claude/commands/pm-audit.md +39 -0
- package/plugins/pm-cli-claude/commands/pm-calendar.md +41 -0
- package/plugins/pm-cli-claude/commands/pm-close-task.md +20 -0
- package/plugins/pm-cli-claude/commands/pm-developer.md +38 -0
- package/plugins/pm-cli-claude/commands/pm-init.md +44 -0
- package/plugins/pm-cli-claude/commands/pm-list.md +39 -0
- package/plugins/pm-cli-claude/commands/pm-new.md +36 -0
- package/plugins/pm-cli-claude/commands/pm-planner.md +51 -0
- package/plugins/pm-cli-claude/commands/pm-release.md +41 -0
- package/plugins/pm-cli-claude/commands/pm-search.md +21 -0
- package/plugins/pm-cli-claude/commands/pm-start-task.md +27 -0
- package/plugins/pm-cli-claude/commands/pm-status.md +15 -0
- package/plugins/pm-cli-claude/commands/pm-triage.md +35 -0
- package/plugins/pm-cli-claude/commands/pm-workflow.md +49 -0
- package/plugins/pm-cli-claude/hooks/hooks.json +17 -0
- package/plugins/pm-cli-claude/hooks/session-start.mjs +120 -0
- package/plugins/pm-cli-claude/scripts/pm-mcp-server.mjs +60 -0
- package/plugins/pm-cli-claude/skills/pm-audit/SKILL.md +88 -0
- package/plugins/pm-cli-claude/skills/pm-developer/SKILL.md +116 -0
- package/plugins/pm-cli-claude/skills/pm-planner/SKILL.md +118 -0
- package/plugins/pm-cli-claude/skills/pm-release/SKILL.md +83 -0
- package/plugins/pm-cli-claude/skills/pm-workflow/SKILL.md +148 -0
- package/plugins/pm-cli-codex/.codex-plugin/plugin.json +45 -0
- package/plugins/pm-cli-codex/.mcp.json +14 -0
- package/plugins/pm-cli-codex/README.md +30 -0
- package/plugins/pm-cli-codex/assets/pm-cli-small.svg +4 -0
- package/plugins/pm-cli-codex/commands/pm-audit.md +8 -0
- package/plugins/pm-cli-codex/commands/pm-close-task.md +9 -0
- package/plugins/pm-cli-codex/commands/pm-start-task.md +9 -0
- package/plugins/pm-cli-codex/scripts/pm-mcp-server.mjs +54 -0
- package/plugins/pm-cli-codex/skills/pm-auditor/SKILL.md +21 -0
- package/plugins/pm-cli-codex/skills/pm-auditor/agents/openai.yaml +6 -0
- package/plugins/pm-cli-codex/skills/pm-native/SKILL.md +57 -0
- package/plugins/pm-cli-codex/skills/pm-native/agents/openai.yaml +6 -0
- package/plugins/pm-cli-codex/skills/pm-release/SKILL.md +19 -0
- package/plugins/pm-cli-codex/skills/pm-release/agents/openai.yaml +6 -0
|
@@ -19,6 +19,30 @@ export const PM_EXTENSION_SERVICE_NAME_CONTRACTS = [
|
|
|
19
19
|
"item_store_write",
|
|
20
20
|
"item_store_delete",
|
|
21
21
|
];
|
|
22
|
+
export const PM_EXTENSION_POLICY_MODE_CONTRACTS = ["off", "warn", "enforce"];
|
|
23
|
+
export const PM_EXTENSION_TRUST_MODE_CONTRACTS = ["off", "warn", "enforce"];
|
|
24
|
+
export const PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS = ["none", "restricted", "strict"];
|
|
25
|
+
export const PM_EXTENSION_POLICY_SURFACE_CONTRACTS = [
|
|
26
|
+
"commands.override",
|
|
27
|
+
"commands.handler",
|
|
28
|
+
"hooks.beforecommand",
|
|
29
|
+
"hooks.aftercommand",
|
|
30
|
+
"hooks.onwrite",
|
|
31
|
+
"hooks.onread",
|
|
32
|
+
"hooks.onindex",
|
|
33
|
+
"schema.flags",
|
|
34
|
+
"schema.itemfields",
|
|
35
|
+
"schema.itemtypes",
|
|
36
|
+
"schema.migrations",
|
|
37
|
+
"parser.override",
|
|
38
|
+
"preflight.override",
|
|
39
|
+
"services.override",
|
|
40
|
+
"renderers.override",
|
|
41
|
+
"importers.importer",
|
|
42
|
+
"importers.exporter",
|
|
43
|
+
"search.provider",
|
|
44
|
+
"search.vectorstore",
|
|
45
|
+
];
|
|
22
46
|
function normalizeUniqueStringList(values) {
|
|
23
47
|
return [...new Set(Array.from(values).filter((value) => value.trim().length > 0))];
|
|
24
48
|
}
|
|
@@ -73,6 +97,7 @@ export const PM_CORE_COMMAND_NAMES = [
|
|
|
73
97
|
"list-canceled",
|
|
74
98
|
"aggregate",
|
|
75
99
|
"dedupe-audit",
|
|
100
|
+
"guide",
|
|
76
101
|
"calendar",
|
|
77
102
|
"cal",
|
|
78
103
|
"context",
|
|
@@ -121,11 +146,13 @@ export const PM_TOOL_ACTIONS = [
|
|
|
121
146
|
"extension-uninstall",
|
|
122
147
|
"extension-explore",
|
|
123
148
|
"extension-manage",
|
|
149
|
+
"extension-reload",
|
|
124
150
|
"extension-doctor",
|
|
125
151
|
"extension-adopt",
|
|
126
152
|
"extension-adopt-all",
|
|
127
153
|
"extension-activate",
|
|
128
154
|
"extension-deactivate",
|
|
155
|
+
"extension",
|
|
129
156
|
"create",
|
|
130
157
|
"list",
|
|
131
158
|
"list-all",
|
|
@@ -137,8 +164,11 @@ export const PM_TOOL_ACTIONS = [
|
|
|
137
164
|
"list-canceled",
|
|
138
165
|
"aggregate",
|
|
139
166
|
"dedupe-audit",
|
|
167
|
+
"guide",
|
|
140
168
|
"calendar",
|
|
169
|
+
"cal",
|
|
141
170
|
"context",
|
|
171
|
+
"ctx",
|
|
142
172
|
"get",
|
|
143
173
|
"search",
|
|
144
174
|
"reindex",
|
|
@@ -183,6 +213,21 @@ export const PM_TOOL_ACTIONS = [
|
|
|
183
213
|
"pause-task",
|
|
184
214
|
"close-task",
|
|
185
215
|
];
|
|
216
|
+
export function isPmToolAction(value) {
|
|
217
|
+
return PM_TOOL_ACTIONS.includes(value);
|
|
218
|
+
}
|
|
219
|
+
export function isPmExtensionCapabilityContract(value) {
|
|
220
|
+
return PM_EXTENSION_CAPABILITY_CONTRACTS.includes(value);
|
|
221
|
+
}
|
|
222
|
+
export function isPmExtensionServiceNameContract(value) {
|
|
223
|
+
return PM_EXTENSION_SERVICE_NAME_CONTRACTS.includes(value);
|
|
224
|
+
}
|
|
225
|
+
export function isPmExtensionPolicyModeContract(value) {
|
|
226
|
+
return PM_EXTENSION_POLICY_MODE_CONTRACTS.includes(value);
|
|
227
|
+
}
|
|
228
|
+
export function isPmExtensionPolicySurfaceContract(value) {
|
|
229
|
+
return PM_EXTENSION_POLICY_SURFACE_CONTRACTS.includes(value);
|
|
230
|
+
}
|
|
186
231
|
export const PI_LIST_FILTER_OPTION_CONTRACTS = [
|
|
187
232
|
{ param: "type", flag: "--type" },
|
|
188
233
|
{ param: "tag", flag: "--tag" },
|
|
@@ -506,6 +551,8 @@ export const COMMENTS_AUDIT_FLAG_CONTRACTS = [
|
|
|
506
551
|
];
|
|
507
552
|
export const COMMENTS_FLAG_CONTRACTS = [
|
|
508
553
|
{ flag: "--add" },
|
|
554
|
+
{ flag: "--stdin" },
|
|
555
|
+
{ flag: "--file" },
|
|
509
556
|
{ flag: "--limit" },
|
|
510
557
|
{ flag: "--author" },
|
|
511
558
|
{ flag: "--message" },
|
|
@@ -569,6 +616,17 @@ export const CONFIG_FLAG_CONTRACTS = [
|
|
|
569
616
|
{ flag: "--clear-criteria" },
|
|
570
617
|
{ flag: "--format" },
|
|
571
618
|
{ flag: "--policy" },
|
|
619
|
+
{ flag: "--default-depth" },
|
|
620
|
+
{ flag: "--activity-limit" },
|
|
621
|
+
{ flag: "--stale-threshold-days" },
|
|
622
|
+
{ flag: "--section-hierarchy" },
|
|
623
|
+
{ flag: "--section-activity" },
|
|
624
|
+
{ flag: "--section-progress" },
|
|
625
|
+
{ flag: "--section-blockers" },
|
|
626
|
+
{ flag: "--section-files" },
|
|
627
|
+
{ flag: "--section-workload" },
|
|
628
|
+
{ flag: "--section-staleness" },
|
|
629
|
+
{ flag: "--section-tests" },
|
|
572
630
|
];
|
|
573
631
|
export const EXTENSION_FLAG_CONTRACTS = [
|
|
574
632
|
{ flag: "--init" },
|
|
@@ -577,6 +635,8 @@ export const EXTENSION_FLAG_CONTRACTS = [
|
|
|
577
635
|
{ flag: "--uninstall" },
|
|
578
636
|
{ flag: "--explore" },
|
|
579
637
|
{ flag: "--manage" },
|
|
638
|
+
{ flag: "--reload" },
|
|
639
|
+
{ flag: "--watch" },
|
|
580
640
|
{ flag: "--doctor" },
|
|
581
641
|
{ flag: "--adopt" },
|
|
582
642
|
{ flag: "--adopt-all" },
|
|
@@ -1077,6 +1137,15 @@ export const CONTEXT_FLAG_CONTRACTS = [
|
|
|
1077
1137
|
{ flag: "--release" },
|
|
1078
1138
|
{ flag: "--limit" },
|
|
1079
1139
|
{ flag: "--format" },
|
|
1140
|
+
{ flag: "--depth" },
|
|
1141
|
+
{ flag: "--section" },
|
|
1142
|
+
{ flag: "--activity-limit" },
|
|
1143
|
+
{ flag: "--stale-threshold" },
|
|
1144
|
+
];
|
|
1145
|
+
export const GUIDE_FLAG_CONTRACTS = [
|
|
1146
|
+
{ flag: "--list" },
|
|
1147
|
+
{ flag: "--format" },
|
|
1148
|
+
{ flag: "--depth" },
|
|
1080
1149
|
];
|
|
1081
1150
|
export const DEPS_FLAG_CONTRACTS = [
|
|
1082
1151
|
{ flag: "--format" },
|
|
@@ -1111,6 +1180,156 @@ export const CONTRACTS_FLAG_CONTRACTS = [
|
|
|
1111
1180
|
export const COMPLETION_FLAG_CONTRACTS = [
|
|
1112
1181
|
{ flag: "--eager-tags" },
|
|
1113
1182
|
];
|
|
1183
|
+
function toUniqueFlagContracts(contracts) {
|
|
1184
|
+
const seen = new Set();
|
|
1185
|
+
const unique = [];
|
|
1186
|
+
for (const contract of contracts) {
|
|
1187
|
+
const aliasKey = (contract.aliases ?? []).join(",");
|
|
1188
|
+
const key = `${contract.flag}|${contract.short ?? ""}|${aliasKey}`;
|
|
1189
|
+
if (seen.has(key)) {
|
|
1190
|
+
continue;
|
|
1191
|
+
}
|
|
1192
|
+
seen.add(key);
|
|
1193
|
+
unique.push(contract);
|
|
1194
|
+
}
|
|
1195
|
+
return unique;
|
|
1196
|
+
}
|
|
1197
|
+
function withSubcommandGlobalFlags(contracts) {
|
|
1198
|
+
return withFlagAliasMetadata(toUniqueFlagContracts([...SUBCOMMAND_GLOBAL_FLAG_CONTRACTS, ...contracts]));
|
|
1199
|
+
}
|
|
1200
|
+
const LIST_COMMAND_NAME_CONTRACTS = new Set([
|
|
1201
|
+
"list",
|
|
1202
|
+
"list-all",
|
|
1203
|
+
"list-draft",
|
|
1204
|
+
"list-open",
|
|
1205
|
+
"list-in-progress",
|
|
1206
|
+
"list-blocked",
|
|
1207
|
+
"list-closed",
|
|
1208
|
+
"list-canceled",
|
|
1209
|
+
]);
|
|
1210
|
+
const NO_SURFACE_COMMAND_NAME_CONTRACTS = new Set([
|
|
1211
|
+
"get",
|
|
1212
|
+
"stats",
|
|
1213
|
+
"reindex",
|
|
1214
|
+
"beads",
|
|
1215
|
+
"todos",
|
|
1216
|
+
"beads-import",
|
|
1217
|
+
"todos-import",
|
|
1218
|
+
"todos-export",
|
|
1219
|
+
"help",
|
|
1220
|
+
]);
|
|
1221
|
+
function normalizeCommandNameForContracts(commandName) {
|
|
1222
|
+
if (typeof commandName !== "string") {
|
|
1223
|
+
return "";
|
|
1224
|
+
}
|
|
1225
|
+
return commandName.trim().toLowerCase();
|
|
1226
|
+
}
|
|
1227
|
+
export function resolveSubcommandFlagContractsForCommand(commandName) {
|
|
1228
|
+
const normalized = normalizeCommandNameForContracts(commandName);
|
|
1229
|
+
if (normalized.length === 0) {
|
|
1230
|
+
return withSubcommandGlobalFlags([]);
|
|
1231
|
+
}
|
|
1232
|
+
if (LIST_COMMAND_NAME_CONTRACTS.has(normalized)) {
|
|
1233
|
+
return withSubcommandGlobalFlags(LIST_FILTER_FLAG_CONTRACTS);
|
|
1234
|
+
}
|
|
1235
|
+
if (NO_SURFACE_COMMAND_NAME_CONTRACTS.has(normalized)) {
|
|
1236
|
+
return withSubcommandGlobalFlags([]);
|
|
1237
|
+
}
|
|
1238
|
+
if (normalized === "templates") {
|
|
1239
|
+
return withSubcommandGlobalFlags(CREATE_FLAG_CONTRACTS);
|
|
1240
|
+
}
|
|
1241
|
+
if (normalized === "cal") {
|
|
1242
|
+
return withSubcommandGlobalFlags(CALENDAR_FLAG_CONTRACTS);
|
|
1243
|
+
}
|
|
1244
|
+
if (normalized === "ctx") {
|
|
1245
|
+
return withSubcommandGlobalFlags(CONTEXT_FLAG_CONTRACTS);
|
|
1246
|
+
}
|
|
1247
|
+
if (normalized === "test-runs-worker") {
|
|
1248
|
+
return withSubcommandGlobalFlags(TEST_RUNS_FLAG_CONTRACTS);
|
|
1249
|
+
}
|
|
1250
|
+
switch (normalized) {
|
|
1251
|
+
case "init":
|
|
1252
|
+
return withSubcommandGlobalFlags(INIT_FLAG_CONTRACTS);
|
|
1253
|
+
case "config":
|
|
1254
|
+
return withSubcommandGlobalFlags(CONFIG_FLAG_CONTRACTS);
|
|
1255
|
+
case "extension":
|
|
1256
|
+
return withSubcommandGlobalFlags(EXTENSION_FLAG_CONTRACTS);
|
|
1257
|
+
case "create":
|
|
1258
|
+
return withSubcommandGlobalFlags(CREATE_FLAG_CONTRACTS);
|
|
1259
|
+
case "aggregate":
|
|
1260
|
+
return withSubcommandGlobalFlags(AGGREGATE_FLAG_CONTRACTS);
|
|
1261
|
+
case "dedupe-audit":
|
|
1262
|
+
return withSubcommandGlobalFlags(DEDUPE_AUDIT_FLAG_CONTRACTS);
|
|
1263
|
+
case "comments-audit":
|
|
1264
|
+
return withSubcommandGlobalFlags(COMMENTS_AUDIT_FLAG_CONTRACTS);
|
|
1265
|
+
case "calendar":
|
|
1266
|
+
return withSubcommandGlobalFlags(CALENDAR_FLAG_CONTRACTS);
|
|
1267
|
+
case "context":
|
|
1268
|
+
return withSubcommandGlobalFlags(CONTEXT_FLAG_CONTRACTS);
|
|
1269
|
+
case "search":
|
|
1270
|
+
return withSubcommandGlobalFlags(SEARCH_FLAG_CONTRACTS);
|
|
1271
|
+
case "history":
|
|
1272
|
+
return withSubcommandGlobalFlags(HISTORY_FLAG_CONTRACTS);
|
|
1273
|
+
case "activity":
|
|
1274
|
+
return withSubcommandGlobalFlags(ACTIVITY_FLAG_CONTRACTS);
|
|
1275
|
+
case "restore":
|
|
1276
|
+
return withSubcommandGlobalFlags(RESTORE_FLAG_CONTRACTS);
|
|
1277
|
+
case "update":
|
|
1278
|
+
return withSubcommandGlobalFlags(UPDATE_FLAG_CONTRACTS);
|
|
1279
|
+
case "update-many":
|
|
1280
|
+
return withSubcommandGlobalFlags(UPDATE_MANY_FLAG_CONTRACTS);
|
|
1281
|
+
case "normalize":
|
|
1282
|
+
return withSubcommandGlobalFlags(NORMALIZE_FLAG_CONTRACTS);
|
|
1283
|
+
case "close":
|
|
1284
|
+
return withSubcommandGlobalFlags(CLOSE_FLAG_CONTRACTS);
|
|
1285
|
+
case "delete":
|
|
1286
|
+
return withSubcommandGlobalFlags(DELETE_FLAG_CONTRACTS);
|
|
1287
|
+
case "append":
|
|
1288
|
+
return withSubcommandGlobalFlags(APPEND_FLAG_CONTRACTS);
|
|
1289
|
+
case "comments":
|
|
1290
|
+
return withSubcommandGlobalFlags(COMMENTS_FLAG_CONTRACTS);
|
|
1291
|
+
case "notes":
|
|
1292
|
+
return withSubcommandGlobalFlags(NOTES_FLAG_CONTRACTS);
|
|
1293
|
+
case "learnings":
|
|
1294
|
+
return withSubcommandGlobalFlags(LEARNINGS_FLAG_CONTRACTS);
|
|
1295
|
+
case "files":
|
|
1296
|
+
return withSubcommandGlobalFlags(FILES_FLAG_CONTRACTS);
|
|
1297
|
+
case "docs":
|
|
1298
|
+
return withSubcommandGlobalFlags(DOCS_FLAG_CONTRACTS);
|
|
1299
|
+
case "deps":
|
|
1300
|
+
return withSubcommandGlobalFlags(DEPS_FLAG_CONTRACTS);
|
|
1301
|
+
case "test":
|
|
1302
|
+
return withSubcommandGlobalFlags(TEST_FLAG_CONTRACTS);
|
|
1303
|
+
case "test-all":
|
|
1304
|
+
return withSubcommandGlobalFlags(TEST_ALL_FLAG_CONTRACTS);
|
|
1305
|
+
case "test-runs":
|
|
1306
|
+
return withSubcommandGlobalFlags(TEST_RUNS_FLAG_CONTRACTS);
|
|
1307
|
+
case "health":
|
|
1308
|
+
return withSubcommandGlobalFlags(HEALTH_FLAG_CONTRACTS);
|
|
1309
|
+
case "validate":
|
|
1310
|
+
return withSubcommandGlobalFlags(VALIDATE_FLAG_CONTRACTS);
|
|
1311
|
+
case "gc":
|
|
1312
|
+
return withSubcommandGlobalFlags(GC_FLAG_CONTRACTS);
|
|
1313
|
+
case "contracts":
|
|
1314
|
+
return withSubcommandGlobalFlags(CONTRACTS_FLAG_CONTRACTS);
|
|
1315
|
+
case "claim":
|
|
1316
|
+
return withSubcommandGlobalFlags(CLAIM_FLAG_CONTRACTS);
|
|
1317
|
+
case "release":
|
|
1318
|
+
return withSubcommandGlobalFlags(RELEASE_FLAG_CONTRACTS);
|
|
1319
|
+
case "start-task":
|
|
1320
|
+
return withSubcommandGlobalFlags(START_TASK_FLAG_CONTRACTS);
|
|
1321
|
+
case "pause-task":
|
|
1322
|
+
return withSubcommandGlobalFlags(PAUSE_TASK_FLAG_CONTRACTS);
|
|
1323
|
+
case "close-task":
|
|
1324
|
+
return withSubcommandGlobalFlags(CLOSE_TASK_FLAG_CONTRACTS);
|
|
1325
|
+
case "guide":
|
|
1326
|
+
return withSubcommandGlobalFlags(GUIDE_FLAG_CONTRACTS);
|
|
1327
|
+
case "completion":
|
|
1328
|
+
return withSubcommandGlobalFlags(COMPLETION_FLAG_CONTRACTS);
|
|
1329
|
+
default:
|
|
1330
|
+
return withSubcommandGlobalFlags([]);
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1114
1333
|
export function toCompletionFlagString(flagContracts, includeGlobal = true) {
|
|
1115
1334
|
const aliasAwareContracts = withFlagAliasMetadata(flagContracts);
|
|
1116
1335
|
const scoped = aliasAwareContracts
|
|
@@ -1465,6 +1684,8 @@ const PM_TOOL_PARAMETER_PROPERTIES = {
|
|
|
1465
1684
|
sharedHostSafe: { type: "boolean" },
|
|
1466
1685
|
detail: { type: "string", enum: ["summary", "deep"] },
|
|
1467
1686
|
trace: { type: "boolean" },
|
|
1687
|
+
reload: { type: "boolean" },
|
|
1688
|
+
watch: { type: "boolean" },
|
|
1468
1689
|
runtimeProbe: { type: "boolean" },
|
|
1469
1690
|
fixManagedState: { type: "boolean" },
|
|
1470
1691
|
pmContext: { type: "string", enum: ["schema", "tracker", "auto"] },
|
|
@@ -1520,6 +1741,7 @@ const PM_TOOL_PARAMETER_PROPERTIES = {
|
|
|
1520
1741
|
collapse: { type: "string", enum: ["none", "repeated"] },
|
|
1521
1742
|
summary: { type: "boolean" },
|
|
1522
1743
|
shell: { type: "string", enum: ["bash", "zsh", "fish"] },
|
|
1744
|
+
stdin: { type: "boolean" },
|
|
1523
1745
|
file: { type: "string" },
|
|
1524
1746
|
preserveSourceIds: { type: "boolean" },
|
|
1525
1747
|
folder: { type: "string" },
|
|
@@ -1666,11 +1888,38 @@ const PM_TOOL_ACTION_SCHEMA_CONTRACTS = {
|
|
|
1666
1888
|
"extension-uninstall": { required: ["target"], optional: ["scope"] },
|
|
1667
1889
|
"extension-explore": { optional: ["scope"] },
|
|
1668
1890
|
"extension-manage": { optional: ["scope", "runtimeProbe", "fixManagedState"] },
|
|
1891
|
+
"extension-reload": { optional: ["scope", "watch"] },
|
|
1669
1892
|
"extension-doctor": { optional: ["scope", "detail", "trace", "fixManagedState", "strictExit", "failOnWarn"] },
|
|
1670
1893
|
"extension-adopt": { required: ["target"], optional: ["scope", "github", "ref"] },
|
|
1671
1894
|
"extension-adopt-all": { optional: ["scope"] },
|
|
1672
1895
|
"extension-activate": { required: ["target"], optional: ["scope"] },
|
|
1673
1896
|
"extension-deactivate": { required: ["target"], optional: ["scope"] },
|
|
1897
|
+
extension: {
|
|
1898
|
+
optional: [
|
|
1899
|
+
"target",
|
|
1900
|
+
"scope",
|
|
1901
|
+
"github",
|
|
1902
|
+
"ref",
|
|
1903
|
+
"init",
|
|
1904
|
+
"install",
|
|
1905
|
+
"uninstall",
|
|
1906
|
+
"explore",
|
|
1907
|
+
"manage",
|
|
1908
|
+
"reload",
|
|
1909
|
+
"doctor",
|
|
1910
|
+
"adopt",
|
|
1911
|
+
"adoptAll",
|
|
1912
|
+
"activate",
|
|
1913
|
+
"deactivate",
|
|
1914
|
+
"runtimeProbe",
|
|
1915
|
+
"fixManagedState",
|
|
1916
|
+
"detail",
|
|
1917
|
+
"trace",
|
|
1918
|
+
"watch",
|
|
1919
|
+
"strictExit",
|
|
1920
|
+
"failOnWarn",
|
|
1921
|
+
],
|
|
1922
|
+
},
|
|
1674
1923
|
create: {
|
|
1675
1924
|
required: ["title", "description", "type", "status", "priority", "message"],
|
|
1676
1925
|
optional: CREATE_CONTRACT_PARAMETER_KEYS,
|
|
@@ -1685,8 +1934,11 @@ const PM_TOOL_ACTION_SCHEMA_CONTRACTS = {
|
|
|
1685
1934
|
"list-canceled": { optional: LIST_CONTRACT_PARAMETER_KEYS },
|
|
1686
1935
|
aggregate: { optional: AGGREGATE_CONTRACT_PARAMETER_KEYS },
|
|
1687
1936
|
"dedupe-audit": { optional: DEDUPE_AUDIT_CONTRACT_PARAMETER_KEYS },
|
|
1937
|
+
guide: { optional: ["format", "depth"] },
|
|
1688
1938
|
calendar: { optional: CALENDAR_CONTRACT_PARAMETER_KEYS },
|
|
1939
|
+
cal: { optional: CALENDAR_CONTRACT_PARAMETER_KEYS },
|
|
1689
1940
|
context: { optional: CONTEXT_CONTRACT_PARAMETER_KEYS },
|
|
1941
|
+
ctx: { optional: CONTEXT_CONTRACT_PARAMETER_KEYS },
|
|
1690
1942
|
get: { required: ["id"] },
|
|
1691
1943
|
search: {
|
|
1692
1944
|
optional: SEARCH_CONTRACT_PARAMETER_KEYS,
|
|
@@ -1702,7 +1954,10 @@ const PM_TOOL_ACTION_SCHEMA_CONTRACTS = {
|
|
|
1702
1954
|
close: { required: ["id", "text"], optional: ["validateClose", ...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS] },
|
|
1703
1955
|
delete: { required: ["id"], optional: AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS },
|
|
1704
1956
|
append: { required: ["id", "body"], optional: AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS },
|
|
1705
|
-
comments: {
|
|
1957
|
+
comments: {
|
|
1958
|
+
required: ["id"],
|
|
1959
|
+
optional: ["text", "add", "stdin", "file", "limit", "allowAuditComment", ...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS],
|
|
1960
|
+
},
|
|
1706
1961
|
"comments-audit": {
|
|
1707
1962
|
optional: [
|
|
1708
1963
|
"status",
|
|
@@ -1860,6 +2115,7 @@ const PM_TOOL_ACTION_SCHEMA_CONTRACTS = {
|
|
|
1860
2115
|
"pause-task": { required: ["id"], optional: AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS },
|
|
1861
2116
|
"close-task": { required: ["id", "text"], optional: AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS },
|
|
1862
2117
|
};
|
|
2118
|
+
export const PM_TOOL_ACTION_PARAMETER_CONTRACTS = PM_TOOL_ACTION_SCHEMA_CONTRACTS;
|
|
1863
2119
|
const PM_TOOL_PARAMETER_METADATA = {
|
|
1864
2120
|
action: {
|
|
1865
2121
|
description: "Tool action to execute.",
|
|
@@ -1879,6 +2135,12 @@ const PM_TOOL_PARAMETER_METADATA = {
|
|
|
1879
2135
|
trace: {
|
|
1880
2136
|
description: "When true for extension-doctor, include actionable registration traces in deep diagnostics.",
|
|
1881
2137
|
},
|
|
2138
|
+
reload: {
|
|
2139
|
+
description: "When true for extension action payloads, trigger cache-busted extension module reload.",
|
|
2140
|
+
},
|
|
2141
|
+
watch: {
|
|
2142
|
+
description: "When true for extension-reload/extension action payloads, enable watch mode semantics.",
|
|
2143
|
+
},
|
|
1882
2144
|
runtimeProbe: {
|
|
1883
2145
|
description: "When true for extension-manage, run a doctor-like runtime activation probe for parity fields.",
|
|
1884
2146
|
},
|
|
@@ -2190,6 +2452,13 @@ const PM_TOOL_PARAMETER_METADATA = {
|
|
|
2190
2452
|
allowAuditComment: {
|
|
2191
2453
|
description: "For comments action, allow non-owner append-only comment audits without requiring --force.",
|
|
2192
2454
|
},
|
|
2455
|
+
stdin: {
|
|
2456
|
+
description: "When true for comments action, read comment text from piped stdin (supports multiline markdown).",
|
|
2457
|
+
},
|
|
2458
|
+
file: {
|
|
2459
|
+
description: "Path to input file for actions that read payload text (for example comments --file or beads-import --file).",
|
|
2460
|
+
examples: ["notes/comment.md", "import.json"],
|
|
2461
|
+
},
|
|
2193
2462
|
allowAuditUpdate: {
|
|
2194
2463
|
description: "Allow non-owner metadata-only update audits without requiring --force.",
|
|
2195
2464
|
},
|
|
@@ -2379,7 +2648,53 @@ export const PM_TOOL_PARAMETERS_SCHEMA = {
|
|
|
2379
2648
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
2380
2649
|
$id: "https://unbrained.dev/schemas/pm-cli/tool-parameters-v4.schema.json",
|
|
2381
2650
|
title: "pm-cli Pi wrapper parameters (action-scoped strict schema)",
|
|
2382
|
-
"x-schema-version": "4.0.
|
|
2651
|
+
"x-schema-version": "4.0.1",
|
|
2652
|
+
type: "object",
|
|
2383
2653
|
oneOf: PM_TOOL_ACTIONS.map((action) => buildActionScopedToolSchema(action)),
|
|
2384
2654
|
};
|
|
2655
|
+
function toProviderCompatibleParameterDefinition(key, definition) {
|
|
2656
|
+
const decorated = decorateToolParameterDefinition(key, definition);
|
|
2657
|
+
if (typeof decorated.type === "string") {
|
|
2658
|
+
return decorated;
|
|
2659
|
+
}
|
|
2660
|
+
const anyOf = Array.isArray(decorated.anyOf) ? decorated.anyOf : [];
|
|
2661
|
+
const firstTypedVariant = anyOf.find((variant) => typeof variant.type === "string");
|
|
2662
|
+
if (firstTypedVariant) {
|
|
2663
|
+
const { anyOf: _anyOf, ...rest } = decorated;
|
|
2664
|
+
return {
|
|
2665
|
+
...rest,
|
|
2666
|
+
type: firstTypedVariant.type,
|
|
2667
|
+
};
|
|
2668
|
+
}
|
|
2669
|
+
const { anyOf: _anyOf, ...rest } = decorated;
|
|
2670
|
+
return {
|
|
2671
|
+
...rest,
|
|
2672
|
+
type: "string",
|
|
2673
|
+
};
|
|
2674
|
+
}
|
|
2675
|
+
function buildProviderCompatiblePiToolSchema() {
|
|
2676
|
+
const properties = {
|
|
2677
|
+
action: {
|
|
2678
|
+
type: "string",
|
|
2679
|
+
description: PM_TOOL_PARAMETER_METADATA.action?.description ?? "Tool action to execute.",
|
|
2680
|
+
},
|
|
2681
|
+
options: {
|
|
2682
|
+
type: "object",
|
|
2683
|
+
additionalProperties: true,
|
|
2684
|
+
description: "Advanced command options object forwarded to the selected pm action.",
|
|
2685
|
+
},
|
|
2686
|
+
};
|
|
2687
|
+
for (const key of Object.keys(PM_TOOL_PARAMETER_PROPERTIES).sort()) {
|
|
2688
|
+
properties[key] = toProviderCompatibleParameterDefinition(key, PM_TOOL_PARAMETER_PROPERTIES[key]);
|
|
2689
|
+
}
|
|
2690
|
+
return {
|
|
2691
|
+
title: "pm-cli Pi tool parameters (provider-compatible flat schema)",
|
|
2692
|
+
"x-schema-version": "1.0.0",
|
|
2693
|
+
type: "object",
|
|
2694
|
+
additionalProperties: false,
|
|
2695
|
+
required: ["action"],
|
|
2696
|
+
properties,
|
|
2697
|
+
};
|
|
2698
|
+
}
|
|
2699
|
+
export const PM_PI_TOOL_PARAMETERS_SCHEMA = buildProviderCompatiblePiToolSchema();
|
|
2385
2700
|
//# sourceMappingURL=cli-contracts.js.map
|