@crouter/api 0.3.387 → 0.3.388

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 (130) hide show
  1. package/dist/api/__tests__/integration/client.test.js +97 -0
  2. package/dist/api/client.d.ts +7 -0
  3. package/dist/api/client.js +40 -21
  4. package/dist/core/asset-root.d.ts +7 -0
  5. package/dist/core/asset-root.js +18 -0
  6. package/dist/core/canvas/boot-id.d.ts +6 -0
  7. package/dist/core/canvas/boot-id.js +26 -0
  8. package/dist/core/canvas/paths.d.ts +72 -0
  9. package/dist/core/canvas/paths.js +163 -0
  10. package/dist/core/canvas/pid.d.ts +391 -0
  11. package/dist/core/canvas/pid.js +948 -0
  12. package/dist/core/command-plugins/bundle.d.ts +149 -0
  13. package/dist/core/command-plugins/bundle.js +588 -0
  14. package/dist/core/command-plugins/endpoint.d.ts +24 -0
  15. package/dist/core/command-plugins/endpoint.js +51 -0
  16. package/dist/core/config.d.ts +233 -0
  17. package/dist/core/config.js +1120 -0
  18. package/dist/core/env-name.d.ts +6 -0
  19. package/dist/core/env-name.js +9 -0
  20. package/dist/core/errors.d.ts +38 -0
  21. package/dist/core/errors.js +90 -0
  22. package/dist/core/events/emit.d.ts +6 -0
  23. package/dist/core/events/emit.js +42 -0
  24. package/dist/core/events/envelope.d.ts +2 -0
  25. package/dist/core/events/envelope.js +84 -0
  26. package/dist/core/events/errors.d.ts +4 -0
  27. package/dist/core/events/errors.js +69 -0
  28. package/dist/core/events/operation-id.d.ts +4 -0
  29. package/dist/core/events/operation-id.js +24 -0
  30. package/dist/core/events/serialize.d.ts +4 -0
  31. package/dist/core/events/serialize.js +199 -0
  32. package/dist/core/events/source.d.ts +16 -0
  33. package/dist/core/events/source.js +31 -0
  34. package/dist/core/events/types.d.ts +68 -0
  35. package/dist/core/events/types.js +11 -0
  36. package/dist/core/exclusive-lock.d.ts +34 -0
  37. package/dist/core/exclusive-lock.js +197 -0
  38. package/dist/core/fs-utils.d.ts +44 -0
  39. package/dist/core/fs-utils.js +208 -0
  40. package/dist/core/help.d.ts +309 -0
  41. package/dist/core/help.js +406 -0
  42. package/dist/core/human/page-catalog.d.ts +57 -0
  43. package/dist/core/human/page-catalog.js +172 -0
  44. package/dist/core/installed-plugins.d.ts +2 -0
  45. package/dist/core/installed-plugins.js +79 -0
  46. package/dist/core/io.d.ts +122 -0
  47. package/dist/core/io.js +373 -0
  48. package/dist/core/keybindings/attach-control.d.ts +49 -0
  49. package/dist/core/keybindings/attach-control.js +42 -0
  50. package/dist/core/keybindings/catalog.d.ts +18 -0
  51. package/dist/core/keybindings/catalog.js +257 -0
  52. package/dist/core/keybindings/types.d.ts +42 -0
  53. package/dist/core/keybindings/types.js +1 -0
  54. package/dist/core/layout.d.ts +26 -0
  55. package/dist/core/layout.js +94 -0
  56. package/dist/core/locked-file.d.ts +27 -0
  57. package/dist/core/locked-file.js +118 -0
  58. package/dist/core/log.d.ts +9 -0
  59. package/dist/core/log.js +89 -0
  60. package/dist/core/manifest.d.ts +5 -0
  61. package/dist/core/manifest.js +15 -0
  62. package/dist/core/plugin-env.d.ts +8 -0
  63. package/dist/core/plugin-env.js +31 -0
  64. package/dist/core/plugin-extensions.d.ts +29 -0
  65. package/dist/core/plugin-extensions.js +191 -0
  66. package/dist/core/plugin-swap-lock.d.ts +9 -0
  67. package/dist/core/plugin-swap-lock.js +31 -0
  68. package/dist/core/preview-result-path.d.ts +4 -0
  69. package/dist/core/preview-result-path.js +26 -0
  70. package/dist/core/profiles/env-store.d.ts +22 -0
  71. package/dist/core/profiles/env-store.js +163 -0
  72. package/dist/core/profiles/fuzzy-match.d.ts +19 -0
  73. package/dist/core/profiles/fuzzy-match.js +92 -0
  74. package/dist/core/profiles/manifest.d.ts +120 -0
  75. package/dist/core/profiles/manifest.js +529 -0
  76. package/dist/core/rate-limit-scope.d.ts +25 -0
  77. package/dist/core/rate-limit-scope.js +64 -0
  78. package/dist/core/render.d.ts +12 -0
  79. package/dist/core/render.js +138 -0
  80. package/dist/core/resolver.d.ts +14 -0
  81. package/dist/core/resolver.js +111 -0
  82. package/dist/core/runtime/branded-host.d.ts +25 -0
  83. package/dist/core/runtime/branded-host.js +264 -0
  84. package/dist/core/runtime/broker/daemon-ops.d.ts +65 -0
  85. package/dist/core/runtime/broker/daemon-ops.js +177 -0
  86. package/dist/core/runtime/broker/signal-stream.d.ts +30 -0
  87. package/dist/core/runtime/broker/signal-stream.js +149 -0
  88. package/dist/core/scope.d.ts +32 -0
  89. package/dist/core/scope.js +184 -0
  90. package/dist/core/scoped-state/db.d.ts +17 -0
  91. package/dist/core/scoped-state/db.js +247 -0
  92. package/dist/core/scoped-state/migrate.d.ts +8 -0
  93. package/dist/core/scoped-state/migrate.js +187 -0
  94. package/dist/core/scoped-state/paths.d.ts +9 -0
  95. package/dist/core/scoped-state/paths.js +27 -0
  96. package/dist/core/scoped-state/profiles.d.ts +27 -0
  97. package/dist/core/scoped-state/profiles.js +93 -0
  98. package/dist/core/scoped-state/providers.d.ts +24 -0
  99. package/dist/core/scoped-state/providers.js +19 -0
  100. package/dist/core/scoped-state/schema.d.ts +6 -0
  101. package/dist/core/scoped-state/schema.js +43 -0
  102. package/dist/core/scoped-state/settings.d.ts +28 -0
  103. package/dist/core/scoped-state/settings.js +83 -0
  104. package/dist/core/spaces/open-beneath.d.ts +71 -0
  105. package/dist/core/spaces/open-beneath.js +581 -0
  106. package/dist/core/sqlite-statements.d.ts +4 -0
  107. package/dist/core/sqlite-statements.js +17 -0
  108. package/dist/core/subscription-state.d.ts +121 -0
  109. package/dist/core/subscription-state.js +287 -0
  110. package/dist/core/user-settings.d.ts +377 -0
  111. package/dist/core/user-settings.js +458 -0
  112. package/dist/daemon/broker-signals/bus.d.ts +30 -0
  113. package/dist/daemon/broker-signals/bus.js +87 -0
  114. package/dist/daemon/manage.d.ts +176 -0
  115. package/dist/daemon/manage.js +664 -0
  116. package/dist/daemon/pidfile.d.ts +8 -0
  117. package/dist/daemon/pidfile.js +37 -0
  118. package/dist/daemon/startup-policy.d.ts +1 -0
  119. package/dist/daemon/startup-policy.js +1 -0
  120. package/dist/native/linux.d.ts +29 -0
  121. package/dist/native/linux.js +20 -0
  122. package/dist/shared/env.d.ts +116 -0
  123. package/dist/shared/env.js +271 -0
  124. package/dist/shared/inbox-entry-body.d.ts +22 -0
  125. package/dist/shared/inbox-entry-body.js +116 -0
  126. package/dist/shared/working-activity.d.ts +9 -0
  127. package/dist/shared/working-activity.js +27 -0
  128. package/dist/types.d.ts +562 -0
  129. package/dist/types.js +186 -0
  130. package/package.json +1 -1
