@unbrained/pm-cli 2026.5.11 → 2026.5.12
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.md +3 -116
- package/CHANGELOG.md +7 -0
- package/PRD.md +11 -11
- package/README.md +11 -1
- package/dist/cli/commands/contracts.js +8 -2
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/extension.d.ts +9 -2
- package/dist/cli/commands/extension.js +247 -67
- package/dist/cli/commands/extension.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/test.js +14 -6
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/upgrade.d.ts +63 -0
- package/dist/cli/commands/upgrade.js +260 -0
- package/dist/cli/commands/upgrade.js.map +1 -0
- package/dist/cli/guide-topics.js +18 -16
- package/dist/cli/guide-topics.js.map +1 -1
- package/dist/cli/help-content.js +42 -2
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/register-setup.js +168 -90
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/core/packages/manifest.d.ts +13 -0
- package/dist/core/packages/manifest.js +139 -0
- package/dist/core/packages/manifest.js.map +1 -0
- package/dist/mcp/server.js +9 -2
- package/dist/mcp/server.js.map +1 -1
- package/dist/sdk/cli-contracts.d.ts +18 -17
- package/dist/sdk/cli-contracts.js +137 -35
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/sdk/index.d.ts +1 -0
- package/dist/sdk/index.js +1 -0
- package/dist/sdk/index.js.map +1 -1
- package/docs/ARCHITECTURE.md +1 -1
- package/docs/COMMANDS.md +14 -1
- package/docs/EXTENSIONS.md +112 -29
- package/docs/QUICKSTART.md +10 -2
- package/docs/README.md +4 -6
- package/docs/SDK.md +16 -12
- package/package.json +5 -23
- package/packages/pm-beads/README.md +10 -0
- package/{.agents/pm → packages/pm-beads}/extensions/beads/index.js +24 -9
- package/packages/pm-beads/extensions/beads/index.ts +131 -0
- package/packages/pm-beads/package.json +17 -0
- package/packages/pm-todos/README.md +11 -0
- package/{.agents/pm → packages/pm-todos}/extensions/todos/index.js +24 -9
- package/packages/pm-todos/extensions/todos/index.ts +149 -0
- package/{.agents/pm → packages/pm-todos}/extensions/todos/runtime.js +1 -1
- package/{.agents/pm → packages/pm-todos}/extensions/todos/runtime.ts +1 -1
- package/packages/pm-todos/package.json +17 -0
- package/plugins/pm-cli-claude/README.md +1 -2
- package/plugins/pm-cli-claude/hooks/session-start.mjs +4 -55
- package/.agents/pm/extensions/.managed-extensions.json +0 -42
- package/.agents/skills/HARNESS_COMPATIBILITY.md +0 -45
- package/.agents/skills/README.md +0 -21
- package/.agents/skills/pm-developer/SKILL.md +0 -73
- package/.agents/skills/pm-developer/references/COMMAND_PLAYBOOK.md +0 -48
- package/.agents/skills/pm-developer/references/PROMPTS.md +0 -17
- package/.agents/skills/pm-extensions/SKILL.md +0 -57
- package/.agents/skills/pm-extensions/references/LIFECYCLE.md +0 -40
- package/.agents/skills/pm-extensions/references/TROUBLESHOOTING.md +0 -25
- package/.agents/skills/pm-sdk/SKILL.md +0 -50
- package/.agents/skills/pm-sdk/references/INTEGRATION_CHECKLIST.md +0 -31
- package/.agents/skills/pm-sdk/references/PROMPTS.md +0 -13
- package/.agents/skills/pm-user/SKILL.md +0 -59
- package/.agents/skills/pm-user/references/PROMPTS.md +0 -17
- package/.agents/skills/pm-user/references/WORKFLOWS.md +0 -35
- package/.pi/README.md +0 -35
- package/.pi/agents/pm-triage-agent.md +0 -19
- package/.pi/agents/pm-verification-agent.md +0 -21
- package/.pi/chains/pm-native-delivery.chain.md +0 -11
- package/.pi/extensions/pm-cli/index.js +0 -387
- package/.pi/prompts/pm-workflow.md +0 -5
- package/.pi/skills/pm-native/SKILL.md +0 -44
- package/.pi/skills/pm-release/SKILL.md +0 -35
- package/dist/pi/native.d.ts +0 -5
- package/dist/pi/native.js +0 -236
- package/dist/pi/native.js.map +0 -1
- package/docs/PI_PACKAGE.md +0 -141
- /package/{.agents/pm → packages/pm-beads}/extensions/beads/manifest.json +0 -0
- /package/{.agents/pm → packages/pm-beads}/extensions/beads/runtime.js +0 -0
- /package/{.agents/pm → packages/pm-beads}/extensions/beads/runtime.ts +0 -0
- /package/{.agents/pm → packages/pm-todos}/extensions/todos/manifest.json +0 -0
package/dist/sdk/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EXTENSION_CAPABILITY_CONTRACT, EXTENSION_CAPABILITY_CONTRACT_VERSION, EXTENSION_CAPABILITY_LEGACY_ALIASES, type ExtensionApi, type ExtensionManifest } from "../core/extensions/loader.js";
|
|
2
|
+
export { PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS, PM_PACKAGE_RESOURCE_KINDS, collectPackageExtensionDirectories, readPmPackageManifest, type PmPackageManifest, type PmPackageResourceKind, type PmPackageResourceMap, } from "../core/packages/manifest.js";
|
|
2
3
|
export * from "./cli-contracts.js";
|
|
3
4
|
/**
|
|
4
5
|
* Canonical extension capability names accepted by pm.
|
package/dist/sdk/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EXTENSION_CAPABILITY_CONTRACT, EXTENSION_CAPABILITY_CONTRACT_VERSION, EXTENSION_CAPABILITY_LEGACY_ALIASES, KNOWN_EXTENSION_CAPABILITIES, KNOWN_EXTENSION_POLICY_MODES, KNOWN_EXTENSION_POLICY_SURFACES, KNOWN_EXTENSION_SANDBOX_PROFILES, KNOWN_EXTENSION_TRUST_MODES, } from "../core/extensions/loader.js";
|
|
2
|
+
export { PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS, PM_PACKAGE_RESOURCE_KINDS, collectPackageExtensionDirectories, readPmPackageManifest, } from "../core/packages/manifest.js";
|
|
2
3
|
export * from "./cli-contracts.js";
|
|
3
4
|
/**
|
|
4
5
|
* Canonical extension capability names accepted by pm.
|
package/dist/sdk/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["sdk/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,qCAAqC,EACrC,mCAAmC,EACnC,4BAA4B,EAC5B,4BAA4B,EAC5B,+BAA+B,EAC/B,gCAAgC,EAChC,2BAA2B,GAG5B,MAAM,8BAA8B,CAAC;AACtC,cAAc,oBAAoB,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,4BAA4B,CAAC;AAGnE;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,4BAA4B,CAAC;AACnE,MAAM,CAAC,MAAM,yBAAyB,GAAG,+BAA+B,CAAC;AACzE,MAAM,CAAC,MAAM,qBAAqB,GAAG,2BAA2B,CAAC;AACjE,MAAM,CAAC,MAAM,0BAA0B,GAAG,gCAAgC,CAAC;AAM3E;;GAEG;AACH,OAAO,EAAE,6BAA6B,EAAE,qCAAqC,EAAE,mCAAmC,EAAE,CAAC;AAarH;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAkC,MAAe;IAC9E,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import {\n EXTENSION_CAPABILITY_CONTRACT,\n EXTENSION_CAPABILITY_CONTRACT_VERSION,\n EXTENSION_CAPABILITY_LEGACY_ALIASES,\n KNOWN_EXTENSION_CAPABILITIES,\n KNOWN_EXTENSION_POLICY_MODES,\n KNOWN_EXTENSION_POLICY_SURFACES,\n KNOWN_EXTENSION_SANDBOX_PROFILES,\n KNOWN_EXTENSION_TRUST_MODES,\n type ExtensionApi,\n type ExtensionManifest,\n} from \"../core/extensions/loader.js\";\nexport * from \"./cli-contracts.js\";\n\n/**\n * Canonical extension capability names accepted by pm.\n *\n * Extension manifests should declare one or more of these values in\n * `capabilities`.\n */\nexport const EXTENSION_CAPABILITIES = KNOWN_EXTENSION_CAPABILITIES;\nexport type ExtensionCapability = (typeof EXTENSION_CAPABILITIES)[number];\n\n/**\n * Canonical extension governance policy modes and registration surfaces.\n */\nexport const EXTENSION_POLICY_MODES = KNOWN_EXTENSION_POLICY_MODES;\nexport const EXTENSION_POLICY_SURFACES = KNOWN_EXTENSION_POLICY_SURFACES;\nexport const EXTENSION_TRUST_MODES = KNOWN_EXTENSION_TRUST_MODES;\nexport const EXTENSION_SANDBOX_PROFILES = KNOWN_EXTENSION_SANDBOX_PROFILES;\nexport type ExtensionPolicyMode = (typeof EXTENSION_POLICY_MODES)[number];\nexport type ExtensionPolicySurface = (typeof EXTENSION_POLICY_SURFACES)[number];\nexport type ExtensionTrustMode = (typeof EXTENSION_TRUST_MODES)[number];\nexport type ExtensionSandboxProfile = (typeof EXTENSION_SANDBOX_PROFILES)[number];\n\n/**\n * Versioned capability contract metadata emitted by runtime diagnostics.\n */\nexport { EXTENSION_CAPABILITY_CONTRACT, EXTENSION_CAPABILITY_CONTRACT_VERSION, EXTENSION_CAPABILITY_LEGACY_ALIASES };\n\nexport interface ExtensionModule {\n /**\n * Optional in-module metadata mirror.\n *\n * The authoritative manifest remains on-disk `manifest.json`; this field is\n * useful when authors want colocated metadata for tooling/tests.\n */\n manifest?: ExtensionManifest;\n activate(api: ExtensionApi): void | Promise<void>;\n}\n\n/**\n * Typed identity helper for extension module exports.\n *\n * Use as:\n * `export default defineExtension({ activate(api) { ... } })`\n */\nexport function defineExtension<TModule extends ExtensionModule>(module: TModule): TModule {\n return module;\n}\n\nexport type {\n AfterCommandHook,\n AfterCommandHookContext,\n BeforeCommandHook,\n BeforeCommandHookContext,\n CommandDefinition,\n ExtensionCommandArgumentDefinition,\n CommandHandler,\n CommandHandlerContext,\n CommandOverride,\n CommandOverrideContext,\n ExtensionServiceName,\n Exporter,\n ExtensionActivationResult,\n ExtensionApi,\n ExtensionCommandRegistry,\n ExtensionDiagnostic,\n ExtensionDiscoveryResult,\n ExtensionLoadResult,\n ExtensionManifest,\n ExtensionGovernancePolicy,\n ExtensionPolicyOverride,\n ExtensionProvenanceMetadata,\n ExtensionRuntimePermissionDeclaration,\n ExtensionSearchMode,\n ExtensionParserRegistry,\n ExtensionPreflightRegistry,\n ExtensionRegistrationRegistry,\n ExtensionRendererRegistry,\n ExtensionServiceRegistry,\n FlagValueType,\n FlagDefinition,\n ImportExportContext,\n Importer,\n OnIndexHook,\n OnIndexHookContext,\n OnReadHook,\n OnReadHookContext,\n OnWriteHook,\n OnWriteHookContext,\n OutputRendererFormat,\n ParserOverride,\n ParserOverrideContext,\n ParserOverrideDelta,\n PreflightOverride,\n PreflightOverrideContext,\n PreflightOverrideDelta,\n PreflightRuntimeDecision,\n RendererOverride,\n RendererOverrideContext,\n SchemaFieldDefinition,\n SchemaItemTypeCommandOptionPolicyDefinition,\n SchemaItemTypeOptionDefinition,\n SchemaItemTypeDefinition,\n SchemaMigrationDefinition,\n SchemaMigrationRunContext,\n SchemaMigrationRunner,\n SearchProviderEmbedBatchContext,\n SearchProviderEmbedContext,\n SearchProviderDefinition,\n SearchProviderHit,\n SearchProviderQueryContext,\n SearchProviderQueryResult,\n ServiceOverride,\n ServiceOverrideContext,\n VectorStoreAdapterDefinition,\n VectorStoreDeleteContext,\n VectorStoreQueryContext,\n VectorStoreQueryHit,\n VectorStoreUpsertContext,\n VectorStoreUpsertPoint,\n} from \"../core/extensions/loader.js\";\n\nexport type { GlobalOptions } from \"../core/shared/command-types.js\";\nexport type { ItemDocument, ItemFrontMatter, ItemStatus, ItemType, PmSettings } from \"../types/index.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["sdk/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,qCAAqC,EACrC,mCAAmC,EACnC,4BAA4B,EAC5B,4BAA4B,EAC5B,+BAA+B,EAC/B,gCAAgC,EAChC,2BAA2B,GAG5B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,sCAAsC,EACtC,yBAAyB,EACzB,kCAAkC,EAClC,qBAAqB,GAItB,MAAM,8BAA8B,CAAC;AACtC,cAAc,oBAAoB,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,4BAA4B,CAAC;AAGnE;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,4BAA4B,CAAC;AACnE,MAAM,CAAC,MAAM,yBAAyB,GAAG,+BAA+B,CAAC;AACzE,MAAM,CAAC,MAAM,qBAAqB,GAAG,2BAA2B,CAAC;AACjE,MAAM,CAAC,MAAM,0BAA0B,GAAG,gCAAgC,CAAC;AAM3E;;GAEG;AACH,OAAO,EAAE,6BAA6B,EAAE,qCAAqC,EAAE,mCAAmC,EAAE,CAAC;AAarH;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAkC,MAAe;IAC9E,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import {\n EXTENSION_CAPABILITY_CONTRACT,\n EXTENSION_CAPABILITY_CONTRACT_VERSION,\n EXTENSION_CAPABILITY_LEGACY_ALIASES,\n KNOWN_EXTENSION_CAPABILITIES,\n KNOWN_EXTENSION_POLICY_MODES,\n KNOWN_EXTENSION_POLICY_SURFACES,\n KNOWN_EXTENSION_SANDBOX_PROFILES,\n KNOWN_EXTENSION_TRUST_MODES,\n type ExtensionApi,\n type ExtensionManifest,\n} from \"../core/extensions/loader.js\";\nexport {\n PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,\n PM_PACKAGE_RESOURCE_KINDS,\n collectPackageExtensionDirectories,\n readPmPackageManifest,\n type PmPackageManifest,\n type PmPackageResourceKind,\n type PmPackageResourceMap,\n} from \"../core/packages/manifest.js\";\nexport * from \"./cli-contracts.js\";\n\n/**\n * Canonical extension capability names accepted by pm.\n *\n * Extension manifests should declare one or more of these values in\n * `capabilities`.\n */\nexport const EXTENSION_CAPABILITIES = KNOWN_EXTENSION_CAPABILITIES;\nexport type ExtensionCapability = (typeof EXTENSION_CAPABILITIES)[number];\n\n/**\n * Canonical extension governance policy modes and registration surfaces.\n */\nexport const EXTENSION_POLICY_MODES = KNOWN_EXTENSION_POLICY_MODES;\nexport const EXTENSION_POLICY_SURFACES = KNOWN_EXTENSION_POLICY_SURFACES;\nexport const EXTENSION_TRUST_MODES = KNOWN_EXTENSION_TRUST_MODES;\nexport const EXTENSION_SANDBOX_PROFILES = KNOWN_EXTENSION_SANDBOX_PROFILES;\nexport type ExtensionPolicyMode = (typeof EXTENSION_POLICY_MODES)[number];\nexport type ExtensionPolicySurface = (typeof EXTENSION_POLICY_SURFACES)[number];\nexport type ExtensionTrustMode = (typeof EXTENSION_TRUST_MODES)[number];\nexport type ExtensionSandboxProfile = (typeof EXTENSION_SANDBOX_PROFILES)[number];\n\n/**\n * Versioned capability contract metadata emitted by runtime diagnostics.\n */\nexport { EXTENSION_CAPABILITY_CONTRACT, EXTENSION_CAPABILITY_CONTRACT_VERSION, EXTENSION_CAPABILITY_LEGACY_ALIASES };\n\nexport interface ExtensionModule {\n /**\n * Optional in-module metadata mirror.\n *\n * The authoritative manifest remains on-disk `manifest.json`; this field is\n * useful when authors want colocated metadata for tooling/tests.\n */\n manifest?: ExtensionManifest;\n activate(api: ExtensionApi): void | Promise<void>;\n}\n\n/**\n * Typed identity helper for extension module exports.\n *\n * Use as:\n * `export default defineExtension({ activate(api) { ... } })`\n */\nexport function defineExtension<TModule extends ExtensionModule>(module: TModule): TModule {\n return module;\n}\n\nexport type {\n AfterCommandHook,\n AfterCommandHookContext,\n BeforeCommandHook,\n BeforeCommandHookContext,\n CommandDefinition,\n ExtensionCommandArgumentDefinition,\n CommandHandler,\n CommandHandlerContext,\n CommandOverride,\n CommandOverrideContext,\n ExtensionServiceName,\n Exporter,\n ExtensionActivationResult,\n ExtensionApi,\n ExtensionCommandRegistry,\n ExtensionDiagnostic,\n ExtensionDiscoveryResult,\n ExtensionLoadResult,\n ExtensionManifest,\n ExtensionGovernancePolicy,\n ExtensionPolicyOverride,\n ExtensionProvenanceMetadata,\n ExtensionRuntimePermissionDeclaration,\n ExtensionSearchMode,\n ExtensionParserRegistry,\n ExtensionPreflightRegistry,\n ExtensionRegistrationRegistry,\n ExtensionRendererRegistry,\n ExtensionServiceRegistry,\n FlagValueType,\n FlagDefinition,\n ImportExportContext,\n Importer,\n OnIndexHook,\n OnIndexHookContext,\n OnReadHook,\n OnReadHookContext,\n OnWriteHook,\n OnWriteHookContext,\n OutputRendererFormat,\n ParserOverride,\n ParserOverrideContext,\n ParserOverrideDelta,\n PreflightOverride,\n PreflightOverrideContext,\n PreflightOverrideDelta,\n PreflightRuntimeDecision,\n RendererOverride,\n RendererOverrideContext,\n SchemaFieldDefinition,\n SchemaItemTypeCommandOptionPolicyDefinition,\n SchemaItemTypeOptionDefinition,\n SchemaItemTypeDefinition,\n SchemaMigrationDefinition,\n SchemaMigrationRunContext,\n SchemaMigrationRunner,\n SearchProviderEmbedBatchContext,\n SearchProviderEmbedContext,\n SearchProviderDefinition,\n SearchProviderHit,\n SearchProviderQueryContext,\n SearchProviderQueryResult,\n ServiceOverride,\n ServiceOverrideContext,\n VectorStoreAdapterDefinition,\n VectorStoreDeleteContext,\n VectorStoreQueryContext,\n VectorStoreQueryHit,\n VectorStoreUpsertContext,\n VectorStoreUpsertPoint,\n} from \"../core/extensions/loader.js\";\n\nexport type { GlobalOptions } from \"../core/shared/command-types.js\";\nexport type { ItemDocument, ItemFrontMatter, ItemStatus, ItemType, PmSettings } from \"../types/index.js\";\n"]}
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -193,7 +193,7 @@ Command/action metadata is centralized in `src/sdk/cli-contracts.ts` and used by
|
|
|
193
193
|
- CLI option normalization
|
|
194
194
|
- help output
|
|
195
195
|
- completion generation
|
|
196
|
-
-
|
|
196
|
+
- provider-safe tool schemas
|
|
197
197
|
- `pm contracts`
|
|
198
198
|
- extension command/action contract exposure
|
|
199
199
|
|
package/docs/COMMANDS.md
CHANGED
|
@@ -31,7 +31,7 @@ Tracked documentation work: [pm-1sb2](../.agents/pm/tasks/pm-1sb2.toon).
|
|
|
31
31
|
| Verification | `test`, `test-all`, `test-runs`, `validate`, `gc` | run linked tests and repository checks |
|
|
32
32
|
| History | `history`, `activity`, `restore`, `stats` | inspect and recover item state |
|
|
33
33
|
| Calendar | `calendar`, `cal` | project deadlines, reminders, and events |
|
|
34
|
-
|
|
|
34
|
+
| Packages | `install`, `upgrade`, `package`, `packages`, `extension`, package/extension command groups | install, upgrade, manage, and run package-backed extension commands |
|
|
35
35
|
| Machines | `guide`, `contracts`, `completion`, `help` | local docs routing plus command contracts and shell helpers |
|
|
36
36
|
|
|
37
37
|
## Bootstrap
|
|
@@ -44,6 +44,19 @@ pm health --check-only
|
|
|
44
44
|
|
|
45
45
|
`pm init` creates `.agents/pm`. `pm health --check-only` inspects without refreshing optional search artifacts.
|
|
46
46
|
|
|
47
|
+
## Packages
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
pm install '*' --project
|
|
51
|
+
pm install npm:@scope/pm-package --project
|
|
52
|
+
pm package doctor --project --detail summary
|
|
53
|
+
pm upgrade --dry-run
|
|
54
|
+
pm upgrade --packages-only
|
|
55
|
+
pm upgrade --cli-only --repair
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
`pm install` and `pm package` are the preferred package-first workflow. `pm install '*'`, shell-expanded `pm install *`, and `pm install all` install bundled first-party packages. `pm extension` remains as a compatibility command for direct extension lifecycle operations.
|
|
59
|
+
|
|
47
60
|
## Triage
|
|
48
61
|
|
|
49
62
|
```bash
|
package/docs/EXTENSIONS.md
CHANGED
|
@@ -1,25 +1,58 @@
|
|
|
1
|
-
# Extensions
|
|
1
|
+
# Packages and Extensions
|
|
2
|
+
|
|
3
|
+
Packages let you add or override `pm` runtime behavior without modifying core `pm-cli` sources. A package can currently contain one or more runtime extensions, and the package-first command surface is the preferred user-facing workflow.
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
`pm extension ...` remains supported for compatibility. New scripts and docs should prefer `pm install ...` and `pm package ...`.
|
|
4
6
|
|
|
5
|
-
This document is the canonical extension reference for manifest contracts, governance policy, trust and sandbox controls, reload workflows, and diagnostics.
|
|
7
|
+
This document is the canonical package/extension reference for manifest contracts, governance policy, trust and sandbox controls, reload workflows, and diagnostics.
|
|
6
8
|
|
|
7
9
|
## Quick Start
|
|
8
10
|
|
|
9
11
|
```bash
|
|
10
|
-
# 1) Scaffold
|
|
11
|
-
pm
|
|
12
|
+
# 1) Scaffold a package extension
|
|
13
|
+
pm package init ./my-package-extension
|
|
12
14
|
|
|
13
15
|
# 2) Install in project scope
|
|
14
|
-
pm
|
|
16
|
+
pm install ./my-package --project
|
|
17
|
+
|
|
18
|
+
# Or install all bundled first-party packages
|
|
19
|
+
pm install '*' --project
|
|
15
20
|
|
|
16
21
|
# 3) Run diagnostics
|
|
17
|
-
pm
|
|
22
|
+
pm package doctor --project --detail summary
|
|
18
23
|
|
|
19
|
-
# 4)
|
|
20
|
-
pm
|
|
24
|
+
# 4) Plan CLI/SDK and package upgrades
|
|
25
|
+
pm upgrade --dry-run
|
|
26
|
+
|
|
27
|
+
# 5) Reload runtime modules after local edits
|
|
28
|
+
pm package reload --project
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Compatibility equivalents:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pm extension init ./my-package
|
|
35
|
+
pm extension install ./my-package --project
|
|
36
|
+
pm extension doctor --project --detail summary
|
|
37
|
+
pm extension reload --project
|
|
21
38
|
```
|
|
22
39
|
|
|
40
|
+
## Upgrade Workflow
|
|
41
|
+
|
|
42
|
+
`pm upgrade` is the package-first update entrypoint:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
pm upgrade --dry-run # plan CLI/SDK and project package updates
|
|
46
|
+
pm upgrade # update the global pm CLI/SDK, then refresh project packages
|
|
47
|
+
pm upgrade --packages-only # refresh managed packages without changing the CLI
|
|
48
|
+
pm upgrade todos --dry-run # plan one managed package refresh
|
|
49
|
+
pm upgrade --cli-only --repair # force a global CLI/SDK reinstall through npm
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
CLI/SDK upgrades use `npm install -g @unbrained/pm-cli@<tag>`.
|
|
53
|
+
Managed package upgrades reuse the source recorded at install time, including `npm:`, GitHub, local, and first-party package paths.
|
|
54
|
+
Use `--tag <version-or-dist-tag>` to target a registry tag such as `latest` or `next`.
|
|
55
|
+
|
|
23
56
|
## Extension Locations
|
|
24
57
|
|
|
25
58
|
- project scope: `.agents/pm/extensions/<name>/`
|
|
@@ -31,6 +64,62 @@ Runtime path overrides:
|
|
|
31
64
|
- `PM_PATH`: project tracker root override
|
|
32
65
|
- `PM_GLOBAL_PATH`: global profile root override
|
|
33
66
|
|
|
67
|
+
## Package Sources
|
|
68
|
+
|
|
69
|
+
`pm install` accepts these package sources:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
pm install ./local-package
|
|
73
|
+
pm install /absolute/path/to/package
|
|
74
|
+
pm install npm:@scope/package
|
|
75
|
+
pm install npm:package@1.2.3
|
|
76
|
+
pm install https://github.com/org/repo
|
|
77
|
+
pm install --github org/repo/path --ref main
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Package roots can expose resources with a `pm` manifest in `package.json`:
|
|
81
|
+
|
|
82
|
+
```json
|
|
83
|
+
{
|
|
84
|
+
"name": "my-pm-package",
|
|
85
|
+
"keywords": ["pm-package"],
|
|
86
|
+
"pm": {
|
|
87
|
+
"extensions": ["extensions/my-extension"]
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
The SDK exposes this project-management package model through `PM_PACKAGE_RESOURCE_KINDS`, `PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS`, and `readPmPackageManifest`. Package installation activates runtime extension resources. Agent-specific bundles such as prompts, skills, and MCP servers should live in separate agent adapter packages rather than the core `pm` package contract.
|
|
93
|
+
|
|
94
|
+
When no manifest is present, `pm` discovers conventional extension directories:
|
|
95
|
+
|
|
96
|
+
- `.agents/pm/extensions/`
|
|
97
|
+
- `extensions/`
|
|
98
|
+
- `.custom/pm-extensions/`
|
|
99
|
+
- `.custom/pm-extension/`
|
|
100
|
+
|
|
101
|
+
If a package contains multiple extension manifests, install the exact extension path so the managed state has one deterministic package target.
|
|
102
|
+
|
|
103
|
+
First-party optional packages are shipped as package roots under `packages/`:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
pm install '*' --project
|
|
107
|
+
pm install all --project
|
|
108
|
+
pm install packages/pm-beads --project
|
|
109
|
+
pm install packages/pm-todos --project
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
`pm install '*'` and `pm install all` install every bundled first-party package in deterministic alias order. If your shell expands `pm install *`, pm recognizes that expansion and treats it as the same bundled-package install-all request.
|
|
113
|
+
|
|
114
|
+
Compatibility aliases remain available:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
pm install beads --project
|
|
118
|
+
pm install todos --project
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Those aliases install package-shipped extension sources. They are then tracked in managed package state and can be refreshed with `pm upgrade --packages-only`.
|
|
122
|
+
|
|
34
123
|
## Manifest Contract
|
|
35
124
|
|
|
36
125
|
### Manifest v1 (supported)
|
|
@@ -184,13 +273,13 @@ pm extension --doctor --project --detail deep --trace
|
|
|
184
273
|
Management commands:
|
|
185
274
|
|
|
186
275
|
```bash
|
|
187
|
-
pm
|
|
188
|
-
pm
|
|
189
|
-
pm
|
|
190
|
-
pm
|
|
191
|
-
pm
|
|
192
|
-
pm
|
|
193
|
-
pm
|
|
276
|
+
pm package explore
|
|
277
|
+
pm package manage --project
|
|
278
|
+
pm package manage --project --runtime-probe
|
|
279
|
+
pm package manage --project --fix-managed-state
|
|
280
|
+
pm package activate my-extension --project
|
|
281
|
+
pm package deactivate my-extension --project
|
|
282
|
+
pm package uninstall my-extension --project
|
|
194
283
|
```
|
|
195
284
|
|
|
196
285
|
Common warning prefixes:
|
|
@@ -214,7 +303,7 @@ Common warning prefixes:
|
|
|
214
303
|
|
|
215
304
|
```bash
|
|
216
305
|
pm contracts --json
|
|
217
|
-
pm
|
|
306
|
+
pm package doctor --project --detail summary --strict-exit
|
|
218
307
|
```
|
|
219
308
|
|
|
220
309
|
6. Resolve warnings before enforcing `mode=enforce` and `trust_mode=enforce`.
|
|
@@ -726,9 +815,9 @@ pm extension scaffold ./my-extension
|
|
|
726
815
|
Install:
|
|
727
816
|
|
|
728
817
|
```bash
|
|
729
|
-
pm
|
|
730
|
-
pm
|
|
731
|
-
pm
|
|
818
|
+
pm package install ./my-package --project
|
|
819
|
+
pm package install github.com/unbraind/pm-cli/packages/pm-todos --project
|
|
820
|
+
pm install todos --project
|
|
732
821
|
```
|
|
733
822
|
|
|
734
823
|
Inspect and manage:
|
|
@@ -898,7 +987,7 @@ pm health --check-only
|
|
|
898
987
|
|
|
899
988
|
## Bundled Managed Extensions
|
|
900
989
|
|
|
901
|
-
`pm-cli` ships
|
|
990
|
+
`pm-cli` ships optional first-party package roots that are not auto-installed:
|
|
902
991
|
|
|
903
992
|
| Alias | Commands after install | Purpose |
|
|
904
993
|
|-------|------------------------|---------|
|
|
@@ -908,16 +997,10 @@ pm health --check-only
|
|
|
908
997
|
Install:
|
|
909
998
|
|
|
910
999
|
```bash
|
|
911
|
-
pm
|
|
912
|
-
pm
|
|
1000
|
+
pm install beads --project
|
|
1001
|
+
pm install todos --project
|
|
913
1002
|
```
|
|
914
1003
|
|
|
915
1004
|
## Starter Extension
|
|
916
1005
|
|
|
917
1006
|
See [examples/starter-extension](examples/starter-extension/README.md) for a compact extension that demonstrates all capability categories through the public SDK.
|
|
918
|
-
|
|
919
|
-
## Pi Wrapper
|
|
920
|
-
|
|
921
|
-
The Pi wrapper source is `.pi/extensions/pm-cli/index.ts`. It is an agent wrapper, not a runtime extension managed by `pm extension`.
|
|
922
|
-
|
|
923
|
-
Use [AGENTS.md](../AGENTS.md) for repository-specific Pi wrapper operating rules.
|
package/docs/QUICKSTART.md
CHANGED
|
@@ -23,10 +23,10 @@ pm --version
|
|
|
23
23
|
For updates, use the registry package again:
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
-
|
|
26
|
+
pm upgrade --cli-only
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
Do not use the GitHub git URL as the normal global update path. If a previous git-sourced install left a stale `pm` shim, run `bash scripts/install.sh --repair` from a checkout or uninstall the package before reinstalling from npm.
|
|
29
|
+
`pm upgrade` uses `npm install -g @unbrained/pm-cli@latest` for the CLI/SDK and can also refresh installed pm packages. Do not use the GitHub git URL as the normal global update path. If a previous git-sourced install left a stale `pm` shim, run `pm upgrade --cli-only --repair`, run `bash scripts/install.sh --repair` from a checkout, or uninstall the package before reinstalling from npm.
|
|
30
30
|
|
|
31
31
|
For one-off use:
|
|
32
32
|
|
|
@@ -34,6 +34,14 @@ For one-off use:
|
|
|
34
34
|
npx @unbrained/pm-cli --help
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
+
Optional first-party packages are installable on demand:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
pm install '*' --project
|
|
41
|
+
pm install all --project
|
|
42
|
+
pm package doctor --project --detail summary
|
|
43
|
+
```
|
|
44
|
+
|
|
37
45
|
## Initialize a Repository
|
|
38
46
|
|
|
39
47
|
```bash
|
package/docs/README.md
CHANGED
|
@@ -21,8 +21,7 @@ pm guide release --json
|
|
|
21
21
|
| New user | [Quickstart](QUICKSTART.md) | [Command Reference](COMMANDS.md) |
|
|
22
22
|
| Coding agent | [Agent Guide](AGENT_GUIDE.md) | [Configuration](CONFIGURATION.md), then command help |
|
|
23
23
|
| Maintainer | [Contributing](../CONTRIBUTING.md) | [Testing](TESTING.md), [Releasing](RELEASING.md), [Architecture](ARCHITECTURE.md) |
|
|
24
|
-
|
|
|
25
|
-
| Pi user | [Pi Package](PI_PACKAGE.md) | [Agent Guide](AGENT_GUIDE.md), then [Command Reference](COMMANDS.md) |
|
|
24
|
+
| Package author | [Packages and Extensions](EXTENSIONS.md) | [SDK](SDK.md), [starter extension](examples/starter-extension/README.md) |
|
|
26
25
|
| Codex user | [Codex Plugin](CODEX_PLUGIN.md) | [Agent Guide](AGENT_GUIDE.md), then [Command Reference](COMMANDS.md) |
|
|
27
26
|
| Machine client | `pm guide commands` | [Command Reference](COMMANDS.md#machine-contracts), then `pm contracts --json` |
|
|
28
27
|
|
|
@@ -34,9 +33,8 @@ pm guide release --json
|
|
|
34
33
|
- [Configuration](CONFIGURATION.md) - settings, storage formats, output, search, validation, and environment variables.
|
|
35
34
|
- [Testing](TESTING.md) - sandbox-safe local tests and linked-test orchestration.
|
|
36
35
|
- [Architecture](ARCHITECTURE.md) - contributor internals: storage, mutation flow, search, extensions, and command contracts.
|
|
37
|
-
- [Extensions](EXTENSIONS.md) - runtime extension lifecycle and API reference.
|
|
36
|
+
- [Packages and Extensions](EXTENSIONS.md) - package install workflows, runtime extension lifecycle, and API reference.
|
|
38
37
|
- [SDK](SDK.md) - public import surfaces and typed authoring examples.
|
|
39
|
-
- [Pi Package](PI_PACKAGE.md) - official Pi package install, native tool, skills, prompts, and workflows.
|
|
40
38
|
- [Codex Plugin](CODEX_PLUGIN.md) - native MCP plugin install, tools, skills, and safety notes.
|
|
41
39
|
- [Releasing](RELEASING.md) - maintainer release checklist and failure handling.
|
|
42
40
|
- [starter extension](examples/starter-extension/README.md) - compact extension scaffold reference.
|
|
@@ -49,7 +47,7 @@ pm guide release --json
|
|
|
49
47
|
| `commands` | [Command Reference](COMMANDS.md), [Configuration](CONFIGURATION.md) |
|
|
50
48
|
| `workflows` | [Agent Guide](AGENT_GUIDE.md), [Testing](TESTING.md) |
|
|
51
49
|
| `sdk` | [SDK](SDK.md), [Architecture](ARCHITECTURE.md) |
|
|
52
|
-
| `extensions` | [Extensions](EXTENSIONS.md), [starter extension](examples/starter-extension/README.md) |
|
|
50
|
+
| `extensions`, `packages` | [Packages and Extensions](EXTENSIONS.md), [starter extension](examples/starter-extension/README.md) |
|
|
53
51
|
| `skills` | [Agent Guide](AGENT_GUIDE.md) plus `.agents/skills/*` |
|
|
54
52
|
| `harnesses` | [Agent Guide](AGENT_GUIDE.md) plus `.agents/skills/HARNESS_COMPATIBILITY.md` |
|
|
55
53
|
| `release` | [Releasing](RELEASING.md), [CHANGELOG](../CHANGELOG.md) |
|
|
@@ -68,7 +66,7 @@ Community files:
|
|
|
68
66
|
2. Use [Command Reference](COMMANDS.md) for command families, not exhaustive flag memory.
|
|
69
67
|
3. Use `pm <command> --help --json` or `pm contracts --command <name> --flags-only --json` for exact flags.
|
|
70
68
|
4. Use [Architecture](ARCHITECTURE.md) only when changing internals or debugging behavior.
|
|
71
|
-
5. Use [SDK](SDK.md) and [Extensions](EXTENSIONS.md) only when authoring or troubleshooting extensions.
|
|
69
|
+
5. Use [SDK](SDK.md) and [Packages and Extensions](EXTENSIONS.md) only when authoring or troubleshooting packages/extensions.
|
|
72
70
|
|
|
73
71
|
## Tracker References
|
|
74
72
|
|
package/docs/SDK.md
CHANGED
|
@@ -29,9 +29,11 @@ npm install @unbrained/pm-cli
|
|
|
29
29
|
- `PM_CORE_COMMAND_NAMES`
|
|
30
30
|
- `PM_TOOL_ACTIONS`
|
|
31
31
|
- `PM_TOOL_PARAMETERS_SCHEMA`
|
|
32
|
-
- `
|
|
32
|
+
- `PM_PROVIDER_TOOL_PARAMETERS_SCHEMA`
|
|
33
33
|
- `PM_TOOL_ACTION_PARAMETER_CONTRACTS`
|
|
34
34
|
|
|
35
|
+
`PM_TOOL_ACTIONS` includes the package lifecycle actions and `upgrade`, so agents and apps can discover `pm upgrade` through `pm contracts` instead of hard-coding flags.
|
|
36
|
+
|
|
35
37
|
### Runtime contract constants
|
|
36
38
|
|
|
37
39
|
- `PM_EXTENSION_CAPABILITY_CONTRACTS`
|
|
@@ -91,7 +93,7 @@ Use runtime contracts for extension-aware schemas:
|
|
|
91
93
|
```bash
|
|
92
94
|
pm contracts --json
|
|
93
95
|
pm contracts --schema-only --json
|
|
94
|
-
pm contracts --command
|
|
96
|
+
pm contracts --command package --flags-only --json
|
|
95
97
|
pm contracts --action create --schema-only --json
|
|
96
98
|
```
|
|
97
99
|
|
|
@@ -101,7 +103,7 @@ Minimal script pattern:
|
|
|
101
103
|
import { PM_TOOL_ACTION_PARAMETER_CONTRACTS, isPmToolAction } from "@unbrained/pm-cli/sdk";
|
|
102
104
|
import { spawnSync } from "node:child_process";
|
|
103
105
|
|
|
104
|
-
const action = "
|
|
106
|
+
const action = "package-reload";
|
|
105
107
|
if (!isPmToolAction(action)) throw new Error("Unsupported action");
|
|
106
108
|
const contract = PM_TOOL_ACTION_PARAMETER_CONTRACTS[action];
|
|
107
109
|
console.log(contract.required, contract.optional);
|
|
@@ -174,7 +176,7 @@ npm install @unbrained/pm-cli
|
|
|
174
176
|
- `PM_CORE_COMMAND_NAMES`
|
|
175
177
|
- `PM_TOOL_ACTIONS`
|
|
176
178
|
- `PM_TOOL_PARAMETERS_SCHEMA`
|
|
177
|
-
- `
|
|
179
|
+
- `PM_PROVIDER_TOOL_PARAMETERS_SCHEMA`
|
|
178
180
|
- `PM_TOOL_ACTION_PARAMETER_CONTRACTS`
|
|
179
181
|
|
|
180
182
|
### Extension Runtime Contract Constants
|
|
@@ -310,7 +312,7 @@ Command/action contract exports:
|
|
|
310
312
|
- `PM_CORE_COMMAND_NAMES`
|
|
311
313
|
- `PM_TOOL_ACTIONS`
|
|
312
314
|
- `PM_TOOL_PARAMETERS_SCHEMA`
|
|
313
|
-
- `
|
|
315
|
+
- `PM_PROVIDER_TOOL_PARAMETERS_SCHEMA`
|
|
314
316
|
- `PM_TOOL_ACTION_PARAMETER_CONTRACTS`
|
|
315
317
|
|
|
316
318
|
Extension runtime contract exports:
|
|
@@ -353,7 +355,7 @@ export default defineExtension({
|
|
|
353
355
|
description: "Collect release readiness diagnostics.",
|
|
354
356
|
intent: "provide deterministic audit payloads for CI gates",
|
|
355
357
|
examples: ["pm release audit --strict"],
|
|
356
|
-
failure_hints: ["Run pm
|
|
358
|
+
failure_hints: ["Run pm package doctor --detail deep --trace on activation failures."],
|
|
357
359
|
flags: [{ long: "--strict", description: "Enable strict gate mode." }],
|
|
358
360
|
run: async (context) => ({
|
|
359
361
|
ok: true,
|
|
@@ -372,7 +374,7 @@ Use runtime `pm contracts` for extension-aware schemas:
|
|
|
372
374
|
```bash
|
|
373
375
|
pm contracts --json
|
|
374
376
|
pm contracts --schema-only --json
|
|
375
|
-
pm contracts --command
|
|
377
|
+
pm contracts --command package --flags-only --json
|
|
376
378
|
pm contracts --action create --schema-only --json
|
|
377
379
|
```
|
|
378
380
|
|
|
@@ -402,7 +404,7 @@ Recommended gate sequence:
|
|
|
402
404
|
```bash
|
|
403
405
|
pnpm build
|
|
404
406
|
pm contracts --schema-only --json > /tmp/pm-contracts.json
|
|
405
|
-
pm
|
|
407
|
+
pm package doctor --project --detail summary --strict-exit
|
|
406
408
|
node scripts/run-tests.mjs test -- tests/unit/contracts-command.spec.ts
|
|
407
409
|
node scripts/run-tests.mjs coverage
|
|
408
410
|
```
|
|
@@ -411,11 +413,9 @@ Reference workflow file:
|
|
|
411
413
|
|
|
412
414
|
- `docs/examples/ci/github-actions-pm-extension-gate.yml`
|
|
413
415
|
|
|
414
|
-
##
|
|
415
|
-
|
|
416
|
-
For provider-safe schemas, use `PM_PI_TOOL_PARAMETERS_SCHEMA`. It is flat, non-`oneOf`, and designed for tool providers that reject advanced schema constructs.
|
|
416
|
+
## Tooling Compatibility
|
|
417
417
|
|
|
418
|
-
|
|
418
|
+
For provider-safe schemas, use `PM_PROVIDER_TOOL_PARAMETERS_SCHEMA`. It is flat, non-`oneOf`, and designed for tool providers that reject advanced schema constructs. Agent-specific adapters should consume this SDK export from their own packages instead of adding agent runtime code to the main `pm` CLI.
|
|
419
419
|
|
|
420
420
|
## Related Docs
|
|
421
421
|
|
|
@@ -460,6 +460,10 @@ Common authoring exports:
|
|
|
460
460
|
- `EXTENSION_CAPABILITY_CONTRACT`
|
|
461
461
|
- `EXTENSION_CAPABILITY_CONTRACT_VERSION`
|
|
462
462
|
- `EXTENSION_CAPABILITY_LEGACY_ALIASES`
|
|
463
|
+
- `PM_PACKAGE_RESOURCE_KINDS`
|
|
464
|
+
- `PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS`
|
|
465
|
+
- `readPmPackageManifest`
|
|
466
|
+
- `collectPackageExtensionDirectories`
|
|
463
467
|
- `PM_CORE_COMMAND_NAMES`
|
|
464
468
|
- `PM_TOOL_ACTIONS`
|
|
465
469
|
- `PM_TOOL_PARAMETERS_SCHEMA`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unbrained/pm-cli",
|
|
3
|
-
"version": "2026.5.
|
|
3
|
+
"version": "2026.5.12",
|
|
4
4
|
"description": "Git-native project management CLI for humans and agents.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "unbrained",
|
|
@@ -48,16 +48,15 @@
|
|
|
48
48
|
"docs/**",
|
|
49
49
|
".claude-plugin/**",
|
|
50
50
|
"plugins/**",
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
".agents/pm/extensions/**",
|
|
51
|
+
"packages/pm-beads/**",
|
|
52
|
+
"packages/pm-todos/**",
|
|
54
53
|
"scripts/install.sh",
|
|
55
54
|
"scripts/install.ps1",
|
|
56
55
|
"marketplace.json"
|
|
57
56
|
],
|
|
58
57
|
"scripts": {
|
|
59
58
|
"build": "tsc -p tsconfig.json",
|
|
60
|
-
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
59
|
+
"typecheck": "tsc --noEmit -p tsconfig.json && tsc -p tsconfig.packages.json",
|
|
61
60
|
"start": "node dist/cli.js",
|
|
62
61
|
"dev": "tsx src/cli.ts",
|
|
63
62
|
"test": "node scripts/run-tests.mjs test",
|
|
@@ -88,36 +87,19 @@
|
|
|
88
87
|
"git-native",
|
|
89
88
|
"typescript",
|
|
90
89
|
"task-tracker",
|
|
91
|
-
"coding-agents"
|
|
92
|
-
"pi-package",
|
|
93
|
-
"pi-extension"
|
|
90
|
+
"coding-agents"
|
|
94
91
|
],
|
|
95
92
|
"license": "MIT",
|
|
96
93
|
"publishConfig": {
|
|
97
94
|
"access": "public"
|
|
98
95
|
},
|
|
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
96
|
"engines": {
|
|
111
97
|
"node": ">=20"
|
|
112
98
|
},
|
|
113
99
|
"peerDependencies": {
|
|
114
|
-
"@earendil-works/pi-coding-agent": "*",
|
|
115
100
|
"typebox": "*"
|
|
116
101
|
},
|
|
117
102
|
"peerDependenciesMeta": {
|
|
118
|
-
"@earendil-works/pi-coding-agent": {
|
|
119
|
-
"optional": true
|
|
120
|
-
},
|
|
121
103
|
"typebox": {
|
|
122
104
|
"optional": true
|
|
123
105
|
}
|
|
@@ -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.
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import { pathToFileURL } from "node:url";
|
|
2
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
3
3
|
|
|
4
4
|
const PM_PACKAGE_ROOT_ENV = "PM_CLI_PACKAGE_ROOT";
|
|
5
|
+
const CURRENT_EXTENSION_ROOT = path.dirname(fileURLToPath(import.meta.url));
|
|
5
6
|
|
|
6
7
|
export const manifest = {
|
|
7
8
|
name: "builtin-beads-import",
|
|
@@ -48,17 +49,31 @@ function resolvePackageRootCandidates() {
|
|
|
48
49
|
async function loadRuntimeModule() {
|
|
49
50
|
const attempted = [];
|
|
50
51
|
for (const packageRoot of resolvePackageRootCandidates()) {
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
const modulePaths = [
|
|
53
|
+
path.join(packageRoot, ".agents", "pm", "extensions", "beads", "runtime.js"),
|
|
54
|
+
path.join(packageRoot, "packages", "pm-beads", "extensions", "beads", "runtime.js"),
|
|
55
|
+
];
|
|
56
|
+
for (const modulePath of modulePaths) {
|
|
57
|
+
attempted.push(modulePath);
|
|
58
|
+
try {
|
|
59
|
+
return await import(pathToFileURL(modulePath).href);
|
|
60
|
+
} catch {
|
|
61
|
+
// Try the next package-root candidate.
|
|
62
|
+
}
|
|
57
63
|
}
|
|
58
64
|
}
|
|
65
|
+
|
|
66
|
+
const localRuntimePath = path.join(CURRENT_EXTENSION_ROOT, "runtime.js");
|
|
67
|
+
attempted.push(localRuntimePath);
|
|
68
|
+
try {
|
|
69
|
+
return await import(pathToFileURL(localRuntimePath).href);
|
|
70
|
+
} catch {
|
|
71
|
+
// Fall through to the diagnostic below.
|
|
72
|
+
}
|
|
73
|
+
|
|
59
74
|
throw new Error(
|
|
60
|
-
"Unable to resolve
|
|
61
|
-
`Tried: ${attempted.join(", ")}. Ensure PM_CLI_PACKAGE_ROOT points to an installed pm package root.`,
|
|
75
|
+
"Unable to resolve packaged beads extension runtime module. " +
|
|
76
|
+
`Tried: ${attempted.join(", ")}. Ensure the installed extension includes runtime.js or PM_CLI_PACKAGE_ROOT points to an installed pm package root.`,
|
|
62
77
|
);
|
|
63
78
|
}
|
|
64
79
|
|