agentfootprint 9.20.0 → 9.22.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/AGENTS.md +1 -1
- package/CLAUDE.md +1 -1
- package/README.md +1 -0
- package/ai-instructions/claude-code/SKILL.md +1 -1
- package/dist/artifacts/capability.js +131 -0
- package/dist/artifacts/capability.js.map +1 -0
- package/dist/artifacts/fileArtifacts.js +230 -0
- package/dist/artifacts/fileArtifacts.js.map +1 -0
- package/dist/artifacts/inMemoryArtifacts.js +165 -0
- package/dist/artifacts/inMemoryArtifacts.js.map +1 -0
- package/dist/artifacts/index.js +47 -0
- package/dist/artifacts/index.js.map +1 -0
- package/dist/artifacts/minting.js +79 -0
- package/dist/artifacts/minting.js.map +1 -0
- package/dist/artifacts/naming.js +64 -0
- package/dist/artifacts/naming.js.map +1 -0
- package/dist/artifacts/payload.js +113 -0
- package/dist/artifacts/payload.js.map +1 -0
- package/dist/artifacts/placement.js +86 -0
- package/dist/artifacts/placement.js.map +1 -0
- package/dist/artifacts/present.js +98 -0
- package/dist/artifacts/present.js.map +1 -0
- package/dist/artifacts/retention.js +121 -0
- package/dist/artifacts/retention.js.map +1 -0
- package/dist/artifacts/sqliteArtifacts.js +338 -0
- package/dist/artifacts/sqliteArtifacts.js.map +1 -0
- package/dist/artifacts/types.js +96 -0
- package/dist/artifacts/types.js.map +1 -0
- package/dist/artifacts/wants.js +240 -0
- package/dist/artifacts/wants.js.map +1 -0
- package/dist/core/Agent.js +73 -2
- package/dist/core/Agent.js.map +1 -1
- package/dist/core/agent/buildToolRegistry.js +30 -1
- package/dist/core/agent/buildToolRegistry.js.map +1 -1
- package/dist/core/agent/presentTool.js +59 -0
- package/dist/core/agent/presentTool.js.map +1 -0
- package/dist/core/agent/stages/toolCalls.js +347 -8
- package/dist/core/agent/stages/toolCalls.js.map +1 -1
- package/dist/core/codeRunnerTool.js +89 -3
- package/dist/core/codeRunnerTool.js.map +1 -1
- package/dist/core/tools.js +7 -0
- package/dist/core/tools.js.map +1 -1
- package/dist/esm/adapters/types.d.ts +17 -1
- package/dist/esm/artifacts/capability.d.ts +93 -0
- package/dist/esm/artifacts/capability.js +126 -0
- package/dist/esm/artifacts/capability.js.map +1 -0
- package/dist/esm/artifacts/fileArtifacts.d.ts +58 -0
- package/dist/esm/artifacts/fileArtifacts.js +225 -0
- package/dist/esm/artifacts/fileArtifacts.js.map +1 -0
- package/dist/esm/artifacts/inMemoryArtifacts.d.ts +54 -0
- package/dist/esm/artifacts/inMemoryArtifacts.js +161 -0
- package/dist/esm/artifacts/inMemoryArtifacts.js.map +1 -0
- package/dist/esm/artifacts/index.d.ts +21 -0
- package/dist/esm/artifacts/index.js +21 -0
- package/dist/esm/artifacts/index.js.map +1 -0
- package/dist/esm/artifacts/minting.d.ts +29 -0
- package/dist/esm/artifacts/minting.js +75 -0
- package/dist/esm/artifacts/minting.js.map +1 -0
- package/dist/esm/artifacts/naming.d.ts +36 -0
- package/dist/esm/artifacts/naming.js +59 -0
- package/dist/esm/artifacts/naming.js.map +1 -0
- package/dist/esm/artifacts/payload.d.ts +43 -0
- package/dist/esm/artifacts/payload.js +105 -0
- package/dist/esm/artifacts/payload.js.map +1 -0
- package/dist/esm/artifacts/placement.d.ts +74 -0
- package/dist/esm/artifacts/placement.js +79 -0
- package/dist/esm/artifacts/placement.js.map +1 -0
- package/dist/esm/artifacts/present.d.ts +77 -0
- package/dist/esm/artifacts/present.js +94 -0
- package/dist/esm/artifacts/present.js.map +1 -0
- package/dist/esm/artifacts/retention.d.ts +72 -0
- package/dist/esm/artifacts/retention.js +115 -0
- package/dist/esm/artifacts/retention.js.map +1 -0
- package/dist/esm/artifacts/sqliteArtifacts.d.ts +90 -0
- package/dist/esm/artifacts/sqliteArtifacts.js +333 -0
- package/dist/esm/artifacts/sqliteArtifacts.js.map +1 -0
- package/dist/esm/artifacts/types.d.ts +220 -0
- package/dist/esm/artifacts/types.js +90 -0
- package/dist/esm/artifacts/types.js.map +1 -0
- package/dist/esm/artifacts/wants.d.ts +104 -0
- package/dist/esm/artifacts/wants.js +234 -0
- package/dist/esm/artifacts/wants.js.map +1 -0
- package/dist/esm/core/Agent.d.ts +8 -2
- package/dist/esm/core/Agent.js +73 -2
- package/dist/esm/core/Agent.js.map +1 -1
- package/dist/esm/core/agent/buildToolRegistry.d.ts +11 -1
- package/dist/esm/core/agent/buildToolRegistry.js +30 -1
- package/dist/esm/core/agent/buildToolRegistry.js.map +1 -1
- package/dist/esm/core/agent/presentTool.d.ts +22 -0
- package/dist/esm/core/agent/presentTool.js +55 -0
- package/dist/esm/core/agent/presentTool.js.map +1 -0
- package/dist/esm/core/agent/stages/toolCalls.d.ts +22 -0
- package/dist/esm/core/agent/stages/toolCalls.js +347 -8
- package/dist/esm/core/agent/stages/toolCalls.js.map +1 -1
- package/dist/esm/core/agent/types.d.ts +46 -0
- package/dist/esm/core/codeRunnerTool.js +89 -3
- package/dist/esm/core/codeRunnerTool.js.map +1 -1
- package/dist/esm/core/tools.d.ts +49 -0
- package/dist/esm/core/tools.js +7 -0
- package/dist/esm/core/tools.js.map +1 -1
- package/dist/esm/events/dispatcher.d.ts +1 -1
- package/dist/esm/events/dispatcher.js.map +1 -1
- package/dist/esm/events/payloads.d.ts +83 -0
- package/dist/esm/events/registry.d.ts +13 -1
- package/dist/esm/events/registry.js +12 -0
- package/dist/esm/events/registry.js.map +1 -1
- package/dist/esm/index.d.ts +3 -1
- package/dist/esm/index.js +17 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/mcp/mcpServe.js +16 -0
- package/dist/esm/lib/mcp/mcpServe.js.map +1 -1
- package/dist/esm/lib/trace-toolpack/traceToolpack.js +4 -0
- package/dist/esm/lib/trace-toolpack/traceToolpack.js.map +1 -1
- package/dist/esm/recorders/core/ArtifactsRecorder.d.ts +22 -0
- package/dist/esm/recorders/core/ArtifactsRecorder.js +27 -0
- package/dist/esm/recorders/core/ArtifactsRecorder.js.map +1 -0
- package/dist/events/dispatcher.js.map +1 -1
- package/dist/events/registry.js +12 -0
- package/dist/events/registry.js.map +1 -1
- package/dist/index.js +43 -8
- package/dist/index.js.map +1 -1
- package/dist/lib/mcp/mcpServe.js +16 -0
- package/dist/lib/mcp/mcpServe.js.map +1 -1
- package/dist/lib/trace-toolpack/traceToolpack.js +4 -0
- package/dist/lib/trace-toolpack/traceToolpack.js.map +1 -1
- package/dist/recorders/core/ArtifactsRecorder.js +31 -0
- package/dist/recorders/core/ArtifactsRecorder.js.map +1 -0
- package/dist/types/adapters/types.d.ts +17 -1
- package/dist/types/adapters/types.d.ts.map +1 -1
- package/dist/types/artifacts/capability.d.ts +94 -0
- package/dist/types/artifacts/capability.d.ts.map +1 -0
- package/dist/types/artifacts/fileArtifacts.d.ts +59 -0
- package/dist/types/artifacts/fileArtifacts.d.ts.map +1 -0
- package/dist/types/artifacts/inMemoryArtifacts.d.ts +55 -0
- package/dist/types/artifacts/inMemoryArtifacts.d.ts.map +1 -0
- package/dist/types/artifacts/index.d.ts +22 -0
- package/dist/types/artifacts/index.d.ts.map +1 -0
- package/dist/types/artifacts/minting.d.ts +30 -0
- package/dist/types/artifacts/minting.d.ts.map +1 -0
- package/dist/types/artifacts/naming.d.ts +37 -0
- package/dist/types/artifacts/naming.d.ts.map +1 -0
- package/dist/types/artifacts/payload.d.ts +44 -0
- package/dist/types/artifacts/payload.d.ts.map +1 -0
- package/dist/types/artifacts/placement.d.ts +75 -0
- package/dist/types/artifacts/placement.d.ts.map +1 -0
- package/dist/types/artifacts/present.d.ts +78 -0
- package/dist/types/artifacts/present.d.ts.map +1 -0
- package/dist/types/artifacts/retention.d.ts +73 -0
- package/dist/types/artifacts/retention.d.ts.map +1 -0
- package/dist/types/artifacts/sqliteArtifacts.d.ts +91 -0
- package/dist/types/artifacts/sqliteArtifacts.d.ts.map +1 -0
- package/dist/types/artifacts/types.d.ts +221 -0
- package/dist/types/artifacts/types.d.ts.map +1 -0
- package/dist/types/artifacts/wants.d.ts +105 -0
- package/dist/types/artifacts/wants.d.ts.map +1 -0
- package/dist/types/core/Agent.d.ts +8 -2
- package/dist/types/core/Agent.d.ts.map +1 -1
- package/dist/types/core/agent/buildToolRegistry.d.ts +11 -1
- package/dist/types/core/agent/buildToolRegistry.d.ts.map +1 -1
- package/dist/types/core/agent/presentTool.d.ts +23 -0
- package/dist/types/core/agent/presentTool.d.ts.map +1 -0
- package/dist/types/core/agent/stages/toolCalls.d.ts +22 -0
- package/dist/types/core/agent/stages/toolCalls.d.ts.map +1 -1
- package/dist/types/core/agent/types.d.ts +46 -0
- package/dist/types/core/agent/types.d.ts.map +1 -1
- package/dist/types/core/codeRunnerTool.d.ts.map +1 -1
- package/dist/types/core/tools.d.ts +49 -0
- package/dist/types/core/tools.d.ts.map +1 -1
- package/dist/types/events/dispatcher.d.ts +1 -1
- package/dist/types/events/dispatcher.d.ts.map +1 -1
- package/dist/types/events/payloads.d.ts +83 -0
- package/dist/types/events/payloads.d.ts.map +1 -1
- package/dist/types/events/registry.d.ts +13 -1
- package/dist/types/events/registry.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lib/mcp/mcpServe.d.ts.map +1 -1
- package/dist/types/lib/trace-toolpack/traceToolpack.d.ts.map +1 -1
- package/dist/types/recorders/core/ArtifactsRecorder.d.ts +23 -0
- package/dist/types/recorders/core/ArtifactsRecorder.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retention.js","sourceRoot":"","sources":["../../src/artifacts/retention.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;;AAgCH;;;;GAIG;AACH,SAAgB,eAAe,CAAC,OAAe,EAAE,SAAwC;IACvF,IAAI,SAAS,KAAK,SAAS;QAAE,OAAO;IACpC,MAAM,KAAK,GAAgD;QACzD,CAAC,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC;QAC1B,CA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C,CAAC;YAC5B,KAAK,IAAI,OAAO,CAAC,KAAK,CAAC;QACzB,CAAC;IACH,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,CAAC;AACnB,CAAC;AAvDD,sCAuDC;AAED;;;;GAIG;AACH,SAAgB,gBAAgB,CAC9B,eAAmC,EACnC,SAAwC,EACxC,GAAW;IAEX,MAAM,OAAO,GAAG,SAAS,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;IACnF,IAAI,eAAe,KAAK,SAAS;QAAE,OAAO,OAAO,CAAC;IAClD,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,eAAe,CAAC;IAClD,OAAO,IAAI,CAAC,GAAG,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;AAC5C,CAAC;AATD,4CASC"}
|
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* artifacts/sqliteArtifacts — the claim-check store in one SQLite file.
|
|
4
|
+
*
|
|
5
|
+
* The durable pairing for `sqliteSessions`: point both at files beside each
|
|
6
|
+
* other and the artifacts a conversation minted live exactly as long as the
|
|
7
|
+
* conversation that can speak their refs — retention coupled by
|
|
8
|
+
* construction, not by checkup. It follows `hosting/sqliteSessions` law for
|
|
9
|
+
* law: `node:sqlite` loaded lazily at construction and refused by name where
|
|
10
|
+
* absent (no install, no native build, and no version-floor tax on consumers
|
|
11
|
+
* who never construct one); WAL requested and the journal mode REPORTED as
|
|
12
|
+
* read back rather than assumed; STRICT tables; a file that exists but is not
|
|
13
|
+
* ours refused by name (`not-our-schema` / `newer-schema` / `cannot-open`) —
|
|
14
|
+
* an unreadable store and an empty one are different facts, and only one of
|
|
15
|
+
* them is safe to answer with a fresh start; `':memory:'` refused, because
|
|
16
|
+
* `inMemoryArtifacts` says that in its name.
|
|
17
|
+
*
|
|
18
|
+
* The columns repeat what the meta knows (kind, bytes, expiry, creation) so
|
|
19
|
+
* an incident can ask "what is filling this store?" from the `sqlite3`
|
|
20
|
+
* command line without a JSON parser and without this library.
|
|
21
|
+
*
|
|
22
|
+
* One process, one machine, one writer at a time — the same ceiling
|
|
23
|
+
* sqliteSessions states, inherited rather than restated at length.
|
|
24
|
+
*/
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.sqliteArtifacts = exports.UnreadableArtifactStoreError = void 0;
|
|
27
|
+
const lazyRequire_js_1 = require("../lib/lazyRequire.js");
|
|
28
|
+
const sqliteUnavailable_js_1 = require("../lib/sqliteUnavailable.js");
|
|
29
|
+
const index_js_1 = require("../memory/identity/index.js");
|
|
30
|
+
const minting_js_1 = require("./minting.js");
|
|
31
|
+
const naming_js_1 = require("./naming.js");
|
|
32
|
+
const payload_js_1 = require("./payload.js");
|
|
33
|
+
const retention_js_1 = require("./retention.js");
|
|
34
|
+
const types_js_1 = require("./types.js");
|
|
35
|
+
/**
|
|
36
|
+
* Raised when the file exists but this runtime cannot use it as an artifact
|
|
37
|
+
* store — never answered with an empty store. Same law, same three cases as
|
|
38
|
+
* `UnreadableSessionFileError`, per store.
|
|
39
|
+
*/
|
|
40
|
+
class UnreadableArtifactStoreError extends Error {
|
|
41
|
+
code = 'ERR_UNREADABLE_ARTIFACT_STORE';
|
|
42
|
+
file;
|
|
43
|
+
problem;
|
|
44
|
+
constructor(file, problem, detail) {
|
|
45
|
+
super(`[artifacts] the artifact store at '${file}' cannot be used: ${detail} ` +
|
|
46
|
+
`An unreadable store and an empty one are different facts, and only one of them is ` +
|
|
47
|
+
`safe to answer with a fresh start. ` +
|
|
48
|
+
(problem === 'newer-schema'
|
|
49
|
+
? `Roll agentfootprint forward, or point this store at its own file.`
|
|
50
|
+
: problem === 'not-our-schema'
|
|
51
|
+
? `Give the store a file of its own rather than sharing one with tables of the ` +
|
|
52
|
+
`same name.`
|
|
53
|
+
: `Check the path and its permissions, or move the file aside to start a new one.`));
|
|
54
|
+
this.name = 'UnreadableArtifactStoreError';
|
|
55
|
+
this.file = file;
|
|
56
|
+
this.problem = problem;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.UnreadableArtifactStoreError = UnreadableArtifactStoreError;
|
|
60
|
+
/** Bumped only for a change an older reader could not survive. */
|
|
61
|
+
const SCHEMA_VERSION = 1;
|
|
62
|
+
const ARTIFACTS_TABLE = 'af_artifacts';
|
|
63
|
+
const META_TABLE = 'af_artifacts_meta';
|
|
64
|
+
const ARTIFACT_COLUMNS = [
|
|
65
|
+
'scope_ns',
|
|
66
|
+
'ref',
|
|
67
|
+
'kind',
|
|
68
|
+
'media_type',
|
|
69
|
+
'bytes',
|
|
70
|
+
'label',
|
|
71
|
+
'digest',
|
|
72
|
+
'expires_at',
|
|
73
|
+
'origin',
|
|
74
|
+
'parent_refs',
|
|
75
|
+
'created_at',
|
|
76
|
+
'last_accessed_at',
|
|
77
|
+
'payload_shape',
|
|
78
|
+
'payload',
|
|
79
|
+
];
|
|
80
|
+
/**
|
|
81
|
+
* An artifact store in one SQLite file — durable across restarts, crash-safe
|
|
82
|
+
* under WAL, and the natural neighbour of `sqliteSessions({ file })`.
|
|
83
|
+
*
|
|
84
|
+
* @throws SqliteUnavailableError when the running Node has no `node:sqlite`.
|
|
85
|
+
* @throws UnreadableArtifactStoreError when the file exists but cannot be used.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* const agent = Agent.create({
|
|
89
|
+
* provider,
|
|
90
|
+
* artifacts: sqliteArtifacts({ file: './data/artifacts.db' }),
|
|
91
|
+
* });
|
|
92
|
+
*/
|
|
93
|
+
function sqliteArtifacts(options) {
|
|
94
|
+
const { file, retention, busyTimeoutMs = 5000 } = options;
|
|
95
|
+
if (file === ':memory:' || typeof file !== 'string' || file.trim() === '') {
|
|
96
|
+
throw new TypeError(`[artifacts] sqliteArtifacts({ file: '${String(file)}' }) is not a durable store. ` +
|
|
97
|
+
`':memory:' looks like a file and keeps nothing across a restart, which is the one ` +
|
|
98
|
+
`thing this adapter exists to do. Use inMemoryArtifacts() when an in-process store ` +
|
|
99
|
+
`is what you want — it says so in its name — or give this one a real path.`);
|
|
100
|
+
}
|
|
101
|
+
(0, retention_js_1.assertRetention)('sqliteArtifacts', retention);
|
|
102
|
+
const now = options._now ?? Date.now;
|
|
103
|
+
const DatabaseSync = options._sqlite ?? loadSqlite();
|
|
104
|
+
ensureParentDirectory(file);
|
|
105
|
+
let db;
|
|
106
|
+
try {
|
|
107
|
+
db = new DatabaseSync(file);
|
|
108
|
+
}
|
|
109
|
+
catch (err) {
|
|
110
|
+
throw new UnreadableArtifactStoreError(file, 'cannot-open', `${describe(err)}.`);
|
|
111
|
+
}
|
|
112
|
+
let journalMode;
|
|
113
|
+
try {
|
|
114
|
+
journalMode = applyPragmas(db, busyTimeoutMs);
|
|
115
|
+
ensureSchema(db, file);
|
|
116
|
+
}
|
|
117
|
+
catch (err) {
|
|
118
|
+
db.close();
|
|
119
|
+
if (err instanceof UnreadableArtifactStoreError)
|
|
120
|
+
throw err;
|
|
121
|
+
throw new UnreadableArtifactStoreError(file, 'cannot-open', `${describe(err)}.`);
|
|
122
|
+
}
|
|
123
|
+
const insert = db.prepare(`INSERT INTO ${ARTIFACTS_TABLE} (${ARTIFACT_COLUMNS.join(', ')}) ` +
|
|
124
|
+
`VALUES (${ARTIFACT_COLUMNS.map(() => '?').join(', ')})`);
|
|
125
|
+
const selectOne = db.prepare(`SELECT ${ARTIFACT_COLUMNS.slice(1).join(', ')} FROM ${ARTIFACTS_TABLE} ` +
|
|
126
|
+
`WHERE scope_ns = ? AND ref = ?`);
|
|
127
|
+
const selectScope = db.prepare(`SELECT ref, kind, bytes, expires_at, last_accessed_at FROM ${ARTIFACTS_TABLE} ` +
|
|
128
|
+
`WHERE scope_ns = ?`);
|
|
129
|
+
const selectPage = db.prepare(`SELECT ${ARTIFACT_COLUMNS.slice(1).join(', ')} FROM ${ARTIFACTS_TABLE} ` +
|
|
130
|
+
`WHERE scope_ns = ? ORDER BY created_at DESC, ref ASC LIMIT ? OFFSET ?`);
|
|
131
|
+
const touch = db.prepare(`UPDATE ${ARTIFACTS_TABLE} SET last_accessed_at = ? WHERE scope_ns = ? AND ref = ?`);
|
|
132
|
+
const remove = db.prepare(`DELETE FROM ${ARTIFACTS_TABLE} WHERE scope_ns = ? AND ref = ?`);
|
|
133
|
+
let closed = false;
|
|
134
|
+
const open = (verb) => {
|
|
135
|
+
if (closed) {
|
|
136
|
+
throw new Error(`[artifacts] the sqliteArtifacts store at '${file}' is closed, so it cannot ${verb}. ` +
|
|
137
|
+
`close() is final by design — reopening the file behind you would hide a ` +
|
|
138
|
+
`shutdown-ordering bug rather than surface it. Build a new store if you need one.`);
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
const rowFor = (ns, ref) => selectOne.get(ns, ref);
|
|
142
|
+
/** Resolve a live row; sweep it when the calendar says it is gone. */
|
|
143
|
+
const liveRow = (ns, ref) => {
|
|
144
|
+
if (!(0, naming_js_1.isArtifactRef)(ref))
|
|
145
|
+
return undefined;
|
|
146
|
+
const row = rowFor(ns, ref);
|
|
147
|
+
if (row === undefined)
|
|
148
|
+
return undefined;
|
|
149
|
+
if (row.expires_at !== null && row.expires_at <= now()) {
|
|
150
|
+
remove.run(ns, ref);
|
|
151
|
+
return undefined;
|
|
152
|
+
}
|
|
153
|
+
return row;
|
|
154
|
+
};
|
|
155
|
+
const metaOf = (row) => ({
|
|
156
|
+
ref: row.ref,
|
|
157
|
+
kind: row.kind,
|
|
158
|
+
mediaType: row.media_type,
|
|
159
|
+
bytes: row.bytes,
|
|
160
|
+
createdAt: row.created_at,
|
|
161
|
+
...(row.label !== null && { label: row.label }),
|
|
162
|
+
...(row.digest !== null && { digest: row.digest }),
|
|
163
|
+
...(row.expires_at !== null && { expiresAt: row.expires_at }),
|
|
164
|
+
...(row.origin !== null && { origin: JSON.parse(row.origin) }),
|
|
165
|
+
...(row.parent_refs !== null && {
|
|
166
|
+
parentRefs: JSON.parse(row.parent_refs),
|
|
167
|
+
}),
|
|
168
|
+
});
|
|
169
|
+
// Port methods are `async` so every refusal arrives as a rejection — the
|
|
170
|
+
// sqliteSessions law about not needing two error handlers.
|
|
171
|
+
return {
|
|
172
|
+
journalMode,
|
|
173
|
+
async put(scope, input) {
|
|
174
|
+
open('store an artifact');
|
|
175
|
+
const ns = (0, index_js_1.identityNamespace)(scope);
|
|
176
|
+
const at = now();
|
|
177
|
+
const { meta } = await (0, minting_js_1.prepareArtifact)(input, (parent) => liveRow(ns, parent) !== undefined, retention, at);
|
|
178
|
+
const held = selectScope.all(ns);
|
|
179
|
+
const rows = held.map((r) => ({
|
|
180
|
+
ref: r.ref,
|
|
181
|
+
kind: r.kind,
|
|
182
|
+
bytes: r.bytes,
|
|
183
|
+
...(r.expires_at !== null && { expiresAt: r.expires_at }),
|
|
184
|
+
lastAccessedAt: r.last_accessed_at,
|
|
185
|
+
}));
|
|
186
|
+
const plan = (0, retention_js_1.planRetention)(rows, meta.bytes, retention, at);
|
|
187
|
+
if (plan.refusal !== undefined)
|
|
188
|
+
throw new types_js_1.InvalidArtifactError(plan.refusal);
|
|
189
|
+
for (const swept of plan.swept)
|
|
190
|
+
remove.run(ns, swept.ref);
|
|
191
|
+
const payload = (0, payload_js_1.encodeArtifactData)(input.data);
|
|
192
|
+
insert.run(ns, meta.ref, meta.kind, meta.mediaType, meta.bytes, meta.label ?? null, meta.digest ?? null, meta.expiresAt ?? null, meta.origin !== undefined ? JSON.stringify(meta.origin) : null, meta.parentRefs !== undefined ? JSON.stringify(meta.parentRefs) : null, meta.createdAt, at, payload.shape, payload.value);
|
|
193
|
+
return { meta, swept: plan.swept };
|
|
194
|
+
},
|
|
195
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
196
|
+
async head(scope, ref) {
|
|
197
|
+
open('describe an artifact');
|
|
198
|
+
const ns = (0, index_js_1.identityNamespace)(scope);
|
|
199
|
+
const row = liveRow(ns, ref);
|
|
200
|
+
if (row === undefined)
|
|
201
|
+
return null;
|
|
202
|
+
touch.run(now(), ns, ref);
|
|
203
|
+
return metaOf(row);
|
|
204
|
+
},
|
|
205
|
+
async get(scope, ref) {
|
|
206
|
+
open('read an artifact');
|
|
207
|
+
const ns = (0, index_js_1.identityNamespace)(scope);
|
|
208
|
+
const row = liveRow(ns, ref);
|
|
209
|
+
if (row === undefined)
|
|
210
|
+
return null;
|
|
211
|
+
touch.run(now(), ns, ref);
|
|
212
|
+
const data = (0, payload_js_1.decodeArtifactData)({ shape: row.payload_shape, value: row.payload });
|
|
213
|
+
if (row.digest !== null) {
|
|
214
|
+
const actual = await (0, payload_js_1.computeArtifactDigest)(data);
|
|
215
|
+
if (actual !== row.digest)
|
|
216
|
+
throw new types_js_1.ArtifactIntegrityError(row.ref, row.digest, actual);
|
|
217
|
+
}
|
|
218
|
+
return { meta: metaOf(row), data };
|
|
219
|
+
},
|
|
220
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
221
|
+
async delete(scope, ref) {
|
|
222
|
+
open('delete an artifact');
|
|
223
|
+
if (!(0, naming_js_1.isArtifactRef)(ref))
|
|
224
|
+
return;
|
|
225
|
+
remove.run((0, index_js_1.identityNamespace)(scope), ref);
|
|
226
|
+
},
|
|
227
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
228
|
+
async list(scope, listOptions) {
|
|
229
|
+
open('list artifacts');
|
|
230
|
+
const ns = (0, index_js_1.identityNamespace)(scope);
|
|
231
|
+
const at = now();
|
|
232
|
+
const offset = decodeCursor(listOptions?.cursor);
|
|
233
|
+
const limit = Math.max(1, Math.floor(listOptions?.limit ?? 50));
|
|
234
|
+
// Ask for one extra row: "is there another page?" answered by the data.
|
|
235
|
+
// Expired rows are FILTERED here, not deleted — deleting mid-walk would
|
|
236
|
+
// shift every later offset and silently skip rows; the actual sweep
|
|
237
|
+
// happens where single rows are touched (put / head / get).
|
|
238
|
+
const rows = selectPage.all(ns, limit + 1, offset);
|
|
239
|
+
const artifacts = [];
|
|
240
|
+
let consumed = 0;
|
|
241
|
+
for (const row of rows) {
|
|
242
|
+
consumed++;
|
|
243
|
+
if (row.expires_at !== null && row.expires_at <= at)
|
|
244
|
+
continue;
|
|
245
|
+
artifacts.push(metaOf(row));
|
|
246
|
+
if (artifacts.length === limit)
|
|
247
|
+
break;
|
|
248
|
+
}
|
|
249
|
+
// More pages when rows were fetched but not walked (early break), or the
|
|
250
|
+
// over-fetch proved the table extends past this window. A final page that
|
|
251
|
+
// turns out empty is a valid cursor outcome, not an error.
|
|
252
|
+
const more = consumed < rows.length || rows.length === limit + 1;
|
|
253
|
+
return {
|
|
254
|
+
artifacts,
|
|
255
|
+
...(more && { cursor: String(offset + consumed) }),
|
|
256
|
+
};
|
|
257
|
+
},
|
|
258
|
+
close() {
|
|
259
|
+
if (closed)
|
|
260
|
+
return;
|
|
261
|
+
closed = true;
|
|
262
|
+
db.close();
|
|
263
|
+
},
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
exports.sqliteArtifacts = sqliteArtifacts;
|
|
267
|
+
// ─── Internals (the sqliteSessions liturgy, per store) ───────────────
|
|
268
|
+
function loadSqlite() {
|
|
269
|
+
try {
|
|
270
|
+
const mod = (0, lazyRequire_js_1.lazyRequire)('node:sqlite');
|
|
271
|
+
if (typeof mod?.DatabaseSync !== 'function') {
|
|
272
|
+
throw new Error('the module loaded but has no DatabaseSync');
|
|
273
|
+
}
|
|
274
|
+
return mod.DatabaseSync;
|
|
275
|
+
}
|
|
276
|
+
catch (err) {
|
|
277
|
+
throw new sqliteUnavailable_js_1.SqliteUnavailableError(nodeVersion(), describe(err));
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
function nodeVersion() {
|
|
281
|
+
return typeof process !== 'undefined' && typeof process.version === 'string'
|
|
282
|
+
? process.version
|
|
283
|
+
: 'unknown';
|
|
284
|
+
}
|
|
285
|
+
function ensureParentDirectory(file) {
|
|
286
|
+
try {
|
|
287
|
+
const { mkdirSync } = (0, lazyRequire_js_1.lazyRequire)('node:fs');
|
|
288
|
+
const { dirname } = (0, lazyRequire_js_1.lazyRequire)('node:path');
|
|
289
|
+
mkdirSync(dirname(file), { recursive: true });
|
|
290
|
+
}
|
|
291
|
+
catch {
|
|
292
|
+
/* Reported by the open below, with the path and the real reason. */
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
function applyPragmas(db, busyTimeoutMs) {
|
|
296
|
+
const row = db.prepare('PRAGMA journal_mode = WAL').get();
|
|
297
|
+
const waitMs = Number.isFinite(busyTimeoutMs) ? Math.max(0, Math.floor(busyTimeoutMs)) : 5000;
|
|
298
|
+
db.exec(`PRAGMA busy_timeout = ${waitMs}`);
|
|
299
|
+
db.exec('PRAGMA synchronous = NORMAL');
|
|
300
|
+
return typeof row?.journal_mode === 'string' ? row.journal_mode : 'unknown';
|
|
301
|
+
}
|
|
302
|
+
function ensureSchema(db, file) {
|
|
303
|
+
db.exec(`CREATE TABLE IF NOT EXISTS ${ARTIFACTS_TABLE} (` +
|
|
304
|
+
`scope_ns TEXT NOT NULL, ref TEXT NOT NULL, kind TEXT NOT NULL, ` +
|
|
305
|
+
`media_type TEXT NOT NULL, bytes INTEGER NOT NULL, label TEXT, digest TEXT, ` +
|
|
306
|
+
`expires_at INTEGER, origin TEXT, parent_refs TEXT, created_at INTEGER NOT NULL, ` +
|
|
307
|
+
`last_accessed_at INTEGER NOT NULL, payload_shape TEXT NOT NULL, payload TEXT NOT NULL, ` +
|
|
308
|
+
`PRIMARY KEY (scope_ns, ref)) STRICT`);
|
|
309
|
+
db.exec(`CREATE TABLE IF NOT EXISTS ${META_TABLE} (key TEXT PRIMARY KEY, value TEXT NOT NULL) STRICT`);
|
|
310
|
+
const columns = db.prepare(`PRAGMA table_info('${ARTIFACTS_TABLE}')`).all().map((c) => String(c.name));
|
|
311
|
+
const missing = ARTIFACT_COLUMNS.filter((name) => !columns.includes(name));
|
|
312
|
+
if (missing.length > 0) {
|
|
313
|
+
throw new UnreadableArtifactStoreError(file, 'not-our-schema', `it has an '${ARTIFACTS_TABLE}' table that is not this store's ` +
|
|
314
|
+
`(missing ${missing.join(', ')}; found ${columns.join(', ') || 'nothing'}).`);
|
|
315
|
+
}
|
|
316
|
+
const stored = db
|
|
317
|
+
.prepare(`SELECT value FROM ${META_TABLE} WHERE key = 'schema_version'`)
|
|
318
|
+
.get();
|
|
319
|
+
if (stored === undefined) {
|
|
320
|
+
db.prepare(`INSERT INTO ${META_TABLE} (key, value) VALUES ('schema_version', ?)`).run(String(SCHEMA_VERSION));
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
323
|
+
const found = Number(stored.value);
|
|
324
|
+
if (!Number.isFinite(found) || found > SCHEMA_VERSION) {
|
|
325
|
+
throw new UnreadableArtifactStoreError(file, 'newer-schema', `it was written with schema version ${String(stored.value)} and this runtime reads ` +
|
|
326
|
+
`version ${SCHEMA_VERSION}.`);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
function describe(err) {
|
|
330
|
+
return err instanceof Error ? err.message : String(err);
|
|
331
|
+
}
|
|
332
|
+
function decodeCursor(cursor) {
|
|
333
|
+
if (cursor === undefined)
|
|
334
|
+
return 0;
|
|
335
|
+
const parsed = Number(cursor);
|
|
336
|
+
return Number.isFinite(parsed) && parsed >= 0 ? Math.floor(parsed) : 0;
|
|
337
|
+
}
|
|
338
|
+
//# sourceMappingURL=sqliteArtifacts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqliteArtifacts.js","sourceRoot":"","sources":["../../src/artifacts/sqliteArtifacts.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;AAEH,0DAAoD;AACpD,sEAAqE;AACrE,0DAAgE;AAChE,6CAA+C;AAC/C,2CAA4C;AAC5C,6CAKsB;AACtB,iDAKwB;AACxB,yCAWoB;AAsDpB;;;;GAIG;AACH,MAAa,4BAA6B,SAAQ,KAAK;IAC5C,IAAI,GAAG,+BAAwC,CAAC;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CAAC;QACtD,MAAM,IAAI,4BAA4B,CACpC,IAAI,EACJ,cAAc,EACd,sCAAsC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,0BAA0B;YAClF,WAAW,cAAc,GAAG,CAC/B,CAAC;IACJ,CAAC;AACH,CAAC;AAED,SAAS,QAAQ,CAAC,GAAY;IAC5B,OAAO,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAC1D,CAAC;AAED,SAAS,YAAY,CAAC,MAA0B;IAC9C,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,CAAC,CAAC;IACnC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IAC9B,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACzE,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* artifacts/types — the claim-check shapes and the five-verb port.
|
|
4
|
+
*
|
|
5
|
+
* A tool stores its result under a REFERENCE and hands the model a claim
|
|
6
|
+
* ticket; the model routes tickets instead of hauling data. These are the
|
|
7
|
+
* shapes that make that sentence true: the ref (an opaque minted string),
|
|
8
|
+
* the metadata a consumer decides from (never the bytes), and the store
|
|
9
|
+
* port every backend implements.
|
|
10
|
+
*
|
|
11
|
+
* ── The constitution this port inherits (from `MemoryStore`) ────────────────
|
|
12
|
+
* 1. **Scope is always the first argument.** Every call takes an
|
|
13
|
+
* {@link ArtifactScope} — the same tenant/principal/conversation tuple
|
|
14
|
+
* memory scopes on — so stores enforce isolation at the boundary. A ref
|
|
15
|
+
* alone opens NOTHING; a wrong scope surfaces as "no data", never as a
|
|
16
|
+
* cross-tenant read.
|
|
17
|
+
* 2. **`get` returns `null` for missing OR expired.** Deliberate ambiguity:
|
|
18
|
+
* "no data" is the only actionable fact, and distinguishing the two would
|
|
19
|
+
* let a caller reason about another scope's contents.
|
|
20
|
+
* 3. **Reads return cursors, not unbounded arrays.** `list` pages.
|
|
21
|
+
* 4. **Methods return Promises uniformly**, so sync adapters can become
|
|
22
|
+
* async ones without breaking a caller.
|
|
23
|
+
*
|
|
24
|
+
* ── Five verbs, no more ─────────────────────────────────────────────────────
|
|
25
|
+
* `put · head · get · delete · list`. The moment this port grows `query()` or
|
|
26
|
+
* `transform()` we are building a database — compute belongs to the code leg,
|
|
27
|
+
* and that refusal is written here so a future round can be refused by
|
|
28
|
+
* citation. No streaming members either: an in-memory adapter must never fake
|
|
29
|
+
* a stream (streaming is a later, feature-detected addition — not Phase 1).
|
|
30
|
+
*
|
|
31
|
+
* `head` earns its place because it IS the render-by-ref decision: a consumer
|
|
32
|
+
* picks what to do from `kind` and `bytes` without paying for the payload.
|
|
33
|
+
*/
|
|
34
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
exports.InvalidArtifactError = exports.ArtifactIntegrityError = exports.UnknownParentRefError = void 0;
|
|
36
|
+
// ─── Refusals ────────────────────────────────────────────────────────
|
|
37
|
+
/**
|
|
38
|
+
* A `put` named a parent that does not resolve in the same scope — a foreign
|
|
39
|
+
* key that would dangle at birth. Refused at mint, because a derivation fact
|
|
40
|
+
* that points at nothing is worse than no fact: every later consumer would
|
|
41
|
+
* inherit the lie.
|
|
42
|
+
*/
|
|
43
|
+
class UnknownParentRefError extends Error {
|
|
44
|
+
code = 'ERR_UNKNOWN_PARENT_REF';
|
|
45
|
+
/** The parents that failed to resolve. */
|
|
46
|
+
unresolved;
|
|
47
|
+
constructor(unresolved) {
|
|
48
|
+
super(`[artifacts] put refused: parentRefs ${unresolved.map((r) => `'${r}'`).join(', ')} ` +
|
|
49
|
+
`do not resolve in this scope. parentRefs are derivation FACTS validated at mint — ` +
|
|
50
|
+
`a parent must exist (and not be expired) in the same scope when the child is born. ` +
|
|
51
|
+
`Store the parent first, or drop it from parentRefs; head(ref) tells you what resolves.`);
|
|
52
|
+
this.name = 'UnknownParentRefError';
|
|
53
|
+
this.unresolved = unresolved;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.UnknownParentRefError = UnknownParentRefError;
|
|
57
|
+
/**
|
|
58
|
+
* A stored payload no longer matches the digest minted with it. Thrown by
|
|
59
|
+
* `get` instead of returning the bytes — corrupt data delivered as whole data
|
|
60
|
+
* is the accepted-and-silently-wrong failure, and the one thing a claim check
|
|
61
|
+
* must never do is honor a ticket with someone else's parcel.
|
|
62
|
+
*/
|
|
63
|
+
class ArtifactIntegrityError extends Error {
|
|
64
|
+
code = 'ERR_ARTIFACT_INTEGRITY';
|
|
65
|
+
ref;
|
|
66
|
+
/** The digest minted at put. */
|
|
67
|
+
expected;
|
|
68
|
+
/** The digest of what the store actually holds now. */
|
|
69
|
+
actual;
|
|
70
|
+
constructor(ref, expected, actual) {
|
|
71
|
+
super(`[artifacts] get('${ref}') refused: the stored payload no longer matches its minted ` +
|
|
72
|
+
`digest (expected ${expected}, computed ${actual}). The bytes changed after put — ` +
|
|
73
|
+
`a corrupted file, an external edit, or a store bug — and returning them as if whole ` +
|
|
74
|
+
`would be silent corruption. Re-create the artifact from its source; the meta ` +
|
|
75
|
+
`(head) is still readable.`);
|
|
76
|
+
this.name = 'ArtifactIntegrityError';
|
|
77
|
+
this.ref = ref;
|
|
78
|
+
this.expected = expected;
|
|
79
|
+
this.actual = actual;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.ArtifactIntegrityError = ArtifactIntegrityError;
|
|
83
|
+
/**
|
|
84
|
+
* A `put` this store cannot honor as stated — a payload JSON cannot carry, a
|
|
85
|
+
* blank `kind`, a payload larger than the whole scope budget. Refused by name
|
|
86
|
+
* at the door: storing an approximation would be accepted-and-silently-wrong.
|
|
87
|
+
*/
|
|
88
|
+
class InvalidArtifactError extends Error {
|
|
89
|
+
code = 'ERR_INVALID_ARTIFACT';
|
|
90
|
+
constructor(detail) {
|
|
91
|
+
super(`[artifacts] put refused: ${detail}`);
|
|
92
|
+
this.name = 'InvalidArtifactError';
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
exports.InvalidArtifactError = InvalidArtifactError;
|
|
96
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/artifacts/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;;;AA2KH,wEAAwE;AAExE;;;;;GAKG;AACH,MAAa,qBAAsB,SAAQ,KAAK;IACrC,IAAI,GAAG,wBAAiC,CAAC;IAClD,0CAA0C;IACjC,UAAU,CAAyB;IAE5C,YAAY,UAAkC;QAC5C,KAAK,CACH,uCAAuC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;YAClF,oFAAoF;YACpF,qFAAqF;YACrF,wFAAwF,CAC3F,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;QACpC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;CACF;AAfD,sDAeC;AAED;;;;;GAKG;AACH,MAAa,sBAAuB,SAAQ,KAAK;IACtC,IAAI,GAAG,wBAAiC,CAAC;IACzC,GAAG,CAAc;IAC1B,gCAAgC;IACvB,QAAQ,CAAS;IAC1B,uDAAuD;IAC9C,MAAM,CAAS;IAExB,YAAY,GAAgB,EAAE,QAAgB,EAAE,MAAc;QAC5D,KAAK,CACH,oBAAoB,GAAG,8DAA8D;YACnF,oBAAoB,QAAQ,cAAc,MAAM,mCAAmC;YACnF,sFAAsF;YACtF,+EAA+E;YAC/E,2BAA2B,CAC9B,CAAC;QACF,IAAI,CAAC,IAAI,G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