@@ -0,0 +1,377 @@
1
+ import type { ScopeConfig } from '../types.js';
2
+ /**
3
+ * Which settings destination owns a preference row. Every settings-surface row
4
+ * must name one, so a new preference cannot be added without deciding where a
5
+ * human finds it.
6
+ */
7
+ export type UserSettingGroup = 'display' | 'panes' | 'providers' | 'updates';
8
+ export interface UserSettingDefinition<Key extends string = string> {
9
+ key: Key;
10
+ label: string;
11
+ description: string;
12
+ valueConstraint: string;
13
+ applies: string;
14
+ group: UserSettingGroup;
15
+ order: number;
16
+ format: (config: ScopeConfig) => string;
17
+ cycle: (config: ScopeConfig, delta: number) => void;
18
+ /** Mutate `config` from a CLI string, returning a user-facing validation error on failure. */
19
+ setFromString: (config: ScopeConfig, raw: string) => string | null;
20
+ }
21
+ /**
22
+ * Exhaustive settings-surface coverage for ScopeConfig. Primitive preferences
23
+ * are required by the type to define a Settings row; structured registries must
24
+ * name the specialized surface that owns them. Adding a config field therefore
25
+ * fails typecheck until its user-facing settings coverage is decided. The
26
+ * auto_update nested record is exhaustive for the same reason.
27
+ */
28
+ export declare const CONFIG_SETTINGS_COVERAGE: {
29
+ schema_version: {
30
+ surface: "specialized";
31
+ owner: string;
32
+ };
33
+ marketplaces: {
34
+ surface: "specialized";
35
+ owner: string;
36
+ };
37
+ plugins: {
38
+ surface: "specialized";
39
+ owner: string;
40
+ };
41
+ auto_update: {
42
+ surface: "settings";
43
+ settings: {
44
+ crtr: {
45
+ key: "auto_update.crtr";
46
+ label: string;
47
+ description: string;
48
+ valueConstraint: string;
49
+ applies: string;
50
+ group: "updates";
51
+ order: number;
52
+ format: (config: ScopeConfig) => "notify" | "apply" | "off";
53
+ cycle: (config: ScopeConfig, delta: number) => void;
54
+ setFromString: (config: ScopeConfig, raw: string) => "auto_update.crtr must be notify, apply, or false" | null;
55
+ };
56
+ content: {
57
+ key: "auto_update.content";
58
+ label: string;
59
+ description: string;
60
+ valueConstraint: string;
61
+ applies: string;
62
+ group: "updates";
63
+ order: number;
64
+ format: (config: ScopeConfig) => "notify" | "apply" | "off";
65
+ cycle: (config: ScopeConfig, delta: number) => void;
66
+ setFromString: (config: ScopeConfig, raw: string) => "auto_update.content must be notify, apply, or false" | null;
67
+ };
68
+ interval_hours: {
69
+ key: "auto_update.interval_hours";
70
+ label: string;
71
+ description: string;
72
+ valueConstraint: string;
73
+ applies: string;
74
+ group: "updates";
75
+ order: number;
76
+ format: (config: ScopeConfig) => string;
77
+ cycle: (config: ScopeConfig, delta: number) => void;
78
+ setFromString: (config: ScopeConfig, raw: string) => string | null;
79
+ };
80
+ };
81
+ };
82
+ max_panes_per_window: {
83
+ surface: "settings";
84
+ setting: {
85
+ key: "max_panes_per_window";
86
+ label: string;
87
+ description: string;
88
+ valueConstraint: string;
89
+ applies: string;
90
+ group: "panes";
91
+ order: number;
92
+ format: (config: ScopeConfig) => string;
93
+ cycle: (config: ScopeConfig, delta: number) => void;
94
+ setFromString: (config: ScopeConfig, raw: string) => string | null;
95
+ };
96
+ };
97
+ auto_open_child_viewers: {
98
+ surface: "settings";
99
+ setting: {
100
+ key: "auto_open_child_viewers";
101
+ label: string;
102
+ description: string;
103
+ valueConstraint: string;
104
+ applies: string;
105
+ group: "panes";
106
+ order: number;
107
+ format: (config: ScopeConfig) => "on" | "off";
108
+ cycle: (config: ScopeConfig) => void;
109
+ setFromString: (config: ScopeConfig, raw: string) => string | null;
110
+ };
111
+ };
112
+ brokerThresholds: {
113
+ surface: "specialized";
114
+ owner: string;
115
+ };
116
+ lifecycle: {
117
+ surface: "specialized";
118
+ owner: string;
119
+ };
120
+ completion_bell: {
121
+ surface: "settings";
122
+ setting: {
123
+ key: "completion_bell";
124
+ label: string;
125
+ description: string;
126
+ valueConstraint: string;
127
+ applies: string;
128
+ group: "display";
129
+ order: number;
130
+ format: (config: ScopeConfig) => "on" | "off";
131
+ cycle: (config: ScopeConfig) => void;
132
+ setFromString: (config: ScopeConfig, raw: string) => string | null;
133
+ };
134
+ };
135
+ working_gerunds: {
136
+ surface: "specialized";
137
+ owner: string;
138
+ };
139
+ whip_mode: {
140
+ surface: "settings";
141
+ setting: {
142
+ key: "whip_mode";
143
+ label: string;
144
+ description: string;
145
+ valueConstraint: string;
146
+ applies: string;
147
+ group: "display";
148
+ order: number;
149
+ format: (config: ScopeConfig) => "on" | "off";
150
+ cycle: (config: ScopeConfig) => void;
151
+ setFromString: (config: ScopeConfig, raw: string) => string | null;
152
+ };
153
+ };
154
+ page_surface: {
155
+ surface: "settings";
156
+ setting: {
157
+ key: "page_surface";
158
+ label: string;
159
+ description: string;
160
+ valueConstraint: string;
161
+ applies: string;
162
+ group: "display";
163
+ order: number;
164
+ format: (config: ScopeConfig) => "on" | "off";
165
+ cycle: (config: ScopeConfig) => void;
166
+ setFromString: (config: ScopeConfig, raw: string) => string | null;
167
+ };
168
+ };
169
+ whip_messages: {
170
+ surface: "specialized";
171
+ owner: string;
172
+ };
173
+ whip_message_mode: {
174
+ surface: "settings";
175
+ setting: {
176
+ key: "whip_message_mode";
177
+ label: string;
178
+ description: string;
179
+ valueConstraint: string;
180
+ applies: string;
181
+ group: "display";
182
+ order: number;
183
+ format: (config: ScopeConfig) => "random" | "go faster";
184
+ cycle: (config: ScopeConfig, delta: number) => void;
185
+ setFromString: (config: ScopeConfig, raw: string) => string | null;
186
+ };
187
+ };
188
+ mouse_mode_default: {
189
+ surface: "settings";
190
+ setting: {
191
+ key: "mouse_mode_default";
192
+ label: string;
193
+ description: string;
194
+ valueConstraint: string;
195
+ applies: string;
196
+ group: "display";
197
+ order: number;
198
+ format: (config: ScopeConfig) => "on" | "off" | "follow tmux";
199
+ cycle: (config: ScopeConfig, delta: number) => void;
200
+ setFromString: (config: ScopeConfig, raw: string) => string | null;
201
+ };
202
+ };
203
+ live_cycles: {
204
+ surface: "settings";
205
+ setting: {
206
+ key: "live_cycles";
207
+ label: string;
208
+ description: string;
209
+ valueConstraint: string;
210
+ applies: string;
211
+ group: "display";
212
+ order: number;
213
+ format: (config: ScopeConfig) => string;
214
+ cycle: (config: ScopeConfig, delta: number) => void;
215
+ setFromString: (config: ScopeConfig, raw: string) => string | null;
216
+ };
217
+ };
218
+ condensed_history: {
219
+ surface: "settings";
220
+ setting: {
221
+ key: "condensed_history";
222
+ label: string;
223
+ description: string;
224
+ valueConstraint: string;
225
+ applies: string;
226
+ group: "display";
227
+ order: number;
228
+ format: (config: ScopeConfig) => "user" | "none" | "agent" | "both";
229
+ cycle: (config: ScopeConfig, delta: number) => void;
230
+ setFromString: (config: ScopeConfig, raw: string) => string | null;
231
+ };
232
+ };
233
+ bash_tool_purpose: {
234
+ surface: "settings";
235
+ setting: {
236
+ key: "bash_tool_purpose";
237
+ label: string;
238
+ description: string;
239
+ valueConstraint: string;
240
+ applies: string;
241
+ group: "display";
242
+ order: number;
243
+ format: (config: ScopeConfig) => "on" | "off";
244
+ cycle: (config: ScopeConfig) => void;
245
+ setFromString: (config: ScopeConfig, raw: string) => string | null;
246
+ };
247
+ };
248
+ fold_finished_tools: {
249
+ surface: "settings";
250
+ setting: {
251
+ key: "fold_finished_tools";
252
+ label: string;
253
+ description: string;
254
+ valueConstraint: string;
255
+ applies: string;
256
+ group: "display";
257
+ order: number;
258
+ format: (config: ScopeConfig) => "on" | "off";
259
+ cycle: (config: ScopeConfig) => void;
260
+ setFromString: (config: ScopeConfig, raw: string) => string | null;
261
+ };
262
+ };
263
+ summarize_tool_calls: {
264
+ surface: "settings";
265
+ setting: {
266
+ key: "summarize_tool_calls";
267
+ label: string;
268
+ description: string;
269
+ valueConstraint: string;
270
+ applies: string;
271
+ group: "display";
272
+ order: number;
273
+ format: (config: ScopeConfig) => "on" | "off";
274
+ cycle: (config: ScopeConfig) => void;
275
+ setFromString: (config: ScopeConfig, raw: string) => string | null;
276
+ };
277
+ };
278
+ detailed_tool_recaps: {
279
+ surface: "settings";
280
+ setting: {
281
+ key: "detailed_tool_recaps";
282
+ label: string;
283
+ description: string;
284
+ valueConstraint: string;
285
+ applies: string;
286
+ group: "display";
287
+ order: number;
288
+ format: (config: ScopeConfig) => "on" | "off";
289
+ cycle: (config: ScopeConfig) => void;
290
+ setFromString: (config: ScopeConfig, raw: string) => string | null;
291
+ };
292
+ };
293
+ keybindings: {
294
+ surface: "specialized";
295
+ owner: string;
296
+ };
297
+ tmux_passthrough: {
298
+ surface: "specialized";
299
+ owner: string;
300
+ };
301
+ providerOptions: {
302
+ surface: "settings";
303
+ settings: {
304
+ 'openai-codex.fastMode': {
305
+ key: "providerOptions.openai-codex.fastMode";
306
+ label: string;
307
+ description: string;
308
+ valueConstraint: string;
309
+ applies: string;
310
+ group: "providers";
311
+ order: number;
312
+ format: (config: ScopeConfig) => "on" | "off";
313
+ cycle: (config: ScopeConfig) => void;
314
+ setFromString: (config: ScopeConfig, raw: string) => string | null;
315
+ };
316
+ };
317
+ };
318
+ modelLadders: {
319
+ surface: "specialized";
320
+ owner: string;
321
+ };
322
+ modelRoutes: {
323
+ surface: "specialized";
324
+ owner: string;
325
+ };
326
+ modelRouting: {
327
+ surface: "specialized";
328
+ owner: string;
329
+ };
330
+ kinds: {
331
+ surface: "specialized";
332
+ owner: string;
333
+ };
334
+ page_components: {
335
+ surface: "specialized";
336
+ owner: string;
337
+ };
338
+ remoteCanvas: {
339
+ surface: "specialized";
340
+ owner: string;
341
+ };
342
+ api: {
343
+ surface: "specialized";
344
+ owner: string;
345
+ };
346
+ paths: {
347
+ surface: "specialized";
348
+ owner: string;
349
+ };
350
+ store: {
351
+ surface: "specialized";
352
+ owner: string;
353
+ };
354
+ runtime: {
355
+ surface: "specialized";
356
+ owner: string;
357
+ };
358
+ spawnEnv: {
359
+ surface: "specialized";
360
+ owner: string;
361
+ };
362
+ bin: {
363
+ surface: "specialized";
364
+ owner: string;
365
+ };
366
+ humanActions: {
367
+ surface: "specialized";
368
+ owner: string;
369
+ };
370
+ };
371
+ /** The exhaustive top-level key list used by config persistence and help. */
372
+ export declare const SCOPE_CONFIG_KEYS: (keyof ScopeConfig)[];
373
+ /** The single row registry shared by `sys settings` and `sys config set`. */
374
+ export declare const USER_SETTINGS: readonly UserSettingDefinition[];
375
+ export declare function findUserSetting(key: string): UserSettingDefinition | undefined;
376
+ /** The rows one settings destination owns, in registry order. */
377
+ export declare function userSettingsInGroup(group: UserSettingGroup): readonly UserSettingDefinition[];