@animalabs/agent-framework 0.6.5 → 0.6.7
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 +78 -0
- package/dist/src/agent.d.ts +56 -2
- package/dist/src/agent.d.ts.map +1 -1
- package/dist/src/agent.js +372 -57
- package/dist/src/agent.js.map +1 -1
- package/dist/src/api/mcp-server.js +0 -0
- package/dist/src/api/server.d.ts.map +1 -1
- package/dist/src/api/server.js +7 -2
- package/dist/src/api/server.js.map +1 -1
- package/dist/src/canonical-json.d.ts +2 -0
- package/dist/src/canonical-json.d.ts.map +1 -0
- package/dist/src/canonical-json.js +23 -0
- package/dist/src/canonical-json.js.map +1 -0
- package/dist/src/framework.d.ts +160 -2
- package/dist/src/framework.d.ts.map +1 -1
- package/dist/src/framework.js +3098 -167
- package/dist/src/framework.js.map +1 -1
- package/dist/src/gate/event-gate.d.ts.map +1 -1
- package/dist/src/gate/event-gate.js +34 -4
- package/dist/src/gate/event-gate.js.map +1 -1
- package/dist/src/index.d.ts +4 -0
- 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/mcpl/channel-registry.d.ts +36 -15
- package/dist/src/mcpl/channel-registry.d.ts.map +1 -1
- package/dist/src/mcpl/channel-registry.js +322 -76
- package/dist/src/mcpl/channel-registry.js.map +1 -1
- package/dist/src/mcpl/push-handler.d.ts +1 -0
- 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 +39 -4
- package/dist/src/mcpl/server-connection.d.ts.map +1 -1
- package/dist/src/mcpl/server-connection.js +146 -28
- package/dist/src/mcpl/server-connection.js.map +1 -1
- package/dist/src/mcpl/types.d.ts +43 -12
- package/dist/src/mcpl/types.d.ts.map +1 -1
- package/dist/src/mcpl/types.js +1 -0
- package/dist/src/mcpl/types.js.map +1 -1
- package/dist/src/modules/workspace/index.d.ts +12 -1
- package/dist/src/modules/workspace/index.d.ts.map +1 -1
- package/dist/src/modules/workspace/index.js +661 -2
- package/dist/src/modules/workspace/index.js.map +1 -1
- package/dist/src/modules/workspace/types.d.ts +4 -0
- package/dist/src/modules/workspace/types.d.ts.map +1 -1
- package/dist/src/modules/workspace/types.js.map +1 -1
- package/dist/src/recovery/discord-awareness-outbox.d.ts +99 -0
- package/dist/src/recovery/discord-awareness-outbox.d.ts.map +1 -0
- package/dist/src/recovery/discord-awareness-outbox.js +334 -0
- package/dist/src/recovery/discord-awareness-outbox.js.map +1 -0
- package/dist/src/recovery/offline-branch.d.ts +45 -0
- package/dist/src/recovery/offline-branch.d.ts.map +1 -0
- package/dist/src/recovery/offline-branch.js +362 -0
- package/dist/src/recovery/offline-branch.js.map +1 -0
- package/dist/src/recovery/recover-cli.d.ts +3 -0
- package/dist/src/recovery/recover-cli.d.ts.map +1 -0
- package/dist/src/recovery/recover-cli.js +129 -0
- package/dist/src/recovery/recover-cli.js.map +1 -0
- package/dist/src/types/agent.d.ts +37 -0
- package/dist/src/types/agent.d.ts.map +1 -1
- package/dist/src/types/events.d.ts +1 -0
- package/dist/src/types/events.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 +31 -0
- package/dist/src/types/module.d.ts.map +1 -1
- package/dist/src/types/trace.d.ts +4 -0
- package/dist/src/types/trace.d.ts.map +1 -1
- package/dist/test/agent-runtime-settings.test.d.ts +2 -0
- package/dist/test/agent-runtime-settings.test.d.ts.map +1 -0
- package/dist/test/agent-runtime-settings.test.js +227 -0
- package/dist/test/agent-runtime-settings.test.js.map +1 -0
- package/dist/test/busy-agent-scheduler.test.d.ts +2 -0
- package/dist/test/busy-agent-scheduler.test.d.ts.map +1 -0
- package/dist/test/busy-agent-scheduler.test.js +62 -0
- package/dist/test/busy-agent-scheduler.test.js.map +1 -0
- package/dist/test/channel-lifecycle-provenance.test.d.ts +2 -0
- package/dist/test/channel-lifecycle-provenance.test.d.ts.map +1 -0
- package/dist/test/channel-lifecycle-provenance.test.js +47 -0
- package/dist/test/channel-lifecycle-provenance.test.js.map +1 -0
- package/dist/test/channel-registry-routing.test.js +5 -4
- package/dist/test/channel-registry-routing.test.js.map +1 -1
- package/dist/test/conversation-fork-injection-scoping.test.js +12 -1
- package/dist/test/conversation-fork-injection-scoping.test.js.map +1 -1
- package/dist/test/discord-awareness-outbox.test.d.ts +2 -0
- package/dist/test/discord-awareness-outbox.test.d.ts.map +1 -0
- package/dist/test/discord-awareness-outbox.test.js +248 -0
- package/dist/test/discord-awareness-outbox.test.js.map +1 -0
- package/dist/test/event-gate.test.js +21 -1
- package/dist/test/event-gate.test.js.map +1 -1
- package/dist/test/helpers/mock-membrane.d.ts +13 -1
- package/dist/test/helpers/mock-membrane.d.ts.map +1 -1
- package/dist/test/helpers/mock-membrane.js +9 -2
- package/dist/test/helpers/mock-membrane.js.map +1 -1
- package/dist/test/maintenance-timer.test.js +103 -1
- package/dist/test/maintenance-timer.test.js.map +1 -1
- package/dist/test/mcpl-awareness-barrier.test.d.ts +2 -0
- package/dist/test/mcpl-awareness-barrier.test.d.ts.map +1 -0
- package/dist/test/mcpl-awareness-barrier.test.js +845 -0
- package/dist/test/mcpl-awareness-barrier.test.js.map +1 -0
- package/dist/test/mcpl-gate-roundtrip.test.js +138 -6
- package/dist/test/mcpl-gate-roundtrip.test.js.map +1 -1
- package/dist/test/mcpl-reconnect-reregistration.test.js +22 -3
- package/dist/test/mcpl-reconnect-reregistration.test.js.map +1 -1
- package/dist/test/mcpl-request-timeout.test.js +15 -0
- package/dist/test/mcpl-request-timeout.test.js.map +1 -1
- package/dist/test/offline-recovery-branch.test.d.ts +2 -0
- package/dist/test/offline-recovery-branch.test.d.ts.map +1 -0
- package/dist/test/offline-recovery-branch.test.js +226 -0
- package/dist/test/offline-recovery-branch.test.js.map +1 -0
- package/dist/test/present-while-acting.test.d.ts +19 -0
- package/dist/test/present-while-acting.test.d.ts.map +1 -0
- package/dist/test/present-while-acting.test.js +295 -0
- package/dist/test/present-while-acting.test.js.map +1 -0
- package/dist/test/primary-summary-refusal-fallback-integration.test.d.ts +2 -0
- package/dist/test/primary-summary-refusal-fallback-integration.test.d.ts.map +1 -0
- package/dist/test/primary-summary-refusal-fallback-integration.test.js +1955 -0
- package/dist/test/primary-summary-refusal-fallback-integration.test.js.map +1 -0
- package/dist/test/primary-summary-refusal-fallback.test.d.ts +2 -0
- package/dist/test/primary-summary-refusal-fallback.test.d.ts.map +1 -0
- package/dist/test/primary-summary-refusal-fallback.test.js +753 -0
- package/dist/test/primary-summary-refusal-fallback.test.js.map +1 -0
- package/dist/test/same-round-think-policy.test.d.ts +2 -0
- package/dist/test/same-round-think-policy.test.d.ts.map +1 -0
- package/dist/test/same-round-think-policy.test.js +853 -0
- package/dist/test/same-round-think-policy.test.js.map +1 -0
- package/dist/test/trunk-channel-routing.test.js +38 -0
- package/dist/test/trunk-channel-routing.test.js.map +1 -1
- package/dist/test/workspace-read-image.test.d.ts +2 -0
- package/dist/test/workspace-read-image.test.d.ts.map +1 -0
- package/dist/test/workspace-read-image.test.js +518 -0
- package/dist/test/workspace-read-image.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -4
- package/src/agent.ts +485 -63
- package/src/api/server.ts +8 -2
- package/src/canonical-json.ts +22 -0
- package/src/framework.ts +4096 -304
- package/src/gate/event-gate.ts +50 -4
- package/src/index.ts +20 -0
- package/src/mcpl/channel-registry.ts +396 -85
- package/src/mcpl/push-handler.ts +2 -0
- package/src/mcpl/server-connection.ts +173 -28
- package/src/mcpl/types.ts +49 -12
- package/src/modules/workspace/index.ts +759 -2
- package/src/modules/workspace/types.ts +5 -0
- package/src/recovery/discord-awareness-outbox.ts +459 -0
- package/src/recovery/offline-branch.ts +510 -0
- package/src/recovery/recover-cli.ts +130 -0
- package/src/types/agent.ts +44 -0
- package/src/types/events.ts +1 -1
- package/src/types/framework.ts +17 -0
- package/src/types/module.ts +33 -0
- package/src/types/trace.ts +4 -0
package/src/types/events.ts
CHANGED
|
@@ -226,6 +226,7 @@ export interface McplPushEvent {
|
|
|
226
226
|
eventId: string;
|
|
227
227
|
content: ContentBlock[];
|
|
228
228
|
origin?: Record<string, unknown>;
|
|
229
|
+
tags?: string[];
|
|
229
230
|
timestamp: string;
|
|
230
231
|
inferenceId: string;
|
|
231
232
|
triggerInference?: boolean;
|
|
@@ -249,4 +250,3 @@ export interface McplChannelIncomingEvent {
|
|
|
249
250
|
triggerInference?: boolean;
|
|
250
251
|
targetAgents?: string[];
|
|
251
252
|
}
|
|
252
|
-
|
package/src/types/framework.ts
CHANGED
|
@@ -42,6 +42,23 @@ export interface FrameworkConfig {
|
|
|
42
42
|
/** Path to Chronicle store */
|
|
43
43
|
storePath?: string;
|
|
44
44
|
|
|
45
|
+
/**
|
|
46
|
+
* Branch-independent Discord awareness-marker outbox. Defaults to
|
|
47
|
+
* `<storePath>/recovery/discord-awareness-outbox.json`. Set explicitly when
|
|
48
|
+
* providing an app-owned `store` without `storePath`; omit to disable.
|
|
49
|
+
*/
|
|
50
|
+
discordAwarenessOutboxPath?: string;
|
|
51
|
+
|
|
52
|
+
/** Emoji used for branch-awareness markers (default: 💤). */
|
|
53
|
+
discordAwarenessEmoji?: string;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Mandatory deadline for each Discord awareness marker tools/call. This is
|
|
57
|
+
* independent of MCPL requestTimeoutMs and cannot be disabled with 0.
|
|
58
|
+
* Values are clamped to 50..60000ms; 0 selects the 10000ms default.
|
|
59
|
+
*/
|
|
60
|
+
discordAwarenessDeadlineMs?: number;
|
|
61
|
+
|
|
45
62
|
/** Or existing store (app-owned) */
|
|
46
63
|
store?: JsStore;
|
|
47
64
|
|
package/src/types/module.ts
CHANGED
|
@@ -96,6 +96,39 @@ export interface Module {
|
|
|
96
96
|
* Adapted from Anarchid/agent-framework@mcpl-module-proto.
|
|
97
97
|
*/
|
|
98
98
|
gatherContext?(agentName: string): Promise<ContextInjection[]>;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Declare extra settings for the synthesized `agent_settings` tool.
|
|
102
|
+
* Modules owning hot-tunable runtime state (e.g. a host settings module
|
|
103
|
+
* managing extended-thinking toggles) expose it here instead of registering
|
|
104
|
+
* their own tools — one settings surface for the agent instead of N.
|
|
105
|
+
* The framework merges the declared fields into agent_settings' schema and
|
|
106
|
+
* routes get/update/reset for the declared keys back to the extension.
|
|
107
|
+
*/
|
|
108
|
+
getAgentSettingsExtension?(): AgentSettingsExtension;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* A module-owned extension of the `agent_settings` tool: extra hot-tunable
|
|
113
|
+
* fields merged into the tool schema, with get/update/reset routed to the
|
|
114
|
+
* declaring module. Keys must not collide with the core settings
|
|
115
|
+
* (context_budget_tokens, tail_tokens, transition_pace_tokens) or with other
|
|
116
|
+
* extensions — colliding extensions are skipped loudly.
|
|
117
|
+
*/
|
|
118
|
+
export interface AgentSettingsExtension {
|
|
119
|
+
/** JSON-schema property definitions for the extension's fields, merged into
|
|
120
|
+
* the agent_settings input schema (e.g. { reasoning_enabled: { type: 'boolean', … } }). */
|
|
121
|
+
properties: Record<string, unknown>;
|
|
122
|
+
/** The setting keys this extension owns (must match `properties` keys). */
|
|
123
|
+
keys: string[];
|
|
124
|
+
/** Current values for the extension's keys. */
|
|
125
|
+
get(agentName: string): Record<string, unknown>;
|
|
126
|
+
/** Apply a partial update (only this extension's keys present) and return
|
|
127
|
+
* the new values. Throw to surface a validation error to the agent. */
|
|
128
|
+
update(agentName: string, patch: Record<string, unknown>): Record<string, unknown>;
|
|
129
|
+
/** Restore the listed keys (or all when omitted) to defaults and return the
|
|
130
|
+
* new values. Optional — extensions without reset semantics are skipped. */
|
|
131
|
+
reset?(agentName: string, keys?: string[]): Record<string, unknown>;
|
|
99
132
|
}
|
|
100
133
|
|
|
101
134
|
/**
|
package/src/types/trace.ts
CHANGED
|
@@ -109,6 +109,8 @@ export type TraceEvent =
|
|
|
109
109
|
| (TraceEventBase & {
|
|
110
110
|
type: 'inference:stream_resumed';
|
|
111
111
|
agentName: string;
|
|
112
|
+
/** Count of mid-turn messages injected into the resumed round (hear-while-acting). */
|
|
113
|
+
injectedMessages?: number;
|
|
112
114
|
})
|
|
113
115
|
| (TraceEventBase & {
|
|
114
116
|
type: 'inference:stream_restarted';
|
|
@@ -317,6 +319,8 @@ export type TraceEvent =
|
|
|
317
319
|
serverId: string;
|
|
318
320
|
/** The JSON-RPC id of the late response whose pending request already timed out. */
|
|
319
321
|
responseId: string | number;
|
|
322
|
+
/** Original request method when retained for mandatory-deadline visibility. */
|
|
323
|
+
method?: string;
|
|
320
324
|
/** True when the dropped response carried host-managed `state`. */
|
|
321
325
|
hadState: boolean;
|
|
322
326
|
/** True when the dropped response carried a server-managed `checkpoint`. */
|