agentfootprint 9.97.0 → 9.98.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/CHANGELOG.md +56 -0
- package/dist/artifacts/datasetResult.js +119 -0
- package/dist/artifacts/datasetResult.js.map +1 -0
- package/dist/artifacts/index.js +4 -1
- package/dist/artifacts/index.js.map +1 -1
- package/dist/esm/artifacts/datasetResult.d.ts +44 -0
- package/dist/esm/artifacts/datasetResult.js +114 -0
- package/dist/esm/artifacts/datasetResult.js.map +1 -0
- package/dist/esm/artifacts/index.d.ts +1 -0
- package/dist/esm/artifacts/index.js +1 -0
- package/dist/esm/artifacts/index.js.map +1 -1
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/integrity/assertion/conflicts.d.ts +5 -32
- package/dist/esm/integrity/assertion/conflicts.js +6 -69
- package/dist/esm/integrity/assertion/conflicts.js.map +1 -1
- package/dist/esm/integrity/assertion/types.d.ts +8 -69
- package/dist/esm/integrity/assertion/types.js +0 -0
- package/dist/esm/integrity/assertion/types.js.map +1 -1
- package/dist/esm/lib/injection-engine/factories/defineMenuHint.js +3 -5
- package/dist/esm/lib/injection-engine/factories/defineMenuHint.js.map +1 -1
- package/dist/esm/lib/injection-engine/skillToolDescriptors.d.ts +4 -2
- package/dist/esm/lib/injection-engine/skillToolDescriptors.js +17 -8
- package/dist/esm/lib/injection-engine/skillToolDescriptors.js.map +1 -1
- package/dist/esm/lib/mcp/mcpClient.js +5 -97
- package/dist/esm/lib/mcp/mcpClient.js.map +1 -1
- package/dist/esm/lib/mcp/mockMcpClient.d.ts +8 -4
- package/dist/esm/lib/mcp/mockMcpClient.js +6 -5
- package/dist/esm/lib/mcp/mockMcpClient.js.map +1 -1
- package/dist/esm/lib/mcp/toolResult.d.ts +8 -0
- package/dist/esm/lib/mcp/toolResult.js +244 -0
- package/dist/esm/lib/mcp/toolResult.js.map +1 -0
- package/dist/esm/lib/mcp/types.d.ts +15 -0
- package/dist/esm/lib/semantics/check.d.ts +7 -1
- package/dist/esm/lib/semantics/check.js +16 -0
- package/dist/esm/lib/semantics/check.js.map +1 -1
- package/dist/esm/lib/semantics/cli.js +3 -0
- package/dist/esm/lib/semantics/cli.js.map +1 -1
- package/dist/esm/lib/semantics/projection.d.ts +15 -0
- package/dist/esm/lib/semantics/projection.js +186 -0
- package/dist/esm/lib/semantics/projection.js.map +1 -0
- package/dist/esm/lib/time-travel/index.d.ts +1 -1
- package/dist/esm/lib/time-travel/index.js.map +1 -1
- package/dist/esm/lib/time-travel/receipt.d.ts +5 -0
- package/dist/esm/lib/time-travel/receipt.js +2 -0
- package/dist/esm/lib/time-travel/receipt.js.map +1 -1
- package/dist/esm/lib/time-travel/requestMeasurement.d.ts +33 -0
- package/dist/esm/lib/time-travel/requestMeasurement.js +120 -0
- package/dist/esm/lib/time-travel/requestMeasurement.js.map +1 -0
- package/dist/esm/lib/time-travel/servedView.js +8 -1
- package/dist/esm/lib/time-travel/servedView.js.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/integrity/assertion/conflicts.js +6 -69
- package/dist/integrity/assertion/conflicts.js.map +1 -1
- package/dist/integrity/assertion/types.js +0 -0
- package/dist/integrity/assertion/types.js.map +1 -1
- package/dist/lib/injection-engine/factories/defineMenuHint.js +3 -5
- package/dist/lib/injection-engine/factories/defineMenuHint.js.map +1 -1
- package/dist/lib/injection-engine/skillToolDescriptors.js +17 -8
- package/dist/lib/injection-engine/skillToolDescriptors.js.map +1 -1
- package/dist/lib/mcp/mcpClient.js +5 -97
- package/dist/lib/mcp/mcpClient.js.map +1 -1
- package/dist/lib/mcp/mockMcpClient.js +6 -5
- package/dist/lib/mcp/mockMcpClient.js.map +1 -1
- package/dist/lib/mcp/toolResult.js +249 -0
- package/dist/lib/mcp/toolResult.js.map +1 -0
- package/dist/lib/semantics/check.js +16 -0
- package/dist/lib/semantics/check.js.map +1 -1
- package/dist/lib/semantics/cli.js +3 -0
- package/dist/lib/semantics/cli.js.map +1 -1
- package/dist/lib/semantics/projection.js +191 -0
- package/dist/lib/semantics/projection.js.map +1 -0
- package/dist/lib/time-travel/index.js.map +1 -1
- package/dist/lib/time-travel/receipt.js +2 -0
- package/dist/lib/time-travel/receipt.js.map +1 -1
- package/dist/lib/time-travel/requestMeasurement.js +124 -0
- package/dist/lib/time-travel/requestMeasurement.js.map +1 -0
- package/dist/lib/time-travel/servedView.js +8 -1
- package/dist/lib/time-travel/servedView.js.map +1 -1
- package/dist/types/artifacts/datasetResult.d.ts +45 -0
- package/dist/types/artifacts/datasetResult.d.ts.map +1 -0
- package/dist/types/artifacts/index.d.ts +1 -0
- package/dist/types/artifacts/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/integrity/assertion/conflicts.d.ts +5 -32
- package/dist/types/integrity/assertion/conflicts.d.ts.map +1 -1
- package/dist/types/integrity/assertion/types.d.ts +8 -69
- package/dist/types/integrity/assertion/types.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/factories/defineMenuHint.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/skillToolDescriptors.d.ts +4 -2
- package/dist/types/lib/injection-engine/skillToolDescriptors.d.ts.map +1 -1
- package/dist/types/lib/mcp/mcpClient.d.ts.map +1 -1
- package/dist/types/lib/mcp/mockMcpClient.d.ts +8 -4
- package/dist/types/lib/mcp/mockMcpClient.d.ts.map +1 -1
- package/dist/types/lib/mcp/toolResult.d.ts +9 -0
- package/dist/types/lib/mcp/toolResult.d.ts.map +1 -0
- package/dist/types/lib/mcp/types.d.ts +15 -0
- package/dist/types/lib/mcp/types.d.ts.map +1 -1
- package/dist/types/lib/semantics/check.d.ts +7 -1
- package/dist/types/lib/semantics/check.d.ts.map +1 -1
- package/dist/types/lib/semantics/cli.d.ts.map +1 -1
- package/dist/types/lib/semantics/projection.d.ts +16 -0
- package/dist/types/lib/semantics/projection.d.ts.map +1 -0
- package/dist/types/lib/time-travel/index.d.ts +1 -1
- package/dist/types/lib/time-travel/index.d.ts.map +1 -1
- package/dist/types/lib/time-travel/receipt.d.ts +5 -0
- package/dist/types/lib/time-travel/receipt.d.ts.map +1 -1
- package/dist/types/lib/time-travel/requestMeasurement.d.ts +34 -0
- package/dist/types/lib/time-travel/requestMeasurement.d.ts.map +1 -0
- package/dist/types/lib/time-travel/servedView.d.ts.map +1 -1
- package/package.json +6 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,62 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [9.98.0] - 2026-09-15
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- `withDatasetArtifacts(tool, adapter)` and `stageDatasetArtifacts` publish
|
|
15
|
+
producer-declared datasets through the existing scoped artifact store. Local,
|
|
16
|
+
HTTP-backed and structured MCP tools share source lineage, unavailable receipts
|
|
17
|
+
and retention checks. Storage is configured by the host; a frontend is optional.
|
|
18
|
+
Includes a chatbot-only example that calculates from the same ref on a later
|
|
19
|
+
turn. This handles materialized results, not streaming or remote dataset handles.
|
|
20
|
+
- MCP clients can opt into `resultMode: 'structured'` or `'structured-or-json'`
|
|
21
|
+
before dataset adaptation. Structured data survives without text conversion;
|
|
22
|
+
the fallback accepts only one declared JSON-object text block. Default text
|
|
23
|
+
decoding is unchanged, and tool errors remain failures.
|
|
24
|
+
- `receipt.requestMeasurement` records JSON character and UTF-8 byte sizes for
|
|
25
|
+
the initial prepared canonical request and its separately serialized slots,
|
|
26
|
+
including complete tool schemas. Unsupported or cyclic values report an
|
|
27
|
+
unavailable measurement without failing the call. Internal work limits report
|
|
28
|
+
`measurement-limit` at more than 100,000 visited values, 64 nested containers,
|
|
29
|
+
or 4,000,000 string/key UTF-16 code units while copying or serialized JSON
|
|
30
|
+
characters; they never truncate or reject provider input. Older receipts may
|
|
31
|
+
lack the field. Existing advisory counters are unchanged; these sizes do not
|
|
32
|
+
represent tokens, later retries or provider HTTP payloads. The measurement
|
|
33
|
+
records no request content; `RequestMeasurement` and `RequestJsonSize` are public types.
|
|
34
|
+
|
|
35
|
+
### Changed
|
|
36
|
+
|
|
37
|
+
- Reuse ContextFootprint's pure assertion comparison and Claim-face helpers.
|
|
38
|
+
Existing assertion keys, witness identity, diagnostic checks and answer-delivery
|
|
39
|
+
policies remain unchanged. Use the published exact `contextfootprint: "0.1.1"`
|
|
40
|
+
runtime dependency; remove the temporary vendored archive and bundle used before
|
|
41
|
+
that registry release. Clean online installs and cached offline installs are
|
|
42
|
+
checked through source and packed consumers.
|
|
43
|
+
|
|
44
|
+
### Fixed
|
|
45
|
+
|
|
46
|
+
- Dataset projections preserve original absence, coverage, clarification and
|
|
47
|
+
semantic declarations, including recognized tool-effect status/effects.
|
|
48
|
+
`withDatasetArtifacts` refuses removed, changed or unreadable declarations;
|
|
49
|
+
optional paired `checkSemantics` fixtures apply the same check at build time.
|
|
50
|
+
This checks declaration preservation, not factual truth, never infers absence
|
|
51
|
+
from empty data, and leaves `requestInput` pauses unchanged.
|
|
52
|
+
- `read_skill` describes each visible skill once when the turn-start menu and
|
|
53
|
+
the catalog or reachability lists overlap. Later memberships retain the skill
|
|
54
|
+
id; candidate ordering, supplied relevance, cursor, visibility and admission
|
|
55
|
+
remain unchanged. The default menu hint and tool wording no longer claim an
|
|
56
|
+
offline scorer necessarily ranked the menu. No routing option is required.
|
|
57
|
+
- Upgrade the shared comparison to ContextFootprint 0.1.1. Distinct JSON data
|
|
58
|
+
with an own `__proto__` property now produces the expected conflict, including
|
|
59
|
+
nested objects and known Claim payloads. Legacy recording keys and original
|
|
60
|
+
witnesses remain unchanged. Pre-call and post-call integration tests exercise
|
|
61
|
+
the shared implementation. Both release paths now require the packed dependency
|
|
62
|
+
check before publishing.
|
|
63
|
+
|
|
8
64
|
## [9.97.0] - 2026-09-13
|
|
9
65
|
|
|
10
66
|
### Added
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stageDatasetArtifacts = exports.withDatasetArtifacts = void 0;
|
|
4
|
+
const projection_js_1 = require("../lib/semantics/projection.js");
|
|
5
|
+
/**
|
|
6
|
+
* Adapt any local, HTTP-backed or MCP Tool using the SAME already-bound execution capability.
|
|
7
|
+
* Claim-check: the host configures storage; the model carries tickets between tools. No UI required.
|
|
8
|
+
* No store: pass through without calling the adapter; the host's normal result policy still applies.
|
|
9
|
+
* Writes are independent, not a transaction. A failed source does not hide otherwise readable data;
|
|
10
|
+
* its unavailable receipt must remain explicit in the producer's projection. Recheck tickets after
|
|
11
|
+
* the batch because a later put can evict an earlier one. Expiry after publication remains possible.
|
|
12
|
+
* This stages materialized payloads; it does not add remote handles, streaming or query pushdown.
|
|
13
|
+
*/
|
|
14
|
+
function withDatasetArtifacts(tool, adapter) {
|
|
15
|
+
return {
|
|
16
|
+
...tool,
|
|
17
|
+
async execute(args, ctx) {
|
|
18
|
+
const result = await tool.execute(args, ctx);
|
|
19
|
+
if (!ctx.hasArtifacts)
|
|
20
|
+
return result;
|
|
21
|
+
const semantics = (0, projection_js_1.snapshotProjectionSemantics)(result);
|
|
22
|
+
const plan = await adapter.describe(result, args);
|
|
23
|
+
if (plan === undefined) {
|
|
24
|
+
const issues = (0, projection_js_1.projectionSemanticsIssues)(semantics, result);
|
|
25
|
+
if (issues.length)
|
|
26
|
+
throw new Error(issues[0].message);
|
|
27
|
+
return result;
|
|
28
|
+
}
|
|
29
|
+
if (!plan || typeof plan.project !== 'function') {
|
|
30
|
+
throw new TypeError('A dataset result plan requires a project function.');
|
|
31
|
+
}
|
|
32
|
+
const projected = await plan.project(await stageDatasetArtifacts(plan.datasets, ctx.artifacts));
|
|
33
|
+
const issues = (0, projection_js_1.projectionSemanticsIssues)(semantics, projected);
|
|
34
|
+
if (issues.length)
|
|
35
|
+
throw new Error(issues[0].message);
|
|
36
|
+
return projected;
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
exports.withDatasetArtifacts = withDatasetArtifacts;
|
|
41
|
+
/** The same staging step for an existing tool pipeline that already owns execution and projection. */
|
|
42
|
+
async function stageDatasetArtifacts(datasets, artifacts) {
|
|
43
|
+
assertInputs(datasets);
|
|
44
|
+
const publications = [];
|
|
45
|
+
for (const entry of datasets) {
|
|
46
|
+
const source = entry.source ? await put(artifacts, entry.source) : undefined;
|
|
47
|
+
const parentRefs = source?.status === 'stored'
|
|
48
|
+
? [...(entry.artifact.parentRefs ?? []), source.meta.ref]
|
|
49
|
+
: entry.artifact.parentRefs;
|
|
50
|
+
const artifact = await put(artifacts, { ...entry.artifact, ...(parentRefs && { parentRefs }) });
|
|
51
|
+
publications.push({ key: entry.key, artifact, ...(source && { source }) });
|
|
52
|
+
}
|
|
53
|
+
const held = [];
|
|
54
|
+
for (const publication of publications) {
|
|
55
|
+
const artifact = await current(artifacts, publication.artifact);
|
|
56
|
+
const source = publication.source ? await current(artifacts, publication.source) : undefined;
|
|
57
|
+
held.push({ key: publication.key, artifact, ...(source && { source }) });
|
|
58
|
+
}
|
|
59
|
+
return held;
|
|
60
|
+
}
|
|
61
|
+
exports.stageDatasetArtifacts = stageDatasetArtifacts;
|
|
62
|
+
async function put(artifacts, input) {
|
|
63
|
+
try {
|
|
64
|
+
return { status: 'stored', meta: await artifacts.put(input) };
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
// Store exceptions may contain connection strings. The existing artifact event records the refusal.
|
|
68
|
+
return { status: 'unavailable', reason: 'store-unavailable' };
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
async function current(artifacts, receipt) {
|
|
72
|
+
if (receipt.status !== 'stored')
|
|
73
|
+
return receipt;
|
|
74
|
+
try {
|
|
75
|
+
const meta = await artifacts.head(receipt.meta.ref);
|
|
76
|
+
return meta
|
|
77
|
+
? { status: 'stored', meta }
|
|
78
|
+
: { status: 'unavailable', reason: 'missing-or-expired' };
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
return { status: 'unavailable', reason: 'store-unavailable' };
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/** Validate declaration shape before any writes. Payload serialization and parent proofs belong to the store. */
|
|
85
|
+
function assertInputs(datasets) {
|
|
86
|
+
if (!Array.isArray(datasets)) {
|
|
87
|
+
throw new TypeError('Dataset declarations must be an array.');
|
|
88
|
+
}
|
|
89
|
+
const keys = new Set();
|
|
90
|
+
for (const entry of datasets) {
|
|
91
|
+
if (!entry || typeof entry.key !== 'string' || entry.key.trim() === '' || keys.has(entry.key)) {
|
|
92
|
+
throw new TypeError('Dataset keys must be nonempty and unique within one result.');
|
|
93
|
+
}
|
|
94
|
+
keys.add(entry.key);
|
|
95
|
+
for (const input of [entry.artifact, ...(entry.source === undefined ? [] : [entry.source])]) {
|
|
96
|
+
if (!input ||
|
|
97
|
+
typeof input !== 'object' ||
|
|
98
|
+
Array.isArray(input) ||
|
|
99
|
+
typeof input.kind !== 'string' ||
|
|
100
|
+
!input.kind.trim() ||
|
|
101
|
+
typeof input.mediaType !== 'string' ||
|
|
102
|
+
!input.mediaType.trim() ||
|
|
103
|
+
!Object.prototype.hasOwnProperty.call(input, 'data')) {
|
|
104
|
+
throw new TypeError('Each dataset/source artifact requires kind, mediaType and data.');
|
|
105
|
+
}
|
|
106
|
+
if (input.parentRefs !== undefined) {
|
|
107
|
+
if (!Array.isArray(input.parentRefs)) {
|
|
108
|
+
throw new TypeError('Dataset/source parentRefs must be an array of strings.');
|
|
109
|
+
}
|
|
110
|
+
for (const ref of input.parentRefs) {
|
|
111
|
+
if (typeof ref !== 'string') {
|
|
112
|
+
throw new TypeError('Dataset/source parentRefs must be an array of strings.');
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=datasetResult.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datasetResult.js","sourceRoot":"","sources":["../../src/artifacts/datasetResult.ts"],"names":[],"mappings":";;;AAIA,kEAGwC;AAsCxC;;;;;;;;GAQG;AACH,SAAgB,oBAAoB,CAClC,IAA0B,EAC1B,OAAyD;IAEzD,OAAO;QACL,GAAG,IAAI;QACP,KAAK,CAAC,OAAO,CAAC,IAAW,EAAE,GAAyB;YAClD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;YAC7C,IAAI,CAAC,GAAG,CAAC,YAAY;gBAAE,OAAO,MAAM,CAAC;YACrC,MAAM,SAAS,GAAG,IAAA,2CAA2B,EAAC,MAAM,CAAC,CAAC;YACtD,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YAClD,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;gBACvB,MAAM,MAAM,GAAG,IAAA,yCAAyB,EAAC,SAAS,EAAE,MAAM,CAAC,CAAC;gBAC5D,IAAI,MAAM,CAAC,MAAM;oBAAE,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAE,CAAC,OAAO,CAAC,CAAC;gBACvD,OAAO,MAAM,CAAC;YAChB,CAAC;YACD,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,UAAU,EAAE,CAAC;gBAChD,MAAM,IAAI,SAAS,CAAC,oDAAoD,CAAC,CAAC;YAC5E,CAAC;YACD,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,OAAO,CAClC,MAAM,qBAAqB,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,SAAS,CAA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AC,EACpD,CAAC;gBACD,MAAM,IAAI,SAAS,CAAC,iEAAiE,CAAC,CAAC;YACzF,CAAC;YACD,IAAI,KAAK,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;gBACnC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC;oBACrC,MAAM,IAAI,SAAS,CAAC,wDAAwD,CAAC,CAAC;gBAChF,CAAC;gBACD,KAAK,MAAM,GAAG,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;oBACnC,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;wBAC5B,MAAM,IAAI,SAAS,CAAC,wDAAwD,CAAC,CAAC;oBAChF,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/artifacts/index.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* this folder for the one-job map and the import direction.
|
|
12
12
|
*/
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.placedToolResult = exports.placedResultKind = exports.isPlacedToolResult = exports.assertArtifactPlacement = exports.runArtifactStoreConformance = exports.runArtifactStoreCase = exports.formatArtifactStoreReport = exports.artifactStoreConformance = exports.UnserializableRecordingError = exports.chartWalkPutInput = exports.CHART_WALK_ARTIFACT_KIND = exports.RECORDING_MEDIA_TYPE = exports.RECORDING_ARTIFACT_KIND = exports.recordingPutInput = exports.presentArtifact = exports.PRESENT_TOOL_NAME = exports.wantsNeedsStoreRefusal = exports.resolveToolWants = exports.assertToolWants = exports.unconfiguredArtifacts = exports.bindArtifacts = exports.collectStream = exports.canStreamArtifacts = exports.canPutArtifactStream = exports.canGetArtifactStream = exports.bytesAsStream = exports.assertStreamBytes = exports.gcsArtifacts = exports.s3Artifacts = exports.UnreadableArtifactStoreError = exports.sqliteArtifacts = exports.UnreadableArtifactFileError = exports.fileArtifacts = exports.DEFAULT_IN_MEMORY_ARTIFACT_RETENTION = exports.inMemoryArtifacts = exports.mintArtifactRef = exports.isArtifactRef = exports.ARTIFACT_REF_PREFIX = exports.UnknownParentRefError = exports.InvalidArtifactError = exports.ArtifactIntegrityError = void 0;
|
|
14
|
+
exports.stageDatasetArtifacts = exports.withDatasetArtifacts = exports.placedToolResult = exports.placedResultKind = exports.isPlacedToolResult = exports.assertArtifactPlacement = exports.runArtifactStoreConformance = exports.runArtifactStoreCase = exports.formatArtifactStoreReport = exports.artifactStoreConformance = exports.UnserializableRecordingError = exports.chartWalkPutInput = exports.CHART_WALK_ARTIFACT_KIND = exports.RECORDING_MEDIA_TYPE = exports.RECORDING_ARTIFACT_KIND = exports.recordingPutInput = exports.presentArtifact = exports.PRESENT_TOOL_NAME = exports.wantsNeedsStoreRefusal = exports.resolveToolWants = exports.assertToolWants = exports.unconfiguredArtifacts = exports.bindArtifacts = exports.collectStream = exports.canStreamArtifacts = exports.canPutArtifactStream = exports.canGetArtifactStream = exports.bytesAsStream = exports.assertStreamBytes = exports.gcsArtifacts = exports.s3Artifacts = exports.UnreadableArtifactStoreError = exports.sqliteArtifacts = exports.UnreadableArtifactFileError = exports.fileArtifacts = exports.DEFAULT_IN_MEMORY_ARTIFACT_RETENTION = exports.inMemoryArtifacts = exports.mintArtifactRef = exports.isArtifactRef = exports.ARTIFACT_REF_PREFIX = exports.UnknownParentRefError = exports.InvalidArtifactError = exports.ArtifactIntegrityError = void 0;
|
|
15
15
|
var types_js_1 = require("./types.js");
|
|
16
16
|
Object.defineProperty(exports, "ArtifactIntegrityError", { enumerable: true, get: function () { return types_js_1.ArtifactIntegrityError; } });
|
|
17
17
|
Object.defineProperty(exports, "InvalidArtifactError", { enumerable: true, get: function () { return types_js_1.InvalidArtifactError; } });
|
|
@@ -71,4 +71,7 @@ Object.defineProperty(exports, "assertArtifactPlacement", { enumerable: true, ge
|
|
|
71
71
|
Object.defineProperty(exports, "isPlacedToolResult", { enumerable: true, get: function () { return placement_js_1.isPlacedToolResult; } });
|
|
72
72
|
Object.defineProperty(exports, "placedResultKind", { enumerable: true, get: function () { return placement_js_1.placedResultKind; } });
|
|
73
73
|
Object.defineProperty(exports, "placedToolResult", { enumerable: true, get: function () { return placement_js_1.placedToolResult; } });
|
|
74
|
+
var datasetResult_js_1 = require("./datasetResult.js");
|
|
75
|
+
Object.defineProperty(exports, "withDatasetArtifacts", { enumerable: true, get: function () { return datasetResult_js_1.withDatasetArtifacts; } });
|
|
76
|
+
Object.defineProperty(exports, "stageDatasetArtifacts", { enumerable: true, get: function () { return datasetResult_js_1.stageDatasetArtifacts; } });
|
|
74
77
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/artifacts/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAEH,uCAkBoB;AAjBlB,kHAAA,sBAAsB,OAAA;AACtB,gHAAA,oBAAoB,OAAA;AACpB,iHAAA,qBAAqB,OAAA;AAgBvB,yCAAkF;AAAzE,gHAAA,mBAAmB,OAAA;AAAE,0GAAA,aAAa,OAAA;AAAE,4GAAA,eAAe,OAAA;AAE5D,+DAKgC;AAJ9B,yHAAA,iBAAiB,OAAA;AACjB,4IAAA,oCAAoC,OAAA;AAItC,uDAI4B;AAH1B,iHAAA,aAAa,OAAA;AACb,+HAAA,2BAA2B,OAAA;AAG7B,2DAK8B;AAJ5B,qHAAA,eAAe,OAAA;AACf,kIAAA,4BAA4B,OAAA;AAI9B,mDAAwE;AAA/D,6GAAA,WAAW,OAAA;AACpB,qDAA2E;AAAlE,+GAAA,YAAY,OAAA;AACrB,+CAUwB;AATtB,iHAAA,iBAAiB,OAAA;AACjB,6GAAA,aAAa,OAAA;AACb,oHAAA,oBAAoB,OAAA;AACpB,oHAAA,oBAAoB,OAAA;AACpB,kHAAA,kBAAkB,OAAA;AAClB,6GAAA,aAAa,OAAA;AAKf,iDAUyB;AATvB,8GAAA,aAAa,OAAA;AACb,sHAAA,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,qDAA2E;AAAlE,+GAAA,YAAY,OAAA;AACrB,+CAUwB;AATtB,iHAAA,iBAAiB,OAAA;AACjB,6GAAA,aAAa,OAAA;AACb,oHAAA,oBAAoB,OAAA;AACpB,oHAAA,oBAAoB,OAAA;AACpB,kHAAA,kBAAkB,OAAA;AAClB,6GAAA,aAAa,OAAA;AAKf,iDAUyB;AATvB,8GAAA,aAAa,OAAA;AACb,sHAAA,qBAAqB,OAAA;AASvB,uCAOoB;AANlB,2GAAA,eAAe,OAAA;AACf,4GAAA,gBAAgB,OAAA;AAChB,kHAAA,sBAAsB,OAAA;AAKxB,2CAMsB;AALpB,+GAAA,iBAAiB,OAAA;AACjB,6GAAA,eAAe,OAAA;AAKjB,+DASgC;AAR9B,yHAAA,iBAAiB,OAAA;AACjB,+HAAA,uBAAuB,OAAA;AACvB,4HAAA,oBAAoB,OAAA;AACpB,gIAAA,wBAAwB,OAAA;AACxB,yHAAA,iBAAiB,OAAA;AACjB,oIAAA,4BAA4B,OAAA;AAI9B,4EAA4E;AAC5E,+EAA+E;AAC/E,6EAA6E;AAC7E,mCAAmC;AACnC,mDAagC;AAZ9B,oHAAA,wBAAwB,OAAA;AACxB,qHAAA,yBAAyB,OAAA;AACzB,gHAAA,oBAAoB,OAAA;AACpB,uHAAA,2BAA2B,OAAA;AAU7B,+CAOwB;AANtB,uHAAA,uBAAuB,OAAA;AACvB,kHAAA,kBAAkB,OAAA;AAClB,gHAAA,gBAAgB,OAAA;AAChB,gHAAA,gBAAgB,OAAA;AAIlB,uDAQ4B;AAP1B,wHAAA,oBAAoB,OAAA;AACpB,yHAAA,qBAAqB,OAAA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/** Declared datasets -> scope-bound artifacts. No transport, row discovery or domain vocabulary. */
|
|
2
|
+
import type { Tool } from '../core/tools.js';
|
|
3
|
+
import type { ToolArtifactPutInput, ToolArtifacts } from './capability.js';
|
|
4
|
+
import type { ArtifactMeta } from './types.js';
|
|
5
|
+
/** Producer-owned payloads. A source is an optional artifact, not an inferred fact. */
|
|
6
|
+
export interface DatasetArtifactInput {
|
|
7
|
+
readonly key: string;
|
|
8
|
+
readonly artifact: ToolArtifactPutInput;
|
|
9
|
+
readonly source?: ToolArtifactPutInput;
|
|
10
|
+
}
|
|
11
|
+
/** A failed write or a ticket no longer held is never advertised as a stored payload. */
|
|
12
|
+
export type DatasetArtifactReceipt = {
|
|
13
|
+
readonly status: 'stored';
|
|
14
|
+
readonly meta: ArtifactMeta;
|
|
15
|
+
} | {
|
|
16
|
+
readonly status: 'unavailable';
|
|
17
|
+
readonly reason: 'store-unavailable' | 'missing-or-expired';
|
|
18
|
+
};
|
|
19
|
+
export interface DatasetPublication {
|
|
20
|
+
readonly key: string;
|
|
21
|
+
readonly artifact: DatasetArtifactReceipt;
|
|
22
|
+
readonly source?: DatasetArtifactReceipt;
|
|
23
|
+
}
|
|
24
|
+
/** Projection owns field meanings, coverage envelopes and inline policy; receipts contain no rows. */
|
|
25
|
+
export interface DatasetResultPlan<TProjected = unknown> {
|
|
26
|
+
readonly datasets: readonly DatasetArtifactInput[];
|
|
27
|
+
project(publications: readonly DatasetPublication[]): TProjected | Promise<TProjected>;
|
|
28
|
+
}
|
|
29
|
+
export interface DatasetResultAdapter<TArgs = Record<string, unknown>, TResult = unknown, TProjected = unknown> {
|
|
30
|
+
/** Undefined is an intentional pass-through (for example a declared absence). */
|
|
31
|
+
describe(result: TResult, args: TArgs): DatasetResultPlan<TProjected> | undefined | Promise<DatasetResultPlan<TProjected> | undefined>;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Adapt any local, HTTP-backed or MCP Tool using the SAME already-bound execution capability.
|
|
35
|
+
* Claim-check: the host configures storage; the model carries tickets between tools. No UI required.
|
|
36
|
+
* No store: pass through without calling the adapter; the host's normal result policy still applies.
|
|
37
|
+
* Writes are independent, not a transaction. A failed source does not hide otherwise readable data;
|
|
38
|
+
* its unavailable receipt must remain explicit in the producer's projection. Recheck tickets after
|
|
39
|
+
* the batch because a later put can evict an earlier one. Expiry after publication remains possible.
|
|
40
|
+
* This stages materialized payloads; it does not add remote handles, streaming or query pushdown.
|
|
41
|
+
*/
|
|
42
|
+
export declare function withDatasetArtifacts<TArgs, TResult, TProjected>(tool: Tool<TArgs, TResult>, adapter: DatasetResultAdapter<TArgs, TResult, TProjected>): Tool<TArgs, TResult | TProjected>;
|
|
43
|
+
/** The same staging step for an existing tool pipeline that already owns execution and projection. */
|
|
44
|
+
export declare function stageDatasetArtifacts(datasets: readonly DatasetArtifactInput[], artifacts: ToolArtifacts): Promise<readonly DatasetPublication[]>;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { projectionSemanticsIssues, snapshotProjectionSemantics, } from '../lib/semantics/projection.js';
|
|
2
|
+
/**
|
|
3
|
+
* Adapt any local, HTTP-backed or MCP Tool using the SAME already-bound execution capability.
|
|
4
|
+
* Claim-check: the host configures storage; the model carries tickets between tools. No UI required.
|
|
5
|
+
* No store: pass through without calling the adapter; the host's normal result policy still applies.
|
|
6
|
+
* Writes are independent, not a transaction. A failed source does not hide otherwise readable data;
|
|
7
|
+
* its unavailable receipt must remain explicit in the producer's projection. Recheck tickets after
|
|
8
|
+
* the batch because a later put can evict an earlier one. Expiry after publication remains possible.
|
|
9
|
+
* This stages materialized payloads; it does not add remote handles, streaming or query pushdown.
|
|
10
|
+
*/
|
|
11
|
+
export function withDatasetArtifacts(tool, adapter) {
|
|
12
|
+
return {
|
|
13
|
+
...tool,
|
|
14
|
+
async execute(args, ctx) {
|
|
15
|
+
const result = await tool.execute(args, ctx);
|
|
16
|
+
if (!ctx.hasArtifacts)
|
|
17
|
+
return result;
|
|
18
|
+
const semantics = snapshotProjectionSemantics(result);
|
|
19
|
+
const plan = await adapter.describe(result, args);
|
|
20
|
+
if (plan === undefined) {
|
|
21
|
+
const issues = projectionSemanticsIssues(semantics, result);
|
|
22
|
+
if (issues.length)
|
|
23
|
+
throw new Error(issues[0].message);
|
|
24
|
+
return result;
|
|
25
|
+
}
|
|
26
|
+
if (!plan || typeof plan.project !== 'function') {
|
|
27
|
+
throw new TypeError('A dataset result plan requires a project function.');
|
|
28
|
+
}
|
|
29
|
+
const projected = await plan.project(await stageDatasetArtifacts(plan.datasets, ctx.artifacts));
|
|
30
|
+
const issues = projectionSemanticsIssues(semantics, projected);
|
|
31
|
+
if (issues.length)
|
|
32
|
+
throw new Error(issues[0].message);
|
|
33
|
+
return projected;
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/** The same staging step for an existing tool pipeline that already owns execution and projection. */
|
|
38
|
+
export async function stageDatasetArtifacts(datasets, artifacts) {
|
|
39
|
+
assertInputs(datasets);
|
|
40
|
+
const publications = [];
|
|
41
|
+
for (const entry of datasets) {
|
|
42
|
+
const source = entry.source ? await put(artifacts, entry.source) : undefined;
|
|
43
|
+
const parentRefs = source?.status === 'stored'
|
|
44
|
+
? [...(entry.artifact.parentRefs ?? []), source.meta.ref]
|
|
45
|
+
: entry.artifact.parentRefs;
|
|
46
|
+
const artifact = await put(artifacts, { ...entry.artifact, ...(parentRefs && { parentRefs }) });
|
|
47
|
+
publications.push({ key: entry.key, artifact, ...(source && { source }) });
|
|
48
|
+
}
|
|
49
|
+
const held = [];
|
|
50
|
+
for (const publication of publications) {
|
|
51
|
+
const artifact = await current(artifacts, publication.artifact);
|
|
52
|
+
const source = publication.source ? await current(artifacts, publication.source) : undefined;
|
|
53
|
+
held.push({ key: publication.key, artifact, ...(source && { source }) });
|
|
54
|
+
}
|
|
55
|
+
return held;
|
|
56
|
+
}
|
|
57
|
+
async function put(artifacts, input) {
|
|
58
|
+
try {
|
|
59
|
+
return { status: 'stored', meta: await artifacts.put(input) };
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
// Store exceptions may contain connection strings. The existing artifact event records the refusal.
|
|
63
|
+
return { status: 'unavailable', reason: 'store-unavailable' };
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
async function current(artifacts, receipt) {
|
|
67
|
+
if (receipt.status !== 'stored')
|
|
68
|
+
return receipt;
|
|
69
|
+
try {
|
|
70
|
+
const meta = await artifacts.head(receipt.meta.ref);
|
|
71
|
+
return meta
|
|
72
|
+
? { status: 'stored', meta }
|
|
73
|
+
: { status: 'unavailable', reason: 'missing-or-expired' };
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
return { status: 'unavailable', reason: 'store-unavailable' };
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/** Validate declaration shape before any writes. Payload serialization and parent proofs belong to the store. */
|
|
80
|
+
function assertInputs(datasets) {
|
|
81
|
+
if (!Array.isArray(datasets)) {
|
|
82
|
+
throw new TypeError('Dataset declarations must be an array.');
|
|
83
|
+
}
|
|
84
|
+
const keys = new Set();
|
|
85
|
+
for (const entry of datasets) {
|
|
86
|
+
if (!entry || typeof entry.key !== 'string' || entry.key.trim() === '' || keys.has(entry.key)) {
|
|
87
|
+
throw new TypeError('Dataset keys must be nonempty and unique within one result.');
|
|
88
|
+
}
|
|
89
|
+
keys.add(entry.key);
|
|
90
|
+
for (const input of [entry.artifact, ...(entry.source === undefined ? [] : [entry.source])]) {
|
|
91
|
+
if (!input ||
|
|
92
|
+
typeof input !== 'object' ||
|
|
93
|
+
Array.isArray(input) ||
|
|
94
|
+
typeof input.kind !== 'string' ||
|
|
95
|
+
!input.kind.trim() ||
|
|
96
|
+
typeof input.mediaType !== 'string' ||
|
|
97
|
+
!input.mediaType.trim() ||
|
|
98
|
+
!Object.prototype.hasOwnProperty.call(input, 'data')) {
|
|
99
|
+
throw new TypeError('Each dataset/source artifact requires kind, mediaType and data.');
|
|
100
|
+
}
|
|
101
|
+
if (input.parentRefs !== undefined) {
|
|
102
|
+
if (!Array.isArray(input.parentRefs)) {
|
|
103
|
+
throw new TypeError('Dataset/source parentRefs must be an array of strings.');
|
|
104
|
+
}
|
|
105
|
+
for (const ref of input.parentRefs) {
|
|
106
|
+
if (typeof ref !== 'string') {
|
|
107
|
+
throw new TypeError('Dataset/source parentRefs must be an array of strings.');
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=datasetResult.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datasetResult.js","sourceRoot":"","sources":["../../../src/artifacts/datasetResult.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,yBAAyB,EACzB,2BAA2B,GAC5B,MAAM,gCAAgC,CAAC;AAsCxC;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAClC,IAA0B,EAC1B,OAAyD;IAEzD,OAAO;QACL,GAAG,IAAI;QACP,KAAK,CAAC,OAAO,CAAC,IAAW,EAAE,GAAyB;YAClD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;YAC7C,IAAI,CAAC,GAAG,CAAC,YAAY;gBAAE,OAAO,MAAM,CAAC;YACrC,MAAM,SAAS,GAAG,2BAA2B,CAAC,MAAM,CAAC,CAAC;YACtD,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YAClD,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;gBACvB,MAAM,MAAM,GAAG,yBAAyB,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;gBAC5D,IAAI,MAAM,CAAC,MAAM;oBAAE,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAE,CAAC,OAAO,CAAC,CAAC;gBACvD,OAAO,MAAM,CAAC;YAChB,CAAC;YACD,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,UAAU,EAAE,CAAC;gBAChD,MAAM,IAAI,SAAS,CAAC,oDAAoD,CAAC,CAAC;YAC5E,CAAC;YACD,MAAM,SAAS,GAAG,MAAM,IAAI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AC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,EACpD,CAAC;gBACD,MAAM,IAAI,SAAS,CAAC,iEAAiE,CAAC,CAAC;YACzF,CAAC;YACD,IAAI,KAAK,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;gBACnC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC;oBACrC,MAAM,IAAI,SAAS,CAAC,wDAAwD,CAAC,CAAC;gBAChF,CAAC;gBACD,KAAK,MAAM,GAAG,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;oBACnC,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;wBAC5B,MAAM,IAAI,SAAS,CAAC,wDAAwD,CAAC,CAAC;oBAChF,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -24,3 +24,4 @@ export { PRESENT_TOOL_NAME, presentArtifact, type PresentOutcome, type PresentSn
|
|
|
24
24
|
export { recordingPutInput, RECORDING_ARTIFACT_KIND, RECORDING_MEDIA_TYPE, CHART_WALK_ARTIFACT_KIND, chartWalkPutInput, UnserializableRecordingError, type ChartWalkMintFacts, type RecordingMintFacts, } from './recordingArtifact.js';
|
|
25
25
|
export { artifactStoreConformance, formatArtifactStoreReport, runArtifactStoreCase, runArtifactStoreConformance, type ArtifactConformanceKit, type ArtifactStoreCase, type ArtifactStoreCaseName, type ArtifactStoreHarness, type ArtifactStoreHarnessHook, type ArtifactStoreMember, type ArtifactStoreOutcome, type ArtifactStoreReport, } from './conformance/index.js';
|
|
26
26
|
export { assertArtifactPlacement, isPlacedToolResult, placedResultKind, placedToolResult, type ArtifactPlacement, type PlacedToolResult, } from './placement.js';
|
|
27
|
+
export { withDatasetArtifacts, stageDatasetArtifacts, type DatasetArtifactInput, type DatasetArtifactReceipt, type DatasetPublication, type DatasetResultAdapter, type DatasetResultPlan, } from './datasetResult.js';
|
|
@@ -27,4 +27,5 @@ export { recordingPutInput, RECORDING_ARTIFACT_KIND, RECORDING_MEDIA_TYPE, CHART
|
|
|
27
27
|
// fail. See conformance/README.md.
|
|
28
28
|
export { artifactStoreConformance, formatArtifactStoreReport, runArtifactStoreCase, runArtifactStoreConformance, } from './conformance/index.js';
|
|
29
29
|
export { assertArtifactPlacement, isPlacedToolResult, placedResultKind, placedToolResult, } from './placement.js';
|
|
30
|
+
export { withDatasetArtifacts, stageDatasetArtifacts, } from './datasetResult.js';
|
|
30
31
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/artifacts/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,GAetB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAElF,OAAO,EACL,iBAAiB,EACjB,oCAAoC,GAGrC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,aAAa,EACb,2BAA2B,GAE5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,eAAe,EACf,4BAA4B,GAG7B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,WAAW,EAA2B,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,YAAY,EAA4B,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,GAId,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,aAAa,EACb,qBAAqB,GAQtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,sBAAsB,GAIvB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,iBAAiB,EACjB,eAAe,GAIhB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,oBAAoB,EACpB,wBAAwB,EACxB,iBAAiB,EACjB,4BAA4B,GAG7B,MAAM,wBAAwB,CAAC;AAChC,4EAA4E;AAC5E,+EAA+E;AAC/E,6EAA6E;AAC7E,mCAAmC;AACnC,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,oBAAoB,EACpB,2BAA2B,GAS5B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,GAGjB,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/artifacts/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,GAetB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAElF,OAAO,EACL,iBAAiB,EACjB,oCAAoC,GAGrC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,aAAa,EACb,2BAA2B,GAE5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,eAAe,EACf,4BAA4B,GAG7B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,WAAW,EAA2B,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,YAAY,EAA4B,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,GAId,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,aAAa,EACb,qBAAqB,GAQtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,sBAAsB,GAIvB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,iBAAiB,EACjB,eAAe,GAIhB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,oBAAoB,EACpB,wBAAwB,EACxB,iBAAiB,EACjB,4BAA4B,GAG7B,MAAM,wBAAwB,CAAC;AAChC,4EAA4E;AAC5E,+EAA+E;AAC/E,6EAA6E;AAC7E,mCAAmC;AACnC,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,oBAAoB,EACpB,2BAA2B,GAS5B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,GAGjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,oBAAoB,EACpB,qBAAqB,GAMtB,MAAM,oBAAoB,CAAC"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export type { CombinedRecorder, ScopeRecorder, FlowRecorder, EmitRecorder, Write
|
|
|
12
12
|
export * from './adapters/types.js';
|
|
13
13
|
export { INJECTION_KEYS, injectionKeyForSlot, isInjectionKey, type InjectionKey, stageRole, type StageRole, milestoneFor, type Milestone, type MilestoneKind, MILESTONE_KINDS, MILESTONE_TAG_PREFIX, MILESTONE_LABEL_TAG_PREFIX, milestoneTag, milestoneTags, milestoneTagsFor, milestoneFromTags, RESERVED_SUBFLOW_PREFIX, isReservedSubflowSegment, } from './conventions.js';
|
|
14
14
|
export { milestoneOf, milestoneStops, milestoneStopsStrategy } from './lib/time-travel/index.js';
|
|
15
|
-
export { epochAt, epochLocations, keyedFold, messageDigestInput, toolDigestInput, receiptAt, receiptHash, servedAt, servedViews, RECEIPT_BOUNDARY, SERVED_GAPS, UNGAPPED_FIELDS, type EpochLocation, type FoldBasis, type KeyedFold, type Receipt, type ReceiptCacheMarker, type ReceiptMessage, type ReceiptParams, type ReceiptPiece, type ReceiptRequestOnlyMessage, type ServedGap, type ServedGapCause, type ServedGapKind, type ServedPiece, type ServedRequestOnly, type ServedView, type StoredReceipt, } from './lib/time-travel/index.js';
|
|
15
|
+
export { epochAt, epochLocations, keyedFold, messageDigestInput, toolDigestInput, receiptAt, receiptHash, servedAt, servedViews, RECEIPT_BOUNDARY, SERVED_GAPS, UNGAPPED_FIELDS, type EpochLocation, type FoldBasis, type KeyedFold, type Receipt, type ReceiptCacheMarker, type ReceiptMessage, type ReceiptParams, type ReceiptPiece, type ReceiptRequestOnlyMessage, type RequestMeasurement, type RequestJsonSize, type ServedGap, type ServedGapCause, type ServedGapKind, type ServedPiece, type ServedRequestOnly, type ServedView, type StoredReceipt, } from './lib/time-travel/index.js';
|
|
16
16
|
export { COMPOSITION_KEYS, type BudgetPressureRecord, type CompositionKey, type EvictionRecord, type InjectionRecord, type SlotComposition, } from './recorders/core/types.js';
|
|
17
17
|
export { type RunContext } from './bridge/eventMeta.js';
|
|
18
18
|
export { contextEngineering, isEngineeredSource, isBaselineSource, ENGINEERED_SOURCES, BASELINE_SOURCES, type ContextEngineeringHandle, type ContextEngineeringUnsubscribe, type ContextInjectedEvent, type ContextInjectedListener, } from './recorders/core/contextEngineering.js';
|
|
@@ -71,7 +71,7 @@ export { composeNotCovered, COUNTER_AGGREGATION_WORDS, explainSemantics, isCount
|
|
|
71
71
|
export { toolSessionKey, hashSessionKey, ToolTeardownTimeoutError, TOOL_TEARDOWN_TIMEOUT_MS, type TeardownScope, type TeardownReason, type TeardownOptions, } from './core/toolSessions.js';
|
|
72
72
|
export { codeRunnerTool, codeShape, codeRunsOf, toolSessionsOf, TOOL_SESSIONS, type CodeRunnerToolOptions, type CodeRunnerToolScope, type HoldsToolSessions, type CodeRunFacts, } from './core/codeRunnerTool.js';
|
|
73
73
|
export { toolContractCheckup, formatToolContractCheckup, type ToolContractCheckup, type ToolContractProblem, type ToolContractCode, type ServerToolEntry, } from './core/toolContract.js';
|
|
74
|
-
export { ARTIFACT_REF_PREFIX, ArtifactIntegrityError, bindArtifacts, RECORDING_ARTIFACT_KIND, RECORDING_MEDIA_TYPE, recordingPutInput, CHART_WALK_ARTIFACT_KIND, chartWalkPutInput, UnserializableRecordingError, DEFAULT_IN_MEMORY_ARTIFACT_RETENTION, fileArtifacts, gcsArtifacts, inMemoryArtifacts, InvalidArtifactError, isArtifactRef, mintArtifactRef, s3Artifacts, sqliteArtifacts, unconfiguredArtifacts, UnknownParentRefError, UnreadableArtifactFileError, UnreadableArtifactStoreError, type ArtifactEventFact, type ArtifactEventSink, type ArtifactListOptions, type ArtifactListResult, type ArtifactMeta, type ArtifactOp, type ArtifactOrigin, type ArtifactPutResult, type ArtifactRecord, type ArtifactRef, type ArtifactRefusalReason, type ArtifactRetention, type ArtifactScope, type ArtifactStore, type ArtifactSweepReason, type BindArtifactsOptions, type FileArtifactsOptions, type GcsArtifactsOptions, type InMemoryArtifacts, type InMemoryArtifactsOptions, type PutArtifactInput, type RecordingMintFacts, type S3ArtifactsOptions, type SqliteArtifacts, type SqliteArtifactsOptions, type SweptArtifact, type ToolArtifactPutInput, type ToolArtifacts, } from './artifacts/index.js';
|
|
74
|
+
export { ARTIFACT_REF_PREFIX, ArtifactIntegrityError, bindArtifacts, RECORDING_ARTIFACT_KIND, RECORDING_MEDIA_TYPE, recordingPutInput, CHART_WALK_ARTIFACT_KIND, chartWalkPutInput, UnserializableRecordingError, DEFAULT_IN_MEMORY_ARTIFACT_RETENTION, fileArtifacts, gcsArtifacts, inMemoryArtifacts, InvalidArtifactError, isArtifactRef, mintArtifactRef, s3Artifacts, sqliteArtifacts, unconfiguredArtifacts, UnknownParentRefError, UnreadableArtifactFileError, UnreadableArtifactStoreError, type ArtifactEventFact, type ArtifactEventSink, type ArtifactListOptions, type ArtifactListResult, type ArtifactMeta, type ArtifactOp, type ArtifactOrigin, type ArtifactPutResult, type ArtifactRecord, type ArtifactRef, type ArtifactRefusalReason, type ArtifactRetention, type ArtifactScope, type ArtifactStore, type ArtifactSweepReason, type BindArtifactsOptions, type FileArtifactsOptions, type GcsArtifactsOptions, type InMemoryArtifacts, type InMemoryArtifactsOptions, type PutArtifactInput, type RecordingMintFacts, type S3ArtifactsOptions, type SqliteArtifacts, type SqliteArtifactsOptions, type SweptArtifact, type ToolArtifactPutInput, type ToolArtifacts, withDatasetArtifacts, stageDatasetArtifacts, type DatasetArtifactInput, type DatasetArtifactReceipt, type DatasetPublication, type DatasetResultAdapter, type DatasetResultPlan, } from './artifacts/index.js';
|
|
75
75
|
export { canGetArtifactStream, canPutArtifactStream, canStreamArtifacts, type ArtifactStreamPutInput, type ArtifactStreamRecord, type StreamingArtifactStore, } from './artifacts/index.js';
|
|
76
76
|
export { artifactStoreConformance, formatArtifactStoreReport, runArtifactStoreCase, runArtifactStoreConformance, type ArtifactConformanceKit, type ArtifactStoreCase, type ArtifactStoreCaseName, type ArtifactStoreHarness, type ArtifactStoreHarnessHook, type ArtifactStoreMember, type ArtifactStoreOutcome, type ArtifactStoreReport, } from './artifacts/index.js';
|
|
77
77
|
export { assertToolWants, isPlacedToolResult, placedResultKind, PRESENT_TOOL_NAME, type ArtifactPlacement, type PlacedToolResult, type PresentedResult, type PresentSnapshot, type ToolWants, } from './artifacts/index.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -334,7 +334,7 @@ RECORDING_ARTIFACT_KIND, RECORDING_MEDIA_TYPE, recordingPutInput,
|
|
|
334
334
|
// The chart-walk kind (9.76.0) — a runbook's inner walk, one row per
|
|
335
335
|
// execution step with the decide() evidence in the `condition` rows,
|
|
336
336
|
// checked in under 'recording/chart-walk' beside 'recording/run'.
|
|
337
|
-
CHART_WALK_ARTIFACT_KIND, chartWalkPutInput, UnserializableRecordingError, DEFAULT_IN_MEMORY_ARTIFACT_RETENTION, fileArtifacts, gcsArtifacts, inMemoryArtifacts, InvalidArtifactError, isArtifactRef, mintArtifactRef, s3Artifacts, sqliteArtifacts, unconfiguredArtifacts, UnknownParentRefError, UnreadableArtifactFileError, UnreadableArtifactStoreError, } from './artifacts/index.js';
|
|
337
|
+
CHART_WALK_ARTIFACT_KIND, chartWalkPutInput, UnserializableRecordingError, DEFAULT_IN_MEMORY_ARTIFACT_RETENTION, fileArtifacts, gcsArtifacts, inMemoryArtifacts, InvalidArtifactError, isArtifactRef, mintArtifactRef, s3Artifacts, sqliteArtifacts, unconfiguredArtifacts, UnknownParentRefError, UnreadableArtifactFileError, UnreadableArtifactStoreError, withDatasetArtifacts, stageDatasetArtifacts, } from './artifacts/index.js';
|
|
338
338
|
// Artifacts, the optional streaming leg (9.25.0) — `putStream`/`getStream` are
|
|
339
339
|
// FEATURE-DETECTED members of the port, so a store that cannot move bytes
|
|
340
340
|
// without holding them whole leaves them absent rather than faking one. The
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,oEAAoE;AACpE,8DAA8D;AAC9D,uEAAuE;AACvE,kEAAkE;AAClE,sEAAsE;AACtE,sDAAsD;AACtD,OAAO,8CAA8C,CAAC;AACtD,OAAO,2CAA2C,CAAC;AACnD,OAAO,4CAA4C,CAAC;AAsCpD,6BAA6B;AAC7B,cAAc,qBAAqB,CAAC;AAEpC,yEAAyE;AACzE,uDAAuD;AACvD,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,cAAc;AAEd,yEAAyE;AACzE,wEAAwE;AACxE,yEAAyE;AACzE,gBAAgB;AAChB,SAAS;AAET,2EAA2E;AAC3E,6EAA6E;AAC7E,6EAA6E;AAC7E,6DAA6D;AAC7D,YAAY;AAGZ,8EAA8E;AAC9E,2EAA2E;AAC3E,4EAA4E;AAC5E,0EAA0E;AAC1E,eAAe,EACf,oBAAoB,EACpB,0BAA0B,EAC1B,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,iBAAiB;AACjB,8EAA8E;AAC9E,6EAA6E;AAC7E,4EAA4E;AAC5E,yEAAyE;AACzE,4EAA4E;AAC5E,uCAAuC;AACvC,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,kBA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+1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Pattern: pure function over a finite assertion set. No I/O, no store.
|
|
5
|
-
* Role: the algebra's first comparison: two `asserted` (never quoted)
|
|
6
|
-
* assertions on one single-valued `(subject, predicate, epoch)`
|
|
7
|
-
* key with different comparable values cannot both be true.
|
|
8
|
-
*
|
|
9
|
-
* What it deliberately does NOT do:
|
|
10
|
-
* - fire across strata (history is quotation);
|
|
11
|
-
* - compare unknowns (honest absence — an unknown neither corroborates
|
|
12
|
-
* nor contradicts);
|
|
13
|
-
* - fire on multi-valued predicates (the declared exception);
|
|
14
|
-
* - infer subject identity (no stamp, no comparison);
|
|
15
|
-
* - resolve anything — it names pairs; the caller files findings.
|
|
16
|
-
*
|
|
17
|
-
* Values compare by structural equality over their comparable face (a
|
|
18
|
-
* known `Claim` compares by its value), via JSON with sorted keys — the
|
|
19
|
-
* same determinism bar the house holds serialization to elsewhere.
|
|
20
|
-
*/
|
|
21
|
-
import { type Assertion } from './types.js';
|
|
22
|
-
/** One exclusion: the two-or-more assertions that cannot all be true. */
|
|
23
|
-
export interface Conflict {
|
|
24
|
-
readonly key: string;
|
|
25
|
-
/** Every distinct-valued assertion on the key, in input order. */
|
|
26
|
-
readonly assertions: readonly Assertion[];
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Find every single-valued key carrying two or more distinct values.
|
|
30
|
-
*
|
|
31
|
-
* @param assertions the finite set under comparison (one payload, or one
|
|
32
|
-
* write-delta joined with the standing set for a subject)
|
|
33
|
-
* @param multiValued predicates exempt from single-valuedness, declared
|
|
2
|
+
* Shared exclusion comparison with Agent's existing recording keys.
|
|
3
|
+
* This wrapper reports conflicts; callers retain their own findings and policy.
|
|
34
4
|
*/
|
|
5
|
+
import { type Assertion, type Conflict } from 'contextfootprint';
|
|
6
|
+
export type { Conflict } from 'contextfootprint';
|
|
7
|
+
/** Find conflicting current readings, retaining original witnesses and order. */
|
|
35
8
|
export declare function conflictsOf(assertions: readonly Assertion[], multiValued?: ReadonlySet<string>): readonly Conflict[];
|
|
@@ -1,74 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Pattern: pure function over a finite assertion set. No I/O, no store.
|
|
5
|
-
* Role: the algebra's first comparison: two `asserted` (never quoted)
|
|
6
|
-
* assertions on one single-valued `(subject, predicate, epoch)`
|
|
7
|
-
* key with different comparable values cannot both be true.
|
|
8
|
-
*
|
|
9
|
-
* What it deliberately does NOT do:
|
|
10
|
-
* - fire across strata (history is quotation);
|
|
11
|
-
* - compare unknowns (honest absence — an unknown neither corroborates
|
|
12
|
-
* nor contradicts);
|
|
13
|
-
* - fire on multi-valued predicates (the declared exception);
|
|
14
|
-
* - infer subject identity (no stamp, no comparison);
|
|
15
|
-
* - resolve anything — it names pairs; the caller files findings.
|
|
16
|
-
*
|
|
17
|
-
* Values compare by structural equality over their comparable face (a
|
|
18
|
-
* known `Claim` compares by its value), via JSON with sorted keys — the
|
|
19
|
-
* same determinism bar the house holds serialization to elsewhere.
|
|
20
|
-
*/
|
|
21
|
-
import { assertionKey, comparableValueOf, participates } from './types.js';
|
|
22
|
-
/** Deterministic structural rendering — sorted keys, no ambient state. */
|
|
23
|
-
function renderValue(value) {
|
|
24
|
-
const face = comparableValueOf(value);
|
|
25
|
-
return JSON.stringify(face, (_k, v) => {
|
|
26
|
-
if (v !== null && typeof v === 'object' && !Array.isArray(v)) {
|
|
27
|
-
const sorted = {};
|
|
28
|
-
for (const key of Object.keys(v).sort()) {
|
|
29
|
-
sorted[key] = v[key];
|
|
30
|
-
}
|
|
31
|
-
return sorted;
|
|
32
|
-
}
|
|
33
|
-
return v;
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Find every single-valued key carrying two or more distinct values.
|
|
38
|
-
*
|
|
39
|
-
* @param assertions the finite set under comparison (one payload, or one
|
|
40
|
-
* write-delta joined with the standing set for a subject)
|
|
41
|
-
* @param multiValued predicates exempt from single-valuedness, declared
|
|
2
|
+
* Shared exclusion comparison with Agent's existing recording keys.
|
|
3
|
+
* This wrapper reports conflicts; callers retain their own findings and policy.
|
|
42
4
|
*/
|
|
5
|
+
import { conflictsOf as compareAssertions } from 'contextfootprint';
|
|
6
|
+
import { assertionKey } from './types.js';
|
|
7
|
+
/** Find conflicting current readings, retaining original witnesses and order. */
|
|
43
8
|
export function conflictsOf(assertions, multiValued = new Set()) {
|
|
44
|
-
|
|
45
|
-
for (const a of assertions) {
|
|
46
|
-
if (a.stratum !== 'asserted')
|
|
47
|
-
continue; // history is quotation
|
|
48
|
-
if (multiValued.has(a.predicate))
|
|
49
|
-
continue; // the declared exception
|
|
50
|
-
if (!participates(a.value))
|
|
51
|
-
continue; // unknowns never compare
|
|
52
|
-
const key = assertionKey(a);
|
|
53
|
-
let entry = byKey.get(key);
|
|
54
|
-
if (entry === undefined) {
|
|
55
|
-
entry = { byValue: new Map(), order: [] };
|
|
56
|
-
byKey.set(key, entry);
|
|
57
|
-
}
|
|
58
|
-
const rendered = renderValue(a.value);
|
|
59
|
-
const bucket = entry.byValue.get(rendered);
|
|
60
|
-
if (bucket === undefined)
|
|
61
|
-
entry.byValue.set(rendered, [a]);
|
|
62
|
-
else
|
|
63
|
-
bucket.push(a);
|
|
64
|
-
entry.order.push(a);
|
|
65
|
-
}
|
|
66
|
-
const conflicts = [];
|
|
67
|
-
for (const [key, entry] of byKey) {
|
|
68
|
-
if (entry.byValue.size < 2)
|
|
69
|
-
continue;
|
|
70
|
-
conflicts.push({ key, assertions: entry.order });
|
|
71
|
-
}
|
|
72
|
-
return conflicts;
|
|
9
|
+
return compareAssertions(assertions, multiValued, assertionKey);
|
|
73
10
|
}
|
|
74
11
|
//# sourceMappingURL=conflicts.js.map
|