@arnilo/prism 0.10.0 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/CHANGELOG.md +32 -1
  2. package/README.md +18 -16
  3. package/dist/agent-run-lifecycle.d.ts +2 -1
  4. package/dist/agent-run-lifecycle.js +1 -1
  5. package/dist/agent-session/session/assemble.js +9 -7
  6. package/dist/agent-session/session/tool-round.js +30 -20
  7. package/dist/agent-session/session/types.d.ts +1 -0
  8. package/dist/agent-session/session.d.ts +1 -0
  9. package/dist/agent-session/session.js +3 -2
  10. package/dist/checkpoint-restore.d.ts +50 -14
  11. package/dist/checkpoint-restore.js +104 -28
  12. package/dist/contracts-core/session.d.ts +2 -1
  13. package/dist/contracts-run-state.d.ts +12 -4
  14. package/dist/index.d.ts +3 -3
  15. package/dist/index.js +1 -1
  16. package/dist/leases.js +32 -6
  17. package/dist/node/contribution-discovery.d.ts +16 -1
  18. package/dist/node/contribution-discovery.js +47 -0
  19. package/dist/node/session-store-jsonl.js +67 -17
  20. package/dist/run-limits.d.ts +11 -5
  21. package/dist/session-stores.js +61 -12
  22. package/dist/testing/prefix-stability-conformance.d.ts +44 -1
  23. package/dist/testing/prefix-stability-conformance.js +92 -29
  24. package/dist/usage-estimation.d.ts +7 -1
  25. package/dist/usage-estimation.js +16 -10
  26. package/docs/acp.md +2 -2
  27. package/docs/agent-events.md +7 -6
  28. package/docs/agent-session-runtime.md +1 -1
  29. package/docs/coding-agent-tools.md +1 -1
  30. package/docs/coding-tools.md +7 -11
  31. package/docs/context-and-skills.md +6 -7
  32. package/docs/contribution-discovery.md +13 -0
  33. package/docs/durable-runs.md +10 -3
  34. package/docs/embeddings.md +3 -1
  35. package/docs/execution-timeline.md +6 -0
  36. package/docs/extensions.md +1 -2
  37. package/docs/impeccable.md +1 -2
  38. package/docs/index.md +26 -21
  39. package/docs/live-testing.md +1 -2
  40. package/docs/memory-fabric.md +3 -2
  41. package/docs/migrate-to-0.11.md +65 -0
  42. package/docs/migration.md +12 -1
  43. package/docs/node-jsonl-session-store.md +4 -3
  44. package/docs/operations.md +1 -1
  45. package/docs/peer-dependencies.md +3 -5
  46. package/docs/policy-and-audit.md +1 -1
  47. package/docs/prefix-stability-conformance.md +30 -7
  48. package/docs/provider-packages.md +23 -21
  49. package/docs/providers/laya.md +113 -0
  50. package/docs/providers/typesafe.md +145 -0
  51. package/docs/public-contracts.md +1 -1
  52. package/docs/rag.md +2 -2
  53. package/docs/release-and-install.md +60 -58
  54. package/docs/runs-and-usage.md +6 -4
  55. package/docs/session-stores.md +2 -2
  56. package/docs/supervisors.md +14 -6
  57. package/docs/testing.md +17 -9
  58. package/docs/workflows.md +2 -2
  59. package/package.json +5 -4
  60. package/docs/caveman.md +0 -130
  61. package/docs/graft.md +0 -149
  62. package/docs/ponytail.md +0 -129
