@unbrained/pm-cli 2026.5.1 → 2026.5.3-5
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 +8 -1
- package/CHANGELOG.md +73 -4
- package/CONTRIBUTING.md +11 -5
- package/PRD.md +17 -1
- package/README.md +55 -1099
- package/SECURITY.md +6 -11
- package/dist/cli/bootstrap-args.d.ts +18 -0
- package/dist/cli/bootstrap-args.js +242 -0
- package/dist/cli/bootstrap-args.js.map +1 -0
- package/dist/cli/commander-usage.d.ts +17 -0
- package/dist/cli/commander-usage.js +178 -0
- package/dist/cli/commander-usage.js.map +1 -0
- package/dist/cli/commands/activity.d.ts +10 -0
- package/dist/cli/commands/activity.js +14 -10
- package/dist/cli/commands/activity.js.map +1 -1
- package/dist/cli/commands/aggregate.js.map +1 -1
- package/dist/cli/commands/append.js.map +1 -1
- package/dist/cli/commands/calendar.js +19 -34
- package/dist/cli/commands/calendar.js.map +1 -1
- package/dist/cli/commands/claim.js.map +1 -1
- package/dist/cli/commands/close.js.map +1 -1
- package/dist/cli/commands/comments-audit.js.map +1 -1
- package/dist/cli/commands/comments.js +1 -9
- package/dist/cli/commands/comments.js.map +1 -1
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/config.d.ts +21 -3
- package/dist/cli/commands/config.js +118 -2
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/context.d.ts +90 -1
- package/dist/cli/commands/context.js +496 -12
- package/dist/cli/commands/context.js.map +1 -1
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/create.js +2 -2
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/dedupe-audit.js +2 -11
- package/dist/cli/commands/dedupe-audit.js.map +1 -1
- package/dist/cli/commands/delete.js.map +1 -1
- package/dist/cli/commands/deps.js.map +1 -1
- package/dist/cli/commands/docs.js.map +1 -1
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/files.js +14 -2
- package/dist/cli/commands/files.js.map +1 -1
- package/dist/cli/commands/gc.js.map +1 -1
- package/dist/cli/commands/get.js.map +1 -1
- package/dist/cli/commands/health.js +16 -12
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history.js +1 -9
- package/dist/cli/commands/history.js.map +1 -1
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/learnings.js +1 -9
- package/dist/cli/commands/learnings.js.map +1 -1
- package/dist/cli/commands/list.d.ts +1 -0
- package/dist/cli/commands/list.js +13 -31
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/normalize.js +14 -23
- package/dist/cli/commands/normalize.js.map +1 -1
- package/dist/cli/commands/notes.js +1 -9
- package/dist/cli/commands/notes.js.map +1 -1
- package/dist/cli/commands/reindex.js +2 -7
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/restore.js.map +1 -1
- package/dist/cli/commands/search.js +4 -35
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/stats.js.map +1 -1
- package/dist/cli/commands/templates.js.map +1 -1
- package/dist/cli/commands/test-all.js.map +1 -1
- package/dist/cli/commands/test-runs.js +1 -11
- package/dist/cli/commands/test-runs.js.map +1 -1
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/update-many.js +1 -6
- package/dist/cli/commands/update-many.js.map +1 -1
- package/dist/cli/commands/update.js +2 -2
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/validate.js +23 -18
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/error-guidance.d.ts +13 -0
- package/dist/cli/error-guidance.js +56 -6
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/extension-command-help.d.ts +48 -0
- package/dist/cli/extension-command-help.js +389 -0
- package/dist/cli/extension-command-help.js.map +1 -0
- package/dist/cli/extension-command-options.js.map +1 -1
- package/dist/cli/help-content.js +9 -3
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/help-json-payload.d.ts +25 -0
- package/dist/cli/help-json-payload.js +265 -0
- package/dist/cli/help-json-payload.js.map +1 -0
- package/dist/cli/main.js +1000 -4456
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/migration-gates.d.ts +22 -0
- package/dist/cli/migration-gates.js +146 -0
- package/dist/cli/migration-gates.js.map +1 -0
- package/dist/cli/register-list-query.d.ts +2 -0
- package/dist/cli/register-list-query.js +317 -0
- package/dist/cli/register-list-query.js.map +1 -0
- package/dist/cli/register-mutation.d.ts +2 -0
- package/dist/cli/register-mutation.js +795 -0
- package/dist/cli/register-mutation.js.map +1 -0
- package/dist/cli/register-operations.d.ts +2 -0
- package/dist/cli/register-operations.js +610 -0
- package/dist/cli/register-operations.js.map +1 -0
- package/dist/cli/register-setup.d.ts +2 -0
- package/dist/cli/register-setup.js +334 -0
- package/dist/cli/register-setup.js.map +1 -0
- package/dist/cli/registration-helpers.d.ts +53 -0
- package/dist/cli/registration-helpers.js +669 -0
- package/dist/cli/registration-helpers.js.map +1 -0
- package/dist/cli/shared-parsers.d.ts +6 -0
- package/dist/cli/shared-parsers.js +40 -0
- package/dist/cli/shared-parsers.js.map +1 -0
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +3 -1
- package/dist/cli.js.map +1 -1
- package/dist/core/extensions/extension-types.d.ts +605 -0
- package/dist/core/extensions/extension-types.js +22 -0
- package/dist/core/extensions/extension-types.js.map +1 -0
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/item-fields.js.map +1 -1
- package/dist/core/extensions/loader.d.ts +2 -586
- package/dist/core/extensions/loader.js +3 -21
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runtime-registrations.js.map +1 -1
- package/dist/core/fs/fs-utils.js.map +1 -1
- package/dist/core/fs/index.js.map +1 -1
- package/dist/core/history/history-stream-policy.js.map +1 -1
- package/dist/core/history/history.js.map +1 -1
- package/dist/core/history/index.js.map +1 -1
- package/dist/core/item/id.js.map +1 -1
- package/dist/core/item/index.js.map +1 -1
- package/dist/core/item/item-format.js.map +1 -1
- package/dist/core/item/parent-reference-policy.js.map +1 -1
- package/dist/core/item/parse.js +6 -0
- package/dist/core/item/parse.js.map +1 -1
- package/dist/core/item/sprint-release-format.js.map +1 -1
- package/dist/core/item/status.js.map +1 -1
- package/dist/core/item/type-registry.js.map +1 -1
- package/dist/core/lock/index.js.map +1 -1
- package/dist/core/lock/lock.js +1 -6
- package/dist/core/lock/lock.js.map +1 -1
- package/dist/core/output/command-aware.js.map +1 -1
- package/dist/core/output/output.js.map +1 -1
- package/dist/core/schema/runtime-field-filters.js.map +1 -1
- package/dist/core/schema/runtime-field-values.js.map +1 -1
- package/dist/core/schema/runtime-schema.js.map +1 -1
- package/dist/core/search/cache.js +1 -7
- package/dist/core/search/cache.js.map +1 -1
- package/dist/core/search/embedding-batches.js +4 -0
- package/dist/core/search/embedding-batches.js.map +1 -1
- package/dist/core/search/http-client.d.ts +29 -0
- package/dist/core/search/http-client.js +64 -0
- package/dist/core/search/http-client.js.map +1 -0
- package/dist/core/search/providers.d.ts +3 -13
- package/dist/core/search/providers.js +19 -88
- package/dist/core/search/providers.js.map +1 -1
- package/dist/core/search/semantic-defaults.js +2 -7
- package/dist/core/search/semantic-defaults.js.map +1 -1
- package/dist/core/search/vector-stores.d.ts +4 -13
- package/dist/core/search/vector-stores.js +40 -93
- package/dist/core/search/vector-stores.js.map +1 -1
- package/dist/core/sentry/helpers.d.ts +27 -0
- package/dist/core/sentry/helpers.js +171 -0
- package/dist/core/sentry/helpers.js.map +1 -0
- package/dist/core/sentry/instrument.d.ts +25 -0
- package/dist/core/sentry/instrument.js +204 -0
- package/dist/core/sentry/instrument.js.map +1 -0
- package/dist/core/shared/command-types.js.map +1 -1
- package/dist/core/shared/conflict-markers.js.map +1 -1
- package/dist/core/shared/constants.d.ts +3 -0
- package/dist/core/shared/constants.js +58 -1
- package/dist/core/shared/constants.js.map +1 -1
- package/dist/core/shared/errors.js.map +1 -1
- package/dist/core/shared/index.d.ts +1 -0
- package/dist/core/shared/index.js +1 -0
- package/dist/core/shared/index.js.map +1 -1
- package/dist/core/shared/primitives.d.ts +13 -0
- package/dist/core/shared/primitives.js +33 -0
- package/dist/core/shared/primitives.js.map +1 -0
- package/dist/core/shared/serialization.js.map +1 -1
- package/dist/core/shared/text-normalization.js.map +1 -1
- package/dist/core/shared/time.js.map +1 -1
- package/dist/core/store/front-matter-cache.d.ts +6 -0
- package/dist/core/store/front-matter-cache.js +150 -0
- package/dist/core/store/front-matter-cache.js.map +1 -0
- package/dist/core/store/index.js.map +1 -1
- package/dist/core/store/item-format-migration.js.map +1 -1
- package/dist/core/store/item-store.js +46 -36
- package/dist/core/store/item-store.js.map +1 -1
- package/dist/core/store/paths.js.map +1 -1
- package/dist/core/store/settings.js +36 -0
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/telemetry/consent.js.map +1 -1
- package/dist/core/telemetry/observability.d.ts +24 -0
- package/dist/core/telemetry/observability.js +185 -0
- package/dist/core/telemetry/observability.js.map +1 -0
- package/dist/core/telemetry/runtime.d.ts +29 -3
- package/dist/core/telemetry/runtime.js +337 -25
- package/dist/core/telemetry/runtime.js.map +1 -1
- package/dist/core/test/background-runs.js.map +1 -1
- package/dist/core/test/item-test-run-tracking.js.map +1 -1
- package/dist/sdk/cli-contracts.js +28 -0
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types.d.ts +21 -0
- package/dist/types.js +11 -0
- package/dist/types.js.map +1 -1
- package/docs/AGENT_GUIDE.md +125 -0
- package/docs/ARCHITECTURE.md +201 -478
- package/docs/COMMANDS.md +209 -0
- package/docs/CONFIGURATION.md +146 -0
- package/docs/EXTENSIONS.md +146 -645
- package/docs/QUICKSTART.md +108 -0
- package/docs/README.md +70 -0
- package/docs/RELEASING.md +92 -50
- package/docs/SDK.md +127 -68
- package/docs/TESTING.md +125 -0
- package/docs/examples/starter-extension/README.md +39 -25
- package/package.json +24 -11
- package/dist/command-types.d.ts +0 -1
- package/dist/command-types.js +0 -2
- package/dist/command-types.js.map +0 -1
- package/dist/constants.d.ts +0 -1
- package/dist/constants.js +0 -2
- package/dist/constants.js.map +0 -1
- package/dist/errors.d.ts +0 -1
- package/dist/errors.js +0 -2
- package/dist/errors.js.map +0 -1
- package/dist/fs-utils.d.ts +0 -1
- package/dist/fs-utils.js +0 -2
- package/dist/fs-utils.js.map +0 -1
- package/dist/history.d.ts +0 -1
- package/dist/history.js +0 -2
- package/dist/history.js.map +0 -1
- package/dist/id.d.ts +0 -1
- package/dist/id.js +0 -2
- package/dist/id.js.map +0 -1
- package/dist/item-format.d.ts +0 -1
- package/dist/item-format.js +0 -2
- package/dist/item-format.js.map +0 -1
- package/dist/item-store.d.ts +0 -1
- package/dist/item-store.js +0 -2
- package/dist/item-store.js.map +0 -1
- package/dist/lock.d.ts +0 -1
- package/dist/lock.js +0 -2
- package/dist/lock.js.map +0 -1
- package/dist/output.d.ts +0 -1
- package/dist/output.js +0 -2
- package/dist/output.js.map +0 -1
- package/dist/parse.d.ts +0 -1
- package/dist/parse.js +0 -2
- package/dist/parse.js.map +0 -1
- package/dist/paths.d.ts +0 -1
- package/dist/paths.js +0 -2
- package/dist/paths.js.map +0 -1
- package/dist/serialization.d.ts +0 -1
- package/dist/serialization.js +0 -2
- package/dist/serialization.js.map +0 -1
- package/dist/settings.d.ts +0 -1
- package/dist/settings.js +0 -2
- package/dist/settings.js.map +0 -1
- package/dist/time.d.ts +0 -1
- package/dist/time.js +0 -2
- package/dist/time.js.map +0 -1
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Quickstart
|
|
2
|
+
|
|
3
|
+
Use this page to get from a clean repository to a tracked, verified item.
|
|
4
|
+
|
|
5
|
+
## Agent Quick Context
|
|
6
|
+
|
|
7
|
+
- Start with `pm init`.
|
|
8
|
+
- Create items with enough metadata to route work, then enrich later.
|
|
9
|
+
- Claim before implementation.
|
|
10
|
+
- Link changed files, docs, and tests to the item.
|
|
11
|
+
- Close only after evidence is recorded.
|
|
12
|
+
|
|
13
|
+
Tracked documentation work: [pm-1sb2](../.agents/pm/tasks/pm-1sb2.toon).
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install -g @unbrained/pm-cli
|
|
19
|
+
pm --version
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
For one-off use:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npx @unbrained/pm-cli --help
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Initialize a Repository
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pm init
|
|
32
|
+
pm health --check-only
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
`pm init` creates `.agents/pm/` with settings, item folders, history, locks, search cache directories, and project extension storage.
|
|
36
|
+
|
|
37
|
+
## Create Your First Item
|
|
38
|
+
|
|
39
|
+
Use strict create mode when all required fields are ready. Use progressive mode for staged triage.
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pm create \
|
|
43
|
+
--title "Add restore retry logging" \
|
|
44
|
+
--description "Restore should explain stale lock retry behavior." \
|
|
45
|
+
--type Task \
|
|
46
|
+
--status open \
|
|
47
|
+
--priority 1 \
|
|
48
|
+
--tags "restore,locks" \
|
|
49
|
+
--ac "Retry logs are visible and regression coverage passes." \
|
|
50
|
+
--create-mode progressive
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Useful item types:
|
|
54
|
+
|
|
55
|
+
| Type | Use |
|
|
56
|
+
|------|-----|
|
|
57
|
+
| `Epic` | broad outcome or initiative |
|
|
58
|
+
| `Feature` | user-facing capability or major slice |
|
|
59
|
+
| `Task` | implementation work |
|
|
60
|
+
| `Issue` | bug or defect |
|
|
61
|
+
| `Decision` | recorded choice and rationale |
|
|
62
|
+
| `Event`, `Reminder`, `Milestone`, `Meeting` | calendar-aware planning |
|
|
63
|
+
|
|
64
|
+
## Find and Claim Work
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
pm context --limit 10
|
|
68
|
+
pm search "restore lock retry" --limit 10
|
|
69
|
+
pm list-open --limit 20
|
|
70
|
+
pm claim <item-id>
|
|
71
|
+
pm update <item-id> --status in_progress --message "Start implementation"
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Do not create a duplicate item until `context`, `search`, and list commands show no relevant active item.
|
|
75
|
+
|
|
76
|
+
## Link Work Artifacts
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
pm files <item-id> --add path=src/core/lock/lock.ts,scope=project,note="implementation"
|
|
80
|
+
pm docs <item-id> --add path=docs/ARCHITECTURE.md,scope=project,note="design context"
|
|
81
|
+
pm test <item-id> --add command="node scripts/run-tests.mjs test -- tests/unit/lock.spec.ts",scope=project,timeout_seconds=240
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Use `node scripts/run-tests.mjs ...` for linked tests so tracker data is sandboxed.
|
|
85
|
+
|
|
86
|
+
## Record Evidence and Close
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
pm test <item-id> --run --progress
|
|
90
|
+
pm comments <item-id> "Evidence: linked lock regression passed."
|
|
91
|
+
pm close <item-id> "Acceptance criteria met; linked regression passed." --validate-close warn
|
|
92
|
+
pm release <item-id>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
For broad readiness checks:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
pnpm build
|
|
99
|
+
node scripts/run-tests.mjs coverage
|
|
100
|
+
pm validate --check-resolution --check-history-drift
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Next Pages
|
|
104
|
+
|
|
105
|
+
- [Agent Guide](AGENT_GUIDE.md) for the full canonical workflow.
|
|
106
|
+
- [Command Reference](COMMANDS.md) for command families and examples.
|
|
107
|
+
- [Configuration](CONFIGURATION.md) for output, storage, search, and validation settings.
|
|
108
|
+
- [Testing](TESTING.md) for sandbox and linked-test details.
|
package/docs/README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# pm-cli Documentation
|
|
2
|
+
|
|
3
|
+
This directory is the public documentation home for `pm-cli`. It is organized for progressive disclosure: read the smallest page that answers the current question, then follow links only when more detail is needed.
|
|
4
|
+
|
|
5
|
+
## Read Path
|
|
6
|
+
|
|
7
|
+
| Reader | First page | Then read |
|
|
8
|
+
|--------|------------|-----------|
|
|
9
|
+
| New user | [Quickstart](QUICKSTART.md) | [Command Reference](COMMANDS.md) |
|
|
10
|
+
| Coding agent | [Agent Guide](AGENT_GUIDE.md) | [Configuration](CONFIGURATION.md), then command help |
|
|
11
|
+
| Maintainer | [Contributing](../CONTRIBUTING.md) | [Testing](TESTING.md), [Releasing](RELEASING.md), [Architecture](ARCHITECTURE.md) |
|
|
12
|
+
| Extension author | [Extensions](EXTENSIONS.md) | [SDK](SDK.md), [starter extension](examples/starter-extension/README.md) |
|
|
13
|
+
| Machine client | [Command Reference](COMMANDS.md#machine-contracts) | `pm contracts --json` |
|
|
14
|
+
|
|
15
|
+
## Documentation Map
|
|
16
|
+
|
|
17
|
+
- [Quickstart](QUICKSTART.md) - install, initialize, create, claim, link, test, close.
|
|
18
|
+
- [Agent Guide](AGENT_GUIDE.md) - canonical agent loop, tracker linking, and token-minimal command choices.
|
|
19
|
+
- [Command Reference](COMMANDS.md) - command families with examples and when to use each family.
|
|
20
|
+
- [Configuration](CONFIGURATION.md) - settings, storage formats, output, search, validation, and environment variables.
|
|
21
|
+
- [Testing](TESTING.md) - sandbox-safe local tests and linked-test orchestration.
|
|
22
|
+
- [Architecture](ARCHITECTURE.md) - contributor internals: storage, mutation flow, search, extensions, and command contracts.
|
|
23
|
+
- [Extensions](EXTENSIONS.md) - runtime extension lifecycle and API reference.
|
|
24
|
+
- [SDK](SDK.md) - public import surfaces and typed authoring examples.
|
|
25
|
+
- [Releasing](RELEASING.md) - maintainer release checklist and failure handling.
|
|
26
|
+
- [starter extension](examples/starter-extension/README.md) - compact extension scaffold reference.
|
|
27
|
+
|
|
28
|
+
Community files:
|
|
29
|
+
|
|
30
|
+
- [Contributing](../CONTRIBUTING.md)
|
|
31
|
+
- [Security](../SECURITY.md)
|
|
32
|
+
- [Code of Conduct](../CODE_OF_CONDUCT.md)
|
|
33
|
+
- [Changelog](../CHANGELOG.md)
|
|
34
|
+
- [License](../LICENSE)
|
|
35
|
+
|
|
36
|
+
## Agent Routing Rules
|
|
37
|
+
|
|
38
|
+
1. Start with [Agent Guide](AGENT_GUIDE.md) for workflow rules.
|
|
39
|
+
2. Use [Command Reference](COMMANDS.md) for command families, not exhaustive flag memory.
|
|
40
|
+
3. Use `pm <command> --help --json` or `pm contracts --command <name> --flags-only --json` for exact flags.
|
|
41
|
+
4. Use [Architecture](ARCHITECTURE.md) only when changing internals or debugging behavior.
|
|
42
|
+
5. Use [SDK](SDK.md) and [Extensions](EXTENSIONS.md) only when authoring or troubleshooting extensions.
|
|
43
|
+
|
|
44
|
+
## Tracker References
|
|
45
|
+
|
|
46
|
+
This documentation structure is tracked through:
|
|
47
|
+
|
|
48
|
+
- [pm-3042](../.agents/pm/epics/pm-3042.toon)
|
|
49
|
+
- [pm-r9gu](../.agents/pm/features/pm-r9gu.toon)
|
|
50
|
+
- [pm-1sb2](../.agents/pm/tasks/pm-1sb2.toon)
|
|
51
|
+
|
|
52
|
+
When changing docs, link files back to the active item:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
pm docs <item-id> --add path=docs/README.md,scope=project,note="documentation index"
|
|
56
|
+
pm comments <item-id> "Docs updated; links and build verified."
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Public Boundary
|
|
60
|
+
|
|
61
|
+
Public docs must not link to ignored local operations artifacts, unpublished evidence logs, credentials, host-specific runbooks, or private service details. Keep those materials local and out of packaged releases.
|
|
62
|
+
|
|
63
|
+
## Maintenance Checklist
|
|
64
|
+
|
|
65
|
+
- Keep links relative and GitHub-compatible.
|
|
66
|
+
- Keep README short; move detail into focused pages.
|
|
67
|
+
- Put a short "Agent Quick Context" near the top of deep docs.
|
|
68
|
+
- Prefer commands that agents can copy exactly.
|
|
69
|
+
- Use `pm` item IDs as durable references when docs explain tracked work.
|
|
70
|
+
- Run link/search checks before closing documentation tasks.
|
package/docs/RELEASING.md
CHANGED
|
@@ -1,69 +1,107 @@
|
|
|
1
1
|
# Releasing `@unbrained/pm-cli`
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This page is for maintainers cutting npm and GitHub releases. It assumes release work is tracked with `pm`.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Agent Quick Context
|
|
6
|
+
|
|
7
|
+
- Release versioning is calendar SemVer-compatible: `YYYY.M.D` or `YYYY.M.D-N`.
|
|
8
|
+
- Daily release preparation is owned by the GitHub Actions auto-release workflow.
|
|
9
|
+
- Publishing is owned by the tag-driven GitHub Actions release workflow.
|
|
10
|
+
- Do not run manual `npm publish`.
|
|
11
|
+
- Run local parity gates before pushing release tags.
|
|
6
12
|
|
|
7
|
-
|
|
13
|
+
Tracked documentation work: [pm-1sb2](../.agents/pm/tasks/pm-1sb2.toon).
|
|
8
14
|
|
|
9
|
-
|
|
10
|
-
- `YYYY.M.D-N` for additional releases on the same date (`N >= 2`)
|
|
15
|
+
## Version Policy
|
|
11
16
|
|
|
12
17
|
Examples:
|
|
13
18
|
|
|
14
|
-
-
|
|
15
|
-
-
|
|
19
|
+
- first release on 2026-05-01: `2026.5.1`
|
|
20
|
+
- second release on 2026-05-01: `2026.5.1-2`
|
|
16
21
|
|
|
17
|
-
|
|
22
|
+
Check the next version:
|
|
18
23
|
|
|
19
24
|
```bash
|
|
20
25
|
pnpm version:next
|
|
21
26
|
```
|
|
22
27
|
|
|
23
|
-
|
|
28
|
+
Validate the current package version:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pnpm version:check
|
|
32
|
+
```
|
|
24
33
|
|
|
25
34
|
## One-Time Setup
|
|
26
35
|
|
|
27
|
-
- Add `NPM_TOKEN` as a GitHub Environment or repository secret
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
- Keep `package.json` repository, homepage, and bugs URLs aligned with
|
|
36
|
+
- Add `NPM_TOKEN` as a GitHub Environment or repository secret.
|
|
37
|
+
- Add `SENTRY_AUTH_TOKEN` as an optional GitHub Environment or repository secret when Sentry release creation and sourcemap upload should run. The release workflow skips this step cleanly when the secret is absent.
|
|
38
|
+
- Keep any `release` environment compatible with free GitHub features. This repository is public, so environment secrets and tag/branch deployment rules are compatible with the free GitHub path; do not add paid-only release gates.
|
|
39
|
+
- Ensure `GITHUB_TOKEN` has `contents: write` for GitHub Release creation.
|
|
40
|
+
- Keep `package.json` repository, homepage, and bugs URLs aligned with `https://github.com/unbraind/pm-cli`.
|
|
41
|
+
- Keep npm automation token settings compatible with provenance publishing. The release workflow must keep `id-token: write`, a GitHub-hosted runner, and `npm publish --access public --provenance`.
|
|
32
42
|
|
|
33
|
-
##
|
|
43
|
+
## Automated Daily Driver
|
|
34
44
|
|
|
35
|
-
|
|
45
|
+
`.github/workflows/auto-release.yml` runs once per day and can also be dispatched manually.
|
|
46
|
+
|
|
47
|
+
Policy:
|
|
48
|
+
|
|
49
|
+
- release only when commits exist after the latest release tag
|
|
50
|
+
- release at most once per UTC day by default
|
|
51
|
+
- same-day follow-up release (`YYYY.M.D-N`) is manual-only via `allow_same_day_release=true`
|
|
52
|
+
- release preparation must pass all quality and compatibility gates before commit+tag push
|
|
53
|
+
|
|
54
|
+
Pipeline entrypoint:
|
|
36
55
|
|
|
37
56
|
```bash
|
|
38
|
-
|
|
57
|
+
node scripts/release/run-release-pipeline.mjs
|
|
39
58
|
```
|
|
40
59
|
|
|
41
|
-
|
|
60
|
+
The pipeline performs:
|
|
61
|
+
|
|
62
|
+
1. change detection + one-release-per-day guard
|
|
63
|
+
2. version bump + changelog promotion from `[Unreleased]`
|
|
64
|
+
3. strict gates (build, typecheck, coverage, static quality, compatibility, security, smoke checks, reliability gate)
|
|
65
|
+
4. release note generation from changelog + pm evidence
|
|
66
|
+
5. commit and tag creation (plus optional push)
|
|
67
|
+
|
|
68
|
+
## Local Release Parity Checklist
|
|
42
69
|
|
|
43
|
-
|
|
70
|
+
1. Confirm or compute the version.
|
|
44
71
|
|
|
45
72
|
```bash
|
|
46
|
-
pnpm
|
|
47
|
-
pnpm release:notes -- --version "$(node -p 'require("./package.json").version')" --output /tmp/pm-cli-release-notes.md
|
|
73
|
+
pnpm version:next
|
|
48
74
|
```
|
|
49
75
|
|
|
50
|
-
|
|
76
|
+
2. Verify previous-version tracker compatibility in a temporary project before release asset edits.
|
|
77
|
+
|
|
78
|
+
Create representative data with the latest published package and then read, mutate, run linked tests, validate, and health-check the same temp `PM_PATH` with the current build. The temp run must use isolated `PM_PATH` and `PM_GLOBAL_PATH`; never point compatibility tests at the repository's real tracker data.
|
|
79
|
+
|
|
80
|
+
Minimum coverage:
|
|
81
|
+
|
|
82
|
+
- parent and dependency links
|
|
83
|
+
- comments, notes, learnings, body, reminders, events
|
|
84
|
+
- linked files, docs, and tests
|
|
85
|
+
- closed issue metadata and history drift checks
|
|
86
|
+
- current-build write mutation and item-count preservation
|
|
87
|
+
|
|
88
|
+
3. Review private reliability signals.
|
|
89
|
+
|
|
90
|
+
Use maintainer-only local workflows for reliability checks and incident triage. Keep operational details, infrastructure topology, and raw diagnostics out of tracked release documentation and release notes.
|
|
91
|
+
|
|
92
|
+
If private reliability checks identify repeated user friction, either confirm the current release already contains the remediation with regression coverage or fix it before continuing.
|
|
93
|
+
|
|
94
|
+
4. Run the same release pipeline locally.
|
|
51
95
|
|
|
52
96
|
```bash
|
|
53
|
-
|
|
54
|
-
pnpm
|
|
55
|
-
pnpm typecheck
|
|
56
|
-
pnpm test
|
|
57
|
-
pnpm test:coverage
|
|
58
|
-
node scripts/run-tests.mjs coverage
|
|
59
|
-
pnpm version:check
|
|
60
|
-
pnpm security:scan
|
|
61
|
-
pnpm smoke:npx
|
|
62
|
-
```
|
|
97
|
+
# Read-only parity check
|
|
98
|
+
pnpm release:pipeline:dry-run
|
|
63
99
|
|
|
64
|
-
|
|
100
|
+
# Full local preparation (version/changelog mutation + local commit/tag)
|
|
101
|
+
pnpm release:pipeline -- --telemetry-mode required
|
|
102
|
+
```
|
|
65
103
|
|
|
66
|
-
|
|
104
|
+
5. Push branch and tag after local green.
|
|
67
105
|
|
|
68
106
|
```bash
|
|
69
107
|
git push origin main
|
|
@@ -71,22 +109,28 @@ git tag v<version>
|
|
|
71
109
|
git push origin v<version>
|
|
72
110
|
```
|
|
73
111
|
|
|
74
|
-
##
|
|
112
|
+
## GitHub Workflow
|
|
75
113
|
|
|
76
|
-
`.github/workflows/release.yml` runs on `v*.*.*` tags and
|
|
114
|
+
`.github/workflows/release.yml` runs on `v*.*.*` tags and handles:
|
|
77
115
|
|
|
78
|
-
- full-history checkout
|
|
116
|
+
- full-history checkout
|
|
79
117
|
- pnpm install with frozen lockfile
|
|
80
118
|
- version policy and tag guard
|
|
81
|
-
- secret
|
|
82
|
-
- build, typecheck, test
|
|
119
|
+
- secret scan
|
|
120
|
+
- build, typecheck, test, and coverage
|
|
121
|
+
- static quality gate (complexity, duplication, dead/orphan module, file/folder hygiene)
|
|
122
|
+
- temporary-project compatibility gate against latest published tracker data
|
|
123
|
+
- reliability threshold gate (Sentry severity threshold, telemetry policy mode)
|
|
124
|
+
- sandboxed `pm` coverage
|
|
125
|
+
- optional Sentry release metadata and sourcemap upload when `SENTRY_AUTH_TOKEN` is configured
|
|
83
126
|
- npm pack dry run and npx tarball smoke test
|
|
84
|
-
- generated release notes from
|
|
85
|
-
-
|
|
127
|
+
- generated release notes from changelog plus sanitized tracker metadata
|
|
128
|
+
- artifact uploads
|
|
86
129
|
- `npm publish --access public --provenance`
|
|
87
|
-
-
|
|
130
|
+
- post-publish npm/npx/bunx verification
|
|
131
|
+
- GitHub Release creation
|
|
88
132
|
|
|
89
|
-
Monitor
|
|
133
|
+
Monitor:
|
|
90
134
|
|
|
91
135
|
```bash
|
|
92
136
|
gh run list --workflow Release --limit 5
|
|
@@ -95,8 +139,6 @@ gh run watch <run-id> --exit-status
|
|
|
95
139
|
|
|
96
140
|
## Post-Release Verification
|
|
97
141
|
|
|
98
|
-
After the workflow succeeds, verify all distribution paths:
|
|
99
|
-
|
|
100
142
|
```bash
|
|
101
143
|
npm view @unbrained/pm-cli@<version> version dist.integrity dist.unpackedSize --json
|
|
102
144
|
npx --yes @unbrained/pm-cli@<version> --version
|
|
@@ -104,11 +146,11 @@ bunx @unbrained/pm-cli@<version> --version
|
|
|
104
146
|
gh release view v<version> --json tagName,name,isDraft,isPrerelease,url
|
|
105
147
|
```
|
|
106
148
|
|
|
107
|
-
The
|
|
149
|
+
The executable remains `pm` even though the npm package is scoped.
|
|
108
150
|
|
|
109
151
|
## Failure Handling
|
|
110
152
|
|
|
111
|
-
-
|
|
112
|
-
- If
|
|
113
|
-
- If
|
|
114
|
-
-
|
|
153
|
+
- If local gates fail, fix and rerun before tagging.
|
|
154
|
+
- If the tag workflow fails before npm publish, confirm no package was published before moving or replacing a tag.
|
|
155
|
+
- If npm publish succeeds but GitHub Release creation fails, recreate only the GitHub Release after verifying the tag and package.
|
|
156
|
+
- Record failure evidence and remediation in the release `pm` item.
|
package/docs/SDK.md
CHANGED
|
@@ -1,123 +1,182 @@
|
|
|
1
|
-
#
|
|
1
|
+
# SDK
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The public SDK is exported from `@unbrained/pm-cli/sdk`. Use it for extension authoring and command-contract introspection. Do not import internal `src/core/...` modules from extensions.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Agent Quick Context
|
|
6
|
+
|
|
7
|
+
- Primary import: `@unbrained/pm-cli/sdk`.
|
|
8
|
+
- Runtime extension lifecycle is documented in [Extensions](EXTENSIONS.md).
|
|
9
|
+
- Exact command/action contracts are available through `pm contracts`.
|
|
10
|
+
|
|
11
|
+
Tracked documentation work: [pm-1sb2](../.agents/pm/tasks/pm-1sb2.toon).
|
|
12
|
+
|
|
13
|
+
## Import Surfaces
|
|
6
14
|
|
|
7
15
|
```ts
|
|
8
16
|
import { defineExtension } from "@unbrained/pm-cli/sdk";
|
|
9
17
|
```
|
|
10
18
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
## Import Surfaces
|
|
19
|
+
Supported package exports:
|
|
14
20
|
|
|
15
|
-
- `@unbrained/pm-cli/sdk
|
|
16
|
-
- `@unbrained/pm-cli/cli
|
|
21
|
+
- `@unbrained/pm-cli/sdk` - stable extension authoring API and CLI contract exports.
|
|
22
|
+
- `@unbrained/pm-cli/cli` - runtime CLI module entrypoint for package resolution, not a typed library API.
|
|
17
23
|
|
|
18
|
-
## Public
|
|
24
|
+
## Public Exports
|
|
19
25
|
|
|
20
26
|
Source of truth:
|
|
21
27
|
|
|
22
|
-
- `src/sdk/index.ts`
|
|
23
|
-
- `src/sdk/cli-contracts.ts`
|
|
28
|
+
- [`src/sdk/index.ts`](../src/sdk/index.ts)
|
|
29
|
+
- [`src/sdk/cli-contracts.ts`](../src/sdk/cli-contracts.ts)
|
|
24
30
|
|
|
25
|
-
|
|
31
|
+
Common authoring exports:
|
|
26
32
|
|
|
27
|
-
- `defineExtension
|
|
33
|
+
- `defineExtension`
|
|
28
34
|
- `EXTENSION_CAPABILITIES`
|
|
29
35
|
- `EXTENSION_CAPABILITY_CONTRACT`
|
|
30
36
|
- `EXTENSION_CAPABILITY_CONTRACT_VERSION`
|
|
31
37
|
- `EXTENSION_CAPABILITY_LEGACY_ALIASES`
|
|
32
|
-
|
|
33
|
-
### CLI/action contract values
|
|
34
|
-
|
|
35
38
|
- `PM_CORE_COMMAND_NAMES`
|
|
36
39
|
- `PM_TOOL_ACTIONS`
|
|
37
40
|
- `PM_TOOL_PARAMETERS_SCHEMA`
|
|
38
41
|
- `PM_EXTENSION_CAPABILITY_CONTRACTS`
|
|
39
42
|
- `PM_EXTENSION_SERVICE_NAME_CONTRACTS`
|
|
40
|
-
- all exported `...FLAG_CONTRACTS`, `...OPTION_CONTRACTS`, and `...COMMANDER_*_CONTRACTS` arrays from `src/sdk/cli-contracts.ts`
|
|
41
|
-
|
|
42
|
-
### CLI/action contract helpers
|
|
43
|
-
|
|
44
|
-
- `withFlagAliasMetadata(...)`
|
|
45
|
-
- `toCompletionFlagString(...)`
|
|
46
|
-
- `readFirstStringFromCommanderOptions(...)`
|
|
47
|
-
- `readStringArrayFromCommanderOptions(...)`
|
|
48
43
|
|
|
49
|
-
|
|
44
|
+
Common types:
|
|
50
45
|
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
46
|
+
- `ExtensionApi`
|
|
47
|
+
- `ExtensionManifest`
|
|
48
|
+
- `CommandDefinition`
|
|
49
|
+
- `FlagDefinition`
|
|
50
|
+
- `SchemaFieldDefinition`
|
|
51
|
+
- `SchemaItemTypeDefinition`
|
|
52
|
+
- `SearchProviderDefinition`
|
|
53
|
+
- `VectorStoreAdapterDefinition`
|
|
54
|
+
- `GlobalOptions`
|
|
55
|
+
- `PmSettings`
|
|
56
|
+
|
|
57
|
+
## Capability Requirements
|
|
58
|
+
|
|
59
|
+
| Registration | Manifest capability |
|
|
60
|
+
|--------------|---------------------|
|
|
61
|
+
| `registerCommand` | `commands` |
|
|
62
|
+
| inline command flags | `schema` |
|
|
63
|
+
| `registerFlags` | `schema` |
|
|
64
|
+
| `registerItemFields` | `schema` |
|
|
65
|
+
| `registerItemTypes` | `schema` |
|
|
66
|
+
| `registerMigration` | `schema` |
|
|
67
|
+
| `registerImporter` | `importers` |
|
|
68
|
+
| `registerExporter` | `importers` |
|
|
69
|
+
| `registerParser` | `parser` |
|
|
70
|
+
| `registerPreflight` | `preflight` |
|
|
71
|
+
| `registerService` | `services` |
|
|
72
|
+
| `registerRenderer` | `renderers` |
|
|
73
|
+
| lifecycle hooks | `hooks` |
|
|
74
|
+
| `registerSearchProvider` | `search` |
|
|
75
|
+
| `registerVectorStoreAdapter` | `search` |
|
|
76
|
+
|
|
77
|
+
## Minimal Command Extension
|
|
59
78
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
- `registerItemFields(...)`, `registerItemTypes(...)`, `registerMigration(...)`: require `schema`
|
|
63
|
-
- `registerImporter(...)` and `registerExporter(...)`: require `importers`
|
|
64
|
-
- `registerParser(...)`: requires `parser`
|
|
65
|
-
- `registerPreflight(...)`: requires `preflight`
|
|
66
|
-
- `registerService(...)`: requires `services`
|
|
67
|
-
- `registerRenderer(...)`: requires `renderers`
|
|
68
|
-
- lifecycle hooks (`beforeCommand`, `afterCommand`, `onWrite`, `onRead`, `onIndex`): require `hooks`
|
|
69
|
-
- `registerSearchProvider(...)` and `registerVectorStoreAdapter(...)`: require `search`
|
|
79
|
+
```ts
|
|
80
|
+
import { defineExtension } from "@unbrained/pm-cli/sdk";
|
|
70
81
|
|
|
71
|
-
|
|
82
|
+
export default defineExtension({
|
|
83
|
+
activate(api) {
|
|
84
|
+
api.registerCommand({
|
|
85
|
+
name: "hello",
|
|
86
|
+
description: "Return a deterministic hello payload.",
|
|
87
|
+
intent: "verify SDK extension activation",
|
|
88
|
+
examples: ["pm hello"],
|
|
89
|
+
run: async () => ({ ok: true, message: "hello" }),
|
|
90
|
+
});
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
```
|
|
72
94
|
|
|
73
|
-
|
|
95
|
+
Manifest:
|
|
74
96
|
|
|
75
97
|
```json
|
|
76
98
|
{
|
|
77
|
-
"name": "hello
|
|
99
|
+
"name": "hello",
|
|
78
100
|
"version": "0.1.0",
|
|
79
101
|
"entry": "./index.js",
|
|
80
102
|
"capabilities": ["commands"]
|
|
81
103
|
}
|
|
82
104
|
```
|
|
83
105
|
|
|
84
|
-
|
|
106
|
+
## Custom Item Type
|
|
85
107
|
|
|
86
|
-
```
|
|
108
|
+
```ts
|
|
87
109
|
import { defineExtension } from "@unbrained/pm-cli/sdk";
|
|
88
110
|
|
|
89
111
|
export default defineExtension({
|
|
90
112
|
activate(api) {
|
|
91
|
-
api.
|
|
92
|
-
|
|
93
|
-
|
|
113
|
+
api.registerItemTypes([
|
|
114
|
+
{
|
|
115
|
+
name: "Incident",
|
|
116
|
+
folder: "incidents",
|
|
117
|
+
aliases: ["incident"],
|
|
118
|
+
required_create_fields: ["title", "description", "severity"],
|
|
119
|
+
options: [
|
|
120
|
+
{ key: "severity", values: ["critical", "major", "minor"], required: true },
|
|
121
|
+
{ key: "service", values: ["api", "web", "worker"] },
|
|
122
|
+
],
|
|
123
|
+
},
|
|
124
|
+
]);
|
|
125
|
+
|
|
126
|
+
api.registerItemFields([
|
|
127
|
+
{ name: "severity", type: "string" },
|
|
128
|
+
{ name: "service", type: "string", optional: true },
|
|
129
|
+
]);
|
|
130
|
+
},
|
|
131
|
+
});
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Manifest capability: `schema`.
|
|
135
|
+
|
|
136
|
+
## Search Provider
|
|
137
|
+
|
|
138
|
+
```ts
|
|
139
|
+
import { defineExtension } from "@unbrained/pm-cli/sdk";
|
|
140
|
+
|
|
141
|
+
export default defineExtension({
|
|
142
|
+
activate(api) {
|
|
143
|
+
api.registerSearchProvider({
|
|
144
|
+
name: "example-search",
|
|
145
|
+
async query(context) {
|
|
146
|
+
return context.documents
|
|
147
|
+
.filter((doc) => doc.front_matter.title?.toLowerCase().includes(context.query.toLowerCase()))
|
|
148
|
+
.map((doc) => ({ id: doc.front_matter.id, score: 0.5, matched_fields: ["title"] }));
|
|
149
|
+
},
|
|
94
150
|
});
|
|
95
151
|
},
|
|
96
152
|
});
|
|
97
153
|
```
|
|
98
154
|
|
|
99
|
-
|
|
155
|
+
Manifest capability: `search`.
|
|
100
156
|
|
|
101
|
-
|
|
157
|
+
## Command Contracts
|
|
102
158
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
159
|
+
For machine clients:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
pm contracts --json
|
|
163
|
+
pm contracts --command create --flags-only --json
|
|
164
|
+
pm contracts --action create --schema-only --json
|
|
165
|
+
```
|
|
109
166
|
|
|
110
|
-
|
|
167
|
+
Use the runtime command because active extensions can add command/action metadata.
|
|
111
168
|
|
|
112
|
-
##
|
|
169
|
+
## Authoring Pattern
|
|
113
170
|
|
|
114
|
-
-
|
|
115
|
-
-
|
|
116
|
-
-
|
|
117
|
-
-
|
|
171
|
+
- Keep handlers deterministic and JSON-like.
|
|
172
|
+
- Return data, not pre-rendered terminal text, unless implementing a renderer.
|
|
173
|
+
- Keep service and preflight overrides narrow.
|
|
174
|
+
- Declare only capabilities in use.
|
|
175
|
+
- Include examples and failure hints in dynamic commands.
|
|
176
|
+
- Add `pm extension doctor` diagnostics to testing instructions.
|
|
118
177
|
|
|
119
178
|
## Related Docs
|
|
120
179
|
|
|
121
|
-
-
|
|
122
|
-
-
|
|
123
|
-
-
|
|
180
|
+
- [Extensions](EXTENSIONS.md)
|
|
181
|
+
- [Architecture](ARCHITECTURE.md)
|
|
182
|
+
- [starter extension](examples/starter-extension/README.md)
|