pm-starter 2026.6.3 → 2026.6.4
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/CHANGELOG.md +6 -0
- package/README.md +65 -27
- package/dist/index.js +1 -1
- package/manifest.json +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2026.6.4 - 2026-06-04
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- Fix README to document all 9 capabilities accurately + strengthen smoke test ([pm-starter-xwkh](https://github.com/unbraind/pm-starter/blob/main/.agents/pm/chores/pm-starter-xwkh.toon))
|
|
8
|
+
|
|
3
9
|
## 2026.06.02 - 2026-06-02
|
|
4
10
|
|
|
5
11
|
### Added
|
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# pm-starter
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The CANONICAL scaffold for [pm-cli](https://github.com/unbraind/pm-cli) extensions. A single, heavily-commented `index.ts` demonstrates **all 9 SDK capability types** with small, SAFE, inert examples.
|
|
4
4
|
|
|
5
|
-
Use this as a starting template for building your own extensions.
|
|
5
|
+
Use this as a starting template for building your own extensions: copy the capability you need and delete the rest.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -14,16 +14,24 @@ pm install github.com/unbraind/pm-starter --project
|
|
|
14
14
|
|
|
15
15
|
## Capabilities
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
|
21
|
-
|
|
22
|
-
|
|
|
23
|
-
|
|
|
24
|
-
|
|
|
25
|
-
|
|
|
26
|
-
|
|
|
17
|
+
Every capability declared in `manifest.json` is demonstrated in `index.ts`. Each
|
|
18
|
+
maps to one or more `register*`/`hooks.*` calls on the `ExtensionApi`.
|
|
19
|
+
|
|
20
|
+
| # | Capability | `ExtensionApi` call(s) | What the demo registers |
|
|
21
|
+
|---|---|---|---|
|
|
22
|
+
| 1 | **commands** | `registerCommand` | `pm starter greet`, `pm starter summary`, `pm starter demo` |
|
|
23
|
+
| 2 | **renderers** | `registerRenderer` | `json` + `toon` renderer overrides (reshape only the `starter demo` payload, pass through everything else) |
|
|
24
|
+
| 3 | **hooks** | `hooks.beforeCommand`, `hooks.afterCommand`, `hooks.onWrite`, `hooks.onRead`, `hooks.onIndex` | All five lifecycle hooks (observe-only; opt-in logging via `PM_STARTER_HOOKS`) |
|
|
25
|
+
| 4 | **schema** | `registerItemFields`, `registerItemTypes`, `registerMigration` | Optional fields `starter_origin`/`starter_score`, a `StarterNote` item type, and a no-op migration `pm-starter-0001-noop` |
|
|
26
|
+
| 5 | **importers** | `registerImporter`, `registerExporter` | `pm starter-demo import` (inert dry-run) and `pm starter-demo export` (read-only JSON dump) |
|
|
27
|
+
| 6 | **search** | `registerSearchProvider`, `registerVectorStoreAdapter` | Search provider `starter-substring` and in-memory vector store adapter `starter-memory` |
|
|
28
|
+
| 7 | **parser** | `registerParser` | Identity pass-through parser override for the native `list` command |
|
|
29
|
+
| 8 | **preflight** | `registerPreflight` | Pass-through preflight decision override (no behavior change) |
|
|
30
|
+
| 9 | **services** | `registerService` | Pass-through override of the `output_format` core service |
|
|
31
|
+
|
|
32
|
+
> **Flags:** the demo commands declare typed `flags`, and `registerFlags("list", …)`
|
|
33
|
+
> adds an inert `--starter-tag` flag to the native `list` command. Flag registration
|
|
34
|
+
> is part of the **commands** capability — it does not need its own manifest entry.
|
|
27
35
|
|
|
28
36
|
## Commands
|
|
29
37
|
|
|
@@ -39,6 +47,50 @@ pm starter summary
|
|
|
39
47
|
pm starter summary --verbose
|
|
40
48
|
```
|
|
41
49
|
|
|
50
|
+
### `pm starter demo`
|
|
51
|
+
```bash
|
|
52
|
+
pm starter demo # structured payload reshaped by the starter renderer
|
|
53
|
+
pm starter demo --json
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Importer / exporter command paths
|
|
57
|
+
|
|
58
|
+
`registerImporter("starter-demo")` and `registerExporter("starter-demo")` auto-create:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
pm starter-demo import # inert dry-run preview
|
|
62
|
+
pm starter-demo export # read-only JSON dump of items
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
> Human-facing commands are namespaced under `pm starter …` while the
|
|
66
|
+
> importer/exporter live under `pm starter-demo …` so the two command paths never
|
|
67
|
+
> collide. `pm extension doctor` reports 0 collisions as a result.
|
|
68
|
+
|
|
69
|
+
## Architecture
|
|
70
|
+
|
|
71
|
+
Each capability lives in its own `setup*` function for clarity. Delete the ones
|
|
72
|
+
you don't need and prune `manifest.json` to match:
|
|
73
|
+
|
|
74
|
+
- `setupCommands(api)` — `registerCommand` (with typed flags)
|
|
75
|
+
- `setupRenderers(api)` — `registerRenderer` for `json` / `toon`
|
|
76
|
+
- `setupHooks(api)` — `hooks.beforeCommand/afterCommand/onWrite/onRead/onIndex`
|
|
77
|
+
- `setupSchema(api)` — `registerItemFields` / `registerItemTypes` / `registerMigration`
|
|
78
|
+
- `setupImportExport(api)` — `registerImporter` / `registerExporter`
|
|
79
|
+
- `setupSearch(api)` — `registerSearchProvider` / `registerVectorStoreAdapter`
|
|
80
|
+
- `setupParser(api)` — `registerParser`
|
|
81
|
+
- `setupPreflight(api)` — `registerPreflight`
|
|
82
|
+
- `setupServices(api)` — `registerService`
|
|
83
|
+
- `setupFlags(api)` — `registerFlags`
|
|
84
|
+
|
|
85
|
+
## The zero-runtime-coupling pattern
|
|
86
|
+
|
|
87
|
+
Standalone-installed extensions load only their own `dist/` at runtime, so
|
|
88
|
+
`@unbrained/pm-cli` is **not** resolvable as a runtime value. `index.ts` therefore
|
|
89
|
+
imports `defineExtension` as a **type only** and provides a trivial identity
|
|
90
|
+
implementation; the real CLI supplies the live `api` object at activation time.
|
|
91
|
+
For the same reason the `EXIT_CODE` / `CommandError` error contract is
|
|
92
|
+
re-implemented locally rather than imported from the SDK.
|
|
93
|
+
|
|
42
94
|
## Creating a New Extension
|
|
43
95
|
|
|
44
96
|
```bash
|
|
@@ -56,23 +108,9 @@ npm install
|
|
|
56
108
|
npm run build
|
|
57
109
|
|
|
58
110
|
# 4. Install locally
|
|
59
|
-
pm install ./my-extension
|
|
111
|
+
pm install ./my-extension --project
|
|
60
112
|
```
|
|
61
113
|
|
|
62
|
-
## Architecture
|
|
63
|
-
|
|
64
|
-
Each capability is in its own setup function for clarity:
|
|
65
|
-
- `setupCommands(api)` — Register CLI commands with flags
|
|
66
|
-
- `setupSchema(api)` — Register validation schemas
|
|
67
|
-
- `setupHooks(api)` — Register lifecycle hooks
|
|
68
|
-
- `setupImporters(api)` — Register data importers
|
|
69
|
-
- `setupRenderers(api)` — Register output renderers
|
|
70
|
-
- `setupSearch(api)` — Register search providers
|
|
71
|
-
- `setupPreflight(api)` — Register pre-flight checks
|
|
72
|
-
- `setupServices(api)` — Register background services
|
|
73
|
-
|
|
74
|
-
Delete the capabilities you don't need and update `manifest.json` accordingly.
|
|
75
|
-
|
|
76
114
|
## License
|
|
77
115
|
|
|
78
116
|
MIT
|
package/dist/index.js
CHANGED
|
@@ -473,7 +473,7 @@ function setupFlags(api) {
|
|
|
473
473
|
// ---------------------------------------------------------------------------
|
|
474
474
|
export default defineExtension({
|
|
475
475
|
name: "pm-starter",
|
|
476
|
-
version: "2026.6.
|
|
476
|
+
version: "2026.6.4",
|
|
477
477
|
activate(api) {
|
|
478
478
|
// Register every capability group. Each helper is defensive enough to be
|
|
479
479
|
// safely deleted when you fork this scaffold for a real extension.
|
package/manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pm-starter",
|
|
3
|
-
"version": "2026.6.
|
|
4
|
-
"description": "Complete scaffold showing all
|
|
3
|
+
"version": "2026.6.4",
|
|
4
|
+
"description": "Complete scaffold showing all 9 capability types: commands, renderers, hooks, schema, importers, search, parser, preflight, services. Use as a starting template for new extensions.",
|
|
5
5
|
"author": "@unbraind",
|
|
6
6
|
"entry": "./dist/index.js",
|
|
7
7
|
"priority": 99,
|