package/docs/ponytail.md DELETED
@@ -1,129 +0,0 @@
1
- # Ponytail behavior integration
2
-
3
- > **Optional peer install:** `@dietrichgebert/ponytail` — see [Optional peer dependencies](peer-dependencies.md).
4
-
5
- ## What it does
6
-
7
- `@arnilo/prism-coding-tools/ponytail` is an optional package that wires [DietrichGebert/ponytail](https://github.com/DietrichGebert/ponytail) into Prism contribution contracts.
8
-
9
- It registers upstream skills and commands, injects active mode instructions via upstream `getPonytailInstructions` / `filterSkillBodyForMode`, and persists mode as session custom `ponytail-mode` entries. Import is inert; missing upstream fails closed at `setup` with a bounded redacted error.
10
-
11
- ## When to use it
12
-
13
- Use it when a host wants lazy-minimalism coding behavior (`lite`, `full`, `ultra`) with upstream Ponytail skills (`ponytail-audit`, `ponytail-debt`, `ponytail-gain`, `ponytail-help`, `ponytail-review`) in a Prism extension kernel.
14
-
15
- Install optional peer `@dietrichgebert/ponytail@^4.9.0` **or** pass `upstreamPath` to a checkout with `skills/` and `hooks/`.
16
-
17
- Pair with progressive disclosure: mode slices on the `ponytail-mode` injector; full skill bodies via `load_skill` only.
18
-
19
- ## Inputs / request
20
-
21
- `createPonytailExtension(options)`:
22
-
23
- | Field | Type | Required | Purpose |
24
- | --- | --- | --- | --- |
25
- | `upstreamPath` | `string` | no | Override path to Ponytail root; default resolves optional peer package. |
26
- | `defaultMode` | `PonytailMode` | no | Initial mode when no session entry exists (default `full`). |
27
- | `quietStartup` | `boolean` | no | Suppress startup status events. |
28
- | `appendEntry` | `(entry, opts?) => Promise<void>` | yes | Host session append (OM `attach` pattern). |
29
- | `getEntries` | `() => readonly SessionEntry[] \| Promise<...>` | yes | Current branch entries for mode restore. |
30
- | `configPath` | `string` | no | Bounded local config for `defaultMode` / `quietStartup` / `hideStatus`. |
31
-
32
- `PonytailMode`: `off` \| `lite` \| `full` \| `ultra`.
33
-
34
- Session custom entry shape:
35
-
36
- ```json
37
- { "kind": "custom", "data": { "type": "ponytail-mode", "mode": "full" } }
38
- ```
39
-
40
- Registered skills: `ponytail`, `ponytail-audit`, `ponytail-debt`, `ponytail-gain`, `ponytail-help`, `ponytail-review`.
41
-
42
- Registered commands: `ponytail`, `ponytail-review`, `ponytail-audit`, `ponytail-gain`, `ponytail-debt`, `ponytail-help`.
43
-
44
- `ponytail` command actions: empty args or `status` report current+default mode (4.9.0; does not change mode); `lite|full|ultra|off` set mode; `default <mode>` persists default.
45
-
46
- ## Outputs / response / events
47
-
48
- | Export | Purpose |
49
- | --- | --- |
50
- | `createPonytailExtension(options)` | Returns an inert `Extension` until `kernel.load([...])`. |
51
- | `ponytail-mode` injector | `InstructionInjector` calling upstream `getPonytailInstructions(mode)`. |
52
- | `ponytail` command | Set mode, report status, or persist default mode to config file. |
53
- | Alias commands | Dispatch `{ skill, dispatch: "load_skill" }` for companion skills. |
54
- | `ponytail:status` / `ponytail:loaded` events | Optional host metadata (no statusline shell scripts). |
55
-
56
- Deactivation: exact phrases `stop ponytail` and `normal mode`.
57
-
58
- ## Request/response example
59
-
60
- ```json
61
- { "command": "ponytail", "args": { "mode": "lite" }, "sessionId": "s1" }
62
- ```
63
-
64
- ```json
65
- { "kind": "custom", "data": { "type": "ponytail-mode", "mode": "lite" } }
66
- ```
67
-
68
- ## Implementation example
69
-
70
- ```ts
71
- import { createPonytailExtension } from "@arnilo/prism-coding-tools/ponytail";
72
- import {
73
- createExtensionKernel,
74
- createLoadSkillTool,
75
- createLoadedSkillSet,
76
- createMemorySessionStore,
77
- createSkillRegistry,
78
- } from "@arnilo/prism";
79
-
80
- const store = createMemorySessionStore();
81
- const callbacks = {
82
- appendEntry: async (entry, options) => store.append(entry, options),
83
- getEntries: async () => store.list("s1"),
84
- };
85
-
86
- const kernel = createExtensionKernel({ errorPolicy: "throw" });
87
- await kernel.load([
88
- createPonytailExtension({
89
- upstreamPath: undefined, // optional peer @dietrichgebert/ponytail
90
- defaultMode: "full",
91
- quietStartup: true,
92
- ...callbacks,
93
- }),
94
- ]);
95
-
96
- const registry = createSkillRegistry(kernel.registries.skills.list());
97
- const loaded = createLoadedSkillSet();
98
- const loadSkill = createLoadSkillTool({ registry, loaded });
99
-
100
- await kernel.registries.commands.get("ponytail")!.execute({ mode: "lite" }, { sessionId: "s1" });
101
- // Select instructionInjectors: ["ponytail-mode"] on runs that should receive mode slices.
102
- ```
103
-
104
- See `examples/caveman-ponytail.ts` for combined Caveman + Ponytail progressive disclosure demo (network-free fixtures).
105
-
106
- ## Extension and configuration notes
107
-
108
- - Import alone registers nothing (`sideEffects: false`); no timers, watchers, network, or shell scripts.
109
- - Upstream hook modules load via `createRequire` from resolved root — instruction strings are not forked in Prism.
110
- - Mode restore scans `getEntries()` for latest `data.type === "ponytail-mode"` (OM attach pattern).
111
- - `ponytail-subagent` hook is not wired; nested-agent behavior is host responsibility. When hosts wire the upstream hook, `PONYTAIL_SUBAGENT_MATCHER` accepts only the documented safe subset — `"explore|general"` (any literal substring) or `"^general$"` (exact), case-insensitive, max 256 chars. No `RegExp` is compiled from the environment, so arbitrary regex (including catastrophic nested quantifiers) is never evaluated; unset/invalid patterns inject into every subagent.
112
- - No TUI statusline scripts; use `ponytail status` command or extension events.
113
- - Not included in `@arnilo/prism-coding-tools` or `@arnilo/prism-core` profiles — opt-in install only.
114
-
115
- ## Security and performance notes
116
-
117
- - Upstream text is untrusted; reads bounded (`MAX_SKILL_FILE_BYTES` 256 KiB, `MAX_INJECTED_INSTRUCTION_BYTES` 32 KiB).
118
- - Config writes only to host `configPath` with size cap (`MAX_CONFIG_FILE_BYTES` 16 KiB).
119
- - Errors redact absolute paths and home directories.
120
- - O(skills) setup scan; O(1) mode tracking per turn; no background workers.
121
-
122
- ## Related APIs
123
-
124
- - [Caveman behavior integration](caveman.md): complementary terse-communication mode package.
125
- - [Extension kernel and event bus](extensions.md): explicit `kernel.load`.
126
- - [Context and skills](context-and-skills.md): progressive catalog + `load_skill`.
127
- - [Instruction injection](instruction-injection.md): `ponytail-mode` injector.
128
- - [Observational memory compaction package](compaction-observational-memory.md): session callback attach pattern.
129
- - [Migration guide](migration.md): `0.0.21 → 0.0.22` notes.