@crouton-kit/crouter 0.3.37 → 0.3.39

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 (143) hide show
  1. package/dist/build-root.js +1 -0
  2. package/dist/{builtin-personas/runtime-base.md → builtin-memory/00-runtime-base.md} +7 -0
  3. package/dist/{builtin-personas/spine/has-manager.md → builtin-memory/01-spine/00-has-manager.md} +8 -0
  4. package/dist/builtin-memory/01-spine/01-no-manager.md +10 -0
  5. package/dist/{builtin-personas/lifecycle/terminal.md → builtin-memory/02-lifecycle/00-terminal.md} +8 -0
  6. package/dist/{builtin-personas/lifecycle/resident.md → builtin-memory/02-lifecycle/01-resident.md} +8 -0
  7. package/dist/{builtin-personas/waiting.md → builtin-memory/03-waiting.md} +7 -0
  8. package/dist/{builtin-personas/orchestration-kernel.md → builtin-memory/04-orchestration-kernel.md} +8 -0
  9. package/dist/{builtin-personas/advisor/PERSONA.md → builtin-memory/05-kinds/advisor/00-base.md} +5 -2
  10. package/dist/{builtin-personas/design/PERSONA.md → builtin-memory/05-kinds/design/00-base.md} +5 -2
  11. package/dist/{builtin-personas/design/orchestrator.md → builtin-memory/05-kinds/design/01-orchestrator.md} +5 -4
  12. package/dist/{builtin-personas/developer/PERSONA.md → builtin-memory/05-kinds/developer/00-base.md} +5 -2
  13. package/dist/{builtin-personas/developer/orchestrator.md → builtin-memory/05-kinds/developer/01-orchestrator.md} +5 -4
  14. package/dist/{builtin-personas/explore/PERSONA.md → builtin-memory/05-kinds/explore/00-base.md} +5 -2
  15. package/dist/{builtin-personas/explore/orchestrator.md → builtin-memory/05-kinds/explore/01-orchestrator.md} +5 -3
  16. package/dist/{builtin-personas/general/PERSONA.md → builtin-memory/05-kinds/general/00-base.md} +5 -2
  17. package/dist/{builtin-personas/general/orchestrator.md → builtin-memory/05-kinds/general/01-orchestrator.md} +5 -3
  18. package/dist/{builtin-personas/plan/PERSONA.md → builtin-memory/05-kinds/plan/00-base.md} +5 -2
  19. package/dist/{builtin-personas/plan/orchestrator.md → builtin-memory/05-kinds/plan/01-orchestrator.md} +5 -4
  20. package/dist/{builtin-personas/plan/reviewers/architecture-fit/PERSONA.md → builtin-memory/05-kinds/plan/reviewers/architecture-fit.md} +5 -2
  21. package/dist/{builtin-personas/plan/reviewers/code-smells/PERSONA.md → builtin-memory/05-kinds/plan/reviewers/code-smells.md} +5 -2
  22. package/dist/{builtin-personas/plan/reviewers/pattern-consistency/PERSONA.md → builtin-memory/05-kinds/plan/reviewers/pattern-consistency.md} +5 -2
  23. package/dist/{builtin-personas/plan/reviewers/requirements-coverage/PERSONA.md → builtin-memory/05-kinds/plan/reviewers/requirements-coverage.md} +5 -2
  24. package/dist/{builtin-personas/plan/reviewers/security/PERSONA.md → builtin-memory/05-kinds/plan/reviewers/security.md} +5 -2
  25. package/dist/{builtin-personas/product/PERSONA.md → builtin-memory/05-kinds/product/00-base.md} +5 -2
  26. package/dist/{builtin-personas/product/orchestrator.md → builtin-memory/05-kinds/product/01-orchestrator.md} +5 -4
  27. package/dist/{builtin-personas/product/teardown/PERSONA.md → builtin-memory/05-kinds/product/teardown.md} +5 -3
  28. package/dist/{builtin-personas/review/PERSONA.md → builtin-memory/05-kinds/review/00-base.md} +5 -2
  29. package/dist/{builtin-personas/review/orchestrator.md → builtin-memory/05-kinds/review/01-orchestrator.md} +5 -3
  30. package/dist/{builtin-personas/spec/PERSONA.md → builtin-memory/05-kinds/spec/00-base.md} +5 -2
  31. package/dist/{builtin-personas/spec/orchestrator.md → builtin-memory/05-kinds/spec/01-orchestrator.md} +5 -4
  32. package/dist/{builtin-personas/spec/requirements/PERSONA.md → builtin-memory/05-kinds/spec/requirements.md} +5 -2
  33. package/dist/builtin-memory/internal/INDEX.md +1 -1
  34. package/dist/builtin-memory/internal/examples/imessage-assistant.md +2 -2
  35. package/dist/builtin-views/prompt-review/core.mjs +6 -134
  36. package/dist/builtin-views/settings/core.mjs +26 -94
  37. package/dist/builtin-views/settings/text.mjs +0 -5
  38. package/dist/builtin-views/settings/tui.mjs +1 -7
  39. package/dist/builtin-views/settings/web.jsx +3 -49
  40. package/dist/clients/attach/attach-cmd.js +416 -416
  41. package/dist/commands/memory/read.js +3 -3
  42. package/dist/commands/memory/shared.d.ts +13 -8
  43. package/dist/commands/memory/shared.js +22 -8
  44. package/dist/commands/memory/write.js +5 -3
  45. package/dist/commands/node.js +40 -11
  46. package/dist/commands/profile/add-project.d.ts +1 -0
  47. package/dist/commands/profile/add-project.js +42 -0
  48. package/dist/commands/profile/delete.d.ts +1 -0
  49. package/dist/commands/profile/delete.js +39 -0
  50. package/dist/commands/profile/list.d.ts +1 -0
  51. package/dist/commands/profile/list.js +35 -0
  52. package/dist/commands/profile/new.d.ts +1 -0
  53. package/dist/commands/profile/new.js +50 -0
  54. package/dist/commands/profile/remove-project.d.ts +1 -0
  55. package/dist/commands/profile/remove-project.js +42 -0
  56. package/dist/commands/profile/rename.d.ts +1 -0
  57. package/dist/commands/profile/rename.js +42 -0
  58. package/dist/commands/profile/show.d.ts +1 -0
  59. package/dist/commands/profile/show.js +50 -0
  60. package/dist/commands/profile.d.ts +2 -0
  61. package/dist/commands/profile.js +33 -0
  62. package/dist/commands/sys/config.js +6 -21
  63. package/dist/commands/sys/prompt-review.js +90 -17
  64. package/dist/core/canvas/canvas.js +10 -9
  65. package/dist/core/canvas/db.js +11 -0
  66. package/dist/core/canvas/history.js +1 -0
  67. package/dist/core/canvas/types.d.ts +10 -0
  68. package/dist/core/config.d.ts +44 -1
  69. package/dist/core/config.js +155 -12
  70. package/dist/core/hearth/provider.d.ts +8 -0
  71. package/dist/core/hearth/providers/__tests__/sweep-and-release.test.d.ts +1 -0
  72. package/dist/core/hearth/providers/__tests__/sweep-and-release.test.js +254 -0
  73. package/dist/core/hearth/providers/blaxel-home.d.ts +39 -0
  74. package/dist/core/hearth/providers/blaxel-home.js +271 -21
  75. package/dist/core/hearth/providers/blaxel.d.ts +5 -0
  76. package/dist/core/hearth/providers/blaxel.js +86 -4
  77. package/dist/core/hearth/providers/types.d.ts +16 -0
  78. package/dist/core/memory-resolver.d.ts +26 -15
  79. package/dist/core/memory-resolver.js +158 -40
  80. package/dist/core/profiles/manifest.d.ts +33 -0
  81. package/dist/core/profiles/manifest.js +332 -0
  82. package/dist/core/profiles/select.d.ts +11 -0
  83. package/dist/core/profiles/select.js +115 -0
  84. package/dist/core/runtime/bearings.d.ts +9 -0
  85. package/dist/core/runtime/bearings.js +31 -0
  86. package/dist/core/runtime/front-door.js +9 -2
  87. package/dist/core/runtime/launch.d.ts +25 -7
  88. package/dist/core/runtime/launch.js +42 -55
  89. package/dist/core/runtime/nodes.d.ts +7 -0
  90. package/dist/core/runtime/nodes.js +6 -0
  91. package/dist/core/runtime/persona.js +18 -32
  92. package/dist/core/runtime/spawn.d.ts +13 -0
  93. package/dist/core/runtime/spawn.js +25 -0
  94. package/dist/core/scope.d.ts +14 -7
  95. package/dist/core/scope.js +76 -20
  96. package/dist/core/substrate/index.d.ts +3 -3
  97. package/dist/core/substrate/index.js +5 -3
  98. package/dist/core/substrate/on-read.js +3 -2
  99. package/dist/core/substrate/render.d.ts +16 -11
  100. package/dist/core/substrate/render.js +249 -62
  101. package/dist/core/substrate/schema.d.ts +11 -3
  102. package/dist/core/substrate/schema.js +25 -0
  103. package/dist/core/substrate/subject.d.ts +15 -2
  104. package/dist/core/substrate/subject.js +24 -2
  105. package/dist/hearth/control-plane/__tests__/error-serialization.test.d.ts +1 -0
  106. package/dist/hearth/control-plane/__tests__/error-serialization.test.js +29 -0
  107. package/dist/hearth/control-plane/__tests__/oauth-serving-marker.test.d.ts +1 -0
  108. package/dist/hearth/control-plane/__tests__/oauth-serving-marker.test.js +44 -0
  109. package/dist/hearth/control-plane/__tests__/wake-roll.test.d.ts +1 -0
  110. package/dist/hearth/control-plane/__tests__/wake-roll.test.js +230 -0
  111. package/dist/hearth/control-plane/db.js +27 -0
  112. package/dist/hearth/control-plane/hearth-target.d.ts +23 -0
  113. package/dist/hearth/control-plane/hearth-target.js +68 -0
  114. package/dist/hearth/control-plane/registry.d.ts +6 -1
  115. package/dist/hearth/control-plane/registry.js +7 -0
  116. package/dist/hearth/control-plane/relay.d.ts +4 -0
  117. package/dist/hearth/control-plane/relay.js +72 -3
  118. package/dist/hearth/control-plane/secrets.d.ts +14 -0
  119. package/dist/hearth/control-plane/secrets.js +21 -0
  120. package/dist/hearth/control-plane/server.js +140 -4
  121. package/dist/hearth/control-plane/serving.d.ts +15 -0
  122. package/dist/hearth/control-plane/serving.js +106 -0
  123. package/dist/hearth/control-plane/types.d.ts +20 -0
  124. package/dist/hearth/control-plane/wake.d.ts +8 -2
  125. package/dist/hearth/control-plane/wake.js +241 -3
  126. package/dist/pi-extensions/canvas-doc-substrate.js +2 -3
  127. package/dist/types.d.ts +57 -1
  128. package/dist/types.js +83 -1
  129. package/dist/web-client/assets/{index-MSKSWwV0.js → index-CbO8L0mN.js} +4 -4
  130. package/dist/web-client/assets/index-DwO46Cs5.css +2 -0
  131. package/dist/web-client/index.html +2 -2
  132. package/package.json +2 -2
  133. package/dist/builtin-memory/crouter-development/personas/base-prompt.md +0 -56
  134. package/dist/builtin-memory/crouter-development/personas/orchestrator-prompt.md +0 -57
  135. package/dist/builtin-memory/crouter-development/personas.md +0 -112
  136. package/dist/builtin-personas/spine/no-manager.md +0 -2
  137. package/dist/core/personas/index.d.ts +0 -13
  138. package/dist/core/personas/index.js +0 -11
  139. package/dist/core/personas/loader.d.ts +0 -159
  140. package/dist/core/personas/loader.js +0 -327
  141. package/dist/core/personas/resolve.d.ts +0 -59
  142. package/dist/core/personas/resolve.js +0 -376
  143. package/dist/web-client/assets/index-DUThOUzU.css +0 -2
