@animalabs/agent-framework 0.29.0 → 0.31.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 +71 -8
- package/dist/src/admission/admit.d.ts +90 -0
- package/dist/src/admission/admit.d.ts.map +1 -0
- package/dist/src/admission/admit.js +43 -0
- package/dist/src/admission/admit.js.map +1 -0
- package/dist/src/agent.d.ts +50 -9
- package/dist/src/agent.d.ts.map +1 -1
- package/dist/src/agent.js +125 -23
- 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 +10 -3
- package/dist/src/api/mcp-server-core.js.map +1 -1
- package/dist/src/author-presentation.d.ts +50 -0
- package/dist/src/author-presentation.d.ts.map +1 -0
- package/dist/src/author-presentation.js +58 -0
- package/dist/src/author-presentation.js.map +1 -0
- package/dist/src/code-execution/isolate/render.d.ts.map +1 -1
- package/dist/src/code-execution/isolate/render.js +7 -6
- package/dist/src/code-execution/isolate/render.js.map +1 -1
- package/dist/src/code-execution/isolate/scripts.d.ts.map +1 -1
- package/dist/src/code-execution/isolate/scripts.js +5 -4
- package/dist/src/code-execution/isolate/scripts.js.map +1 -1
- package/dist/src/dendrite/index.d.ts +6 -0
- package/dist/src/dendrite/index.d.ts.map +1 -0
- package/dist/src/dendrite/index.js +3 -0
- package/dist/src/dendrite/index.js.map +1 -0
- package/dist/src/dendrite/presets.d.ts +60 -0
- package/dist/src/dendrite/presets.d.ts.map +1 -0
- package/dist/src/dendrite/presets.js +117 -0
- package/dist/src/dendrite/presets.js.map +1 -0
- package/dist/src/dendrite/registry.d.ts +260 -0
- package/dist/src/dendrite/registry.d.ts.map +1 -0
- package/dist/src/dendrite/registry.js +742 -0
- package/dist/src/dendrite/registry.js.map +1 -0
- package/dist/src/dendrite/types.d.ts +392 -0
- package/dist/src/dendrite/types.d.ts.map +1 -0
- package/dist/src/dendrite/types.js +24 -0
- package/dist/src/dendrite/types.js.map +1 -0
- package/dist/src/framework.d.ts +806 -118
- package/dist/src/framework.d.ts.map +1 -1
- package/dist/src/framework.js +4180 -1121
- package/dist/src/framework.js.map +1 -1
- package/dist/src/gate/event-gate.d.ts +36 -21
- package/dist/src/gate/event-gate.d.ts.map +1 -1
- package/dist/src/gate/event-gate.js +223 -149
- package/dist/src/gate/event-gate.js.map +1 -1
- package/dist/src/gate/recipe-reconcile.d.ts.map +1 -1
- package/dist/src/gate/recipe-reconcile.js +6 -5
- package/dist/src/gate/recipe-reconcile.js.map +1 -1
- package/dist/src/host-presentation.d.ts +4 -0
- package/dist/src/host-presentation.d.ts.map +1 -1
- package/dist/src/host-presentation.js +12 -10
- package/dist/src/host-presentation.js.map +1 -1
- package/dist/src/index.d.ts +6 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +7 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/inference-bounds.d.ts +37 -0
- package/dist/src/inference-bounds.d.ts.map +1 -0
- package/dist/src/inference-bounds.js +84 -0
- package/dist/src/inference-bounds.js.map +1 -0
- package/dist/src/line-reader.d.ts +7 -1
- package/dist/src/line-reader.d.ts.map +1 -1
- package/dist/src/line-reader.js +17 -6
- package/dist/src/line-reader.js.map +1 -1
- package/dist/src/mcpl/channel-registry.d.ts +84 -9
- package/dist/src/mcpl/channel-registry.d.ts.map +1 -1
- package/dist/src/mcpl/channel-registry.js +136 -58
- package/dist/src/mcpl/channel-registry.js.map +1 -1
- package/dist/src/mcpl/errors.d.ts +1 -0
- package/dist/src/mcpl/errors.d.ts.map +1 -1
- package/dist/src/mcpl/errors.js +3 -0
- package/dist/src/mcpl/errors.js.map +1 -1
- package/dist/src/mcpl/inbound-source.d.ts +2 -2
- package/dist/src/mcpl/inbound-source.js +2 -2
- package/dist/src/mcpl/inference-router.d.ts +11 -1
- package/dist/src/mcpl/inference-router.d.ts.map +1 -1
- package/dist/src/mcpl/inference-router.js +65 -9
- package/dist/src/mcpl/inference-router.js.map +1 -1
- package/dist/src/mcpl/modern-connection.d.ts +10 -7
- package/dist/src/mcpl/modern-connection.d.ts.map +1 -1
- package/dist/src/mcpl/modern-connection.js +85 -74
- package/dist/src/mcpl/modern-connection.js.map +1 -1
- package/dist/src/mcpl/protocol-family.d.ts +1 -1
- package/dist/src/mcpl/protocol-family.d.ts.map +1 -1
- package/dist/src/mcpl/protocol-family.js +45 -3
- package/dist/src/mcpl/protocol-family.js.map +1 -1
- package/dist/src/mcpl/push-coalescer.d.ts +11 -7
- package/dist/src/mcpl/push-coalescer.d.ts.map +1 -1
- package/dist/src/mcpl/push-coalescer.js +21 -0
- package/dist/src/mcpl/push-coalescer.js.map +1 -1
- package/dist/src/mcpl/references.d.ts +1 -2
- package/dist/src/mcpl/references.d.ts.map +1 -1
- package/dist/src/mcpl/references.js +3 -3
- package/dist/src/mcpl/references.js.map +1 -1
- package/dist/src/mcpl/server-connection.d.ts +14 -0
- package/dist/src/mcpl/server-connection.d.ts.map +1 -1
- package/dist/src/mcpl/server-connection.js +26 -22
- package/dist/src/mcpl/server-connection.js.map +1 -1
- package/dist/src/mcpl/tool-signature.d.ts +1 -0
- package/dist/src/mcpl/tool-signature.d.ts.map +1 -1
- package/dist/src/mcpl/tool-signature.js +16 -11
- package/dist/src/mcpl/tool-signature.js.map +1 -1
- package/dist/src/mcpl/toolsets-module.d.ts.map +1 -1
- package/dist/src/mcpl/toolsets-module.js +7 -0
- package/dist/src/mcpl/toolsets-module.js.map +1 -1
- package/dist/src/mcpl/transport.d.ts +44 -21
- package/dist/src/mcpl/transport.d.ts.map +1 -1
- package/dist/src/mcpl/transport.js +283 -64
- package/dist/src/mcpl/transport.js.map +1 -1
- package/dist/src/mcpl/types.d.ts +17 -1
- 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 +32 -4
- package/dist/src/module-registry.d.ts.map +1 -1
- package/dist/src/module-registry.js +189 -25
- package/dist/src/module-registry.js.map +1 -1
- package/dist/src/modules/discord/discord-js-client.d.ts.map +1 -1
- package/dist/src/modules/discord/discord-js-client.js +24 -16
- package/dist/src/modules/discord/discord-js-client.js.map +1 -1
- package/dist/src/modules/sender-name.d.ts +5 -4
- package/dist/src/modules/sender-name.d.ts.map +1 -1
- package/dist/src/modules/sender-name.js +7 -5
- package/dist/src/modules/sender-name.js.map +1 -1
- package/dist/src/modules/workspace/disk-agreement.d.ts +16 -8
- package/dist/src/modules/workspace/disk-agreement.d.ts.map +1 -1
- package/dist/src/modules/workspace/disk-agreement.js +33 -12
- package/dist/src/modules/workspace/disk-agreement.js.map +1 -1
- package/dist/src/modules/workspace/index.d.ts +6 -3
- package/dist/src/modules/workspace/index.d.ts.map +1 -1
- package/dist/src/modules/workspace/index.js +61 -15
- package/dist/src/modules/workspace/index.js.map +1 -1
- package/dist/src/modules/workspace/observe.d.ts +9 -1
- package/dist/src/modules/workspace/observe.d.ts.map +1 -1
- package/dist/src/modules/workspace/observe.js +50 -10
- package/dist/src/modules/workspace/observe.js.map +1 -1
- package/dist/src/modules/workspace/reconcile.d.ts +11 -1
- package/dist/src/modules/workspace/reconcile.d.ts.map +1 -1
- package/dist/src/modules/workspace/reconcile.js +19 -8
- package/dist/src/modules/workspace/reconcile.js.map +1 -1
- package/dist/src/modules/workspace/types.d.ts +8 -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/modules/workspace/watcher.d.ts +7 -0
- package/dist/src/modules/workspace/watcher.d.ts.map +1 -1
- package/dist/src/modules/workspace/watcher.js +7 -5
- package/dist/src/modules/workspace/watcher.js.map +1 -1
- package/dist/src/notice-tags.d.ts +2 -0
- package/dist/src/notice-tags.d.ts.map +1 -1
- package/dist/src/notice-tags.js +2 -0
- package/dist/src/notice-tags.js.map +1 -1
- package/dist/src/recovery/discord-awareness-outbox.d.ts.map +1 -1
- package/dist/src/recovery/discord-awareness-outbox.js +1 -9
- package/dist/src/recovery/discord-awareness-outbox.js.map +1 -1
- package/dist/src/silent-heartbeat.d.ts +4 -2
- package/dist/src/silent-heartbeat.d.ts.map +1 -1
- package/dist/src/silent-heartbeat.js +7 -4
- package/dist/src/silent-heartbeat.js.map +1 -1
- package/dist/src/stored-injections.d.ts +4 -0
- package/dist/src/stored-injections.d.ts.map +1 -1
- package/dist/src/stored-injections.js +6 -0
- package/dist/src/stored-injections.js.map +1 -1
- package/dist/src/supplied-text.d.ts +2 -0
- package/dist/src/supplied-text.d.ts.map +1 -1
- package/dist/src/supplied-text.js +16 -7
- package/dist/src/supplied-text.js.map +1 -1
- package/dist/src/tool-result-guard.js +1 -1
- package/dist/src/tool-result-guard.js.map +1 -1
- package/dist/src/tune-out/coordinator.d.ts +368 -16
- package/dist/src/tune-out/coordinator.d.ts.map +1 -1
- package/dist/src/tune-out/coordinator.js +1224 -136
- package/dist/src/tune-out/coordinator.js.map +1 -1
- package/dist/src/tune-out/tools.d.ts +115 -7
- package/dist/src/tune-out/tools.d.ts.map +1 -1
- package/dist/src/tune-out/tools.js +55 -18
- package/dist/src/tune-out/tools.js.map +1 -1
- package/dist/src/types/agent.d.ts +27 -1
- package/dist/src/types/agent.d.ts.map +1 -1
- package/dist/src/types/framework.d.ts +153 -15
- package/dist/src/types/framework.d.ts.map +1 -1
- package/dist/src/types/module.d.ts +42 -3
- package/dist/src/types/module.d.ts.map +1 -1
- package/dist/src/types/trace.d.ts +140 -3
- package/dist/src/types/trace.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/admission/admit.ts +113 -0
- package/src/agent.ts +138 -31
- package/src/api/mcp-server-core.ts +10 -3
- package/src/author-presentation.ts +81 -0
- package/src/code-execution/isolate/render.ts +7 -6
- package/src/code-execution/isolate/scripts.ts +5 -4
- package/src/dendrite/index.ts +32 -0
- package/src/dendrite/presets.ts +149 -0
- package/src/dendrite/registry.ts +808 -0
- package/src/dendrite/types.ts +397 -0
- package/src/framework.ts +4344 -1052
- package/src/gate/event-gate.ts +251 -150
- package/src/gate/recipe-reconcile.ts +7 -5
- package/src/host-presentation.ts +14 -10
- package/src/index.ts +16 -2
- package/src/inference-bounds.ts +111 -0
- package/src/line-reader.ts +22 -5
- package/src/mcpl/channel-registry.ts +170 -60
- package/src/mcpl/errors.ts +4 -0
- package/src/mcpl/inbound-source.ts +2 -2
- package/src/mcpl/inference-router.ts +67 -10
- package/src/mcpl/modern-connection.ts +83 -68
- package/src/mcpl/protocol-family.ts +37 -4
- package/src/mcpl/push-coalescer.ts +21 -7
- package/src/mcpl/references.ts +3 -4
- package/src/mcpl/server-connection.ts +30 -21
- package/src/mcpl/tool-signature.ts +18 -11
- package/src/mcpl/toolsets-module.ts +7 -0
- package/src/mcpl/transport.ts +261 -60
- package/src/mcpl/types.ts +18 -1
- package/src/module-registry.ts +178 -25
- package/src/modules/discord/discord-js-client.ts +33 -29
- package/src/modules/sender-name.ts +8 -5
- package/src/modules/workspace/disk-agreement.ts +39 -15
- package/src/modules/workspace/index.ts +65 -14
- package/src/modules/workspace/observe.ts +51 -10
- package/src/modules/workspace/reconcile.ts +22 -8
- package/src/modules/workspace/types.ts +5 -0
- package/src/modules/workspace/watcher.ts +8 -6
- package/src/notice-tags.ts +2 -0
- package/src/recovery/discord-awareness-outbox.ts +1 -11
- package/src/silent-heartbeat.ts +7 -4
- package/src/stored-injections.ts +7 -0
- package/src/supplied-text.ts +17 -6
- package/src/tool-result-guard.ts +1 -1
- package/src/tune-out/coordinator.ts +1374 -141
- package/src/tune-out/tools.ts +166 -13
- package/src/types/agent.ts +30 -1
- package/src/types/framework.ts +157 -15
- package/src/types/module.ts +42 -3
- package/src/types/trace.ts +154 -3
package/src/types/trace.ts
CHANGED
|
@@ -730,9 +730,10 @@ export type TraceEvent =
|
|
|
730
730
|
/** Signal that terminated the child, if any. */
|
|
731
731
|
signal: string | null;
|
|
732
732
|
/** Why the transport closed, in its own words, such as `child process
|
|
733
|
-
* exited, and
|
|
734
|
-
* null when it gave none, or when its
|
|
735
|
-
* own close text, which stays off the
|
|
733
|
+
* exited, and this host had stopped using the server's stdio (write
|
|
734
|
+
* EPIPE)` or `closed by host`; null when it gave none, or when its
|
|
735
|
+
* reason is a WebSocket server's own close text, which stays off the
|
|
736
|
+
* trace. */
|
|
736
737
|
reason: string | null;
|
|
737
738
|
/** True when a background reconnect loop will revive the connection. */
|
|
738
739
|
willReconnect: boolean;
|
|
@@ -887,6 +888,156 @@ export type TraceEvent =
|
|
|
887
888
|
since?: number;
|
|
888
889
|
})
|
|
889
890
|
|
|
891
|
+
/** A reader fork ended in prose without `deliver_summary`; its final prose was delivered as its report. */
|
|
892
|
+
| (TraceEventBase & {
|
|
893
|
+
type: 'tune-out:reader-prose-delivered';
|
|
894
|
+
agentName: string;
|
|
895
|
+
serverId: string;
|
|
896
|
+
channelId: string;
|
|
897
|
+
epochId: string;
|
|
898
|
+
chars: number;
|
|
899
|
+
})
|
|
900
|
+
|
|
901
|
+
/** Bounded work the host's stop() cut off: left live for the next boot to end as `host-restart`. */
|
|
902
|
+
| (TraceEventBase & {
|
|
903
|
+
type: 'dendrite:agent-interrupted';
|
|
904
|
+
agentName: string;
|
|
905
|
+
kind: string;
|
|
906
|
+
incarnation: number;
|
|
907
|
+
reason: 'host-stop';
|
|
908
|
+
})
|
|
909
|
+
|
|
910
|
+
/** A tune-out reader fork was derived for one invocation (subconscious.reader: 'forks'). */
|
|
911
|
+
| (TraceEventBase & {
|
|
912
|
+
type: 'tune-out:reader-fork';
|
|
913
|
+
agentName: string;
|
|
914
|
+
serverId: string;
|
|
915
|
+
channelId: string;
|
|
916
|
+
epochId: string;
|
|
917
|
+
trigger: 'cadence' | 'wake' | 'cancel';
|
|
918
|
+
/** Held messages the fork was handed, stored and queued. */
|
|
919
|
+
held: number;
|
|
920
|
+
/** Of those, the ones still queued behind the resident's turn. */
|
|
921
|
+
queued: number;
|
|
922
|
+
})
|
|
923
|
+
|
|
924
|
+
/**
|
|
925
|
+
* A tune-out reader fork threw: its framing, its derive or its run. One
|
|
926
|
+
* that failed before it reported gives its held messages back to the
|
|
927
|
+
* channel's backlog while the epoch still holds the channel (`returned`
|
|
928
|
+
* counts them), so the next reader for the channel is handed them.
|
|
929
|
+
*/
|
|
930
|
+
| (TraceEventBase & {
|
|
931
|
+
type: 'tune-out:reader-fork-failed';
|
|
932
|
+
agentName: string;
|
|
933
|
+
serverId: string;
|
|
934
|
+
channelId: string;
|
|
935
|
+
epochId: string;
|
|
936
|
+
trigger: 'cadence' | 'wake' | 'cancel';
|
|
937
|
+
error: string;
|
|
938
|
+
/** Whether the fork had reported through `deliver_summary` before it failed. */
|
|
939
|
+
reported: boolean;
|
|
940
|
+
returned: number;
|
|
941
|
+
})
|
|
942
|
+
|
|
943
|
+
// Dendrite: agent registry and lifecycle.
|
|
944
|
+
// `agent-created` is the consent event: it names the kind of agent, what
|
|
945
|
+
// ends it, and what happens to it when its spawner ends.
|
|
946
|
+
| (TraceEventBase & {
|
|
947
|
+
type: 'dendrite:agent-created';
|
|
948
|
+
agentName: string;
|
|
949
|
+
kind: string;
|
|
950
|
+
/** Whose weights; `inherit.from` is whose context. */
|
|
951
|
+
model?: string;
|
|
952
|
+
incarnation: number;
|
|
953
|
+
lifetime: import('../dendrite/types.js').AgentLifetime;
|
|
954
|
+
spawnedBy?: string;
|
|
955
|
+
onParentEnd?: import('../dendrite/types.js').ParentEndPolicy;
|
|
956
|
+
resultTo?: import('../dendrite/types.js').ResultRoute;
|
|
957
|
+
inherit?: import('../dendrite/types.js').ContextInheritance;
|
|
958
|
+
})
|
|
959
|
+
| (TraceEventBase & {
|
|
960
|
+
type: 'dendrite:agent-ended';
|
|
961
|
+
agentName: string;
|
|
962
|
+
kind: string;
|
|
963
|
+
incarnation: number;
|
|
964
|
+
reason: string;
|
|
965
|
+
by?: string;
|
|
966
|
+
/** The agent that spawned it, when its record names one. */
|
|
967
|
+
spawnedBy?: string;
|
|
968
|
+
})
|
|
969
|
+
| (TraceEventBase & {
|
|
970
|
+
/** The last event a replay of create()'s traces delivers when the
|
|
971
|
+
* buffer kept only their first 1,000: how many came after. */
|
|
972
|
+
type: 'dendrite:early-traces-dropped';
|
|
973
|
+
dropped: number;
|
|
974
|
+
})
|
|
975
|
+
| (TraceEventBase & {
|
|
976
|
+
type: 'dendrite:agent-orphaned';
|
|
977
|
+
agentName: string;
|
|
978
|
+
formerParent: string;
|
|
979
|
+
reason: string;
|
|
980
|
+
/** Agents offered as a new parent, nearest first. */
|
|
981
|
+
candidates: string[];
|
|
982
|
+
})
|
|
983
|
+
| (TraceEventBase & {
|
|
984
|
+
type: 'dendrite:agent-reparented';
|
|
985
|
+
agentName: string;
|
|
986
|
+
parent: string;
|
|
987
|
+
by?: string;
|
|
988
|
+
})
|
|
989
|
+
| (TraceEventBase & {
|
|
990
|
+
type: 'dendrite:activation-cancelled';
|
|
991
|
+
agentName: string;
|
|
992
|
+
by?: string;
|
|
993
|
+
reason?: string;
|
|
994
|
+
})
|
|
995
|
+
/** The message entered the recipient's store (not merely queued for it). */
|
|
996
|
+
| (TraceEventBase & {
|
|
997
|
+
type: 'dendrite:mail-delivered';
|
|
998
|
+
mailId: string;
|
|
999
|
+
kind: string;
|
|
1000
|
+
from: string;
|
|
1001
|
+
to: string;
|
|
1002
|
+
})
|
|
1003
|
+
/** Queued for the recipient's next boundary; `mail-delivered` follows when it lands. */
|
|
1004
|
+
| (TraceEventBase & {
|
|
1005
|
+
type: 'dendrite:mail-deferred';
|
|
1006
|
+
mailId: string;
|
|
1007
|
+
kind: string;
|
|
1008
|
+
from: string;
|
|
1009
|
+
to: string;
|
|
1010
|
+
})
|
|
1011
|
+
| (TraceEventBase & {
|
|
1012
|
+
type: 'dendrite:mail-held';
|
|
1013
|
+
mailId: string;
|
|
1014
|
+
kind: string;
|
|
1015
|
+
from: string;
|
|
1016
|
+
to: string;
|
|
1017
|
+
reason: string;
|
|
1018
|
+
})
|
|
1019
|
+
/**
|
|
1020
|
+
* The admission stage's decision for one inbound event (Dendrite §D):
|
|
1021
|
+
* who may receive it, whether it is held (the epoch id) or delivered,
|
|
1022
|
+
* whether it may wake them, and the gate's verdict.
|
|
1023
|
+
*/
|
|
1024
|
+
| (TraceEventBase & {
|
|
1025
|
+
type: 'admission:decided';
|
|
1026
|
+
lane: 'channel' | 'push';
|
|
1027
|
+
serverId: string;
|
|
1028
|
+
channelId?: string;
|
|
1029
|
+
messageId: string;
|
|
1030
|
+
recipients: string[];
|
|
1031
|
+
held: string | null;
|
|
1032
|
+
wake: boolean;
|
|
1033
|
+
gatePass: boolean;
|
|
1034
|
+
})
|
|
1035
|
+
/** Batched gate events dropped at delivery because their channel is held now. */
|
|
1036
|
+
| (TraceEventBase & {
|
|
1037
|
+
type: 'gate:held-dropped';
|
|
1038
|
+
dropped: number;
|
|
1039
|
+
channels: Array<string | undefined>;
|
|
1040
|
+
})
|
|
890
1041
|
// Inbound acceptance observation (mcpl/inbound-source.ts): an installed
|
|
891
1042
|
// InboundAcceptanceObserver threw. Delivery is unaffected; the observer's
|
|
892
1043
|
// own coverage is interrupted for that acceptance.
|