@0gfoundation/0g-agentdna 0.4.0 → 0.5.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/GUIDE.md +190 -40
- package/OPERATORS.md +164 -0
- package/OPERATORS.zh.md +141 -0
- package/PROVIDERS.md +6 -0
- package/PROVIDERS.zh.md +3 -1
- package/README.md +84 -11
- package/dist/AgentClient.d.ts +374 -26
- package/dist/AgentClient.d.ts.map +1 -1
- package/dist/AgentClient.js +323 -40
- package/dist/AgentClient.js.map +1 -1
- package/dist/AgenticID.d.ts +170 -80
- package/dist/AgenticID.d.ts.map +1 -1
- package/dist/AgenticID.js +300 -42
- package/dist/AgenticID.js.map +1 -1
- package/dist/AttestorClient.d.ts +115 -31
- package/dist/AttestorClient.d.ts.map +1 -1
- package/dist/AttestorClient.js +276 -56
- package/dist/AttestorClient.js.map +1 -1
- package/dist/Credentials.d.ts +574 -0
- package/dist/Credentials.d.ts.map +1 -0
- package/dist/Credentials.js +838 -0
- package/dist/Credentials.js.map +1 -0
- package/dist/Operators.d.ts +60 -0
- package/dist/Operators.d.ts.map +1 -0
- package/dist/Operators.js +38 -0
- package/dist/Operators.js.map +1 -0
- package/dist/Providers.d.ts +13 -0
- package/dist/Providers.d.ts.map +1 -1
- package/dist/Providers.js +20 -1
- package/dist/Providers.js.map +1 -1
- package/dist/Releases.d.ts +51 -0
- package/dist/Releases.d.ts.map +1 -0
- package/dist/Releases.js +72 -0
- package/dist/Releases.js.map +1 -0
- package/dist/ReputationClient.d.ts +47 -3
- package/dist/ReputationClient.d.ts.map +1 -1
- package/dist/ReputationClient.js +204 -78
- package/dist/ReputationClient.js.map +1 -1
- package/dist/ServeProof.d.ts +70 -23
- package/dist/ServeProof.d.ts.map +1 -1
- package/dist/ServeProof.js +94 -35
- package/dist/ServeProof.js.map +1 -1
- package/dist/ServeSession.d.ts +17 -2
- package/dist/ServeSession.d.ts.map +1 -1
- package/dist/ServeSession.js +77 -9
- package/dist/ServeSession.js.map +1 -1
- package/dist/Settings.d.ts +25 -1
- package/dist/Settings.d.ts.map +1 -1
- package/dist/Settings.js +53 -1
- package/dist/Settings.js.map +1 -1
- package/dist/TrustRegistry.d.ts +28 -0
- package/dist/TrustRegistry.d.ts.map +1 -0
- package/dist/TrustRegistry.js +67 -0
- package/dist/TrustRegistry.js.map +1 -0
- package/dist/abi.d.ts +346 -34
- package/dist/abi.d.ts.map +1 -1
- package/dist/abi.js +150 -30
- package/dist/abi.js.map +1 -1
- package/dist/cli/attach.d.ts +79 -0
- package/dist/cli/attach.d.ts.map +1 -0
- package/dist/cli/attach.js +253 -0
- package/dist/cli/attach.js.map +1 -0
- package/dist/cli/commands/cells.d.ts +45 -0
- package/dist/cli/commands/cells.d.ts.map +1 -1
- package/dist/cli/commands/cells.js +77 -0
- package/dist/cli/commands/cells.js.map +1 -1
- package/dist/cli/commands/cred.d.ts +12 -0
- package/dist/cli/commands/cred.d.ts.map +1 -0
- package/dist/cli/commands/cred.js +43 -0
- package/dist/cli/commands/cred.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -1
- package/dist/cli/commands/doctor.js +44 -35
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/interactive.d.ts +597 -21
- package/dist/cli/commands/interactive.d.ts.map +1 -1
- package/dist/cli/commands/interactive.js +5082 -1323
- package/dist/cli/commands/interactive.js.map +1 -1
- package/dist/cli/commands/list.d.ts +5 -5
- package/dist/cli/commands/list.d.ts.map +1 -1
- package/dist/cli/commands/list.js +21 -26
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/providers.d.ts +4 -0
- package/dist/cli/commands/providers.d.ts.map +1 -1
- package/dist/cli/commands/providers.js +19 -5
- package/dist/cli/commands/providers.js.map +1 -1
- package/dist/cli/commands/releases.d.ts +13 -0
- package/dist/cli/commands/releases.d.ts.map +1 -0
- package/dist/cli/commands/releases.js +65 -0
- package/dist/cli/commands/releases.js.map +1 -0
- package/dist/cli/commands/settings.d.ts +5 -0
- package/dist/cli/commands/settings.d.ts.map +1 -1
- package/dist/cli/commands/settings.js +70 -24
- package/dist/cli/commands/settings.js.map +1 -1
- package/dist/cli/commands/status.d.ts +2 -1
- package/dist/cli/commands/status.d.ts.map +1 -1
- package/dist/cli/commands/status.js +22 -19
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/config.d.ts +48 -1
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +114 -5
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/credentials.d.ts +179 -0
- package/dist/cli/credentials.d.ts.map +1 -0
- package/dist/cli/credentials.js +1443 -0
- package/dist/cli/credentials.js.map +1 -0
- package/dist/cli/download.d.ts +21 -0
- package/dist/cli/download.d.ts.map +1 -0
- package/dist/cli/download.js +89 -0
- package/dist/cli/download.js.map +1 -0
- package/dist/cli/env.d.ts +6 -0
- package/dist/cli/env.d.ts.map +1 -1
- package/dist/cli/env.js +18 -6
- package/dist/cli/env.js.map +1 -1
- package/dist/cli/envelope.d.ts +4 -2
- package/dist/cli/envelope.d.ts.map +1 -1
- package/dist/cli/envelope.js +10 -6
- package/dist/cli/envelope.js.map +1 -1
- package/dist/cli/errors.d.ts +45 -1
- package/dist/cli/errors.d.ts.map +1 -1
- package/dist/cli/errors.js +77 -0
- package/dist/cli/errors.js.map +1 -1
- package/dist/cli/inference.d.ts.map +1 -1
- package/dist/cli/inference.js +7 -0
- package/dist/cli/inference.js.map +1 -1
- package/dist/cli/inkView.d.ts +341 -0
- package/dist/cli/inkView.d.ts.map +1 -0
- package/dist/cli/inkView.js +1019 -0
- package/dist/cli/inkView.js.map +1 -0
- package/dist/cli/legacy/modelKey.d.ts +24 -0
- package/dist/cli/legacy/modelKey.d.ts.map +1 -0
- package/dist/cli/legacy/modelKey.js +32 -0
- package/dist/cli/legacy/modelKey.js.map +1 -0
- package/dist/cli/livePrompt.d.ts +212 -0
- package/dist/cli/livePrompt.d.ts.map +1 -0
- package/dist/cli/livePrompt.js +576 -0
- package/dist/cli/livePrompt.js.map +1 -0
- package/dist/cli/main.js +206 -72
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/modelkey.d.ts +64 -0
- package/dist/cli/modelkey.d.ts.map +1 -0
- package/dist/cli/modelkey.js +113 -0
- package/dist/cli/modelkey.js.map +1 -0
- package/dist/cli/outboxSync.d.ts +51 -0
- package/dist/cli/outboxSync.d.ts.map +1 -0
- package/dist/cli/outboxSync.js +210 -0
- package/dist/cli/outboxSync.js.map +1 -0
- package/dist/cli/plain.d.ts +46 -0
- package/dist/cli/plain.d.ts.map +1 -0
- package/dist/cli/plain.js +260 -0
- package/dist/cli/plain.js.map +1 -0
- package/dist/cli/proofs.d.ts +5 -0
- package/dist/cli/proofs.d.ts.map +1 -1
- package/dist/cli/proofs.js +20 -0
- package/dist/cli/proofs.js.map +1 -1
- package/dist/cli/ref.d.ts.map +1 -1
- package/dist/cli/ref.js +3 -2
- package/dist/cli/ref.js.map +1 -1
- package/dist/cli/releaseNotice.d.ts +64 -0
- package/dist/cli/releaseNotice.d.ts.map +1 -0
- package/dist/cli/releaseNotice.js +194 -0
- package/dist/cli/releaseNotice.js.map +1 -0
- package/dist/cli/sdk.d.ts +18 -0
- package/dist/cli/sdk.d.ts.map +1 -1
- package/dist/cli/sdk.js +99 -1
- package/dist/cli/sdk.js.map +1 -1
- package/dist/cli/settings.d.ts +87 -6
- package/dist/cli/settings.d.ts.map +1 -1
- package/dist/cli/settings.js +270 -18
- package/dist/cli/settings.js.map +1 -1
- package/dist/cli/textfit.d.ts +28 -0
- package/dist/cli/textfit.d.ts.map +1 -0
- package/dist/cli/textfit.js +111 -0
- package/dist/cli/textfit.js.map +1 -0
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/context.d.ts +26 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +1 -0
- package/dist/context.js.map +1 -1
- package/dist/index.d.ts +19 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +35 -2
- package/dist/index.js.map +1 -1
- package/dist/legacy/modelKey.d.ts +67 -0
- package/dist/legacy/modelKey.d.ts.map +1 -0
- package/dist/legacy/modelKey.js +80 -0
- package/dist/legacy/modelKey.js.map +1 -0
- package/dist/legacy/serveProofV1.d.ts +56 -0
- package/dist/legacy/serveProofV1.d.ts.map +1 -0
- package/dist/legacy/serveProofV1.js +91 -0
- package/dist/legacy/serveProofV1.js.map +1 -0
- package/dist/provider-catalog.json +3 -2
- package/dist/secretEnv.d.ts +18 -3
- package/dist/secretEnv.d.ts.map +1 -1
- package/dist/secretEnv.js +16 -2
- package/dist/secretEnv.js.map +1 -1
- package/dist/types.d.ts +63 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/viemErrors.d.ts +30 -0
- package/dist/viemErrors.d.ts.map +1 -0
- package/dist/viemErrors.js +36 -0
- package/dist/viemErrors.js.map +1 -0
- package/package.json +5 -1
- package/src/AgentClient.ts +622 -68
- package/src/AgenticID.ts +345 -56
- package/src/AttestorClient.ts +330 -83
- package/src/Credentials.ts +1027 -0
- package/src/Operators.ts +71 -0
- package/src/Providers.ts +20 -0
- package/src/Releases.ts +95 -0
- package/src/ReputationClient.ts +231 -79
- package/src/ServeProof.ts +123 -39
- package/src/ServeSession.ts +91 -9
- package/src/Settings.ts +61 -1
- package/src/TrustRegistry.ts +75 -0
- package/src/abi.ts +153 -30
- package/src/cli/attach.ts +257 -0
- package/src/cli/commands/cells.ts +104 -0
- package/src/cli/commands/cred.ts +44 -0
- package/src/cli/commands/doctor.ts +45 -37
- package/src/cli/commands/interactive.ts +4120 -664
- package/src/cli/commands/list.ts +21 -30
- package/src/cli/commands/providers.ts +17 -4
- package/src/cli/commands/releases.ts +60 -0
- package/src/cli/commands/settings.ts +75 -28
- package/src/cli/commands/status.ts +24 -21
- package/src/cli/config.ts +119 -4
- package/src/cli/credentials.ts +1379 -0
- package/src/cli/download.ts +80 -0
- package/src/cli/env.ts +22 -7
- package/src/cli/envelope.ts +10 -6
- package/src/cli/errors.ts +92 -0
- package/src/cli/inference.ts +8 -1
- package/src/cli/inkView.ts +969 -0
- package/src/cli/legacy/modelKey.ts +35 -0
- package/src/cli/livePrompt.ts +615 -0
- package/src/cli/main.ts +206 -76
- package/src/cli/modelkey.ts +124 -0
- package/src/cli/outboxSync.ts +231 -0
- package/src/cli/plain.ts +260 -0
- package/src/cli/proofs.ts +27 -0
- package/src/cli/ref.ts +5 -4
- package/src/cli/releaseNotice.ts +200 -0
- package/src/cli/sdk.ts +87 -7
- package/src/cli/settings.ts +272 -22
- package/src/cli/textfit.ts +95 -0
- package/src/constants.ts +1 -1
- package/src/context.ts +28 -0
- package/src/index.ts +50 -7
- package/src/legacy/modelKey.ts +80 -0
- package/src/legacy/serveProofV1.ts +124 -0
- package/src/provider-catalog.json +3 -2
- package/src/secretEnv.ts +18 -3
- package/src/types.ts +60 -1
- package/src/viemErrors.ts +39 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @file textfit.ts
|
|
4
|
+
* @description Text that fits the owner's terminal: the width to use, the
|
|
5
|
+
* shell's two-column help reflowed for narrow terminals, whole lines wrapped
|
|
6
|
+
* (with livePrompt.ts's wrapProse, the CLI's one word wrap), and the nearest
|
|
7
|
+
* known word for a typo.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.termWidth = termWidth;
|
|
11
|
+
exports.fitHelp = fitHelp;
|
|
12
|
+
exports.didYouMean = didYouMean;
|
|
13
|
+
exports.fitLines = fitLines;
|
|
14
|
+
const livePrompt_1 = require("./livePrompt");
|
|
15
|
+
/** The columns text may use on `stream` when it is a terminal: its width
|
|
16
|
+
* less the last column (a character there leaves the cursor pending a wrap
|
|
17
|
+
* some terminals then take); undefined when it is piped. */
|
|
18
|
+
function termWidth(stream = process.stdout) {
|
|
19
|
+
return stream.isTTY && stream.columns ? Math.max(20, stream.columns - 1) : undefined;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The shell's help text, fitted to `width`. The text is written for 80
|
|
23
|
+
* columns in two columns (a command, then its description from column
|
|
24
|
+
* `col`); on a narrower terminal each description is re-wrapped under its
|
|
25
|
+
* command, and below 60 columns it goes on the lines below the command.
|
|
26
|
+
*/
|
|
27
|
+
function fitHelp(text, width, col = 26) {
|
|
28
|
+
const lines = text.split('\n');
|
|
29
|
+
if (!width || lines.every((l) => [...l].length <= width))
|
|
30
|
+
return text;
|
|
31
|
+
const entries = [];
|
|
32
|
+
const pad = ' '.repeat(col);
|
|
33
|
+
for (const l of lines) {
|
|
34
|
+
if (l.startsWith(pad) && entries.length && entries[entries.length - 1].cmd !== undefined) {
|
|
35
|
+
entries[entries.length - 1].desc += ` ${l.trim()}`;
|
|
36
|
+
}
|
|
37
|
+
else if (/^ {2}\S/.test(l)) {
|
|
38
|
+
const cmd = l.slice(2, col).trimEnd();
|
|
39
|
+
// A command wider than its column puts its description on the next line.
|
|
40
|
+
entries.push(l.length > col && l[col - 1] === ' ' ? { cmd, desc: l.slice(col).trim() } : { cmd: l.trim(), desc: '' });
|
|
41
|
+
}
|
|
42
|
+
else if (l.trim() && entries.length && entries[entries.length - 1].cmd === undefined && entries[entries.length - 1].desc.trim()) {
|
|
43
|
+
entries[entries.length - 1].desc += ` ${l.trim()}`;
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
entries.push({ desc: l });
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const out = [];
|
|
50
|
+
const twoCol = width >= 60;
|
|
51
|
+
for (const e of entries) {
|
|
52
|
+
if (e.cmd === undefined) {
|
|
53
|
+
out.push(...(0, livePrompt_1.wrapProse)(e.desc, width));
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
if (!e.desc) {
|
|
57
|
+
out.push(` ${e.cmd}`);
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
if (twoCol && e.cmd.length <= col - 3) {
|
|
61
|
+
const cmd = e.cmd;
|
|
62
|
+
(0, livePrompt_1.wrapProse)(e.desc.trim(), width - col).forEach((r, i) => out.push(`${i ? pad : ` ${cmd.padEnd(col - 2)}`}${r}`));
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
out.push(` ${e.cmd}`);
|
|
66
|
+
const under = twoCol ? pad : ' ';
|
|
67
|
+
(0, livePrompt_1.wrapProse)(e.desc.trim(), width - under.length).forEach((r) => out.push(`${under}${r}`));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return out.join('\n');
|
|
71
|
+
}
|
|
72
|
+
/** Damerau–Levenshtein distance (adjacent swaps cost 1: `lsit` → `list`). */
|
|
73
|
+
function distance(a, b) {
|
|
74
|
+
const d = Array.from({ length: a.length + 1 }, (_, i) => [i, ...Array(b.length).fill(0)]);
|
|
75
|
+
for (let j = 1; j <= b.length; j++)
|
|
76
|
+
d[0][j] = j;
|
|
77
|
+
for (let i = 1; i <= a.length; i++) {
|
|
78
|
+
for (let j = 1; j <= b.length; j++) {
|
|
79
|
+
const cost = a[i - 1] === b[j - 1] ? 0 : 1;
|
|
80
|
+
d[i][j] = Math.min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + cost);
|
|
81
|
+
if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1])
|
|
82
|
+
d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + 1);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return d[a.length][b.length];
|
|
86
|
+
}
|
|
87
|
+
/** The known word `typed` is most likely a typo of, or undefined when none is close. */
|
|
88
|
+
function didYouMean(typed, words) {
|
|
89
|
+
const t = typed.toLowerCase();
|
|
90
|
+
let best;
|
|
91
|
+
let bestD = Infinity;
|
|
92
|
+
for (const w of words) {
|
|
93
|
+
const dist = distance(t, w);
|
|
94
|
+
if (dist < bestD) {
|
|
95
|
+
best = w;
|
|
96
|
+
bestD = dist;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
// Close means at most 2 edits, and fewer than half the word's letters.
|
|
100
|
+
return best !== undefined && bestD <= 2 && bestD * 2 < Math.max(t.length, best.length) ? best : undefined;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Text of whole lines fitted to `width` (undefined: as it is), between words:
|
|
104
|
+
* the shell's word wrap (livePrompt.ts wrapText — later rows under the text,
|
|
105
|
+
* a label's value or an `error:`/`fix:` text; long tokens whole; CJK between
|
|
106
|
+
* characters), for the one-shot commands' lines on a terminal.
|
|
107
|
+
*/
|
|
108
|
+
function fitLines(text, width) {
|
|
109
|
+
return width ? (0, livePrompt_1.wrapText)(text, width) : text;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=textfit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textfit.js","sourceRoot":"","sources":["../../src/cli/textfit.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAOH,8BAEC;AAQD,0BAkCC;AAiBD,gCAUC;AAQD,4BAEC;AAtFD,6CAAmD;AAEnD;;6DAE6D;AAC7D,SAAgB,SAAS,CAAC,SAA6B,OAAO,CAAC,MAAM;IACnE,OAAO,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACvF,CAAC;AAED;;;;;GAKG;AACH,SAAgB,OAAO,CAAC,IAAY,EAAE,KAAyB,EAAE,GAAG,GAAG,EAAE;IACvE,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC/B,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC;QAAE,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;YAAC,KAAK,GAAG,IAAI,CAAC;QAAC,CAAC;IAC/C,CAAC;IACD,uEAAuE;IACvE,OAAO,IAAI,KAAK,SAAS,IAAI,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AAC5G,CAAC;AAED;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,IAAY,EAAE,KAAyB;IAC9D,OAAO,KAAK,CAAC,CAAC,CAAC,IAAA,qBAAQ,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC9C,CAAC"}
|
package/dist/constants.d.ts
CHANGED
|
@@ -103,5 +103,5 @@ export declare const RECEIPT_WAIT: {
|
|
|
103
103
|
};
|
|
104
104
|
/** This SDK's own version. Kept in lockstep with package.json by a test —
|
|
105
105
|
* a runtime package.json read would break browser bundles, so a constant. */
|
|
106
|
-
export declare const SDK_VERSION = "0.
|
|
106
|
+
export declare const SDK_VERSION = "0.5.0";
|
|
107
107
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.js
CHANGED
|
@@ -70,5 +70,5 @@ exports.RECEIPT_WAIT = {
|
|
|
70
70
|
};
|
|
71
71
|
/** This SDK's own version. Kept in lockstep with package.json by a test —
|
|
72
72
|
* a runtime package.json read would break browser bundles, so a constant. */
|
|
73
|
-
exports.SDK_VERSION = '0.
|
|
73
|
+
exports.SDK_VERSION = '0.5.0';
|
|
74
74
|
//# sourceMappingURL=constants.js.map
|
package/dist/context.d.ts
CHANGED
|
@@ -5,6 +5,12 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { type Account, type Chain, type PublicClient, type WalletClient } from 'viem';
|
|
7
7
|
import { type ContractAddresses } from './constants';
|
|
8
|
+
/** A stored credential set's place in order, and its EIP-712 digest. */
|
|
9
|
+
export interface CredentialMarkRecord {
|
|
10
|
+
epoch: number;
|
|
11
|
+
version: number;
|
|
12
|
+
digest?: string;
|
|
13
|
+
}
|
|
8
14
|
/** Public config for `new AgentDNA(config)` (exported as `AgentDNAConfig`). */
|
|
9
15
|
export interface AgenticIDConfig {
|
|
10
16
|
/** RPC endpoint. Defaults to the 0G Galileo testnet RPC. */
|
|
@@ -32,6 +38,9 @@ export interface AgenticIDConfig {
|
|
|
32
38
|
*/
|
|
33
39
|
componentAppIds?: string[];
|
|
34
40
|
/**
|
|
41
|
+
* LEGACY(model-key): only the request copy of a model key is sealed with
|
|
42
|
+
* the secret-env scheme.
|
|
43
|
+
*
|
|
35
44
|
* Sticky memory for the secret-env scheme (issue #166): once an attestor
|
|
36
45
|
* has advertised `secret_env_scheme`, its later absence is treated as
|
|
37
46
|
* tampering and refused (`scheme_withdrawn`) rather than silently falling
|
|
@@ -44,6 +53,21 @@ export interface AgenticIDConfig {
|
|
|
44
53
|
seen(attestorUrl: string): boolean | Promise<boolean>;
|
|
45
54
|
record(attestorUrl: string): void | Promise<void>;
|
|
46
55
|
};
|
|
56
|
+
/**
|
|
57
|
+
* Memory of the newest credential set (ownership epoch, version) this
|
|
58
|
+
* client has seen for each agent, so an older one the attestor serves
|
|
59
|
+
* again is refused instead of signed anew. Every client remembers within
|
|
60
|
+
* its own lifetime; supply this store to remember across processes (the
|
|
61
|
+
* CLI backs it with a file). Keys are opaque strings; `record` is called
|
|
62
|
+
* with a newer mark than `seen` answered, and should keep the newer of it
|
|
63
|
+
* and what it holds. `where` names the store in the error that refuses an
|
|
64
|
+
* older set, for an owner whose attestor's data was reset on purpose.
|
|
65
|
+
*/
|
|
66
|
+
credentialMarks?: {
|
|
67
|
+
seen(key: string): CredentialMarkRecord | undefined | Promise<CredentialMarkRecord | undefined>;
|
|
68
|
+
record(key: string, mark: CredentialMarkRecord): void | Promise<void>;
|
|
69
|
+
where?: string;
|
|
70
|
+
};
|
|
47
71
|
}
|
|
48
72
|
/** The slice of the attestor's GET /config the SDK auto-configures from. */
|
|
49
73
|
export interface AttestorPublicConfig {
|
|
@@ -98,6 +122,8 @@ export interface Ctx {
|
|
|
98
122
|
seen(attestorUrl: string): boolean | Promise<boolean>;
|
|
99
123
|
record(attestorUrl: string): void | Promise<void>;
|
|
100
124
|
};
|
|
125
|
+
/** See {@link AgenticIDConfig.credentialMarks}. */
|
|
126
|
+
credentialMarks?: AgenticIDConfig['credentialMarks'];
|
|
101
127
|
}
|
|
102
128
|
export declare function buildCtx(config: AgenticIDConfig): Ctx;
|
|
103
129
|
/** Guard used by write methods. */
|
package/dist/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,YAAY,EACjB,KAAK,YAAY,EAClB,MAAM,MAAM,CAAC;AAEd,OAAO,EAA2B,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAE9E,+EAA+E;AAC/E,MAAM,WAAW,eAAe;IAC9B,4DAA4D;IAC5D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0DAA0D;IAC1D,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,8FAA8F;IAC9F,SAAS,EAAE,iBAAiB,CAAC;IAC7B,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,KAAK,MAAM,EAAE,CAAC;IAClC;;;OAGG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,KAAK,EAC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C,oBAAoB,GAAG,IAAI,CAAC,CAAC;IAC3D,gDAAgD;IAChD,YAAY,CAAC,EAAE;QACb,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;QACtD,MAAM,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;KACnD,CAAC;IACF,mDAAmD;IACnD,eAAe,CAAC,EAAE,eAAe,CAAC,iBAAiB,CAAC,CAAC;CACtD;AAID,wBAAgB,QAAQ,CAAC,MAAM,EAAE,eAAe,GAAG,GAAG,CA4CrD;AAED,mCAAmC;AACnC,wBAAgB,aAAa,CAAC,GAAG,EAAE,GAAG,GAAG;IAAE,YAAY,EAAE,YAAY,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAKxF"}
|
package/dist/context.js
CHANGED
|
@@ -51,6 +51,7 @@ function buildCtx(config) {
|
|
|
51
51
|
componentAppIdsExplicit: config.componentAppIds !== undefined,
|
|
52
52
|
attestorConfig,
|
|
53
53
|
secretEnvPin: config.secretEnvPin,
|
|
54
|
+
credentialMarks: config.credentialMarks,
|
|
54
55
|
publicClient: (0, viem_1.createPublicClient)({ chain, transport: (0, viem_1.http)(rpcUrl) }),
|
|
55
56
|
};
|
|
56
57
|
}
|
package/dist/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAoIH,4BA4CC;AAGD,sCAKC;AAtLD,+BAQc;AACd,4CAAoD;AACpD,2CAA8E;AAsH9E,MAAM,yBAAyB,GAAG,CAAC,aAAa,EAAE,QAAQ,EAAE,qBAAqB,CAAC,CAAC;AAEnF,SAAgB,QAAQ,CAAC,MAAuB;IAC9C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CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAE,CAAC,CAAC,IAAI,EAAoC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;aACxE,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,EAAC;QACrB,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;IAEF,OAAO;QACL,KAAK;QACL,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,YAAY;QACZ,OAAO;QACP,eAAe,EAAE,MAAM,CAAC,eAAe,IAAI,yBAAyB;QACpE,uBAAuB,EAAE,MAAM,CAAC,eAAe,KAAK,SAAS;QAC7D,cAAc;QACd,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,eAAe,EAAE,MAAM,CAAC,eAAe;QACvC,YAAY,EAAE,IAAA,yBAAkB,EAAC,EAAE,KAAK,EAAE,SAAS,EAAE,IAAA,WAAI,EAAC,MAAM,CAAC,EAAE,CAAC;KACrE,CAAC;AACJ,CAAC;AAED,mCAAmC;AACnC,SAAgB,aAAa,CAAC,GAAQ;IACpC,IAAI,CAAC,GAAG,CAAC,YAAY,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;IAChF,CAAC;IACD,OAAO,EAAE,YAAY,EAAE,GAAG,CAAC,YAAY,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;AAClE,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -14,33 +14,41 @@
|
|
|
14
14
|
* ```
|
|
15
15
|
*/
|
|
16
16
|
export { AgenticID as AgentDNA, AgenticID, AgentApi, AdminApi, ReputationApi } from './AgenticID';
|
|
17
|
-
export type { ContainerStatus, DeployAccepted, WaitLevel } from './AgenticID';
|
|
17
|
+
export type { ContainerStatus, DeployAccepted, WaitLevel, ModelKeyLifecycleOpts } from './AgenticID';
|
|
18
|
+
export { fetchReleases, releaseNoticeOf, agentMigrationOf } from './Releases';
|
|
19
|
+
export type { ReleaseNotice, ReleaseMigration, AgentMigration, MigrationState } from './Releases';
|
|
18
20
|
export { makeAgentClient } from './AgentClient';
|
|
19
|
-
export type { AgentClient, AgentServiceEntry, AgentRoute, ChatMessage, ChatCompletion, AgentTask, AgentTaskInfo, AgentTaskStop, AgentInbox, AgentInboxMessage, AgentSchedule, AgentEvent, } from './AgentClient';
|
|
20
|
-
export { mcpServices } from './AgentClient';
|
|
21
|
+
export type { AgentClient, AgentServiceEntry, AgentRoute, ChatMessage, ChatCompletion, AgentTask, AgentActivityInfo, AgentActivityStop, AgentTaskInfo, AgentTaskStop, AgentInbox, AgentInboxMessage, AgentSchedule, AgentEvent, ChatImage, ChatNotice, UploadedFile, SteerResult, AgentSession, SessionPromptResult, HarnessTask, HarnessTaskState, HarnessTaskRecord, HarnessTaskSummary, HarnessTaskFeedEvent, CreateTaskOptions, TaskInputResult, SteerState, AgentFile, AgentFileDir, } from './AgentClient';
|
|
22
|
+
export { mcpServices, withImages } from './AgentClient';
|
|
21
23
|
export { defaultIData, DEFAULT_PERSONA_INFERENCE, deploymentFactsOf, needsDefaultSettings, storeDefaultSettings } from './AttestorClient';
|
|
22
24
|
export type { DeploymentFacts } from './AttestorClient';
|
|
23
25
|
export type { DefaultIDataParams } from './AttestorClient';
|
|
24
|
-
export type { AgenticIDConfig as AgentDNAConfig, AgenticIDConfig } from './context';
|
|
26
|
+
export type { AgenticIDConfig as AgentDNAConfig, AgenticIDConfig, CredentialMarkRecord } from './context';
|
|
25
27
|
export { SandboxClient } from './SandboxClient';
|
|
26
28
|
export { AgenticIDClient } from './AgenticIDClient';
|
|
27
29
|
export type { IntelligentDataResult } from './AgenticIDClient';
|
|
28
30
|
export { ReputationClient, MAX_ABS_FEEDBACK_VALUE } from './ReputationClient';
|
|
29
31
|
export { AttestorClient, CLONE_DOMAIN, CLONE_CONTRACT_DOMAIN, DEPLOY_DOMAIN, b64encode } from './AttestorClient';
|
|
30
32
|
export type { CloneParams, DeployParams, IDataInput, DeployCloneResponse } from './AttestorClient';
|
|
33
|
+
export { OPERATOR_DOMAIN, OperatorConflictError, OperatorCheckpointSupersededError } from './Operators';
|
|
34
|
+
export type { OperatorState, OperatorOptions, OperatorCheckpoint, RuntimeBinding } from './Operators';
|
|
31
35
|
export { SECRET_ENV_SCHEME, SECRET_ENV_VAR, SecretEnvRefusedError, sealSecretEnv } from './secretEnv';
|
|
32
36
|
export type { SecretEnvMode, SecretEnvRefusalCode } from './secretEnv';
|
|
33
|
-
export { SETTINGS_DOMAIN, THINKING_LEVELS, SETTINGS_FIELDS, ZG_COMPUTE_PROVIDER, ROUTER_MODELS_URL, canonicalSettings, settingsAuthMessage, SettingsConflictError, sha256Hex, modelAdvisory, fetchRouterModelIds, } from './Settings';
|
|
34
|
-
export type { SettingsDoc, ThinkingLevel } from './Settings';
|
|
37
|
+
export { SETTINGS_DOMAIN, THINKING_LEVELS, SETTINGS_FIELDS, ZG_COMPUTE_PROVIDER, ROUTER_MODELS_URL, canonicalSettings, settingsAuthMessage, SettingsConflictError, sha256Hex, modelAdvisory, fetchRouterModelIds, versionPicksProblem, } from './Settings';
|
|
38
|
+
export type { SettingsDoc, ThinkingLevel, VersionPicks } from './Settings';
|
|
39
|
+
export { CredentialsApi, CredentialsConflictError, CredentialsUnverifiedError, credentialSetTypes, approvalTypes, definitionOf, inputOf, credentialPlaintext, modelKeyName, MODEL_KEY_PREFIX, CREDENTIALS_DOMAIN_NAME, CREDENTIALS_DOMAIN_VERSION, } from './Credentials';
|
|
40
|
+
export type { CredentialSigner, CredentialMCP, CredentialInput, CredentialDefinition, CredentialDocument, CredentialPosition, TokenRequestTemplate, PendingCredentialRequest, CredentialInference, ModelKeyInUse, ModelKeysView, LoadedCredentials, SealedModelKey, } from './Credentials';
|
|
35
41
|
export { ServeSession, SERVE_PROOF_HEADER, parseServeProofHeader, proofFromResponse, captureProof, taskRevealOf, proofRecordingFetch, } from './ServeSession';
|
|
36
42
|
export type { ServeSessionOptions, ProofVerification, TaskExchange } from './ServeSession';
|
|
37
|
-
export { buildServeProofMessageHash, buildServeProofSigningHash, buildServeProof, signServeProof, verifyServeProofSignature, } from './ServeProof';
|
|
38
|
-
export type { BuildServeProofHashParams, BuildServeProofSigningHashParams } from './ServeProof';
|
|
43
|
+
export { buildServeProofMessageHash, buildServeProofSigningHash, buildServeProof, signServeProof, verifyServeProofSignature, serveProofLayers, SERVE_PROOF_VERSION, SERVE_PROOF_V2_TAG, } from './ServeProof';
|
|
44
|
+
export type { BuildServeProofHashParams, BuildServeProofSigningHashParams, ServeProofLayers } from './ServeProof';
|
|
45
|
+
export { TRUST_KINDS, trustRegistryOf, isListed, listedHashes } from './TrustRegistry';
|
|
46
|
+
export type { TrustKind } from './TrustRegistry';
|
|
39
47
|
export { taskHashOf, requestUriOf, requestUriCandidates } from './taskHash';
|
|
40
|
-
export type { IntelligentData, ServeProof, Feedback, FeedbackSummary, ServeData, GiveFeedbackParams, GiveFeedbackResult, TaskReveal, AppendResponseParams, ReadAllFeedbackParams, GetSummaryParams, } from './types';
|
|
48
|
+
export type { IntelligentData, ServeProof, Feedback, FeedbackSummary, ServeData, ServeLayers, GiveFeedbackParams, GiveFeedbackResult, TaskReveal, AppendResponseParams, ReadAllFeedbackParams, GetSummaryParams, SignatureRecord, } from './types';
|
|
41
49
|
export { ZERO_G_TESTNET, ZERO_G_MAINNET, RPC_URL, CHAIN_ID, RECEIPT_WAIT, } from './constants';
|
|
42
50
|
export type { ContractAddresses } from './constants';
|
|
43
|
-
export { agenticIDAbi, cloneGateAbi, standardCloneAuthorizerAbi, canonicalReputationAbi, verifiedFeedbackAbi, feedbackBatcherAbi, tappRegistryAbi, sandboxServingAbi, } from './abi';
|
|
44
|
-
export { listInferenceProviders, inferenceProvider, routeHash } from './Providers';
|
|
51
|
+
export { agenticIDAbi, trustRegistryAbi, cloneGateAbi, standardCloneAuthorizerAbi, canonicalReputationAbi, verifiedFeedbackAbi, feedbackBatcherAbi, tappRegistryAbi, sandboxServingAbi, } from './abi';
|
|
52
|
+
export { listInferenceProviders, inferenceProvider, providerWebSearch, routeHash } from './Providers';
|
|
45
53
|
export type { InferenceProvider, InferenceFormat, InferenceModel, ProviderRegistrySnapshot, ProviderRegistryPin } from './Providers';
|
|
46
54
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAcH,OAAO,EAAE,SAAS,IAAI,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAClG,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,YAAY,EACV,WAAW,EAAE,iBAAiB,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,SAAS,EAClF,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,iBAAiB,EAAE,aAAa,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAcH,OAAO,EAAE,SAAS,IAAI,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAClG,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACrG,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9E,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,cAAc,EAAE,cAAc,EAAE,M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Module", { value: true });
|
|
18
|
-
exports.
|
|
19
|
-
exports.routeHash = exports.inferenceProvider = exports.listInferenceProviders = exports.sandboxServingAbi = exports.tappRegistryAbi = exports.feedbackBatcherAbi = exports.verifiedFeedbackAbi = exports.canonicalReputationAbi = exports.standardCloneAuthorizerAbi = exports.cloneGateAbi = exports.agenticIDAbi = exports.RECEIPT_WAIT = exports.CHAIN_ID = exports.RPC_URL = exports.ZERO_G_MAINNET = exports.ZERO_G_TESTNET = exports.requestUriCandidates = void 0;
|
|
18
|
+
exports.definitionOf = exports.approvalTypes = exports.credentialSetTypes = exports.CredentialsUnverifiedError = exports.CredentialsConflictError = exports.CredentialsApi = exports.versionPicksProblem = exports.fetchRouterModelIds = exports.modelAdvisory = exports.sha256Hex = exports.SettingsConflictError = exports.settingsAuthMessage = exports.canonicalSettings = exports.ROUTER_MODELS_URL = exports.ZG_COMPUTE_PROVIDER = exports.SETTINGS_FIELDS = exports.THINKING_LEVELS = exports.SETTINGS_DOMAIN = exports.sealSecretEnv = exports.SecretEnvRefusedError = exports.SECRET_ENV_VAR = exports.SECRET_ENV_SCHEME = exports.OperatorCheckpointSupersededError = exports.OperatorConflictError = exports.OPERATOR_DOMAIN = exports.b64encode = exports.DEPLOY_DOMAIN = exports.CLONE_CONTRACT_DOMAIN = exports.CLONE_DOMAIN = exports.AttestorClient = exports.MAX_ABS_FEEDBACK_VALUE = exports.ReputationClient = exports.AgenticIDClient = exports.SandboxClient = exports.storeDefaultSettings = exports.needsDefaultSettings = exports.deploymentFactsOf = exports.DEFAULT_PERSONA_INFERENCE = exports.defaultIData = exports.withImages = exports.mcpServices = exports.makeAgentClient = exports.agentMigrationOf = exports.releaseNoticeOf = exports.fetchReleases = exports.ReputationApi = exports.AdminApi = exports.AgentApi = exports.AgenticID = exports.AgentDNA = void 0;
|
|
19
|
+
exports.routeHash = exports.providerWebSearch = exports.inferenceProvider = exports.listInferenceProviders = exports.sandboxServingAbi = exports.tappRegistryAbi = exports.feedbackBatcherAbi = exports.verifiedFeedbackAbi = exports.canonicalReputationAbi = exports.standardCloneAuthorizerAbi = exports.cloneGateAbi = exports.trustRegistryAbi = exports.agenticIDAbi = exports.RECEIPT_WAIT = exports.CHAIN_ID = exports.RPC_URL = exports.ZERO_G_MAINNET = exports.ZERO_G_TESTNET = exports.requestUriCandidates = exports.requestUriOf = exports.taskHashOf = exports.listedHashes = exports.isListed = exports.trustRegistryOf = exports.TRUST_KINDS = exports.SERVE_PROOF_V2_TAG = exports.SERVE_PROOF_VERSION = exports.serveProofLayers = exports.verifyServeProofSignature = exports.signServeProof = exports.buildServeProof = exports.buildServeProofSigningHash = exports.buildServeProofMessageHash = exports.proofRecordingFetch = exports.taskRevealOf = exports.captureProof = exports.proofFromResponse = exports.parseServeProofHeader = exports.SERVE_PROOF_HEADER = exports.ServeSession = exports.CREDENTIALS_DOMAIN_VERSION = exports.CREDENTIALS_DOMAIN_NAME = exports.MODEL_KEY_PREFIX = exports.modelKeyName = exports.credentialPlaintext = exports.inputOf = void 0;
|
|
20
20
|
// Node < 18 has no global fetch; without this guard the first bootstrap
|
|
21
21
|
// (fromAttestor) or chain read fails with a bare "fetch is not defined" from
|
|
22
22
|
// deep in the call stack. package.json `engines` isn't enforced by npm by
|
|
@@ -32,10 +32,15 @@ Object.defineProperty(exports, "AgenticID", { enumerable: true, get: function ()
|
|
|
32
32
|
Object.defineProperty(exports, "AgentApi", { enumerable: true, get: function () { return AgenticID_1.AgentApi; } });
|
|
33
33
|
Object.defineProperty(exports, "AdminApi", { enumerable: true, get: function () { return AgenticID_1.AdminApi; } });
|
|
34
34
|
Object.defineProperty(exports, "ReputationApi", { enumerable: true, get: function () { return AgenticID_1.ReputationApi; } });
|
|
35
|
+
var Releases_1 = require("./Releases");
|
|
36
|
+
Object.defineProperty(exports, "fetchReleases", { enumerable: true, get: function () { return Releases_1.fetchReleases; } });
|
|
37
|
+
Object.defineProperty(exports, "releaseNoticeOf", { enumerable: true, get: function () { return Releases_1.releaseNoticeOf; } });
|
|
38
|
+
Object.defineProperty(exports, "agentMigrationOf", { enumerable: true, get: function () { return Releases_1.agentMigrationOf; } });
|
|
35
39
|
var AgentClient_1 = require("./AgentClient");
|
|
36
40
|
Object.defineProperty(exports, "makeAgentClient", { enumerable: true, get: function () { return AgentClient_1.makeAgentClient; } });
|
|
37
41
|
var AgentClient_2 = require("./AgentClient");
|
|
38
42
|
Object.defineProperty(exports, "mcpServices", { enumerable: true, get: function () { return AgentClient_2.mcpServices; } });
|
|
43
|
+
Object.defineProperty(exports, "withImages", { enumerable: true, get: function () { return AgentClient_2.withImages; } });
|
|
39
44
|
var AttestorClient_1 = require("./AttestorClient");
|
|
40
45
|
Object.defineProperty(exports, "defaultIData", { enumerable: true, get: function () { return AttestorClient_1.defaultIData; } });
|
|
41
46
|
Object.defineProperty(exports, "DEFAULT_PERSONA_INFERENCE", { enumerable: true, get: function () { return AttestorClient_1.DEFAULT_PERSONA_INFERENCE; } });
|
|
@@ -56,6 +61,10 @@ Object.defineProperty(exports, "CLONE_DOMAIN", { enumerable: true, get: function
|
|
|
56
61
|
Object.defineProperty(exports, "CLONE_CONTRACT_DOMAIN", { enumerable: true, get: function () { return AttestorClient_2.CLONE_CONTRACT_DOMAIN; } });
|
|
57
62
|
Object.defineProperty(exports, "DEPLOY_DOMAIN", { enumerable: true, get: function () { return AttestorClient_2.DEPLOY_DOMAIN; } });
|
|
58
63
|
Object.defineProperty(exports, "b64encode", { enumerable: true, get: function () { return AttestorClient_2.b64encode; } });
|
|
64
|
+
var Operators_1 = require("./Operators");
|
|
65
|
+
Object.defineProperty(exports, "OPERATOR_DOMAIN", { enumerable: true, get: function () { return Operators_1.OPERATOR_DOMAIN; } });
|
|
66
|
+
Object.defineProperty(exports, "OperatorConflictError", { enumerable: true, get: function () { return Operators_1.OperatorConflictError; } });
|
|
67
|
+
Object.defineProperty(exports, "OperatorCheckpointSupersededError", { enumerable: true, get: function () { return Operators_1.OperatorCheckpointSupersededError; } });
|
|
59
68
|
// Sealed secret env (issue #166): the inference key sealed to the agent's
|
|
60
69
|
// agentSeal key instead of riding the signed envelope in clear.
|
|
61
70
|
var secretEnv_1 = require("./secretEnv");
|
|
@@ -76,6 +85,20 @@ Object.defineProperty(exports, "SettingsConflictError", { enumerable: true, get:
|
|
|
76
85
|
Object.defineProperty(exports, "sha256Hex", { enumerable: true, get: function () { return Settings_1.sha256Hex; } });
|
|
77
86
|
Object.defineProperty(exports, "modelAdvisory", { enumerable: true, get: function () { return Settings_1.modelAdvisory; } });
|
|
78
87
|
Object.defineProperty(exports, "fetchRouterModelIds", { enumerable: true, get: function () { return Settings_1.fetchRouterModelIds; } });
|
|
88
|
+
Object.defineProperty(exports, "versionPicksProblem", { enumerable: true, get: function () { return Settings_1.versionPicksProblem; } });
|
|
89
|
+
var Credentials_1 = require("./Credentials");
|
|
90
|
+
Object.defineProperty(exports, "CredentialsApi", { enumerable: true, get: function () { return Credentials_1.CredentialsApi; } });
|
|
91
|
+
Object.defineProperty(exports, "CredentialsConflictError", { enumerable: true, get: function () { return Credentials_1.CredentialsConflictError; } });
|
|
92
|
+
Object.defineProperty(exports, "CredentialsUnverifiedError", { enumerable: true, get: function () { return Credentials_1.CredentialsUnverifiedError; } });
|
|
93
|
+
Object.defineProperty(exports, "credentialSetTypes", { enumerable: true, get: function () { return Credentials_1.credentialSetTypes; } });
|
|
94
|
+
Object.defineProperty(exports, "approvalTypes", { enumerable: true, get: function () { return Credentials_1.approvalTypes; } });
|
|
95
|
+
Object.defineProperty(exports, "definitionOf", { enumerable: true, get: function () { return Credentials_1.definitionOf; } });
|
|
96
|
+
Object.defineProperty(exports, "inputOf", { enumerable: true, get: function () { return Credentials_1.inputOf; } });
|
|
97
|
+
Object.defineProperty(exports, "credentialPlaintext", { enumerable: true, get: function () { return Credentials_1.credentialPlaintext; } });
|
|
98
|
+
Object.defineProperty(exports, "modelKeyName", { enumerable: true, get: function () { return Credentials_1.modelKeyName; } });
|
|
99
|
+
Object.defineProperty(exports, "MODEL_KEY_PREFIX", { enumerable: true, get: function () { return Credentials_1.MODEL_KEY_PREFIX; } });
|
|
100
|
+
Object.defineProperty(exports, "CREDENTIALS_DOMAIN_NAME", { enumerable: true, get: function () { return Credentials_1.CREDENTIALS_DOMAIN_NAME; } });
|
|
101
|
+
Object.defineProperty(exports, "CREDENTIALS_DOMAIN_VERSION", { enumerable: true, get: function () { return Credentials_1.CREDENTIALS_DOMAIN_VERSION; } });
|
|
79
102
|
// ── Reputation: serve-proof transport + verification ──
|
|
80
103
|
var ServeSession_1 = require("./ServeSession");
|
|
81
104
|
Object.defineProperty(exports, "ServeSession", { enumerable: true, get: function () { return ServeSession_1.ServeSession; } });
|
|
@@ -92,6 +115,14 @@ Object.defineProperty(exports, "buildServeProofSigningHash", { enumerable: true,
|
|
|
92
115
|
Object.defineProperty(exports, "buildServeProof", { enumerable: true, get: function () { return ServeProof_1.buildServeProof; } });
|
|
93
116
|
Object.defineProperty(exports, "signServeProof", { enumerable: true, get: function () { return ServeProof_1.signServeProof; } });
|
|
94
117
|
Object.defineProperty(exports, "verifyServeProofSignature", { enumerable: true, get: function () { return ServeProof_1.verifyServeProofSignature; } });
|
|
118
|
+
Object.defineProperty(exports, "serveProofLayers", { enumerable: true, get: function () { return ServeProof_1.serveProofLayers; } });
|
|
119
|
+
Object.defineProperty(exports, "SERVE_PROOF_VERSION", { enumerable: true, get: function () { return ServeProof_1.SERVE_PROOF_VERSION; } });
|
|
120
|
+
Object.defineProperty(exports, "SERVE_PROOF_V2_TAG", { enumerable: true, get: function () { return ServeProof_1.SERVE_PROOF_V2_TAG; } });
|
|
121
|
+
var TrustRegistry_1 = require("./TrustRegistry");
|
|
122
|
+
Object.defineProperty(exports, "TRUST_KINDS", { enumerable: true, get: function () { return TrustRegistry_1.TRUST_KINDS; } });
|
|
123
|
+
Object.defineProperty(exports, "trustRegistryOf", { enumerable: true, get: function () { return TrustRegistry_1.trustRegistryOf; } });
|
|
124
|
+
Object.defineProperty(exports, "isListed", { enumerable: true, get: function () { return TrustRegistry_1.isListed; } });
|
|
125
|
+
Object.defineProperty(exports, "listedHashes", { enumerable: true, get: function () { return TrustRegistry_1.listedHashes; } });
|
|
95
126
|
var taskHash_1 = require("./taskHash");
|
|
96
127
|
Object.defineProperty(exports, "taskHashOf", { enumerable: true, get: function () { return taskHash_1.taskHashOf; } });
|
|
97
128
|
Object.defineProperty(exports, "requestUriOf", { enumerable: true, get: function () { return taskHash_1.requestUriOf; } });
|
|
@@ -108,6 +139,7 @@ Object.defineProperty(exports, "RECEIPT_WAIT", { enumerable: true, get: function
|
|
|
108
139
|
// ── ABIs (advanced usage) ──
|
|
109
140
|
var abi_1 = require("./abi");
|
|
110
141
|
Object.defineProperty(exports, "agenticIDAbi", { enumerable: true, get: function () { return abi_1.agenticIDAbi; } });
|
|
142
|
+
Object.defineProperty(exports, "trustRegistryAbi", { enumerable: true, get: function () { return abi_1.trustRegistryAbi; } });
|
|
111
143
|
Object.defineProperty(exports, "cloneGateAbi", { enumerable: true, get: function () { return abi_1.cloneGateAbi; } });
|
|
112
144
|
Object.defineProperty(exports, "standardCloneAuthorizerAbi", { enumerable: true, get: function () { return abi_1.standardCloneAuthorizerAbi; } });
|
|
113
145
|
Object.defineProperty(exports, "canonicalReputationAbi", { enumerable: true, get: function () { return abi_1.canonicalReputationAbi; } });
|
|
@@ -118,5 +150,6 @@ Object.defineProperty(exports, "sandboxServingAbi", { enumerable: true, get: fun
|
|
|
118
150
|
var Providers_1 = require("./Providers");
|
|
119
151
|
Object.defineProperty(exports, "listInferenceProviders", { enumerable: true, get: function () { return Providers_1.listInferenceProviders; } });
|
|
120
152
|
Object.defineProperty(exports, "inferenceProvider", { enumerable: true, get: function () { return Providers_1.inferenceProvider; } });
|
|
153
|
+
Object.defineProperty(exports, "providerWebSearch", { enumerable: true, get: function () { return Providers_1.providerWebSearch; } });
|
|
121
154
|
Object.defineProperty(exports, "routeHash", { enumerable: true, get: function () { return Providers_1.routeHash; } });
|
|
122
155
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;AAEH,wEAAwE;AACxE,6EAA6E;AAC7E,0EAA0E;AAC1E,uEAAuE;AACvE,IAAI,OAAQ,UAAkC,CAAC,KAAK,KAAK,UAAU,EAAE,CAAC;IACpE,MAAM,IAAI,KAAK,CACb,oDAAoD;QAClD,gEAAgE,CACnE,CAAC;AACJ,CAAC;AAED,4BAA4B;AAC5B,yCAAkG;AAAzF,qGAAA,SAAS,OAAY;AAAE,sGAAA,SAAS,OAAA;AAAE,qGAAA,QAAQ,OAAA;AAAE,qGAAA,QAAQ,OAAA;AAAE,0GAAA,aAAa,OAAA;AAE5E,6CAAgD;AAAvC,8GAAA,eAAe,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;AAEH,wEAAwE;AACxE,6EAA6E;AAC7E,0EAA0E;AAC1E,uEAAuE;AACvE,IAAI,OAAQ,UAAkC,CAAC,KAAK,KAAK,UAAU,EAAE,CAAC;IACpE,MAAM,IAAI,KAAK,CACb,oDAAoD;QAClD,gEAAgE,CACnE,CAAC;AACJ,CAAC;AAED,4BAA4B;AAC5B,yCAAkG;AAAzF,qGAAA,SAAS,OAAY;AAAE,sGAAA,SAAS,OAAA;AAAE,qGAAA,QAAQ,OAAA;AAAE,qGAAA,QAAQ,OAAA;AAAE,0GAAA,aAAa,OAAA;AAE5E,uCAA8E;AAArE,yGAAA,aAAa,OAAA;AAAE,2GAAA,eAAe,OAAA;AAAE,4GAAA,gBAAgB,OAAA;AAEzD,6CAAgD;AAAvC,8GAAA,eAAe,OAAA;AAMxB,6CAAwD;AAA/C,0GAAA,WAAW,OAAA;AAAE,yGAAA,UAAU,OAAA;AAChC,mDAA0I;AAAj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AA,eAAe,OAAA;AACf,wGAAA,iBAAiB,OAAA;AAGnB,yCAAsG;AAA7F,mHAAA,sBAAsB,OAAA;AAAE,8GAAA,iBAAiB,OAAA;AAAE,8GAAA,iBAAiB,OAAA;AAAE,sGAAA,SAAS,OAAA"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file legacy/modelKey.ts
|
|
3
|
+
* @description LEGACY(model-key): model keys sent with the request.
|
|
4
|
+
*
|
|
5
|
+
* The SDK keeps every model key in the agent's credential set
|
|
6
|
+
* (`model.<provider>`). Two kinds of peers from before that need more, and
|
|
7
|
+
* the SDK's part of it is here:
|
|
8
|
+
*
|
|
9
|
+
* - images that read the key only from the create/reset request: a key given
|
|
10
|
+
* to `deploy` / `start` / `reset` / `retry` also rides the request
|
|
11
|
+
* ({@link deployRequestKey}, {@link requestKey}), and so does a key an
|
|
12
|
+
* integrator's server seals ({@link requestSecretEnv});
|
|
13
|
+
* - attestors that take no credential set before the mint: `deploy` stores
|
|
14
|
+
* the key once minted ({@link storeAfterMint}).
|
|
15
|
+
*
|
|
16
|
+
* The request key itself is built where every request is (AttestorClient's
|
|
17
|
+
* `sandboxEnv`, `keyEnv` and `sealApiKey`, with secretEnv.ts); the CLI's part
|
|
18
|
+
* is in cli/legacy/modelKey.ts. Once every image reads model keys from the
|
|
19
|
+
* set and every attestor takes a set before the mint, delete this file and
|
|
20
|
+
* cli/legacy/modelKey.ts, and remove every piece marked LEGACY(model-key)
|
|
21
|
+
* (`git grep -n 'LEGACY(model-key)'`). Deleting the files makes the compiler
|
|
22
|
+
* list the call sites that send the key; the marks find the rest (the
|
|
23
|
+
* request-building code behind them, the options, types and messages that
|
|
24
|
+
* only describe the request copy). The attestor drops the request key
|
|
25
|
+
* (`OWNER_ENV_KEYS`) only after no client sends it any more, this SDK's
|
|
26
|
+
* releases until then included.
|
|
27
|
+
*/
|
|
28
|
+
import type { DeployAccepted, ModelKeyLifecycleOpts } from '../AgenticID';
|
|
29
|
+
import type { AttestorClient } from '../AttestorClient';
|
|
30
|
+
import { type SecretEnvMode } from '../secretEnv';
|
|
31
|
+
/** What a start/reset/retry request carries besides the credential set: the key, for images that read only the request. */
|
|
32
|
+
export declare function requestKey(opts: ModelKeyLifecycleOpts): {
|
|
33
|
+
apiKey?: string;
|
|
34
|
+
sealedSecretEnv?: string;
|
|
35
|
+
secretEnv?: SecretEnvMode;
|
|
36
|
+
};
|
|
37
|
+
/** Whether a start/reset/retry request carries the key, for images that read only the request. */
|
|
38
|
+
export declare function carriesRequestKey(p: {
|
|
39
|
+
apiKey?: string;
|
|
40
|
+
sealedSecretEnv?: string;
|
|
41
|
+
}): boolean;
|
|
42
|
+
/** The key a deploy's create envelope carries, for images that read only the request. */
|
|
43
|
+
export declare function deployRequestKey(sandbox: {
|
|
44
|
+
apiKey?: string;
|
|
45
|
+
secretEnv?: SecretEnvMode;
|
|
46
|
+
}): {
|
|
47
|
+
apiKey?: string;
|
|
48
|
+
mode?: SecretEnvMode;
|
|
49
|
+
};
|
|
50
|
+
/** `keepStoredModelKey`: the set holds the key already, and it goes with the request only. */
|
|
51
|
+
export declare function requestOnly(opts: ModelKeyLifecycleOpts): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* The key as an older image reads it with the request (`sealApiKey`), beside
|
|
54
|
+
* the value `sealModelKey` seals for the set. None when the attestor does
|
|
55
|
+
* not seal request keys: the key then reaches only images that read the set.
|
|
56
|
+
*/
|
|
57
|
+
export declare function requestSecretEnv(attestor: AttestorClient, p: {
|
|
58
|
+
sealId: `0x${string}`;
|
|
59
|
+
owner: `0x${string}`;
|
|
60
|
+
apiKey: string;
|
|
61
|
+
provider: string;
|
|
62
|
+
framework?: string;
|
|
63
|
+
sealedImage?: string;
|
|
64
|
+
}): Promise<string | undefined>;
|
|
65
|
+
/** After the mint, for an attestor that took no set before it: the key goes in now. */
|
|
66
|
+
export declare function storeAfterMint(accepted: DeployAccepted, store: () => Promise<boolean>): Promise<void>;
|
|
67
|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AAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GAC7H,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAO7B;AAED,uFAAuF;AACvF,wBAAsB,cAAc,CAAC,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3G"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @file legacy/modelKey.ts
|
|
4
|
+
* @description LEGACY(model-key): model keys sent with the request.
|
|
5
|
+
*
|
|
6
|
+
* The SDK keeps every model key in the agent's credential set
|
|
7
|
+
* (`model.<provider>`). Two kinds of peers from before that need more, and
|
|
8
|
+
* the SDK's part of it is here:
|
|
9
|
+
*
|
|
10
|
+
* - images that read the key only from the create/reset request: a key given
|
|
11
|
+
* to `deploy` / `start` / `reset` / `retry` also rides the request
|
|
12
|
+
* ({@link deployRequestKey}, {@link requestKey}), and so does a key an
|
|
13
|
+
* integrator's server seals ({@link requestSecretEnv});
|
|
14
|
+
* - attestors that take no credential set before the mint: `deploy` stores
|
|
15
|
+
* the key once minted ({@link storeAfterMint}).
|
|
16
|
+
*
|
|
17
|
+
* The request key itself is built where every request is (AttestorClient's
|
|
18
|
+
* `sandboxEnv`, `keyEnv` and `sealApiKey`, with secretEnv.ts); the CLI's part
|
|
19
|
+
* is in cli/legacy/modelKey.ts. Once every image reads model keys from the
|
|
20
|
+
* set and every attestor takes a set before the mint, delete this file and
|
|
21
|
+
* cli/legacy/modelKey.ts, and remove every piece marked LEGACY(model-key)
|
|
22
|
+
* (`git grep -n 'LEGACY(model-key)'`). Deleting the files makes the compiler
|
|
23
|
+
* list the call sites that send the key; the marks find the rest (the
|
|
24
|
+
* request-building code behind them, the options, types and messages that
|
|
25
|
+
* only describe the request copy). The attestor drops the request key
|
|
26
|
+
* (`OWNER_ENV_KEYS`) only after no client sends it any more, this SDK's
|
|
27
|
+
* releases until then included.
|
|
28
|
+
*/
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.requestKey = requestKey;
|
|
31
|
+
exports.carriesRequestKey = carriesRequestKey;
|
|
32
|
+
exports.deployRequestKey = deployRequestKey;
|
|
33
|
+
exports.requestOnly = requestOnly;
|
|
34
|
+
exports.requestSecretEnv = requestSecretEnv;
|
|
35
|
+
exports.storeAfterMint = storeAfterMint;
|
|
36
|
+
const secretEnv_1 = require("../secretEnv");
|
|
37
|
+
/** What a start/reset/retry request carries besides the credential set: the key, for images that read only the request. */
|
|
38
|
+
function requestKey(opts) {
|
|
39
|
+
if (opts.sealedModelKey && opts.sealedSecretEnv !== undefined) {
|
|
40
|
+
throw new secretEnv_1.SecretEnvRefusedError('conflicting_inputs', 'pass sealedModelKey or sealedSecretEnv, not both');
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
apiKey: opts.apiKey,
|
|
44
|
+
sealedSecretEnv: opts.sealedSecretEnv ?? opts.sealedModelKey?.secretEnv,
|
|
45
|
+
secretEnv: opts.secretEnv,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/** Whether a start/reset/retry request carries the key, for images that read only the request. */
|
|
49
|
+
function carriesRequestKey(p) {
|
|
50
|
+
return !!p.apiKey || p.sealedSecretEnv !== undefined;
|
|
51
|
+
}
|
|
52
|
+
/** The key a deploy's create envelope carries, for images that read only the request. */
|
|
53
|
+
function deployRequestKey(sandbox) {
|
|
54
|
+
return { apiKey: sandbox.apiKey, mode: sandbox.secretEnv };
|
|
55
|
+
}
|
|
56
|
+
/** `keepStoredModelKey`: the set holds the key already, and it goes with the request only. */
|
|
57
|
+
function requestOnly(opts) {
|
|
58
|
+
return !!opts.keepStoredModelKey;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The key as an older image reads it with the request (`sealApiKey`), beside
|
|
62
|
+
* the value `sealModelKey` seals for the set. None when the attestor does
|
|
63
|
+
* not seal request keys: the key then reaches only images that read the set.
|
|
64
|
+
*/
|
|
65
|
+
async function requestSecretEnv(attestor, p) {
|
|
66
|
+
try {
|
|
67
|
+
return await attestor.sealApiKey(p);
|
|
68
|
+
}
|
|
69
|
+
catch (e) {
|
|
70
|
+
if (e instanceof secretEnv_1.SecretEnvRefusedError && e.code === 'scheme_unsupported')
|
|
71
|
+
return undefined;
|
|
72
|
+
throw e;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/** After the mint, for an attestor that took no set before it: the key goes in now. */
|
|
76
|
+
async function storeAfterMint(accepted, store) {
|
|
77
|
+
if (!accepted.modelKeyStored)
|
|
78
|
+
accepted.modelKeyStored = await store();
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=modelKey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modelKey.js","sourceRoot":"","sources":["../../src/legacy/modelKey.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;AAOH,gCASC;AAGD,8CAEC;AAGD,4CAEC;AAGD,kCAEC;AAOD,4CAUC;AAGD,wCAEC;AAjDD,4CAAyE;AAEzE,2HAA2H;AAC3H,SAAgB,UAAU,CAAC,IAA2B;IACpD,IAAI,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;QAC9D,MAAM,IAAI,iCAAqB,CAAC,oBAAoB,EAAE,kDAAkD,CAAC,CAAC;IAC5G,CAAC;IACD,OAAO;QACL,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,eAAe,EAAE,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,cAAc,EAAE,SAAS;QACvE,SAAS,EAAE,IAAI,CAAC,SAAS;KAC1B,CAAC;AACJ,CAAC;AAED,kGAAkG;AAClG,SAAgB,iBAAiB,CAAC,CAAgD;IAChF,OAAO,CAAC,CAAC,CAAC,CAAC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