@animalabs/agent-framework 0.32.0 → 0.33.0
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 +204 -14
- package/dist/src/admission/admit.d.ts +18 -0
- package/dist/src/admission/admit.d.ts.map +1 -1
- package/dist/src/admission/admit.js +16 -3
- package/dist/src/admission/admit.js.map +1 -1
- package/dist/src/agent.d.ts +185 -78
- package/dist/src/agent.d.ts.map +1 -1
- package/dist/src/agent.js +279 -102
- package/dist/src/agent.js.map +1 -1
- package/dist/src/api/mcp-server-core.d.ts.map +1 -1
- package/dist/src/api/mcp-server-core.js +50 -12
- package/dist/src/api/mcp-server-core.js.map +1 -1
- package/dist/src/api/server.d.ts.map +1 -1
- package/dist/src/api/server.js +4 -20
- package/dist/src/api/server.js.map +1 -1
- package/dist/src/code-execution/isolate/scripts.d.ts +12 -8
- package/dist/src/code-execution/isolate/scripts.d.ts.map +1 -1
- package/dist/src/code-execution/isolate/scripts.js +24 -0
- package/dist/src/code-execution/isolate/scripts.js.map +1 -1
- package/dist/src/config-checks.d.ts +7 -0
- package/dist/src/config-checks.d.ts.map +1 -1
- package/dist/src/config-checks.js +14 -0
- package/dist/src/config-checks.js.map +1 -1
- package/dist/src/context-manager-errors.d.ts +25 -0
- package/dist/src/context-manager-errors.d.ts.map +1 -0
- package/dist/src/context-manager-errors.js +31 -0
- package/dist/src/context-manager-errors.js.map +1 -0
- package/dist/src/context-options.d.ts +67 -0
- package/dist/src/context-options.d.ts.map +1 -0
- package/dist/src/context-options.js +85 -0
- package/dist/src/context-options.js.map +1 -0
- package/dist/src/deferred-import.d.ts +93 -0
- package/dist/src/deferred-import.d.ts.map +1 -0
- package/dist/src/deferred-import.js +177 -0
- package/dist/src/deferred-import.js.map +1 -0
- package/dist/src/dendrite/audience.d.ts +223 -0
- package/dist/src/dendrite/audience.d.ts.map +1 -0
- package/dist/src/dendrite/audience.js +202 -0
- package/dist/src/dendrite/audience.js.map +1 -0
- package/dist/src/dendrite/index.d.ts +5 -3
- package/dist/src/dendrite/index.d.ts.map +1 -1
- package/dist/src/dendrite/index.js +2 -1
- package/dist/src/dendrite/index.js.map +1 -1
- package/dist/src/dendrite/presets.d.ts +10 -5
- package/dist/src/dendrite/presets.d.ts.map +1 -1
- package/dist/src/dendrite/presets.js +17 -5
- package/dist/src/dendrite/presets.js.map +1 -1
- package/dist/src/dendrite/registry.d.ts +62 -7
- package/dist/src/dendrite/registry.d.ts.map +1 -1
- package/dist/src/dendrite/registry.js +179 -10
- package/dist/src/dendrite/registry.js.map +1 -1
- package/dist/src/dendrite/types.d.ts +91 -8
- package/dist/src/dendrite/types.d.ts.map +1 -1
- package/dist/src/foreign-rounds.d.ts +69 -0
- package/dist/src/foreign-rounds.d.ts.map +1 -0
- package/dist/src/foreign-rounds.js +152 -0
- package/dist/src/foreign-rounds.js.map +1 -0
- package/dist/src/framework.d.ts +1976 -818
- package/dist/src/framework.d.ts.map +1 -1
- package/dist/src/framework.js +7566 -3422
- package/dist/src/framework.js.map +1 -1
- package/dist/src/gate/event-gate.d.ts +85 -15
- package/dist/src/gate/event-gate.d.ts.map +1 -1
- package/dist/src/gate/event-gate.js +421 -47
- package/dist/src/gate/event-gate.js.map +1 -1
- package/dist/src/gate/index.d.ts +1 -1
- package/dist/src/gate/index.d.ts.map +1 -1
- package/dist/src/gate/index.js.map +1 -1
- package/dist/src/gate/rule-scope.d.ts +30 -0
- package/dist/src/gate/rule-scope.d.ts.map +1 -0
- package/dist/src/gate/rule-scope.js +41 -0
- package/dist/src/gate/rule-scope.js.map +1 -0
- package/dist/src/gate/suppress-script-worker.d.ts +2 -0
- package/dist/src/gate/suppress-script-worker.d.ts.map +1 -0
- package/dist/src/gate/suppress-script-worker.js +103 -0
- package/dist/src/gate/suppress-script-worker.js.map +1 -0
- package/dist/src/gate/suppress-scripts.d.ts +105 -0
- package/dist/src/gate/suppress-scripts.d.ts.map +1 -0
- package/dist/src/gate/suppress-scripts.js +403 -0
- package/dist/src/gate/suppress-scripts.js.map +1 -0
- package/dist/src/gate/suppression-review.d.ts +143 -0
- package/dist/src/gate/suppression-review.d.ts.map +1 -0
- package/dist/src/gate/suppression-review.js +463 -0
- package/dist/src/gate/suppression-review.js.map +1 -0
- package/dist/src/gate/suppression-stats.d.ts +125 -0
- package/dist/src/gate/suppression-stats.d.ts.map +1 -0
- package/dist/src/gate/suppression-stats.js +214 -0
- package/dist/src/gate/suppression-stats.js.map +1 -0
- package/dist/src/gate/types.d.ts +135 -7
- package/dist/src/gate/types.d.ts.map +1 -1
- package/dist/src/gate/wake-onboarding.d.ts +119 -0
- package/dist/src/gate/wake-onboarding.d.ts.map +1 -0
- package/dist/src/gate/wake-onboarding.js +277 -0
- package/dist/src/gate/wake-onboarding.js.map +1 -0
- package/dist/src/held-writes.d.ts +31 -23
- package/dist/src/held-writes.d.ts.map +1 -1
- package/dist/src/held-writes.js +44 -59
- package/dist/src/held-writes.js.map +1 -1
- package/dist/src/index.d.ts +5 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/jsonrpc-envelope.d.ts +69 -0
- package/dist/src/jsonrpc-envelope.d.ts.map +1 -0
- package/dist/src/jsonrpc-envelope.js +66 -0
- package/dist/src/jsonrpc-envelope.js.map +1 -0
- package/dist/src/mcpl/channel-registry.d.ts +131 -15
- package/dist/src/mcpl/channel-registry.d.ts.map +1 -1
- package/dist/src/mcpl/channel-registry.js +290 -46
- package/dist/src/mcpl/channel-registry.js.map +1 -1
- package/dist/src/mcpl/checkpoint-manager.d.ts +2 -4
- package/dist/src/mcpl/checkpoint-manager.d.ts.map +1 -1
- package/dist/src/mcpl/checkpoint-manager.js.map +1 -1
- package/dist/src/mcpl/feature-set-manager.d.ts +2 -4
- package/dist/src/mcpl/feature-set-manager.d.ts.map +1 -1
- package/dist/src/mcpl/feature-set-manager.js.map +1 -1
- package/dist/src/mcpl/inbound-source.d.ts +2 -1
- package/dist/src/mcpl/inbound-source.d.ts.map +1 -1
- package/dist/src/mcpl/inbound-source.js +2 -1
- package/dist/src/mcpl/inbound-source.js.map +1 -1
- package/dist/src/mcpl/inference-router.d.ts +6 -6
- package/dist/src/mcpl/inference-router.d.ts.map +1 -1
- package/dist/src/mcpl/inference-router.js.map +1 -1
- package/dist/src/mcpl/push-coalescer.d.ts +132 -22
- package/dist/src/mcpl/push-coalescer.d.ts.map +1 -1
- package/dist/src/mcpl/push-coalescer.js +105 -15
- package/dist/src/mcpl/push-coalescer.js.map +1 -1
- package/dist/src/mcpl/push-handler.d.ts +9 -7
- package/dist/src/mcpl/push-handler.d.ts.map +1 -1
- package/dist/src/mcpl/push-handler.js.map +1 -1
- package/dist/src/mcpl/server-connection.d.ts +13 -10
- package/dist/src/mcpl/server-connection.d.ts.map +1 -1
- package/dist/src/mcpl/server-connection.js +134 -56
- package/dist/src/mcpl/server-connection.js.map +1 -1
- package/dist/src/mcpl/tool-classes.d.ts.map +1 -1
- package/dist/src/mcpl/tool-classes.js +3 -0
- package/dist/src/mcpl/tool-classes.js.map +1 -1
- package/dist/src/mcpl/types.d.ts +8 -2
- package/dist/src/mcpl/types.d.ts.map +1 -1
- package/dist/src/mcpl/types.js.map +1 -1
- package/dist/src/module-registry.d.ts +24 -1
- package/dist/src/module-registry.d.ts.map +1 -1
- package/dist/src/module-registry.js +68 -18
- package/dist/src/module-registry.js.map +1 -1
- package/dist/src/modules/discord/index.d.ts +45 -8
- package/dist/src/modules/discord/index.d.ts.map +1 -1
- package/dist/src/modules/discord/index.js +237 -86
- package/dist/src/modules/discord/index.js.map +1 -1
- package/dist/src/modules/history/index.d.ts +59 -0
- package/dist/src/modules/history/index.d.ts.map +1 -1
- package/dist/src/modules/history/index.js +432 -67
- package/dist/src/modules/history/index.js.map +1 -1
- package/dist/src/modules/history/semantic.d.ts +6 -5
- package/dist/src/modules/history/semantic.d.ts.map +1 -1
- package/dist/src/modules/history/semantic.js +15 -22
- package/dist/src/modules/history/semantic.js.map +1 -1
- package/dist/src/modules/workspace/disk-agreement.d.ts +1 -1
- package/dist/src/modules/workspace/disk-agreement.js +1 -1
- package/dist/src/modules/workspace/index.d.ts +28 -7
- package/dist/src/modules/workspace/index.d.ts.map +1 -1
- package/dist/src/modules/workspace/index.js +76 -22
- package/dist/src/modules/workspace/index.js.map +1 -1
- package/dist/src/notice-tags.d.ts +10 -1
- package/dist/src/notice-tags.d.ts.map +1 -1
- package/dist/src/notice-tags.js +10 -1
- package/dist/src/notice-tags.js.map +1 -1
- package/dist/src/operator-log.d.ts +36 -3
- package/dist/src/operator-log.d.ts.map +1 -1
- package/dist/src/operator-log.js +2 -2
- package/dist/src/operator-log.js.map +1 -1
- package/dist/src/presentation.d.ts +746 -0
- package/dist/src/presentation.d.ts.map +1 -0
- package/dist/src/presentation.js +1435 -0
- package/dist/src/presentation.js.map +1 -0
- package/dist/src/prose-drafts.d.ts +15 -11
- package/dist/src/prose-drafts.d.ts.map +1 -1
- package/dist/src/prose-drafts.js +16 -12
- package/dist/src/prose-drafts.js.map +1 -1
- package/dist/src/read-marks.d.ts +192 -0
- package/dist/src/read-marks.d.ts.map +1 -0
- package/dist/src/read-marks.js +242 -0
- package/dist/src/read-marks.js.map +1 -0
- package/dist/src/recovery/offline-branch.d.ts +91 -6
- package/dist/src/recovery/offline-branch.d.ts.map +1 -1
- package/dist/src/recovery/offline-branch.js +273 -29
- package/dist/src/recovery/offline-branch.js.map +1 -1
- package/dist/src/recovery/recover-cli.js +22 -3
- package/dist/src/recovery/recover-cli.js.map +1 -1
- package/dist/src/send-tools.d.ts +5 -9
- package/dist/src/send-tools.d.ts.map +1 -1
- package/dist/src/send-tools.js +40 -7
- package/dist/src/send-tools.js.map +1 -1
- package/dist/src/stored-injections.d.ts +2 -2
- package/dist/src/stored-injections.js +2 -2
- package/dist/src/stored-removal.d.ts +17 -4
- package/dist/src/stored-removal.d.ts.map +1 -1
- package/dist/src/stored-removal.js +29 -5
- package/dist/src/stored-removal.js.map +1 -1
- package/dist/src/tool-result-guard.d.ts +12 -1
- package/dist/src/tool-result-guard.d.ts.map +1 -1
- package/dist/src/tool-result-guard.js +42 -8
- package/dist/src/tool-result-guard.js.map +1 -1
- package/dist/src/tune-out/coordinator.d.ts +1159 -79
- package/dist/src/tune-out/coordinator.d.ts.map +1 -1
- package/dist/src/tune-out/coordinator.js +3709 -363
- package/dist/src/tune-out/coordinator.js.map +1 -1
- package/dist/src/tune-out/tools.d.ts +114 -17
- package/dist/src/tune-out/tools.d.ts.map +1 -1
- package/dist/src/tune-out/tools.js +87 -27
- package/dist/src/tune-out/tools.js.map +1 -1
- package/dist/src/tune-out/window-anchor.d.ts +143 -0
- package/dist/src/tune-out/window-anchor.d.ts.map +1 -0
- package/dist/src/tune-out/window-anchor.js +202 -0
- package/dist/src/tune-out/window-anchor.js.map +1 -0
- package/dist/src/types/agent.d.ts +82 -20
- package/dist/src/types/agent.d.ts.map +1 -1
- package/dist/src/types/events.d.ts +2 -0
- package/dist/src/types/events.d.ts.map +1 -1
- package/dist/src/types/framework.d.ts +32 -12
- package/dist/src/types/framework.d.ts.map +1 -1
- package/dist/src/types/module.d.ts +180 -69
- package/dist/src/types/module.d.ts.map +1 -1
- package/dist/src/types/trace.d.ts +510 -36
- package/dist/src/types/trace.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/admission/admit.ts +32 -3
- package/src/agent.ts +323 -120
- package/src/api/mcp-server-core.ts +54 -17
- package/src/api/server.ts +4 -23
- package/src/code-execution/isolate/scripts.ts +28 -3
- package/src/config-checks.ts +14 -0
- package/src/context-manager-errors.ts +37 -0
- package/src/context-options.ts +96 -0
- package/src/deferred-import.ts +239 -0
- package/src/dendrite/audience.ts +315 -0
- package/src/dendrite/index.ts +14 -2
- package/src/dendrite/presets.ts +18 -6
- package/src/dendrite/registry.ts +209 -12
- package/src/dendrite/types.ts +92 -8
- package/src/foreign-rounds.ts +199 -0
- package/src/framework.ts +7804 -3546
- package/src/gate/event-gate.ts +428 -65
- package/src/gate/index.ts +3 -0
- package/src/gate/rule-scope.ts +45 -0
- package/src/gate/suppress-script-worker.ts +89 -0
- package/src/gate/suppress-scripts.ts +414 -0
- package/src/gate/suppression-review.ts +517 -0
- package/src/gate/suppression-stats.ts +314 -0
- package/src/gate/types.ts +141 -7
- package/src/gate/wake-onboarding.ts +309 -0
- package/src/held-writes.ts +49 -60
- package/src/index.ts +9 -2
- package/src/jsonrpc-envelope.ts +81 -0
- package/src/mcpl/channel-registry.ts +353 -85
- package/src/mcpl/checkpoint-manager.ts +3 -2
- package/src/mcpl/feature-set-manager.ts +2 -1
- package/src/mcpl/inbound-source.ts +2 -1
- package/src/mcpl/inference-router.ts +7 -4
- package/src/mcpl/push-coalescer.ts +193 -34
- package/src/mcpl/push-handler.ts +10 -5
- package/src/mcpl/server-connection.ts +141 -60
- package/src/mcpl/tool-classes.ts +3 -0
- package/src/mcpl/types.ts +8 -2
- package/src/module-registry.ts +73 -17
- package/src/modules/discord/index.ts +229 -81
- package/src/modules/history/index.ts +439 -70
- package/src/modules/history/semantic.ts +15 -21
- package/src/modules/workspace/disk-agreement.ts +1 -1
- package/src/modules/workspace/index.ts +85 -23
- package/src/notice-tags.ts +10 -1
- package/src/operator-log.ts +36 -3
- package/src/presentation.ts +1676 -0
- package/src/prose-drafts.ts +16 -12
- package/src/read-marks.ts +328 -0
- package/src/recovery/offline-branch.ts +346 -32
- package/src/recovery/recover-cli.ts +21 -3
- package/src/send-tools.ts +40 -7
- package/src/stored-injections.ts +2 -2
- package/src/stored-removal.ts +31 -7
- package/src/tool-result-guard.ts +41 -7
- package/src/tune-out/coordinator.ts +4089 -457
- package/src/tune-out/tools.ts +160 -43
- package/src/tune-out/window-anchor.ts +277 -0
- package/src/types/agent.ts +86 -20
- package/src/types/events.ts +2 -0
- package/src/types/framework.ts +32 -12
- package/src/types/module.ts +181 -68
- package/src/types/trace.ts +542 -40
package/src/types/agent.ts
CHANGED
|
@@ -330,8 +330,29 @@ export interface AgentConfig {
|
|
|
330
330
|
* - 'disabled': generated prose is never published. Only explicit tools may
|
|
331
331
|
* send externally; prose remains in Chronicle, and a turn that wrote plain
|
|
332
332
|
* speech ends with a private `[delivered] plain speech → no channel` receipt.
|
|
333
|
+
* - 'locked': unprefixed prose goes to one destination the agent chose, on
|
|
334
|
+
* every turn, and nothing moves it automatically: not the channel that
|
|
335
|
+
* woke the turn, not an addressed message, a heartbeat or channel_open.
|
|
336
|
+
* Only the `prose_locus` tool moves it, to a channel or to drafts (held,
|
|
337
|
+
* never posted unless the agent resends them). The choice persists
|
|
338
|
+
* across turns and restarts. Until the agent first makes one,
|
|
339
|
+
* `proseLock` is the destination. It governs routing through the channel
|
|
340
|
+
* registry: a module that handles final speech itself (`onAgentSpeech`,
|
|
341
|
+
* such as the in-process Discord module) receives it in every mode, this
|
|
342
|
+
* one included. See docs/locked-prose-routing.md.
|
|
333
343
|
*/
|
|
334
|
-
proseRouting?: 'locus' | 'explicit' | 'hybrid' | 'disabled';
|
|
344
|
+
proseRouting?: 'locus' | 'explicit' | 'hybrid' | 'disabled' | 'locked';
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Locked mode's destination until the agent chooses one with `prose_locus`:
|
|
348
|
+
* `"#channel"`, `"@person"`, a channel id, or `"drafts"`. Resolved as a
|
|
349
|
+
* `>>` target is, at each turn's start, so a channel its server hasn't
|
|
350
|
+
* registered yet resolves once it has; until it resolves, plain speech is
|
|
351
|
+
* held as drafts. Left out, plain speech is held as drafts until the agent
|
|
352
|
+
* chooses. The agent's own choice, once made, takes its place. Ignored in
|
|
353
|
+
* the other modes.
|
|
354
|
+
*/
|
|
355
|
+
proseLock?: string;
|
|
335
356
|
|
|
336
357
|
/**
|
|
337
358
|
* Stored participants that are this agent's own voice, in addition to its
|
|
@@ -424,6 +445,55 @@ export interface AgentConfig {
|
|
|
424
445
|
* view.
|
|
425
446
|
*/
|
|
426
447
|
clock?: import('../clock-rows.js').ClockConfig;
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* Keep the rows that open a turn raw for the whole turn (on when left out):
|
|
451
|
+
* at a start that opens a turn, the framework pins raw the rows of the
|
|
452
|
+
* agent's window after its newest own message and its consumed mark
|
|
453
|
+
* (`pinRange`, named `agent-framework:turn-inputs`; the README says
|
|
454
|
+
* which rows exactly), and removes the pin when the turn ends, so the
|
|
455
|
+
* strategy doesn't compress the rows the turn opened with while it runs,
|
|
456
|
+
* unless a committing compile refuses as over budget with it held: the
|
|
457
|
+
* pin is then removed and the compile runs once more (README). `false` places no pin:
|
|
458
|
+
* the turn's opening rows are compressed as any others, and a pin of the
|
|
459
|
+
* name left from before (a crash's) is removed at the next start that opens
|
|
460
|
+
* a turn, as a silent start removes one.
|
|
461
|
+
*/
|
|
462
|
+
turnInputsPin?: boolean;
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* The other configured agents whose own rows this agent's window takes
|
|
466
|
+
* (none when left out). Residents share one slot, and each is shown only
|
|
467
|
+
* its own rows and the rows meant for it: another resident's rounds,
|
|
468
|
+
* replies, tool results and notes stay out of its window (#291, decision
|
|
469
|
+
* 1; rows an earlier release stored carry no stamp and stay in the window
|
|
470
|
+
* written down from the record: 291-presentation-mandatory). A name here
|
|
471
|
+
* is an observe edge in this agent's registry record, on
|
|
472
|
+
* that agent (`{ agent: name }`, the path the subconscious's edge takes),
|
|
473
|
+
* and the presentation index presents that agent's own rows to this one
|
|
474
|
+
* at its points, as it does any arrival (bearingOf); the history tools
|
|
475
|
+
* leave them in for its calls (ModuleContext.observes). That agent's own
|
|
476
|
+
* rows this one's window doesn't hold yet, those stored before the edge
|
|
477
|
+
* was declared included, enter it at its next presentation point, after
|
|
478
|
+
* what it holds: an edge declared on a store with history hands the
|
|
479
|
+
* observer that agent's earlier rows at once, at the end of its window
|
|
480
|
+
* (`ObserveEdge.fromMessageId`, which would start the edge at a row, is
|
|
481
|
+
* read by nothing yet). Only own rows: mail and channel traffic meant for that agent, and its stored
|
|
482
|
+
* context injections, stay out. One way: `nova` observing `mira` shows
|
|
483
|
+
* nova mira's rows, not mira nova's. `create()` refuses a name that is
|
|
484
|
+
* this agent's own or no configured agent's. Read when a configured agent
|
|
485
|
+
* is created; a derived agent's spec carries its own edges.
|
|
486
|
+
*/
|
|
487
|
+
observes?: string[];
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* How the rounds of an agent it observes (`observes`) go out in this
|
|
491
|
+
* agent's requests, as `PersistentReaderConfig.foreignRounds` for the
|
|
492
|
+
* persistent subconscious: `'transcript'` (the default), a line per tool
|
|
493
|
+
* call and per result and none of their thinking, or `'raw'`, as stored.
|
|
494
|
+
* Unread for an agent that observes no one.
|
|
495
|
+
*/
|
|
496
|
+
foreignRounds?: 'transcript' | 'raw';
|
|
427
497
|
}
|
|
428
498
|
|
|
429
499
|
/** The intentionally small set of agent settings that may change in-process. */
|
|
@@ -578,22 +648,19 @@ export interface InferenceRequest {
|
|
|
578
648
|
* all of them without materializing content, the turn has no cause left
|
|
579
649
|
* and does not run. */
|
|
580
650
|
coalescingBatchSubjects?: string[];
|
|
581
|
-
/** Host-owned: this wake's sole cause is this
|
|
582
|
-
*
|
|
651
|
+
/** Host-owned: this wake's sole cause is this row, by the stored row's
|
|
652
|
+
* id: one stored for its agent as it arrived, or one stored and not
|
|
653
|
+
* presented to its agent at its write, because a turn of the agent's was
|
|
654
|
+
* alive: a coalesced render its turn being assembled doesn't read
|
|
583
655
|
* (wakeToRead), or a message, notice or event whose wake was queued with
|
|
584
|
-
* it. Once a request that carried the
|
|
585
|
-
*
|
|
586
|
-
*
|
|
587
|
-
*
|
|
588
|
-
*
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
* request that carried the message was answered and, for a wake that
|
|
593
|
-
* carries a channel and isn't marked `ambient`, the agent has since
|
|
594
|
-
* published into that channel having read it, or once the message isn't
|
|
595
|
-
* on its store's current branch, the wake starts no turn. */
|
|
596
|
-
readsStoredMessage?: string;
|
|
656
|
+
* it. Once a request that carried the row was answered (an answered
|
|
657
|
+
* request's consumed watermark covers it, in the agent's window once its
|
|
658
|
+
* context presents rows) and, for a wake that carries a channel and isn't
|
|
659
|
+
* marked `ambient`, the agent has since published into that channel
|
|
660
|
+
* having read it, or once the row is not on its store's current branch,
|
|
661
|
+
* the wake starts no turn. A row stored and not yet presented to the
|
|
662
|
+
* agent keeps its wake. */
|
|
663
|
+
readsRow?: string;
|
|
597
664
|
agentName: string;
|
|
598
665
|
reason: string;
|
|
599
666
|
source: string;
|
|
@@ -653,10 +720,9 @@ export interface InferenceRequest {
|
|
|
653
720
|
* (`chat:ambient`). A coalesced push's wake carries it only to read a
|
|
654
721
|
* render, and only when every notice the render stands for was. Such a
|
|
655
722
|
* message asked nothing of the agent, so a wake for it that carries
|
|
656
|
-
* `
|
|
657
|
-
*
|
|
658
|
-
*
|
|
659
|
-
* addressed one.
|
|
723
|
+
* `readsRow` is dropped once a request that carried the message
|
|
724
|
+
* was answered, with no publish asked of the agent. A message with neither
|
|
725
|
+
* tag is in doubt, and is judged as an addressed one.
|
|
660
726
|
*/
|
|
661
727
|
ambient?: true;
|
|
662
728
|
/**
|
package/src/types/events.ts
CHANGED
|
@@ -349,6 +349,8 @@ export interface ToolCall {
|
|
|
349
349
|
* Converted from wire-format McplContentBlock to membrane ContentBlock.
|
|
350
350
|
*/
|
|
351
351
|
export interface McplPushEvent {
|
|
352
|
+
/** The occurrence's suppression, when a coalesced push's wake decided it (CoalescedOccurrence.suppressionDecision). */
|
|
353
|
+
suppressionDecision?: string | null;
|
|
352
354
|
type: 'mcpl:push-event';
|
|
353
355
|
serverId: string;
|
|
354
356
|
featureSet: string;
|
package/src/types/framework.ts
CHANGED
|
@@ -169,16 +169,14 @@ export interface FrameworkConfig {
|
|
|
169
169
|
subconscious?: import('../tune-out/tools.js').SubconsciousConfig;
|
|
170
170
|
|
|
171
171
|
/**
|
|
172
|
-
* Tune-out
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
* a reader
|
|
177
|
-
*
|
|
172
|
+
* Tune-out settings. Residents are offered `tune_out` only with a reader
|
|
173
|
+
* (`subconscious`), or while a hold a failed release left is still on
|
|
174
|
+
* record to check or cancel: a hold nothing summarizes would hand the resident an
|
|
175
|
+
* undated backlog all at once when it ends. `enabled`, which offered one
|
|
176
|
+
* without a reader, was removed in 0.33.0: `enabled: true` is refused at
|
|
177
|
+
* `create` (`false` is still accepted, from JavaScript, and does nothing).
|
|
178
178
|
*/
|
|
179
179
|
tuneOut?: {
|
|
180
|
-
/** Offer `tune_out` without a subconscious. Default: only with one. */
|
|
181
|
-
enabled?: boolean;
|
|
182
180
|
/**
|
|
183
181
|
* Announce the all-except scope in the excepted channel: one bracketed
|
|
184
182
|
* line under the resident's name when it opens (who, for how long) and
|
|
@@ -202,7 +200,9 @@ export interface FrameworkConfig {
|
|
|
202
200
|
* inbound message is a global fallback locus for turns without one, and
|
|
203
201
|
* an addressed message injected mid-turn re-pins the turn's locus.
|
|
204
202
|
*
|
|
205
|
-
* Held traffic never moves the locus under either rule.
|
|
203
|
+
* Held traffic never moves the locus under either rule. Neither rule
|
|
204
|
+
* applies to an agent under locked prose routing (AgentConfig.proseRouting
|
|
205
|
+
* 'locked'): its turns speak at its lock, whatever arrives.
|
|
206
206
|
*/
|
|
207
207
|
speech?: {
|
|
208
208
|
locus?: 'delivery' | 'latest-inbound';
|
|
@@ -239,9 +239,29 @@ export interface FrameworkConfig {
|
|
|
239
239
|
hostModePath?: string;
|
|
240
240
|
|
|
241
241
|
/**
|
|
242
|
-
*
|
|
243
|
-
*
|
|
244
|
-
*
|
|
242
|
+
* Where a release before #291 kept its durable queue of deferred context
|
|
243
|
+
* writes. Defaults to `<storePath>/recovery/deferred-writes.json`; without
|
|
244
|
+
* either, the store's `framework/deferred-writes` slot. This release keeps
|
|
245
|
+
* no durable queue: a write is stored when it is made, and enters each
|
|
246
|
+
* agent's window at that agent's presentation points. Two holds keep a
|
|
247
|
+
* write in memory instead, and a crash loses it: a live operator surgery
|
|
248
|
+
* (a rollback, a suppression, a branch switch), until its release stores
|
|
249
|
+
* it, and an agent's context manager refusing its work after a failed
|
|
250
|
+
* re-initialization, until a branch move (switchBranch, a rollback or a
|
|
251
|
+
* suppression) re-initializes it.
|
|
252
|
+
*
|
|
253
|
+
* create() reads the record once and stores its writes. A write for an
|
|
254
|
+
* agent no longer registered goes to the primary when it is a failed
|
|
255
|
+
* reply, a channel notice its reader could act on, or a module's write
|
|
256
|
+
* for a run or a fork, and is dropped otherwise, logged. It then rewrites
|
|
257
|
+
* the record with what it left for the next boot: a write it couldn't
|
|
258
|
+
* store, or couldn't tell had already landed, with that agent's later
|
|
259
|
+
* writes. A write the store refuses as malformed is dropped, logged, as an
|
|
260
|
+
* earlier release's flush dropped it. When the store doesn't sync after
|
|
261
|
+
* the import, the record is left as it was.
|
|
262
|
+
*
|
|
263
|
+
* @deprecated Read once at boot by the deferred-write importer; removed in
|
|
264
|
+
* the next release.
|
|
245
265
|
*/
|
|
246
266
|
deferredWritesPath?: string;
|
|
247
267
|
|
package/src/types/module.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { ContentBlock } from '@animalabs/membrane';
|
|
2
2
|
import type {
|
|
3
|
+
ContextManager,
|
|
3
4
|
MessageId,
|
|
4
5
|
MessageMetadata,
|
|
5
6
|
StoredMessage,
|
|
6
7
|
ContextInjection,
|
|
8
|
+
WindowStatus,
|
|
7
9
|
} from '@animalabs/context-manager';
|
|
8
10
|
import type { ProcessEvent, ToolDefinition, ToolCall, ToolResult } from './events.js';
|
|
9
11
|
import type { TraceEventListener } from './trace.js';
|
|
@@ -49,44 +51,54 @@ export interface MessageQuery {
|
|
|
49
51
|
export type ModuleContextInjection = ContextInjection & { placedEachCompile?: true };
|
|
50
52
|
|
|
51
53
|
/**
|
|
52
|
-
* A message as a module context's reads answer it: a stored row,
|
|
53
|
-
*
|
|
54
|
-
* `heldFromResidents` when a tune-out holds it from the
|
|
54
|
+
* A message as a module context's reads answer it: a stored row, marked
|
|
55
|
+
* `held` when it isn't in the window of the agent the read is for, and
|
|
56
|
+
* `heldFromResidents` when a tune-out or a suppress rule holds it from the
|
|
57
|
+
* residents.
|
|
55
58
|
*/
|
|
56
59
|
export type ModuleMessage = StoredMessage & {
|
|
57
60
|
/**
|
|
58
|
-
* True
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
61
|
+
* True on a row stored and not in the window of the agent the read is for
|
|
62
|
+
* (#291's presentation index): it arrived while that agent's turn was
|
|
63
|
+
* alive, or while the host was quiesced, and enters the window at the
|
|
64
|
+
* agent's next presentation point (a turn's start, a tool boundary that
|
|
65
|
+
* can carry it, a turn's end, or at once while no turn of it is alive);
|
|
66
|
+
* or it was taken out of the window as an undone turn's; or it is never
|
|
67
|
+
* presented to that agent, as a held message is to a resident. Set only
|
|
68
|
+
* once that agent's window is written down (presented mode); a held
|
|
69
|
+
* message an earlier release stored is in a resident's window written
|
|
70
|
+
* down from the record, so it reads without `held`, and
|
|
71
|
+
* `heldFromResidents` is what marks it. Its `id`,
|
|
72
|
+
* `sequence` and `timestamp` are the store's, as for any row: since #291
|
|
73
|
+
* every write is stored at once, so no row is a handle and nothing
|
|
74
|
+
* changes when it enters the window. Before #291 the same name marked a
|
|
75
|
+
* write the framework still held, under a `held:` handle; see the
|
|
76
|
+
* changelog. Absent on a row the window holds.
|
|
69
77
|
*/
|
|
70
78
|
held?: true;
|
|
71
79
|
/**
|
|
72
80
|
* True on a message a tune-out holds from the residents: one that arrived
|
|
73
81
|
* in a tuned-out channel, stamped `metadata.tuneOut` as it came in. The
|
|
74
82
|
* store keeps it, but no resident is shown the row itself: no resident's
|
|
75
|
-
* compiled view includes it, during the tune-out or after it
|
|
76
|
-
* resident's tool boundary of a turn alive
|
|
77
|
-
*
|
|
83
|
+
* compiled view includes it, during the tune-out or after it. It is
|
|
84
|
+
* stored as any write is, and a resident's tool boundary of a turn alive
|
|
85
|
+
* when it arrived doesn't inject it into the live turn. The subconscious
|
|
86
|
+
* reads it. Its
|
|
78
87
|
* text can still reach a resident in rows of their own, which aren't
|
|
79
88
|
* marked, such as the
|
|
80
89
|
* cancel's `<tuned-out-backlog>` row, with the text of the tune-out's newest
|
|
81
90
|
* messages, up to `backlogCap` of them and as many as fit in one of the
|
|
82
|
-
* residents' messages
|
|
83
|
-
*
|
|
91
|
+
* residents' messages; what the subconscious says of it, in its report or
|
|
92
|
+
* its note; and the
|
|
84
93
|
* result of a tool that reads history on request, such as a
|
|
85
94
|
* channel's `fetch_history` or the history module's `extract`. A module
|
|
86
95
|
* that builds on what the residents see, such as one choosing from the
|
|
87
96
|
* recent conversation, leaves a marked row out, and one that matches
|
|
88
|
-
* what's stored, such as a sync's dedupe, keeps it. A
|
|
89
|
-
* is marked too
|
|
97
|
+
* what's stored, such as a sync's dedupe, keeps it. A row a suppress rule
|
|
98
|
+
* hid (`metadata.suppressed`) is marked too: no view shows it, the
|
|
99
|
+
* subconscious's included, and no window presents it, so once the
|
|
100
|
+
* agent's window is written down it reads `held` too. Absent on every
|
|
101
|
+
* other row.
|
|
90
102
|
*/
|
|
91
103
|
heldFromResidents?: true;
|
|
92
104
|
};
|
|
@@ -95,9 +107,8 @@ export type ModuleMessage = StoredMessage & {
|
|
|
95
107
|
* Result of a message query.
|
|
96
108
|
*/
|
|
97
109
|
export interface MessageQueryResult {
|
|
98
|
-
/** The matching stored rows,
|
|
99
|
-
*
|
|
100
|
-
* in a reversed query */
|
|
110
|
+
/** The matching stored rows, in store order (newest first in a reversed
|
|
111
|
+
* query), each marked as ModuleMessage says. */
|
|
101
112
|
messages: ModuleMessage[];
|
|
102
113
|
totalCount: number;
|
|
103
114
|
}
|
|
@@ -281,9 +292,10 @@ export interface AgentSettingsExtension {
|
|
|
281
292
|
* nothing.
|
|
282
293
|
*
|
|
283
294
|
* Its reads (`getState`, `getLog`, `getLogLength`, `getMessage`,
|
|
284
|
-
* `queryMessages`, `getAgents`, `getActiveTools`, `findMessageByExternalId
|
|
285
|
-
*
|
|
286
|
-
*
|
|
295
|
+
* `queryMessages`, `getAgents`, `getActiveTools`, `findMessageByExternalId`,
|
|
296
|
+
* and the window lookups `windowStatusOf`, `observes`, `viewKeeps` and
|
|
297
|
+
* `agentNameOf` where the framework offers them) answer, and fail, as
|
|
298
|
+
* before. The framework calls none of the
|
|
287
299
|
* module's `onProcess`, `onAgentSpeech` and `onToolBatchComplete` again; it
|
|
288
300
|
* drops whole a response of its that hadn't been applied by then, with a line
|
|
289
301
|
* naming what the response asked for if it asked for anything; and it leaves
|
|
@@ -381,20 +393,44 @@ export interface ModuleContext {
|
|
|
381
393
|
getModule<T extends Module>(name: string): T | null;
|
|
382
394
|
|
|
383
395
|
/**
|
|
384
|
-
* Add a message to the conversation, and answer its id.
|
|
385
|
-
*
|
|
386
|
-
*
|
|
387
|
-
*
|
|
388
|
-
*
|
|
389
|
-
*
|
|
390
|
-
*
|
|
391
|
-
*
|
|
396
|
+
* Add a message to the conversation, and answer its stored id. The write
|
|
397
|
+
* is stored at once, whatever the agent's turn (#291): it enters the
|
|
398
|
+
* agent's window at the agent's next presentation point, or at once while
|
|
399
|
+
* no turn of it is alive, and until then reads mark it `held`
|
|
400
|
+
* (ModuleMessage.held). Only while the write is kept in memory is the id
|
|
401
|
+
* '': while an operator's surgery holds the store, stored at the
|
|
402
|
+
* surgery's end, and while the agent's context manager refuses its work
|
|
403
|
+
* after a failed re-initialization, stored when a switchBranch()
|
|
404
|
+
* re-initializes it (a restart loses it; if the agent ends first, it goes
|
|
405
|
+
* to the primary when it is a write the primary takes in its place).
|
|
406
|
+
* Until it lands, such a write can't be read, edited or removed through
|
|
407
|
+
* this context: it has no id, getMessage, editMessage and removeMessage
|
|
408
|
+
* take none for it, and queryMessages and findMessageByExternalId read
|
|
409
|
+
* the store, which doesn't hold it yet. Its release stores it as it was
|
|
410
|
+
* given here. A module that must change it keeps the change and applies
|
|
411
|
+
* it to the row once the row is stored, which the release traces
|
|
412
|
+
* synchronously as `message:added` with source `surgery-release` and the
|
|
413
|
+
* stored id, as the Discord module does for an edit or a delete of a
|
|
414
|
+
* message whose create was kept.
|
|
415
|
+
* Writes a release before #291 held and kept across a restart are
|
|
416
|
+
* stored once create() imports them, which is after every module's
|
|
417
|
+
* start().
|
|
418
|
+
* A write whose store throws after rows of it landed is answered by the
|
|
419
|
+
* first of them, as stored (context-manager's WriteLandedError names
|
|
420
|
+
* them). One whose store throws where the store can't be read to tell
|
|
421
|
+
* what of it landed throws context-manager's WriteOutcomeUnknownError,
|
|
422
|
+
* which names the rows it knows are stored (`landed`, presented as a
|
|
423
|
+
* stored write's rows are) and counts those it can't (`unknown`,
|
|
424
|
+
* `unnamed`): the write may be stored, in part or whole, or not at all,
|
|
425
|
+
* and isn't answered as stored. A read of the store tells, once the store
|
|
426
|
+
* reads: queryMessages, or findMessageByExternalId for a write that
|
|
427
|
+
* carried `metadata.external`. Any other error means none of it is stored.
|
|
392
428
|
*
|
|
393
429
|
* With `opts.forAgent`, it's added to the named agent's window instead: a
|
|
394
430
|
* conversation fork's or a running sub-agent's own store, or, for an
|
|
395
|
-
* ordinary resident, the residents' shared slot. It
|
|
396
|
-
* agent's
|
|
397
|
-
* primary's
|
|
431
|
+
* ordinary resident, the residents' shared slot. It enters that agent's
|
|
432
|
+
* window at that agent's points, as a write for the primary does at the
|
|
433
|
+
* primary's. A name that isn't a registered agent when the write is
|
|
398
434
|
* made, or the empty name, throws, naming the registered ones, so a write
|
|
399
435
|
* for a launcher that has gone is heard. For an ephemeral run (a
|
|
400
436
|
* sub-agent's run) or a conversation fork, whose window nothing reads
|
|
@@ -413,12 +449,17 @@ export interface ModuleContext {
|
|
|
413
449
|
* failed reply, or a channel notice its reader could act on). getMessage,
|
|
414
450
|
* editMessage and removeMessage read the delivery agent's window (the
|
|
415
451
|
* primary's, or the first agent's when none is primary): they don't take
|
|
416
|
-
* an id
|
|
452
|
+
* an id for a row in a fork's or a sub-agent's window, and don't
|
|
417
453
|
* find it (read it with queryMessages and the same forAgent). The
|
|
418
454
|
* residents' shared slot is the primary's window too, for a primary
|
|
419
455
|
* that's an ordinary resident, so there they do.
|
|
420
456
|
* `metadata.external` with a target throws: its id map is read in the
|
|
421
|
-
* primary's window.
|
|
457
|
+
* primary's window. The row is stamped (`metadata.audience`, #291) for
|
|
458
|
+
* the agent named, or, with no agent named, for the agents that take
|
|
459
|
+
* untargeted inbound in the slot it lands in: every resident on a
|
|
460
|
+
* residents' host. A row a suppress rule took is stamped for nobody, and
|
|
461
|
+
* one carrying a tune-out's hold for nobody but a named agent whose view
|
|
462
|
+
* keeps held traffic (the persistent subconscious).
|
|
422
463
|
*/
|
|
423
464
|
addMessage(
|
|
424
465
|
participant: string,
|
|
@@ -428,48 +469,53 @@ export interface ModuleContext {
|
|
|
428
469
|
): MessageId;
|
|
429
470
|
|
|
430
471
|
/**
|
|
431
|
-
* Edit a message, by its id
|
|
432
|
-
*
|
|
433
|
-
*
|
|
434
|
-
*
|
|
472
|
+
* Edit a stored message, by its id. An edit of a row an agent's window
|
|
473
|
+
* holds changes what that agent's next compile sends, as for any stored
|
|
474
|
+
* row. For one release it also takes the `held:` handle a release before
|
|
475
|
+
* #291 answered for a write it held, and edits the row that write landed
|
|
476
|
+
* as.
|
|
435
477
|
*/
|
|
436
478
|
editMessage(id: MessageId, content: ContentBlock[]): void;
|
|
437
479
|
|
|
438
480
|
/**
|
|
439
|
-
* Remove a message, by its id
|
|
440
|
-
*
|
|
441
|
-
*
|
|
442
|
-
* with nothing changed.
|
|
481
|
+
* Remove a stored message, by its id. For one release it also takes the
|
|
482
|
+
* `held:` handle a release before #291 answered for a write it held, and
|
|
483
|
+
* removes the row that write landed as.
|
|
443
484
|
*/
|
|
444
485
|
removeMessage(id: MessageId): void;
|
|
445
486
|
|
|
446
487
|
/**
|
|
447
488
|
* Find the message for an external ID this context added a message under:
|
|
448
|
-
* the row it added, while the store holds it. For a write
|
|
449
|
-
*
|
|
450
|
-
*
|
|
451
|
-
*
|
|
452
|
-
*
|
|
453
|
-
*
|
|
489
|
+
* the row it added, while the store holds it. For a write whose id this
|
|
490
|
+
* context doesn't keep (one kept in memory, by an operator's surgery or
|
|
491
|
+
* for its agent's recovery, one whose store threw where context-manager
|
|
492
|
+
* couldn't tell whether it landed (WriteOutcomeUnknownError), or one a
|
|
493
|
+
* release before #291 held, whose map it kept as ''), the first row the
|
|
494
|
+
* store shows under that external ID. Null when this context added none under
|
|
495
|
+
* it, when the row it added is gone, or when the store shows none for
|
|
496
|
+
* such a write, as for one an earlier release left queued, looked up in
|
|
497
|
+
* start() before create() imports it.
|
|
454
498
|
*/
|
|
455
499
|
findMessageByExternalId(source: string, externalId: string): MessageId | null;
|
|
456
500
|
|
|
457
501
|
/**
|
|
458
|
-
* Get a message by its id
|
|
459
|
-
*
|
|
460
|
-
*
|
|
502
|
+
* Get a stored message by its id, marked as ModuleMessage says: `held`
|
|
503
|
+
* when it isn't in the delivery agent's window, `heldFromResidents` when a
|
|
504
|
+
* tune-out or a suppress rule holds it from the residents. For one release
|
|
505
|
+
* it also takes the `held:` handle a release before #291 answered, and
|
|
506
|
+
* gives the row that write landed as.
|
|
461
507
|
*/
|
|
462
508
|
getMessage(id: MessageId): ModuleMessage | null;
|
|
463
509
|
|
|
464
510
|
/**
|
|
465
511
|
* Query messages by filter criteria.
|
|
466
512
|
* Useful for finding messages from external sources, by participant, etc.
|
|
467
|
-
* The rows
|
|
468
|
-
* the
|
|
469
|
-
*
|
|
470
|
-
*
|
|
471
|
-
*
|
|
472
|
-
*
|
|
513
|
+
* The rows come in store order, each marked as ModuleMessage says: `held`
|
|
514
|
+
* when it isn't in the window of the agent the read is for (stored and not
|
|
515
|
+
* yet presented to it, or undone), and `heldFromResidents` when a tune-out
|
|
516
|
+
* or a suppress rule holds it from the residents. Writes a release before
|
|
517
|
+
* #291 left queued show once create() has imported them, after every
|
|
518
|
+
* module's start() (addMessage).
|
|
473
519
|
*
|
|
474
520
|
* It reads the primary's window (the first registered agent's when none
|
|
475
521
|
* is primary), or with `opts.forAgent`, the named agent's: a conversation
|
|
@@ -482,6 +528,67 @@ export interface ModuleContext {
|
|
|
482
528
|
*/
|
|
483
529
|
queryMessages(filter: MessageQuery, opts?: { forAgent?: string }): MessageQueryResult;
|
|
484
530
|
|
|
531
|
+
/**
|
|
532
|
+
* Where a stored row stands with an agent's window (#291), the rows its
|
|
533
|
+
* requests are given, before its view's filter (context-manager's
|
|
534
|
+
* `windowStatusOf`): `'in'` when the window holds it, which is every row
|
|
535
|
+
* its record holds while the window is still the record; `'undone'` when
|
|
536
|
+
* it was taken out as an undone turn's, or shed after a refusal; `'out'`
|
|
537
|
+
* when it is stored and not in the window (not presented to the agent
|
|
538
|
+
* yet, or taken back to arrived); `'absent'` when the agent's record
|
|
539
|
+
* doesn't hold it (removed, never stored on its branch, or in a slot it
|
|
540
|
+
* doesn't read). For the delivery agent (the primary's, or the first
|
|
541
|
+
* agent's when none is primary), or with `opts.forAgent`, the named
|
|
542
|
+
* agent, which must be registered, as for queryMessages: a name that
|
|
543
|
+
* isn't throws. A tool that reads the record for an agent, such as the
|
|
544
|
+
* history module's, says with it, and with viewKeeps, which of the rows it
|
|
545
|
+
* returns the agent isn't being shown.
|
|
546
|
+
*
|
|
547
|
+
* Optional: a framework from before the presentation index, or a host's
|
|
548
|
+
* own context, doesn't offer it. Call as `ctx.windowStatusOf?.(...)`.
|
|
549
|
+
*/
|
|
550
|
+
windowStatusOf?(id: MessageId, opts?: { forAgent?: string }): WindowStatus;
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* Whether `observer` reads `observed`'s own rows through an observe edge
|
|
554
|
+
* (dendrite's relationships): one of its edges reads another slot
|
|
555
|
+
* `observed` owns, or names `observed` and reads the observer's own slot
|
|
556
|
+
* (a resident's `AgentConfig.observes`). Seeing another agent's rounds is
|
|
557
|
+
* a declared relationship (#291, decision 1): an observe edge, which a
|
|
558
|
+
* resident's configuration declares with `observes`, so a tool that reads
|
|
559
|
+
* the record for an agent leaves out another agent's own rows it isn't
|
|
560
|
+
* shown unless this is true.
|
|
561
|
+
* False for a name the registry doesn't know. Optional, as
|
|
562
|
+
* windowStatusOf is, and offered with it.
|
|
563
|
+
*/
|
|
564
|
+
observes?(observer: string, observed: string): boolean;
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* Whether an agent's view keeps a stored row (#291): whether its requests
|
|
568
|
+
* carry the row, as its strategy renders it (a row it has folded, as that
|
|
569
|
+
* summary), while its window holds it. windowStatusOf answers before
|
|
570
|
+
* the view's filter, and a window written down from the record the
|
|
571
|
+
* residents share can hold rows the view never sends: another agent's
|
|
572
|
+
* stored context injection, and, for an agent whose view leaves held
|
|
573
|
+
* traffic out (a resident), a row a tune-out holds from the residents. A
|
|
574
|
+
* row the agent is shown is one windowStatusOf reads `'in'` and this
|
|
575
|
+
* keeps. It reads the view the agent's context was opened with
|
|
576
|
+
* (context-options.ts), for the delivery agent, or with `opts.forAgent`
|
|
577
|
+
* the named agent, which must be registered, as for windowStatusOf: a name
|
|
578
|
+
* that isn't throws. Optional, as windowStatusOf is, and offered with it.
|
|
579
|
+
*/
|
|
580
|
+
viewKeeps?(row: StoredMessage, opts?: { forAgent?: string }): boolean;
|
|
581
|
+
|
|
582
|
+
/**
|
|
583
|
+
* The live agent whose context `contextManager` is (the one its
|
|
584
|
+
* `getContextManager()` returns), or undefined when it is no live
|
|
585
|
+
* agent's (#291). A module a host binds to an agent's context, as it binds
|
|
586
|
+
* the history module, reads that context's record and summaries; this
|
|
587
|
+
* says whose they are, so another agent's call can be told from that
|
|
588
|
+
* agent's own. Optional, as windowStatusOf is, and offered with it.
|
|
589
|
+
*/
|
|
590
|
+
agentNameOf?(contextManager: ContextManager): string | undefined;
|
|
591
|
+
|
|
485
592
|
/**
|
|
486
593
|
* Get info about all agents.
|
|
487
594
|
*/
|
|
@@ -649,19 +756,25 @@ export type AgentStatus = 'idle' | 'inferring' | 'streaming' | 'waiting_for_tool
|
|
|
649
756
|
*/
|
|
650
757
|
export interface EventResponse {
|
|
651
758
|
/**
|
|
652
|
-
* Messages to add to the conversation.
|
|
759
|
+
* Messages to add to the conversation. Each row says who it is for in
|
|
760
|
+
* `metadata.audience` (#291): the agents a `requestInference` list names
|
|
761
|
+
* that are registered and read the slot the row lands in (the agent the
|
|
762
|
+
* row is delivered to, when none of them is registered); for `true`, no
|
|
763
|
+
* request, or a list whose registered agents don't read that slot (an
|
|
764
|
+
* isolated job, a conversation fork), as for any write that names no
|
|
765
|
+
* agent, the agents that take untargeted inbound in the slot it lands in
|
|
766
|
+
* (every resident on a residents' host). A message that carries a
|
|
767
|
+
* tune-out's hold is for nobody.
|
|
653
768
|
*/
|
|
654
769
|
addMessages?: NewMessage[];
|
|
655
770
|
|
|
656
771
|
/**
|
|
657
|
-
* Messages to edit, each by its id
|
|
658
|
-
* (ModuleContext.editMessage).
|
|
772
|
+
* Messages to edit, each by its stored id (ModuleContext.editMessage).
|
|
659
773
|
*/
|
|
660
774
|
editMessages?: MessageEdit[];
|
|
661
775
|
|
|
662
776
|
/**
|
|
663
|
-
* Messages to remove, each by its id
|
|
664
|
-
* (ModuleContext.removeMessage).
|
|
777
|
+
* Messages to remove, each by its stored id (ModuleContext.removeMessage).
|
|
665
778
|
*/
|
|
666
779
|
removeMessages?: MessageId[];
|
|
667
780
|
|