@tangle-network/agent-app 0.46.29 → 0.46.31
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/dist/chat-routes/gateway-adapter.d.ts +17 -0
- package/dist/chat-routes/index.d.ts +1 -0
- package/dist/chat-routes/index.js +188 -1
- package/dist/chat-routes/index.js.map +1 -1
- package/dist/chat-routes/turn-routes.d.ts +5 -0
- package/dist/work-product/index.js +33 -27
- package/dist/work-product/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -521,6 +521,11 @@ export interface ChatTurnRoutes {
|
|
|
521
521
|
* running (and buffering) after a client disconnect. */
|
|
522
522
|
turn(request: Request, ctx?: {
|
|
523
523
|
waitUntil?(p: Promise<unknown>): void;
|
|
524
|
+
/**
|
|
525
|
+
* Abort this turn when the caller disconnects. Gateway adapters set this
|
|
526
|
+
* explicitly; browser callers omit it so the durable drain continues.
|
|
527
|
+
*/
|
|
528
|
+
cancelOnDisconnect?: boolean;
|
|
524
529
|
}): Promise<Response>;
|
|
525
530
|
/** GET — replay a buffered turn from `?fromSeq=` (0 = everything), then
|
|
526
531
|
* follow it live until it completes. */
|
|
@@ -892,9 +892,39 @@ function buildWorkProductTools(config) {
|
|
|
892
892
|
...config.now ? { now: config.now } : {},
|
|
893
893
|
...config.generateId ? { generateId: config.generateId } : {}
|
|
894
894
|
});
|
|
895
|
+
const canResolveTextLocators = config.readSourceText !== void 0;
|
|
896
|
+
const locatorProperties = {
|
|
897
|
+
page: { type: "number" },
|
|
898
|
+
range: { type: "string", description: "Free-form location: 'L120-L134' | 'B7' | '\xB64'." },
|
|
899
|
+
...canResolveTextLocators ? {
|
|
900
|
+
find: {
|
|
901
|
+
type: "string",
|
|
902
|
+
description: 'PREFERRED \u2014 use this whenever the value was READ from a document. The value exactly as it appears in the source (for example "128,450.00"), or a short distinctive phrase from the supporting line. The platform LOCATES it, cites the whole line it sits on, and returns that line to you. You do not retype the quote and you do not compute character offsets \u2014 so the citation can neither be invented nor land on the wrong line. If the value is not in the document, the entry is refused.'
|
|
903
|
+
},
|
|
904
|
+
findOccurrence: {
|
|
905
|
+
type: "integer",
|
|
906
|
+
minimum: 1,
|
|
907
|
+
description: "Which occurrence of `find` to cite when the value appears more than once. Defaults to the first."
|
|
908
|
+
},
|
|
909
|
+
span: {
|
|
910
|
+
type: "object",
|
|
911
|
+
description: "Only when you have exact character offsets from a tool that computed them. Absolute offsets into the whole document: start is the first character, end is one past the last. Prefer `find` \u2014 offsets computed by hand land on the wrong line.",
|
|
912
|
+
properties: {
|
|
913
|
+
start: { type: "integer", minimum: 0 },
|
|
914
|
+
end: { type: "integer", minimum: 1 }
|
|
915
|
+
},
|
|
916
|
+
required: ["start", "end"],
|
|
917
|
+
additionalProperties: false
|
|
918
|
+
}
|
|
919
|
+
} : {},
|
|
920
|
+
quote: {
|
|
921
|
+
type: "string",
|
|
922
|
+
description: canResolveTextLocators ? "Fallback for sources that cannot give you character offsets: the supporting text copied character-for-character. The platform checks it occurs in the document and REFUSES the entry if it does not. Prefer span. For a value you COMPUTED rather than read, omit both and state the computation in claim." : "Supporting text copied character-for-character from the source. This deployment cannot locate values or resolve character spans. For a value you COMPUTED rather than read, omit the locator and state the computation in claim."
|
|
923
|
+
}
|
|
924
|
+
};
|
|
895
925
|
const upsertEvidence = defineAppTool({
|
|
896
926
|
name: "upsert_evidence",
|
|
897
|
-
description: "Record source\u2192field lineage for the current work product, incrementally as you find it. Each entry links a source document (sourceRef + locator) to one artifact target and states the claim it supports. Cite by locator.find \u2014 the value exactly as it appears in the document \u2014 and the platform locates it and writes the supporting quote for you. Re-emitting an entry id replaces that entry. Address the work product by scopeKey; the first call creates the draft.",
|
|
927
|
+
description: canResolveTextLocators ? "Record source\u2192field lineage for the current work product, incrementally as you find it. Each entry links a source document (sourceRef + locator) to one artifact target and states the claim it supports. Cite by locator.find \u2014 the value exactly as it appears in the document \u2014 and the platform locates it and writes the supporting quote for you. Re-emitting an entry id replaces that entry. Address the work product by scopeKey; the first call creates the draft." : "Record source\u2192field lineage for the current work product, incrementally as you find it. Each entry links a source document (sourceRef + locator) to one artifact target and states the claim it supports. Cite with locator.quote when the source states the claim. This deployment cannot locate values or resolve character spans. Re-emitting an entry id replaces that entry. Address the work product by scopeKey; the first call creates the draft.",
|
|
898
928
|
parameters: {
|
|
899
929
|
type: "object",
|
|
900
930
|
properties: {
|
|
@@ -910,32 +940,8 @@ function buildWorkProductTools(config) {
|
|
|
910
940
|
sourceRef: { type: "string", description: "Vault path / attachment id of the SOURCE document." },
|
|
911
941
|
locator: {
|
|
912
942
|
type: "object",
|
|
913
|
-
properties:
|
|
914
|
-
|
|
915
|
-
range: { type: "string", description: "Free-form location: 'L120-L134' | 'B7' | '\xB64'." },
|
|
916
|
-
find: {
|
|
917
|
-
type: "string",
|
|
918
|
-
description: 'PREFERRED \u2014 use this whenever the value was READ from a document. The value exactly as it appears in the source (for example "128,450.00"), or a short distinctive phrase from the supporting line. The platform LOCATES it, cites the whole line it sits on, and returns that line to you. You do not retype the quote and you do not compute character offsets \u2014 so the citation can neither be invented nor land on the wrong line. If the value is not in the document, the entry is refused.'
|
|
919
|
-
},
|
|
920
|
-
findOccurrence: {
|
|
921
|
-
type: "integer",
|
|
922
|
-
minimum: 1,
|
|
923
|
-
description: "Which occurrence of `find` to cite when the value appears more than once. Defaults to the first."
|
|
924
|
-
},
|
|
925
|
-
span: {
|
|
926
|
-
type: "object",
|
|
927
|
-
description: "Only when you have exact character offsets from a tool that computed them. Absolute offsets into the whole document: start is the first character, end is one past the last. Prefer `find` \u2014 offsets computed by hand land on the wrong line.",
|
|
928
|
-
properties: {
|
|
929
|
-
start: { type: "integer", minimum: 0 },
|
|
930
|
-
end: { type: "integer", minimum: 1 }
|
|
931
|
-
},
|
|
932
|
-
required: ["start", "end"]
|
|
933
|
-
},
|
|
934
|
-
quote: {
|
|
935
|
-
type: "string",
|
|
936
|
-
description: "Fallback for sources that cannot give you character offsets: the supporting text copied character-for-character. The platform checks it occurs in the document and REFUSES the entry if it does not. Prefer span. For a value you COMPUTED rather than read, omit both and state the computation in claim."
|
|
937
|
-
}
|
|
938
|
-
}
|
|
943
|
+
properties: locatorProperties,
|
|
944
|
+
additionalProperties: false
|
|
939
945
|
},
|
|
940
946
|
target: { type: "string", description: "Artifact field/claim this evidence supports." },
|
|
941
947
|
claim: { type: "string", description: "The value/assertion at the target." },
|