@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
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
*
|
|
26
26
|
* Ported from mcpl-cc-bridge's presence.ts, the reference host.
|
|
27
27
|
*/
|
|
28
|
-
import { type HintedTool } from './tool-signature.js';
|
|
28
|
+
import { type HintedTool, type Shown } from './tool-signature.js';
|
|
29
29
|
export interface ToolsetDecl {
|
|
30
30
|
title?: string;
|
|
31
31
|
summary?: string;
|
|
@@ -90,10 +90,16 @@ export interface ChangeSet {
|
|
|
90
90
|
changes: Change[];
|
|
91
91
|
suggest: Suggestion[];
|
|
92
92
|
notes: string[];
|
|
93
|
+
/** Ended records' notes, by id: rendered while the id is untold, told once the set reaches an agent (markTold). */
|
|
94
|
+
ended?: Array<{
|
|
95
|
+
id: string;
|
|
96
|
+
note: string;
|
|
97
|
+
}>;
|
|
98
|
+
/** false when its taker showed the change without its blocks (a look that restates the present shows the live catalog instead): told() then counts none of its definitions shown, while a notice that tells it still shows them. */
|
|
99
|
+
blocksShown?: false;
|
|
93
100
|
}
|
|
94
101
|
export declare const emptyChange: () => ChangeSet;
|
|
95
102
|
export declare const isEmptyChange: (c: ChangeSet) => boolean;
|
|
96
|
-
export declare const joinChanges: (...sets: ChangeSet[]) => ChangeSet;
|
|
97
103
|
/**
|
|
98
104
|
* RFC-014 §6.1: revs on a connection are consecutive (1, 2, 3 …), and changes
|
|
99
105
|
* apply in rev order, which on stdio and WebSocket is arrival order.
|
|
@@ -106,6 +112,7 @@ export interface ApplyOutcome {
|
|
|
106
112
|
skipped: boolean;
|
|
107
113
|
behind: boolean;
|
|
108
114
|
suggest: Suggestion[];
|
|
115
|
+
unlisted: boolean;
|
|
109
116
|
}
|
|
110
117
|
/** What a hint `definition` may change (RFC §6.1): everything else stays the listed tool's. */
|
|
111
118
|
interface DefOverride {
|
|
@@ -123,6 +130,8 @@ export declare class ToolPresence {
|
|
|
123
130
|
private readonly allowed;
|
|
124
131
|
/** How a static tool is named in the API tool list, for `look`. */
|
|
125
132
|
private readonly listedName;
|
|
133
|
+
/** Where the model's published tool list last put a tool, if it's there (shownAs). */
|
|
134
|
+
private readonly published;
|
|
126
135
|
/** Hints are in effect on the current connection: the host advertised toolHints and the server did too. */
|
|
127
136
|
active: boolean;
|
|
128
137
|
declared: Record<string, ToolsetDecl>;
|
|
@@ -138,10 +147,10 @@ export declare class ToolPresence {
|
|
|
138
147
|
private visible;
|
|
139
148
|
/** Definition overrides from hints: per key (an instance's own, or a toolset's), per tool. */
|
|
140
149
|
private defs;
|
|
141
|
-
/** `ended` ids told to the agent
|
|
150
|
+
/** `ended` ids told to the agent, kept while the server still reports them (RFC §5.3). */
|
|
142
151
|
private toldEnded;
|
|
152
|
+
/** Moves a tools/list made that the model's tool list doesn't show yet: told once a rebuild has published them. */
|
|
143
153
|
private pendingMoves;
|
|
144
|
-
private moved;
|
|
145
154
|
/** Digests of definitions the model has been shown with their first sentence. */
|
|
146
155
|
readonly shown: Set<string>;
|
|
147
156
|
constructor(server: string,
|
|
@@ -150,7 +159,9 @@ export declare class ToolPresence {
|
|
|
150
159
|
/** The host's tool policy (enabledTools/disabledTools): a tool it refuses is as if unlisted. */
|
|
151
160
|
allowed?: (tool: string) => boolean,
|
|
152
161
|
/** How a static tool is named in the API tool list, for `look`. */
|
|
153
|
-
listedName?: (tool: string) => string
|
|
162
|
+
listedName?: (tool: string) => string,
|
|
163
|
+
/** Where the model's published tool list last put a tool, if it's there (shownAs). */
|
|
164
|
+
published?: (tool: string) => Presence | undefined);
|
|
154
165
|
/** A new connection: revs start over; hints count only when both sides advertised toolHints. */
|
|
155
166
|
beginConnection(mcpl: Record<string, unknown> | null | undefined, hostHints: boolean): void;
|
|
156
167
|
/** Toolset declarations and the surface hint, from initialize or a manifest re-fetch. */
|
|
@@ -164,8 +175,14 @@ export declare class ToolPresence {
|
|
|
164
175
|
get allTools(): HintedTool[];
|
|
165
176
|
tool(name: string): HintedTool | undefined;
|
|
166
177
|
toolsetOf(name: string): string | undefined;
|
|
167
|
-
/**
|
|
178
|
+
/** As the list states it: a toolset's tool is dynamic whatever a hint says (RFC §4.1). */
|
|
168
179
|
presenceOf(name: string): Presence;
|
|
180
|
+
/** RFC §4.2: "Until it applies the move, the tool keeps working where it
|
|
181
|
+
* is." Whether a tool is at `place` in the tool list last published, or
|
|
182
|
+
* in the server's latest tools/list (its presence). Until a rebuild
|
|
183
|
+
* applies a move the two differ, and a call is taken at either. */
|
|
184
|
+
shownAs(name: string, place: Presence): boolean;
|
|
185
|
+
private listedPresence;
|
|
169
186
|
isDeclared(toolset: string): boolean;
|
|
170
187
|
/** Undeclared toolset names the server's tools are tagged with (RFC §5.4). */
|
|
171
188
|
get undeclaredGroups(): string[];
|
|
@@ -215,17 +232,39 @@ export declare class ToolPresence {
|
|
|
215
232
|
ended: Ended[];
|
|
216
233
|
suggest: Suggestion[];
|
|
217
234
|
skipped: boolean;
|
|
235
|
+
unlisted: boolean;
|
|
218
236
|
};
|
|
219
237
|
/**
|
|
220
238
|
* What the agent should hear about an adoption: what ended while it was
|
|
221
|
-
* away, each `ended` id
|
|
222
|
-
*
|
|
239
|
+
* away, each `ended` id until it has been told (RFC §5.3; markTold), and
|
|
240
|
+
* what is closed now. An ended record with an id is in `ended`, rendered
|
|
241
|
+
* while its id is untold.
|
|
223
242
|
*/
|
|
224
|
-
adoptionNotes(lost: OpenRecord[], ended: Ended[]):
|
|
243
|
+
adoptionNotes(lost: OpenRecord[], ended: Ended[]): {
|
|
244
|
+
notes: string[];
|
|
245
|
+
ended: Array<{
|
|
246
|
+
id: string;
|
|
247
|
+
note: string;
|
|
248
|
+
}>;
|
|
249
|
+
};
|
|
250
|
+
/** The agent has been told these ended records (a notice written, a result it reads); the next statement forgets any it no longer reports. */
|
|
251
|
+
markTold(ended: ChangeSet['ended']): void;
|
|
252
|
+
/** The definitions a change set's tool blocks describe have reached the model. */
|
|
253
|
+
markShown(cs: ChangeSet): void;
|
|
254
|
+
/** A set's ended notes whose ids are still untold, each once. */
|
|
255
|
+
untoldNotes(cs: ChangeSet): string[];
|
|
225
256
|
openGroup(g: string): void;
|
|
226
257
|
closeGroup(g: string): void;
|
|
227
|
-
/**
|
|
228
|
-
|
|
258
|
+
/** The static↔dynamic moves the lists made since the last rebuild, still to be shown. */
|
|
259
|
+
moves(): Array<{
|
|
260
|
+
name: string;
|
|
261
|
+
to: Presence;
|
|
262
|
+
}>;
|
|
263
|
+
/** At a rebuild of the model's tool list (RFC §4.2): those of `moves` still pending, now shown. */
|
|
264
|
+
applyMoves(moves?: {
|
|
265
|
+
name: string;
|
|
266
|
+
to: Presence;
|
|
267
|
+
}[]): Array<{
|
|
229
268
|
name: string;
|
|
230
269
|
to: Presence;
|
|
231
270
|
}>;
|
|
@@ -239,10 +278,19 @@ export declare class ToolPresence {
|
|
|
239
278
|
describeAll?: boolean;
|
|
240
279
|
headed?: boolean;
|
|
241
280
|
title?: string;
|
|
281
|
+
seen?: Shown;
|
|
242
282
|
}): string[];
|
|
243
|
-
/**
|
|
283
|
+
/**
|
|
284
|
+
* What the model reads for a change set. `bare`: a key whose header the
|
|
285
|
+
* caller already printed. `mark: false` renders without counting the
|
|
286
|
+
* definitions it describes as shown, for text that may not reach the model
|
|
287
|
+
* (markShown counts them once it has). `describeAll`: every tool with its
|
|
288
|
+
* first sentence, as for a result that may reach no agent.
|
|
289
|
+
*/
|
|
244
290
|
render(cs: ChangeSet, opts?: {
|
|
245
291
|
bare?: string;
|
|
292
|
+
mark?: boolean;
|
|
293
|
+
describeAll?: boolean;
|
|
246
294
|
}): string;
|
|
247
295
|
/** RFC §6.2: a suggestion is shown, never acted on. */
|
|
248
296
|
renderSuggestion(s: Suggestion): string;
|
|
@@ -250,8 +298,12 @@ export declare class ToolPresence {
|
|
|
250
298
|
openKeys(): string[];
|
|
251
299
|
/** RFC §8.3 reminder: what is open, its current tools (described), how to call and close it. Null when nothing is open. */
|
|
252
300
|
reminder(): string | null;
|
|
253
|
-
/** look naming this server: what is open (with tools) and what can be
|
|
254
|
-
|
|
301
|
+
/** look naming this server: what is open (with tools) and what can be
|
|
302
|
+
* opened. `mark: false`, as for render, for a look whose result may
|
|
303
|
+
* reach no agent. */
|
|
304
|
+
catalog(opts?: {
|
|
305
|
+
mark?: boolean;
|
|
306
|
+
}): string;
|
|
255
307
|
/** Where a tool can be called from now, for `look` naming it. */
|
|
256
308
|
toolStatus(tool: string): string;
|
|
257
309
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-presence.d.ts","sourceRoot":"","sources":["../../../src/mcpl/tool-presence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EAAgD,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-presence.d.ts","sourceRoot":"","sources":["../../../src/mcpl/tool-presence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG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