@deepseek-ai/dsh-cordis-client-runner 0.2.2-alpha.3 → 0.2.2-rc.2
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/lib/client.js +2411 -7959
- package/lib/client.js.map +1 -0
- package/lib/types/client/api-catalog.d.ts.map +1 -0
- package/lib/types/client/api-catalog.js.map +1 -0
- package/lib/types/client/evaluator.d.ts.map +1 -0
- package/lib/types/client/evaluator.js.map +1 -0
- package/lib/types/client/guard.d.ts.map +1 -0
- package/lib/types/client/guard.js.map +1 -0
- package/lib/types/client/index.d.ts.map +1 -0
- package/lib/types/client/index.js.map +1 -0
- package/lib/types/client/inspect-registry.d.ts.map +1 -0
- package/lib/types/client/inspect-registry.js.map +1 -0
- package/lib/types/client/orchestrator.d.ts.map +1 -0
- package/lib/types/client/orchestrator.js.map +1 -0
- package/lib/types/client/providers.d.ts.map +1 -0
- package/lib/types/client/providers.js.map +1 -0
- package/lib/types/client/runtime.d.ts.map +1 -0
- package/lib/types/client/runtime.js.map +1 -0
- package/lib/types/client/slot-catalog.d.ts +6 -2
- package/lib/types/client/slot-catalog.d.ts.map +1 -0
- package/lib/types/client/slot-catalog.js.map +1 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js.map +1 -0
- package/package.json +14 -11
- package/src/client/api-catalog.ts +1208 -0
- package/src/client/evaluator.ts +222 -0
- package/src/client/guard.ts +245 -0
- package/src/client/index.ts +308 -0
- package/src/client/inspect-registry.ts +150 -0
- package/src/client/orchestrator.ts +458 -0
- package/src/client/providers.ts +263 -0
- package/src/client/runtime.ts +512 -0
- package/src/client/slot-catalog.ts +5782 -0
- package/src/index.ts +9 -0
|
@@ -0,0 +1,1208 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/gen-cordis-inspect-catalog.ts — do not edit by hand; run
|
|
3
|
+
* `pnpm run gen-cordis-inspect-catalog` to regenerate (freshness-gated by
|
|
4
|
+
* `pnpm run verify-cordis-inspect-catalog` in doc-sync).
|
|
5
|
+
*
|
|
6
|
+
* The machine-readable cordis API catalog `cordis_inspect` serves to the
|
|
7
|
+
* model: harness services (summary + structured public method contracts),
|
|
8
|
+
* harness events (mode + structured listener contracts), and the inherited `ctx` API. Produced by
|
|
9
|
+
* the same AST walk as docs/cordis-catalog, so this data and the rendered
|
|
10
|
+
* docs cannot diverge.
|
|
11
|
+
*
|
|
12
|
+
* @module @deepseek-ai/dsh-cordis-client-runner/client/api-catalog
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/* jscpd:ignore-start */
|
|
16
|
+
/** One named parameter in a Service method or Event listener. */
|
|
17
|
+
export interface ApiParameter {
|
|
18
|
+
/** Parameter name from the exact signature. */
|
|
19
|
+
name: string
|
|
20
|
+
/** Source-owned parameter contract. */
|
|
21
|
+
description: string
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** One public service member and its source-owned contract. */
|
|
25
|
+
export interface ServiceApiMethod {
|
|
26
|
+
/** Public method signature with its body stripped. */
|
|
27
|
+
signature: string
|
|
28
|
+
/** Method purpose and behavior. */
|
|
29
|
+
description: string
|
|
30
|
+
/** Named parameters in signature order. */
|
|
31
|
+
parameters: readonly ApiParameter[]
|
|
32
|
+
/** Non-void result contract when documented. */
|
|
33
|
+
returns?: string
|
|
34
|
+
/** Documented failure conditions. */
|
|
35
|
+
throws?: readonly string[]
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** One harness `ctx.<key>` service and its public methods. */
|
|
39
|
+
export interface ServiceApiEntry {
|
|
40
|
+
/** The `ctx.<key>` name, e.g. `tools`. */
|
|
41
|
+
key: string
|
|
42
|
+
/** First sentence of the service class JSDoc. */
|
|
43
|
+
summary: string
|
|
44
|
+
/** Complete service description. */
|
|
45
|
+
description: string
|
|
46
|
+
/** Public methods, bodies stripped, in source order. */
|
|
47
|
+
methods: readonly ServiceApiMethod[]
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** One harness event: its dispatch mode, exact signature, and listener contract. */
|
|
51
|
+
export interface EventApiEntry {
|
|
52
|
+
/** The scoped event name, e.g. `agent/status`. */
|
|
53
|
+
name: string
|
|
54
|
+
/** The dispatch mode from the declaration's `@mode` tag. */
|
|
55
|
+
mode: string
|
|
56
|
+
/** The exact listener signature, whitespace-normalized. */
|
|
57
|
+
signature: string
|
|
58
|
+
/** First sentence of the event JSDoc. */
|
|
59
|
+
summary: string
|
|
60
|
+
/** Complete event description. */
|
|
61
|
+
description: string
|
|
62
|
+
/** Named listener parameters in signature order. */
|
|
63
|
+
parameters: readonly ApiParameter[]
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** One inherited (cordis core + loader/hmr/timer) `ctx` member group with its summary. */
|
|
67
|
+
export interface InheritedApiEntry {
|
|
68
|
+
/** The `ctx` member name(s), e.g. `ctx.on / ctx.once`. */
|
|
69
|
+
name: string
|
|
70
|
+
/** One-line summary of what the member does. */
|
|
71
|
+
summary: string
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** One named type declaration referenced by a Service or Event signature. */
|
|
75
|
+
export interface TypeApiEntry {
|
|
76
|
+
/** The exported type/interface name, e.g. `ShellRunResult`. */
|
|
77
|
+
name: string
|
|
78
|
+
/** The full declaration text, comments stripped. */
|
|
79
|
+
declaration: string
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** Every harness `ctx.<key>` service, sorted by key. */
|
|
83
|
+
export const SERVICE_API: readonly ServiceApiEntry[] = [
|
|
84
|
+
{
|
|
85
|
+
key: 'layout',
|
|
86
|
+
summary: 'Panel navigation and geometry actions exposed through ctx.layout.',
|
|
87
|
+
description: 'Panel navigation and geometry actions exposed through ctx.layout.',
|
|
88
|
+
methods: [
|
|
89
|
+
{
|
|
90
|
+
signature: 'selectPanel(panelId: MainPanelId | null): void',
|
|
91
|
+
description: 'Select a global central panel without changing the current Session.',
|
|
92
|
+
parameters: [{ name: 'panelId', description: 'registered main key, or null to show the Conversation.' }],
|
|
93
|
+
throws: ['if the selected main key is not registered; preserves the current selection.'],
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
signature: 'beginNavigation(): AbortSignal',
|
|
97
|
+
description: 'Start an asynchronous navigation, superseding any earlier pending navigation.',
|
|
98
|
+
parameters: [],
|
|
99
|
+
returns: 'a signal aborted by the next navigation or layout disposal; check it before committing UI state.',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
signature: 'toggleSidebar(): void',
|
|
103
|
+
description: 'Toggle the sidebar panel (closed ⟷ contract default width).',
|
|
104
|
+
parameters: [],
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
signature: 'openRightbar(track: boolean, fullscreen: boolean): void',
|
|
108
|
+
description: 'Report the right panel\'s presentation without changing its expanded state.',
|
|
109
|
+
parameters: [{ name: 'track', description: 'whether the normal panel width reserves a grid track, including beneath a fullscreen overlay.' }, { name: 'fullscreen', description: 'whether the panel covers the frame and hides its outer resize handle; independent of the underlying grid track.' }],
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
signature: 'closeRightbar(): void',
|
|
113
|
+
description: 'Report the right panel as hidden: no track, no handle.',
|
|
114
|
+
parameters: [],
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
key: 'locale',
|
|
120
|
+
summary: 'Dictionary registry plus locale preference.',
|
|
121
|
+
description: 'Dictionary registry plus locale preference. Lookup walks the active language\'s declared fallback chain in the entry namespace, then repeats it in the shared common namespace before showing the key itself. Reads go through getLocale; preferences change only through setLocale, while language packs extend the catalog through addLanguage. Continuous sync uses the `locale/change` event or the LocaleFace getSnapshot/subscribe pair installed through `ctx.slots.installLocale`.',
|
|
122
|
+
methods: [
|
|
123
|
+
{
|
|
124
|
+
signature: 'getLocale(): LocaleSnapshot',
|
|
125
|
+
description: 'Read the current immutable locale snapshot.',
|
|
126
|
+
parameters: [],
|
|
127
|
+
returns: 'the current snapshot (stable reference until the next change).',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
signature: 'getSnapshot(): LocaleSnapshot',
|
|
131
|
+
description: 'LocaleFace getSnapshot: the current snapshot (carries `revision`; stable reference between changes, uSES-safe).',
|
|
132
|
+
parameters: [],
|
|
133
|
+
returns: 'the current snapshot.',
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
signature: 'subscribe(fn: () => void): () => void',
|
|
137
|
+
description: 'LocaleFace subscribe: notified on every snapshot change (locale switch or dictionary registration — registrations bump the revision so already rendered outlets pick up late-arriving dictionaries and locale definitions).',
|
|
138
|
+
parameters: [{ name: 'fn', description: 'change callback.' }],
|
|
139
|
+
returns: 'unsubscribe.',
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
signature: 'setLocale(id: string): void',
|
|
143
|
+
description: 'Switch the active locale — the only user preference write entry.\n\nThe durable write happens even when the id already matches the active locale, because the active value may be a provisional browser-derived or fallback resolution that nothing has stored yet. Picking the language already on screen is still an explicit choice, and it must survive a different browser sharing the same DSH home. Only the render notification is conditional: republishing an unchanged locale would churn every subscriber for nothing.',
|
|
144
|
+
parameters: [{ name: 'id', description: 'a registered locale id; unknown ids throw.' }],
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
signature: 'addLanguage(input: LanguageRegistration): () => void',
|
|
148
|
+
description: 'Add one selectable language to the shared catalog. Its fallback must already be registered, and following fallback definitions must terminate at English. Dictionaries may register before or after this definition. Registration rechecks an unresolved Host preference and the browser\'s ordered language list. The caller owns the returned disposer; removing an active language falls back without clearing the stored id.',
|
|
149
|
+
parameters: [{ name: 'input', description: 'stable id, self-described label, and fallback language id.' }],
|
|
150
|
+
returns: 'idempotent disposer removing this exact definition.',
|
|
151
|
+
throws: ['when fields are malformed, the id is occupied, or the fallback target is unknown or creates a cycle.'],
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
signature: 'register<N extends Extract<keyof LocaleNamespaceMap, string>>( ns: N, dicts: Record<BuiltInLocaleId, LocaleDictOf<N>> & Record<LocaleId, LocaleDictOf<N>>, ): () => void',
|
|
155
|
+
description: 'Register a declared namespace\'s dictionaries, all locales in one call — the typed form: each dictionary is checked against the namespace\'s LocaleNamespaceMap key union (a missing or extra key is a compile error), and both baseline locales are required (bilingual balance enforced at registration). Duplicate (ns, locale) throws (single occupant; a namespace\'s texts have one owner). Registration bumps the revision so mounted outlets pick up late-arriving dictionaries.',
|
|
156
|
+
parameters: [{ name: 'ns', description: 'a namespace merged into LocaleNamespaceMap.' }, { name: 'dicts', description: 'complete baseline dictionaries and optional dictionaries for additional locale ids.' }],
|
|
157
|
+
returns: 'disposer removing every locale registered by this call (idempotent).',
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
signature: 'register(ns: string, locale: string, dict: LocaleDict): () => void',
|
|
161
|
+
description: 'Single-locale untyped form for language-pack contributions and namespaces outside the merge table.',
|
|
162
|
+
parameters: [{ name: 'ns', description: 'namespace.' }, { name: 'locale', description: 'locale tag.' }, { name: 'dict', description: 'dictionary.' }],
|
|
163
|
+
returns: 'disposer (idempotent).',
|
|
164
|
+
throws: ['when locale is not a BCP 47-style tag.'],
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
signature: 'bind<N extends Extract<keyof LocaleNamespaceMap, string>>(ns: N): TranslateNS<N>',
|
|
168
|
+
description: 'Bind a declared namespace to a translate function typed to its dictionary key union (plus the shared common vocabulary) — the same key domain the framework-injected `t` seat carries. The returned reference is stable per namespace (repeat binds return the same function), so it can ride inject surfaces without breaking memoization.',
|
|
169
|
+
parameters: [{ name: 'ns', description: 'a namespace merged into LocaleNamespaceMap.' }],
|
|
170
|
+
returns: 'the typed translate function (reads the active locale at call time).',
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
signature: 'bind(ns: string): Translate',
|
|
174
|
+
description: 'Untyped form for namespaces outside the merge table (dynamic composition, tests).',
|
|
175
|
+
parameters: [{ name: 'ns', description: 'namespace.' }],
|
|
176
|
+
returns: 'the translate function.',
|
|
177
|
+
},
|
|
178
|
+
],
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
key: 'sessions',
|
|
182
|
+
summary: 'The sessions-service face injected as `ctx.sessions`.',
|
|
183
|
+
description: 'The sessions-service face injected as `ctx.sessions`.',
|
|
184
|
+
methods: [
|
|
185
|
+
{
|
|
186
|
+
signature: 'retain(target: SessionTarget, options: SessionRetainOptions): SessionReference',
|
|
187
|
+
description: 'Retain an exact Client generation and start its shared initial history opening.',
|
|
188
|
+
parameters: [{ name: 'target', description: 'known identity or durable direct-parent address.' }, { name: 'options', description: 'required consumer source and optional independent waiter cancellation.' }],
|
|
189
|
+
returns: 'an owned reference immediately; await `reference.ready` when the initial open attempt must settle first.',
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
signature: 'using<T>(target: SessionTarget, options: SessionRetainOptions, operation: (reference: SessionReference) => T | Promise<T>): Promise<T>',
|
|
193
|
+
description: 'Hold one reference through callback settlement, including synchronous and asynchronous failures.',
|
|
194
|
+
parameters: [{ name: 'target', description: 'Session to acquire.' }, { name: 'options', description: 'source and acquisition cancellation.' }, { name: 'operation', description: 'callback using the reference only until its returned value or Promise settles.' }],
|
|
195
|
+
returns: 'the callback result after release; acquisition and callback failures propagate unchanged.',
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
signature: 'retainInfo(id: SessionId): ObservableSnapshot<SessionRetainInfo>',
|
|
199
|
+
description: 'Observe local reference counts without retaining, creating a scope, or opening history. The returned source keeps stable identity across same-id generations and remains allocated until the Client root is disposed, even after its final subscriber leaves.',
|
|
200
|
+
parameters: [{ name: 'id', description: 'explicit Session identity; Host existence is not implied.' }],
|
|
201
|
+
returns: 'a stable read-only source across same-id generations, with zero counts when none is live.',
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
signature: 'refreshProjections(sessionId: SessionId): Promise<void>',
|
|
205
|
+
description: 'Read projections without starting migration; retry failed or migration-deferred reads.',
|
|
206
|
+
parameters: [{ name: 'sessionId', description: 'Session to inspect without opening its conversation.' }],
|
|
207
|
+
returns: 'completion of the current or newly started refresh.',
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
signature: 'search( query: string, signal: AbortSignal, ): Promise<RemoteResult<{ items: SessionSearchResultItem[]; hasMore: boolean }>>',
|
|
211
|
+
description: 'Search the Host\'s visible message-content index. Results stay request-local; the list snapshot remains the metadata authority.',
|
|
212
|
+
parameters: [{ name: 'query', description: 'non-blank literal phrase.' }, { name: 'signal', description: 'cancellation for a superseded search.' }],
|
|
213
|
+
returns: 'bounded results, or a business/transport error.',
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
signature: 'fork(opts: { sessionId: SessionId atSeq?: number increaseTitle?: boolean onCreated?: (childId: SessionId) => void /** False refuses source migration; omission preserves the Host default. */ allowMigration?: boolean }): Promise<SessionId>',
|
|
217
|
+
description: 'Fork a session from an exact inclusive prefix of the source; on resolution the child is catalogued and can be explicitly retained.',
|
|
218
|
+
parameters: [{ name: 'opts', description: 'source session id, the optional exact inclusive boundary seq (a real event seq the caller already knows; a cut inside an open turn is balanced Host-side with synthetic closers, and omission selects the latest completed-turn prefix), and whether to increment an inherited durable title, skipping numbers Host-listed titles already use, before resolving. `onCreated` observes the catalogued child before that optional rename.' }],
|
|
219
|
+
returns: 'the child session id.',
|
|
220
|
+
throws: ['when the fork fails, or when a requested child-title rename fails after creation.'],
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
signature: 'scope(id: SessionId): AgentContext | undefined',
|
|
224
|
+
description: 'Borrow an already-retained Agent-scoped Context without extending its lifetime.',
|
|
225
|
+
parameters: [{ name: 'id', description: 'session id.' }],
|
|
226
|
+
returns: 'the live scoped Context, or undefined without a retained generation.',
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
signature: 'binding(id: SessionId): SessionBinding | undefined',
|
|
230
|
+
description: 'Borrow an already-retained Session binding without extending its lifetime.',
|
|
231
|
+
parameters: [{ name: 'id', description: 'session id.' }],
|
|
232
|
+
returns: 'the live binding, or undefined without a retained generation.',
|
|
233
|
+
},
|
|
234
|
+
],
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
key: 'slots',
|
|
238
|
+
summary: 'cordis Service layer of the slot system; see the module doc for the split with SlotCore.',
|
|
239
|
+
description: 'cordis Service layer of the slot system; see the module doc for the split with SlotCore.',
|
|
240
|
+
methods: [
|
|
241
|
+
{
|
|
242
|
+
signature: 'declare readonly register: SlotCore[\'register\']',
|
|
243
|
+
description: 'The ordinary Slot registration API. The typed face IS the core\'s register (both overloads reused verbatim — one authority, no structural copy; see SlotCore.register for children declaration, store seat, inject face, load-time validation, and the unload cascade). This layer adds: disposal through the caller\'s ctx.effect (fiber unload = cascade), exclusive-factory minting (`store: createXxxStore` becomes a per-entry handle), the registrant diagnostics stamp, and store-instance lifecycle on the entry axis.\n\nDeclared here, implemented by prototype assignment below the class: it MUST stay a prototype method (never an instance arrow) — the cordis service proxy binds `this.ctx` to the CALLER\'s context at call time, which is what routes the effect (and the unload cascade) into the caller\'s fiber. An arrow property would freeze `this` to the service\'s own root ctx and silently break per-plugin disposal.',
|
|
244
|
+
parameters: [],
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
signature: 'declare readonly registerFactory: RegisterFactory',
|
|
248
|
+
description: 'Register one reusable Component Factory under the caller\'s effect lifetime. A Store factory mints one handle per rendered occurrence rather than per definition. Like SlotRegistry.register, this remains a prototype method so the Cordis proxy binds `this.ctx` to the caller\'s Context.',
|
|
249
|
+
parameters: [{ name: 'options', description: 'runtime definition checked against `SlotFactoryMap`.' }, { name: 'component', description: 'reusable Factory Component.' }],
|
|
250
|
+
returns: 'the idempotent definition disposer.',
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
signature: 'inject(key: keyof SlotMap & string, callback: () => SlotInjectionEffect): () => void',
|
|
254
|
+
description: 'Install an effect for each declaration lifetime of a slot. The callback runs synchronously when the declaration already exists; otherwise it runs inside the declaring `register()` call after the declaration is committed. Collapse disposes the effect and a later declaration runs it again. Callback effects are synchronous disposers; iterable effects install transactionally and dispose in reverse order. The controller belongs to the caller\'s fiber, so plugin unload cancels a pending wait and removes any active contribution.',
|
|
255
|
+
parameters: [{ name: 'key', description: 'declared SlotMap key to depend on.' }, { name: 'callback', description: 'creates one disposer or an iterable of disposers.' }],
|
|
256
|
+
returns: 'idempotent disposer for the wait and active effect.',
|
|
257
|
+
throws: ['callback setup failures synchronously when the slot is already declared.'],
|
|
258
|
+
},
|
|
259
|
+
],
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
key: 'theme',
|
|
263
|
+
summary: 'Theme registry and preference owner.',
|
|
264
|
+
description: 'Theme registry and preference owner. `light`/`dark` are built in (the base stylesheets carry both palettes); third-party themes register alias-layer overrides. Reads go through getTheme; preference writes only through setTheme; continuous sync only through the `theme/change` event. overrideTokens stacks partial token layers over the active theme without touching the registry. The service holds the `prefers-color-scheme` media query (environment sensing, not presentation) and re-emits when the OS scheme flips while the preference is `system`.',
|
|
265
|
+
methods: [
|
|
266
|
+
{
|
|
267
|
+
signature: 'getTheme(): ThemeSnapshot',
|
|
268
|
+
description: 'Read the current immutable theme snapshot.',
|
|
269
|
+
parameters: [],
|
|
270
|
+
returns: 'the current snapshot (stable reference until the next change).',
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
signature: 'setTheme(id: string): void',
|
|
274
|
+
description: 'Switch the theme preference — the only user preference write entry. Built-in preferences are written through the settings scope and every accepted value emits `theme/change`.',
|
|
275
|
+
parameters: [{ name: 'id', description: 'a registered theme id or `system`; unknown ids throw.' }],
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
signature: 'setFontSize(role: FontRole, px: number): void',
|
|
279
|
+
description: 'Change one role\'s font size. Accepted values are written through the settings scope and emit `theme/change`.',
|
|
280
|
+
parameters: [{ name: 'role', description: 'font role.' }, { name: 'px', description: 'integer px within the role\'s `FONT_SIZE_SPECS` range; out-of-range or fractional values throw.' }],
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
signature: 'register(definition: ThemeDefinition): () => void',
|
|
284
|
+
description: 'Register a theme. Duplicate id throws (single occupant per id; the built-in pair counts; `system` is a preference, not a registrable id).',
|
|
285
|
+
parameters: [{ name: 'definition', description: 'theme id, colorScheme, alias-token overrides, and optional icon replacements; the runtime keeps a frozen copy of `icons`. Invalid icon replacements throw a `TypeError` naming the theme and icon.' }],
|
|
286
|
+
returns: 'disposer. Disposing the theme backing the active preference resets the preference to the default so the UI never keeps tokens of an unregistered theme.',
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
signature: 'overrideTokens(source: string, tokens: ThemeTokenOverrides): () => void',
|
|
290
|
+
description: 'Stack a token override layer on top of the active theme — the token-level analogue of slot shading: the base theme stays untouched, layers compose in seq order with later layers winning per-token, and removing a layer restores whatever it covered. Calling again with the same source replaces that source\'s whole layer and restacks it on top (effect re-registration semantics). Emits `theme/change` with the recomposed snapshot.',
|
|
291
|
+
parameters: [{ name: 'source', description: 'layer identity; one layer per source (dynamic packages pass their package id — the façade pins it, so it also names the layer\'s origin for inspection).' }, { name: 'tokens', description: 'token-name → `{ light, dark }` value pairs. Validated at runtime (model-authored callers reach this boundary with untyped JS); a bare string value throws a teaching error.' }],
|
|
292
|
+
returns: 'disposer removing exactly the layer this call created; a no-op once the source has re-overridden (the newer layer is not torn down).',
|
|
293
|
+
},
|
|
294
|
+
],
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
key: 'timer',
|
|
298
|
+
summary: 'Disposable timer helpers mixed into Cordis contexts.',
|
|
299
|
+
description: 'Disposable timer helpers mixed into Cordis contexts.',
|
|
300
|
+
methods: [
|
|
301
|
+
{
|
|
302
|
+
signature: 'timeout(callback: () => void, delay: number): () => void',
|
|
303
|
+
description: 'Run a callback once and return its disposer.',
|
|
304
|
+
parameters: [],
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
signature: 'timeout(delay: number): Promise<void>',
|
|
308
|
+
description: 'Resolve after a delay; disposal rejects the pending promise.',
|
|
309
|
+
parameters: [],
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
signature: 'interval(callback: () => void, delay: number): () => void',
|
|
313
|
+
description: 'Run a callback repeatedly and return its disposer.',
|
|
314
|
+
parameters: [],
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
signature: 'interval<R = any>(delay: number): AsyncIterableIterator<void, R, void>',
|
|
318
|
+
description: 'Return an async iterator of timer ticks.',
|
|
319
|
+
parameters: [],
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
signature: 'throttle<F extends (...args: any[]) => any>(callback: F, delay: number, noTrailing?: boolean): ((...args: Parameters<F>) => void) & { dispose: () => void }',
|
|
323
|
+
description: 'Return a throttled function whose timer is disposed with the current fiber.',
|
|
324
|
+
parameters: [],
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
signature: 'debounce<F extends (...args: any[]) => any>(callback: F, delay: number): ((...args: Parameters<F>) => void) & { dispose: () => void }',
|
|
328
|
+
description: 'Return a debounced function whose timer is disposed with the current fiber.',
|
|
329
|
+
parameters: [],
|
|
330
|
+
},
|
|
331
|
+
],
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
key: 'uiWorkspace',
|
|
335
|
+
summary: 'Workspace archive and directory operations consumed by Client UI domains.',
|
|
336
|
+
description: 'Workspace archive and directory operations consumed by Client UI domains.',
|
|
337
|
+
methods: [
|
|
338
|
+
{
|
|
339
|
+
signature: 'openSession(target: SessionTarget): void',
|
|
340
|
+
description: 'Select a Session and show its Conversation as one UI navigation action.',
|
|
341
|
+
parameters: [{ name: 'target', description: 'known Session identity or durable direct-parent subagent address to display.' }],
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
signature: 'openWorkspace( workspaceId: WorkspaceId, beforeOpen?: (sessionId: SessionId) => void, options?: Pick<StartSessionOptions, \'agentPreset\'>, ): Promise<void>',
|
|
345
|
+
description: 'Connect a Workspace and open its Session unless a later navigation supersedes it.',
|
|
346
|
+
parameters: [{ name: 'workspaceId', description: 'target Workspace.' }, { name: 'beforeOpen', description: 'optional synchronous preparation for the selected Session, skipped after supersession; a throw aborts the open and releases the retained reference.' }, { name: 'options', description: 'choices for the Session the connection creates or reuses.' }],
|
|
347
|
+
returns: 'completion; a superseded request may create a Session but does not open it.',
|
|
348
|
+
throws: ['on failure; a refused creation is also shown through the Workspace notice unless a later navigation or disposal superseded the request.'],
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
signature: 'forkSession( sessionId: SessionId, onCreated?: (childId: SessionId) => void, options?: Pick<Parameters<ISessions[\'fork\']>[0], \'allowMigration\'>, ): Promise<SessionId>',
|
|
352
|
+
description: 'Fork a Session without changing the current selection.',
|
|
353
|
+
parameters: [{ name: 'sessionId', description: 'source Session.' }, { name: 'onCreated', description: 'observer before the optional child-title update.' }, { name: 'options', description: 'optional permission to start source migration; omission preserves the Host default.' }],
|
|
354
|
+
returns: 'the child SessionId after creation and inherited-title increment.',
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
signature: 'connectWorkspace(workspaceId: WorkspaceId, options?: Pick<StartSessionOptions, \'agentPreset\'>): Promise<SessionId>',
|
|
358
|
+
description: 'Resolve the Session for a new conversation in a Workspace: navigation names the first reusable blank member — listed in the Workspace, not archived, and listing no preset or the requested one — and the Host reuses it under the requested preset or its default, creating another Session when it reuses none. Concurrent calls for the same Workspace and preset share one attempt.',
|
|
359
|
+
parameters: [{ name: 'workspaceId', description: 'target Workspace.' }, { name: 'options', description: 'choices for the created or reused Session.' }],
|
|
360
|
+
returns: 'a Session already addressable through the Session Controller.',
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
signature: 'startSession(workspaceId?: WorkspaceId, options?: StartSessionOptions): void',
|
|
364
|
+
description: 'Open the Workspace blank `connectWorkspace` resolves, so New Session returns to that blank\'s unsent draft. A creation the Host refuses is shown through the Workspace notice and leaves the selection as it was.',
|
|
365
|
+
parameters: [{ name: 'workspaceId', description: 'explicit target; absent inherits the current or most recent Workspace.' }, { name: 'options', description: 'initial content, the blank\'s preset, and `whenDraftExists`, which decides whether existing text or attachments are kept, replaced, or followed by the prompt.' }],
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
signature: 'archiveSession(sessionId: SessionId, options?: { readonly stopActivity?: boolean }): Promise<void>',
|
|
369
|
+
description: 'Archive a Session and clear it when it is the current selection.',
|
|
370
|
+
parameters: [{ name: 'sessionId', description: 'Session to archive.' }, { name: 'options', description: '`stopActivity` asks the Host to stop the Session\'s running work instead of refusing.' }],
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
signature: 'unarchiveSession(sessionId: SessionId): Promise<void>',
|
|
374
|
+
description: 'Unarchive a Session, restoring it to its recorded Workspace position.',
|
|
375
|
+
parameters: [{ name: 'sessionId', description: 'Session to unarchive.' }],
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
signature: 'pickDirectory(): Promise<string | null>',
|
|
379
|
+
description: 'Open the Host-native directory picker.',
|
|
380
|
+
parameters: [],
|
|
381
|
+
returns: 'the selected directory, or null when cancelled.',
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
signature: 'listDirectory(path?: string, signal?: AbortSignal): Promise<DirectoryListing>',
|
|
385
|
+
description: 'List one Host directory level.',
|
|
386
|
+
parameters: [{ name: 'path', description: 'directory path; absent selects the Host home.' }, { name: 'signal', description: 'cancellation for a superseded scan.' }],
|
|
387
|
+
returns: 'directory entries and breadcrumb ancestry.',
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
signature: 'createDirectory(path: string, name: string): Promise<string>',
|
|
391
|
+
description: 'Create a child directory.',
|
|
392
|
+
parameters: [{ name: 'path', description: 'existing parent directory.' }, { name: 'name', description: 'child directory name.' }],
|
|
393
|
+
returns: 'created absolute path.',
|
|
394
|
+
},
|
|
395
|
+
],
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
key: 'workspaces',
|
|
399
|
+
summary: 'Workspace Controller\'s Client service face.',
|
|
400
|
+
description: 'Workspace Controller\'s Client service face.',
|
|
401
|
+
methods: [
|
|
402
|
+
{
|
|
403
|
+
signature: 'create(input: { path: string }): Promise<WorkspaceView>',
|
|
404
|
+
description: 'Register an existing path as a Workspace.',
|
|
405
|
+
parameters: [{ name: 'input', description: 'Host create payload.' }],
|
|
406
|
+
returns: 'the created or idempotently resolved Workspace.',
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
signature: 'rename(workspaceId: WorkspaceId, title: string): Promise<WorkspaceView>',
|
|
410
|
+
description: 'Rename a Workspace.',
|
|
411
|
+
parameters: [{ name: 'workspaceId', description: 'target Workspace.' }, { name: 'title', description: 'new display title.' }],
|
|
412
|
+
returns: 'the renamed Workspace.',
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
signature: 'delete(workspaceId: WorkspaceId): Promise<void>',
|
|
416
|
+
description: 'Delete a Workspace registration without deleting Sessions or files.',
|
|
417
|
+
parameters: [{ name: 'workspaceId', description: 'target Workspace.' }],
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
signature: 'archiveSession(sessionId: SessionId, options?: { readonly stopActivity?: boolean }): Promise<void>',
|
|
421
|
+
description: 'Archive a Session from Workspace grouping surfaces.',
|
|
422
|
+
parameters: [{ name: 'sessionId', description: 'Session to archive.' }, { name: 'options', description: '`stopActivity` asks the Host to stop the Session\'s running work instead of refusing.' }],
|
|
423
|
+
throws: ['{WorkspaceArchiveError} when the Host refuses; without `stopActivity` a Session with running work fails as `workspace/session-active`, its details naming what runs.'],
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
signature: 'unarchiveSession(sessionId: SessionId): Promise<void>',
|
|
427
|
+
description: 'Unarchive a Session from the archived Session list.',
|
|
428
|
+
parameters: [{ name: 'sessionId', description: 'Session to unarchive.' }],
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
signature: 'insertSessionBefore( workspaceId: WorkspaceId, sessionId: SessionId, beforeSessionId?: SessionId, ): Promise<WorkspaceView>',
|
|
432
|
+
description: 'Move a Session within one Workspace account.',
|
|
433
|
+
parameters: [{ name: 'workspaceId', description: 'owning Workspace.' }, { name: 'sessionId', description: 'Session to move.' }, { name: 'beforeSessionId', description: 'anchor Session; omitted appends.' }],
|
|
434
|
+
returns: 'the changed Workspace.',
|
|
435
|
+
},
|
|
436
|
+
],
|
|
437
|
+
},
|
|
438
|
+
]
|
|
439
|
+
|
|
440
|
+
/** Every harness event, sorted by name. */
|
|
441
|
+
export const EVENT_API: readonly EventApiEntry[] = [
|
|
442
|
+
{
|
|
443
|
+
name: 'connection/reset',
|
|
444
|
+
mode: 'emit',
|
|
445
|
+
signature: '\'connection/reset\'(): void',
|
|
446
|
+
summary: 'A connection generation was established.',
|
|
447
|
+
description: 'A connection generation was established. Wire-derived caches must repull; long-lived streams own their own resume and baseline lifecycle.',
|
|
448
|
+
parameters: [],
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
name: 'locale/change',
|
|
452
|
+
mode: 'emit',
|
|
453
|
+
signature: '\'locale/change\'(snapshot: LocaleSnapshot): void',
|
|
454
|
+
summary: 'The active locale switched.',
|
|
455
|
+
description: 'The active locale switched. Dictionary registrations do NOT emit this event (listeners may re-register slots in response, and boot registers one namespace per package); continuous render refresh rides the LocaleFace revision instead.',
|
|
456
|
+
parameters: [{ name: 'snapshot', description: 'Current immutable locale snapshot.' }],
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
name: 'slots/changed',
|
|
460
|
+
mode: 'emit',
|
|
461
|
+
signature: '\'slots/changed\'(key: string): void',
|
|
462
|
+
summary: 'An ordinary Slot declaration or entry registration set changed.',
|
|
463
|
+
description: 'An ordinary Slot declaration or entry registration set changed. Factory definitions publish through `subscribeFactory()` instead.',
|
|
464
|
+
parameters: [{ name: 'key', description: 'mutated SlotMap key.' }],
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
name: 'theme/change',
|
|
468
|
+
mode: 'emit',
|
|
469
|
+
signature: '\'theme/change\'(snapshot: ThemeSnapshot): void',
|
|
470
|
+
summary: 'Theme state changed (preference switched, registry updated, or the OS color scheme changed while the preference is `system`).',
|
|
471
|
+
description: 'Theme state changed (preference switched, registry updated, or the OS color scheme changed while the preference is `system`).',
|
|
472
|
+
parameters: [{ name: 'snapshot', description: 'Current immutable theme snapshot.' }],
|
|
473
|
+
},
|
|
474
|
+
]
|
|
475
|
+
|
|
476
|
+
/** Shapes of every exported type the Service and Event signatures reference (transitively), sorted by name. */
|
|
477
|
+
export const TYPE_API: readonly TypeApiEntry[] = [
|
|
478
|
+
{
|
|
479
|
+
name: 'ActionsDecl',
|
|
480
|
+
declaration: 'export type ActionsDecl<T> = Record<string, (draft: T, ...params: any[]) => void>;',
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
name: 'AgentContext',
|
|
484
|
+
declaration: 'export type AgentContext = Omit<Context, \'remote\'> & {\n readonly remote: ClientRemote & TypertRemoteScopeApi<\'agent\'>;\n};',
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
name: 'AssistantLiveChunkEvent',
|
|
488
|
+
declaration: 'export interface AssistantLiveChunkEvent {\n readonly type: \'assistant/live-chunk\';\n readonly seq: number;\n readonly time: number;\n readonly data: {\n readonly attemptId: LlmAttemptId;\n readonly turn: number;\n readonly step: number;\n readonly chunk: StreamChunk;\n };\n}',
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
name: 'BakedActions',
|
|
492
|
+
declaration: 'export type BakedActions<T, A extends ActionsDecl<T>> = {\n [K in keyof A]: A[K] extends (draft: T, ...params: infer P) => void ? (...params: P) => void : never;\n};',
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
name: 'BeginSubmissionInput',
|
|
496
|
+
declaration: 'export interface BeginSubmissionInput {\n readonly mode: \'queue\' | \'steer\';\n readonly text: string;\n readonly attachments: readonly PendingSubmissionAttachment[];\n readonly onAccept?: () => void;\n readonly onRetire?: (retirement: PendingSubmissionRetirement) => void;\n}',
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
name: 'BoundActions',
|
|
500
|
+
declaration: 'export type BoundActions<H> = H extends StoreHandle<infer T, infer A> ? BakedActions<T, A> : never;',
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
name: 'BuiltInLocaleId',
|
|
504
|
+
declaration: 'export type BuiltInLocaleId = typeof LOCALE_IDS[number];',
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
name: 'ChainKeysOf',
|
|
508
|
+
declaration: 'export type ChainKeysOf<S extends keyof SlotMap & string> = S extends unknown ? (SlotMap[S][\'kind\'] extends \'chain\' ? S : never) : never;',
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
name: 'ChainRenderOpts',
|
|
512
|
+
declaration: 'export interface ChainRenderOpts {\n fallback?: ReactNode;\n fallbackOnly?: boolean;\n overlay?: boolean;\n}',
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
name: 'ChildrenDecl',
|
|
516
|
+
declaration: 'export type ChildrenDecl = {\n [P in keyof SlotMap & string]?: SlotSpec<SlotMap[P]>;\n};',
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
name: 'ClientConnectionRpc',
|
|
520
|
+
declaration: 'export interface ClientConnectionRpc {\n call(channel: string, endpoint: string, payload: unknown, signal?: AbortSignal): Promise<ConnectionRpcResult<unknown>>;\n readonly open?: (channel: string, endpoint: string, payload: unknown, signal: AbortSignal, uplink?: AsyncIterable<unknown>) => AsyncIterable<unknown>;\n}',
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
name: 'ClientRemote',
|
|
524
|
+
declaration: 'export interface ClientRemote extends TypertClientRemote {\n $stream<Item>(options: RemoteStreamOptions<Item>): RemoteStream<Item>;\n readonly $host: RemoteHostFacts;\n}',
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
name: 'CommonKeyOf',
|
|
528
|
+
declaration: 'export type CommonKeyOf = LocaleNamespaceMap extends {\n common: infer C;\n} ? C & string : never;',
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
name: 'ComposedProps',
|
|
532
|
+
declaration: 'export type ComposedProps<K extends keyof SlotMap & string, EntryKey extends EntryKeyOf<K>, S extends keyof SlotMap & string, H, I extends object, M = never, N = undefined> = PropsRuntime<K, EntryKey> & PropsRenderSlots<S> & PropsRenderFactories & PropsStore<H> & InjectFace<I> & MatchedShare<SlotMap[K], M> & HocShare<SlotMap[K]> & PropsLocale<N>;',
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
name: 'ConnectionGeneration',
|
|
536
|
+
declaration: 'export interface ConnectionGeneration {\n readonly id: number;\n readonly host: ConnectionHostInfo;\n}',
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
name: 'ConnectionGenerationSource',
|
|
540
|
+
declaration: 'export type ConnectionGenerationSource = (signal: AbortSignal, ready: (host: ConnectionHostInfo) => void) => Promise<void>;',
|
|
541
|
+
},
|
|
542
|
+
{
|
|
543
|
+
name: 'ConnectionGenerationState',
|
|
544
|
+
declaration: 'export interface ConnectionGenerationState {\n getSnapshot(): ConnectionGeneration | undefined;\n subscribe(listener: () => void): () => void;\n}',
|
|
545
|
+
},
|
|
546
|
+
{
|
|
547
|
+
name: 'ConnectionHandle',
|
|
548
|
+
declaration: 'export interface ConnectionHandle {\n readonly interactions: ConnectionInteractions;\n readonly isLoopback: boolean;\n readonly generation: ConnectionGenerationState;\n readonly state: ConnectionStateSource;\n readonly rpc: ClientConnectionRpc;\n openWebSocket(path: string): ConnectionWebSocket;\n reconnect(): void;\n registerGenerationSource(source: ConnectionGenerationSource): () => void;\n start(sinks: ConnectionSinks, config?: ConnectionRecoveryConfig): ConnectionLoop;\n}',
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
name: 'ConnectionHostInfo',
|
|
552
|
+
declaration: 'export interface ConnectionHostInfo {\n readonly home: string;\n}',
|
|
553
|
+
},
|
|
554
|
+
{
|
|
555
|
+
name: 'ConnectionInteractions',
|
|
556
|
+
declaration: 'export type ConnectionInteractions = \'answer\' | \'none\';',
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
name: 'ConnectionLoop',
|
|
560
|
+
declaration: 'export interface ConnectionLoop {\n stop(): void;\n}',
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
name: 'ConnectionRecoveryConfig',
|
|
564
|
+
declaration: 'export interface ConnectionRecoveryConfig {\n backoffBaseMs?: number;\n backoffFactor?: number;\n backoffMaxMs?: number;\n generationReadyWarnMs?: number;\n generationReadyTimeoutMs?: number;\n}',
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
name: 'ConnectionRpcFailure',
|
|
568
|
+
declaration: 'export interface ConnectionRpcFailure {\n readonly code: string;\n readonly message: string;\n readonly details: object;\n}',
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
name: 'ConnectionRpcResult',
|
|
572
|
+
declaration: 'export type ConnectionRpcResult<T> = {\n readonly ok: true;\n readonly value: T;\n} | {\n readonly ok: false;\n readonly error: ConnectionRpcFailure;\n};',
|
|
573
|
+
},
|
|
574
|
+
{
|
|
575
|
+
name: 'ConnectionSinks',
|
|
576
|
+
declaration: 'export interface ConnectionSinks {\n onConnected?: (host: ConnectionHostInfo) => void;\n onStateChange?: (state: ConnectionState) => void;\n onReconnectRequested?: () => void;\n}',
|
|
577
|
+
},
|
|
578
|
+
{
|
|
579
|
+
name: 'ConnectionState',
|
|
580
|
+
declaration: 'export type ConnectionState = \'connected\' | \'disconnected\' | \'connecting\';',
|
|
581
|
+
},
|
|
582
|
+
{
|
|
583
|
+
name: 'ConnectionStateSource',
|
|
584
|
+
declaration: 'export interface ConnectionStateSource {\n getSnapshot(): ConnectionState | undefined;\n subscribe(listener: () => void): () => void;\n}',
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
name: 'ConnectionWebSocket',
|
|
588
|
+
declaration: 'export interface ConnectionWebSocket {\n readonly readyState: number;\n send(data: string): void;\n close(code?: number, reason?: string): void;\n addEventListener<Event extends keyof ConnectionWebSocketEventMap>(event: Event, listener: (event: ConnectionWebSocketEventMap[Event]) => void, options?: {\n readonly once?: boolean;\n }): void;\n removeEventListener<Event extends keyof ConnectionWebSocketEventMap>(event: Event, listener: (event: ConnectionWebSocketEventMap[Event]) => void): void;\n}',
|
|
589
|
+
},
|
|
590
|
+
{
|
|
591
|
+
name: 'ConnectionWebSocketEventMap',
|
|
592
|
+
declaration: 'export interface ConnectionWebSocketEventMap {\n readonly open: object;\n readonly error: object;\n readonly close: object;\n readonly message: {\n readonly data: unknown;\n };\n}',
|
|
593
|
+
},
|
|
594
|
+
{
|
|
595
|
+
name: 'DraftInitializationOptions',
|
|
596
|
+
declaration: 'export interface DraftInitializationOptions {\n readonly prompt?: string;\n readonly clearPreviousDraft?: boolean;\n readonly whenDraftExists?: \'replace\' | \'append\' | \'keep\';\n}',
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
name: 'EntryKeyOf',
|
|
600
|
+
declaration: 'export type EntryKeyOf<K extends keyof SlotMap & string> = SlotMap[K] extends {\n kind: \'keyed\';\n keyProps: infer P extends object;\n} ? keyof P & string : string;',
|
|
601
|
+
},
|
|
602
|
+
{
|
|
603
|
+
name: 'FactoryComponentPropsOf',
|
|
604
|
+
declaration: 'export type FactoryComponentPropsOf<F extends keyof SlotFactoryMap & string> = FactoryInputPropsOf<F> & FactoryRegistrationPropsOf<F> & ScopeStandardProps<FactoryDefOf<F>[\'scope\']> & {\n useFactorySlot: UseFactorySlot<F>;\n};',
|
|
605
|
+
},
|
|
606
|
+
{
|
|
607
|
+
name: 'FactoryInjectParams',
|
|
608
|
+
declaration: 'export type FactoryInjectParams<F extends keyof SlotFactoryMap & string> = FactoryDefOf<F>[\'scope\'] extends \'session\' ? ([\n FactoryStoreOf<F>\n] extends [\n StoreDecl\n] ? [\n sessionId: SessionIdOf,\n actions: BoundActions<FactoryStoreOf<F>>\n] : [\n sessionId: SessionIdOf\n]) : FactoryDefOf<F>[\'scope\'] extends \'session-maybe\' ? ([\n FactoryStoreOf<F>\n] extends [\n StoreDecl\n] ? [\n sessionId: SessionIdOf | undefined,\n actions: BoundActions<FactoryStoreOf<F>> | undefined\n] : [\n sessionId: SessionIdOf | undefined\n]) : ([\n FactoryStoreOf<F>\n] extends [\n StoreDecl\n] ? [\n actions: BoundActions<FactoryStoreOf<F>>\n] : [\n]);',
|
|
609
|
+
},
|
|
610
|
+
{
|
|
611
|
+
name: 'FactoryLocalComponent',
|
|
612
|
+
declaration: 'export type FactoryLocalComponent<F extends keyof SlotFactoryMap & string, N extends FactoryLocalNameOf<F>> = SlotComponent<FactoryLocalComponentPropsOf<F, N>>;',
|
|
613
|
+
},
|
|
614
|
+
{
|
|
615
|
+
name: 'FactoryLocalComponentPropsOf',
|
|
616
|
+
declaration: 'export type FactoryLocalComponentPropsOf<F extends keyof SlotFactoryMap & string, N extends FactoryLocalNameOf<F>> = FactoryLocalInputPropsOf<F, N> & FactoryRegistrationPropsOf<F> & ScopeStandardProps<FactoryLocalDefOf<F, N>[\'scope\']>;',
|
|
617
|
+
},
|
|
618
|
+
{
|
|
619
|
+
name: 'FactoryRegistrationPropsOf',
|
|
620
|
+
declaration: 'export type FactoryRegistrationPropsOf<F extends keyof SlotFactoryMap & string> = FactoryRenderPropsOf<F> & PropsStore<FactoryStoreOf<F>> & InjectFace<FactoryInjectOf<F>> & PropsLocale<FactoryLocaleOf<F>> & PropsRenderFactories;',
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
name: 'FontFamilies',
|
|
624
|
+
declaration: 'export type FontFamilies = Readonly<Record<FontRole, string>>;',
|
|
625
|
+
},
|
|
626
|
+
{
|
|
627
|
+
name: 'FontRole',
|
|
628
|
+
declaration: 'export type FontRole = typeof FONT_ROLES[number];',
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
name: 'FontSizes',
|
|
632
|
+
declaration: 'export type FontSizes = Readonly<Record<FontRole, number>>;',
|
|
633
|
+
},
|
|
634
|
+
{
|
|
635
|
+
name: 'GlobalStandardProps',
|
|
636
|
+
declaration: 'export interface GlobalStandardProps {\n}',
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
name: 'HandleOf',
|
|
640
|
+
declaration: 'export type HandleOf<H> = H extends () => infer R ? R : H;',
|
|
641
|
+
},
|
|
642
|
+
{
|
|
643
|
+
name: 'HocShare',
|
|
644
|
+
declaration: 'export type HocShare<E extends SlotEntryDef> = E[\'kind\'] extends \'hoc\' ? {\n children: ReactNode;\n} : object;',
|
|
645
|
+
},
|
|
646
|
+
{
|
|
647
|
+
name: 'HooksSources',
|
|
648
|
+
declaration: 'export type HooksSources = Record<string, HostObservable<unknown>>;',
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
name: 'HostObservable',
|
|
652
|
+
declaration: 'export type HostObservable<T> = ObservableSnapshot<T>;',
|
|
653
|
+
},
|
|
654
|
+
{
|
|
655
|
+
name: 'IconGlyph',
|
|
656
|
+
declaration: 'export type IconGlyph = keyof typeof ICON_ARTWORK;',
|
|
657
|
+
},
|
|
658
|
+
{
|
|
659
|
+
name: 'IconReplacements',
|
|
660
|
+
declaration: 'export type IconReplacements = Readonly<Partial<Record<IconSymbolId, string>>>;',
|
|
661
|
+
},
|
|
662
|
+
{
|
|
663
|
+
name: 'IconSymbolId',
|
|
664
|
+
declaration: 'export type IconSymbolId = `dsw-icon-${IconGlyph}-${IconWeight}`;',
|
|
665
|
+
},
|
|
666
|
+
{
|
|
667
|
+
name: 'IconWeight',
|
|
668
|
+
declaration: 'export type IconWeight = \'regular\' | \'medium\';',
|
|
669
|
+
},
|
|
670
|
+
{
|
|
671
|
+
name: 'InjectFace',
|
|
672
|
+
declaration: 'export type InjectFace<I extends object> = I extends {\n hooks: infer HS extends HooksSources;\n} ? I extends {\n keyedHooks: infer KS extends KeyedHooksSources;\n} ? Omit<I, \'hooks\' | \'keyedHooks\'> & PropsHooks<HS> & PropsKeyedHooks<KS> : Omit<I, \'hooks\'> & PropsHooks<HS> : I extends {\n keyedHooks: infer KS extends KeyedHooksSources;\n} ? Omit<I, \'keyedHooks\'> & PropsKeyedHooks<KS> : I;',
|
|
673
|
+
},
|
|
674
|
+
{
|
|
675
|
+
name: 'InjectParams',
|
|
676
|
+
declaration: 'export type InjectParams<K extends keyof SlotMap & string, H> = ScopeOf<K> extends \'session\' ? ([\n H\n] extends [\n StoreDecl\n] ? [\n sessionId: SessionIdOf,\n actions: BoundActions<HandleOf<H>>\n] : [\n sessionId: SessionIdOf\n]) : ScopeOf<K> extends \'session-maybe\' ? ([\n H\n] extends [\n StoreDecl\n] ? [\n sessionId: SessionIdOf | undefined,\n actions: BoundActions<HandleOf<H>> | undefined\n] : [\n sessionId: SessionIdOf | undefined\n]) : ([\n H\n] extends [\n StoreDecl\n] ? [\n actions: BoundActions<HandleOf<H>>\n] : [\n]);',
|
|
677
|
+
},
|
|
678
|
+
{
|
|
679
|
+
name: 'ISession',
|
|
680
|
+
declaration: 'export interface ISession {\n readonly sessionId: SessionId;\n readonly projections: ProjectionsFace;\n beginSubmission(input: BeginSubmissionInput): SubmissionHandle;\n prompt(content: PromptContentPart[], mode: \'queue\' | \'steer\', signal?: AbortSignal, requestId?: SessionRequestId): Promise<RemoteResult<{\n accepted: true;\n }>>;\n readAttachment(attachment: ImageAttachmentRef): Promise<RemoteResult<{\n attachment: ImageAttachmentRef;\n data: Uint8Array;\n }>>;\n updateQueue(itemId: MessageId, action: QueueAction): Promise<RemoteResult<{\n accepted: true;\n }>>;\n cancel(): Promise<RemoteResult<{\n accepted: true;\n }>>;\n rename(title: string): Promise<RemoteResult<{\n title: string;\n seq: SessionSeq;\n }>>;\n loadOlder(options?: {\n deferConsumption?: boolean;\n }): Promise<void>;\n consumeOlder(): boolean;\n loadThrough(seq: SessionSeq): Promise<void>;\n command(line: string): Promise<RemoteResult<{\n matched: boolean;\n }>>;\n}',
|
|
681
|
+
},
|
|
682
|
+
{
|
|
683
|
+
name: 'ISessions',
|
|
684
|
+
declaration: 'export interface ISessions {\n readonly list: ObservableSnapshot<SessionListState>;\n retain(target: SessionTarget, options: SessionRetainOptions): SessionReference;\n using<T>(target: SessionTarget, options: SessionRetainOptions, operation: (reference: SessionReference) => T | Promise<T>): Promise<T>;\n retainInfo(id: SessionId): ObservableSnapshot<SessionRetainInfo>;\n readonly searchResultLimit: number;\n create(opts?: {\n workspaceId?: WorkspaceId;\n cwd?: string;\n sessionId?: SessionId;\n agentPreset?: string;\n }): Promise<SessionId>;\n subagentAddress(id: SessionId): SubagentAddress | undefined;\n refreshProjections(sessionId: SessionId): Promise<void>;\n refresh(): Promise<void>;\n search(query: string, signal: AbortSignal): Promise<RemoteResult<{\n items: SessionSearchResultItem[];\n hasMore: boolean;\n }>>;\n fork(opts: {\n sessionId: SessionId;\n atSeq?: number;\n increaseTitle?: boolean;\n onCreated?: (childId: SessionId) => void;\n allowMigration?: boolean;\n }): Promise<SessionId>;\n scope(id: SessionId): AgentContext | undefined;\n scopeOf(ctx: Context): SessionId | undefined;\n sessionOf(ctx: Context): SessionFace | undefined;\n binding(id: SessionId): SessionBinding | undefined;\n}',
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
name: 'KeyedHooksSources',
|
|
688
|
+
declaration: 'export type KeyedHooksSources = Record<string, KeyedStandardSource>;',
|
|
689
|
+
},
|
|
690
|
+
{
|
|
691
|
+
name: 'KeyedSnapshotSelectorHook',
|
|
692
|
+
declaration: 'export type KeyedSnapshotSelectorHook<Snapshot> = {\n (key: string): Snapshot | undefined;\n <Selected>(key: string, selector: (value: Snapshot | undefined) => Selected, equal?: (left: Selected, right: Selected) => boolean): Selected;\n};',
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
name: 'KeyedStandardSource',
|
|
696
|
+
declaration: 'export type KeyedStandardSource = (key: string, member?: string) => HostObservable<unknown> | undefined;',
|
|
697
|
+
},
|
|
698
|
+
{
|
|
699
|
+
name: 'KeyPropsOf',
|
|
700
|
+
declaration: 'export type KeyPropsOf<K extends keyof SlotMap & string, EntryKey extends EntryKeyOf<K>> = SlotMap[K] extends {\n kind: \'keyed\';\n keyProps: infer P extends object;\n} ? EntryKey extends keyof P ? P[EntryKey] extends object ? P[EntryKey] : never : never : object;',
|
|
701
|
+
},
|
|
702
|
+
{
|
|
703
|
+
name: 'LanguageRegistration',
|
|
704
|
+
declaration: 'export interface LanguageRegistration {\n id: LocaleId;\n label: string;\n fallback: LocaleId;\n}',
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
name: 'LiveCompositionNode',
|
|
708
|
+
declaration: 'export type LiveCompositionNode = LiveSlotNode | LiveFactoryNode;',
|
|
709
|
+
},
|
|
710
|
+
{
|
|
711
|
+
name: 'LiveFactoryNode',
|
|
712
|
+
declaration: 'export interface LiveFactoryNode {\n type: \'factory\';\n name: string;\n scope: SlotScope;\n registrant?: string;\n children: LiveSlotNode[];\n}',
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
name: 'LiveSlotNode',
|
|
716
|
+
declaration: 'export interface LiveSlotNode {\n type: \'slot\';\n name: string;\n kind: SlotKind;\n scope: SlotScope;\n declaredBy?: string;\n occupants: LiveSlotOccupant[];\n children: LiveSlotNode[];\n}',
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
name: 'LiveSlotOccupant',
|
|
720
|
+
declaration: 'export interface LiveSlotOccupant {\n registrant?: string;\n key?: string;\n id?: string;\n order?: number;\n priority: number;\n active: boolean;\n}',
|
|
721
|
+
},
|
|
722
|
+
{
|
|
723
|
+
name: 'LocaleDefinition',
|
|
724
|
+
declaration: 'export interface LocaleDefinition {\n readonly id: LocaleId;\n readonly label: string;\n readonly fallback?: LocaleId;\n}',
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
name: 'LocaleDict',
|
|
728
|
+
declaration: 'export type LocaleDict = Record<string, string>;',
|
|
729
|
+
},
|
|
730
|
+
{
|
|
731
|
+
name: 'LocaleDictOf',
|
|
732
|
+
declaration: 'export type LocaleDictOf<N extends keyof LocaleNamespaceMap & string> = Record<LocaleNamespaceMap[N] & string, string>;',
|
|
733
|
+
},
|
|
734
|
+
{
|
|
735
|
+
name: 'LocaleId',
|
|
736
|
+
declaration: 'export type LocaleId = string;',
|
|
737
|
+
},
|
|
738
|
+
{
|
|
739
|
+
name: 'LocaleKeysOf',
|
|
740
|
+
declaration: 'export type LocaleKeysOf<N extends keyof LocaleNamespaceMap & string> = (LocaleNamespaceMap[N] & string) | CommonKeyOf;',
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
name: 'LocaleNamespaceMap',
|
|
744
|
+
declaration: 'export interface LocaleNamespaceMap {\n}',
|
|
745
|
+
},
|
|
746
|
+
{
|
|
747
|
+
name: 'LocaleSnapshot',
|
|
748
|
+
declaration: 'export interface LocaleSnapshot {\n active: LocaleId;\n locales: readonly LocaleDefinition[];\n revision: number;\n}',
|
|
749
|
+
},
|
|
750
|
+
{
|
|
751
|
+
name: 'MainPanelId',
|
|
752
|
+
declaration: 'export type MainPanelId = Branded<\'MainPanelId\'>;',
|
|
753
|
+
},
|
|
754
|
+
{
|
|
755
|
+
name: 'MatchedShare',
|
|
756
|
+
declaration: 'export type MatchedShare<E extends SlotEntryDef, M> = E[\'kind\'] extends \'chain\' ? {\n matched: M;\n} : object;',
|
|
757
|
+
},
|
|
758
|
+
{
|
|
759
|
+
name: 'ObservableSnapshot',
|
|
760
|
+
declaration: 'export interface ObservableSnapshot<T> {\n getSnapshot(): T;\n subscribe(fn: () => void): () => void;\n}',
|
|
761
|
+
},
|
|
762
|
+
{
|
|
763
|
+
name: 'OpenState',
|
|
764
|
+
declaration: 'export type OpenState = \'cold\' | \'loading\' | \'open\' | \'error\';',
|
|
765
|
+
},
|
|
766
|
+
{
|
|
767
|
+
name: 'OwnerOf',
|
|
768
|
+
declaration: 'export type OwnerOf<K extends keyof SlotMap & string> = SlotMap[K] extends {\n owner: infer O extends object;\n} ? O : object;',
|
|
769
|
+
},
|
|
770
|
+
{
|
|
771
|
+
name: 'PendingSubmission',
|
|
772
|
+
declaration: 'export interface PendingSubmission {\n readonly requestId: SessionRequestId;\n readonly placement: PendingSubmissionPlacement;\n readonly time: number;\n readonly text: string;\n readonly attachments: readonly PendingSubmissionAttachment[];\n}',
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
name: 'PendingSubmissionAttachment',
|
|
776
|
+
declaration: 'export type PendingSubmissionAttachment = PendingSubmissionImageAttachment | PendingSubmissionFileAttachment;',
|
|
777
|
+
},
|
|
778
|
+
{
|
|
779
|
+
name: 'PendingSubmissionFileAttachment',
|
|
780
|
+
declaration: 'export interface PendingSubmissionFileAttachment {\n readonly type: \'file\';\n readonly value: FileAttachmentRef;\n}',
|
|
781
|
+
},
|
|
782
|
+
{
|
|
783
|
+
name: 'PendingSubmissionImage',
|
|
784
|
+
declaration: 'export interface PendingSubmissionImage {\n readonly previewUrl: string;\n readonly name?: string;\n readonly width?: number;\n readonly height?: number;\n}',
|
|
785
|
+
},
|
|
786
|
+
{
|
|
787
|
+
name: 'PendingSubmissionImageAttachment',
|
|
788
|
+
declaration: 'export interface PendingSubmissionImageAttachment {\n readonly type: \'image\';\n readonly value: PendingSubmissionImage;\n}',
|
|
789
|
+
},
|
|
790
|
+
{
|
|
791
|
+
name: 'PendingSubmissionPlacement',
|
|
792
|
+
declaration: 'export type PendingSubmissionPlacement = \'transcript\' | \'queued\' | \'steering\';',
|
|
793
|
+
},
|
|
794
|
+
{
|
|
795
|
+
name: 'PendingSubmissionRetirement',
|
|
796
|
+
declaration: 'export type PendingSubmissionRetirement = {\n readonly reason: \'observed\';\n readonly attachments: readonly (ImageAttachmentRef | FileAttachmentRef)[];\n} | {\n readonly reason: \'failed\';\n};',
|
|
797
|
+
},
|
|
798
|
+
{
|
|
799
|
+
name: 'ProjectionsFace',
|
|
800
|
+
declaration: 'export interface ProjectionsFace {\n faceOf(key: string): ObservableSnapshot<unknown>;\n}',
|
|
801
|
+
},
|
|
802
|
+
{
|
|
803
|
+
name: 'PromptContentPart',
|
|
804
|
+
declaration: 'export type PromptContentPart = {\n readonly type: \'text\';\n readonly text: string;\n} | {\n readonly type: \'image\';\n readonly mediaType: ImageMediaType;\n readonly data: string;\n readonly name?: string;\n} | {\n readonly type: \'file\';\n readonly receiptId: Branded<\'file-upload-receipt-id\'>;\n};',
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
name: 'PromptError',
|
|
808
|
+
declaration: 'export interface PromptError {\n readonly op: \'send\' | \'stop\';\n readonly error: RemoteFailure;\n}',
|
|
809
|
+
},
|
|
810
|
+
{
|
|
811
|
+
name: 'PropsHooks',
|
|
812
|
+
declaration: 'export type PropsHooks<HS extends HooksSources> = {\n [N in keyof HS & string as `use${Capitalize<N>}`]: SnapshotSelectorHook<HS[N] extends HostObservable<infer T> ? T : never>;\n};',
|
|
813
|
+
},
|
|
814
|
+
{
|
|
815
|
+
name: 'PropsKeyedHooks',
|
|
816
|
+
declaration: 'export type PropsKeyedHooks<HS extends KeyedHooksSources> = {\n [N in keyof HS & string as `use${Capitalize<N>}`]: KeyedSnapshotSelectorHook<HS[N] extends (key: string) => HostObservable<infer T> | undefined ? T : never>;\n};',
|
|
817
|
+
},
|
|
818
|
+
{
|
|
819
|
+
name: 'PropsLocale',
|
|
820
|
+
declaration: 'export type PropsLocale<N> = N extends keyof LocaleNamespaceMap & string ? {\n t: TranslateNS<N>;\n} : object;',
|
|
821
|
+
},
|
|
822
|
+
{
|
|
823
|
+
name: 'PropsRenderFactories',
|
|
824
|
+
declaration: 'export interface PropsRenderFactories {\n renderFactorySlot: RenderFactorySlot;\n}',
|
|
825
|
+
},
|
|
826
|
+
{
|
|
827
|
+
name: 'PropsRenderSlots',
|
|
828
|
+
declaration: 'export type PropsRenderSlots<S extends keyof SlotMap & string> = {\n renderSlot: RenderSlotFn<Exclude<S, ChainKeysOf<S>>>;\n readonly __renders?: ((key: S) => void) | undefined;\n} & ([\n ChainKeysOf<S>\n] extends [\n never\n] ? object : {\n renderSlotChain: <K extends ChainKeysOf<S>>(key: K, owner: OwnerOf<K>, opts?: ChainRenderOpts) => ReactNode;\n}) & ([\n Extract<ScopeOf<S>, \'session\' | \'session-maybe\'>\n] extends [\n never\n] ? object : {\n SessionProvider: SessionProviderComponent;\n});',
|
|
829
|
+
},
|
|
830
|
+
{
|
|
831
|
+
name: 'PropsRuntime',
|
|
832
|
+
declaration: 'export type PropsRuntime<K extends keyof SlotMap & string, EntryKey extends EntryKeyOf<K> = EntryKeyOf<K>> = OwnerOf<K> & KeyPropsOf<K, EntryKey> & SlotInjectFace<SlotInjectOf<K>> & ScopeStandardProps<ScopeOf<K>>;',
|
|
833
|
+
},
|
|
834
|
+
{
|
|
835
|
+
name: 'PropsSlotHooks',
|
|
836
|
+
declaration: 'export type PropsSlotHooks<HS extends object> = {\n [N in keyof HS & string as `use${Capitalize<N>}`]: BoundHookOf<HS[N]>;\n};',
|
|
837
|
+
},
|
|
838
|
+
{
|
|
839
|
+
name: 'PropsStore',
|
|
840
|
+
declaration: 'export type PropsStore<H> = H extends StoreHandle<infer T, infer A> ? {\n useStore: SnapshotSelectorHook<T>;\n actions: BakedActions<T, A>;\n} : object;',
|
|
841
|
+
},
|
|
842
|
+
{
|
|
843
|
+
name: 'QueueAction',
|
|
844
|
+
declaration: 'export type QueueAction = {\n readonly kind: \'edit\';\n readonly content: readonly TextBlock[];\n} | {\n readonly kind: \'remove\';\n} | {\n readonly kind: \'steer\';\n};',
|
|
845
|
+
},
|
|
846
|
+
{
|
|
847
|
+
name: 'RegisterFactory',
|
|
848
|
+
declaration: 'export interface RegisterFactory {\n <F extends keyof SlotFactoryMap & string>(options: RegisterFactoryOptions<F>, component: SlotComponent<FactoryComponentPropsOf<F>>): () => void;\n}',
|
|
849
|
+
},
|
|
850
|
+
{
|
|
851
|
+
name: 'RegisterFactoryOptions',
|
|
852
|
+
declaration: 'export type RegisterFactoryOptions<F extends keyof SlotFactoryMap & string> = {\n name: F;\n scope: FactoryDefOf<F>[\'scope\'];\n} & FactoryField<F, \'children\', FactoryChildrenOf<F>> & FactoryField<F, \'store\', FactoryStoreOf<F> | (() => FactoryStoreOf<F>)> & FactoryField<F, \'inject\', (...args: FactoryInjectParams<F>) => FactoryInjectOf<F>> & FactoryField<F, \'locale\', FactoryLocaleOf<F>> & FactoryField<F, \'slots\', RuntimeFactorySlots<F>> & FactoryCollisionCheck<F> & FactoryChildrenCheck<F>;',
|
|
853
|
+
},
|
|
854
|
+
{
|
|
855
|
+
name: 'RemoteHostFacts',
|
|
856
|
+
declaration: 'export interface RemoteHostFacts {\n readonly home: string | undefined;\n readonly isLoopback: boolean;\n}',
|
|
857
|
+
},
|
|
858
|
+
{
|
|
859
|
+
name: 'RemoteStream',
|
|
860
|
+
declaration: 'export class RemoteStream<Item> implements AsyncIterable<RemoteStreamItem<Item>> {\n constructor(private readonly connection: Pick<ConnectionHandle, \'generation\'>, private readonly options: RemoteStreamOptions<Item>);\n get signal(): AbortSignal;\n restart(): void;\n dispose(): Promise<void>;\n [Symbol.asyncIterator](): AsyncIterator<RemoteStreamItem<Item>>;\n}',
|
|
861
|
+
},
|
|
862
|
+
{
|
|
863
|
+
name: 'RemoteStreamCarrierError',
|
|
864
|
+
declaration: 'export class RemoteStreamCarrierError extends Error {\n constructor(message: string, options?: ErrorOptions);\n}',
|
|
865
|
+
},
|
|
866
|
+
{
|
|
867
|
+
name: 'RemoteStreamItem',
|
|
868
|
+
declaration: 'export interface RemoteStreamItem<Item> {\n readonly generation: number;\n readonly value: Item;\n readonly signal: AbortSignal;\n accept(): void;\n}',
|
|
869
|
+
},
|
|
870
|
+
{
|
|
871
|
+
name: 'RemoteStreamOptions',
|
|
872
|
+
declaration: 'export interface RemoteStreamOptions<Item> {\n readonly name: string;\n readonly open: (signal: AbortSignal) => AsyncIterable<Item>;\n readonly ended: (accepted: boolean) => Error;\n readonly carrierFailed?: (error: RemoteStreamCarrierError) => void;\n}',
|
|
873
|
+
},
|
|
874
|
+
{
|
|
875
|
+
name: 'RenderFactorySlot',
|
|
876
|
+
declaration: 'export type RenderFactorySlot = <F extends keyof SlotFactoryMap & string>(name: F, props: FactoryInputPropsOf<F>, options?: {\n slots?: Partial<{\n [N in FactoryLocalNameOf<F>]: FactoryLocalComponent<F, N>;\n }>;\n fallback?: ReactNode;\n}) => ReactNode;',
|
|
877
|
+
},
|
|
878
|
+
{
|
|
879
|
+
name: 'ScopeOf',
|
|
880
|
+
declaration: 'export type ScopeOf<K extends keyof SlotMap & string> = SlotMap[K][\'scope\'];',
|
|
881
|
+
},
|
|
882
|
+
{
|
|
883
|
+
name: 'ScopeStandardProps',
|
|
884
|
+
declaration: 'export type ScopeStandardProps<S extends SlotScope> = (S extends \'session\' ? SessionStandardProps : S extends \'session-maybe\' ? SessionMaybeStandardProps : object) & GlobalStandardProps;',
|
|
885
|
+
},
|
|
886
|
+
{
|
|
887
|
+
name: 'SessionAreaProps',
|
|
888
|
+
declaration: 'export interface SessionAreaProps {\n readonly session?: SlotScopeTargetMap[keyof SlotScopeTargetMap & \'session\'] | undefined;\n empty?: (() => ReactNode) | undefined;\n children: ReactNode;\n}',
|
|
889
|
+
},
|
|
890
|
+
{
|
|
891
|
+
name: 'SessionAssistantSettlementEntry',
|
|
892
|
+
declaration: 'export interface SessionAssistantSettlementEntry {\n readonly type: \'event\';\n readonly event: SessionEvent<\'assistant/message\'> | SessionEvent<\'assistant/attempt\'>;\n}',
|
|
893
|
+
},
|
|
894
|
+
{
|
|
895
|
+
name: 'SessionBinding',
|
|
896
|
+
declaration: 'export interface SessionBinding {\n readonly sessionId: SessionId;\n readonly session: SessionFace;\n readonly eventSource: SessionEventSource;\n readonly ctx: AgentContext;\n}',
|
|
897
|
+
},
|
|
898
|
+
{
|
|
899
|
+
name: 'SessionEventChange',
|
|
900
|
+
declaration: 'export type SessionEventChange = {\n readonly kind: \'replace\';\n readonly entries: readonly SessionEventLikeEntry[];\n} | {\n readonly kind: \'prepend\';\n readonly entries: readonly SessionEventLikeEntry[];\n} | {\n readonly kind: \'append\';\n readonly entries: readonly SessionEventLikeEntry[];\n} | {\n readonly kind: \'settle-assistant\';\n readonly attemptId: LlmAttemptId;\n readonly entry?: SessionAssistantSettlementEntry;\n};',
|
|
901
|
+
},
|
|
902
|
+
{
|
|
903
|
+
name: 'SessionEventLikeEntry',
|
|
904
|
+
declaration: 'export type SessionEventLikeEntry = {\n readonly type: \'event\';\n readonly event: SessionEvent;\n} | {\n readonly type: \'transient\';\n readonly event: AssistantLiveChunkEvent;\n};',
|
|
905
|
+
},
|
|
906
|
+
{
|
|
907
|
+
name: 'SessionEventSource',
|
|
908
|
+
declaration: 'export type SessionEventSource = ObservableSnapshot<SessionEventWindow>;',
|
|
909
|
+
},
|
|
910
|
+
{
|
|
911
|
+
name: 'SessionEventWindow',
|
|
912
|
+
declaration: 'export interface SessionEventWindow {\n readonly entries: readonly SessionEventLikeEntry[];\n readonly hasMore: boolean;\n readonly revision: number;\n readonly change: SessionEventChange;\n}',
|
|
913
|
+
},
|
|
914
|
+
{
|
|
915
|
+
name: 'SessionFace',
|
|
916
|
+
declaration: 'export type SessionFace = ISession & ObservableSnapshot<SessionSnapshot>;',
|
|
917
|
+
},
|
|
918
|
+
{
|
|
919
|
+
name: 'SessionIdOf',
|
|
920
|
+
declaration: 'export type SessionIdOf = SessionStandardProps extends {\n sessionId: infer S;\n} ? S : string;',
|
|
921
|
+
},
|
|
922
|
+
{
|
|
923
|
+
name: 'SessionListPhase',
|
|
924
|
+
declaration: 'export type SessionListPhase = \'pending\' | \'ready\';',
|
|
925
|
+
},
|
|
926
|
+
{
|
|
927
|
+
name: 'SessionListState',
|
|
928
|
+
declaration: 'export interface SessionListState {\n ids: SessionId[];\n byId: Record<SessionId, SessionSummary>;\n phase: SessionListPhase;\n projectionsBySession: Readonly<Record<SessionId, SessionProjectionSnapshot>>;\n}',
|
|
929
|
+
},
|
|
930
|
+
{
|
|
931
|
+
name: 'SessionMaybeStandardProps',
|
|
932
|
+
declaration: 'export interface SessionMaybeStandardProps {\n}',
|
|
933
|
+
},
|
|
934
|
+
{
|
|
935
|
+
name: 'SessionProjectionSnapshot',
|
|
936
|
+
declaration: 'export interface SessionProjectionSnapshot {\n readonly values: Readonly<Partial<SessionProjectionViewValues>>;\n readonly state: \'idle\' | \'loading\' | \'ready\' | \'migration-required\' | \'error\';\n readonly error: RemoteFailure | null;\n}',
|
|
937
|
+
},
|
|
938
|
+
{
|
|
939
|
+
name: 'SessionProviderComponent',
|
|
940
|
+
declaration: 'export type SessionProviderComponent = (props: SessionAreaProps) => ReactNode;',
|
|
941
|
+
},
|
|
942
|
+
{
|
|
943
|
+
name: 'SessionReference',
|
|
944
|
+
declaration: 'export interface SessionReference extends Disposable {\n readonly sessionId: SessionId;\n readonly binding: SessionBinding;\n readonly ready: Promise<SessionBinding>;\n release(): void;\n}',
|
|
945
|
+
},
|
|
946
|
+
{
|
|
947
|
+
name: 'SessionReferenceSource',
|
|
948
|
+
declaration: 'export type SessionReferenceSource = Extract<keyof SessionReferenceSourceMap, string>;',
|
|
949
|
+
},
|
|
950
|
+
{
|
|
951
|
+
name: 'SessionReferenceSourceMap',
|
|
952
|
+
declaration: 'export interface SessionReferenceSourceMap {\n controllerOperation: unknown;\n gateway: unknown;\n}',
|
|
953
|
+
},
|
|
954
|
+
{
|
|
955
|
+
name: 'SessionRequestId',
|
|
956
|
+
declaration: 'export type SessionRequestId = Branded<\'session-request-id\'>;',
|
|
957
|
+
},
|
|
958
|
+
{
|
|
959
|
+
name: 'SessionRetainInfo',
|
|
960
|
+
declaration: 'export interface SessionRetainInfo {\n readonly referenceCount: number;\n readonly retainedBy: Readonly<Partial<Record<SessionReferenceSource, number>>>;\n}',
|
|
961
|
+
},
|
|
962
|
+
{
|
|
963
|
+
name: 'SessionRetainOptions',
|
|
964
|
+
declaration: 'export interface SessionRetainOptions {\n readonly source: SessionReferenceSource;\n readonly signal?: AbortSignal | undefined;\n}',
|
|
965
|
+
},
|
|
966
|
+
{
|
|
967
|
+
name: 'SessionSearchResultItem',
|
|
968
|
+
declaration: 'export interface SessionSearchResultItem {\n sessionId: SessionId;\n snippet: string;\n}',
|
|
969
|
+
},
|
|
970
|
+
{
|
|
971
|
+
name: 'SessionSnapshot',
|
|
972
|
+
declaration: 'export interface SessionSnapshot {\n readonly sessionId: SessionId;\n readonly pendingSubmissions: readonly PendingSubmission[];\n readonly running: boolean;\n readonly subagent: {\n readonly address: SubagentAddress;\n } | null;\n readonly removed: boolean;\n readonly openState: OpenState;\n readonly openError: RemoteFailure | null;\n readonly hasMore: boolean;\n readonly historyWasPartial: boolean;\n readonly loadingOlder: boolean;\n readonly historyLoadStatus: \'idle\' | \'loading\' | \'pendingConsumption\' | \'error\';\n readonly promptError: PromptError | null;\n readonly blank: boolean;\n readonly lastAgentError: string | null;\n readonly promptAttempted: boolean;\n readonly awaitingFirstTurn: boolean;\n}',
|
|
973
|
+
},
|
|
974
|
+
{
|
|
975
|
+
name: 'SessionStandardProps',
|
|
976
|
+
declaration: 'export interface SessionStandardProps {\n}',
|
|
977
|
+
},
|
|
978
|
+
{
|
|
979
|
+
name: 'SessionTarget',
|
|
980
|
+
declaration: 'export type SessionTarget = SessionId | SubagentAddress;',
|
|
981
|
+
},
|
|
982
|
+
{
|
|
983
|
+
name: 'SlotComponent',
|
|
984
|
+
declaration: 'export type SlotComponent<P> = (props: P) => ReactNode;',
|
|
985
|
+
},
|
|
986
|
+
{
|
|
987
|
+
name: 'SlotCore',
|
|
988
|
+
declaration: 'export class SlotCore {\n constructor();\n readonly registerFactory: RegisterFactory;\n factory(name: string): StoredFactory | undefined;\n factoryVersion(name: string): number;\n subscribeFactory(name: string, listener: () => void): () => void;\n isFactoryLive(definition: StoredFactory): boolean;\n register<K extends keyof SlotMap & string, const EntryKey extends EntryKeyOf<K> = EntryKeyOf<K>, const D extends ChildrenDecl = Record<never, never>, H extends StoreDecl | undefined = undefined, M = never, N extends (keyof LocaleNamespaceMap & string) | undefined = undefined, C extends SlotComponent<never> = SlotComponent<never>>(options: BaseOptions<K, EntryKey, D, H, M, N> & {\n inject?: undefined;\n }, component: C & SlotComponent<ComposedProps<K, NoInfer<EntryKey>, keyof NoInfer<D> & keyof SlotMap & string, HandleOf<NoInfer<H>>, object, NoInfer<M>, NoInfer<N>>> & RendersCheck<C, D>): () => void;\n register<K extends keyof SlotMap & string, I extends object, const EntryKey extends EntryKeyOf<K> = EntryKeyOf<K>, const D extends ChildrenDecl = Record<never, never>, H extends StoreDecl | undefined = undefined, M = never, N extends (keyof LocaleNamespaceMap & string) | undefined = undefined, C extends SlotComponent<never> = SlotComponent<never>>(options: BaseOptions<K, EntryKey, D, H, M, N> & {\n inject: (...args: InjectParams<K, H>) => I;\n }, component: C & SlotComponent<ComposedProps<K, NoInfer<EntryKey>, keyof NoInfer<D> & keyof SlotMap & string, HandleOf<NoInfer<H>>, I, NoInfer<M>, NoInfer<N>>> & RendersCheck<C, D>): () => void;\n isLive(entry: StoredEntry): boolean;\n entries(key: string): readonly StoredEntry[];\n entriesOfSlot(key: string): readonly StoredEntry[];\n spec<K extends keyof SlotMap & string>(key: K): SlotSpec<SlotMap[K]> | undefined;\n specDynamic(key: string): SlotSpec<SlotEntryDef> | undefined;\n snapshot(root?: string): LiveCompositionNode[];\n declarationEpoch(key: string): number;\n subscribe(key: string, fn: () => void): () => void;\n subscribeDeclaration(key: string, fn: () => void): () => void;\n getVersion(key: string): number;\n onMutate(fn: (key: string) => void): () => void;\n reportEntryError(key: string, entry: StoredEntry, error: unknown, info: {\n abdicate: boolean;\n }): void;\n reportFactoryError(name: string, registration: StoredEntry | StoredFactory, error: unknown): void;\n onEntryError(fn: (key: string, registration: StoredEntry | StoredFactory, error: unknown, info: {\n abdicated: boolean;\n }) => void): () => void;\n}',
|
|
989
|
+
},
|
|
990
|
+
{
|
|
991
|
+
name: 'SlotEntryDef',
|
|
992
|
+
declaration: 'export interface SlotEntryDef {\n kind: SlotKind;\n scope: SlotScope;\n inline?: true;\n owner?: object;\n keyProps?: Record<string, object>;\n hookContext?: unknown;\n inject?: object;\n}',
|
|
993
|
+
},
|
|
994
|
+
{
|
|
995
|
+
name: 'SlotFactoryMap',
|
|
996
|
+
declaration: 'export interface SlotFactoryMap {\n}',
|
|
997
|
+
},
|
|
998
|
+
{
|
|
999
|
+
name: 'SlotInjectFace',
|
|
1000
|
+
declaration: 'export type SlotInjectFace<I extends object> = I extends {\n hooks: infer HS extends object;\n} ? Omit<I, \'hooks\'> & PropsSlotHooks<HS> : I;',
|
|
1001
|
+
},
|
|
1002
|
+
{
|
|
1003
|
+
name: 'SlotInjectOf',
|
|
1004
|
+
declaration: 'export type SlotInjectOf<K extends keyof SlotMap & string> = SlotMap[K] extends {\n inject: infer Injected extends object;\n} ? Injected : object;',
|
|
1005
|
+
},
|
|
1006
|
+
{
|
|
1007
|
+
name: 'SlotKind',
|
|
1008
|
+
declaration: 'export type SlotKind = \'single\' | \'list\' | \'keyed\' | \'chain\' | \'hoc\';',
|
|
1009
|
+
},
|
|
1010
|
+
{
|
|
1011
|
+
name: 'SlotLabel',
|
|
1012
|
+
declaration: 'export type SlotLabel = string | (() => string);',
|
|
1013
|
+
},
|
|
1014
|
+
{
|
|
1015
|
+
name: 'SlotMap',
|
|
1016
|
+
declaration: 'export interface SlotMap {\n}',
|
|
1017
|
+
},
|
|
1018
|
+
{
|
|
1019
|
+
name: 'SlotScope',
|
|
1020
|
+
declaration: 'export type SlotScope = \'root\' | \'session-maybe\' | \'session\';',
|
|
1021
|
+
},
|
|
1022
|
+
{
|
|
1023
|
+
name: 'SlotScopeTargetMap',
|
|
1024
|
+
declaration: 'export interface SlotScopeTargetMap {\n}',
|
|
1025
|
+
},
|
|
1026
|
+
{
|
|
1027
|
+
name: 'SlotSpec',
|
|
1028
|
+
declaration: 'export type SlotSpec<E extends SlotEntryDef> = {\n kind: E[\'kind\'];\n scope: E[\'scope\'];\n inline?: true;\n} & (\'inject\' extends keyof E ? E extends {\n inject: infer Injected extends object;\n} ? {\n inject: Injected;\n} : {\n inject?: object;\n} : {\n inject?: never;\n});',
|
|
1029
|
+
},
|
|
1030
|
+
{
|
|
1031
|
+
name: 'SnapshotSelectorHook',
|
|
1032
|
+
declaration: 'export type SnapshotSelectorHook<T> = <S>(sel: (s: T) => S, eq?: (a: S, b: S) => boolean) => S;',
|
|
1033
|
+
},
|
|
1034
|
+
{
|
|
1035
|
+
name: 'StartSessionOptions',
|
|
1036
|
+
declaration: 'export interface StartSessionOptions extends DraftInitializationOptions {\n readonly agentPreset?: string;\n}',
|
|
1037
|
+
},
|
|
1038
|
+
{
|
|
1039
|
+
name: 'StoreDecl',
|
|
1040
|
+
declaration: 'export type StoreDecl = StoreHandle<any, any> | StoreFactory;',
|
|
1041
|
+
},
|
|
1042
|
+
{
|
|
1043
|
+
name: 'StoredEntry',
|
|
1044
|
+
declaration: 'export interface StoredEntry {\n component: unknown;\n options: {\n key?: string;\n id?: string;\n order?: number;\n label?: SlotLabel;\n priority?: number;\n };\n select?: ((owner: never) => unknown) | undefined;\n inject?: ((...args: never[]) => Record<string, unknown>) | undefined;\n children?: Readonly<Record<string, SlotSpec<SlotEntryDef>>> | undefined;\n store?: StoreDecl | undefined;\n locale?: string | undefined;\n registrant?: string | undefined;\n}',
|
|
1045
|
+
},
|
|
1046
|
+
{
|
|
1047
|
+
name: 'StoredFactory',
|
|
1048
|
+
declaration: 'export interface StoredFactory {\n readonly name: string;\n readonly component: unknown;\n readonly scope: SlotScope;\n readonly children?: Readonly<Record<string, SlotSpec<SlotEntryDef>>> | undefined;\n readonly store?: StoreDecl | undefined;\n readonly inject?: ((...args: never[]) => Record<string, unknown>) | undefined;\n readonly locale?: string | undefined;\n readonly slots?: Readonly<Record<string, {\n scope: SlotScope;\n }>> | undefined;\n readonly registrant?: string | undefined;\n}',
|
|
1049
|
+
},
|
|
1050
|
+
{
|
|
1051
|
+
name: 'StoreFactory',
|
|
1052
|
+
declaration: 'export type StoreFactory = () => StoreHandle<any, any>;',
|
|
1053
|
+
},
|
|
1054
|
+
{
|
|
1055
|
+
name: 'StoreHandle',
|
|
1056
|
+
declaration: 'export interface StoreHandle<T, A extends ActionsDecl<T>> {\n readonly spec: StoreSpec<T, A>;\n create(scopeKey?: string): StoreInstance<T, A>;\n}',
|
|
1057
|
+
},
|
|
1058
|
+
{
|
|
1059
|
+
name: 'StoreInstance',
|
|
1060
|
+
declaration: 'export interface StoreInstance<T, A extends ActionsDecl<T>> {\n readonly actions: BakedActions<T, A>;\n getSnapshot(): T;\n subscribe(fn: () => void): () => void;\n clearPersisted(): void;\n}',
|
|
1061
|
+
},
|
|
1062
|
+
{
|
|
1063
|
+
name: 'StoreSpec',
|
|
1064
|
+
declaration: 'export interface StoreSpec<T, A extends ActionsDecl<T>> {\n init: () => T;\n persist?: string;\n actions: A;\n}',
|
|
1065
|
+
},
|
|
1066
|
+
{
|
|
1067
|
+
name: 'SubmissionHandle',
|
|
1068
|
+
declaration: 'export interface SubmissionHandle {\n readonly requestId: SessionRequestId;\n abandon(): void;\n}',
|
|
1069
|
+
},
|
|
1070
|
+
{
|
|
1071
|
+
name: 'ThemeDefinition',
|
|
1072
|
+
declaration: 'export interface ThemeDefinition {\n id: string;\n colorScheme: \'light\' | \'dark\';\n tokens: ThemeTokens;\n icons?: IconReplacements | undefined;\n}',
|
|
1073
|
+
},
|
|
1074
|
+
{
|
|
1075
|
+
name: 'ThemePreference',
|
|
1076
|
+
declaration: 'export type ThemePreference = typeof THEME_PREFERENCES[number];',
|
|
1077
|
+
},
|
|
1078
|
+
{
|
|
1079
|
+
name: 'ThemeSnapshot',
|
|
1080
|
+
declaration: 'export interface ThemeSnapshot {\n preference: ThemePreference;\n fontSizes: FontSizes;\n fontFamilies: FontFamilies;\n active: ThemeDefinition;\n themes: readonly ThemeDefinition[];\n revision: number;\n}',
|
|
1081
|
+
},
|
|
1082
|
+
{
|
|
1083
|
+
name: 'ThemeTokenModes',
|
|
1084
|
+
declaration: 'export interface ThemeTokenModes {\n light: string;\n dark: string;\n}',
|
|
1085
|
+
},
|
|
1086
|
+
{
|
|
1087
|
+
name: 'ThemeTokenOverrides',
|
|
1088
|
+
declaration: 'export type ThemeTokenOverrides = Record<string, ThemeTokenModes>;',
|
|
1089
|
+
},
|
|
1090
|
+
{
|
|
1091
|
+
name: 'ThemeTokens',
|
|
1092
|
+
declaration: 'export type ThemeTokens = Record<string, string>;',
|
|
1093
|
+
},
|
|
1094
|
+
{
|
|
1095
|
+
name: 'TranslateNS',
|
|
1096
|
+
declaration: 'export type TranslateNS<N extends keyof LocaleNamespaceMap & string> = Translate<LocaleKeysOf<N>>;',
|
|
1097
|
+
},
|
|
1098
|
+
{
|
|
1099
|
+
name: 'UseFactorySlot',
|
|
1100
|
+
declaration: 'export type UseFactorySlot<F extends keyof SlotFactoryMap & string> = <N extends FactoryLocalNameOf<F>>(name: N, fallback: FactoryLocalComponent<F, N>) => SlotComponent<FactoryLocalInputPropsOf<F, N>>;',
|
|
1101
|
+
},
|
|
1102
|
+
{
|
|
1103
|
+
name: 'WorkspaceView',
|
|
1104
|
+
declaration: 'export interface WorkspaceView {\n readonly workspaceId: WorkspaceId;\n readonly path: string;\n readonly title: string;\n readonly sessionIds: readonly SessionId[];\n readonly createdAt: string;\n readonly updatedAt: string;\n}',
|
|
1105
|
+
},
|
|
1106
|
+
]
|
|
1107
|
+
|
|
1108
|
+
/** The inherited `ctx` API (cordis core + loader/hmr/timer), in curated order. */
|
|
1109
|
+
export const INHERITED_CTX_API: readonly InheritedApiEntry[] = [
|
|
1110
|
+
{ name: 'ctx.on / ctx.once', summary: 'Register an event listener (disposable).' },
|
|
1111
|
+
{ name: 'ctx.emit / ctx.parallel / ctx.serial / ctx.bail / ctx.waterfall', summary: 'Dispatch an event (sync / awaited / first-bail / short-circuit chain).' },
|
|
1112
|
+
{ name: 'ctx.plugin / ctx.inject', summary: 'Load a plugin / declare required services.' },
|
|
1113
|
+
{ name: 'ctx.effect', summary: 'Register a disposable side effect tied to the fiber.' },
|
|
1114
|
+
{ name: 'ctx.get / ctx.set / ctx.provide / ctx.accessor / ctx.mixin', summary: 'Low-level service-store access and binding.' },
|
|
1115
|
+
{ name: 'ctx.extend / ctx.isolate / ctx.intercept', summary: 'Derive a child context (scoped services / isolation / interception).' },
|
|
1116
|
+
{ name: 'ctx.root / ctx.fiber / ctx.registry / ctx.reflect / ctx.events / ctx.logger', summary: 'Ambient handles onto the running context graph.' },
|
|
1117
|
+
{ name: 'ctx.timer (+ interval / timeout / throttle / debounce)', summary: 'Disposable timer helpers. The `timer` key is provided at runtime; the four supported helpers are mixed onto ctx directly (declared via Pick).' },
|
|
1118
|
+
{ name: 'ctx.loader', summary: 'The config Loader that booted the app (present under the loader).' },
|
|
1119
|
+
]
|
|
1120
|
+
|
|
1121
|
+
function referencedTypeClosure(seeds: readonly string[]): TypeApiEntry[] {
|
|
1122
|
+
const included = new Set<string>()
|
|
1123
|
+
let frontier = [...seeds]
|
|
1124
|
+
while (frontier.length > 0) {
|
|
1125
|
+
const next: string[] = []
|
|
1126
|
+
for (const entry of TYPE_API) {
|
|
1127
|
+
if (included.has(entry.name)) continue
|
|
1128
|
+
const pattern = new RegExp(`\\b${entry.name}\\b`)
|
|
1129
|
+
if (!frontier.some(text => pattern.test(text))) continue
|
|
1130
|
+
included.add(entry.name)
|
|
1131
|
+
next.push(entry.declaration)
|
|
1132
|
+
}
|
|
1133
|
+
frontier = next
|
|
1134
|
+
}
|
|
1135
|
+
return TYPE_API.filter(entry => included.has(entry.name))
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
function contextProperty(key: string): string {
|
|
1139
|
+
return /^[A-Za-z_$][\w$]*$/.test(key) ? `ctx.${key}` : `ctx[${JSON.stringify(key)}]`
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
/**
|
|
1143
|
+
* Project the Service Catalog as a compact directory or one exact coding contract.
|
|
1144
|
+
* @param key - exact Service key; omit it to list all Services and method signatures.
|
|
1145
|
+
* @param services - platform-specific visible Service entries.
|
|
1146
|
+
* @returns compact navigation data or one detailed Service with its referenced type closure.
|
|
1147
|
+
*/
|
|
1148
|
+
export function queryServiceApi(key?: string, services: readonly ServiceApiEntry[] = SERVICE_API): object {
|
|
1149
|
+
if (key === undefined) {
|
|
1150
|
+
return {
|
|
1151
|
+
mode: 'catalog',
|
|
1152
|
+
services: services.map(service => ({
|
|
1153
|
+
key: service.key,
|
|
1154
|
+
description: service.summary,
|
|
1155
|
+
methods: service.methods.map(method => ({ signature: method.signature })),
|
|
1156
|
+
})),
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
const service = services.find(candidate => candidate.key === key)
|
|
1160
|
+
if (service === undefined) throw new Error(`no catalogued Service named "${key}"`)
|
|
1161
|
+
return {
|
|
1162
|
+
mode: 'service',
|
|
1163
|
+
service: {
|
|
1164
|
+
key: service.key,
|
|
1165
|
+
description: service.description,
|
|
1166
|
+
access: {
|
|
1167
|
+
optional: { expression: `ctx.get(${JSON.stringify(service.key)})`, requiresUndefinedCheck: true },
|
|
1168
|
+
hardDependency: { inject: [service.key], expression: contextProperty(service.key) },
|
|
1169
|
+
},
|
|
1170
|
+
methods: service.methods,
|
|
1171
|
+
},
|
|
1172
|
+
referencedTypes: referencedTypeClosure(service.methods.map(method => method.signature)),
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
/**
|
|
1177
|
+
* Project the Event Catalog as a compact directory or one exact listener contract.
|
|
1178
|
+
* @param name - exact Event name; omit it to list all Events and listener signatures.
|
|
1179
|
+
* @param events - platform-specific visible Event entries.
|
|
1180
|
+
* @returns compact navigation data or one detailed Event with its referenced type closure.
|
|
1181
|
+
*/
|
|
1182
|
+
export function queryEventApi(name?: string, events: readonly EventApiEntry[] = EVENT_API): object {
|
|
1183
|
+
if (name === undefined) {
|
|
1184
|
+
return {
|
|
1185
|
+
mode: 'catalog',
|
|
1186
|
+
events: events.map(event => ({
|
|
1187
|
+
name: event.name,
|
|
1188
|
+
description: event.summary,
|
|
1189
|
+
mode: event.mode,
|
|
1190
|
+
signature: event.signature,
|
|
1191
|
+
})),
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
const event = events.find(candidate => candidate.name === name)
|
|
1195
|
+
if (event === undefined) throw new Error(`no catalogued Event named "${name}"`)
|
|
1196
|
+
return {
|
|
1197
|
+
mode: 'event',
|
|
1198
|
+
event: {
|
|
1199
|
+
name: event.name,
|
|
1200
|
+
description: event.description,
|
|
1201
|
+
mode: event.mode,
|
|
1202
|
+
signature: event.signature,
|
|
1203
|
+
parameters: event.parameters,
|
|
1204
|
+
},
|
|
1205
|
+
referencedTypes: referencedTypeClosure([event.signature]),
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
/* jscpd:ignore-end */
|