@animalabs/agent-framework 0.26.2 → 0.28.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 +99 -8
- package/dist/src/agent.d.ts +291 -23
- package/dist/src/agent.d.ts.map +1 -1
- package/dist/src/agent.js +596 -61
- package/dist/src/agent.js.map +1 -1
- package/dist/src/api/server.d.ts.map +1 -1
- package/dist/src/api/server.js +5 -4
- package/dist/src/api/server.js.map +1 -1
- package/dist/src/auto-continue.d.ts +34 -0
- package/dist/src/auto-continue.d.ts.map +1 -0
- package/dist/src/auto-continue.js +36 -0
- package/dist/src/auto-continue.js.map +1 -0
- package/dist/src/code-execution/isolate/scripts.d.ts +11 -0
- package/dist/src/code-execution/isolate/scripts.d.ts.map +1 -1
- package/dist/src/code-execution/isolate/scripts.js +5 -1
- 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 +1038 -193
- package/dist/src/framework.d.ts.map +1 -1
- package/dist/src/framework.js +5967 -1514
- package/dist/src/framework.js.map +1 -1
- package/dist/src/gate/event-gate.d.ts +405 -46
- package/dist/src/gate/event-gate.d.ts.map +1 -1
- package/dist/src/gate/event-gate.js +2646 -399
- 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/recipe-reconcile.d.ts +103 -0
- package/dist/src/gate/recipe-reconcile.d.ts.map +1 -0
- package/dist/src/gate/recipe-reconcile.js +325 -0
- package/dist/src/gate/recipe-reconcile.js.map +1 -0
- 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 +229 -8
- package/dist/src/gate/types.d.ts.map +1 -1
- package/dist/src/heartbeat/heartbeat.d.ts +184 -0
- package/dist/src/heartbeat/heartbeat.d.ts.map +1 -0
- package/dist/src/heartbeat/heartbeat.js +752 -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/index.d.ts +10 -4
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +7 -2
- package/dist/src/index.js.map +1 -1
- 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 +433 -113
- package/dist/src/mcpl/channel-registry.d.ts.map +1 -1
- package/dist/src/mcpl/channel-registry.js +1154 -435
- package/dist/src/mcpl/channel-registry.js.map +1 -1
- package/dist/src/mcpl/conversation-router.d.ts +16 -8
- package/dist/src/mcpl/conversation-router.d.ts.map +1 -1
- package/dist/src/mcpl/conversation-router.js +29 -15
- package/dist/src/mcpl/conversation-router.js.map +1 -1
- package/dist/src/mcpl/convert-block.d.ts.map +1 -1
- package/dist/src/mcpl/convert-block.js +14 -2
- package/dist/src/mcpl/convert-block.js.map +1 -1
- package/dist/src/mcpl/hook-orchestrator.d.ts +7 -1
- package/dist/src/mcpl/hook-orchestrator.d.ts.map +1 -1
- package/dist/src/mcpl/hook-orchestrator.js +32 -7
- package/dist/src/mcpl/hook-orchestrator.js.map +1 -1
- package/dist/src/mcpl/inbound-source.d.ts +26 -10
- package/dist/src/mcpl/inbound-source.d.ts.map +1 -1
- package/dist/src/mcpl/inbound-source.js +40 -69
- package/dist/src/mcpl/inbound-source.js.map +1 -1
- package/dist/src/mcpl/index.d.ts +5 -1
- package/dist/src/mcpl/index.d.ts.map +1 -1
- package/dist/src/mcpl/index.js +4 -0
- package/dist/src/mcpl/index.js.map +1 -1
- package/dist/src/mcpl/inference-router.d.ts +14 -2
- package/dist/src/mcpl/inference-router.d.ts.map +1 -1
- package/dist/src/mcpl/inference-router.js +73 -28
- package/dist/src/mcpl/inference-router.js.map +1 -1
- package/dist/src/mcpl/prose-grammar.d.ts +4 -0
- package/dist/src/mcpl/prose-grammar.d.ts.map +1 -1
- package/dist/src/mcpl/prose-grammar.js +6 -0
- package/dist/src/mcpl/prose-grammar.js.map +1 -1
- package/dist/src/mcpl/protocol-family.d.ts.map +1 -1
- package/dist/src/mcpl/protocol-family.js +3 -0
- package/dist/src/mcpl/protocol-family.js.map +1 -1
- package/dist/src/mcpl/push-coalescer.d.ts +20 -2
- package/dist/src/mcpl/push-coalescer.d.ts.map +1 -1
- package/dist/src/mcpl/push-coalescer.js +33 -11
- package/dist/src/mcpl/push-coalescer.js.map +1 -1
- package/dist/src/mcpl/reference-fetcher.d.ts +63 -42
- package/dist/src/mcpl/reference-fetcher.d.ts.map +1 -1
- package/dist/src/mcpl/reference-fetcher.js +177 -145
- package/dist/src/mcpl/reference-fetcher.js.map +1 -1
- package/dist/src/mcpl/references.d.ts +380 -46
- package/dist/src/mcpl/references.d.ts.map +1 -1
- package/dist/src/mcpl/references.js +736 -77
- package/dist/src/mcpl/references.js.map +1 -1
- package/dist/src/mcpl/server-connection.d.ts +93 -4
- package/dist/src/mcpl/server-connection.d.ts.map +1 -1
- package/dist/src/mcpl/server-connection.js +176 -11
- package/dist/src/mcpl/server-connection.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-lifecycle.d.ts +11 -0
- package/dist/src/mcpl/tool-lifecycle.d.ts.map +1 -1
- package/dist/src/mcpl/tool-lifecycle.js +21 -0
- package/dist/src/mcpl/tool-lifecycle.js.map +1 -1
- package/dist/src/mcpl/tool-presence.d.ts +311 -0
- package/dist/src/mcpl/tool-presence.d.ts.map +1 -0
- package/dist/src/mcpl/tool-presence.js +697 -0
- package/dist/src/mcpl/tool-presence.js.map +1 -0
- package/dist/src/mcpl/tool-result-normalize.d.ts +9 -3
- package/dist/src/mcpl/tool-result-normalize.d.ts.map +1 -1
- package/dist/src/mcpl/tool-result-normalize.js +14 -6
- package/dist/src/mcpl/tool-result-normalize.js.map +1 -1
- package/dist/src/mcpl/tool-signature.d.ts +46 -0
- package/dist/src/mcpl/tool-signature.d.ts.map +1 -0
- package/dist/src/mcpl/tool-signature.js +321 -0
- package/dist/src/mcpl/tool-signature.js.map +1 -0
- package/dist/src/mcpl/toolset-host.d.ts +251 -0
- package/dist/src/mcpl/toolset-host.d.ts.map +1 -0
- package/dist/src/mcpl/toolset-host.js +720 -0
- package/dist/src/mcpl/toolset-host.js.map +1 -0
- package/dist/src/mcpl/toolsets-module.d.ts +83 -0
- package/dist/src/mcpl/toolsets-module.d.ts.map +1 -0
- package/dist/src/mcpl/toolsets-module.js +523 -0
- package/dist/src/mcpl/toolsets-module.js.map +1 -0
- package/dist/src/mcpl/transport.d.ts +2 -2
- package/dist/src/mcpl/transport.d.ts.map +1 -1
- package/dist/src/mcpl/transport.js +3 -2
- package/dist/src/mcpl/transport.js.map +1 -1
- package/dist/src/mcpl/types.d.ts +24 -2
- package/dist/src/mcpl/types.d.ts.map +1 -1
- package/dist/src/mcpl/types.js.map +1 -1
- package/dist/src/mcpl/visible-content.d.ts +7 -9
- package/dist/src/mcpl/visible-content.d.ts.map +1 -1
- package/dist/src/mcpl/visible-content.js +21 -9
- package/dist/src/mcpl/visible-content.js.map +1 -1
- package/dist/src/module-registry.d.ts +27 -9
- package/dist/src/module-registry.d.ts.map +1 -1
- package/dist/src/module-registry.js +77 -17
- package/dist/src/module-registry.js.map +1 -1
- package/dist/src/modules/discord/index.js +1 -1
- package/dist/src/modules/discord/index.js.map +1 -1
- package/dist/src/modules/history/index.d.ts +2 -1
- package/dist/src/modules/history/index.d.ts.map +1 -1
- package/dist/src/modules/history/index.js +73 -28
- package/dist/src/modules/history/index.js.map +1 -1
- package/dist/src/modules/history/semantic.d.ts +108 -6
- package/dist/src/modules/history/semantic.d.ts.map +1 -1
- package/dist/src/modules/history/semantic.js +273 -57
- package/dist/src/modules/history/semantic.js.map +1 -1
- package/dist/src/modules/workspace/answers.d.ts +22 -0
- package/dist/src/modules/workspace/answers.d.ts.map +1 -0
- package/dist/src/modules/workspace/answers.js +123 -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 +184 -0
- package/dist/src/modules/workspace/direct-write.d.ts.map +1 -0
- package/dist/src/modules/workspace/direct-write.js +417 -0
- package/dist/src/modules/workspace/direct-write.js.map +1 -0
- 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 +27 -12
- package/dist/src/modules/workspace/edit-text.d.ts.map +1 -1
- package/dist/src/modules/workspace/edit-text.js +61 -29
- package/dist/src/modules/workspace/edit-text.js.map +1 -1
- package/dist/src/modules/workspace/effects.d.ts +10 -0
- package/dist/src/modules/workspace/effects.d.ts.map +1 -1
- package/dist/src/modules/workspace/effects.js +21 -14
- package/dist/src/modules/workspace/effects.js.map +1 -1
- package/dist/src/modules/workspace/index.d.ts +308 -78
- package/dist/src/modules/workspace/index.d.ts.map +1 -1
- package/dist/src/modules/workspace/index.js +2103 -720
- package/dist/src/modules/workspace/index.js.map +1 -1
- package/dist/src/modules/workspace/observe.d.ts +75 -63
- package/dist/src/modules/workspace/observe.d.ts.map +1 -1
- package/dist/src/modules/workspace/observe.js +366 -180
- package/dist/src/modules/workspace/observe.js.map +1 -1
- package/dist/src/modules/workspace/read-page.d.ts +41 -0
- package/dist/src/modules/workspace/read-page.d.ts.map +1 -0
- package/dist/src/modules/workspace/read-page.js +219 -0
- package/dist/src/modules/workspace/read-page.js.map +1 -0
- package/dist/src/modules/workspace/reconcile.d.ts.map +1 -1
- package/dist/src/modules/workspace/reconcile.js +26 -16
- package/dist/src/modules/workspace/reconcile.js.map +1 -1
- package/dist/src/modules/workspace/result-text.d.ts +68 -0
- package/dist/src/modules/workspace/result-text.d.ts.map +1 -0
- package/dist/src/modules/workspace/result-text.js +94 -0
- package/dist/src/modules/workspace/result-text.js.map +1 -0
- 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/text.d.ts +29 -12
- package/dist/src/modules/workspace/text.d.ts.map +1 -1
- package/dist/src/modules/workspace/text.js +35 -33
- package/dist/src/modules/workspace/text.js.map +1 -1
- package/dist/src/modules/workspace/types.d.ts +137 -60
- 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/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 +50 -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.d.ts +59 -0
- package/dist/src/sent-rows.d.ts.map +1 -0
- package/dist/src/sent-rows.js +145 -0
- package/dist/src/sent-rows.js.map +1 -0
- package/dist/src/silent-heartbeat.d.ts +17 -10
- package/dist/src/silent-heartbeat.d.ts.map +1 -1
- package/dist/src/silent-heartbeat.js.map +1 -1
- package/dist/src/stable-hash.d.ts +3 -0
- package/dist/src/stable-hash.d.ts.map +1 -0
- package/dist/src/stable-hash.js +15 -0
- package/dist/src/stable-hash.js.map +1 -0
- package/dist/src/stored-injections.d.ts +99 -0
- package/dist/src/stored-injections.d.ts.map +1 -0
- package/dist/src/stored-injections.js +106 -0
- package/dist/src/stored-injections.js.map +1 -0
- package/dist/src/text-as-stored.d.ts +4 -3
- package/dist/src/text-as-stored.d.ts.map +1 -1
- package/dist/src/text-as-stored.js +4 -3
- package/dist/src/text-as-stored.js.map +1 -1
- package/dist/src/thinking-drops.d.ts +74 -0
- package/dist/src/thinking-drops.d.ts.map +1 -0
- package/dist/src/thinking-drops.js +96 -0
- package/dist/src/thinking-drops.js.map +1 -0
- 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 +35 -1
- package/dist/src/tool-args.js.map +1 -1
- package/dist/src/tool-image-ledger.d.ts +9 -8
- package/dist/src/tool-image-ledger.d.ts.map +1 -1
- package/dist/src/tool-image-ledger.js +9 -8
- 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 +3 -1
- package/dist/src/tool-presentation.js.map +1 -1
- package/dist/src/tool-result-guard.d.ts +12 -6
- package/dist/src/tool-result-guard.d.ts.map +1 -1
- package/dist/src/tool-result-guard.js +44 -17
- package/dist/src/tool-result-guard.js.map +1 -1
- package/dist/src/tool-result-history.d.ts +176 -24
- package/dist/src/tool-result-history.d.ts.map +1 -1
- package/dist/src/tool-result-history.js +411 -91
- package/dist/src/tool-result-history.js.map +1 -1
- package/dist/src/tune-out/coordinator.d.ts +17 -9
- package/dist/src/tune-out/coordinator.d.ts.map +1 -1
- package/dist/src/tune-out/coordinator.js +84 -37
- 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 +217 -7
- package/dist/src/types/agent.d.ts.map +1 -1
- package/dist/src/types/events.d.ts +33 -9
- package/dist/src/types/events.d.ts.map +1 -1
- package/dist/src/types/framework.d.ts +39 -3
- package/dist/src/types/framework.d.ts.map +1 -1
- package/dist/src/types/module.d.ts +95 -9
- package/dist/src/types/module.d.ts.map +1 -1
- package/dist/src/types/trace.d.ts +91 -3
- package/dist/src/types/trace.d.ts.map +1 -1
- package/package.json +5 -4
- package/src/agent.ts +661 -67
- package/src/api/server.ts +5 -4
- package/src/auto-continue.ts +43 -0
- package/src/code-execution/isolate/scripts.ts +11 -3
- package/src/cut-off-round.ts +98 -0
- package/src/framework.ts +6168 -1540
- package/src/gate/event-gate.ts +2895 -405
- package/src/gate/index.ts +10 -1
- package/src/gate/recipe-reconcile.ts +355 -0
- package/src/gate/reply-judge.ts +512 -0
- package/src/gate/types.ts +234 -9
- package/src/heartbeat/heartbeat.ts +804 -0
- package/src/heartbeat/reminder-time.ts +107 -0
- package/src/index.ts +11 -4
- package/src/mcpl/capability-mask.ts +3 -2
- package/src/mcpl/channel-registry.ts +1222 -468
- package/src/mcpl/conversation-router.ts +34 -16
- package/src/mcpl/convert-block.ts +14 -1
- package/src/mcpl/hook-orchestrator.ts +33 -6
- package/src/mcpl/inbound-source.ts +42 -69
- package/src/mcpl/index.ts +6 -1
- package/src/mcpl/inference-router.ts +79 -34
- package/src/mcpl/prose-grammar.ts +7 -0
- package/src/mcpl/protocol-family.ts +2 -0
- package/src/mcpl/push-coalescer.ts +51 -13
- package/src/mcpl/reference-fetcher.ts +201 -162
- package/src/mcpl/references.ts +851 -77
- package/src/mcpl/server-connection.ts +189 -11
- package/src/mcpl/tags.ts +13 -2
- package/src/mcpl/tool-lifecycle.ts +21 -0
- package/src/mcpl/tool-presence.ts +716 -0
- package/src/mcpl/tool-result-normalize.ts +18 -6
- package/src/mcpl/tool-signature.ts +316 -0
- package/src/mcpl/toolset-host.ts +727 -0
- package/src/mcpl/toolsets-module.ts +545 -0
- package/src/mcpl/transport.ts +3 -2
- package/src/mcpl/types.ts +25 -2
- package/src/mcpl/visible-content.ts +22 -9
- package/src/module-registry.ts +85 -26
- package/src/modules/discord/index.ts +1 -1
- package/src/modules/history/index.ts +70 -30
- package/src/modules/history/semantic.ts +308 -54
- package/src/modules/workspace/answers.ts +133 -0
- package/src/modules/workspace/branch-intent.ts +10 -5
- package/src/modules/workspace/direct-write.ts +460 -0
- package/src/modules/workspace/disk-agreement.ts +52 -21
- package/src/modules/workspace/edit-text.ts +84 -35
- package/src/modules/workspace/effects.ts +22 -13
- package/src/modules/workspace/index.ts +2142 -723
- package/src/modules/workspace/observe.ts +381 -177
- package/src/modules/workspace/read-page.ts +228 -0
- package/src/modules/workspace/reconcile.ts +27 -15
- package/src/modules/workspace/result-text.ts +121 -0
- package/src/modules/workspace/sync.ts +16 -0
- package/src/modules/workspace/text.ts +58 -32
- package/src/modules/workspace/types.ts +137 -60
- package/src/modules/workspace/watcher.ts +8 -3
- package/src/prose-drafts.ts +4 -3
- package/src/reasoning-loss-notice.ts +62 -0
- package/src/reasoning-loss.ts +120 -0
- package/src/send-tools.ts +3 -2
- package/src/sent-rows.ts +162 -0
- package/src/silent-heartbeat.ts +17 -10
- package/src/stable-hash.ts +14 -0
- package/src/stored-injections.ts +131 -0
- package/src/text-as-stored.ts +4 -3
- package/src/thinking-drops.ts +135 -0
- package/src/tool-args.ts +34 -1
- package/src/tool-image-ledger.ts +9 -8
- package/src/tool-presentation.ts +3 -1
- package/src/tool-result-guard.ts +45 -17
- package/src/tool-result-history.ts +471 -90
- package/src/tune-out/coordinator.ts +80 -37
- package/src/tune-out/tools.ts +4 -1
- package/src/types/agent.ts +220 -7
- package/src/types/events.ts +33 -9
- package/src/types/framework.ts +36 -3
- package/src/types/module.ts +91 -9
- package/src/types/trace.ts +94 -3
package/dist/src/gate/types.d.ts
CHANGED
|
@@ -12,9 +12,10 @@
|
|
|
12
12
|
* bucket are denied (decision: trigger=false). Tokens regenerate at one per
|
|
13
13
|
* `refillIntervalMs`, capped at `tokens`. Buckets are partitioned by the
|
|
14
14
|
* value of `keyBy` resolved against event metadata — so a per-user limit
|
|
15
|
-
* uses `keyBy: "senderId"`, a per-channel limit uses `keyBy: "channelId"
|
|
16
|
-
*
|
|
17
|
-
*
|
|
15
|
+
* uses `keyBy: "senderId"`, a per-channel limit uses `keyBy: "channelId"`
|
|
16
|
+
* (resolved to the channel's registered id, as `keyBy` says), etc. With no
|
|
17
|
+
* `keyBy` (or when the resolved value is missing), one shared bucket is used
|
|
18
|
+
* for the policy.
|
|
18
19
|
*/
|
|
19
20
|
export interface RateLimitConfig {
|
|
20
21
|
/** Max bucket capacity, also the initial fill. Must be > 0. */
|
|
@@ -22,8 +23,12 @@ export interface RateLimitConfig {
|
|
|
22
23
|
/** Milliseconds between token regenerations. Must be > 0. */
|
|
23
24
|
refillIntervalMs: number;
|
|
24
25
|
/**
|
|
25
|
-
* Metadata field name to partition buckets by.
|
|
26
|
-
*
|
|
26
|
+
* Metadata field name to partition buckets by. `"channelId"` takes the
|
|
27
|
+
* channel's registered id where the gate resolves one, as `match.channel`
|
|
28
|
+
* does, so a channel's push events share its messages' bucket, a voice
|
|
29
|
+
* report's included, though it carries no `channelId`. Otherwise, if
|
|
30
|
+
* absent or the metadata field is missing on a given event, all such
|
|
31
|
+
* events share one bucket.
|
|
27
32
|
*/
|
|
28
33
|
keyBy?: string;
|
|
29
34
|
}
|
|
@@ -39,9 +44,42 @@ export interface RateLimitConfig {
|
|
|
39
44
|
export interface PassiveSampleConfig {
|
|
40
45
|
/** Trigger every N-th match. Must be > 0. */
|
|
41
46
|
every: number;
|
|
42
|
-
/** Optional metadata field name for separate per-key counters
|
|
47
|
+
/** Optional metadata field name for separate per-key counters, resolved
|
|
48
|
+
* as `RateLimitConfig.keyBy` is. */
|
|
43
49
|
keyBy?: string;
|
|
44
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Configuration for the `judge` behavior: batch matching events as `debounce`
|
|
53
|
+
* does, then, instead of waking the agent when the batch fires, ask a small,
|
|
54
|
+
* cheap model (the host's reply judge, `GateOptions.judge`) whether now is a
|
|
55
|
+
* good time for the agent to reply. The judge reads the agent's context as one
|
|
56
|
+
* document (its newest part), the agent's own `instructions` and the batch,
|
|
57
|
+
* and answers reply or wait. On reply the
|
|
58
|
+
* batch is delivered as a debounce's is; on wait the agent isn't woken: the
|
|
59
|
+
* events are in its context already, as for `defer`, and the next batch is
|
|
60
|
+
* judged afresh. Rules are read in order, as ever: a mention rule placed ahead
|
|
61
|
+
* of a judge rule wakes the agent without the judge. A judge that fails or
|
|
62
|
+
* times out wakes the agent (fail open),
|
|
63
|
+
* unless the host set its `onError` to `"skip"`.
|
|
64
|
+
*/
|
|
65
|
+
export interface JudgeConfig {
|
|
66
|
+
/** Quiet period (ms) before the batch is judged, as `debounce`'s. */
|
|
67
|
+
debounceMs: number;
|
|
68
|
+
/**
|
|
69
|
+
* The longest (ms) a batch waits from its first event before it's judged,
|
|
70
|
+
* even while events keep arriving and pushing the quiet period back. Left
|
|
71
|
+
* out, a batch is judged only after `debounceMs` of quiet, as a debounce
|
|
72
|
+
* delivers.
|
|
73
|
+
*/
|
|
74
|
+
maxWaitMs?: number;
|
|
75
|
+
/**
|
|
76
|
+
* The agent's own word to the judge: when it wants to be woken and when it
|
|
77
|
+
* would rather stay quiet ("wake me when someone asks me something or the
|
|
78
|
+
* talk turns to the garden; let banter between others go by"). Shown to the
|
|
79
|
+
* judge with every batch this rule sends it.
|
|
80
|
+
*/
|
|
81
|
+
instructions?: string;
|
|
82
|
+
}
|
|
45
83
|
/** How a matching policy affects inference triggering. */
|
|
46
84
|
export type GateBehavior = 'always' | 'defer' | 'skip' | {
|
|
47
85
|
debounce: number;
|
|
@@ -49,6 +87,8 @@ export type GateBehavior = 'always' | 'defer' | 'skip' | {
|
|
|
49
87
|
rate_limit: RateLimitConfig;
|
|
50
88
|
} | {
|
|
51
89
|
passive_sample: PassiveSampleConfig;
|
|
90
|
+
} | {
|
|
91
|
+
judge: JudgeConfig;
|
|
52
92
|
};
|
|
53
93
|
/** Criteria for matching an event. All specified fields must match (AND logic). */
|
|
54
94
|
export interface GatePolicyMatch {
|
|
@@ -56,7 +96,12 @@ export interface GatePolicyMatch {
|
|
|
56
96
|
scope?: string[];
|
|
57
97
|
/** ServerId to match (exact or glob with *). */
|
|
58
98
|
source?: string;
|
|
59
|
-
/**
|
|
99
|
+
/** Channel to match (exact or glob with *): against the event's channel
|
|
100
|
+
* id, then the registered id the gate resolves for it
|
|
101
|
+
* (`resolveRouteChannel`). A channels/incoming message carries the
|
|
102
|
+
* registered id (`discord:<guild>:<channel>`), and a push the adapter's
|
|
103
|
+
* raw one or none, so a registered-form pattern meets every event in its
|
|
104
|
+
* channel whose push names the channel, and a raw id only push events. */
|
|
60
105
|
channel?: string;
|
|
61
106
|
/** Content text filter. */
|
|
62
107
|
filter?: {
|
|
@@ -131,7 +176,17 @@ export interface GateConfig {
|
|
|
131
176
|
export interface GateOptions {
|
|
132
177
|
/** Path to gate.json. Default: derived from storePath. */
|
|
133
178
|
configPath?: string;
|
|
134
|
-
/**
|
|
179
|
+
/**
|
|
180
|
+
* The recipe's gate config. The first start seeds gate.json with it. Each
|
|
181
|
+
* later start merges it into gate.json against the recipe last applied,
|
|
182
|
+
* which the gate keeps beside gate.json (`gate.recipe.json`): a rule the
|
|
183
|
+
* recipe dropped, renamed, moved or redefined follows it, a rule edited at
|
|
184
|
+
* run time or by hand stays, and so does one no recipe declared. Rules are
|
|
185
|
+
* merged by name, compared by what they mean and kept as written: a
|
|
186
|
+
* recipe's rule with no name is never merged, as one with no name was never
|
|
187
|
+
* added, and where gate.json or the recipe names a rule twice, a start only
|
|
188
|
+
* adds the rules gate.json lacks. See `recipe-reconcile.ts`.
|
|
189
|
+
*/
|
|
135
190
|
config?: GateConfig;
|
|
136
191
|
/**
|
|
137
192
|
* Path to a JSON file listing user ids that may wake the agent even while
|
|
@@ -140,7 +195,110 @@ export interface GateOptions {
|
|
|
140
195
|
* missing, no one bypasses sleep.
|
|
141
196
|
*/
|
|
142
197
|
privilegedUsersPath?: string;
|
|
198
|
+
/** The reply judge that `judge` rules ask (see JudgeConfig). Left out (or
|
|
199
|
+
* null), the judge is wired with its defaults; it runs only for `judge`
|
|
200
|
+
* rules, so a gate with none makes no judge calls. */
|
|
201
|
+
judge?: ReplyJudgeOptions | null;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Host options for the reply judge, the small model `judge` rules ask whether
|
|
205
|
+
* now is a good time for the agent to reply. The host sets the model and how
|
|
206
|
+
* the judge runs, not the agent: an agent's rule says when to ask and what to
|
|
207
|
+
* say.
|
|
208
|
+
*/
|
|
209
|
+
export interface ReplyJudgeOptions {
|
|
210
|
+
/** False leaves the judge unwired: `wake_add_rule` then offers no `judge`,
|
|
211
|
+
* and a `judge` rule in gate.json wakes the agent as a debounce of its
|
|
212
|
+
* `debounceMs` would, which gate_status says. Default true. */
|
|
213
|
+
enabled?: boolean;
|
|
214
|
+
/** The model the judge runs on, as the host's membrane names it. Default
|
|
215
|
+
* `claude-haiku-5-5`. */
|
|
216
|
+
model?: string;
|
|
217
|
+
/**
|
|
218
|
+
* The most input tokens one judge request may carry, its instructions and
|
|
219
|
+
* the batch included; the context document is cut from its oldest end to
|
|
220
|
+
* fit. Default 90,000: Claude Haiku 5.5 costs five times as much past
|
|
221
|
+
* 100,000 input tokens, and the margin covers the estimate's error. The
|
|
222
|
+
* least is 4,000, a short tail of the conversation: cheaper and quicker,
|
|
223
|
+
* with less of the room's history to weigh.
|
|
224
|
+
*/
|
|
225
|
+
maxInputTokens?: number;
|
|
226
|
+
/** The longest (ms) a judge request may take before the batch is decided by
|
|
227
|
+
* `onError`. Default 20,000. */
|
|
228
|
+
timeoutMs?: number;
|
|
229
|
+
/** What a judge that fails, times out or answers unreadably does: `"wake"`
|
|
230
|
+
* wakes the agent as a debounce would (the default, so a judge outage
|
|
231
|
+
* never silences the agent); `"skip"` doesn't. */
|
|
232
|
+
onError?: 'wake' | 'skip';
|
|
233
|
+
/** The judge's effort (`output_config.effort`). Default `"low"`: a short
|
|
234
|
+
* verdict, quickly. `"none"` sends no effort, for a provider that doesn't
|
|
235
|
+
* take Anthropic's `output_config`. */
|
|
236
|
+
effort?: 'low' | 'medium' | 'high' | 'none';
|
|
237
|
+
/** The prompt cache's lifetime for the judge's context document. `"5m"`
|
|
238
|
+
* (the default) suits judge rules that fire minutes apart; `"1h"` costs
|
|
239
|
+
* more to write and suits ones that fire less often. */
|
|
240
|
+
cacheTtl?: '5m' | '1h';
|
|
143
241
|
}
|
|
242
|
+
/** One event of a batch, as the reply judge is shown it. */
|
|
243
|
+
export interface JudgeEventSummary {
|
|
244
|
+
eventType: string;
|
|
245
|
+
/** The channel as the agent is shown it, when the event named one. */
|
|
246
|
+
channel?: string;
|
|
247
|
+
/** The author's id, when the event named one. */
|
|
248
|
+
authorId?: string;
|
|
249
|
+
/** Whether the event addressed the agent (mention, reply, DM). */
|
|
250
|
+
addressed: boolean;
|
|
251
|
+
/** The event's text, cut short when long. */
|
|
252
|
+
content: string;
|
|
253
|
+
/** When the event arrived (ms). */
|
|
254
|
+
at: number;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Something that will (or, for a batch going to the judge, may) wake the
|
|
258
|
+
* agent with no new event: what the judge is told would happen if it answers
|
|
259
|
+
* wait and nothing else arrives.
|
|
260
|
+
*/
|
|
261
|
+
export interface UpcomingWake {
|
|
262
|
+
/** When (ms), when known; absent for one due as soon as the agent is free. */
|
|
263
|
+
at?: number;
|
|
264
|
+
/** False when it only may wake the agent (a judge rule's batch goes to the judge then). */
|
|
265
|
+
certain: boolean;
|
|
266
|
+
/** What it is, as the judge is told ("its own skip_reply timer"). */
|
|
267
|
+
what: string;
|
|
268
|
+
}
|
|
269
|
+
/** What the gate asks the reply judge for one batch. */
|
|
270
|
+
export interface JudgeRequest {
|
|
271
|
+
/** The rule whose batch this is. */
|
|
272
|
+
policyName: string;
|
|
273
|
+
/** The rule's `instructions`, the agent's own word to the judge. */
|
|
274
|
+
instructions?: string;
|
|
275
|
+
/** The batch, oldest first. */
|
|
276
|
+
events: JudgeEventSummary[];
|
|
277
|
+
/** The agents the batch would wake. */
|
|
278
|
+
agentNames: string[];
|
|
279
|
+
/** The gate's own timers that will wake those agents with no new event
|
|
280
|
+
* (upcomingWakes): their self-wakes, a sleep's end, other rules' pending
|
|
281
|
+
* batches. The judge adds what the framework knows besides. */
|
|
282
|
+
upcomingWakes?: UpcomingWake[];
|
|
283
|
+
/** Aborted when the judge's time is up or the gate is disposed. */
|
|
284
|
+
signal: AbortSignal;
|
|
285
|
+
}
|
|
286
|
+
/** The reply judge's answer for one batch. */
|
|
287
|
+
export interface JudgeVerdict {
|
|
288
|
+
/** True: wake the agent now. False: let the batch go by. */
|
|
289
|
+
reply: boolean;
|
|
290
|
+
/** The judge's one-line reason. */
|
|
291
|
+
reason: string;
|
|
292
|
+
/** The model that answered. */
|
|
293
|
+
model?: string;
|
|
294
|
+
/** Input tokens the request carried (all of them: uncached, cache reads and writes). */
|
|
295
|
+
inputTokens?: number;
|
|
296
|
+
/** Of those, the tokens read from the prompt cache. */
|
|
297
|
+
cacheReadTokens?: number;
|
|
298
|
+
outputTokens?: number;
|
|
299
|
+
}
|
|
300
|
+
/** The judge's function, as the framework wires it into the gate. */
|
|
301
|
+
export type JudgeFn = (request: JudgeRequest) => Promise<JudgeVerdict>;
|
|
144
302
|
/** The result of evaluating an event against the gate. */
|
|
145
303
|
export interface GateDecision {
|
|
146
304
|
/** Whether to trigger inference. */
|
|
@@ -198,6 +356,45 @@ export interface GateEventInfo {
|
|
|
198
356
|
/** Event tags (MCPL RFC-001), already implication-expanded by the host. */
|
|
199
357
|
tags?: string[];
|
|
200
358
|
}
|
|
359
|
+
/** An MCPL event whose content the framework stored at arrival, as a
|
|
360
|
+
* batched wake names it to the framework (EventGate's `isNewestEntry`):
|
|
361
|
+
* a channel message by its server, channel and message id, a push event by
|
|
362
|
+
* its server and event id. */
|
|
363
|
+
export interface GateEntryRef {
|
|
364
|
+
eventType: string;
|
|
365
|
+
serverId?: string;
|
|
366
|
+
channelId?: string;
|
|
367
|
+
messageId?: string;
|
|
368
|
+
eventId?: string;
|
|
369
|
+
}
|
|
370
|
+
/** A batched wake's `[Gate: …]` line that the gate handed to the wake rather
|
|
371
|
+
* than wrote: its batch was one event whose entry was still the newest in
|
|
372
|
+
* the window when the batch fired (EventGate's `isNewestEntry`). A fresh
|
|
373
|
+
* start of the wake's turn decides it (the framework's placeWakeLines): the
|
|
374
|
+
* delivery agent's own start leaves it out while that entry is still the
|
|
375
|
+
* newest, and writes it once something follows; a co-resident's start
|
|
376
|
+
* places none; two or more such lines are each written;
|
|
377
|
+
* and none is written while the host is quiesced or another reader of the
|
|
378
|
+
* residents' shared slot has a turn alive. A line left out stays for a
|
|
379
|
+
* later fresh start of the same wake. Its text is rendered when it's
|
|
380
|
+
* written (wakeLineText), so its age is true then.
|
|
381
|
+
*
|
|
382
|
+
* Every request for one wake carries the same object: the framework writes
|
|
383
|
+
* each line once by its identity, across the wake's retries and holds. A
|
|
384
|
+
* host that hands the gate's requests on itself passes the line on as it
|
|
385
|
+
* is, not a copy per agent. */
|
|
386
|
+
export interface WakeLine {
|
|
387
|
+
/** The event's own entry. */
|
|
388
|
+
entry: GateEntryRef;
|
|
389
|
+
policyNames: string[];
|
|
390
|
+
/** The channel as the line names it to the agent. */
|
|
391
|
+
shown: string;
|
|
392
|
+
/** When the event arrived (ms): the line's age is counted from it to when
|
|
393
|
+
* the line is written (wakeLineText). */
|
|
394
|
+
at: number;
|
|
395
|
+
/** The channel the line names, as the omission's trace reports it. */
|
|
396
|
+
channelId?: string;
|
|
397
|
+
}
|
|
201
398
|
/** Per-policy runtime statistics (for gate:status). */
|
|
202
399
|
export interface GatePolicyStats {
|
|
203
400
|
name: string;
|
|
@@ -218,6 +415,30 @@ export interface GatePolicyStats {
|
|
|
218
415
|
counterCount: number;
|
|
219
416
|
fireCount: number;
|
|
220
417
|
};
|
|
418
|
+
/** Present for `judge` behaviors. */
|
|
419
|
+
judgeState?: {
|
|
420
|
+
/** Events in the batch still waiting out its quiet period. */
|
|
421
|
+
pendingCount: number;
|
|
422
|
+
/** Whether the judge is deciding one of this rule's batches now. */
|
|
423
|
+
judging: boolean;
|
|
424
|
+
/** Events held for the judge until the agent's turn (or the host's quiesce) ends. */
|
|
425
|
+
heldCount: number;
|
|
426
|
+
/** Verdicts so far: woke the agent, let the batch go by, and judge failures. */
|
|
427
|
+
verdicts: {
|
|
428
|
+
reply: number;
|
|
429
|
+
wait: number;
|
|
430
|
+
error: number;
|
|
431
|
+
};
|
|
432
|
+
/** The newest verdict. */
|
|
433
|
+
last?: {
|
|
434
|
+
at: number;
|
|
435
|
+
verdict: 'reply' | 'wait' | 'error';
|
|
436
|
+
reason: string;
|
|
437
|
+
eventCount: number;
|
|
438
|
+
durationMs: number;
|
|
439
|
+
inputTokens?: number;
|
|
440
|
+
};
|
|
441
|
+
};
|
|
221
442
|
}
|
|
222
443
|
/** Full gate status returned by gate:status tool. */
|
|
223
444
|
export interface GateStatus {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/gate/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/gate/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,eAAe;IAC9B,+DAA+D;IAC/D,MAAM,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,gBAAgB,EAAE,MAAM,CAAC;IACzB;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,mBAAmB;IAClC,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd;yCACqC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,WAAW;IAC1B,qEAAqE;IACrE,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,0DAA0D;AAC1D,MAAM,MAAM,YAAY,GACpB,QAAQ,GACR,OAAO,GACP,MAAM,GACN;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,GACpB;IAAE,UAAU,EAAE,eAAe,CAAA;CAAE,GAC/B;IAAE,cAAc,EAAE,mBAAmB,CAAA;CAAE,GACvC;IAAE,KAAK,EAAE,WAAW,CAAA;CAAE,CAAC;AAM3B,mFAAmF;AACnF,MAAM,WAAW,eAAe;IAC9B,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;+EAK2E;IAC3E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2BAA2B;IAC3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AC,MAAM,EAAE;YAAE,SAAS,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KACrE,CAAC;IACF,+DAA+D;IAC/D,KAAK,CAAC,EAAE;QACN,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,0EAA0E;QAC1E,UAAU,EAAE,MAAM,CAAC;QACnB,gEAAgE;QAChE,eAAe,EAAE,MAAM,CAAC;KACzB,CAAC;CACH"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The heartbeat: the agent's own schedule of wakes, in the framework.
|
|
3
|
+
*
|
|
4
|
+
* Two kinds of wake, both the agent's to set:
|
|
5
|
+
* - the ambient heartbeat, one periodic tick (`intervalSeconds`, `paused`,
|
|
6
|
+
* `message`, `deliveryMode`): a message-mode tick is a timestamped prompt
|
|
7
|
+
* stored in the agent's window, a silent tick a private wake that stores
|
|
8
|
+
* no prompt and suppresses automatic prose (silent-heartbeat.ts);
|
|
9
|
+
* - reminders, one-off (a delay or an `atIso` time) or repeating (an
|
|
10
|
+
* interval), each a stored message with a header naming it and the time.
|
|
11
|
+
*
|
|
12
|
+
* This was heartbeat-mcpl, an MCPL server; it moved here so the framework
|
|
13
|
+
* knows when the agent's next scheduled wake is (the reply judge is told,
|
|
14
|
+
* EventGate.upcomingWakes) and needs no server, policy exchange or push
|
|
15
|
+
* delivery to keep it. Its tools are listed as `heartbeat--heartbeat_status`
|
|
16
|
+
* and the rest, and calls by heartbeat-mcpl's names (`mcpl--heartbeat--…`)
|
|
17
|
+
* reach them too. Its wakes go to the gate as that server's pushes did, a
|
|
18
|
+
* push from the server id `heartbeat`, so the agent's rules decide them as
|
|
19
|
+
* they decided those, and a sleep lets them through, as it let that server
|
|
20
|
+
* id through.
|
|
21
|
+
*
|
|
22
|
+
* State (the schedule, when the next tick is due, and the reminders) is one
|
|
23
|
+
* JSON file, by default `{storePath}/config/heartbeat.json`. A first start
|
|
24
|
+
* with no file imports heartbeat-mcpl's two files when the host names them
|
|
25
|
+
* (`importFrom`). The next tick's time is kept, so a restart doesn't push it
|
|
26
|
+
* back; a tick or a reminder that fell due while the host was down fires
|
|
27
|
+
* once, shortly after start, a repeating reminder once for the periods it
|
|
28
|
+
* missed.
|
|
29
|
+
*/
|
|
30
|
+
import type { UpcomingWake } from '../gate/types.js';
|
|
31
|
+
import type { ToolDefinition } from '../types/events.js';
|
|
32
|
+
/** The prefix the heartbeat's tools carry. */
|
|
33
|
+
export declare const HEARTBEAT_TOOL_PREFIX = "heartbeat--";
|
|
34
|
+
/** The prefix heartbeat-mcpl's tools carried under the server id `heartbeat`
|
|
35
|
+
* and the default tool prefix: a call by that name, as the agent's context
|
|
36
|
+
* may still show them, reaches the same tool. */
|
|
37
|
+
export declare const LEGACY_HEARTBEAT_TOOL_PREFIX = "mcpl--heartbeat--";
|
|
38
|
+
/**
|
|
39
|
+
* Whether an MCPL server is heartbeat-mcpl, or names its tools as the
|
|
40
|
+
* heartbeat's: by its id, a tool prefix of `heartbeat` or `mcpl--heartbeat`,
|
|
41
|
+
* or a command or argument that runs heartbeat-mcpl. The framework's
|
|
42
|
+
* heartbeat refuses one beside it, at create and at a runtime connect.
|
|
43
|
+
*/
|
|
44
|
+
export declare function isHeartbeatMcplServer(server: {
|
|
45
|
+
id: string;
|
|
46
|
+
toolPrefix?: string;
|
|
47
|
+
}): boolean;
|
|
48
|
+
/** A heartbeat tool's name under the other prefix, for a name under one: the
|
|
49
|
+
* framework's `heartbeat--x` and heartbeat-mcpl's `mcpl--heartbeat--x` are
|
|
50
|
+
* one tool. Undefined for any other name. */
|
|
51
|
+
export declare function heartbeatToolAlias(name: string): string | undefined;
|
|
52
|
+
/** The tools that change the schedule, as against the two that only show it. */
|
|
53
|
+
export declare const HEARTBEAT_CHANGING_TOOLS: readonly string[];
|
|
54
|
+
export type HeartbeatDeliveryMode = 'message' | 'silent';
|
|
55
|
+
/** The ambient heartbeat's schedule. */
|
|
56
|
+
export interface HeartbeatSettings {
|
|
57
|
+
intervalSeconds: number;
|
|
58
|
+
paused: boolean;
|
|
59
|
+
message: string;
|
|
60
|
+
deliveryMode: HeartbeatDeliveryMode;
|
|
61
|
+
}
|
|
62
|
+
export declare const DEFAULT_HEARTBEAT: Readonly<HeartbeatSettings>;
|
|
63
|
+
/** A scheduled reminder. `everySeconds` null: one-off, dropped once it fires. */
|
|
64
|
+
export interface Reminder {
|
|
65
|
+
id: string;
|
|
66
|
+
message: string;
|
|
67
|
+
/** When it was set (ms). */
|
|
68
|
+
createdAt: number;
|
|
69
|
+
/** When it's next due (ms). */
|
|
70
|
+
fireAt: number;
|
|
71
|
+
everySeconds: number | null;
|
|
72
|
+
/** When a delivery that failed is tried again (ms); its `fireAt` stays the time it was due. */
|
|
73
|
+
retryAt?: number;
|
|
74
|
+
}
|
|
75
|
+
/** Host options (`FrameworkConfig.heartbeat`). */
|
|
76
|
+
export interface HeartbeatOptions {
|
|
77
|
+
/** The state file. Default `{storePath}/config/heartbeat.json`. */
|
|
78
|
+
statePath?: string;
|
|
79
|
+
/** The schedule a first start writes when there's nothing to import. */
|
|
80
|
+
defaults?: Partial<HeartbeatSettings>;
|
|
81
|
+
/**
|
|
82
|
+
* heartbeat-mcpl's files (its HEARTBEAT_CONFIG_FILE and
|
|
83
|
+
* HEARTBEAT_REMINDERS_FILE), read once, by a start that finds no state
|
|
84
|
+
* file, so an agent moving off the server keeps its schedule and its
|
|
85
|
+
* reminders. They're left as they are.
|
|
86
|
+
*/
|
|
87
|
+
importFrom?: {
|
|
88
|
+
configPath?: string;
|
|
89
|
+
remindersPath?: string;
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
/** A wake the heartbeat asks the framework to deliver. */
|
|
93
|
+
export type HeartbeatWake = {
|
|
94
|
+
kind: 'heartbeat';
|
|
95
|
+
reason: 'schedule' | 'manual';
|
|
96
|
+
silent: boolean;
|
|
97
|
+
text: string;
|
|
98
|
+
eventId: string;
|
|
99
|
+
} | {
|
|
100
|
+
kind: 'reminder';
|
|
101
|
+
reminderId: string;
|
|
102
|
+
recurring: boolean;
|
|
103
|
+
text: string;
|
|
104
|
+
eventId: string;
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* A time as the heartbeat's texts show it, to the second, with its offset and
|
|
108
|
+
* zone: `2026-10-26T09:00:00-07:00 [America/Los_Angeles]`, as heartbeat-mcpl
|
|
109
|
+
* wrote it, so the agent reads its ticks and reminders as before.
|
|
110
|
+
*/
|
|
111
|
+
export declare function formatHeartbeatTime(value: number, timeZone: string): string;
|
|
112
|
+
/** The text a reminder brings: a header naming it, then its message. */
|
|
113
|
+
export declare function reminderText(rem: Reminder, now: number, timeZone: string): string;
|
|
114
|
+
export declare class Heartbeat {
|
|
115
|
+
private readonly statePath;
|
|
116
|
+
private readonly defaults;
|
|
117
|
+
private readonly importFrom;
|
|
118
|
+
private readonly timeZone;
|
|
119
|
+
private readonly deliver;
|
|
120
|
+
private readonly now;
|
|
121
|
+
private readonly tools;
|
|
122
|
+
private state;
|
|
123
|
+
/** Why the state file can't be written now, when it can't (its text couldn't be read and set aside). */
|
|
124
|
+
private unsaveable;
|
|
125
|
+
/** What the last save's failure was, for the tool that made the change. */
|
|
126
|
+
private lastSaveError;
|
|
127
|
+
private cancelTick;
|
|
128
|
+
private cancelReminders;
|
|
129
|
+
/** Nothing fires before this (ms): a start's grace for what fell due while the host was down. */
|
|
130
|
+
private notBefore;
|
|
131
|
+
private started;
|
|
132
|
+
constructor(opts: {
|
|
133
|
+
statePath: string;
|
|
134
|
+
timeZone: string;
|
|
135
|
+
deliver: (wake: HeartbeatWake) => void;
|
|
136
|
+
defaults?: Partial<HeartbeatSettings>;
|
|
137
|
+
importFrom?: HeartbeatOptions['importFrom'];
|
|
138
|
+
now?: () => number;
|
|
139
|
+
});
|
|
140
|
+
/** Load (or import, or create) the state and arm the timers. */
|
|
141
|
+
start(): void;
|
|
142
|
+
/** Clear the timers; the state stays saved. */
|
|
143
|
+
stop(): void;
|
|
144
|
+
/** The tools, named as agents call them (`heartbeat--…`). */
|
|
145
|
+
getTools(): ToolDefinition[];
|
|
146
|
+
/** Whether `name` is one of the heartbeat's tools, by its name or heartbeat-mcpl's. */
|
|
147
|
+
ownsTool(name: string): boolean;
|
|
148
|
+
/** What the heartbeat will wake the agent with, soonest first, for the reply judge (UpcomingWake). */
|
|
149
|
+
upcomingWakes(): UpcomingWake[];
|
|
150
|
+
/**
|
|
151
|
+
* Handle a call to one of the tools, by its full name. Arguments are read
|
|
152
|
+
* as a wake rule's are: a slip of a parameter's name, or a field given
|
|
153
|
+
* outside the parameter it belongs to, refuses the call, naming it; an
|
|
154
|
+
* unknown name is noted in the result.
|
|
155
|
+
*/
|
|
156
|
+
handleToolCall(calledName: string, rawInput: unknown): {
|
|
157
|
+
success: boolean;
|
|
158
|
+
data?: string;
|
|
159
|
+
error?: string;
|
|
160
|
+
isError?: boolean;
|
|
161
|
+
};
|
|
162
|
+
private refuse;
|
|
163
|
+
private statusLine;
|
|
164
|
+
private statusText;
|
|
165
|
+
private saveNote;
|
|
166
|
+
private configure;
|
|
167
|
+
private trigger;
|
|
168
|
+
private addReminder;
|
|
169
|
+
private describe;
|
|
170
|
+
private listText;
|
|
171
|
+
private cancelReminder;
|
|
172
|
+
private armTick;
|
|
173
|
+
/** Deliver one tick; false when delivery threw. */
|
|
174
|
+
private fireTick;
|
|
175
|
+
private armReminders;
|
|
176
|
+
private fireDueReminders;
|
|
177
|
+
private load;
|
|
178
|
+
/** The state a file holds, or undefined when it isn't state this framework writes. */
|
|
179
|
+
private readState;
|
|
180
|
+
/** heartbeat-mcpl's files, read once when there's no state file and the host names them. */
|
|
181
|
+
private imported;
|
|
182
|
+
private save;
|
|
183
|
+
}
|
|
184
|
+
//# sourceMappingURL=heartbeat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heartbeat.d.ts","sour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