@animalabs/agent-framework 0.5.7 → 0.6.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/dist/src/framework.d.ts +67 -0
- package/dist/src/framework.d.ts.map +1 -1
- package/dist/src/framework.js +469 -26
- package/dist/src/framework.js.map +1 -1
- package/dist/src/gate/event-gate.d.ts +44 -1
- package/dist/src/gate/event-gate.d.ts.map +1 -1
- package/dist/src/gate/event-gate.js +152 -8
- package/dist/src/gate/event-gate.js.map +1 -1
- package/dist/src/gate/gate-script-worker.d.ts +2 -0
- package/dist/src/gate/gate-script-worker.d.ts.map +1 -0
- package/dist/src/gate/gate-script-worker.js +69 -0
- package/dist/src/gate/gate-script-worker.js.map +1 -0
- package/dist/src/gate/gate-script.d.ts +44 -0
- package/dist/src/gate/gate-script.d.ts.map +1 -0
- package/dist/src/gate/gate-script.js +164 -0
- package/dist/src/gate/gate-script.js.map +1 -0
- package/dist/src/gate/types.d.ts +18 -3
- package/dist/src/gate/types.d.ts.map +1 -1
- package/dist/src/mcpl/channel-registry.d.ts +43 -1
- package/dist/src/mcpl/channel-registry.d.ts.map +1 -1
- package/dist/src/mcpl/channel-registry.js +82 -8
- package/dist/src/mcpl/channel-registry.js.map +1 -1
- package/dist/src/mcpl/checkpoint-manager.d.ts +7 -0
- package/dist/src/mcpl/checkpoint-manager.d.ts.map +1 -1
- package/dist/src/mcpl/checkpoint-manager.js +15 -0
- package/dist/src/mcpl/checkpoint-manager.js.map +1 -1
- package/dist/src/mcpl/push-handler.d.ts.map +1 -1
- package/dist/src/mcpl/push-handler.js +1 -0
- package/dist/src/mcpl/push-handler.js.map +1 -1
- package/dist/src/mcpl/server-connection.d.ts +35 -30
- package/dist/src/mcpl/server-connection.d.ts.map +1 -1
- package/dist/src/mcpl/server-connection.js +145 -206
- package/dist/src/mcpl/server-connection.js.map +1 -1
- package/dist/src/mcpl/transport.d.ts +98 -0
- package/dist/src/mcpl/transport.d.ts.map +1 -0
- package/dist/src/mcpl/transport.js +281 -0
- package/dist/src/mcpl/transport.js.map +1 -0
- package/dist/src/mcpl/types.d.ts +42 -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 +2 -0
- package/dist/src/module-registry.d.ts.map +1 -1
- package/dist/src/module-registry.js +9 -2
- package/dist/src/module-registry.js.map +1 -1
- package/dist/src/prose-segments.d.ts +18 -0
- package/dist/src/prose-segments.d.ts.map +1 -0
- package/dist/src/prose-segments.js +39 -0
- package/dist/src/prose-segments.js.map +1 -0
- package/dist/src/runtime/liveness-watchdog-worker.d.ts +2 -0
- package/dist/src/runtime/liveness-watchdog-worker.d.ts.map +1 -0
- package/dist/src/runtime/liveness-watchdog-worker.js +57 -0
- package/dist/src/runtime/liveness-watchdog-worker.js.map +1 -0
- package/dist/src/runtime/liveness-watchdog.d.ts +36 -0
- package/dist/src/runtime/liveness-watchdog.d.ts.map +1 -0
- package/dist/src/runtime/liveness-watchdog.js +106 -0
- package/dist/src/runtime/liveness-watchdog.js.map +1 -0
- package/dist/src/types/agent.d.ts +10 -0
- package/dist/src/types/agent.d.ts.map +1 -1
- package/dist/src/types/framework.d.ts +14 -0
- package/dist/src/types/framework.d.ts.map +1 -1
- package/dist/src/types/module.d.ts +12 -0
- package/dist/src/types/module.d.ts.map +1 -1
- package/dist/test/channel-registry-routing.test.js +108 -1
- package/dist/test/channel-registry-routing.test.js.map +1 -1
- package/dist/test/checkpoint-attribution.test.d.ts +2 -0
- package/dist/test/checkpoint-attribution.test.d.ts.map +1 -0
- package/dist/test/checkpoint-attribution.test.js +40 -0
- package/dist/test/checkpoint-attribution.test.js.map +1 -0
- package/dist/test/event-gate-policy-mutation.test.d.ts +2 -0
- package/dist/test/event-gate-policy-mutation.test.d.ts.map +1 -0
- package/dist/test/event-gate-policy-mutation.test.js +137 -0
- package/dist/test/event-gate-policy-mutation.test.js.map +1 -0
- package/dist/test/event-gate-script.test.d.ts +2 -0
- package/dist/test/event-gate-script.test.d.ts.map +1 -0
- package/dist/test/event-gate-script.test.js +95 -0
- package/dist/test/event-gate-script.test.js.map +1 -0
- package/dist/test/event-gate-tags.test.d.ts +2 -0
- package/dist/test/event-gate-tags.test.d.ts.map +1 -0
- package/dist/test/event-gate-tags.test.js +76 -0
- package/dist/test/event-gate-tags.test.js.map +1 -0
- package/dist/test/liveness-watchdog.test.d.ts +2 -0
- package/dist/test/liveness-watchdog.test.d.ts.map +1 -0
- package/dist/test/liveness-watchdog.test.js +78 -0
- package/dist/test/liveness-watchdog.test.js.map +1 -0
- package/dist/test/mcpl-ws-transport.test.d.ts +2 -0
- package/dist/test/mcpl-ws-transport.test.d.ts.map +1 -0
- package/dist/test/mcpl-ws-transport.test.js +155 -0
- package/dist/test/mcpl-ws-transport.test.js.map +1 -0
- package/dist/test/prose-segments.test.d.ts +2 -0
- package/dist/test/prose-segments.test.d.ts.map +1 -0
- package/dist/test/prose-segments.test.js +52 -0
- package/dist/test/prose-segments.test.js.map +1 -0
- package/dist/test/trunk-channel-routing.test.d.ts +19 -0
- package/dist/test/trunk-channel-routing.test.d.ts.map +1 -0
- package/dist/test/trunk-channel-routing.test.js +175 -0
- package/dist/test/trunk-channel-routing.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/framework.ts +509 -24
- package/src/gate/event-gate.ts +153 -8
- package/src/gate/gate-script-worker.ts +73 -0
- package/src/gate/gate-script.ts +180 -0
- package/src/gate/types.ts +19 -3
- package/src/mcpl/channel-registry.ts +112 -8
- package/src/mcpl/checkpoint-manager.ts +16 -0
- package/src/mcpl/push-handler.ts +1 -0
- package/src/mcpl/server-connection.ts +153 -224
- package/src/mcpl/transport.ts +307 -0
- package/src/mcpl/types.ts +49 -2
- package/src/module-registry.ts +13 -2
- package/src/prose-segments.ts +42 -0
- package/src/runtime/liveness-watchdog-worker.ts +66 -0
- package/src/runtime/liveness-watchdog.ts +122 -0
- package/src/types/agent.ts +10 -0
- package/src/types/framework.ts +15 -0
- package/src/types/module.ts +13 -0
package/src/types/agent.ts
CHANGED
|
@@ -138,4 +138,14 @@ export interface InferenceRequest {
|
|
|
138
138
|
reason: string;
|
|
139
139
|
source: string;
|
|
140
140
|
timestamp: number;
|
|
141
|
+
/**
|
|
142
|
+
* The MCPL channel whose message triggered this inference, if any (composite
|
|
143
|
+
* id, e.g. `discord:guild:channel` / `discord:dm:id`). The framework routes
|
|
144
|
+
* the turn's auto-published plain-text speech here so a single TRUNK agent
|
|
145
|
+
* replies in the channel it is answering — not the process-global most-recent-
|
|
146
|
+
* inbound locus, which a concurrent message elsewhere can hijack (item-3
|
|
147
|
+
* redux). Undefined for non-channel wakes (heartbeat, timers, module events),
|
|
148
|
+
* which correctly fall back to the global default channel.
|
|
149
|
+
*/
|
|
150
|
+
channelId?: string;
|
|
141
151
|
}
|
package/src/types/framework.ts
CHANGED
|
@@ -68,6 +68,21 @@ export interface FrameworkConfig {
|
|
|
68
68
|
/** EventGate config. If omitted, all events trigger inference (unchanged default). */
|
|
69
69
|
gate?: GateOptions;
|
|
70
70
|
|
|
71
|
+
/**
|
|
72
|
+
* Liveness watchdog: fail hard (and let the supervisor restart) if the main
|
|
73
|
+
* thread wedges — a synchronous infinite loop or microtask flood that would
|
|
74
|
+
* otherwise leave the agent silently deaf. Off unless `enabled` is set.
|
|
75
|
+
*/
|
|
76
|
+
watchdog?: {
|
|
77
|
+
enabled?: boolean;
|
|
78
|
+
/** Kill if no heartbeat for this long (ms). Default 30000. */
|
|
79
|
+
thresholdMs?: number;
|
|
80
|
+
/** 'abort' → SIGABRT (core dump for debugging); 'exit' → SIGKILL. Default 'abort'. */
|
|
81
|
+
action?: 'abort' | 'exit';
|
|
82
|
+
/** Optional path for a JSON wedge report written before the kill. */
|
|
83
|
+
reportPath?: string;
|
|
84
|
+
};
|
|
85
|
+
|
|
71
86
|
/**
|
|
72
87
|
* Per-channel conversation routing. When set, incoming MCPL channel
|
|
73
88
|
* messages route to per-channel fork agents spawned from the template
|
package/src/types/module.ts
CHANGED
|
@@ -186,6 +186,19 @@ export interface ModuleContext {
|
|
|
186
186
|
*/
|
|
187
187
|
unregisterSpeechHandler(): void;
|
|
188
188
|
|
|
189
|
+
/**
|
|
190
|
+
* Execute a tool call autonomously, without agent mediation.
|
|
191
|
+
*
|
|
192
|
+
* Routes through the framework's normal tool dispatch — MCPL-prefixed names
|
|
193
|
+
* (e.g. `mcpl--discord--unsubscribe_channel`) hit the MCPL subsystem; module
|
|
194
|
+
* names hit the owning module. Unlike pushing a `tool-call` event, this does
|
|
195
|
+
* NOT record tool_use/tool_result into any agent's context — it's a pure
|
|
196
|
+
* side-effecting call whose result is returned to the caller. Used by modules
|
|
197
|
+
* that need to act on their own (e.g. subscription GC unsubscribing a noisy
|
|
198
|
+
* channel) rather than asking the agent to call the tool.
|
|
199
|
+
*/
|
|
200
|
+
callTool(call: ToolCall): Promise<ToolResult>;
|
|
201
|
+
|
|
189
202
|
/**
|
|
190
203
|
* Subscribe to the framework's trace event stream for observability.
|
|
191
204
|
*
|