@animalabs/agent-framework 0.27.0 → 0.29.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 +145 -41
- package/dist/src/agent.d.ts +29 -2
- package/dist/src/agent.d.ts.map +1 -1
- package/dist/src/agent.js +73 -12
- 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 +3 -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 +11 -5
- package/dist/src/api/server.js.map +1 -1
- package/dist/src/auto-continue.d.ts +5 -2
- package/dist/src/auto-continue.d.ts.map +1 -1
- package/dist/src/auto-continue.js +9 -5
- package/dist/src/auto-continue.js.map +1 -1
- package/dist/src/code-execution/isolate/runner.d.ts +7 -5
- package/dist/src/code-execution/isolate/runner.d.ts.map +1 -1
- package/dist/src/code-execution/isolate/runner.js +7 -5
- package/dist/src/code-execution/isolate/runner.js.map +1 -1
- package/dist/src/code-execution/isolate/scripts.d.ts.map +1 -1
- package/dist/src/code-execution/isolate/scripts.js +3 -2
- package/dist/src/code-execution/isolate/scripts.js.map +1 -1
- package/dist/src/cut-off-round.d.ts +24 -0
- package/dist/src/cut-off-round.d.ts.map +1 -0
- package/dist/src/cut-off-round.js +87 -0
- package/dist/src/cut-off-round.js.map +1 -0
- package/dist/src/framework.d.ts +468 -125
- package/dist/src/framework.d.ts.map +1 -1
- package/dist/src/framework.js +3651 -1111
- package/dist/src/framework.js.map +1 -1
- package/dist/src/gate/event-gate.d.ts +133 -13
- package/dist/src/gate/event-gate.d.ts.map +1 -1
- package/dist/src/gate/event-gate.js +654 -59
- package/dist/src/gate/event-gate.js.map +1 -1
- package/dist/src/gate/index.d.ts +3 -2
- package/dist/src/gate/index.d.ts.map +1 -1
- package/dist/src/gate/index.js +2 -1
- package/dist/src/gate/index.js.map +1 -1
- package/dist/src/gate/reply-judge.d.ts +116 -0
- package/dist/src/gate/reply-judge.d.ts.map +1 -0
- package/dist/src/gate/reply-judge.js +467 -0
- package/dist/src/gate/reply-judge.js.map +1 -0
- package/dist/src/gate/types.d.ts +173 -2
- package/dist/src/gate/types.d.ts.map +1 -1
- package/dist/src/heartbeat/heartbeat.d.ts +202 -0
- package/dist/src/heartbeat/heartbeat.d.ts.map +1 -0
- package/dist/src/heartbeat/heartbeat.js +778 -0
- package/dist/src/heartbeat/heartbeat.js.map +1 -0
- package/dist/src/heartbeat/reminder-time.d.ts +5 -0
- package/dist/src/heartbeat/reminder-time.d.ts.map +1 -0
- package/dist/src/heartbeat/reminder-time.js +107 -0
- package/dist/src/heartbeat/reminder-time.js.map +1 -0
- package/dist/src/held-writes.d.ts +3 -3
- package/dist/src/held-writes.js +3 -3
- package/dist/src/host-presentation.d.ts +170 -0
- package/dist/src/host-presentation.d.ts.map +1 -0
- package/dist/src/host-presentation.js +561 -0
- package/dist/src/host-presentation.js.map +1 -0
- package/dist/src/index.d.ts +5 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/line-reader.d.ts +4 -0
- package/dist/src/line-reader.d.ts.map +1 -0
- package/dist/src/line-reader.js +59 -0
- package/dist/src/line-reader.js.map +1 -0
- package/dist/src/mcpl/capability-mask.d.ts.map +1 -1
- package/dist/src/mcpl/capability-mask.js +3 -2
- package/dist/src/mcpl/capability-mask.js.map +1 -1
- package/dist/src/mcpl/channel-registry.d.ts +34 -6
- package/dist/src/mcpl/channel-registry.d.ts.map +1 -1
- package/dist/src/mcpl/channel-registry.js +133 -54
- package/dist/src/mcpl/channel-registry.js.map +1 -1
- package/dist/src/mcpl/conversation-router.d.ts.map +1 -1
- package/dist/src/mcpl/conversation-router.js +2 -1
- package/dist/src/mcpl/conversation-router.js.map +1 -1
- package/dist/src/mcpl/convert-block.d.ts +1 -0
- package/dist/src/mcpl/convert-block.d.ts.map +1 -1
- package/dist/src/mcpl/convert-block.js +16 -4
- package/dist/src/mcpl/convert-block.js.map +1 -1
- package/dist/src/mcpl/hook-orchestrator.d.ts.map +1 -1
- package/dist/src/mcpl/hook-orchestrator.js +4 -3
- package/dist/src/mcpl/hook-orchestrator.js.map +1 -1
- package/dist/src/mcpl/inbound-source.d.ts +29 -11
- package/dist/src/mcpl/inbound-source.d.ts.map +1 -1
- package/dist/src/mcpl/inbound-source.js +43 -70
- package/dist/src/mcpl/inbound-source.js.map +1 -1
- package/dist/src/mcpl/modern-connection.d.ts.map +1 -1
- package/dist/src/mcpl/modern-connection.js +11 -7
- package/dist/src/mcpl/modern-connection.js.map +1 -1
- package/dist/src/mcpl/protocol-family.d.ts +3 -2
- package/dist/src/mcpl/protocol-family.d.ts.map +1 -1
- package/dist/src/mcpl/protocol-family.js +25 -3
- package/dist/src/mcpl/protocol-family.js.map +1 -1
- package/dist/src/mcpl/push-handler.js +2 -2
- package/dist/src/mcpl/push-handler.js.map +1 -1
- package/dist/src/mcpl/references.d.ts +12 -40
- package/dist/src/mcpl/references.d.ts.map +1 -1
- package/dist/src/mcpl/references.js +29 -23
- package/dist/src/mcpl/references.js.map +1 -1
- package/dist/src/mcpl/server-connection.d.ts +18 -8
- package/dist/src/mcpl/server-connection.d.ts.map +1 -1
- package/dist/src/mcpl/server-connection.js +70 -30
- package/dist/src/mcpl/server-connection.js.map +1 -1
- package/dist/src/mcpl/skip-reply-wake.d.ts +25 -0
- package/dist/src/mcpl/skip-reply-wake.d.ts.map +1 -1
- package/dist/src/mcpl/skip-reply-wake.js +25 -0
- package/dist/src/mcpl/skip-reply-wake.js.map +1 -1
- package/dist/src/mcpl/tags.d.ts +9 -2
- package/dist/src/mcpl/tags.d.ts.map +1 -1
- package/dist/src/mcpl/tags.js +12 -2
- package/dist/src/mcpl/tags.js.map +1 -1
- package/dist/src/mcpl/tool-presence.d.ts +66 -14
- package/dist/src/mcpl/tool-presence.d.ts.map +1 -1
- package/dist/src/mcpl/tool-presence.js +150 -80
- package/dist/src/mcpl/tool-presence.js.map +1 -1
- package/dist/src/mcpl/tool-signature.d.ts +10 -3
- package/dist/src/mcpl/tool-signature.d.ts.map +1 -1
- package/dist/src/mcpl/tool-signature.js +60 -30
- package/dist/src/mcpl/tool-signature.js.map +1 -1
- package/dist/src/mcpl/toolset-host.d.ts +88 -55
- package/dist/src/mcpl/toolset-host.d.ts.map +1 -1
- package/dist/src/mcpl/toolset-host.js +220 -111
- package/dist/src/mcpl/toolset-host.js.map +1 -1
- package/dist/src/mcpl/toolsets-module.d.ts +27 -35
- package/dist/src/mcpl/toolsets-module.d.ts.map +1 -1
- package/dist/src/mcpl/toolsets-module.js +313 -91
- package/dist/src/mcpl/toolsets-module.js.map +1 -1
- package/dist/src/mcpl/transport.d.ts +1 -1
- package/dist/src/mcpl/transport.d.ts.map +1 -1
- package/dist/src/mcpl/transport.js +16 -16
- package/dist/src/mcpl/transport.js.map +1 -1
- package/dist/src/mcpl/types.d.ts +31 -13
- 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 +10 -8
- package/dist/src/module-registry.d.ts.map +1 -1
- package/dist/src/module-registry.js +15 -9
- package/dist/src/module-registry.js.map +1 -1
- package/dist/src/modules/api/index.d.ts.map +1 -1
- package/dist/src/modules/api/index.js +4 -2
- package/dist/src/modules/api/index.js.map +1 -1
- package/dist/src/modules/discord/index.d.ts.map +1 -1
- package/dist/src/modules/discord/index.js +33 -25
- package/dist/src/modules/discord/index.js.map +1 -1
- package/dist/src/modules/history/index.d.ts.map +1 -1
- package/dist/src/modules/history/index.js +30 -17
- package/dist/src/modules/history/index.js.map +1 -1
- package/dist/src/modules/sender-name.d.ts +7 -0
- package/dist/src/modules/sender-name.d.ts.map +1 -0
- package/dist/src/modules/sender-name.js +10 -0
- package/dist/src/modules/sender-name.js.map +1 -0
- package/dist/src/modules/workspace/answers.d.ts +26 -0
- package/dist/src/modules/workspace/answers.d.ts.map +1 -0
- package/dist/src/modules/workspace/answers.js +138 -0
- package/dist/src/modules/workspace/answers.js.map +1 -0
- package/dist/src/modules/workspace/branch-intent.d.ts +5 -3
- package/dist/src/modules/workspace/branch-intent.d.ts.map +1 -1
- package/dist/src/modules/workspace/branch-intent.js +6 -2
- package/dist/src/modules/workspace/branch-intent.js.map +1 -1
- package/dist/src/modules/workspace/direct-write.d.ts +3 -0
- package/dist/src/modules/workspace/direct-write.d.ts.map +1 -1
- package/dist/src/modules/workspace/direct-write.js +59 -24
- package/dist/src/modules/workspace/direct-write.js.map +1 -1
- package/dist/src/modules/workspace/disk-agreement.d.ts +33 -11
- package/dist/src/modules/workspace/disk-agreement.d.ts.map +1 -1
- package/dist/src/modules/workspace/disk-agreement.js +48 -17
- package/dist/src/modules/workspace/disk-agreement.js.map +1 -1
- package/dist/src/modules/workspace/edit-text.d.ts +2 -1
- package/dist/src/modules/workspace/edit-text.d.ts.map +1 -1
- package/dist/src/modules/workspace/edit-text.js +4 -2
- package/dist/src/modules/workspace/edit-text.js.map +1 -1
- package/dist/src/modules/workspace/effects.d.ts +4 -2
- package/dist/src/modules/workspace/effects.d.ts.map +1 -1
- package/dist/src/modules/workspace/effects.js +67 -50
- package/dist/src/modules/workspace/effects.js.map +1 -1
- package/dist/src/modules/workspace/index.d.ts +63 -51
- package/dist/src/modules/workspace/index.d.ts.map +1 -1
- package/dist/src/modules/workspace/index.js +980 -547
- package/dist/src/modules/workspace/index.js.map +1 -1
- package/dist/src/modules/workspace/observe.d.ts +125 -82
- package/dist/src/modules/workspace/observe.d.ts.map +1 -1
- package/dist/src/modules/workspace/observe.js +465 -241
- package/dist/src/modules/workspace/observe.js.map +1 -1
- package/dist/src/modules/workspace/read-page.d.ts.map +1 -1
- package/dist/src/modules/workspace/read-page.js +7 -1
- package/dist/src/modules/workspace/read-page.js.map +1 -1
- package/dist/src/modules/workspace/reconcile.d.ts +7 -1
- package/dist/src/modules/workspace/reconcile.d.ts.map +1 -1
- package/dist/src/modules/workspace/reconcile.js +156 -50
- package/dist/src/modules/workspace/reconcile.js.map +1 -1
- package/dist/src/modules/workspace/result-text.d.ts +1 -0
- package/dist/src/modules/workspace/result-text.d.ts.map +1 -1
- package/dist/src/modules/workspace/result-text.js.map +1 -1
- package/dist/src/modules/workspace/sync.d.ts +9 -0
- package/dist/src/modules/workspace/sync.d.ts.map +1 -1
- package/dist/src/modules/workspace/sync.js +14 -0
- package/dist/src/modules/workspace/sync.js.map +1 -1
- package/dist/src/modules/workspace/types.d.ts +96 -43
- package/dist/src/modules/workspace/types.d.ts.map +1 -1
- package/dist/src/modules/workspace/types.js.map +1 -1
- package/dist/src/modules/workspace/watcher.d.ts.map +1 -1
- package/dist/src/modules/workspace/watcher.js +8 -3
- package/dist/src/modules/workspace/watcher.js.map +1 -1
- package/dist/src/notice-tags.d.ts +79 -0
- package/dist/src/notice-tags.d.ts.map +1 -0
- package/dist/src/notice-tags.js +83 -0
- package/dist/src/notice-tags.js.map +1 -0
- package/dist/src/prose-drafts.d.ts +4 -3
- package/dist/src/prose-drafts.d.ts.map +1 -1
- package/dist/src/prose-drafts.js +3 -2
- package/dist/src/prose-drafts.js.map +1 -1
- package/dist/src/reasoning-loss-notice.d.ts +23 -0
- package/dist/src/reasoning-loss-notice.d.ts.map +1 -0
- package/dist/src/reasoning-loss-notice.js +52 -0
- package/dist/src/reasoning-loss-notice.js.map +1 -0
- package/dist/src/reasoning-loss.d.ts +24 -0
- package/dist/src/reasoning-loss.d.ts.map +1 -0
- package/dist/src/reasoning-loss.js +102 -0
- package/dist/src/reasoning-loss.js.map +1 -0
- package/dist/src/send-tools.d.ts +3 -2
- package/dist/src/send-tools.d.ts.map +1 -1
- package/dist/src/send-tools.js +3 -2
- package/dist/src/send-tools.js.map +1 -1
- package/dist/src/sent-rows.js +1 -1
- package/dist/src/silent-heartbeat.d.ts +1 -53
- package/dist/src/silent-heartbeat.d.ts.map +1 -1
- package/dist/src/silent-heartbeat.js +56 -3
- package/dist/src/silent-heartbeat.js.map +1 -1
- package/dist/src/supplied-text.d.ts +35 -0
- package/dist/src/supplied-text.d.ts.map +1 -0
- package/dist/src/supplied-text.js +141 -0
- package/dist/src/supplied-text.js.map +1 -0
- package/dist/src/thinking-drops.d.ts +4 -11
- package/dist/src/thinking-drops.d.ts.map +1 -1
- package/dist/src/thinking-drops.js +7 -14
- package/dist/src/thinking-drops.js.map +1 -1
- package/dist/src/tool-args.d.ts +12 -0
- package/dist/src/tool-args.d.ts.map +1 -1
- package/dist/src/tool-args.js +39 -4
- package/dist/src/tool-args.js.map +1 -1
- package/dist/src/tool-image-ledger.d.ts.map +1 -1
- package/dist/src/tool-image-ledger.js +2 -1
- package/dist/src/tool-image-ledger.js.map +1 -1
- package/dist/src/tool-presentation.d.ts.map +1 -1
- package/dist/src/tool-presentation.js +5 -4
- package/dist/src/tool-presentation.js.map +1 -1
- package/dist/src/tool-result-guard.d.ts +8 -4
- package/dist/src/tool-result-guard.d.ts.map +1 -1
- package/dist/src/tool-result-guard.js +23 -11
- package/dist/src/tool-result-guard.js.map +1 -1
- package/dist/src/tune-out/coordinator.d.ts +3 -2
- package/dist/src/tune-out/coordinator.d.ts.map +1 -1
- package/dist/src/tune-out/coordinator.js +24 -26
- package/dist/src/tune-out/coordinator.js.map +1 -1
- package/dist/src/tune-out/tools.d.ts +4 -1
- package/dist/src/tune-out/tools.d.ts.map +1 -1
- package/dist/src/types/agent.d.ts +63 -18
- package/dist/src/types/agent.d.ts.map +1 -1
- package/dist/src/types/events.d.ts +18 -8
- package/dist/src/types/events.d.ts.map +1 -1
- package/dist/src/types/framework.d.ts +58 -0
- package/dist/src/types/framework.d.ts.map +1 -1
- package/dist/src/types/module.d.ts +27 -13
- package/dist/src/types/module.d.ts.map +1 -1
- package/dist/src/types/trace.d.ts +34 -1
- package/dist/src/types/trace.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/agent.ts +76 -12
- package/src/api/mcp-server-core.ts +3 -14
- package/src/api/server.ts +11 -5
- package/src/auto-continue.ts +12 -5
- package/src/code-execution/isolate/runner.ts +7 -5
- package/src/code-execution/isolate/scripts.ts +3 -2
- package/src/cut-off-round.ts +98 -0
- package/src/framework.ts +3772 -1138
- package/src/gate/event-gate.ts +705 -60
- package/src/gate/index.ts +9 -1
- package/src/gate/reply-judge.ts +512 -0
- package/src/gate/types.ts +176 -3
- package/src/heartbeat/heartbeat.ts +843 -0
- package/src/heartbeat/reminder-time.ts +107 -0
- package/src/held-writes.ts +3 -3
- package/src/host-presentation.ts +605 -0
- package/src/index.ts +5 -1
- package/src/line-reader.ts +58 -0
- package/src/mcpl/capability-mask.ts +3 -2
- package/src/mcpl/channel-registry.ts +139 -53
- package/src/mcpl/conversation-router.ts +2 -1
- package/src/mcpl/convert-block.ts +17 -4
- package/src/mcpl/hook-orchestrator.ts +4 -3
- package/src/mcpl/inbound-source.ts +45 -70
- package/src/mcpl/modern-connection.ts +11 -7
- package/src/mcpl/protocol-family.ts +24 -3
- package/src/mcpl/push-handler.ts +2 -2
- package/src/mcpl/references.ts +31 -23
- package/src/mcpl/server-connection.ts +76 -34
- package/src/mcpl/skip-reply-wake.ts +35 -0
- package/src/mcpl/tags.ts +13 -2
- package/src/mcpl/tool-presence.ts +149 -82
- package/src/mcpl/tool-signature.ts +64 -32
- package/src/mcpl/toolset-host.ts +212 -110
- package/src/mcpl/toolsets-module.ts +277 -91
- package/src/mcpl/transport.ts +18 -14
- package/src/mcpl/types.ts +32 -13
- package/src/module-registry.ts +14 -9
- package/src/modules/api/index.ts +4 -2
- package/src/modules/discord/index.ts +37 -25
- package/src/modules/history/index.ts +30 -18
- package/src/modules/sender-name.ts +9 -0
- package/src/modules/workspace/answers.ts +151 -0
- package/src/modules/workspace/branch-intent.ts +10 -5
- package/src/modules/workspace/direct-write.ts +59 -23
- package/src/modules/workspace/disk-agreement.ts +52 -21
- package/src/modules/workspace/edit-text.ts +7 -5
- package/src/modules/workspace/effects.ts +69 -50
- package/src/modules/workspace/index.ts +966 -556
- package/src/modules/workspace/observe.ts +497 -242
- package/src/modules/workspace/read-page.ts +7 -1
- package/src/modules/workspace/reconcile.ts +184 -49
- package/src/modules/workspace/result-text.ts +2 -0
- package/src/modules/workspace/sync.ts +16 -0
- package/src/modules/workspace/types.ts +96 -43
- package/src/modules/workspace/watcher.ts +8 -3
- package/src/notice-tags.ts +84 -0
- package/src/prose-drafts.ts +4 -3
- package/src/reasoning-loss-notice.ts +64 -0
- package/src/reasoning-loss.ts +120 -0
- package/src/send-tools.ts +3 -2
- package/src/sent-rows.ts +1 -1
- package/src/silent-heartbeat.ts +4 -3
- package/src/supplied-text.ts +154 -0
- package/src/thinking-drops.ts +10 -16
- package/src/tool-args.ts +38 -4
- package/src/tool-image-ledger.ts +2 -1
- package/src/tool-presentation.ts +5 -4
- package/src/tool-result-guard.ts +26 -11
- package/src/tune-out/coordinator.ts +25 -27
- package/src/tune-out/tools.ts +4 -1
- package/src/types/agent.ts +63 -18
- package/src/types/events.ts +18 -8
- package/src/types/framework.ts +59 -0
- package/src/types/module.ts +28 -13
- package/src/types/trace.ts +36 -1
package/src/types/agent.ts
CHANGED
|
@@ -14,8 +14,9 @@ export type SameRoundThinkTextPolicySource =
|
|
|
14
14
|
export interface AutoContinueRun {
|
|
15
15
|
/** How the agent stops, as the row puts it ("call skip_reply"). */
|
|
16
16
|
stop: string;
|
|
17
|
-
/** The turn before ended in words
|
|
18
|
-
*
|
|
17
|
+
/** The turn before ended in words some or all of which were held, not
|
|
18
|
+
* sent, because a send in it may already have posted where they were
|
|
19
|
+
* going. */
|
|
19
20
|
heldAfterSend?: boolean;
|
|
20
21
|
/** Set by the scheduler: the continuation is the turn's only cause. */
|
|
21
22
|
sole?: boolean;
|
|
@@ -54,13 +55,15 @@ export interface AgentConfig {
|
|
|
54
55
|
* Enforced at dispatch for registered agent callers; omitted means 'all'.
|
|
55
56
|
* - 'all': all available tools
|
|
56
57
|
* - string[]: exact tool names, including module--utility names for utilities.
|
|
57
|
-
* Utilities
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* '
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
58
|
+
* Utilities and the host's other rarely-used tools are in the host's
|
|
59
|
+
* built-in toolset ("settings"), out of the tool list: the model reaches
|
|
60
|
+
* them with toolsets--open {toolset:"settings"} and toolsets--act, each
|
|
61
|
+
* checked under the tool's own name. An agent that should use a utility
|
|
62
|
+
* from its model lists 'toolsets--open', 'toolsets--act' and
|
|
63
|
+
* 'module--utility' (an agent without the two meta-tools keeps every other
|
|
64
|
+
* tool in its list, but no utility). The name alone passes the dispatch
|
|
65
|
+
* check for any call by that name, whether the host makes it with
|
|
66
|
+
* executeToolCall on the agent's behalf or the model or a script makes it.
|
|
64
67
|
* Trusted module calls are exempt. Genuinely unidentified public callers,
|
|
65
68
|
* including unknown legacy names, remain unrestricted. Framework-created
|
|
66
69
|
* identities have tool authority only while registered.
|
|
@@ -254,7 +257,18 @@ export interface AgentConfig {
|
|
|
254
257
|
* that the record doesn't account for raises the
|
|
255
258
|
* `thinking-binding-loss` ops alert, once per incident and again if a
|
|
256
259
|
* call drops more. The provider reports drops only on a request that
|
|
257
|
-
* carries the drop control; without it, such a block is refused
|
|
260
|
+
* carries the drop control; without it, such a block is refused;
|
|
261
|
+
* - the agent is told, in a `[reasoning] <agent>:` system notice of kind
|
|
262
|
+
* `reasoning-loss` stored for it as the framework's other notices are,
|
|
263
|
+
* when a committing compile leaves out a stored reply's reasoning at a
|
|
264
|
+
* change of the request's head, at a branch's first compile, or in a
|
|
265
|
+
* fold or other change to an earlier message that takes a reply of the
|
|
266
|
+
* current turn, and, with `dropBlock` set too, when the provider drops
|
|
267
|
+
* blocks it can place as the agent's stored replies or the stream's
|
|
268
|
+
* rounds, once per incident and again when a call drops more. The
|
|
269
|
+
* framework hears compiles through `Agent.onThinkingStrip` from the
|
|
270
|
+
* agent's first stream on, unless a host has set its own, so an agent
|
|
271
|
+
* driven only through the direct API is never told.
|
|
258
272
|
* The record and the notes
|
|
259
273
|
* vouch for requests as agent-framework hands them to membrane, so a
|
|
260
274
|
* membrane `beforeRequest` hook that changes a request must change every
|
|
@@ -546,10 +560,18 @@ export interface InferenceRequest {
|
|
|
546
560
|
* agent while a turn was alive: a coalesced render placed in its queue
|
|
547
561
|
* (wakeToRead), or a message, notice or event whose wake was queued with
|
|
548
562
|
* it. Once a request that carried the write was answered and, for a wake
|
|
549
|
-
* that carries a channel
|
|
550
|
-
* channel having read it, or once the write is in
|
|
551
|
-
* queue nor its store's current branch, the wake
|
|
563
|
+
* that carries a channel and isn't marked `ambient`, the agent has since
|
|
564
|
+
* published into that channel having read it, or once the write is in
|
|
565
|
+
* neither the agent's queue nor its store's current branch, the wake
|
|
566
|
+
* starts no turn. */
|
|
552
567
|
readsDeferredWrite?: string;
|
|
568
|
+
/** Host-owned: this wake's sole cause is this message, stored in its
|
|
569
|
+
* agent's store as it arrived, not deferred (its row's id). Once a
|
|
570
|
+
* request that carried the message was answered and, for a wake that
|
|
571
|
+
* carries a channel and isn't marked `ambient`, the agent has since
|
|
572
|
+
* published into that channel having read it, or once the message isn't
|
|
573
|
+
* on its store's current branch, the wake starts no turn. */
|
|
574
|
+
readsStoredMessage?: string;
|
|
553
575
|
agentName: string;
|
|
554
576
|
reason: string;
|
|
555
577
|
source: string;
|
|
@@ -560,8 +582,9 @@ export interface InferenceRequest {
|
|
|
560
582
|
* the turn's auto-published plain-text speech here so a single TRUNK agent
|
|
561
583
|
* replies in the channel it is answering — not the process-global most-recent-
|
|
562
584
|
* inbound locus, which a concurrent message elsewhere can hijack (item-3
|
|
563
|
-
* redux). Undefined for non-channel wakes (heartbeat, timers, module events)
|
|
564
|
-
*
|
|
585
|
+
* redux). Undefined for non-channel wakes (heartbeat, timers, module events).
|
|
586
|
+
* A heartbeat's turn takes no channel at all, and holds its plain speech as
|
|
587
|
+
* drafts; any other falls back to the global default channel, except an
|
|
565
588
|
* ephemeral run's (a subagent's), which takes no global fallback.
|
|
566
589
|
*/
|
|
567
590
|
channelId?: string;
|
|
@@ -584,6 +607,17 @@ export interface InferenceRequest {
|
|
|
584
607
|
* it starts. Hosts don't set it.
|
|
585
608
|
*/
|
|
586
609
|
autoContinueRun?: AutoContinueRun;
|
|
610
|
+
/**
|
|
611
|
+
* Framework-set: whether this wake's turn is a heartbeat's, which has no
|
|
612
|
+
* channel and holds its plain speech as drafts. True on a wake that
|
|
613
|
+
* continues a heartbeat's turn with no channel of its own (an autoContinue
|
|
614
|
+
* continuation, a bounce's resend wake, a ` !` continuation, and a re-arm,
|
|
615
|
+
* which copies its trigger), and on a merged batch whose causes include a
|
|
616
|
+
* heartbeat's wake and name no channel; false on a merged batch with none,
|
|
617
|
+
* so the batch's first request doesn't decide it. Unset, a wake is a
|
|
618
|
+
* heartbeat's when its `source` is `heartbeat`. Hosts don't set it.
|
|
619
|
+
*/
|
|
620
|
+
heartbeatTurn?: boolean;
|
|
587
621
|
/**
|
|
588
622
|
* True when the triggering message explicitly addressed the agent (mention,
|
|
589
623
|
* reply-to-bot, DM — `chat:addressed` in MCPL RFC-001 terms). When a wake
|
|
@@ -597,11 +631,22 @@ export interface InferenceRequest {
|
|
|
597
631
|
* (`chat:ambient`). A coalesced push's wake carries it only to read a
|
|
598
632
|
* render, and only when every notice the render stands for was. Such a
|
|
599
633
|
* message asked nothing of the agent, so a wake for it that carries
|
|
600
|
-
* `readsDeferredWrite` is dropped once a request
|
|
601
|
-
* was answered, with no publish asked of the
|
|
602
|
-
* tag is in doubt, and is judged as an
|
|
634
|
+
* `readsDeferredWrite` or `readsStoredMessage` is dropped once a request
|
|
635
|
+
* that carried the message was answered, with no publish asked of the
|
|
636
|
+
* agent. A message with neither tag is in doubt, and is judged as an
|
|
637
|
+
* addressed one.
|
|
603
638
|
*/
|
|
604
639
|
ambient?: true;
|
|
640
|
+
/**
|
|
641
|
+
* Host-owned: true when the triggering message's server marked it a
|
|
642
|
+
* `chat:system` notice (RFC-001 rev 3): an event about the place, such as
|
|
643
|
+
* a join or the weather changing, not something anyone said. Such a wake
|
|
644
|
+
* names no channel for its turn's plain speech, though it carries
|
|
645
|
+
* `channelId`: a turn it starts alone resolves its locus as a heartbeat's
|
|
646
|
+
* does. Like an ambient one, a wake to read it is done once read. Never
|
|
647
|
+
* set on a coalesced render's wake, which may fold messages too.
|
|
648
|
+
*/
|
|
649
|
+
systemNotice?: true;
|
|
605
650
|
/**
|
|
606
651
|
* Who spoke the message that triggered this inference, as an adapter-
|
|
607
652
|
* namespaced opaque id (`<serverId>:user:<authorId>`) — never a display
|
package/src/types/events.ts
CHANGED
|
@@ -211,14 +211,17 @@ export interface ToolResult {
|
|
|
211
211
|
/** Whether this was an error (for LLM) */
|
|
212
212
|
isError?: boolean;
|
|
213
213
|
/**
|
|
214
|
-
* The
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
*
|
|
214
|
+
* The call was refused before it opened, RFC-007's refusal, so nothing ran
|
|
215
|
+
* and the call certainly had no effect. The dispatcher's path, the model's
|
|
216
|
+
* calls and a script's, sets it: the caller may not use the tool
|
|
217
|
+
* (allowedTools), a `skip_reply` wake was refused, the call's MCPL server is
|
|
218
|
+
* absent or still connecting, the host's policy for that server denies the
|
|
219
|
+
* tool, or a fork reached outside its channel. RFC-007's lifecycle refuses
|
|
220
|
+
* the call from the same place, so observers see no events for it. The
|
|
221
|
+
* framework also sets it on the result it stores for each call in the last
|
|
222
|
+
* round of a response the output limit cut off: such a call was never
|
|
223
|
+
* dispatched or opened, and its result goes into the context with the reply,
|
|
224
|
+
* not through a tool-result event. A check made after the call opened, such as a module's
|
|
222
225
|
* answer for a name it has no tool for or arguments that don't fit a
|
|
223
226
|
* schema, is a failure whose text says nothing was done, as is an MCPL
|
|
224
227
|
* request that couldn't be written. A programmatic call (`executeToolCall`,
|
|
@@ -270,6 +273,13 @@ export interface ToolCall {
|
|
|
270
273
|
name: string;
|
|
271
274
|
/** Tool input */
|
|
272
275
|
input: unknown;
|
|
276
|
+
/**
|
|
277
|
+
* membrane's marker (ToolUseContent.unparseableInput), present when `input`
|
|
278
|
+
* isn't the model's arguments. The framework refuses such a call without
|
|
279
|
+
* running it, except one whose text is JSON `null`, which runs as a call
|
|
280
|
+
* with no arguments.
|
|
281
|
+
*/
|
|
282
|
+
unparseableInput?: string;
|
|
273
283
|
/** The agent that made this tool call. Set by the framework dispatch layer. */
|
|
274
284
|
callerAgentName?: string;
|
|
275
285
|
/**
|
package/src/types/framework.ts
CHANGED
|
@@ -218,6 +218,50 @@ export interface FrameworkConfig {
|
|
|
218
218
|
*/
|
|
219
219
|
providerHold?: ProviderHoldHook;
|
|
220
220
|
|
|
221
|
+
/**
|
|
222
|
+
* Delays before a turn whose retries ran out is sent again, in ms (default
|
|
223
|
+
* `[120000, 480000, 1920000]`: 2, 8 and 32 minutes), or `false` never to.
|
|
224
|
+
* When a persistent agent's turn ends exhausted on a transient failure (a
|
|
225
|
+
* server error, an overload, a rate limit, a network failure, or a timeout
|
|
226
|
+
* membrane marks retryable and not as a deadline it reports as run out, such
|
|
227
|
+
* as a 408 or a socket's ETIMEDOUT), its trigger is queued again after the
|
|
228
|
+
* first delay, as a wake of its own. It opens where the exhausted turn's
|
|
229
|
+
* plain speech was going: its locus, where a message mid-turn may have moved
|
|
230
|
+
* it, else its trigger channel. Carrying that channel, it ranks as addressed
|
|
231
|
+
* in a merged wake's choice of channel, so a newer ambient wake from
|
|
232
|
+
* elsewhere doesn't take it; an autoContinue continuation's still yields its
|
|
233
|
+
* channel to any wake's, as it does on main; a continuation's, such as a
|
|
234
|
+
* budget restart's, names no author. A re-arm that would have to guess a
|
|
235
|
+
* channel isn't sent again: one whose turn was woken for a channel id that
|
|
236
|
+
* names no one registered channel and never found one, and whose request
|
|
237
|
+
* names none of its own. A failure that states a wait is held for that wait
|
|
238
|
+
* first, as any turn's is, and a deadline ends the turn as before, whether
|
|
239
|
+
* the host set it or membrane marks one as run out: the runtime's or
|
|
240
|
+
* undici's on a sent request, the Anthropic adapter's watchdogs, or the
|
|
241
|
+
* Anthropic SDK's timeout, which covers its connect timeout too. Until one
|
|
242
|
+
* of the re-armed turn's rounds has run or had its tool calls cut off, its
|
|
243
|
+
* failure gets no retries from the error policy: on another transient
|
|
244
|
+
* failure the next delay follows, until the list runs out, and a failure of
|
|
245
|
+
* any other kind ends the re-arming. A wake for the agent while it waits
|
|
246
|
+
* starts its turn at once, with the re-armed trigger merged in. That turn is
|
|
247
|
+
* the wake's: the error policy retries its failures. A completed turn starts
|
|
248
|
+
* the count again, and so does a message said to the agent: not a system
|
|
249
|
+
* message or notice; not an edit, reaction or deletion, unless an edit is
|
|
250
|
+
* the first version of a message the agent sees; not a message its own view
|
|
251
|
+
* leaves out, such as one a tune-out holds from it; and not the agent's own
|
|
252
|
+
* schedule, the heartbeat's tick or reminder, a self-wake timer it set, or a
|
|
253
|
+
* script's wake. A notice a module or an MCPL server stores as a message
|
|
254
|
+
* counts. A message in the residents' shared slot counts for each resident
|
|
255
|
+
* that reads it. Any other wake leaves the count going on. A re-armed turn's
|
|
256
|
+
* transient failure writes no `[inference-failed]` marker unless a round of
|
|
257
|
+
* it ran or had its tool calls cut off; any other failure of it writes one.
|
|
258
|
+
* Each counts toward the hard-down streak. Ephemeral runs and conversation
|
|
259
|
+
* forks are never re-armed. The wait and the count are kept in memory:
|
|
260
|
+
* `stop()` drops them, and so does a restart. The wait isn't a turn, so
|
|
261
|
+
* `abortInference()` doesn't end it.
|
|
262
|
+
*/
|
|
263
|
+
exhaustedTurnRearmMs?: number[] | false;
|
|
264
|
+
|
|
221
265
|
/** Interval for periodic store sync in milliseconds (default: 1000ms, 0 to disable) */
|
|
222
266
|
syncIntervalMs?: number;
|
|
223
267
|
|
|
@@ -299,6 +343,21 @@ export interface FrameworkConfig {
|
|
|
299
343
|
|
|
300
344
|
/** EventGate config. If omitted, all events trigger inference (unchanged default). */
|
|
301
345
|
gate?: GateOptions;
|
|
346
|
+
/**
|
|
347
|
+
* The heartbeat: the agent's own periodic check-in and reminders, kept by
|
|
348
|
+
* the framework (src/heartbeat/heartbeat.ts), with the tools
|
|
349
|
+
* `heartbeat--heartbeat_status`, `heartbeat--heartbeat_configure`,
|
|
350
|
+
* `heartbeat--heartbeat_trigger`, `heartbeat--reminder_add`,
|
|
351
|
+
* `heartbeat--reminder_list` and `heartbeat--reminder_cancel`. `true` turns it
|
|
352
|
+
* on with its defaults; `false`, null or leaving it out leaves it off. Its
|
|
353
|
+
* wakes go to the gate as heartbeat-mcpl's pushes did, from the server id
|
|
354
|
+
* `heartbeat`, so the agent's rules decide them and a sleep lets them
|
|
355
|
+
* through. It replaces the heartbeat-mcpl server, which is refused beside it
|
|
356
|
+
* (by its id, a heartbeat tool prefix, or its command), at create and at a
|
|
357
|
+
* runtime connect: both would wake the agent. `importFrom` brings that
|
|
358
|
+
* server's schedule and reminders along.
|
|
359
|
+
*/
|
|
360
|
+
heartbeat?: boolean | null | import('../heartbeat/heartbeat.js').HeartbeatOptions;
|
|
302
361
|
|
|
303
362
|
/**
|
|
304
363
|
* Liveness watchdog: fail hard (and let the supervisor restart) if the main
|
package/src/types/module.ts
CHANGED
|
@@ -72,10 +72,11 @@ export type ModuleMessage = StoredMessage & {
|
|
|
72
72
|
* True on a message a tune-out holds from the residents: one that arrived
|
|
73
73
|
* in a tuned-out channel, stamped `metadata.tuneOut` as it came in. The
|
|
74
74
|
* 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, and a
|
|
76
|
-
* boundary of a turn alive when it arrived stores it
|
|
77
|
-
* into the live turn. The subconscious reads it. Its
|
|
78
|
-
* a resident in rows of their own, which aren't
|
|
75
|
+
* compiled view includes it, during the tune-out or after it, and a
|
|
76
|
+
* resident's tool boundary of a turn alive when it arrived stores it
|
|
77
|
+
* without injecting it into the live turn. The subconscious reads it. Its
|
|
78
|
+
* text can still reach a resident in rows of their own, which aren't
|
|
79
|
+
* marked, such as the
|
|
79
80
|
* cancel's `<tuned-out-backlog>` row, with the text of the tune-out's newest
|
|
80
81
|
* messages, up to `backlogCap` of them and as many as fit in one of the
|
|
81
82
|
* residents' messages, the stored ones first and then those still held;
|
|
@@ -142,16 +143,27 @@ export interface Module {
|
|
|
142
143
|
|
|
143
144
|
/**
|
|
144
145
|
* Utilities: agent-invocable operations that deliberately do NOT get a
|
|
145
|
-
*
|
|
146
|
-
* capability used twice a month shouldn't. Utilities
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
146
|
+
* slot in the tool list. Every tool schema taxes every inference; a
|
|
147
|
+
* capability used twice a month shouldn't. Utilities belong to the host's
|
|
148
|
+
* built-in toolset ("settings"): an agent sees them with
|
|
149
|
+
* `toolsets--look {toolset:"settings"}` and calls them with
|
|
150
|
+
* `toolsets--act` once it has opened it. Same ToolDefinition shape, same
|
|
151
|
+
* un-prefixed names, and dispatch arrives at the SAME handleToolCall as
|
|
152
|
+
* getTools() output. Optional; omitting it means the module contributes no
|
|
153
|
+
* utilities.
|
|
152
154
|
*/
|
|
153
155
|
getUtilities?(): ToolDefinition[];
|
|
154
156
|
|
|
157
|
+
/**
|
|
158
|
+
* Where one of this module's tools (a getTools() name, unprefixed) is
|
|
159
|
+
* presented: in the agent's tool list (`'header'`, the default), or in the
|
|
160
|
+
* host's built-in toolset (`'builtin'`), out of the tool list, opened with
|
|
161
|
+
* `toolsets--open {toolset:"settings"}` and called with `toolsets--act`.
|
|
162
|
+
* For tools an agent uses rarely: settings, administration, status reads.
|
|
163
|
+
* Optional; omitting it keeps every tool in the tool list.
|
|
164
|
+
*/
|
|
165
|
+
toolPlacement?(toolName: string): 'header' | 'builtin' | undefined;
|
|
166
|
+
|
|
155
167
|
/**
|
|
156
168
|
* Handle a tool call.
|
|
157
169
|
* Tool name is without module prefix.
|
|
@@ -232,13 +244,16 @@ export interface AgentSettingsExtension {
|
|
|
232
244
|
properties: Record<string, unknown>;
|
|
233
245
|
/** The setting keys this extension owns (must match `properties` keys). */
|
|
234
246
|
keys: string[];
|
|
235
|
-
/** Current values for the extension's keys.
|
|
247
|
+
/** Current values for the extension's keys. A refused agent_settings call
|
|
248
|
+
* names what changed by comparing every field this returns, before the
|
|
249
|
+
* call and at its refusal. */
|
|
236
250
|
get(agentName: string): Record<string, unknown>;
|
|
237
251
|
/** Apply a partial update (only this extension's keys present) and return
|
|
238
252
|
* the new values. Throw to surface a validation error to the agent. */
|
|
239
253
|
update(agentName: string, patch: Record<string, unknown>): Record<string, unknown>;
|
|
240
254
|
/** Restore the listed keys (or all when omitted) to defaults and return the
|
|
241
|
-
* new values. Optional
|
|
255
|
+
* new values. Optional: without it, a reset of every setting skips the
|
|
256
|
+
* extension, and a reset that names one of its keys is refused. */
|
|
242
257
|
reset?(agentName: string, keys?: string[]): Record<string, unknown>;
|
|
243
258
|
}
|
|
244
259
|
|
package/src/types/trace.ts
CHANGED
|
@@ -114,6 +114,23 @@ export type TraceEvent =
|
|
|
114
114
|
/** Bounded like `error`. */
|
|
115
115
|
stack?: string;
|
|
116
116
|
})
|
|
117
|
+
| (TraceEventBase & {
|
|
118
|
+
/**
|
|
119
|
+
* A turn waiting out its error policy's delay before a retry says so:
|
|
120
|
+
* as the wait begins, with when it is due to end, and again every 60
|
|
121
|
+
* seconds while it lasts, while its agent is the one registered under
|
|
122
|
+
* its name, and never after the wait ends (its time coming, a stop, or
|
|
123
|
+
* an abort). The failure being retried is the `inference:failed` just
|
|
124
|
+
* before it. A host watching for agents gone quiet can tell a waiting
|
|
125
|
+
* one from a stuck one by it.
|
|
126
|
+
*/
|
|
127
|
+
type: 'inference:waiting';
|
|
128
|
+
agentName: string;
|
|
129
|
+
/** When the wait is due to end (epoch ms): it counts down by its
|
|
130
|
+
* timers, so a stalled event loop can end it later. Absent for a wait
|
|
131
|
+
* too long for a date. */
|
|
132
|
+
until?: number;
|
|
133
|
+
})
|
|
117
134
|
| (TraceEventBase & {
|
|
118
135
|
type: 'inference:exhausted';
|
|
119
136
|
agentName: string;
|
|
@@ -472,6 +489,24 @@ export type TraceEvent =
|
|
|
472
489
|
policyName: string;
|
|
473
490
|
eventCount: number;
|
|
474
491
|
})
|
|
492
|
+
| (TraceEventBase & {
|
|
493
|
+
/** The reply judge's verdict on a `judge` rule's batch. `verdict`:
|
|
494
|
+
* `reply` or `wait` as the judge answered, `error` when it failed,
|
|
495
|
+
* timed out or answered nothing usable; `woke` is whether the batch
|
|
496
|
+
* then woke the agent (an error does by the host's onError).
|
|
497
|
+
* The judge's reason is in the agent's gate_status, not here: it's
|
|
498
|
+
* written from the agent's context. */
|
|
499
|
+
type: 'gate:judge-verdict';
|
|
500
|
+
policyName: string;
|
|
501
|
+
verdict: 'reply' | 'wait' | 'error';
|
|
502
|
+
woke: boolean;
|
|
503
|
+
eventCount: number;
|
|
504
|
+
durationMs: number;
|
|
505
|
+
model?: string;
|
|
506
|
+
inputTokens?: number;
|
|
507
|
+
cacheReadTokens?: number;
|
|
508
|
+
outputTokens?: number;
|
|
509
|
+
})
|
|
475
510
|
| (TraceEventBase & {
|
|
476
511
|
/** A batched wake's turn started without its `[Gate: …]` line (the
|
|
477
512
|
* gate hands the line to the wake when its message is the newest at
|
|
@@ -836,7 +871,7 @@ export type TraceEvent =
|
|
|
836
871
|
parkedAdmissions?: number;
|
|
837
872
|
/** True when undrained turns were force-cancelled (abandon). */
|
|
838
873
|
abandoned?: boolean;
|
|
839
|
-
/** Agents whose turn the abandon had not ended when its grace ran out: a token held with no stream and no check ahead (a puppet tool turn, a store surgery's reservation, a turn finishing its last delivery), or a turn that hadn't reached its next check, the tool-result guard's wait for its speech included. A turn whose stream the abandon cancelled while it was still streaming isn't listed, even one still running when the grace ran out. */
|
|
874
|
+
/** Agents whose turn the abandon had not ended when its grace ran out: a token held with no stream and no check ahead (a puppet tool turn, a store surgery's reservation, a turn finishing its last delivery), or a turn that hadn't reached its next check, the tool-result guard's wait for its speech included, or a turn whose stream's cancel threw with no check ahead, so that its stream goes on. A turn whose stream the abandon cancelled while it was still streaming isn't listed, even one still running when the grace ran out. */
|
|
840
875
|
unabandonable?: string[];
|
|
841
876
|
})
|
|
842
877
|
| (TraceEventBase & {
|