@excitedjs/dreamux-types 0.11.0-beta.264 → 0.11.0-beta.271

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/README.md CHANGED
@@ -13,7 +13,8 @@ shared structural types.
13
13
  - **Declarations only.** The package emits `.d.ts` files (`emitDeclarationOnly`)
14
14
  and publishes a `types`-only `exports` map — there is no runtime JS contract
15
15
  surface to import as a value.
16
- - **No runtime dependencies.** `package.json` declares only dev tooling.
16
+ - **One runtime dependency, `tapable`, by type only.** The plugin hook contract
17
+ is tapable's hook types; beyond it `package.json` declares only dev tooling.
17
18
  - **No host-private types.** Provider create contexts here are neutral; Dreamux
18
19
  core adapts its private objects (dispatcher rows, stores, identity records)
19
20
  into these public shapes rather than exposing them.
@@ -34,6 +35,9 @@ shared structural types.
34
35
  collaboration operations, and dispatcher-scoped read-only core event DTOs.
35
36
  Channel delivery receipts are status-only and the core event surface carries
36
37
  no service Turn submitted/settled events;
38
+ - plugin contracts: `DreamuxPlugin`, its `ContributeHost` / `ServerHost`, the
39
+ hooked `Dispatcher` / `Team` faces, `LaunchDraft`, and the
40
+ `DreamuxPluginApis` map a plugin augments to type its published `api`;
37
41
  - a minimal public logger type (`DreamuxLogger`).
38
42
 
39
43
  It does **not** export runtime implementations, default loggers, loader logic,
