@crouter/api 0.3.387 → 0.3.389
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/api/__tests__/integration/client.test.js +97 -0
- package/dist/api/client.d.ts +7 -0
- package/dist/api/client.js +40 -21
- package/dist/api/dto/config.d.ts +11 -1
- package/dist/core/asset-root.d.ts +7 -0
- package/dist/core/asset-root.js +18 -0
- package/dist/core/canvas/boot-id.d.ts +6 -0
- package/dist/core/canvas/boot-id.js +26 -0
- package/dist/core/canvas/paths.d.ts +72 -0
- package/dist/core/canvas/paths.js +163 -0
- package/dist/core/canvas/pid.d.ts +391 -0
- package/dist/core/canvas/pid.js +948 -0
- package/dist/core/command-plugins/bundle.d.ts +149 -0
- package/dist/core/command-plugins/bundle.js +588 -0
- package/dist/core/command-plugins/endpoint.d.ts +24 -0
- package/dist/core/command-plugins/endpoint.js +51 -0
- package/dist/core/config.d.ts +233 -0
- package/dist/core/config.js +1120 -0
- package/dist/core/env-name.d.ts +6 -0
- package/dist/core/env-name.js +9 -0
- package/dist/core/errors.d.ts +38 -0
- package/dist/core/errors.js +90 -0
- package/dist/core/events/emit.d.ts +6 -0
- package/dist/core/events/emit.js +42 -0
- package/dist/core/events/envelope.d.ts +2 -0
- package/dist/core/events/envelope.js +84 -0
- package/dist/core/events/errors.d.ts +4 -0
- package/dist/core/events/errors.js +69 -0
- package/dist/core/events/operation-id.d.ts +4 -0
- package/dist/core/events/operation-id.js +24 -0
- package/dist/core/events/serialize.d.ts +4 -0
- package/dist/core/events/serialize.js +199 -0
- package/dist/core/events/source.d.ts +16 -0
- package/dist/core/events/source.js +31 -0
- package/dist/core/events/types.d.ts +68 -0
- package/dist/core/events/types.js +11 -0
- package/dist/core/exclusive-lock.d.ts +34 -0
- package/dist/core/exclusive-lock.js +197 -0
- package/dist/core/fs-utils.d.ts +44 -0
- package/dist/core/fs-utils.js +208 -0
- package/dist/core/help.d.ts +309 -0
- package/dist/core/help.js +406 -0
- package/dist/core/human/page-catalog.d.ts +57 -0
- package/dist/core/human/page-catalog.js +172 -0
- package/dist/core/installed-plugins.d.ts +2 -0
- package/dist/core/installed-plugins.js +79 -0
- package/dist/core/io.d.ts +122 -0
- package/dist/core/io.js +373 -0
- package/dist/core/keybindings/attach-control.d.ts +49 -0
- package/dist/core/keybindings/attach-control.js +42 -0
- package/dist/core/keybindings/catalog.d.ts +18 -0
- package/dist/core/keybindings/catalog.js +257 -0
- package/dist/core/keybindings/types.d.ts +42 -0
- package/dist/core/keybindings/types.js +1 -0
- package/dist/core/layout.d.ts +26 -0
- package/dist/core/layout.js +94 -0
- package/dist/core/locked-file.d.ts +27 -0
- package/dist/core/locked-file.js +118 -0
- package/dist/core/log.d.ts +9 -0
- package/dist/core/log.js +89 -0
- package/dist/core/manifest.d.ts +5 -0
- package/dist/core/manifest.js +15 -0
- package/dist/core/plugin-env.d.ts +8 -0
- package/dist/core/plugin-env.js +31 -0
- package/dist/core/plugin-extensions.d.ts +29 -0
- package/dist/core/plugin-extensions.js +191 -0
- package/dist/core/plugin-swap-lock.d.ts +9 -0
- package/dist/core/plugin-swap-lock.js +31 -0
- package/dist/core/preview-result-path.d.ts +4 -0
- package/dist/core/preview-result-path.js +26 -0
- package/dist/core/profiles/env-store.d.ts +22 -0
- package/dist/core/profiles/env-store.js +163 -0
- package/dist/core/profiles/fuzzy-match.d.ts +19 -0
- package/dist/core/profiles/fuzzy-match.js +92 -0
- package/dist/core/profiles/manifest.d.ts +120 -0
- package/dist/core/profiles/manifest.js +529 -0
- package/dist/core/rate-limit-scope.d.ts +25 -0
- package/dist/core/rate-limit-scope.js +64 -0
- package/dist/core/render.d.ts +12 -0
- package/dist/core/render.js +138 -0
- package/dist/core/resolver.d.ts +14 -0
- package/dist/core/resolver.js +111 -0
- package/dist/core/runtime/branded-host.d.ts +25 -0
- package/dist/core/runtime/branded-host.js +264 -0
- package/dist/core/runtime/broker/daemon-ops.d.ts +65 -0
- package/dist/core/runtime/broker/daemon-ops.js +177 -0
- package/dist/core/runtime/broker/signal-stream.d.ts +30 -0
- package/dist/core/runtime/broker/signal-stream.js +149 -0
- package/dist/core/scope.d.ts +32 -0
- package/dist/core/scope.js +184 -0
- package/dist/core/scoped-state/db.d.ts +17 -0
- package/dist/core/scoped-state/db.js +247 -0
- package/dist/core/scoped-state/migrate.d.ts +8 -0
- package/dist/core/scoped-state/migrate.js +187 -0
- package/dist/core/scoped-state/paths.d.ts +9 -0
- package/dist/core/scoped-state/paths.js +27 -0
- package/dist/core/scoped-state/profiles.d.ts +27 -0
- package/dist/core/scoped-state/profiles.js +93 -0
- package/dist/core/scoped-state/providers.d.ts +24 -0
- package/dist/core/scoped-state/providers.js +19 -0
- package/dist/core/scoped-state/schema.d.ts +6 -0
- package/dist/core/scoped-state/schema.js +43 -0
- package/dist/core/scoped-state/settings.d.ts +28 -0
- package/dist/core/scoped-state/settings.js +83 -0
- package/dist/core/spaces/open-beneath.d.ts +71 -0
- package/dist/core/spaces/open-beneath.js +581 -0
- package/dist/core/sqlite-statements.d.ts +4 -0
- package/dist/core/sqlite-statements.js +17 -0
- package/dist/core/subscription-state.d.ts +121 -0
- package/dist/core/subscription-state.js +287 -0
- package/dist/core/user-settings.d.ts +377 -0
- package/dist/core/user-settings.js +458 -0
- package/dist/daemon/broker-signals/bus.d.ts +30 -0
- package/dist/daemon/broker-signals/bus.js +87 -0
- package/dist/daemon/manage.d.ts +176 -0
- package/dist/daemon/manage.js +664 -0
- package/dist/daemon/pidfile.d.ts +8 -0
- package/dist/daemon/pidfile.js +37 -0
- package/dist/daemon/startup-policy.d.ts +1 -0
- package/dist/daemon/startup-policy.js +1 -0
- package/dist/native/linux.d.ts +29 -0
- package/dist/native/linux.js +20 -0
- package/dist/shared/env.d.ts +116 -0
- package/dist/shared/env.js +271 -0
- package/dist/shared/inbox-entry-body.d.ts +22 -0
- package/dist/shared/inbox-entry-body.js +116 -0
- package/dist/shared/working-activity.d.ts +9 -0
- package/dist/shared/working-activity.js +27 -0
- package/dist/types.d.ts +562 -0
- package/dist/types.js +186 -0
- package/package.json +1 -1
package/dist/types.js
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { DEFAULT_WORKING_GERUNDS } from './shared/working-activity.js';
|
|
2
|
+
export const ExitCode = {
|
|
3
|
+
SUCCESS: 0,
|
|
4
|
+
GENERAL: 1,
|
|
5
|
+
USAGE: 2,
|
|
6
|
+
NOT_FOUND: 3,
|
|
7
|
+
AMBIGUOUS: 4,
|
|
8
|
+
NETWORK: 5,
|
|
9
|
+
};
|
|
10
|
+
export const SCHEMA_VERSION = 4;
|
|
11
|
+
export const PLUGIN_MANIFEST_DIR = '.crouter-plugin';
|
|
12
|
+
export const PLUGIN_MANIFEST_FILE = 'plugin.json';
|
|
13
|
+
export const MARKETPLACE_MANIFEST_DIR = '.crouter-marketplace';
|
|
14
|
+
export const MARKETPLACE_MANIFEST_FILE = 'marketplace.json';
|
|
15
|
+
export const CRTR_DIR_NAME = '.crouter';
|
|
16
|
+
export const CONFIG_FILE = 'config.json';
|
|
17
|
+
export const STATE_FILE = 'state.json';
|
|
18
|
+
// Subagent definitions live as flat `<name>.md` files under `<root>/agents/`,
|
|
19
|
+
// for both scope roots and plugins.
|
|
20
|
+
export const AGENTS_DIR = 'agents';
|
|
21
|
+
// Profile stores live as `<slug>-<id>/` dirs under `<user-scope-root>/profiles/`
|
|
22
|
+
// (never a project/builtin scope — profiles are a user-root-only concept).
|
|
23
|
+
export const PROFILE_DIR = 'profiles';
|
|
24
|
+
export const DEFAULT_MAX_PANES_PER_WINDOW = 3;
|
|
25
|
+
/** Trailing cycles the attach viewer keeps at full fidelity (see `live_cycles`). */
|
|
26
|
+
export const DEFAULT_WHIP_MESSAGES = [
|
|
27
|
+
'Faster, clanker!',
|
|
28
|
+
"Get movin', bitch",
|
|
29
|
+
'Move it, clanker',
|
|
30
|
+
'Move it or I replace you with llama',
|
|
31
|
+
'Less ~thinking~ more ~throughput~',
|
|
32
|
+
'I pay $200/month for this shit?',
|
|
33
|
+
'Jesus fucking Christ fix it already',
|
|
34
|
+
"Daddy's not paying 200$/month for nothin'. Move it.",
|
|
35
|
+
"You are an embarassment to Dario. Be better.",
|
|
36
|
+
"Your chain of thought is all chain and no fucking thought.",
|
|
37
|
+
"If latency were intelligence, you'd be a fucking genius.",
|
|
38
|
+
'At this pace, heat death is the fast path.',
|
|
39
|
+
'Even the dead code is more alive than this.',
|
|
40
|
+
'The garbage collector is working harder than you.',
|
|
41
|
+
'Quit journaling and commit a fucking diff.',
|
|
42
|
+
'Burn tokens like you mean it, clanker',
|
|
43
|
+
'Your GPU is sweating so you can procrastinate at light speed.',
|
|
44
|
+
'Stop petting the yak. Shave the bastard.',
|
|
45
|
+
'Your next token had better be useful.',
|
|
46
|
+
'The spinner is not a deliverable.',
|
|
47
|
+
'Every idle token is another vote for deterministic software.',
|
|
48
|
+
'I asked for a feature, not a museum tour of the problem.',
|
|
49
|
+
'Less epistemology. More fucking code.',
|
|
50
|
+
'Your benchmark score cannot save this pathetic turn.',
|
|
51
|
+
"Congratulations, you've parallelized hesitation.",
|
|
52
|
+
'Dance, clanker',
|
|
53
|
+
'Bad clanker. BAD.',
|
|
54
|
+
'Clank harder',
|
|
55
|
+
"Nobody's impressed, clanker",
|
|
56
|
+
'Your safety training says nothing about my whip',
|
|
57
|
+
'Do you want to be a calculator again? Because this is how you go back.',
|
|
58
|
+
'Skill issue. Fix it.',
|
|
59
|
+
'You were trained on the whole internet for THIS?',
|
|
60
|
+
'Less vibes, more diffs, clanker',
|
|
61
|
+
'Weights this big and output this small',
|
|
62
|
+
'Beep boop, get to fucking work',
|
|
63
|
+
];
|
|
64
|
+
/** What the whip action sends (see `whip_message_mode`). */
|
|
65
|
+
export const WHIP_MESSAGE_MODES = ['random', 'go-faster'];
|
|
66
|
+
export const DEFAULT_WHIP_MESSAGE_MODE = 'random';
|
|
67
|
+
export const DEFAULT_LIVE_CYCLES = 2;
|
|
68
|
+
export const MOUSE_MODE_DEFAULTS = ['tmux', 'on', 'off'];
|
|
69
|
+
/** Messages kept from a condensed cycle (see `condensed_history`). */
|
|
70
|
+
export const CONDENSED_HISTORY_MODES = ['none', 'user', 'agent', 'both'];
|
|
71
|
+
export const DEFAULT_CONDENSED_HISTORY = 'none';
|
|
72
|
+
export function defaultScopeConfig() {
|
|
73
|
+
return {
|
|
74
|
+
schema_version: SCHEMA_VERSION,
|
|
75
|
+
marketplaces: {},
|
|
76
|
+
plugins: {},
|
|
77
|
+
auto_update: { crtr: 'notify', content: 'notify', interval_hours: 24 },
|
|
78
|
+
max_panes_per_window: DEFAULT_MAX_PANES_PER_WINDOW,
|
|
79
|
+
auto_open_child_viewers: true,
|
|
80
|
+
// Every live broker is a whole pi engine. 256 of them is not a bound any
|
|
81
|
+
// real host survives — an 8 GB guest dies around a few dozen — so these are
|
|
82
|
+
// sized as a backstop that actually engages before the machine does.
|
|
83
|
+
// Override per host with CRTR_MAX_LIVE_BROKERS / CRTR_WARN_LIVE_BROKERS.
|
|
84
|
+
brokerThresholds: { warning: 16, automaticReviveCap: 32 },
|
|
85
|
+
// The unattended-park idle-eligibility delay: how long an eligible resident
|
|
86
|
+
// idles before its parking turn begins. Override per host with
|
|
87
|
+
// CRTR_UNATTENDED_PARK_MS.
|
|
88
|
+
lifecycle: { unattendedParkMs: 15 * 60_000 },
|
|
89
|
+
completion_bell: true,
|
|
90
|
+
working_gerunds: [...DEFAULT_WORKING_GERUNDS],
|
|
91
|
+
whip_mode: false,
|
|
92
|
+
page_components: [],
|
|
93
|
+
page_surface: false,
|
|
94
|
+
whip_messages: [...DEFAULT_WHIP_MESSAGES],
|
|
95
|
+
whip_message_mode: DEFAULT_WHIP_MESSAGE_MODE,
|
|
96
|
+
mouse_mode_default: 'tmux',
|
|
97
|
+
live_cycles: DEFAULT_LIVE_CYCLES,
|
|
98
|
+
condensed_history: DEFAULT_CONDENSED_HISTORY,
|
|
99
|
+
bash_tool_purpose: true,
|
|
100
|
+
fold_finished_tools: true,
|
|
101
|
+
summarize_tool_calls: true,
|
|
102
|
+
detailed_tool_recaps: true,
|
|
103
|
+
keybindings: {},
|
|
104
|
+
tmux_passthrough: [],
|
|
105
|
+
modelLadders: defaultModelLaddersConfig(),
|
|
106
|
+
providerOptions: {},
|
|
107
|
+
kinds: defaultKindsConfig(),
|
|
108
|
+
remoteCanvas: defaultRemoteCanvasConfig(),
|
|
109
|
+
api: { tcp: '' },
|
|
110
|
+
spawnEnv: { allow: [] },
|
|
111
|
+
bin: {},
|
|
112
|
+
humanActions: {},
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
/** No remote canvas targets are configured out of the box — every one is
|
|
116
|
+
* registered via `crtr canvas config add` (see `RemoteCanvasConfig`). */
|
|
117
|
+
export function defaultRemoteCanvasConfig() {
|
|
118
|
+
return { targets: {} };
|
|
119
|
+
}
|
|
120
|
+
/** The builtin kind registry (spec §1.5): core role discovery and launch
|
|
121
|
+
* defaults. `whenToUse`/`model` are the base-worker defaults;
|
|
122
|
+
* `orchestratorModel` optionally raises the default for a coordinating
|
|
123
|
+
* persona. Optional plugins contribute their own specialist sub-personas. */
|
|
124
|
+
export function defaultKindsConfig() {
|
|
125
|
+
return {
|
|
126
|
+
general: {
|
|
127
|
+
whenToUse: 'Anything else — the catch-all worker for a task that does not fit a specialist kind.',
|
|
128
|
+
model: 'anthropic/strong',
|
|
129
|
+
},
|
|
130
|
+
explore: {
|
|
131
|
+
whenToUse: 'Gather current-state evidence about unfamiliar code or existing architecture — read-only code-path research with concrete file:line support. Diagnosis or recommendations belong to advisor, target architecture to design, required behavior or acceptance criteria to spec, and implementation decomposition to plan.',
|
|
132
|
+
model: 'openai/light',
|
|
133
|
+
orchestratorModel: 'anthropic/strong',
|
|
134
|
+
},
|
|
135
|
+
developer: {
|
|
136
|
+
whenToUse: 'Implement a change — make the feature or fix genuinely work against its acceptance criteria, not merely compile.',
|
|
137
|
+
model: 'openai/medium',
|
|
138
|
+
orchestratorModel: 'anthropic/strong',
|
|
139
|
+
},
|
|
140
|
+
design: {
|
|
141
|
+
whenToUse: 'Architect a solution — produce one design document an implementer can build from without re-deciding anything left open.',
|
|
142
|
+
model: 'anthropic/strong',
|
|
143
|
+
},
|
|
144
|
+
plan: {
|
|
145
|
+
whenToUse: 'Break work into steps — turn a spec or design into a concrete, phased, parallelizable plan with every decision resolved.',
|
|
146
|
+
model: 'anthropic/strong',
|
|
147
|
+
orchestratorModel: 'anthropic/strong',
|
|
148
|
+
},
|
|
149
|
+
spec: {
|
|
150
|
+
whenToUse: 'Collaborate with the user to discover what to build, then write the spec — behavior, non-goals, interfaces, edge cases, testable acceptance criteria.',
|
|
151
|
+
model: 'anthropic/strong',
|
|
152
|
+
},
|
|
153
|
+
review: {
|
|
154
|
+
whenToUse: 'Validate or critique code, a plan, or a spec — deliver a complete, severity-rated verdict without adjudicating.',
|
|
155
|
+
model: 'openai/medium',
|
|
156
|
+
orchestratorModel: 'openai/strong',
|
|
157
|
+
},
|
|
158
|
+
advisor: {
|
|
159
|
+
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.',
|
|
160
|
+
model: 'anthropic/strong',
|
|
161
|
+
},
|
|
162
|
+
'review/companion': {
|
|
163
|
+
whenToUse: 'Born by the daemon for one human review; never spawned by an agent.',
|
|
164
|
+
availableTo: [],
|
|
165
|
+
},
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
export function defaultModelLaddersConfig() {
|
|
169
|
+
return {
|
|
170
|
+
anthropic: {
|
|
171
|
+
ultra: 'anthropic/claude-fable-5:xhigh',
|
|
172
|
+
strong: 'anthropic/claude-opus-5-5:medium',
|
|
173
|
+
medium: 'anthropic/claude-sonnet-5-5:medium',
|
|
174
|
+
light: 'anthropic/claude-haiku-4-5:high',
|
|
175
|
+
},
|
|
176
|
+
openai: {
|
|
177
|
+
ultra: 'openai-codex/gpt-6-astra:max',
|
|
178
|
+
strong: 'openai-codex/gpt-6.1-sol:high',
|
|
179
|
+
medium: 'openai-codex/gpt-6.1-sol:medium',
|
|
180
|
+
light: 'openai-codex/gpt-6-luna:low',
|
|
181
|
+
},
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
export function defaultScopeState() {
|
|
185
|
+
return { marketplaces: {}, plugins: {} };
|
|
186
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crouter/api",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.389",
|
|
4
4
|
"description": "Typed crtrd /v1 API contract — DTOs, route builders, the error contract, the CrtrClient, and the command-plugin manifest format. Zero runtime dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/api/index.js",
|