@animalabs/agent-framework 0.27.0 → 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 +56 -15
- package/dist/src/agent.d.ts +29 -2
- package/dist/src/agent.d.ts.map +1 -1
- package/dist/src/agent.js +69 -11
- package/dist/src/agent.js.map +1 -1
- package/dist/src/api/server.d.ts.map +1 -1
- package/dist/src/api/server.js +4 -2
- package/dist/src/api/server.js.map +1 -1
- package/dist/src/auto-continue.d.ts +3 -2
- package/dist/src/auto-continue.d.ts.map +1 -1
- package/dist/src/auto-continue.js +4 -3
- package/dist/src/auto-continue.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 +304 -89
- package/dist/src/framework.d.ts.map +1 -1
- package/dist/src/framework.js +2577 -678
- package/dist/src/framework.js.map +1 -1
- package/dist/src/gate/event-gate.d.ts +99 -3
- package/dist/src/gate/event-gate.d.ts.map +1 -1
- package/dist/src/gate/event-gate.js +538 -13
- package/dist/src/gate/event-gate.js.map +1 -1
- package/dist/src/gate/index.d.ts +2 -1
- package/dist/src/gate/index.d.ts.map +1 -1
- package/dist/src/gate/index.js +1 -0
- 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 +161 -0
- 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 +4 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -0
- 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.map +1 -1
- package/dist/src/mcpl/channel-registry.js +2 -1
- package/dist/src/mcpl/channel-registry.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/server-connection.d.ts +18 -8
- package/dist/src/mcpl/server-connection.d.ts.map +1 -1
- package/dist/src/mcpl/server-connection.js +50 -10
- 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-presence.d.ts +66 -14
- package/dist/src/mcpl/tool-presence.d.ts.map +1 -1
- package/dist/src/mcpl/tool-presence.js +134 -65
- 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 +47 -18
- package/dist/src/mcpl/tool-signature.js.map +1 -1
- package/dist/src/mcpl/toolset-host.d.ts +88 -37
- package/dist/src/mcpl/toolset-host.d.ts.map +1 -1
- package/dist/src/mcpl/toolset-host.js +207 -108
- package/dist/src/mcpl/toolset-host.js.map +1 -1
- package/dist/src/mcpl/toolsets-module.d.ts +14 -11
- package/dist/src/mcpl/toolsets-module.d.ts.map +1 -1
- package/dist/src/mcpl/toolsets-module.js +141 -49
- package/dist/src/mcpl/toolsets-module.js.map +1 -1
- package/dist/src/mcpl/types.d.ts +3 -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 +4 -1
- package/dist/src/module-registry.d.ts.map +1 -1
- package/dist/src/module-registry.js +9 -2
- package/dist/src/module-registry.js.map +1 -1
- package/dist/src/modules/history/index.d.ts.map +1 -1
- package/dist/src/modules/history/index.js +22 -11
- package/dist/src/modules/history/index.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 +3 -0
- package/dist/src/modules/workspace/direct-write.d.ts.map +1 -1
- package/dist/src/modules/workspace/direct-write.js +57 -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.map +1 -1
- package/dist/src/modules/workspace/effects.js +20 -13
- package/dist/src/modules/workspace/effects.js.map +1 -1
- package/dist/src/modules/workspace/index.d.ts +62 -51
- package/dist/src/modules/workspace/index.d.ts.map +1 -1
- package/dist/src/modules/workspace/index.js +934 -531
- 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.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.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 +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/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.js +1 -1
- 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 +35 -1
- package/dist/src/tool-args.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/tools.d.ts +4 -1
- package/dist/src/tune-out/tools.d.ts.map +1 -1
- package/dist/src/types/agent.d.ts +40 -9
- 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 +15 -0
- package/dist/src/types/framework.d.ts.map +1 -1
- package/dist/src/types/module.d.ts +5 -2
- 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 +72 -11
- package/src/api/server.ts +4 -2
- package/src/auto-continue.ts +4 -3
- package/src/cut-off-round.ts +98 -0
- package/src/framework.ts +2694 -700
- package/src/gate/event-gate.ts +579 -15
- package/src/gate/index.ts +8 -0
- package/src/gate/reply-judge.ts +512 -0
- package/src/gate/types.ts +164 -1
- package/src/heartbeat/heartbeat.ts +804 -0
- package/src/heartbeat/reminder-time.ts +107 -0
- package/src/index.ts +4 -0
- package/src/mcpl/capability-mask.ts +3 -2
- package/src/mcpl/channel-registry.ts +2 -1
- package/src/mcpl/inbound-source.ts +42 -69
- package/src/mcpl/server-connection.ts +56 -16
- package/src/mcpl/tags.ts +13 -2
- package/src/mcpl/tool-presence.ts +133 -67
- package/src/mcpl/tool-signature.ts +51 -20
- package/src/mcpl/toolset-host.ts +197 -107
- package/src/mcpl/toolsets-module.ts +143 -49
- package/src/mcpl/types.ts +3 -1
- package/src/module-registry.ts +8 -2
- package/src/modules/history/index.ts +22 -12
- package/src/modules/workspace/answers.ts +133 -0
- package/src/modules/workspace/branch-intent.ts +10 -5
- package/src/modules/workspace/direct-write.ts +58 -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 +21 -12
- package/src/modules/workspace/index.ts +927 -541
- package/src/modules/workspace/observe.ts +381 -177
- package/src/modules/workspace/read-page.ts +7 -1
- package/src/modules/workspace/reconcile.ts +27 -15
- 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/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 +1 -1
- package/src/thinking-drops.ts +10 -16
- package/src/tool-args.ts +34 -1
- package/src/tool-result-guard.ts +26 -11
- package/src/tune-out/tools.ts +4 -1
- package/src/types/agent.ts +40 -9
- package/src/types/events.ts +18 -8
- package/src/types/framework.ts +15 -0
- package/src/types/module.ts +5 -2
- package/src/types/trace.ts +36 -1
|
@@ -139,23 +139,39 @@ export declare function canonicalJson(value: unknown): string;
|
|
|
139
139
|
* room-220 #46752–#47210): SHA-256 hex of `canonicalJson([blocks])` over the
|
|
140
140
|
* ContentBlock[] the framework stores for the body — after MCPL conversion,
|
|
141
141
|
* before any host decoration is added and before storage shards it — with
|
|
142
|
-
* each block as the store keeps it
|
|
143
|
-
* hashes alike as delivered, as handed to storage, and as
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
142
|
+
* each block as the store keeps it, which context-manager's `blockAsStored`
|
|
143
|
+
* gives. So a body hashes alike as delivered, as handed to storage, and as
|
|
144
|
+
* read back unsharded from the store with its blobs resolved, except one
|
|
145
|
+
* whose blocks the store changes together: when it mends a `tool_use` whose
|
|
146
|
+
* input isn't an object, it also releases a raw replay form (`rawXml`,
|
|
147
|
+
* `rawItem`) that the message's other blocks share, which no one block's
|
|
148
|
+
* stored form shows. A body an MCPL lane stamps is never one. A block the
|
|
149
|
+
* store refuses on write, a `blob_ref` among them, is digested as given. The
|
|
150
|
+
* one-element array keeps the framing an undecorated, unsharded stored copy
|
|
151
|
+
* has always hashed to, so a stamped copy and an older copy of the same body
|
|
152
|
+
* share a version where the store keeps the body as it did then.
|
|
153
|
+
*
|
|
154
|
+
* A digest is a digest under the context-manager release that computed it: a
|
|
155
|
+
* release that changes what the store keeps, such as its set of image
|
|
156
|
+
* signatures, changes the digest of a body it touches.
|
|
147
157
|
*
|
|
148
158
|
* Ingestion stamps it as `metadata.sourceBodyDigest`, and the same function
|
|
149
159
|
* over exactly the blocks handed to storage (decorations included) as
|
|
150
160
|
* `metadata.storedBodyDigest`, on both MCPL lanes. Both live outside the
|
|
151
161
|
* frozen admission envelope: they describe the body actually delivered (a
|
|
152
162
|
* materialization, a correction), not the admission. Neither proves later
|
|
153
|
-
* presence or completeness
|
|
163
|
+
* presence or completeness. An unsharded stored copy that no longer hashes
|
|
154
164
|
* to its storedBodyDigest was changed after delivery (editMessage keeps
|
|
155
|
-
* metadata)
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
165
|
+
* metadata), or holds blocks the store changes together, or its digest was
|
|
166
|
+
* taken under a release that kept some block of it differently: a
|
|
167
|
+
* context-manager release that changed a stored form, or an agent-framework
|
|
168
|
+
* release from 0.24.0 up to the one that brought in blockAsStored, which
|
|
169
|
+
* took stored forms from a copy of the store's transform. Digests already
|
|
170
|
+
* stamped are never recomputed. A body the store shards carries the whole
|
|
171
|
+
* body's two digests on every shard, and no shard hashes to them. Check a
|
|
172
|
+
* copy read back with its blobs resolved (getAllMessages, getMessage, or
|
|
173
|
+
* getMessageWindow without `resolveBlobs: false`): a blob reference never
|
|
174
|
+
* matches.
|
|
159
175
|
*
|
|
160
176
|
* Exported from the package root, so a consumer checks a copy against either
|
|
161
177
|
* field with this same function rather than a copy of it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inbound-source.d.ts","sourceRoot":"","sources":["../../../src/mcpl/inbound-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;
|
|
1
|
+
{"version":3,"file":"inbound-source.d.ts","sourceRoot":"","sources":["../../../src/mcpl/inbound-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAMH;;;;+CAI+C;AAC/C,MAAM,MAAM,WAAW,GAAG,mBAAmB,GAAG,YAAY,CAAC;AAE7D,oDAAoD;AACpD,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,SAAS,CAAC;IAChB,6DAA6D;IAC7D,IAAI,EAAE,WAAW,CAAC;IAClB,oDAAoD;IACpD,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,kFAAkF;IAClF,QAAQ,EAAE,MAAM,CAAC;IACjB;;qFAEiF;IACjF,OAAO,EAAE,MAAM,CAAC;IAChB;gFAC4E;IAC5E,SAAS,EAAE,MAAM,CAAC;IAClB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6EAA6E;IAC7E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uCAAuC;IACvC,UAAU,EAAE,MAAM,CAAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,OAAO,EAAE,GAAG,MAAM,CAEnE"}
|
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
* key: `eventId` is present only when the producer supplied one.
|
|
22
22
|
*/
|
|
23
23
|
import { createHash } from 'node:crypto';
|
|
24
|
+
import { blockAsStored, MalformedContentError } from '@animalabs/context-manager';
|
|
25
|
+
import { logDetail, logValue } from './log-value.js';
|
|
24
26
|
/** Metadata key the framework stamps. */
|
|
25
27
|
export const INBOUND_SOURCE_KEY = 'inboundSource';
|
|
26
28
|
const isText = (v) => typeof v === 'string' && v.length > 0;
|
|
@@ -117,92 +119,61 @@ export function canonicalJson(value) {
|
|
|
117
119
|
return JSON.stringify(value) ?? 'null';
|
|
118
120
|
}
|
|
119
121
|
/**
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
* 'base64', data, mediaType } }` and nothing else, its data re-encoded from
|
|
124
|
-
* the decoded bytes, and an image's media type taken from its bytes'
|
|
125
|
-
* signature where they have one. Any other block comes back as it was given,
|
|
126
|
-
* except a store-internal `blob_ref` from an unresolved read, which resolves
|
|
127
|
-
* to inline media by default. It is digested as given here, so an unresolved
|
|
128
|
-
* read and its resolved form differ. Context-manager refuses caller-supplied
|
|
129
|
-
* blob_ref writes; the MCPL lanes never store one.
|
|
122
|
+
* blockAsStored throws a `MalformedContentError` for a block the store
|
|
123
|
+
* refuses on write, a caller-supplied `blob_ref` among them. Such a block
|
|
124
|
+
* has no stored form, and whatever is thrown, it is digested as given.
|
|
130
125
|
*/
|
|
131
126
|
function storedBlock(block) {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
? media.source?.type !== 'url'
|
|
135
|
-
: media?.type === 'document' || media?.type === 'audio' || media?.type === 'video';
|
|
136
|
-
const source = media?.source;
|
|
137
|
-
if (!blob || typeof source?.data !== 'string')
|
|
138
|
-
return block;
|
|
139
|
-
const data = canonicalBase64(source.data);
|
|
140
|
-
const mediaType = media.type === 'image'
|
|
141
|
-
? sniffRasterImageMediaType(Buffer.from(data.slice(0, 32), 'base64')) ?? source.mediaType
|
|
142
|
-
: source.mediaType;
|
|
143
|
-
return { type: media.type, source: { type: 'base64', data, mediaType } };
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Base64 as the store writes it back from the decoded bytes: padded, with no
|
|
147
|
-
* whitespace, the standard alphabet and zero unused bits. Data already in
|
|
148
|
-
* that form, as every stored copy's is, is returned without decoding it all.
|
|
149
|
-
*/
|
|
150
|
-
function canonicalBase64(data) {
|
|
151
|
-
if (data.length % 4 === 0 && /^[A-Za-z0-9+/]*={0,2}$/.test(data)) {
|
|
152
|
-
const last = data.slice(-4);
|
|
153
|
-
if (Buffer.from(last, 'base64').toString('base64') === last)
|
|
154
|
-
return data;
|
|
127
|
+
try {
|
|
128
|
+
return blockAsStored(block);
|
|
155
129
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
function sniffRasterImageMediaType(bytes) {
|
|
164
|
-
if (bytes.length >= 8 &&
|
|
165
|
-
bytes[0] === 0x89 && bytes[1] === 0x50 && bytes[2] === 0x4e && bytes[3] === 0x47 &&
|
|
166
|
-
bytes[4] === 0x0d && bytes[5] === 0x0a && bytes[6] === 0x1a && bytes[7] === 0x0a) {
|
|
167
|
-
return 'image/png';
|
|
168
|
-
}
|
|
169
|
-
if (bytes.length >= 3 && bytes[0] === 0xff && bytes[1] === 0xd8 && bytes[2] === 0xff) {
|
|
170
|
-
return 'image/jpeg';
|
|
171
|
-
}
|
|
172
|
-
if (bytes.length >= 6) {
|
|
173
|
-
const signature = Buffer.from(bytes.subarray(0, 6)).toString('ascii');
|
|
174
|
-
if (signature === 'GIF87a' || signature === 'GIF89a')
|
|
175
|
-
return 'image/gif';
|
|
176
|
-
}
|
|
177
|
-
if (bytes.length >= 12 &&
|
|
178
|
-
Buffer.from(bytes.subarray(0, 4)).toString('ascii') === 'RIFF' &&
|
|
179
|
-
Buffer.from(bytes.subarray(8, 12)).toString('ascii') === 'WEBP') {
|
|
180
|
-
return 'image/webp';
|
|
130
|
+
catch (err) {
|
|
131
|
+
if (!(err instanceof MalformedContentError)) {
|
|
132
|
+
const { name, message } = (err ?? {});
|
|
133
|
+
console.error(`[stored-digest-as-given] error=${logValue(typeof name === 'string' ? name : typeof err)}: ` +
|
|
134
|
+
logDetail(typeof message === 'string' ? message : ''));
|
|
135
|
+
}
|
|
136
|
+
return block;
|
|
181
137
|
}
|
|
182
|
-
return null;
|
|
183
138
|
}
|
|
184
139
|
/**
|
|
185
140
|
* The version identity of a delivered body (agreed with the receipts lane,
|
|
186
141
|
* room-220 #46752–#47210): SHA-256 hex of `canonicalJson([blocks])` over the
|
|
187
142
|
* ContentBlock[] the framework stores for the body — after MCPL conversion,
|
|
188
143
|
* before any host decoration is added and before storage shards it — with
|
|
189
|
-
* each block as the store keeps it
|
|
190
|
-
* hashes alike as delivered, as handed to storage, and as
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
144
|
+
* each block as the store keeps it, which context-manager's `blockAsStored`
|
|
145
|
+
* gives. So a body hashes alike as delivered, as handed to storage, and as
|
|
146
|
+
* read back unsharded from the store with its blobs resolved, except one
|
|
147
|
+
* whose blocks the store changes together: when it mends a `tool_use` whose
|
|
148
|
+
* input isn't an object, it also releases a raw replay form (`rawXml`,
|
|
149
|
+
* `rawItem`) that the message's other blocks share, which no one block's
|
|
150
|
+
* stored form shows. A body an MCPL lane stamps is never one. A block the
|
|
151
|
+
* store refuses on write, a `blob_ref` among them, is digested as given. The
|
|
152
|
+
* one-element array keeps the framing an undecorated, unsharded stored copy
|
|
153
|
+
* has always hashed to, so a stamped copy and an older copy of the same body
|
|
154
|
+
* share a version where the store keeps the body as it did then.
|
|
155
|
+
*
|
|
156
|
+
* A digest is a digest under the context-manager release that computed it: a
|
|
157
|
+
* release that changes what the store keeps, such as its set of image
|
|
158
|
+
* signatures, changes the digest of a body it touches.
|
|
194
159
|
*
|
|
195
160
|
* Ingestion stamps it as `metadata.sourceBodyDigest`, and the same function
|
|
196
161
|
* over exactly the blocks handed to storage (decorations included) as
|
|
197
162
|
* `metadata.storedBodyDigest`, on both MCPL lanes. Both live outside the
|
|
198
163
|
* frozen admission envelope: they describe the body actually delivered (a
|
|
199
164
|
* materialization, a correction), not the admission. Neither proves later
|
|
200
|
-
* presence or completeness
|
|
165
|
+
* presence or completeness. An unsharded stored copy that no longer hashes
|
|
201
166
|
* to its storedBodyDigest was changed after delivery (editMessage keeps
|
|
202
|
-
* metadata)
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
*
|
|
167
|
+
* metadata), or holds blocks the store changes together, or its digest was
|
|
168
|
+
* taken under a release that kept some block of it differently: a
|
|
169
|
+
* context-manager release that changed a stored form, or an agent-framework
|
|
170
|
+
* release from 0.24.0 up to the one that brought in blockAsStored, which
|
|
171
|
+
* took stored forms from a copy of the store's transform. Digests already
|
|
172
|
+
* stamped are never recomputed. A body the store shards carries the whole
|
|
173
|
+
* body's two digests on every shard, and no shard hashes to them. Check a
|
|
174
|
+
* copy read back with its blobs resolved (getAllMessages, getMessage, or
|
|
175
|
+
* getMessageWindow without `resolveBlobs: false`): a blob reference never
|
|
176
|
+
* matches.
|
|
206
177
|
*
|
|
207
178
|
* Exported from the package root, so a consumer checks a copy against either
|
|
208
179
|
* field with this same function rather than a copy of it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inbound-source.js","sourceRoot":"","sources":["../../../src/mcpl/inbound-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"inbound-source.js","sourceRoot":"","sources":["../../../src/mcpl/inbound-source.ts"],"names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handed as the connection reads a message
|
|
105
105
|
* that can carry hint changes (see McplServerConnection.setReadTap). */
|
|
106
106
|
export type HintRead =
|
|
107
|
-
/** A response to a request that can carry hints (RFC-014 §6.1 carrier 1)
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
107
|
+
/** A response to a request that can carry hints (RFC-014 §6.1 carrier 1),
|
|
108
|
+
* or a `tools/list`'s whole inventory (§4.1), its pages joined by
|
|
109
|
+
* sendToolsList, `straddled` when its pages carry different revs.
|
|
110
|
+
* `awaited`: whoever sent it still waits for it; false for a
|
|
111
|
+
* result that arrives after its timeout. A JSON-RPC error carries no state
|
|
112
|
+
* and isn't tapped. */
|
|
111
113
|
{
|
|
112
114
|
kind: 'result';
|
|
113
115
|
method: string;
|
|
114
116
|
params: Record<string, unknown>;
|
|
115
117
|
result: unknown;
|
|
116
118
|
awaited: boolean;
|
|
119
|
+
straddled?: boolean;
|
|
117
120
|
}
|
|
118
121
|
/** A push/event (carrier 2), as read, before the plane gate or the grant
|
|
119
122
|
* admit or refuse it. */
|
|
@@ -258,13 +261,16 @@ export declare class McplServerConnection extends EventEmitter {
|
|
|
258
261
|
* the message: a push the plane holds or the grant refuses, a result its
|
|
259
262
|
* caller stopped waiting for. The tap sees every such message of the
|
|
260
263
|
* current transport, synchronously, before anything routes it; a late
|
|
261
|
-
* answer's request is remembered past its timeout (hintedRequests
|
|
262
|
-
*
|
|
264
|
+
* answer's request is remembered past its timeout (hintedRequests, while
|
|
265
|
+
* no more than 1,000 hinted requests await an answer) so its hints still
|
|
266
|
+
* apply. Null (the default) taps nothing, and the connection
|
|
263
267
|
* behaves as it always has.
|
|
264
268
|
*/
|
|
265
269
|
private readTap;
|
|
266
270
|
/** The hinted requests sent on this transport, by id, kept past a timeout
|
|
267
|
-
* so a late result is still tapped
|
|
271
|
+
* so a late result is still tapped: each one's method, and an open's or
|
|
272
|
+
* close's toolset and instance, which are all the read of its result
|
|
273
|
+
* uses; never a call's arguments. Bounded. Cleared at each boundary,
|
|
268
274
|
* since the next transport numbers its requests afresh. */
|
|
269
275
|
private hintedRequests;
|
|
270
276
|
/** Install (or, with null, remove) the RFC-014 read tap (see readTap). */
|
|
@@ -684,7 +690,11 @@ export declare class McplServerConnection extends EventEmitter {
|
|
|
684
690
|
* read it as a complete page). A page that isn't well formed (no `tools` array, a cursor
|
|
685
691
|
* that isn't a string), or cursors that don't terminate (a repeat, or more
|
|
686
692
|
* than {@link MAX_TOOL_LIST_PAGES} pages), are errors, never a partial or
|
|
687
|
-
* empty inventory published as complete.
|
|
693
|
+
* empty inventory published as complete. The read tap (RFC-014) is handed
|
|
694
|
+
* the complete inventory once, with the last page's `_meta`, as the last
|
|
695
|
+
* page's response is read, before anything read after it; a list that
|
|
696
|
+
* fails or times out hands it nothing. It's `straddled` when its pages
|
|
697
|
+
* carry different `mcpl/rev`s.
|
|
688
698
|
*/
|
|
689
699
|
sendToolsList(): Promise<{
|
|
690
700
|
tools: McpToolDefinition[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-connection.d.ts","sourceRoot":"","sources":["../../../src/mcpl/server-connection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAqC,KAAK,aAAa,EAA2B,MAAM,gBAAgB,CAAC;AAEhH,OAAO,EAAE,eAAe,EAAgC,MAAM,uBAAuB,CAAC;AAatF,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EAGpB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,yBAAyB,EACzB,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,2BAA2B,EAC3B,8BAA8B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AO,CAAC,oBAAoB;IAY5B;uDACmD;IACnD,OAAO,CAAC,WAAW;IAUnB;;OAEG;IACH,OAAO,CAAC,cAAc;IA0FtB;;OAEG;IACH,OAAO,CAAC,YAAY;IAQpB;;2DAEuD;IACvD,OAAO,CAAC,aAAa;IAQrB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAsBzB;;;;OAIG;IACH,OAAO,CAAC,cAAc;CA8EvB"}
|
|
1
|
+
{"version":3,"file":"server-connection.d.ts","sourceRoot":"","sources":["../../../src/mcpl/server-connection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAqC,KAAK,aAAa,EAA2B,MAAM,gBAAgB,CAAC;AAEhH,OAAO,EAAE,eAAe,EAAgC,MAAM,uBAAuB,CAAC;AAatF,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EAGpB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,yBAAyB,EACzB,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,2BAA2B,EAC3B,8BAA8B,EAC9B,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAGpB,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEhF;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB;IACtC;sEACkE;IAClE,SAAS,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IACxC,oFAAoF;IACpF,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,uDAAuD;IACvD,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,IAA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ised) {
|
|
|
163
163
|
...(surface !== undefined ? { surface } : {}),
|
|
164
164
|
};
|
|
165
165
|
}
|
|
166
|
-
/** Requests whose results can carry hint state (RFC-014 §6.1
|
|
167
|
-
const HINTED_METHODS = new Set(['tools/call', 'toolsets/open', 'toolsets/close', 'toolsets/list'
|
|
166
|
+
/** Requests whose results can carry hint state, remembered for a late answer (RFC-014 §6.1). */
|
|
167
|
+
const HINTED_METHODS = new Set(['tools/call', 'toolsets/open', 'toolsets/close', 'toolsets/list']);
|
|
168
|
+
function hintedParams(method, params) {
|
|
169
|
+
if (method !== 'toolsets/open' && method !== 'toolsets/close')
|
|
170
|
+
return {};
|
|
171
|
+
return {
|
|
172
|
+
...(typeof params.toolset === 'string' ? { toolset: params.toolset } : {}),
|
|
173
|
+
...(typeof params.instance === 'string' ? { instance: params.instance } : {}),
|
|
174
|
+
};
|
|
175
|
+
}
|
|
168
176
|
/**
|
|
169
177
|
* A handshake that failed, and whose cleanup couldn't confirm that the child
|
|
170
178
|
* exited. The transport goes to whoever owns the launch.
|
|
@@ -322,13 +330,16 @@ export class McplServerConnection extends EventEmitter {
|
|
|
322
330
|
* the message: a push the plane holds or the grant refuses, a result its
|
|
323
331
|
* caller stopped waiting for. The tap sees every such message of the
|
|
324
332
|
* current transport, synchronously, before anything routes it; a late
|
|
325
|
-
* answer's request is remembered past its timeout (hintedRequests
|
|
326
|
-
*
|
|
333
|
+
* answer's request is remembered past its timeout (hintedRequests, while
|
|
334
|
+
* no more than 1,000 hinted requests await an answer) so its hints still
|
|
335
|
+
* apply. Null (the default) taps nothing, and the connection
|
|
327
336
|
* behaves as it always has.
|
|
328
337
|
*/
|
|
329
338
|
readTap = null;
|
|
330
339
|
/** The hinted requests sent on this transport, by id, kept past a timeout
|
|
331
|
-
* so a late result is still tapped
|
|
340
|
+
* so a late result is still tapped: each one's method, and an open's or
|
|
341
|
+
* close's toolset and instance, which are all the read of its result
|
|
342
|
+
* uses; never a call's arguments. Bounded. Cleared at each boundary,
|
|
332
343
|
* since the next transport numbers its requests afresh. */
|
|
333
344
|
hintedRequests = new Map();
|
|
334
345
|
/** Install (or, with null, remove) the RFC-014 read tap (see readTap). */
|
|
@@ -1468,21 +1479,44 @@ export class McplServerConnection extends EventEmitter {
|
|
|
1468
1479
|
* read it as a complete page). A page that isn't well formed (no `tools` array, a cursor
|
|
1469
1480
|
* that isn't a string), or cursors that don't terminate (a repeat, or more
|
|
1470
1481
|
* than {@link MAX_TOOL_LIST_PAGES} pages), are errors, never a partial or
|
|
1471
|
-
* empty inventory published as complete.
|
|
1482
|
+
* empty inventory published as complete. The read tap (RFC-014) is handed
|
|
1483
|
+
* the complete inventory once, with the last page's `_meta`, as the last
|
|
1484
|
+
* page's response is read, before anything read after it; a list that
|
|
1485
|
+
* fails or times out hands it nothing. It's `straddled` when its pages
|
|
1486
|
+
* carry different `mcpl/rev`s.
|
|
1472
1487
|
*/
|
|
1473
1488
|
async sendToolsList() {
|
|
1474
1489
|
const tools = [];
|
|
1475
1490
|
const seen = new Set();
|
|
1476
1491
|
let cursor;
|
|
1477
1492
|
let first;
|
|
1493
|
+
const read = [];
|
|
1494
|
+
const revs = new Set();
|
|
1495
|
+
const onRead = (result) => {
|
|
1496
|
+
if (!result || typeof result !== 'object' || !Array.isArray(result.tools))
|
|
1497
|
+
return;
|
|
1498
|
+
const r = result;
|
|
1499
|
+
for (const t of r.tools)
|
|
1500
|
+
read.push(t);
|
|
1501
|
+
const rev = r._meta?.['mcpl/rev'];
|
|
1502
|
+
if (typeof rev === 'number')
|
|
1503
|
+
revs.add(rev);
|
|
1504
|
+
if (r.nextCursor !== undefined && r.nextCursor !== null)
|
|
1505
|
+
return;
|
|
1506
|
+
this.tap({
|
|
1507
|
+
kind: 'result', method: 'tools/list', params: {}, ...(revs.size > 1 ? { straddled: true } : {}),
|
|
1508
|
+
result: { tools: read, ...(r._meta !== undefined ? { _meta: r._meta } : {}) }, awaited: true,
|
|
1509
|
+
});
|
|
1510
|
+
};
|
|
1478
1511
|
for (let page = 0; page < MAX_TOOL_LIST_PAGES; page++) {
|
|
1479
|
-
const result = await this.sendRequest('tools/list', cursor === undefined ? {} : { cursor });
|
|
1512
|
+
const result = await this.sendRequest('tools/list', cursor === undefined ? {} : { cursor }, { onRead });
|
|
1480
1513
|
const malformed = (why) => new Error(`MCPL server "${this.id}" sent a malformed tools/list page ${page + 1}: ${why}`);
|
|
1481
1514
|
if (!result || typeof result !== 'object' || !Array.isArray(result.tools)) {
|
|
1482
1515
|
throw malformed('no tools array');
|
|
1483
1516
|
}
|
|
1484
1517
|
first ??= result;
|
|
1485
|
-
|
|
1518
|
+
for (const t of result.tools)
|
|
1519
|
+
tools.push(t);
|
|
1486
1520
|
if (result.nextCursor === undefined || result.nextCursor === null) {
|
|
1487
1521
|
// The first page's other fields are kept as they came, so a
|
|
1488
1522
|
// single-page answer is returned exactly as before.
|
|
@@ -1894,7 +1928,7 @@ export class McplServerConnection extends EventEmitter {
|
|
|
1894
1928
|
'If calling it again fails, ask whoever runs this host.', 'not-sent'), `MCPL server "${this.id}": ${method} (id=${id}) not sent, since it can't be written as JSON: ${logDetail(err instanceof Error ? err.message : err)}`);
|
|
1895
1929
|
}
|
|
1896
1930
|
return new Promise((resolve, reject) => {
|
|
1897
|
-
const pending = { resolve, reject, method };
|
|
1931
|
+
const pending = { resolve, reject, method, ...(options.onRead ? { onRead: options.onRead } : {}) };
|
|
1898
1932
|
const timeoutMs = options.timeoutMs ?? this.requestTimeoutMs;
|
|
1899
1933
|
if (timeoutMs > 0) {
|
|
1900
1934
|
pending.timer = setTimeout(() => {
|
|
@@ -1932,7 +1966,7 @@ export class McplServerConnection extends EventEmitter {
|
|
|
1932
1966
|
// RFC-014: a request whose result can carry hints is remembered past
|
|
1933
1967
|
// its timeout, so a late result's hints still apply (readTap).
|
|
1934
1968
|
if (this.readTap && HINTED_METHODS.has(method)) {
|
|
1935
|
-
this.hintedRequests.set(id, { method, params });
|
|
1969
|
+
this.hintedRequests.set(id, { method, params: hintedParams(method, params) });
|
|
1936
1970
|
if (this.hintedRequests.size > 1000)
|
|
1937
1971
|
this.hintedRequests.delete(this.hintedRequests.keys().next().value);
|
|
1938
1972
|
}
|
|
@@ -2347,6 +2381,12 @@ export class McplServerConnection extends EventEmitter {
|
|
|
2347
2381
|
logValueRedacted(response.error.message, redact));
|
|
2348
2382
|
}
|
|
2349
2383
|
else {
|
|
2384
|
+
try {
|
|
2385
|
+
pending.onRead?.(response.result);
|
|
2386
|
+
}
|
|
2387
|
+
catch (error) {
|
|
2388
|
+
console.error(`MCPL server "${this.id}": reading ${pending.method}'s result failed: ${logDetail(describeCause(error))}`);
|
|
2389
|
+
}
|
|
2350
2390
|
pending.resolve(response.result);
|
|
2351
2391
|
}
|
|
2352
2392
|
}
|