@@ -83,6 +87,14 @@ A provider implements the full contract against this package only — see
83
87
  > (issue #209 slice 3). The public target published here is already stable for
84
88
  > external and built-in runtime/channel packages to author against.
85
89
 
90
+ ## Plugin loading contract
91
+
92
+ A plugin factory returns its `DreamuxPlugin` synchronously; `config.read`
93
+ synchronously validates the plugin's config. Returning a thenable fails loading
94
+ with the ref or plugin name and phase. Loaded plugin names must be unique
95
+ ignoring ASCII case, so `Foo` and `foo` cannot coexist. A single mixed-case
96
+ name keeps its original API key and `state/plugins/<name>` spelling.
97
+
86
98
  ## Build / test
87
99
 
88
100
  Built and tested through the monorepo (rush) path — the only supported install
@@ -0,0 +1,192 @@
1
+ /**
2
+ * The Activity domain (declaration-only): what a runtime reports about what an
3
+ * agent did, in two distinct contracts.
4
+ *
5
+ * `RuntimeActivity` (with its `NativeActivity`/`RuntimeToolAction` support
6
+ * types) is the live, per-provider-detailed stream a runtime pushes through
7
+ * {@link AgentRuntimeActivitySink} while a turn is running. `AgentActivityRecord`
8
+ * (with `AgentActivityQuery`/`AgentActivityPage`/`AgentActivityReadContext`/
9
+ * `AgentActivityError`) is the neutral, minimal contract
10
+ * {@link AgentRuntimeProvider.readRecentActivity} replays from a cold
11
+ * session/rollout file. The two are deliberately not unified: a provider folds
12
+ * many submissions into one native turn, so live activity carries per-call
13
+ * detail (arguments, results, native ids) a cold replay never reconstructs,
14
+ * while a cold read exposes only the minimal shape every provider can honestly
15
+ * replay after the live runtime is gone. This module holds both because they
16
+ * are the same domain — what an agent did — read through the runtime's two
17
+ * different lifecycles, separate from `agent-runtime.ts`'s concern of
18
+ * launching and running a native session at all.
19
+ */
20
+ import type { JsonValue } from './json.js';
21
+ import type { DreamuxLogger } from './logger.js';
22
+ /**
23
+ * What a tool invocation does, classified by the runtime that owns the tool
24
+ * vocabulary. `null` means the runtime has no such classification for this call.
25
+ */
26
+ export type RuntimeToolAction = 'read' | 'list_files' | 'search' | 'edit' | 'run';
27
+ /** A live fact identified by the native object it reports. */
28
+ interface NativeActivity<K extends string> {
29
+ readonly kind: K;
30
+ readonly occurredAt: number;
31
+ /**
32
+ * The provider's own id, taken whole without a prefix, suffix, or counter.
33
+ * It identifies the native object, not a unique activity: a tool's start
34
+ * and result share its call id; usage and interruption share a turn id.
35
+ * A consumer derives row identity from kind (and tool status) plus this id.
36
+ */
37
+ readonly id: string;
38
+ }
39
+ /**
40
+ * One thing an agent's runtime did, in the runtime's own vocabulary.
41
+ *
42
+ * Keyed on the agent and nothing else. A provider folds any number of Dreamux
43
+ * submissions into one native turn, so an activity cannot honestly name the
44
+ * submission that caused it — and inventing one would make a display pick an
45
+ * arbitrary member. What a live surface needs is this agent's stream in order,
46
+ * which is what this is.
47
+ *
48
+ * A Channel receives this same type with every text and JSON payload member
49
+ * already redacted by Core. Core bounds nothing: each surface applies its
50
+ * own display limits where it sends.
51
+ */
52
+ export type RuntimeActivity = (NativeActivity<'assistant.message'> & {
53
+ readonly text: string;
54
+ })
55
+ /**
56
+ * The runtime compacted its context. Carries no summary or compaction
57
+ * metadata. Live-only: the cold activity reader never produces this.
58
+ */
59
+ | NativeActivity<'context.compacted'>
60
+ /**
61
+ * A display marker, not a terminal: a native turn stopped at an interrupt
62
+ * request. Reported from the native interrupted terminal, before its
63
+ * `token.usage` (when available) and paired `turn.ended` with status
64
+ * `interrupted`. Teardown reports `turn.ended` `interrupted` without this
65
+ * marker. Live-only: the cold activity reader never produces this.
66
+ */
67
+ | NativeActivity<'turn.interrupted'> | (NativeActivity<'tool.call'> & {
68
+ readonly toolName: string;
69
+ readonly action: RuntimeToolAction | null;
70
+ /**
71
+ * The call as the runtime's own UI labels it, in one line: a command's
72
+ * stated purpose, the path a file tool touches, the pattern a search
73
+ * runs, the task a sub-agent was given. `null` when the runtime has no
74
+ * label of its own for the tool, so a display falls back to the name.
75
+ */
76
+ readonly summary: string | null;
77
+ /**
78
+ * The call as a person would write it: the shell command line, the
79
+ * task text handed to a sub-agent, the script a runner executes.
80
+ * `arguments` is the tool's full structured input; this is the one
81
+ * member of it that has a notation of its own, so a display can show
82
+ * it in that notation instead of as JSON. `null` when there is none.
83
+ */
84
+ readonly invocation: string | null;
85
+ /**
86
+ * What the call is about, one entry per item, as the runtime reported
87
+ * it in structured members of the call: the path a file tool reads or
88
+ * writes, the paths of a patch, the files a parsed shell command read.
89
+ * Not limited to files: a runtime lists whatever discrete things its
90
+ * protocol names for the call. Empty when it names none; never
91
+ * recovered from a label or an output by parsing.
92
+ */
93
+ readonly items: readonly string[];
94
+ readonly status: 'started' | 'completed' | 'failed';
95
+ readonly arguments: JsonValue | null;
96
+ readonly result: JsonValue | null;
97
+ readonly error: string | null;
98
+ })
99
+ /**
100
+ * The native runtime's cumulative token counters for its live session,
101
+ * at the turn they were observed for. Runners that fold several native
102
+ * turns into one provider turn emit once on the native terminal with the
103
+ * latest snapshot, so one activity stands for one turn.
104
+ *
105
+ * Values are session-total as the runtime owns them, never turn deltas:
106
+ * a consumer derives a turn's consumption by differencing against the
107
+ * previous snapshot for this agent. The runtime keeps no history and
108
+ * performs no subtraction. Live-only: the cold activity reader never
109
+ * replays this, and a dropped snapshot simply widens the next delta.
110
+ */
111
+ | (NativeActivity<'token.usage'> & {
112
+ readonly inputTokens: number;
113
+ readonly outputTokens: number;
114
+ /** The last response's context footprint, and the native window when the runtime reports one; `null` when the runtime gives no context signal. */
115
+ readonly context: {
116
+ readonly usedTokens: number;
117
+ readonly windowTokens: number | null;
118
+ } | null;
119
+ }) | {
120
+ /**
121
+ * The runtime stopped producing for the turn it was running, whatever
122
+ * that turn contained. `completed` is the runtime's own successful
123
+ * terminal; `failed` is a proven terminal error; `interrupted` is a
124
+ * native turn that ended without either, such as a stop or a protocol
125
+ * loss. `reason` carries the runtime's own explanation when it holds
126
+ * one, so a display can say why rather than only that.
127
+ * A native interrupt also reports `turn.interrupted` before this end.
128
+ *
129
+ * Core also reports this for an input no runtime accepted, because that
130
+ * input opened a display that nothing else closes.
131
+ *
132
+ * A provider reports this from the native terminal it observed, and
133
+ * again, without asking whether a turn was open, when it tears down a
134
+ * live native session. It keeps no display state to answer that
135
+ * question, so a consumer may receive an end with nothing open and
136
+ * ignores it: a native end closes an open display and never opens one.
137
+ */
138
+ readonly kind: 'turn.ended';
139
+ readonly occurredAt: number;
140
+ readonly status: 'completed' | 'failed' | 'interrupted';
141
+ readonly reason: string | null;
142
+ };
143
+ /**
144
+ * A bounded request for the recent tail of one session's activity. Cursors are
145
+ * opaque and provider-owned; pagination walks a stable recent tail without
146
+ * skipping or duplicating records as native history grows.
147
+ */
148
+ export interface AgentActivityQuery {
149
+ readonly sessionId: string;
150
+ readonly cursor?: string;
151
+ readonly limit?: number;
152
+ /** Tools are included by default and can only be hidden as a group. */
153
+ readonly includeTools?: boolean;
154
+ }
155
+ export interface AgentActivityReadContext<TConfig> {
156
+ readonly config: TConfig;
157
+ readonly cwd: string;
158
+ readonly logger: DreamuxLogger;
159
+ }
160
+ /**
161
+ * One neutral activity fact. Tool arguments, tool results, provider-native
162
+ * lines, Core status, admission, and settlement never appear here.
163
+ */
164
+ export type AgentActivityRecord = {
165
+ readonly kind: 'assistant_message';
166
+ readonly text: string;
167
+ readonly occurredAt?: string;
168
+ } | {
169
+ readonly kind: 'tool';
170
+ readonly name: string;
171
+ readonly status: 'started' | 'completed' | 'failed';
172
+ readonly occurredAt?: string;
173
+ };
174
+ /** One chronological page of recent Activity Records. */
175
+ export interface AgentActivityPage {
176
+ readonly records: readonly AgentActivityRecord[];
177
+ readonly nextCursor?: string;
178
+ /** Set by the provider when its own native read bounds truncated the page. */
179
+ readonly truncated: boolean;
180
+ }
181
+ /**
182
+ * Structural shape of the `Error` a provider rejects an Activity read with.
183
+ * Reasons describe neutral states only: never a filesystem path, native history
184
+ * layout, or scan mode. Callers branch on `error.name` rather than
185
+ * `instanceof`, keeping this package declaration-only.
186
+ */
187
+ export interface AgentActivityError extends Error {
188
+ name: 'AgentActivityError';
189
+ reason: 'session_unavailable' | 'cursor_invalid' | 'activity_corrupt' | 'provider_failure';
190
+ }
191
+ export {};
192
+ //# sourceMappingURL=activity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activity.d.ts","sourceRoot":"","sources":["../src/activity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAC3B,MAAM,GAAG,YAAY,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC;AAEpD,8DAA8D;AAC9D,UAAU,cAAc,C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AC;AAEN,yDAAyD;AACzD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,OAAO,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACjD,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,8EAA8E;IAC9E,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;GAKG;AACH,MAAM,WAAW,kBAAmB,SAAQ,KAAK;IAC/C,IAAI,EAAE,oBAAoB,CAAC;IAC3B,MAAM,EACF,qBAAqB,GACrB,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,CAAC;CACxB"}
@@ -15,7 +15,14 @@
15
15
  * mandatory provider behavior rather than negotiated capability bits. Live
16
16
  * activity emission stays optional because its absence changes only
17
17
  * presentation.
18
+ *
19
+ * The live and cold Activity record shapes themselves (`RuntimeActivity` and
20
+ * `AgentActivityRecord`, with their supporting types) live in `activity.js`:
21
+ * that module is the Activity domain read through both of a runtime's
22
+ * lifecycles, while this module stays about launching and running the session
23
+ * that produces them.
18
24
  */
25
+ import type { AgentActivityPage, AgentActivityQuery, AgentActivityReadContext, RuntimeActivity } from './activity.js';
19
26
  import type { DreamuxLogger } from './logger.js';
20
27
  import type { JsonSchema, JsonValue } from './json.js';
21
28
  import type { DreamuxEnvironment, ProviderBinCheck, ProviderDiagnosticRunner, ProviderDiagnosticScope, ProviderDiagnosticResult, ProviderFactory, ProviderOnboard } from './provider.js';
@@ -139,11 +146,6 @@ export interface AgentRuntimeStateSink {
139
146
  export interface AgentRuntimeStateLeaseRevokedError extends Error {
140
147
  name: 'AgentRuntimeStateLeaseRevokedError';
141
148
  }
142
- /**
143
- * What a tool invocation does, classified by the runtime that owns the tool
144
- * vocabulary. `null` means the runtime has no such classification for this call.
145
- */
146
- export type RuntimeToolAction = 'read' | 'list_files' | 'search' | 'edit' | 'run';
147
149
  /** One accepted provider submission. Its identity never implies folding. */
148
150
  export interface RuntimeSubmission {
149
151
  readonly settled: Promise<RuntimeSubmissionSettlement>;
@@ -165,122 +167,6 @@ export type RuntimeSubmissionSettlement = {
165
167
  } | {
166
168
  readonly kind: 'stopped';
167
169
  };
168
- /** A live fact identified by the native object it reports. */
169
- interface NativeActivity<K extends string> {
170
- readonly kind: K;
171
- readonly occurredAt: number;
172
- /**
173
- * The provider's own id, taken whole without a prefix, suffix, or counter.
174
- * It identifies the native object, not a unique activity: a tool's start
175
- * and result share its call id; usage and interruption share a turn id.
176
- * A consumer derives row identity from kind (and tool status) plus this id.
177
- */
178
- readonly id: string;
179
- }
180
- /**
181
- * One thing an agent's runtime did, in the runtime's own vocabulary.
182
- *
183
- * Keyed on the agent and nothing else. A provider folds any number of Dreamux
184
- * submissions into one native turn, so an activity cannot honestly name the
185
- * submission that caused it — and inventing one would make a display pick an
186
- * arbitrary member. What a live surface needs is this agent's stream in order,
187
- * which is what this is.
188
- *
189
- * A Channel receives this same type with every text and JSON payload member
190
- * already redacted by Core. Core bounds nothing: each surface applies its
191
- * own display limits where it sends.
192
- */
193
- export type RuntimeActivity = NativeActivity<'assistant.message'> & {
194
- readonly text: string;
195
- }
196
- /**
197
- * The runtime compacted its context. Carries no summary or compaction
198
- * metadata. Live-only: the cold activity reader never produces this.
199
- */
200
- | NativeActivity<'context.compacted'>
201
- /**
202
- * A display marker, not a terminal: a native turn stopped at an interrupt
203
- * request. Reported from the native interrupted terminal, before its
204
- * `token.usage` (when available) and paired `turn.ended` with status
205
- * `interrupted`. Teardown reports `turn.ended` `interrupted` without this
206
- * marker. Live-only: the cold activity reader never produces this.
207
- */
208
- | NativeActivity<'turn.interrupted'> | NativeActivity<'tool.call'> & {
209
- readonly toolName: string;
210
- readonly action: RuntimeToolAction | null;
211
- /**
212
- * The call as the runtime's own UI labels it, in one line: a command's
213
- * stated purpose, the path a file tool touches, the pattern a search
214
- * runs, the task a sub-agent was given. `null` when the runtime has no
215
- * label of its own for the tool, so a display falls back to the name.
216
- */
217
- readonly summary: string | null;
218
- /**
219
- * The call as a person would write it: the shell command line, the
220
- * task text handed to a sub-agent, the script a runner executes.
221
- * `arguments` is the tool's full structured input; this is the one
222
- * member of it that has a notation of its own, so a display can show
223
- * it in that notation instead of as JSON. `null` when there is none.
224
- */
225
- readonly invocation: string | null;
226
- /**
227
- * What the call is about, one entry per item, as the runtime reported
228
- * it in structured members of the call: the path a file tool reads or
229
- * writes, the paths of a patch, the files a parsed shell command read.
230
- * Not limited to files: a runtime lists whatever discrete things its
231
- * protocol names for the call. Empty when it names none; never
232
- * recovered from a label or an output by parsing.
233
- */
234
- readonly items: readonly string[];
235
- readonly status: 'started' | 'completed' | 'failed';
236
- readonly arguments: JsonValue | null;
237
- readonly result: JsonValue | null;
238
- readonly error: string | null;
239
- }
240
- /**
241
- * The native runtime's cumulative token counters for its live session,
242
- * at the turn they were observed for. Runners that fold several native
243
- * turns into one provider turn emit once on the native terminal with the
244
- * latest snapshot, so one activity stands for one turn.
245
- *
246
- * Values are session-total as the runtime owns them, never turn deltas:
247
- * a consumer derives a turn's consumption by differencing against the
248
- * previous snapshot for this agent. The runtime keeps no history and
249
- * performs no subtraction. Live-only: the cold activity reader never
250
- * replays this, and a dropped snapshot simply widens the next delta.
251
- */
252
- | NativeActivity<'token.usage'> & {
253
- readonly inputTokens: number;
254
- readonly outputTokens: number;
255
- /** The last response's context footprint, and the native window when the runtime reports one; `null` when the runtime gives no context signal. */
256
- readonly context: {
257
- readonly usedTokens: number;
258
- readonly windowTokens: number | null;
259
- } | null;
260
- } | {
261
- /**
262
- * The runtime stopped producing for the turn it was running, whatever
263
- * that turn contained. `completed` is the runtime's own successful
264
- * terminal; `failed` is a proven terminal error; `interrupted` is a
265
- * native turn that ended without either, such as a stop or a protocol
266
- * loss. `reason` carries the runtime's own explanation when it holds
267
- * one, so a display can say why rather than only that.
268
- * A native interrupt also reports `turn.interrupted` before this end.
269
- *
270
- * Core also reports this for an input no runtime accepted, because that
271
- * input opened a display that nothing else closes.
272
- *
273
- * A provider reports this from the native terminal it observed, and
274
- * again, without asking whether a turn was open, when it tears down a
275
- * live native session. It keeps no display state to answer that
276
- * question, so a consumer may receive an end with nothing open and
277
- * ignores it: a native end closes an open display and never opens one.
278
- */
279
- readonly kind: 'turn.ended';
280
- readonly occurredAt: number;
281
- readonly status: 'completed' | 'failed' | 'interrupted';
282
- readonly reason: string | null;
283
- };
284
170
  /**
285
171
  * Optional, synchronous, non-backpressuring sink for live native activity. It
286
172
  * is transient input to the Core conversation projection, not a progress view:
@@ -392,21 +278,12 @@ export interface AgentRuntimeCreateContext<TConfig> {
392
278
  * valid JSON conforming to the schema; the caller parses it.
393
279
  */
394
280
  readonly outputSchema?: JsonSchema;
395
- /**
396
- * Neutral process-env injection seam. Core merges these entries into the
397
- * runtime's spawn environment AFTER `process.env` and BEFORE the provider's
398
- * own `config.extra_env`, i.e. spawn env =
399
- * `{ ...process.env, ...injectEnv, ...config.extra_env }`. Core owns what (if
400
- * anything) it injects; `config.extra_env` is the provider's own config and is
401
- * NOT routed through here.
402
- */
403
- readonly injectEnv?: Readonly<Record<string, string>>;
404
281
  readonly paths: AgentRuntimePathContext;
405
282
  /** Leased, push-only state sink for this runtime generation. */
406
283
  readonly state: AgentRuntimeStateSink;
407
284
  /** Leased, push-only sink for this runtime generation's live activity. */
408
- readonly activity?: AgentRuntimeActivitySink;
409
- readonly logger?: AgentRuntimeLogger;
285
+ readonly activity: AgentRuntimeActivitySink;
286
+ readonly logger: AgentRuntimeLogger;
410
287
  }
411
288
  /** What `start` restored. Core consumes it before admitting the first submission. */
412
289
  export interface AgentRuntimeStartOutcome {
@@ -441,55 +318,6 @@ export interface AgentRuntime {
441
318
  */
442
319
  stop(): Promise<void>;
443
320
  }
444
- /**
445
- * A bounded request for the recent tail of one session's activity. Cursors are
446
- * opaque and provider-owned; pagination walks a stable recent tail without
447
- * skipping or duplicating records as native history grows.
448
- */
449
- export interface AgentActivityQuery {
450
- readonly sessionId: string;
451
- readonly cursor?: string;
452
- readonly limit?: number;
453
- /** Tools are included by default and can only be hidden as a group. */
454
- readonly includeTools?: boolean;
455
- }
456
- export interface AgentActivityReadContext<TConfig> {
457
- readonly config: TConfig;
458
- readonly cwd: string;
459
- readonly injectEnv?: Readonly<Record<string, string>>;
460
- readonly logger?: AgentRuntimeLogger;
461
- }
462
- /**
463
- * One neutral activity fact. Tool arguments, tool results, provider-native
464
- * lines, Core status, admission, and settlement never appear here.
465
- */
466
- export type AgentActivityRecord = {
467
- readonly kind: 'assistant_message';
468
- readonly text: string;
469
- readonly occurredAt?: string;
470
- } | {
471
- readonly kind: 'tool';
472
- readonly name: string;
473
- readonly status: 'started' | 'completed' | 'failed';
474
- readonly occurredAt?: string;
475
- };
476
- /** One chronological page of recent Activity Records. */
477
- export interface AgentActivityPage {
478
- readonly records: readonly AgentActivityRecord[];
479
- readonly nextCursor?: string;
480
- /** Set by the provider when its own native read bounds truncated the page. */
481
- readonly truncated: boolean;
482
- }
483
- /**
484
- * Structural shape of the `Error` a provider rejects an Activity read with.
485
- * Reasons describe neutral states only: never a filesystem path, native history
486
- * layout, or scan mode. Callers branch on `error.name` rather than
487
- * `instanceof`, keeping this package declaration-only.
488
- */
489
- export interface AgentActivityError extends Error {
490
- name: 'AgentActivityError';
491
- reason: 'session_unavailable' | 'cursor_invalid' | 'activity_corrupt' | 'provider_failure';
492
- }
493
321
  export interface AgentRuntimeProviderConfigReadContext {
494
322
  providerRef: string;
495
323
  /**
@@ -502,7 +330,11 @@ export interface AgentRuntimeProviderConfigReadContext {
502
330
  }
503
331
  /**
504
332
  * Optional provider-owned config parsing. A parse/validation failure must throw
505
- * (the host fails loud), never return a partially-valid config.
333
+ * (the host fails loud), never return a partially-valid config. Throw the
334
+ * `RuleViolation` from `@excitedjs/dreamux-utils` for a value this reader
335
+ * checked and refused, so a host request that carried that value (an online
336
+ * config replace) reports it as the caller's mistake; any other throw is
337
+ * reported as an internal failure.
506
338
  */
507
339
  export interface AgentRuntimeConfigCapability<TConfig> {
508
340
  read(rawConfig: Record<string, unknown>, context: AgentRuntimeProviderConfigReadContext): TConfig | Promise<TConfig>;
@@ -532,10 +364,10 @@ export interface AgentRuntimeDiagnosticContext<TConfig = unknown> {
532
364
  * The same neutral path context the create context carries, supplied by
533
365
  * doctor so a provider diagnostic can pre-check placement-sensitive paths
534
366
  * (e.g. validate that a runtime socket would fit the platform budget via
535
- * {@link AgentRuntimePathContext.runtimeSocketDirs}). Optional: a provider
536
- * with no path-dependent checks ignores it.
367
+ * {@link AgentRuntimePathContext.runtimeSocketDirs}). Always supplied by the
368
+ * host; a provider with no path-dependent checks simply never reads it.
537
369
  */
538
- paths?: AgentRuntimePathContext;
370
+ paths: AgentRuntimePathContext;
539
371
  }
540
372
  /**
541
373
  * Optional provider-owned diagnostics: the provider DECLARES the bin checks
@@ -550,7 +382,10 @@ export interface AgentRuntimeDiagnosticCapability<TConfig> {
550
382
  /**
551
383
  * The Agent Runtime provider facade: selection, neutral recent Activity reads,
552
384
  * and runtime creation, plus operational capabilities composed as optional
553
- * objects rather than fake methods.
385
+ * members. A capability with more than one operation is an optional object
386
+ * (`config`, `onboard`, `diagnostic`) rather than a set of fake always-present
387
+ * methods; a capability that is a single pure function (`operatorStateRoot`)
388
+ * is declared directly as an optional method, with no object wrapper to add.
554
389
  *
555
390
  * Registration identity is absent by construction — Core owns the descriptor in
556
391
  * its {@link RegisteredProvider} wrapper, so this interface has no `ref` or
@@ -566,14 +401,23 @@ export interface AgentRuntimeProvider<TConfig> {
566
401
  * against an actively growing session — producing useful records before any
567
402
  * completion marker — and against the same session after the live runtime has
568
403
  * closed. The provider enforces its own native read bounds and sets
569
- * {@link AgentActivityPage.truncated}; Core independently validates record
570
- * count, text size, page size, cursor size, and public errors.
404
+ * {@link AgentActivityPage.truncated}; Core checks page and record shape,
405
+ * record count, and recognized public errors. Text, page, and cursor size
406
+ * bounds belong to the provider.
571
407
  */
572
408
  readRecentActivity(query: AgentActivityQuery, context: AgentActivityReadContext<TConfig>): Promise<AgentActivityPage>;
573
409
  createRuntime(context: AgentRuntimeCreateContext<TConfig>): Promise<AgentRuntime>;
574
410
  readonly config?: AgentRuntimeConfigCapability<TConfig>;
575
411
  readonly onboard?: AgentRuntimeOnboardCapability;
576
412
  readonly diagnostic?: AgentRuntimeDiagnosticCapability<TConfig>;
413
+ /**
414
+ * The provider's own global state directory (e.g. `~/.codex`), with no
415
+ * per-agent `extra_env` override applied. Host-wide operations that are not
416
+ * scoped to any one agent (uninstall's directory-safety guard) call this
417
+ * with the operator's ambient env to learn which directories this provider
418
+ * owns, instead of the host hard-coding provider-specific path literals.
419
+ */
420
+ operatorStateRoot?(env: DreamuxEnvironment): string;
577
421
  }
578
422
  /**
579
423
  * The default (or `npm:pkg#export`-selected) factory export an Agent Runtime
@@ -1 +1 @@
1
- {"version":3,"file":"agent-runtime.d.ts","sourceRoot":"","sources":["../src/agent-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAChB,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,EACxB,eAAe,EACf,eAAe,EAChB,MAAM,eAAe,CAAC;AAEvB,mEAAmE;AACnE,MAAM,MAAM,kBAAkB,GAAG,aAAa,CAAC;AAE/C;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACjD;AAED;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC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AAC"}
package/dist/channel.d.ts CHANGED
@@ -216,7 +216,7 @@ export type ChannelMcpToolOutcome = {
216
216
  */
217
217
  export interface ChannelInstance {
218
218
  readonly session: ChannelSession;
219
- readonly mcp?: ChannelSessionMcpCapability;
219
+ readonly mcp?: ChannelSessionMcpCapability | undefined;
220
220
  }
221
221
  export interface ChannelConfigContext {
222
222
  dispatcher_id: string;
@@ -228,14 +228,18 @@ export interface ChannelSessionCreateContext<TConfig> {
228
228
  channel_id: string;
229
229
  provider: string;
230
230
  config: TConfig;
231
- logger?: DreamuxLogger;
231
+ logger: DreamuxLogger;
232
232
  /** The per-dispatcher root the Channel owns its durable state under. */
233
- state_root?: string;
234
- cache_root?: string;
233
+ state_root: string;
234
+ cache_root: string;
235
235
  }
236
236
  /**
237
237
  * Optional Channel-owned config parsing. A parse/validation failure must throw
238
- * (the host fails loud), never return a partially-valid config.
238
+ * (the host fails loud), never return a partially-valid config. Throw the
239
+ * `RuleViolation` from `@excitedjs/dreamux-utils` for a value this reader
240
+ * checked and refused, so a host request that carried that value (an online
241
+ * config replace) reports it as the caller's mistake; any other throw is
242
+ * reported as an internal failure.
239
243
  */
240
244
  export interface ChannelConfigCapability<TConfig> {
241
245
  read(raw: unknown, context: ChannelConfigContext): TConfig | Promise<TConfig>;
@@ -1 +1 @@
1
- {"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../src/channel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAChB,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,EACxB,eAAe,EACf,eAAe,EAChB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE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CAAC,CAAC;IACnD,QAAQ,CAAC,QAAQ,CAAC,EAAE,yBAAyB,CAAC,OAAO,CAAC,CAAC;IACvD,QAAQ,CAAC,OAAO,CAAC,EAAE,wBAAwB,CAAC;IAC5C,QAAQ,CAAC,UAAU,CAAC,EAAE,2BAA2B,CAAC,OAAO,CAAC,CAAC;IAC3D,QAAQ,CAAC,GAAG,CAAC,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;CAC9C;AAED;;;GAGG;AACH,MAAM,MAAM,sBAAsB,CAAC,OAAO,IAAI,eAAe,CAC3D,eAAe,CAAC,OAAO,CAAC,CACzB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -5,18 +5,24 @@
5
5
  * Runtime and Channel providers import Dreamux contracts from this package and
6
6
  * must not import `@excitedjs/dreamux`.
7
7
  *
8
- * This package emits declarations only: there is no runtime JS contract surface
9
- * and no runtime dependencies. See
8
+ * This package emits declarations only: there is no runtime JS contract
9
+ * surface. Its one dependency is `tapable`, referenced only by type, because
10
+ * the plugin hook contract is tapable's hook types. See
10
11
  * `.agents/tasks/architecture/npm-package-split/requirement.md (npm-package-split-and-channel-targets)`.
11
12
  *
12
- * Scope: neutral contracts and catalog types only. No provider-specific paths,
13
- * selectors, or runtime-native record formats cross this boundary, and no
14
- * module here encodes a provider id or an exposure policy.
13
+ * Scope: neutral provider and plugin contracts and catalog types only. No
14
+ * provider-specific paths, selectors, or runtime-native record formats cross
15
+ * this boundary, and no module here encodes a provider id or an exposure
16
+ * policy.
15
17
  *
16
18
  * Module layout follows domain ownership: `agent-runtime.ts` is the Provider /
17
- * native execution seam, `channel.ts` is the bridge lifecycle plus the two
18
- * generic Core ports, `command.ts` is the generic Command port, and `team.ts` /
19
- * `teammate.ts` hold the Core domain facts each of those entities owns.
19
+ * native execution seam, `activity.ts` is the Activity domain (live and cold
20
+ * record shapes) that seam produces, `channel.ts` is the bridge lifecycle plus
21
+ * the two generic Core ports, `plugin.ts` is the plugin seam (plugin object,
22
+ * hosts, hooked Dispatcher/Team faces, launch draft), and `team.ts` /
23
+ * `teammate.ts` hold the Core domain facts each of those entities owns
24
+ * (`team.ts` also owns the published Channel Command failure shape, since a
25
+ * Team Command payload is its only consumer).
20
26
  *
21
27
  * Root-export policy (issue #209): the root aggregates every public contract
22
28
  * type so an external provider author can name any of them directly. A type
@@ -27,13 +33,14 @@
27
33
  * legitimately depend on). The `exports` map publishes only this root, so this
28
34
  * list IS the public API.
29
35
  */
30
- export type { DreamuxLogger } from './logger.js';
31
- export type { JsonSchema, JsonValue } from './json.js';
32
- export type { JsonInvokeResult, JsonInvoker } from './invoke.js';
33
- export type { AgentRuntimeProviderDescriptor, BuiltinProviderRef, ChannelProviderDescriptor, DreamuxEnvironment, ProviderBinCheck, NpmProviderRef, ProviderDiagnosticRunner, ProviderDiagnosticScope, ProviderDescriptor, ProviderDiagnosticResult, ProviderFactory, ProviderFactoryContext, ProviderKind, ProviderOnboard, ProviderOnboardConfirmPrompt, ProviderOnboardContext, ProviderOnboardPromptHost, ProviderOnboardSecretPrompt, ProviderOnboardTextPrompt, ProviderRef, ProviderRefSource, RegisteredProvider, } from './provider.js';
34
- export type { AgentActivityError, AgentActivityPage, AgentActivityQuery, AgentActivityReadContext, AgentActivityRecord, AgentRuntime, AgentRuntimeActivitySink, AgentRuntimeBinCheck, AgentRuntimeConfigCapability, AgentRuntimeCreateContext, AgentRuntimeDiagnosticCapability, AgentRuntimeDiagnosticContext, AgentRuntimeDiagnosticRunner, AgentRuntimeDiagnosticResult, AgentRuntimeIdentity, AgentRuntimeInterruptOutcome, AgentRuntimeLogger, AgentRuntimeMcpServer, AgentRuntimeOnboardCapability, AgentRuntimePathContext, AgentRuntimeProvider, AgentRuntimeProviderCapabilities, AgentRuntimeProviderConfigReadContext, AgentRuntimeProviderFactory, AgentRuntimeSkillSource, AgentRuntimeStartOutcome, AgentRuntimeStateLeaseRevokedError, AgentRuntimeStateSink, AgentRuntimeStateUpdate, AgentRuntimeStatus, AgentRuntimeSubmissionInput, AgentRuntimeSystemPrompt, RuntimeActivity, RuntimeAdmission, RuntimeCompletion, RuntimeSubmission, RuntimeSubmissionSettlement, RuntimeToolAction, } from './agent-runtime.js';
35
- export type { ChannelCommandError, ChannelCommandRetryableErrorCode, CoreCommandContext, CoreCommandDefinition, CoreCommandRegistry, CoreCommandSource, } from './command.js';
36
- export type { SubmitCommand, TeamCreateCommand, TeamCreateRepoRequest, TeamStatus, TeamSummary, TeamStateEvent, TeamStateTeammateSummary, TeamSubmitCommand, TeamSubmitResult, } from './team.js';
37
- export type { TeamContainedRole, TeammateActivityEvent, TeammateActorScope, TeammateInputEvent, TeammateInputNotice, TeammateRole, TeammateStateEvent, TeammateStatus, } from './teammate.js';
38
- export type { ChannelBinCheck, ChannelConfigCapability, ChannelConfigContext, ChannelCorePort, ChannelCoreEvent, ChannelDiagnosticCapability, ChannelDiagnosticContext, ChannelDiagnosticRunner, ChannelDiagnosticResult, ChannelEventSource, ChannelEventSubscription, ChannelIdentityCapability, ChannelInstance, ChannelMcpCall, ChannelMcpCallContext, ChannelMcpCaller, ChannelMcpCapability, ChannelMcpToolAnnotations, ChannelMcpToolDescriptor, ChannelMcpToolIcon, ChannelMcpToolOutcome, ChannelMcpToolRegistration, ChannelOnboardCapability, ChannelProvider, ChannelProviderFactory, ChannelSession, ChannelSessionCreateContext, ChannelSessionMcpCapability, } from './channel.js';
36
+ export type * from './logger.js';
37
+ export type * from './json.js';
38
+ export type * from './invoke.js';
39
+ export type * from './provider.js';
40
+ export type * from './agent-runtime.js';
41
+ export type * from './activity.js';
42
+ export type * from './team.js';
43
+ export type * from './teammate.js';
44
+ export type * from './channel.js';
45
+ export type * from './plugin.js';
39
46
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa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,EACrB,UAAU,EACV,WAAW,EACX,cAAc,EACd,wBAAwB,EACxB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,WAAW,CAAC;AACnB,YAAY,EACV,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,EACZ,kBAAkB,EAClB,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,eAAe,EACf,uBAAuB,EACvB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,2BAA2B,EAC3B,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,EACvB,kBAAkB,EAClB,wBAAwB,EACxB,yBAAyB,EACzB,eAAe,EACf,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,yBAAyB,EACzB,wBAAwB,EACxB,kBAAkB,EAClB,qBAAqB,EACrB,0BAA0B,EAC1B,wBAAwB,EACxB,eAAe,EACf,sBAAsB,EACtB,cAAc,EACd,2BAA2B,EAC3B,2BAA2B,GAC5B,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,mBAAmB,aAAa,CAAC;AACjC,mBAAmB,WAAW,CAAC;AAC/B,mBAAmB,aAAa,CAAC;AACjC,mBAAmB,eAAe,CAAC;AACnC,mBAAmB,oBAAoB,CAAC;AACxC,mBAAmB,eAAe,CAAC;AACnC,mBAAmB,WAAW,CAAC;AAC/B,mBAAmB,eAAe,CAAC;AACnC,mBAAmB,cAAc,CAAC;AAClC,mBAAmB,aAAa,CAAC"}
package/dist/invoke.d.ts CHANGED
@@ -15,25 +15,4 @@ import type { JsonValue } from './json.js';
15
15
  export interface JsonInvoker {
16
16
  invoke(method: string, params: JsonValue): Promise<JsonValue>;
17
17
  }
18
- /**
19
- * A settled outcome an implementation chose to state, rather than throw.
20
- *
21
- * The distinction is the whole failure boundary. `ok: false` is a decision: the
22
- * implementation understood the request, refused it, and wrote a message it
23
- * accepts being read by whoever asked. Everything it did *not* decide — a bug,
24
- * a broken invariant, an unexpected exception — is never this. It stays an
25
- * exception, so the boundary that owns diagnostics logs it in full and answers
26
- * with its own sanitized wording.
27
- *
28
- * Because a refusal is data, it crosses a process or package edge as JSON. No
29
- * error class, error code, or thrown domain value has to be shared for one side
30
- * to tell the other exactly what was wrong.
31
- */
32
- export type JsonInvokeResult<TValue = JsonValue> = {
33
- readonly ok: true;
34
- readonly value: TValue;
35
- } | {
36
- readonly ok: false;
37
- readonly message: string;
38
- };
39
18
  //# sourceMappingURL=invoke.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"invoke.d.ts","sourceRoot":"","sources":["../src/invoke.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;CAC/D;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,gBAAgB,CAAC,MAAM,GAAG,SAAS,IAC3C;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC7C;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC"}
1
+ {"version":3,"file":"invoke.d.ts","sourceRoot":"","sources":["../src/invoke.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;CAC/D"}
package/dist/logger.d.ts CHANGED
@@ -4,10 +4,8 @@
4
4
  * Deliberately pino-compatible (fields-first: `info(fields, message)`), so the
5
5
  * host's real pino logger satisfies this shape *structurally* — Dreamux core
6
6
  * injects its pino logger as-is, with no wrapper and no conversion at any
7
- * boundary. A provider authored against `@excitedjs/dreamux-types` depends only
8
- * on this shape; when core injects no logger, the provider package owns its own
9
- * minimal console fallback (also this shape). That fallback is implementation
10
- * code and does not belong in this declaration-only package.
7
+ * boundary. Core always supplies a logger, so every provider context field
8
+ * that carries one is required, not optional.
11
9
  *
12
10
  * The dual call signature mirrors pino's two primary overloads: pass fields then
13
11
  * an optional message, or pass a bare message. A misplaced message-first call
@@ -26,10 +24,10 @@ export interface DreamuxLogger {
26
24
  debug: DreamuxLogFn;
27
25
  trace: DreamuxLogFn;
28
26
  /**
29
- * Context-binding sub-logger. Optional so a minimal provider fallback need not
30
- * implement it; pino's `child(bindings)` satisfies it directly.
27
+ * Context-binding sub-logger. Every constructed `DreamuxLogger` already
28
+ * provides it — pino's `child(bindings)` satisfies it directly.
31
29
  */
32
- child?(bindings: Record<string, unknown>): DreamuxLogger;
30
+ child(bindings: Record<string, unknown>): DreamuxLogger;
33
31
  }
34
32
  export {};
35
33
  //# sourceMappingURL=logger.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,UAAU,YAAY;IACpB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1D,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,YAAY,CAAC;IACpB,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,EAAE,YAAY,CAAC;IACpB,KAAK,EAAE,YAAY,CAAC;IACpB;;;OAGG;IACH,KAAK,CAAC,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,aAAa,CAAC;CAC1D"}
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,UAAU,YAAY;IACpB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1D,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,YAAY,CAAC;IACpB,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,EAAE,YAAY,CAAC;IACpB,KAAK,EAAE,YAAY,CAAC;IACpB;;;OAGG;IACH,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,aAAa,CAAC;CACzD"}
@@ -0,0 +1,192 @@
1
+ import type { AsyncSeriesHook, AsyncSeriesWaterfallHook, SyncHook, TypedHookMap } from 'tapable';
2
+ import type { AgentRuntimeProvider, AgentRuntimeSkillSource } from './agent-runtime.js';
3
+ import type { ChannelProvider } from './channel.js';
4
+ import type { DreamuxLogger } from './logger.js';
5
+ import type { TeamCreateParams } from './team.js';
6
+ /**
7
+ * A Dreamux plugin: the object a plugin package's zero-argument factory
8
+ * (its `default` export, or the `npm:<pkg>#<export>` export) returns
9
+ * synchronously. Factories and `config.read` must not return thenables.
10
+ *
11
+ * `contribute` and `server` only register and tap. They must not do IO, start
12
+ * timers, or hold resources: `dreamux doctor` runs both while a daemon may be
13
+ * live, and no Dispatcher or channel exists yet to own a resource. Resources
14
+ * belong to object lifecycles (a channel's initialize/start/close, or a hook
15
+ * callback). Both must be synchronous — declared `void`, and enforced at load
16
+ * time by rejecting a returned thenable — since nothing awaits them: an
17
+ * `async` implementation would silently lose any tap it registers after its
18
+ * first `await`.
19
+ */
20
+ export interface DreamuxPlugin {
21
+ /** Unique ignoring ASCII case across loaded plugins; spelling is preserved. */
22
+ readonly name: string;
23
+ /**
24
+ * Published to other plugins after every plugin's `server` ran, through
25
+ * `ServerHost.hooks.plugin.for(name)`. Declare its type by augmenting
26
+ * {@link DreamuxPluginApis}.
27
+ */
28
+ readonly api?: unknown;
29
+ /** Synchronously validate this plugin's `plugins[]` config block; a throw fails loading. */
30
+ readonly config?: {
31
+ read(raw: unknown): unknown;
32
+ };
33
+ contribute?(host: ContributeHost): void;
34
+ server?(host: ServerHost): void;
35
+ }
36
+ export interface ContributeHost {
37
+ readonly logger: DreamuxLogger;
38
+ /** Registers a channel provider addressed in config as `builtin:<name>`. */
39
+ readonly channelProviders: {
40
+ contribute<TConfig>(name: string, provider: ChannelProvider<TConfig>): void;
41
+ };
42
+ /** Registers an Agent Runtime provider addressed in config as `builtin:<name>`. */
43
+ readonly agentRuntimeProviders: {
44
+ contribute<TConfig>(name: string, provider: AgentRuntimeProvider<TConfig>): void;
45
+ };
46
+ }
47
+ /**
48
+ * Plugin name -> the type of that plugin's `api`. A plugin package that
49
+ * publishes an api augments this interface:
50
+ *
51
+ * ```ts
52
+ * declare module '@excitedjs/dreamux-types' {
53
+ * interface DreamuxPluginApis { example: ExampleApi }
54
+ * }
55
+ * ```
56
+ */
57
+ export interface DreamuxPluginApis {
58
+ }
59
+ export interface ServerHost {
60
+ /** The value this plugin's `config.read` returned; `undefined` without one. */
61
+ readonly config: unknown;
62
+ /** Bound with `plugin: <name>`. */
63
+ readonly logger: DreamuxLogger;
64
+ /**
65
+ * This plugin's own durable state directory, scoped by the plugin's name
66
+ * and no other identity. Core neither creates it nor reads inside it — the
67
+ * plugin owns its own `mkdir`/read/write, the same way every other Dreamux
68
+ * store creates its directory lazily on first write.
69
+ */
70
+ readonly stateDir: string;
71
+ /**
72
+ * Core runs these hooks, and every hook below them, with tapable's own
73
+ * `call` / `promise`, so interceptors added with `hook.intercept` run. Core
74
+ * installs a `register` interceptor first, which wraps each tap: a failing
75
+ * tap is logged with its owning plugin and the other taps still run. Core
76
+ * also wraps `hook.intercept` itself, so every method of a plugin's own
77
+ * interceptor (`call`/`tap`/`loop`/`result`/`done`/`error`/`register`) is
78
+ * guarded the same way — including `done`/`error`, which tapable invokes
79
+ * from a continuation no caller-side try/catch can see, so an unguarded
80
+ * throw there would otherwise hang the hook's own `promise()` forever
81
+ * instead of failing it. A guarded interceptor's throw is attributed to the
82
+ * plugin that added it and follows the same rule as the hook it is on:
83
+ * logged and skipped at runtime, a failed load naming that plugin at load
84
+ * time (`hooks.plugin.for(name)`). Interceptor methods must be synchronous:
85
+ * tapable ignores their return value (except `register`'s), so an `async`
86
+ * method's rejection is logged at runtime and fails loading at load time,
87
+ * and an `async` `register` leaves the tap unchanged even when its promise
88
+ * resolves to a modified tap.
89
+ *
90
+ * Tap names are free-form. The owning plugin of a tap is the plugin whose
91
+ * `server` registered it, or the plugin whose tap callback was running when
92
+ * it registered (including after an `await` inside that callback). Failure
93
+ * logs and doctor name taps by that owner.
94
+ */
95
+ readonly hooks: Readonly<{
96
+ /**
97
+ * Called once per Dispatcher object, right after core constructs it. A tap
98
+ * that throws is only stopped: taps it already added to the Dispatcher's
99
+ * hooks stay.
100
+ */
101
+ dispatcher: SyncHook<[Dispatcher]>;
102
+ /**
103
+ * `for(name)` is called once with that plugin's `api`, after every
104
+ * plugin's `server` ran. Never called for a plugin that is not loaded.
105
+ */
106
+ plugin: TypedHookMap<{
107
+ [K in keyof DreamuxPluginApis]: SyncHook<[DreamuxPluginApis[K]]>;
108
+ }>;
109
+ }>;
110
+ }
111
+ /** The public face of a Dispatcher, as plugin hooks receive it. */
112
+ export interface Dispatcher {
113
+ readonly id: string;
114
+ /** The configured Dispatcher cwd, absolute. */
115
+ readonly cwd: string;
116
+ /**
117
+ * A failing tap does not stop the others. Each `launch` or `teammateLaunch`
118
+ * tap receives its own empty draft, merged into the launch only when the
119
+ * tap succeeds. A `team` tap that throws is only stopped: taps it already
120
+ * added to the Team's hooks stay.
121
+ */
122
+ readonly hooks: Readonly<{
123
+ /** Runs each time this Dispatcher's Agent is constructed (each Dispatcher start). */
124
+ launch: AsyncSeriesHook<[LaunchDraft]>;
125
+ /**
126
+ * Runs each time any ordinary TeamMate's Agent is constructed —
127
+ * Dispatcher-spawned, a Team member, or a Workflow agent — never for the
128
+ * Dispatcher's own Agent or a Team's leader (see `launch` / `leaderLaunch`).
129
+ * `teamId` is `null` for a dispatcher-owned TeamMate, the owning Team's id
130
+ * otherwise.
131
+ */
132
+ teammateLaunch: AsyncSeriesHook<[
133
+ LaunchDraft,
134
+ Readonly<{
135
+ teamId: string | null;
136
+ }>
137
+ ]>;
138
+ /**
139
+ * Runs once per `team.create` request that is not a replay of an already
140
+ * accepted one, before the Team is constructed. Each tap receives the
141
+ * previous tap's returned value (the caller's own params for the first
142
+ * tap) and returns the value the next tap sees; the final value is what
143
+ * the Team is built from. `request_id` is not part of this value — replay
144
+ * identity is decided before this hook ever runs.
145
+ */
146
+ createTeam: AsyncSeriesWaterfallHook<[TeamCreateParams]>;
147
+ /**
148
+ * Runs right after a Team object is constructed: on creation (before the
149
+ * Team record is written, so the object may be discarded when the name is
150
+ * taken) and on rebuild. Taps here should only tap the Team's own hooks.
151
+ */
152
+ team: SyncHook<[Team, {
153
+ readonly origin: 'create' | 'rebuild';
154
+ }]>;
155
+ }>;
156
+ }
157
+ /** The public face of a Team, as plugin hooks receive it. */
158
+ export interface Team {
159
+ readonly id: string;
160
+ readonly name: string;
161
+ /** The Team's runtime cwd. */
162
+ readonly workspace: string;
163
+ /**
164
+ * A failing tap does not stop the others. Each `leaderLaunch` tap
165
+ * receives its own empty draft, merged into the launch only when the tap
166
+ * succeeds.
167
+ */
168
+ readonly hooks: Readonly<{
169
+ /**
170
+ * Runs each time this Team's TeamLeader Agent is constructed, including
171
+ * when a failed creation adopts the already-persisted leader to close it.
172
+ */
173
+ leaderLaunch: AsyncSeriesHook<[LaunchDraft]>;
174
+ }>;
175
+ }
176
+ /**
177
+ * What a launch hook may add. It starts empty: built-in prompts and skill
178
+ * roots are not in it and cannot be changed. Core appends `instructions` after
179
+ * the built-in prompt and `skillSources` after the built-in roots, fenced
180
+ * against them.
181
+ *
182
+ * This is also the only shape a launch hook itself ever carries: a tap gets
183
+ * its own private one, merged in only after it resolves and passes the skill
184
+ * fence, and a plugin's own `hook.intercept` callback on the hook sees a
185
+ * disconnected one — the accumulator that applies the fence is never handed
186
+ * to a hook, so an interceptor cannot add a skill root that skips it.
187
+ */
188
+ export interface LaunchDraft {
189
+ readonly instructions: string[];
190
+ readonly skillSources: AgentRuntimeSkillSource[];
191
+ }
192
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,wBAAwB,EACxB,QAAQ,EACR,YAAY,EACb,MAAM,SAAS,CAAC;AAEjB,OAAO,KAAK,EACV,oBAAoB,EACpB,uBAAuB,EACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAElD;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,aAAa;IAC5B,+EAA+E;IAC/E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IACvB,4FAA4F;IAC5F,QAAQ,CAAC,MAAM,CAAC,EAAE;QAAE,IAAI,CAA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AAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,+CAA+C;IAC/C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;QACvB,qFAAqF;QACrF,MAAM,EAAE,eAAe,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;QACvC;;;;;;WAMG;QACH,cAAc,EAAE,eAAe,CAC7B;YAAC,WAAW;YAAE,QAAQ,CAAC;gBAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;aAAE,CAAC;SAAC,CACnD,CAAC;QACF;;;;;;;WAOG;QACH,UAAU,EAAE,wBAAwB,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC;QACzD;;;;WAIG;QACH,IAAI,EAAE,QAAQ,CAAC,CAAC,IAAI,EAAE;YAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,SAAS,CAAA;SAAE,CAAC,CAAC,CAAC;KACnE,CAAC,CAAC;CACJ;AAED,6DAA6D;AAC7D,MAAM,WAAW,IAAI;IACnB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,8BAA8B;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;QACvB;;;WAGG;QACH,YAAY,EAAE,eAAe,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;KAC9C,CAAC,CAAC;CACJ;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC;IAChC,QAAQ,CAAC,YAAY,EAAE,uBAAuB,EAAE,CAAC;CAClD"}
package/dist/team.d.ts CHANGED
@@ -4,17 +4,44 @@
4
4
  * The Team owns its canonical Commands and its aggregate state event. Both
5
5
  * Command payloads below are the two whose contracts change materially for
6
6
  * Channel use; every other canonical Team Command keeps its current domain
7
- * behavior and is defined by its own domain-owned Command module in Core.
7
+ * behavior and is defined by its own domain-owned Command module in Core. The
8
+ * published Channel Command failure shape lives here too, rather than with a
9
+ * generic Command port module, because {@link TeamSubmitResult} is its only
10
+ * consumer.
8
11
  */
9
12
  import type { AgentRuntimeSkillSource, AgentRuntimeStatus } from './agent-runtime.js';
10
- import type { ChannelCommandError } from './command.js';
11
13
  import type { TeamContainedRole, TeammateStatus } from './teammate.js';
14
+ /**
15
+ * A typed Command failure returned across the generic Channel Command port.
16
+ * `code` stays an open string because each domain owns its own failure
17
+ * vocabulary; the two codes that carry a cross-domain rule are named by
18
+ * {@link ChannelCommandRetryableErrorCode}.
19
+ */
20
+ export interface ChannelCommandError {
21
+ readonly code: string;
22
+ readonly message: string;
23
+ /**
24
+ * The next step the failure stated for itself, when it stated one.
25
+ *
26
+ * Present exactly when the failure's own author wrote both halves of it — the
27
+ * reason and what to do about it — so a caller rendering this for an agent can
28
+ * repeat it as it stands. Absent means no next step was ever authored: a
29
+ * renderer carries the `code` and the `message` alone, and says nothing more.
30
+ */
31
+ readonly action?: string;
32
+ }
33
+ /**
34
+ * The only pre-admission failures that permit a Channel to remove a stale
35
+ * binding and retry once to the Dispatcher Agent. Every other failure — and any
36
+ * `ambiguous` outcome — is never retried.
37
+ */
38
+ export type ChannelCommandRetryableErrorCode = 'TEAM_NOT_FOUND' | 'TEAM_CLOSED';
12
39
  /**
13
40
  * A Team's repository policy. It is the complete existing Team-creation
14
41
  * capability, not a Channel-shaped subset: `reuse-cwd` reuses a caller-selected
15
42
  * or default working directory, and `managed` creates a git worktree with the
16
- * existing optional path, base ref, branch, slug, and cleanup controls. An
17
- * omitted request keeps the dispatcher's default shared work directory.
43
+ * existing optional path, base ref, branch, and cleanup controls. An omitted
44
+ * request keeps the dispatcher's default shared work directory.
18
45
  *
19
46
  * A Channel that owns only a narrow policy — Feishu supplies `path`/`base_ref`
20
47
  * — maps it into the `managed` branch before invoking the Command, so no
@@ -30,7 +57,6 @@ export type TeamCreateRepoRequest = {
30
57
  readonly path?: string;
31
58
  readonly base_ref?: string;
32
59
  readonly branch?: string;
33
- readonly slug?: string;
34
60
  readonly cleanup?: 'keep' | 'delete-on-close';
35
61
  };
36
62
  /**
@@ -58,7 +84,23 @@ export interface TeamCreateCommand {
58
84
  };
59
85
  readonly repo?: TeamCreateRepoRequest;
60
86
  }
87
+ /**
88
+ * A `team.create` request's own params, without `request_id`.
89
+ *
90
+ * This is what `dispatcher.hooks.createTeam` hands a tap and expects back:
91
+ * `request_id` decides replay identity before the hook ever runs, so it is
92
+ * neither read nor returnable here. Every field is `readonly` (inherited from
93
+ * {@link TeamCreateCommand}); a tap that wants to change one returns a new
94
+ * spread object (`{ ...params, intent: '...' }`), never a mutation in place.
95
+ */
96
+ export type TeamCreateParams = Omit<TeamCreateCommand, 'request_id'>;
61
97
  export type TeamStatus = 'starting' | 'running' | 'closed';
98
+ /**
99
+ * A managed worktree's cleanup outcome, as {@link TeamSummary} reports it. Named
100
+ * so a caller can hold or narrow the value by type rather than repeating the
101
+ * nine-member literal union at every read site.
102
+ */
103
+ export type TeamWorktreeCleanupState = 'not-managed' | 'managed-active' | 'cleanup-pending' | 'kept' | 'deleted' | 'retained-dirty' | 'retained-unmerged' | 'retained-unique-commits' | 'retained-error';
62
104
  /** The current Team facts shared by create and status; `team.list` is a compact row. */
63
105
  export interface TeamSummary {
64
106
  readonly team_name: string;
@@ -84,7 +126,7 @@ export interface TeamSummary {
84
126
  readonly source_repo: string | null;
85
127
  readonly worktree_mode: 'reuse-cwd' | 'managed';
86
128
  readonly worktree_cleanup_mode: 'keep' | 'delete-on-close';
87
- readonly worktree_cleanup: 'not-managed' | 'managed-active' | 'cleanup-pending' | 'kept' | 'deleted' | 'retained-dirty' | 'retained-unmerged' | 'retained-unique-commits' | 'retained-error';
129
+ readonly worktree_cleanup: TeamWorktreeCleanupState;
88
130
  }
89
131
  /**
90
132
  * One turn submit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AM,WAAW,iBAAkB,SAAQ,aAAa;IACtD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EACb,WAAW,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,CAAC;IACjE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,mBAAmB,CAAC;CACtC;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;CACjC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,aAAa,EAAE,CAAC,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,SAAS,wBAAwB,EAAE,CAAC;CACzD"}
@@ -10,7 +10,7 @@
10
10
  * Dispatcher-scoped TeamMate publishes its first `teammate.state`; later
11
11
  * transitions publish the same kind. There is no separate creation event.
12
12
  */
13
- import type { RuntimeActivity } from './agent-runtime.js';
13
+ import type { RuntimeActivity } from './activity.js';
14
14
  /**
15
15
  * The role a TeamMate presents at this boundary.
16
16
  *
@@ -1 +1 @@
1
- {"version":3,"file":"teammate.d.ts","sourceRoot":"","sources":["../src/teammate.ts"],"names":[],"mappings":"AAAA;;;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.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@excitedjs/dreamux-types",
3
- "version": "0.11.0-beta.264",
4
- "description": "Declaration-only provider-authoring contracts for Dreamux: Agent Runtime and Channel provider types external providers compile against without depending on @excitedjs/dreamux (issue excitedjs/dreamux#209).",
3
+ "version": "0.11.0-beta.271",
4
+ "description": "Declaration-only provider- and plugin-authoring contracts for Dreamux: Agent Runtime and Channel provider types and the plugin hook contract, which external providers and plugins compile against without depending on @excitedjs/dreamux (issue excitedjs/dreamux#209).",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -23,9 +23,13 @@
23
23
  "README.md",
24
24
  "LICENSE"
25
25
  ],
26
+ "dependencies": {
27
+ "tapable": "~2.3.3"
28
+ },
26
29
  "devDependencies": {
27
30
  "@types/node": "^22.10.0",
28
31
  "eslint": "^9.39.0",
32
+ "prettier": "^3.9.9",
29
33
  "typescript": "^5.7.0",
30
34
  "vitest": "^2.1.0",
31
35
  "@excitedjs/eslint-config": "0.0.0"
@@ -34,7 +38,7 @@
34
38
  "build": "tsc -p tsconfig.json",
35
39
  "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.tests.json",
36
40
  "typecheck:tests": "tsc -p tsconfig.tests.json",
37
- "lint": "eslint .",
41
+ "lint": "eslint . && prettier --check . '!**/*.md' '!**/dist/**' '!**/CHANGELOG.json' '!**/.rush/**'",
38
42
  "test": "vitest run",
39
43
  "test:watch": "vitest",
40
44
  "clean": "rm -rf dist"
package/dist/command.d.ts DELETED
@@ -1,78 +0,0 @@
1
- /**
2
- * The generic Core Command port (declaration-only).
3
- *
4
- * There is one authoritative Command registry, not an admin method table plus a
5
- * separate Channel catalog. Both adapters — the `admin.sock` NDJSON server and
6
- * the in-process Channel invoker — resolve the same definition, run the same
7
- * validation, attach their factual caller context, execute the same domain
8
- * handler, and return the same typed result or error.
9
- *
10
- * These types carry no exposure/audience property, allowlist, describe-by-caller
11
- * hook, or capability negotiation: every registered Command is callable through
12
- * every adapter, subject only to its ordinary input and domain invariants.
13
- * Canonical Command payloads themselves live with the domain that owns them
14
- * (see `team.ts`).
15
- */
16
- import type { JsonSchema, JsonValue } from './json.js';
17
- /**
18
- * Which adapter admitted this Command invocation.
19
- *
20
- * There are exactly two, because an Agent no longer reaches Commands at all: an
21
- * Agent-facing MCP tool is served by its own delegate behind a runtime-generation
22
- * lease, so no adapter has to describe itself as “the MCP proxy”.
23
- */
24
- export type CoreCommandSource = 'admin_socket' | 'channel';
25
- /**
26
- * Factual invocation context. Some domain operations, logging, and deduplication
27
- * consume these fields. They never filter the registry.
28
- *
29
- * There is no caller identity here. Caller scope belongs to whoever bound it —
30
- * for MCP that is the delegate the lease resolves to — and a Command that read
31
- * one would be re-deriving a fact a lower layer already owns.
32
- */
33
- export interface CoreCommandContext {
34
- readonly source: CoreCommandSource;
35
- readonly dispatcher_id?: string;
36
- readonly channel_id?: string;
37
- }
38
- /**
39
- * One domain-owned Command. Parsing, schemas, and execution belong to the
40
- * domain that owns the action, not to a transport adapter.
41
- */
42
- export interface CoreCommandDefinition<Name extends string, Input, Output> {
43
- readonly name: Name;
44
- readonly version: 1;
45
- readonly input: JsonSchema;
46
- readonly output: JsonSchema;
47
- parse(payload: JsonValue): Input;
48
- execute(context: CoreCommandContext, input: Input): Promise<Output>;
49
- }
50
- export interface CoreCommandRegistry {
51
- invoke(context: CoreCommandContext, name: string, payload: JsonValue): Promise<JsonValue>;
52
- }
53
- /**
54
- * A typed Command failure returned across the generic port. `code` stays an
55
- * open string because each domain owns its own failure vocabulary; the two
56
- * codes that carry a cross-domain rule are named by
57
- * {@link ChannelCommandRetryableErrorCode}.
58
- */
59
- export interface ChannelCommandError {
60
- readonly code: string;
61
- readonly message: string;
62
- /**
63
- * The next step the failure stated for itself, when it stated one.
64
- *
65
- * Present exactly when the failure's own author wrote both halves of it — the
66
- * reason and what to do about it — so a caller rendering this for an agent can
67
- * repeat it as it stands. Absent means no next step was ever authored: a
68
- * renderer carries the `code` and the `message` alone, and says nothing more.
69
- */
70
- readonly action?: string;
71
- }
72
- /**
73
- * The only pre-admission failures that permit a Channel to remove a stale
74
- * binding and retry once to the Dispatcher Agent. Every other failure — and any
75
- * `ambiguous` outcome — is never retried.
76
- */
77
- export type ChannelCommandRetryableErrorCode = 'TEAM_NOT_FOUND' | 'TEAM_CLOSED';
78
- //# sourceMappingURL=command.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEvD;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,cAAc,GAAG,SAAS,CAAC;AAE3D;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB,CAAC,IAAI,SAAS,MAAM,EAAE,KAAK,EAAE,MAAM;IACvE,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,KAAK,CAAC,OAAO,EAAE,SAAS,GAAG,KAAK,CAAC;IACjC,OAAO,CAAC,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACrE;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,CACJ,OAAO,EAAE,kBAAkB,EAC3B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,SAA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