@crouton-kit/crouter 0.3.20 → 0.3.22
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/dist/builtin-memory/crouter-development/marketplaces.md +2 -4
- package/dist/builtin-memory/crouter-development/personas/base-prompt.md +3 -5
- package/dist/builtin-memory/crouter-development/personas/orchestrator-prompt.md +3 -6
- package/dist/builtin-memory/crouter-development/personas.md +2 -6
- package/dist/builtin-memory/crouter-development/plugins.md +2 -4
- package/dist/builtin-memory/design.md +2 -4
- package/dist/builtin-memory/development.md +3 -3
- package/dist/builtin-memory/planning.md +3 -4
- package/dist/builtin-memory/spec.md +3 -10
- package/dist/builtin-personas/orchestration-kernel.md +1 -1
- package/dist/commands/canvas-history/read.d.ts +1 -0
- package/dist/commands/canvas-history/read.js +61 -0
- package/dist/commands/canvas-history/search.d.ts +1 -0
- package/dist/commands/canvas-history/search.js +270 -0
- package/dist/commands/canvas-history/show.d.ts +1 -0
- package/dist/commands/canvas-history/show.js +79 -0
- package/dist/commands/canvas-history.d.ts +2 -0
- package/dist/commands/canvas-history.js +33 -0
- package/dist/commands/canvas.js +3 -2
- package/dist/commands/human/queue.js +2 -2
- package/dist/commands/memory/__tests__/lint-schema.test.js +29 -0
- package/dist/commands/memory/find.js +14 -52
- package/dist/commands/memory/lint.d.ts +7 -0
- package/dist/commands/memory/lint.js +29 -35
- package/dist/commands/memory/list.js +8 -18
- package/dist/commands/memory/read.js +4 -37
- package/dist/commands/memory/shared.js +1 -2
- package/dist/commands/memory/write.js +6 -9
- package/dist/commands/node.js +47 -25
- package/dist/commands/pkg/bridge.d.ts +1 -0
- package/dist/commands/pkg/bridge.js +137 -0
- package/dist/commands/pkg/plugin-inspect.js +7 -6
- package/dist/commands/pkg.js +2 -1
- package/dist/commands/push.js +10 -15
- package/dist/commands/skill/author.js +35 -44
- package/dist/commands/skill/shared.d.ts +1 -5
- package/dist/commands/skill/shared.js +9 -63
- package/dist/commands/skill.js +5 -6
- package/dist/commands/sys/doctor.js +6 -144
- package/dist/commands/tmux-spread.js +16 -1
- package/dist/commands/view-cycle.js +9 -5
- package/dist/commands/view-run.js +3 -2
- package/dist/core/__tests__/broker-dormant-wake.test.js +71 -34
- package/dist/core/__tests__/canvas-inbox-watcher-hold.test.js +21 -5
- package/dist/core/__tests__/canvas-inbox-watcher.test.js +21 -5
- package/dist/core/__tests__/child-death-wake.test.js +133 -185
- package/dist/core/__tests__/context-intro.test.js +23 -27
- package/dist/core/__tests__/daemon-liveness.test.js +28 -258
- package/dist/core/__tests__/flagship-lifecycle.test.js +156 -135
- package/dist/core/__tests__/frame-decoder-perf.test.js +51 -25
- package/dist/core/__tests__/{broker-attach-limits.test.js → full/broker-attach-limits.test.js} +62 -35
- package/dist/core/__tests__/{broker-attach-stream.test.js → full/broker-attach-stream.test.js} +54 -31
- package/dist/core/__tests__/full/broker-crash-teardown.test.js +143 -0
- package/dist/core/__tests__/full/broker-dialogs.test.js +153 -0
- package/dist/core/__tests__/full/broker-lifecycle.test.js +116 -0
- package/dist/core/__tests__/{cascade-close.test.js → full/cascade-close.test.js} +4 -3
- package/dist/core/__tests__/full/daemon-liveness-pane.full.test.js +292 -0
- package/dist/core/__tests__/{dead-pane-regression.test.js → full/dead-pane-regression.test.js} +2 -2
- package/dist/core/__tests__/{detach-focus.test.js → full/detach-focus.test.js} +7 -7
- package/dist/core/__tests__/{human-new-window-regression.test.js → full/human-new-window-regression.test.js} +2 -2
- package/dist/core/__tests__/{placement-focus.test.js → full/placement-focus.test.js} +5 -5
- package/dist/core/__tests__/{placement-reconcile.test.js → full/placement-reconcile.test.js} +3 -3
- package/dist/core/__tests__/{placement-revive.test.js → full/placement-revive.test.js} +5 -5
- package/dist/core/__tests__/{placement-teardown.test.js → full/placement-teardown.test.js} +4 -4
- package/dist/core/__tests__/{review-render-pane-regression.test.js → full/review-render-pane-regression.test.js} +2 -2
- package/dist/core/__tests__/full/spike-harness.test.d.ts +1 -0
- package/dist/core/__tests__/full/spike-harness.test.js +117 -0
- package/dist/core/__tests__/grace-clock.test.js +72 -75
- package/dist/core/__tests__/helpers/harness.d.ts +35 -1
- package/dist/core/__tests__/helpers/harness.js +70 -12
- package/dist/core/__tests__/live-mutation-verbs.test.js +100 -105
- package/dist/core/__tests__/live-mutation.test.js +111 -134
- package/dist/core/__tests__/memory.test.js +4 -4
- package/dist/core/__tests__/revive.test.js +96 -86
- package/dist/core/__tests__/subscription-delivery.test.js +116 -138
- package/dist/core/__tests__/wake-origin.test.js +54 -50
- package/dist/core/bootstrap.js +18 -14
- package/dist/core/bridge-map.d.ts +19 -0
- package/dist/core/bridge-map.js +73 -0
- package/dist/core/canvas/history.d.ts +91 -0
- package/dist/core/canvas/history.js +389 -0
- package/dist/core/canvas/index.d.ts +1 -0
- package/dist/core/canvas/index.js +1 -0
- package/dist/core/config.js +3 -22
- package/dist/core/help.d.ts +2 -2
- package/dist/core/help.js +1 -1
- package/dist/core/memory-resolver.d.ts +9 -2
- package/dist/core/memory-resolver.js +47 -7
- package/dist/core/render.d.ts +4 -3
- package/dist/core/render.js +38 -41
- package/dist/core/resolver.d.ts +1 -30
- package/dist/core/resolver.js +6 -546
- package/dist/core/runtime/bearings.d.ts +2 -2
- package/dist/core/runtime/bearings.js +2 -2
- package/dist/core/runtime/persona.js +5 -7
- package/dist/core/scope.d.ts +7 -5
- package/dist/core/scope.js +16 -17
- package/dist/core/substrate/ceiling.d.ts +28 -0
- package/dist/core/substrate/ceiling.js +87 -0
- package/dist/core/substrate/index.d.ts +2 -0
- package/dist/core/substrate/index.js +1 -0
- package/dist/core/substrate/on-read.js +18 -2
- package/dist/core/substrate/render.d.ts +3 -5
- package/dist/core/substrate/render.js +68 -59
- package/dist/core/substrate/schema.d.ts +18 -13
- package/dist/core/substrate/schema.js +12 -11
- package/dist/pi-extensions/canvas-context-intro.js +5 -3
- package/dist/pi-extensions/canvas-inbox-watcher.js +19 -2
- package/dist/types.d.ts +3 -18
- package/dist/types.js +0 -8
- package/package.json +4 -3
- package/dist/builtin-skills/.crouter-plugin/plugin.json +0 -5
- package/dist/builtin-skills/skills/crouter-development/marketplaces/SKILL.md +0 -157
- package/dist/builtin-skills/skills/crouter-development/personas/SKILL.md +0 -106
- package/dist/builtin-skills/skills/crouter-development/personas/base-prompt/SKILL.md +0 -49
- package/dist/builtin-skills/skills/crouter-development/personas/orchestrator-prompt/SKILL.md +0 -49
- package/dist/builtin-skills/skills/crouter-development/plugins/SKILL.md +0 -156
- package/dist/builtin-skills/skills/design/SKILL.md +0 -51
- package/dist/builtin-skills/skills/development/SKILL.md +0 -109
- package/dist/builtin-skills/skills/planning/SKILL.md +0 -59
- package/dist/builtin-skills/skills/spec/SKILL.md +0 -83
- package/dist/commands/skill/state.d.ts +0 -3
- package/dist/commands/skill/state.js +0 -71
- package/dist/core/__tests__/broker-crash-teardown.test.js +0 -116
- package/dist/core/__tests__/broker-dialogs.test.js +0 -126
- package/dist/core/__tests__/broker-lifecycle.test.js +0 -87
- package/dist/core/__tests__/resolver.test.js +0 -181
- package/dist/core/__tests__/spike-harness.test.js +0 -242
- /package/dist/{core/__tests__/broker-attach-limits.test.d.ts → commands/memory/__tests__/lint-schema.test.d.ts} +0 -0
- /package/dist/core/__tests__/{broker-attach-stream.test.d.ts → full/broker-attach-limits.test.d.ts} +0 -0
- /package/dist/core/__tests__/{broker-crash-teardown.test.d.ts → full/broker-attach-stream.test.d.ts} +0 -0
- /package/dist/core/__tests__/{broker-dialogs.test.d.ts → full/broker-crash-teardown.test.d.ts} +0 -0
- /package/dist/core/__tests__/{broker-lifecycle.test.d.ts → full/broker-dialogs.test.d.ts} +0 -0
- /package/dist/core/__tests__/{cascade-close.test.d.ts → full/broker-lifecycle.test.d.ts} +0 -0
- /package/dist/core/__tests__/{dead-pane-regression.test.d.ts → full/cascade-close.test.d.ts} +0 -0
- /package/dist/core/__tests__/{detach-focus.test.d.ts → full/daemon-liveness-pane.full.test.d.ts} +0 -0
- /package/dist/core/__tests__/{human-new-window-regression.test.d.ts → full/dead-pane-regression.test.d.ts} +0 -0
- /package/dist/core/__tests__/{placement-focus.test.d.ts → full/detach-focus.test.d.ts} +0 -0
- /package/dist/core/__tests__/{placement-reconcile.test.d.ts → full/human-new-window-regression.test.d.ts} +0 -0
- /package/dist/core/__tests__/{placement-revive.test.d.ts → full/placement-focus.test.d.ts} +0 -0
- /package/dist/core/__tests__/{placement-teardown.test.d.ts → full/placement-reconcile.test.d.ts} +0 -0
- /package/dist/core/__tests__/{resolver.test.d.ts → full/placement-revive.test.d.ts} +0 -0
- /package/dist/core/__tests__/{review-render-pane-regression.test.d.ts → full/placement-teardown.test.d.ts} +0 -0
- /package/dist/core/__tests__/{spike-harness.test.d.ts → full/review-render-pane-regression.test.d.ts} +0 -0
package/dist/core/render.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
// Default stdout rendering: the result a leaf returns is written FOR the model
|
|
2
2
|
// to act on, not as data to parse. Output is a continuation of the agent's
|
|
3
|
-
// prompt —
|
|
4
|
-
//
|
|
3
|
+
// prompt — PLAIN MARKDOWN, no XML wrapper. Scalars list as `- name: value`
|
|
4
|
+
// bullets in output-schema order, prose fields render as paragraphs, and arrays
|
|
5
|
+
// become a count lead-in plus a markdown table (objects) or bullets (scalars).
|
|
6
|
+
// The raw JSON object is still available behind the `--json` global for tooling.
|
|
5
7
|
//
|
|
6
8
|
// A leaf may hand `defineLeaf` a bespoke `render(result)` for instruction-shaped
|
|
7
|
-
// output (see `node new`, `push`, `feed read`).
|
|
8
|
-
// the schema-driven generic renderer here, so
|
|
9
|
-
// without a hand-written renderer.
|
|
9
|
+
// output that leads with the outcome (see `node new`, `push`, `feed read`).
|
|
10
|
+
// Everything else falls through to the schema-driven generic renderer here, so
|
|
11
|
+
// every command obeys the markdown paradigm without a hand-written renderer.
|
|
12
|
+
// `renderError` is the one sanctioned exception: a failure is a different domain
|
|
13
|
+
// from a result, so it keeps its `<error>` block.
|
|
10
14
|
// Field names whose value is prose the agent reads, not a scalar it keys on —
|
|
11
|
-
// these always render as their own
|
|
15
|
+
// these always render as their own paragraph, never as a `- name: value` bullet.
|
|
12
16
|
const PROSE_FIELDS = new Set([
|
|
13
17
|
'follow_up', 'digest', 'message', 'next', 'result', 'content', 'body', 'guide',
|
|
14
18
|
'summary', 'note', 'reason', 'detail', 'details', 'hint', 'instruction',
|
|
@@ -37,20 +41,17 @@ function isProse(name, v) {
|
|
|
37
41
|
return true;
|
|
38
42
|
return v.includes('\n') || v.length > 80;
|
|
39
43
|
}
|
|
40
|
-
/**
|
|
41
|
-
*
|
|
42
|
-
function
|
|
43
|
-
|
|
44
|
-
return true;
|
|
45
|
-
return typeof v === 'string' && v.length <= 40 && !v.includes(' ') && !v.includes('\n');
|
|
46
|
-
}
|
|
47
|
-
/** Root element name = the command path with spaces hyphenated. */
|
|
48
|
-
function rootTag(help) {
|
|
49
|
-
return help.name.trim().split(/\s+/).join('-').replace(/[^a-zA-Z0-9_-]/g, '') || 'result';
|
|
44
|
+
/** Keep a value safe inside a markdown table cell: pipes would split columns,
|
|
45
|
+
* newlines would break the row. */
|
|
46
|
+
function cellEsc(v) {
|
|
47
|
+
return scalarStr(v).replace(/\|/g, '\\|').replace(/\n/g, ' ');
|
|
50
48
|
}
|
|
49
|
+
/** An array renders as a count lead-in followed by the collection: a markdown
|
|
50
|
+
* table when every element is an object, plain bullets otherwise. */
|
|
51
51
|
function renderArray(name, arr) {
|
|
52
52
|
if (arr.length === 0)
|
|
53
|
-
return
|
|
53
|
+
return `0 ${name}.`;
|
|
54
|
+
const lead = `${arr.length} ${name}:`;
|
|
54
55
|
const allObjects = arr.every((x) => x !== null && typeof x === 'object' && !Array.isArray(x));
|
|
55
56
|
if (allObjects) {
|
|
56
57
|
const rows = arr;
|
|
@@ -61,55 +62,51 @@ function renderArray(name, arr) {
|
|
|
61
62
|
cols.push(k);
|
|
62
63
|
const head = `| ${cols.join(' | ')} |`;
|
|
63
64
|
const sep = `| ${cols.map(() => '---').join(' | ')} |`;
|
|
64
|
-
const body = rows.map((r) => `| ${cols.map((c) =>
|
|
65
|
-
return
|
|
65
|
+
const body = rows.map((r) => `| ${cols.map((c) => cellEsc(r[c])).join(' | ')} |`).join('\n');
|
|
66
|
+
return `${lead}\n\n${head}\n${sep}\n${body}`;
|
|
66
67
|
}
|
|
67
68
|
const items = arr.map((x) => `- ${scalarStr(x)}`).join('\n');
|
|
68
|
-
return
|
|
69
|
+
return `${lead}\n${items}`;
|
|
69
70
|
}
|
|
70
|
-
/** Schema-driven fallback: turn a result object into agent-ready
|
|
71
|
+
/** Schema-driven fallback: turn a result object into agent-ready plain markdown.
|
|
71
72
|
* Field order follows the leaf's declared output schema; any extra keys append
|
|
72
|
-
* after. Scalars
|
|
73
|
-
* become
|
|
73
|
+
* after. Scalars (and nested objects) list as `- name: value` bullets, prose
|
|
74
|
+
* fields render as paragraphs, and arrays become a count lead-in plus a table
|
|
75
|
+
* or bullets. No root tag — the result is read as a continuation of the prompt. */
|
|
74
76
|
export function renderResult(result, help) {
|
|
75
77
|
const order = help.output.map((f) => f.name);
|
|
76
78
|
for (const k of Object.keys(result))
|
|
77
79
|
if (!order.includes(k))
|
|
78
80
|
order.push(k);
|
|
79
|
-
const attrs = [];
|
|
80
81
|
const bullets = [];
|
|
81
|
-
const
|
|
82
|
+
const proseFields = [];
|
|
83
|
+
const arrays = [];
|
|
82
84
|
for (const name of order) {
|
|
83
85
|
const v = result[name];
|
|
84
86
|
if (v === undefined || v === null)
|
|
85
87
|
continue;
|
|
86
88
|
if (Array.isArray(v)) {
|
|
87
|
-
|
|
88
|
-
continue;
|
|
89
|
-
}
|
|
90
|
-
if (typeof v === 'object') {
|
|
91
|
-
blocks.push(`<${name}>\n${JSON.stringify(v, null, 2)}\n</${name}>`);
|
|
89
|
+
arrays.push(renderArray(name, v));
|
|
92
90
|
continue;
|
|
93
91
|
}
|
|
94
92
|
if (isProse(name, v)) {
|
|
95
|
-
|
|
96
|
-
continue;
|
|
97
|
-
}
|
|
98
|
-
if (isAttr(v)) {
|
|
99
|
-
attrs.push(`${name}="${attrEsc(v)}"`);
|
|
93
|
+
proseFields.push({ name, text: v });
|
|
100
94
|
continue;
|
|
101
95
|
}
|
|
96
|
+
// Scalars and nested objects alike list as a bullet (objects via compact JSON).
|
|
102
97
|
bullets.push(`- ${name}: ${scalarStr(v)}`);
|
|
103
98
|
}
|
|
104
|
-
const tag = rootTag(help);
|
|
105
|
-
const open = attrs.length > 0 ? `<${tag} ${attrs.join(' ')}>` : `<${tag}>`;
|
|
106
99
|
const parts = [];
|
|
107
100
|
if (bullets.length > 0)
|
|
108
101
|
parts.push(bullets.join('\n'));
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
const
|
|
112
|
-
|
|
102
|
+
// Label prose only when more than one block would otherwise blur together.
|
|
103
|
+
const labelProse = proseFields.length > 1;
|
|
104
|
+
for (const { name, text } of proseFields) {
|
|
105
|
+
parts.push(labelProse ? `**${name}:** ${text}` : text);
|
|
106
|
+
}
|
|
107
|
+
for (const block of arrays)
|
|
108
|
+
parts.push(block);
|
|
109
|
+
return parts.join('\n\n');
|
|
113
110
|
}
|
|
114
111
|
/** Render a structured failure as an instruction-shaped block: what broke, what
|
|
115
112
|
* was received, and the recovery road sign — the same recovery info the JSON
|
package/dist/core/resolver.d.ts
CHANGED
|
@@ -1,25 +1,7 @@
|
|
|
1
|
-
import type { InstalledMarketplace, InstalledPlugin, Scope
|
|
1
|
+
import type { InstalledMarketplace, InstalledPlugin, Scope } from '../types.js';
|
|
2
2
|
export declare function listInstalledPlugins(scope: Scope): InstalledPlugin[];
|
|
3
3
|
export declare function listAllPlugins(): InstalledPlugin[];
|
|
4
4
|
export declare function findPluginByName(name: string, scope?: Scope): InstalledPlugin | null;
|
|
5
|
-
interface ScopeConfigs {
|
|
6
|
-
project?: ScopeConfig;
|
|
7
|
-
user: ScopeConfig;
|
|
8
|
-
}
|
|
9
|
-
export declare function effectiveSkillEnabled(pluginName: string, skillName: string, cfgs: ScopeConfigs): {
|
|
10
|
-
enabled: boolean;
|
|
11
|
-
disabledIn?: Scope;
|
|
12
|
-
};
|
|
13
|
-
export declare function listSkillsInPlugin(plugin: InstalledPlugin, cfgs?: ScopeConfigs): Skill[];
|
|
14
|
-
export declare function listScopeRootSkills(scope: Scope, cfgs?: ScopeConfigs): Skill[];
|
|
15
|
-
export declare function listAllSkills(scopeFilter?: Scope): Skill[];
|
|
16
|
-
export declare function listSkillSiblings(skill: Skill): Skill[];
|
|
17
|
-
export declare function listSkillChildren(skill: Skill): Skill[];
|
|
18
|
-
export interface SkillResolutionOpts {
|
|
19
|
-
scope?: Scope;
|
|
20
|
-
pluginFilter?: string;
|
|
21
|
-
}
|
|
22
|
-
export declare function resolveSkill(rawName: string, opts?: SkillResolutionOpts): Skill;
|
|
23
5
|
export interface ParsedSkillQualifier {
|
|
24
6
|
scope?: Scope;
|
|
25
7
|
segments: string[];
|
|
@@ -28,15 +10,4 @@ export declare function parseSkillQualifier(raw: string): ParsedSkillQualifier;
|
|
|
28
10
|
export declare function listInstalledMarketplaces(scope: Scope): InstalledMarketplace[];
|
|
29
11
|
export declare function listAllMarketplaces(): InstalledMarketplace[];
|
|
30
12
|
export declare function findMarketplaceByName(name: string, scope?: Scope): InstalledMarketplace | null;
|
|
31
|
-
export interface CategoryResolution {
|
|
32
|
-
id: string;
|
|
33
|
-
plugin: string | undefined;
|
|
34
|
-
scope: Scope | undefined;
|
|
35
|
-
dir: string;
|
|
36
|
-
indexPath: string | undefined;
|
|
37
|
-
skills: Skill[];
|
|
38
|
-
}
|
|
39
|
-
export declare function resolveCategory(name: string, opts?: SkillResolutionOpts): CategoryResolution | null;
|
|
40
|
-
export declare function buildCategoryIndex(cat: CategoryResolution): string;
|
|
41
13
|
export declare function scopeRootsLabel(): string;
|
|
42
|
-
export {};
|