@@ -2,9 +2,8 @@
2
2
  // a single self-contained canvas pi extension.
3
3
  //
4
4
  // Loaded into a canvas node's pi process via the node's launch.extensions list
5
- // (registered in CANVAS_EXTENSIONS at the flip — see the note at the bottom of
6
- // this file; AUTHOR-ONLY for now, NOT yet registered). INERT when CRTR_NODE_ID
7
- // is absent (a plain pi session or legacy job agent loads it as a no-op).
5
+ // (registered in CANVAS_EXTENSIONS, src/core/runtime/launch.ts). INERT when
6
+ // CRTR_NODE_ID is absent (a plain pi session or legacy job agent loads it as a no-op).
8
7
  //
9
8
  // It owns the substrate's two new pi hooks:
10
9
  //
package/dist/types.d.ts CHANGED
@@ -100,6 +100,29 @@ export interface ModelLaddersConfig {
100
100
  anthropic: Record<ModelStrength, string>;
101
101
  openai: Record<ModelStrength, string>;
102
102
  }
103
+ /** Launch metadata for one kind (a top-level kind like `developer`, or a full
104
+ * sub-kind string like `plan/reviewers/security`) — the settings-file
105
+ * replacement for per-kind persona frontmatter. `model`/`tools`/`extensions`
106
+ * are launch knobs consumed by `buildLaunchSpec` (Phase 3); `whenToUse` is the
107
+ * one-line gloss shown in `node new -h` / `node promote -h`. `availableTo` is
108
+ * VISIBILITY-ONLY (never launch validation): the list of top-level kind names
109
+ * whose spawn menus surface this sub-kind, `'*'` meaning every kind; omitted
110
+ * defaults to the sub-kind's own top-level ancestor (e.g.
111
+ * `plan/reviewers/security` defaults to `['plan']`) — this reproduces the
112
+ * original sub-persona `availableTo` semantics. A direct launch by full kind
113
+ * string is always valid regardless of `availableTo`. */
114
+ export interface KindConfig {
115
+ model?: string;
116
+ /** Model override for ORCHESTRATOR mode only, e.g. a kind whose orchestrator
117
+ * body warrants a stronger model than its base worker. Selection: base mode
118
+ * always uses `model`; orchestrator mode uses `orchestratorModel ?? model`.
119
+ * Omit when the kind runs the same model in both modes. */
120
+ orchestratorModel?: string;
121
+ tools?: string[];
122
+ extensions?: string[];
123
+ whenToUse: string;
124
+ availableTo?: string[];
125
+ }
103
126
  export interface ScopeConfig {
104
127
  schema_version: number;
105
128
  marketplaces: Record<string, ConfigMarketplaceEntry>;
@@ -108,7 +131,12 @@ export interface ScopeConfig {
108
131
  max_panes_per_window: number;
109
132
  canvasNav: CanvasNavConfig;
110
133
  modelLadders: ModelLaddersConfig;
111
- personaStrengths: Record<string, ModelStrength>;
134
+ /** The kind registry (spec §1.5): kind existence + launch knobs, keyed by
135
+ * full kind string (top-level e.g. `developer`, or sub-kind e.g.
136
+ * `plan/reviewers/security`). Builtins ship a default registry via
137
+ * `defaultScopeConfig()`; user/project `config.json` adds or shadows
138
+ * entries at the same scope precedence as the rest of `ScopeConfig`. */
139
+ kinds: Record<string, KindConfig>;
112
140
  }
113
141
  export interface ScopeState {
114
142
  marketplaces: Record<string, {
@@ -158,6 +186,23 @@ export interface InstalledMarketplace {
158
186
  url: string;
159
187
  ref: string;
160
188
  }
189
+ /** The on-disk manifest at `~/.crouter/profiles/<slug>-<id>/profile.json`
190
+ * (spec §2.1). A profile is an agent identity defined at the user root: it
191
+ * names N project directories and owns its own `memory/` store. `projects`
192
+ * are absolute, real-path-resolved directories in manifest order — the
193
+ * pointer set `findProjectScopeRoots` walks (Phase 5), after the node's own
194
+ * cwd. `name` is the mutable display name (and the gateable `profile` subject
195
+ * field, Phase 6); `<slug>-<id>` in the directory name is the stable id and
196
+ * never changes on rename. See `src/core/profiles/manifest.ts` for every
197
+ * read/write of this file — it is the sole owner of path resolution and
198
+ * mutation. */
199
+ export interface ProfileManifest {
200
+ schema_version: number;
201
+ name: string;
202
+ projects: string[];
203
+ created_at: string;
204
+ last_used_at: string | null;
205
+ }
161
206
  export declare const PLUGIN_MANIFEST_DIR = ".crouter-plugin";
162
207
  export declare const PLUGIN_MANIFEST_FILE = "plugin.json";
163
208
  export declare const MARKETPLACE_MANIFEST_DIR = ".crouter-marketplace";
@@ -166,8 +211,19 @@ export declare const CRTR_DIR_NAME = ".crouter";
166
211
  export declare const CONFIG_FILE = "config.json";
167
212
  export declare const STATE_FILE = "state.json";
168
213
  export declare const AGENTS_DIR = "agents";
214
+ export declare const PROFILE_DIR = "profiles";
169
215
  export declare const DEFAULT_MAX_PANES_PER_WINDOW = 3;
170
216
  export declare function defaultScopeConfig(): ScopeConfig;
217
+ /** The builtin kind registry (spec §1.5): the built-in defaults for every
218
+ * top-level kind and its sub-persona kinds. `whenToUse`/`model` are the
219
+ * one-per-kind defaults (not one per mode) that seed a node's spawn menu
220
+ * and default model choice. Roadmap-shaping guidance is orchestrator-only —
221
+ * an orchestrator-gated memory doc keyed to the kind, not baked into the
222
+ * registry entry. Sub-persona `availableTo` is
223
+ * omitted where it only reproduces the default (its own top-level
224
+ * ancestor) — `product/teardown` is included explicitly below for parity
225
+ * even though its value equals the default. */
226
+ export declare function defaultKindsConfig(): Record<string, KindConfig>;
171
227
  /** Built-in canvas-nav binds so an absent config still gives the intended UX.
172
228
  * prefixBinds restate the current menu defaults; graphBinds stay empty.
173
229
  */
package/dist/types.js CHANGED
@@ -17,6 +17,9 @@ export const STATE_FILE = 'state.json';
17
17
  // Subagent definitions live as flat `<name>.md` files under `<root>/agents/`,
18
18
  // for both scope roots and plugins.
19
19
  export const AGENTS_DIR = 'agents';
20
+ // Profile stores live as `<slug>-<id>/` dirs under `<user-scope-root>/profiles/`
21
+ // (never a project/builtin scope — profiles are a user-root-only concept).
22
+ export const PROFILE_DIR = 'profiles';
20
23
  export const DEFAULT_MAX_PANES_PER_WINDOW = 3;
21
24
  export function defaultScopeConfig() {
22
25
  return {
@@ -27,7 +30,86 @@ export function defaultScopeConfig() {
27
30
  max_panes_per_window: DEFAULT_MAX_PANES_PER_WINDOW,
28
31
  canvasNav: defaultCanvasNavConfig(),
29
32
  modelLadders: defaultModelLaddersConfig(),
30
- personaStrengths: {},
33
+ kinds: defaultKindsConfig(),
34
+ };
35
+ }
36
+ /** The builtin kind registry (spec §1.5): the built-in defaults for every
37
+ * top-level kind and its sub-persona kinds. `whenToUse`/`model` are the
38
+ * one-per-kind defaults (not one per mode) that seed a node's spawn menu
39
+ * and default model choice. Roadmap-shaping guidance is orchestrator-only —
40
+ * an orchestrator-gated memory doc keyed to the kind, not baked into the
41
+ * registry entry. Sub-persona `availableTo` is
42
+ * omitted where it only reproduces the default (its own top-level
43
+ * ancestor) — `product/teardown` is included explicitly below for parity
44
+ * even though its value equals the default. */
45
+ export function defaultKindsConfig() {
46
+ return {
47
+ general: {
48
+ whenToUse: 'Anything else — the catch-all worker for a task that does not fit a specialist kind.',
49
+ model: 'anthropic/strong',
50
+ },
51
+ explore: {
52
+ whenToUse: 'Map unfamiliar code or architecture — read-only orientation and code-path research with concrete file:line evidence. Anything diagnostic — investigating a failure, why something is broken or misbehaving, or live/runtime behavior — is advisor, not explore.',
53
+ model: 'anthropic/light',
54
+ },
55
+ developer: {
56
+ whenToUse: 'Implement a change — make the feature or fix genuinely work against its acceptance criteria, not merely compile.',
57
+ model: 'anthropic/medium',
58
+ orchestratorModel: 'anthropic/strong',
59
+ },
60
+ design: {
61
+ whenToUse: 'Architect a solution — produce one design document an implementer can build from without re-deciding anything left open.',
62
+ model: 'anthropic/strong',
63
+ },
64
+ plan: {
65
+ whenToUse: 'Break work into steps — turn a spec or design into a concrete, phased, parallelizable plan with every decision resolved.',
66
+ model: 'openai/strong',
67
+ },
68
+ spec: {
69
+ whenToUse: 'Collaborate with the user to discover what to build, then write the spec — behavior, non-goals, interfaces, edge cases, testable acceptance criteria.',
70
+ model: 'anthropic/strong',
71
+ },
72
+ product: {
73
+ whenToUse: 'Discover the real user need behind a request and define the product experience that meets it — use cases, how it should feel and look, grounded in how comparable products solve it. Hands off to spec.',
74
+ model: 'anthropic/strong',
75
+ },
76
+ review: {
77
+ whenToUse: 'Validate or critique code, a plan, or a spec — deliver a complete, severity-rated verdict without adjudicating.',
78
+ model: 'openai/strong',
79
+ },
80
+ advisor: {
81
+ whenToUse: 'Debug failures, investigate why something is broken or misbehaving, diagnose live/runtime issues, or give engineering advice and second opinions — reason from evidence and recommend the next move. Use advisor (not explore) whenever the task is to find out what is going wrong.',
82
+ model: 'anthropic/ultra',
83
+ },
84
+ 'plan/reviewers/requirements-coverage': {
85
+ whenToUse: 'every requirement and design constraint maps to a concrete plan task, classified Covered/Partial/Missing; flags only blocking gaps',
86
+ model: 'openai/strong',
87
+ },
88
+ 'plan/reviewers/pattern-consistency': {
89
+ whenToUse: "the plan honors the codebase's real conventions; reads actual source and cites the pattern each finding deviates from; owns contract-level conflicts between parts",
90
+ model: 'openai/strong',
91
+ },
92
+ 'plan/reviewers/code-smells': {
93
+ whenToUse: 'nullability mismatches, type conflicts across parts, hidden N+1s, over-fetching, missing error boundaries, leaky abstractions; owns file-level conflicts between parts',
94
+ model: 'openai/strong',
95
+ },
96
+ 'plan/reviewers/security': {
97
+ whenToUse: 'input validation, injection surfaces, auth/authz gaps, data exposure, races; flags only risks with a concrete exploit path',
98
+ model: 'openai/strong',
99
+ },
100
+ 'plan/reviewers/architecture-fit': {
101
+ whenToUse: "proposed files/modules/abstractions fit the system's existing decomposition; flags new units that duplicate existing ones or cross layer boundaries",
102
+ model: 'openai/strong',
103
+ },
104
+ 'spec/requirements': {
105
+ whenToUse: 'Derive testable EARS requirements from a finished, approved design — in isolation, from the rendered design text alone.',
106
+ model: 'anthropic/strong',
107
+ },
108
+ 'product/teardown': {
109
+ whenToUse: 'Tear down ONE comparable product against a specific job-to-be-done — how it solves it, where it succeeds and fails its users, and what to borrow, avoid, or differentiate from.',
110
+ model: 'anthropic/strong',
111
+ availableTo: ['product'],
112
+ },
31
113
  };
32
114
  }
33
115
  /** Built-in canvas-nav binds so an absent config still gives the intended UX.