@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.
Files changed (255) hide show
  1. package/GUIDE.md +190 -40
  2. package/OPERATORS.md +164 -0
  3. package/OPERATORS.zh.md +141 -0
  4. package/PROVIDERS.md +6 -0
  5. package/PROVIDERS.zh.md +3 -1
  6. package/README.md +84 -11
  7. package/dist/AgentClient.d.ts +374 -26
  8. package/dist/AgentClient.d.ts.map +1 -1
  9. package/dist/AgentClient.js +323 -40
  10. package/dist/AgentClient.js.map +1 -1
  11. package/dist/AgenticID.d.ts +170 -80
  12. package/dist/AgenticID.d.ts.map +1 -1
  13. package/dist/AgenticID.js +300 -42
  14. package/dist/AgenticID.js.map +1 -1
  15. package/dist/AttestorClient.d.ts +115 -31
  16. package/dist/AttestorClient.d.ts.map +1 -1
  17. package/dist/AttestorClient.js +276 -56
  18. package/dist/AttestorClient.js.map +1 -1
  19. package/dist/Credentials.d.ts +574 -0
  20. package/dist/Credentials.d.ts.map +1 -0
  21. package/dist/Credentials.js +838 -0
  22. package/dist/Credentials.js.map +1 -0
  23. package/dist/Operators.d.ts +60 -0
  24. package/dist/Operators.d.ts.map +1 -0
  25. package/dist/Operators.js +38 -0
  26. package/dist/Operators.js.map +1 -0
  27. package/dist/Providers.d.ts +13 -0
  28. package/dist/Providers.d.ts.map +1 -1
  29. package/dist/Providers.js +20 -1
  30. package/dist/Providers.js.map +1 -1
  31. package/dist/Releases.d.ts +51 -0
  32. package/dist/Releases.d.ts.map +1 -0
  33. package/dist/Releases.js +72 -0
  34. package/dist/Releases.js.map +1 -0
  35. package/dist/ReputationClient.d.ts +47 -3
  36. package/dist/ReputationClient.d.ts.map +1 -1
  37. package/dist/ReputationClient.js +204 -78
  38. package/dist/ReputationClient.js.map +1 -1
  39. package/dist/ServeProof.d.ts +70 -23
  40. package/dist/ServeProof.d.ts.map +1 -1
  41. package/dist/ServeProof.js +94 -35
  42. package/dist/ServeProof.js.map +1 -1
  43. package/dist/ServeSession.d.ts +17 -2
  44. package/dist/ServeSession.d.ts.map +1 -1
  45. package/dist/ServeSession.js +77 -9
  46. package/dist/ServeSession.js.map +1 -1
  47. package/dist/Settings.d.ts +25 -1
  48. package/dist/Settings.d.ts.map +1 -1
  49. package/dist/Settings.js +53 -1
  50. package/dist/Settings.js.map +1 -1
  51. package/dist/TrustRegistry.d.ts +28 -0
  52. package/dist/TrustRegistry.d.ts.map +1 -0
  53. package/dist/TrustRegistry.js +67 -0
  54. package/dist/TrustRegistry.js.map +1 -0
  55. package/dist/abi.d.ts +346 -34
  56. package/dist/abi.d.ts.map +1 -1
  57. package/dist/abi.js +150 -30
  58. package/dist/abi.js.map +1 -1
  59. package/dist/cli/attach.d.ts +79 -0
  60. package/dist/cli/attach.d.ts.map +1 -0
  61. package/dist/cli/attach.js +253 -0
  62. package/dist/cli/attach.js.map +1 -0
  63. package/dist/cli/commands/cells.d.ts +45 -0
  64. package/dist/cli/commands/cells.d.ts.map +1 -1
  65. package/dist/cli/commands/cells.js +77 -0
  66. package/dist/cli/commands/cells.js.map +1 -1
  67. package/dist/cli/commands/cred.d.ts +12 -0
  68. package/dist/cli/commands/cred.d.ts.map +1 -0
  69. package/dist/cli/commands/cred.js +43 -0
  70. package/dist/cli/commands/cred.js.map +1 -0
  71. package/dist/cli/commands/doctor.d.ts.map +1 -1
  72. package/dist/cli/commands/doctor.js +44 -35
  73. package/dist/cli/commands/doctor.js.map +1 -1
  74. package/dist/cli/commands/interactive.d.ts +597 -21
  75. package/dist/cli/commands/interactive.d.ts.map +1 -1
  76. package/dist/cli/commands/interactive.js +5082 -1323
  77. package/dist/cli/commands/interactive.js.map +1 -1
  78. package/dist/cli/commands/list.d.ts +5 -5
  79. package/dist/cli/commands/list.d.ts.map +1 -1
  80. package/dist/cli/commands/list.js +21 -26
  81. package/dist/cli/commands/list.js.map +1 -1
  82. package/dist/cli/commands/providers.d.ts +4 -0
  83. package/dist/cli/commands/providers.d.ts.map +1 -1
  84. package/dist/cli/commands/providers.js +19 -5
  85. package/dist/cli/commands/providers.js.map +1 -1
  86. package/dist/cli/commands/releases.d.ts +13 -0
  87. package/dist/cli/commands/releases.d.ts.map +1 -0
  88. package/dist/cli/commands/releases.js +65 -0
  89. package/dist/cli/commands/releases.js.map +1 -0
  90. package/dist/cli/commands/settings.d.ts +5 -0
  91. package/dist/cli/commands/settings.d.ts.map +1 -1
  92. package/dist/cli/commands/settings.js +70 -24
  93. package/dist/cli/commands/settings.js.map +1 -1
  94. package/dist/cli/commands/status.d.ts +2 -1
  95. package/dist/cli/commands/status.d.ts.map +1 -1
  96. package/dist/cli/commands/status.js +22 -19
  97. package/dist/cli/commands/status.js.map +1 -1
  98. package/dist/cli/config.d.ts +48 -1
  99. package/dist/cli/config.d.ts.map +1 -1
  100. package/dist/cli/config.js +114 -5
  101. package/dist/cli/config.js.map +1 -1
  102. package/dist/cli/credentials.d.ts +179 -0
  103. package/dist/cli/credentials.d.ts.map +1 -0
  104. package/dist/cli/credentials.js +1443 -0
  105. package/dist/cli/credentials.js.map +1 -0
  106. package/dist/cli/download.d.ts +21 -0
  107. package/dist/cli/download.d.ts.map +1 -0
  108. package/dist/cli/download.js +89 -0
  109. package/dist/cli/download.js.map +1 -0
  110. package/dist/cli/env.d.ts +6 -0
  111. package/dist/cli/env.d.ts.map +1 -1
  112. package/dist/cli/env.js +18 -6
  113. package/dist/cli/env.js.map +1 -1
  114. package/dist/cli/envelope.d.ts +4 -2
  115. package/dist/cli/envelope.d.ts.map +1 -1
  116. package/dist/cli/envelope.js +10 -6
  117. package/dist/cli/envelope.js.map +1 -1
  118. package/dist/cli/errors.d.ts +45 -1
  119. package/dist/cli/errors.d.ts.map +1 -1
  120. package/dist/cli/errors.js +77 -0
  121. package/dist/cli/errors.js.map +1 -1
  122. package/dist/cli/inference.d.ts.map +1 -1
  123. package/dist/cli/inference.js +7 -0
  124. package/dist/cli/inference.js.map +1 -1
  125. package/dist/cli/inkView.d.ts +341 -0
  126. package/dist/cli/inkView.d.ts.map +1 -0
  127. package/dist/cli/inkView.js +1019 -0
  128. package/dist/cli/inkView.js.map +1 -0
  129. package/dist/cli/legacy/modelKey.d.ts +24 -0
  130. package/dist/cli/legacy/modelKey.d.ts.map +1 -0
  131. package/dist/cli/legacy/modelKey.js +32 -0
  132. package/dist/cli/legacy/modelKey.js.map +1 -0
  133. package/dist/cli/livePrompt.d.ts +212 -0
  134. package/dist/cli/livePrompt.d.ts.map +1 -0
  135. package/dist/cli/livePrompt.js +576 -0
  136. package/dist/cli/livePrompt.js.map +1 -0
  137. package/dist/cli/main.js +206 -72
  138. package/dist/cli/main.js.map +1 -1
  139. package/dist/cli/modelkey.d.ts +64 -0
  140. package/dist/cli/modelkey.d.ts.map +1 -0
  141. package/dist/cli/modelkey.js +113 -0
  142. package/dist/cli/modelkey.js.map +1 -0
  143. package/dist/cli/outboxSync.d.ts +51 -0
  144. package/dist/cli/outboxSync.d.ts.map +1 -0
  145. package/dist/cli/outboxSync.js +210 -0
  146. package/dist/cli/outboxSync.js.map +1 -0
  147. package/dist/cli/plain.d.ts +46 -0
  148. package/dist/cli/plain.d.ts.map +1 -0
  149. package/dist/cli/plain.js +260 -0
  150. package/dist/cli/plain.js.map +1 -0
  151. package/dist/cli/proofs.d.ts +5 -0
  152. package/dist/cli/proofs.d.ts.map +1 -1
  153. package/dist/cli/proofs.js +20 -0
  154. package/dist/cli/proofs.js.map +1 -1
  155. package/dist/cli/ref.d.ts.map +1 -1
  156. package/dist/cli/ref.js +3 -2
  157. package/dist/cli/ref.js.map +1 -1
  158. package/dist/cli/releaseNotice.d.ts +64 -0
  159. package/dist/cli/releaseNotice.d.ts.map +1 -0
  160. package/dist/cli/releaseNotice.js +194 -0
  161. package/dist/cli/releaseNotice.js.map +1 -0
  162. package/dist/cli/sdk.d.ts +18 -0
  163. package/dist/cli/sdk.d.ts.map +1 -1
  164. package/dist/cli/sdk.js +99 -1
  165. package/dist/cli/sdk.js.map +1 -1
  166. package/dist/cli/settings.d.ts +87 -6
  167. package/dist/cli/settings.d.ts.map +1 -1
  168. package/dist/cli/settings.js +270 -18
  169. package/dist/cli/settings.js.map +1 -1
  170. package/dist/cli/textfit.d.ts +28 -0
  171. package/dist/cli/textfit.d.ts.map +1 -0
  172. package/dist/cli/textfit.js +111 -0
  173. package/dist/cli/textfit.js.map +1 -0
  174. package/dist/constants.d.ts +1 -1
  175. package/dist/constants.js +1 -1
  176. package/dist/context.d.ts +26 -0
  177. package/dist/context.d.ts.map +1 -1
  178. package/dist/context.js +1 -0
  179. package/dist/context.js.map +1 -1
  180. package/dist/index.d.ts +19 -11
  181. package/dist/index.d.ts.map +1 -1
  182. package/dist/index.js +35 -2
  183. package/dist/index.js.map +1 -1
  184. package/dist/legacy/modelKey.d.ts +67 -0
  185. package/dist/legacy/modelKey.d.ts.map +1 -0
  186. package/dist/legacy/modelKey.js +80 -0
  187. package/dist/legacy/modelKey.js.map +1 -0
  188. package/dist/legacy/serveProofV1.d.ts +56 -0
  189. package/dist/legacy/serveProofV1.d.ts.map +1 -0
  190. package/dist/legacy/serveProofV1.js +91 -0
  191. package/dist/legacy/serveProofV1.js.map +1 -0
  192. package/dist/provider-catalog.json +3 -2
  193. package/dist/secretEnv.d.ts +18 -3
  194. package/dist/secretEnv.d.ts.map +1 -1
  195. package/dist/secretEnv.js +16 -2
  196. package/dist/secretEnv.js.map +1 -1
  197. package/dist/types.d.ts +63 -1
  198. package/dist/types.d.ts.map +1 -1
  199. package/dist/viemErrors.d.ts +30 -0
  200. package/dist/viemErrors.d.ts.map +1 -0
  201. package/dist/viemErrors.js +36 -0
  202. package/dist/viemErrors.js.map +1 -0
  203. package/package.json +5 -1
  204. package/src/AgentClient.ts +622 -68
  205. package/src/AgenticID.ts +345 -56
  206. package/src/AttestorClient.ts +330 -83
  207. package/src/Credentials.ts +1027 -0
  208. package/src/Operators.ts +71 -0
  209. package/src/Providers.ts +20 -0
  210. package/src/Releases.ts +95 -0
  211. package/src/ReputationClient.ts +231 -79
  212. package/src/ServeProof.ts +123 -39
  213. package/src/ServeSession.ts +91 -9
  214. package/src/Settings.ts +61 -1
  215. package/src/TrustRegistry.ts +75 -0
  216. package/src/abi.ts +153 -30
  217. package/src/cli/attach.ts +257 -0
  218. package/src/cli/commands/cells.ts +104 -0
  219. package/src/cli/commands/cred.ts +44 -0
  220. package/src/cli/commands/doctor.ts +45 -37
  221. package/src/cli/commands/interactive.ts +4120 -664
  222. package/src/cli/commands/list.ts +21 -30
  223. package/src/cli/commands/providers.ts +17 -4
  224. package/src/cli/commands/releases.ts +60 -0
  225. package/src/cli/commands/settings.ts +75 -28
  226. package/src/cli/commands/status.ts +24 -21
  227. package/src/cli/config.ts +119 -4
  228. package/src/cli/credentials.ts +1379 -0
  229. package/src/cli/download.ts +80 -0
  230. package/src/cli/env.ts +22 -7
  231. package/src/cli/envelope.ts +10 -6
  232. package/src/cli/errors.ts +92 -0
  233. package/src/cli/inference.ts +8 -1
  234. package/src/cli/inkView.ts +969 -0
  235. package/src/cli/legacy/modelKey.ts +35 -0
  236. package/src/cli/livePrompt.ts +615 -0
  237. package/src/cli/main.ts +206 -76
  238. package/src/cli/modelkey.ts +124 -0
  239. package/src/cli/outboxSync.ts +231 -0
  240. package/src/cli/plain.ts +260 -0
  241. package/src/cli/proofs.ts +27 -0
  242. package/src/cli/ref.ts +5 -4
  243. package/src/cli/releaseNotice.ts +200 -0
  244. package/src/cli/sdk.ts +87 -7
  245. package/src/cli/settings.ts +272 -22
  246. package/src/cli/textfit.ts +95 -0
  247. package/src/constants.ts +1 -1
  248. package/src/context.ts +28 -0
  249. package/src/index.ts +50 -7
  250. package/src/legacy/modelKey.ts +80 -0
  251. package/src/legacy/serveProofV1.ts +124 -0
  252. package/src/provider-catalog.json +3 -2
  253. package/src/secretEnv.ts +18 -3
  254. package/src/types.ts +60 -1
  255. package/src/viemErrors.ts +39 -0
@@ -0,0 +1,574 @@
1
+ import { type Address, type Hash } from 'viem';
2
+ import type { Ctx } from './context';
3
+ import type { AttestorClient } from './AttestorClient';
4
+ /** EIP-712 domain name and version shared with sealed and the attestor. */
5
+ export declare const CREDENTIALS_DOMAIN_NAME = "AgentDNA Credentials";
6
+ export declare const CREDENTIALS_DOMAIN_VERSION = "1";
7
+ export declare const credentialSetTypes: {
8
+ readonly CredentialSet: readonly [{
9
+ readonly name: "sealId";
10
+ readonly type: "bytes32";
11
+ }, {
12
+ readonly name: "ownerEpoch";
13
+ readonly type: "uint64";
14
+ }, {
15
+ readonly name: "version";
16
+ readonly type: "uint64";
17
+ }, {
18
+ readonly name: "entries";
19
+ readonly type: "Entry[]";
20
+ }];
21
+ readonly Entry: readonly [{
22
+ readonly name: "name";
23
+ readonly type: "string";
24
+ }, {
25
+ readonly name: "defHash";
26
+ readonly type: "bytes32";
27
+ }];
28
+ };
29
+ export declare const approvalTypes: {
30
+ readonly Approval: readonly [{
31
+ readonly name: "sealId";
32
+ readonly type: "bytes32";
33
+ }, {
34
+ readonly name: "bootId";
35
+ readonly type: "bytes32";
36
+ }, {
37
+ readonly name: "authReqId";
38
+ readonly type: "bytes32";
39
+ }, {
40
+ readonly name: "requestDigest";
41
+ readonly type: "bytes32";
42
+ }, {
43
+ readonly name: "expiresAt";
44
+ readonly type: "uint64";
45
+ }];
46
+ };
47
+ /** Where a placeholder may stand in a request. */
48
+ export type CredentialPosition = {
49
+ kind: 'header';
50
+ name: string;
51
+ template: string;
52
+ } | {
53
+ kind: 'basic';
54
+ username: string;
55
+ } | {
56
+ kind: 'query';
57
+ param: string;
58
+ } | {
59
+ kind: 'path';
60
+ } | {
61
+ kind: 'body';
62
+ field: string;
63
+ };
64
+ /** Template sealed follows to call a token endpoint (RFC 6749 §3.2). */
65
+ export interface TokenRequestTemplate {
66
+ url: string;
67
+ encoding?: 'form' | 'json';
68
+ /** Field → template: `{v}` is this entry's value, `{cred:<name>}` another entry's. */
69
+ fields: Record<string, string>;
70
+ basic_auth?: {
71
+ username_entry: string;
72
+ password_entry: string;
73
+ };
74
+ /** Parameters the agent may add (e.g. `scope`). */
75
+ params?: string[];
76
+ /** Response fields kept as derived entries the agent uses by placeholder. */
77
+ take: Array<{
78
+ field: string;
79
+ name?: string;
80
+ hosts: string[];
81
+ positions: CredentialPosition[];
82
+ expires_in_field?: string;
83
+ }>;
84
+ /** e.g. `refresh_token`: a new value in the response replaces this entry. */
85
+ rotate_field?: string;
86
+ }
87
+ /**
88
+ * How a signing entry (`use: 'sign'`) uses its key, which is never written
89
+ * into a request: sealed signs AWS requests (sigv4) or HMAC-signed ones on
90
+ * their way out, mints a JWT where the entry's placeholder stands, or signs
91
+ * with a wallet through the agent's credential socket.
92
+ */
93
+ export type CredentialSigner = {
94
+ method: 'sigv4';
95
+ access_key_id: string;
96
+ region: string;
97
+ service: string;
98
+ session_token_entry?: string;
99
+ } | {
100
+ method: 'hmac';
101
+ /** Template over {method} {path} {query} {body} {timestamp} {header:<name>}. */
102
+ message: string;
103
+ header?: string;
104
+ param?: string;
105
+ algorithm?: 'sha256' | 'sha512' | 'sha1';
106
+ encoding?: 'hex' | 'base64';
107
+ prefix?: string;
108
+ timestamp_header?: string;
109
+ } | {
110
+ method: 'jwt';
111
+ alg: 'RS256' | 'ES256' | 'HS256';
112
+ kid?: string;
113
+ claims?: Record<string, unknown>;
114
+ ttl?: number;
115
+ } | {
116
+ method: 'wallet';
117
+ };
118
+ /**
119
+ * A login entry: the owner logs the agent in to the MCP server at `url`
120
+ * (OAuth with PKCE, run by sealed); sealed keeps and refreshes the tokens.
121
+ */
122
+ export interface CredentialMCP {
123
+ url: string;
124
+ /** For a server that does not register clients itself. */
125
+ client_id?: string;
126
+ /** The entry holding that client's secret. */
127
+ client_secret_entry?: string;
128
+ scopes?: string[];
129
+ }
130
+ /**
131
+ * Makes an entry the agent's model (inference) key for one provider of the
132
+ * platform's provider registry: sealed hands it to the framework for that
133
+ * provider's model calls and nothing else. Without `route_hash` the image's
134
+ * built-in route; with it, the provider's route in that accepted registry
135
+ * version (see {@link CredentialsApi.setModelKey}).
136
+ */
137
+ export interface CredentialInference {
138
+ provider: string;
139
+ route_hash?: string;
140
+ registry?: {
141
+ version: number;
142
+ digest?: string;
143
+ };
144
+ }
145
+ /** One credential as the owner sets it. */
146
+ export interface CredentialInput {
147
+ name: string;
148
+ /** The secret. Omit to keep the value already stored for this name. */
149
+ value?: string;
150
+ hosts: string[];
151
+ positions: CredentialPosition[];
152
+ /** `inject` (default), `token_only` (only feeds a token request), `sign`; `model` for a model key. */
153
+ use?: 'inject' | 'token_only' | 'sign' | 'model';
154
+ /** Required with `use: 'sign'`. */
155
+ signer?: CredentialSigner;
156
+ /** A login entry; it takes no value (see {@link CredentialsApi.login}). */
157
+ mcp?: CredentialMCP;
158
+ description?: string;
159
+ /** Unix seconds. */
160
+ expiresAt?: number;
161
+ /** Let the agent have the value itself without asking each time. */
162
+ allowReveal?: boolean;
163
+ /** Let sealed store a rotated refresh token back for the next boot. */
164
+ writeback?: boolean;
165
+ tokenRequest?: TokenRequestTemplate;
166
+ /** A model key: no hosts, positions or other options (see {@link CredentialInference}). */
167
+ inference?: CredentialInference;
168
+ }
169
+ /** A stored credential, as the owner reads it back (never the value). */
170
+ export interface CredentialDefinition {
171
+ v: 1;
172
+ name: string;
173
+ hosts: string[];
174
+ positions: CredentialPosition[];
175
+ /** `model` marks a model key: an image from before model keys skips the entry. */
176
+ use: 'inject' | 'token_only' | 'sign' | 'model';
177
+ value_hash: string;
178
+ description?: string;
179
+ expires_at?: number;
180
+ allow_reveal?: boolean;
181
+ writeback?: boolean;
182
+ token_request?: TokenRequestTemplate;
183
+ signer?: CredentialSigner;
184
+ mcp?: CredentialMCP;
185
+ inference?: CredentialInference;
186
+ }
187
+ /** Model key entries are named `model.<provider>`. */
188
+ export declare const MODEL_KEY_PREFIX = "model.";
189
+ export declare function modelKeyName(provider: string): string;
190
+ /**
191
+ * A model key sealed to one agent for its owner by whoever holds the key
192
+ * (an integrator's server, {@link CredentialsApi.sealModelKey}). The owner
193
+ * stores it as it is ({@link CredentialsApi.setModelKey}) and never sees the
194
+ * key.
195
+ */
196
+ export interface SealedModelKey {
197
+ v: 1;
198
+ sealId: Hash;
199
+ owner: Address;
200
+ provider: string;
201
+ /** The value as the credential set stores it: ECIES to the agent's agentSeal key, base64. */
202
+ value: string;
203
+ /** LEGACY(model-key): the same key as an older image reads it with the request (`SEAL_SECRET_ENV`); absent when the attestor does not seal request keys. */
204
+ secretEnv?: string;
205
+ }
206
+ /** Which model key the running agent's framework uses (`GET /_seal/credentials`). */
207
+ export interface ModelKeyInUse {
208
+ provider?: string;
209
+ /** `credentials`: an entry of the set; `deploy` (LEGACY(model-key)): the key given with the create/reset request. */
210
+ source: 'credentials' | 'deploy' | 'none';
211
+ /** The entry's value hash, when `source` is `credentials`. */
212
+ value_hash?: string;
213
+ /** Why the key the settings choose is not the one in use. */
214
+ issue?: string;
215
+ /** LEGACY(model-key): the provider of the key given with the create/reset request, when it is usable: a switch to it needs no key in the set. */
216
+ deploy_provider?: string;
217
+ }
218
+ /** {@link CredentialsApi.modelKeys}. */
219
+ export interface ModelKeysView {
220
+ /** The providers the credential set holds a key for. */
221
+ stored: Array<{
222
+ provider: string;
223
+ valueHash: string;
224
+ }>;
225
+ /** The key the running agent uses; null: not running; `unsupported`: an image from before model keys in the set. */
226
+ inUse: ModelKeyInUse | null | 'unsupported';
227
+ }
228
+ /**
229
+ * What the running agent has loaded: the entries the agent may use (names and
230
+ * where they may go, never values) and, from an image that takes model keys
231
+ * from the set, which model key is in use (absent from an older image).
232
+ */
233
+ export interface LoadedCredentials {
234
+ version: number;
235
+ entries: Array<{
236
+ name: string;
237
+ source: string;
238
+ use: string;
239
+ hosts: string[];
240
+ expires_at?: number;
241
+ logged_in_at?: number;
242
+ status?: string;
243
+ }>;
244
+ model?: ModelKeyInUse;
245
+ }
246
+ /** The signed document, as sealed and the attestor read it. */
247
+ export interface CredentialDocument {
248
+ set: {
249
+ seal_id: string;
250
+ owner_epoch: number;
251
+ version: number;
252
+ entries: Array<{
253
+ name: string;
254
+ def_hash: string;
255
+ }>;
256
+ };
257
+ signature: string;
258
+ defs: Record<string, string>;
259
+ values: Record<string, string>;
260
+ writebacks?: Record<string, unknown>;
261
+ }
262
+ /** A request waiting for the owner (sealed's /_seal/credentials/pending). */
263
+ export interface PendingCredentialRequest {
264
+ auth_req_id: string;
265
+ op: 'reveal' | 'add' | 'login';
266
+ name: string;
267
+ params?: Record<string, string>;
268
+ /** What sealed knows (source, hosts, expiry). */
269
+ facts: Record<string, unknown>;
270
+ /** What the agent said; shown apart from the facts. */
271
+ reason?: string;
272
+ request_digest: string;
273
+ boot_id: string;
274
+ created_at: number;
275
+ expires_at: number;
276
+ status: 'pending' | 'approved' | 'denied';
277
+ }
278
+ /** The largest value sealed holds (credproxy.MaxValueLen). */
279
+ export declare const MAX_VALUE_BYTES: number;
280
+ /**
281
+ * Thrown when the stored set is not one this wallet signed: the attestor, or
282
+ * the connection to it, returned something else. Nothing is signed on top
283
+ * of it.
284
+ */
285
+ export declare class CredentialsUnverifiedError extends Error {
286
+ readonly why: string;
287
+ constructor(why: string);
288
+ }
289
+ /** Thrown when the stored set moved on since it was read. */
290
+ export declare class CredentialsConflictError extends Error {
291
+ readonly currentVersion: number;
292
+ readonly ownerEpoch: number;
293
+ constructor(currentVersion: number, ownerEpoch: number);
294
+ }
295
+ /** The plaintext a value's ciphertext holds (sealed/internal/credentials). */
296
+ export declare function credentialPlaintext(p: {
297
+ owner: Address;
298
+ sealId: Hash;
299
+ chainId: number;
300
+ name: string;
301
+ value: string;
302
+ }): string;
303
+ /**
304
+ * Build a definition from an input and the ciphertext hash of its value.
305
+ * The bytes depend only on the definition, never on how the input was built
306
+ * (keys in one fixed order), so an entry stored again unchanged keeps its
307
+ * hash, and with it what sealed wrote back for it.
308
+ */
309
+ export declare function definitionOf(c: CredentialInput, valueHash: Hash): CredentialDefinition;
310
+ /** A stored definition as an input that keeps its stored value. */
311
+ export declare function inputOf(d: CredentialDefinition): CredentialInput;
312
+ /**
313
+ * The checks {@link CredentialsApi.setModelKey} makes of a key and its
314
+ * provider before it reads or sends anything: a caller that stores a key
315
+ * after a request (`AgentApi.deploy`) runs them before the request. Throws.
316
+ */
317
+ export declare function checkModelKeyInput(provider: string, value: string): void;
318
+ export declare class CredentialsApi {
319
+ private readonly ctx;
320
+ private readonly attestor;
321
+ /** The newest set seen per agent (see markKey), within this client's life. */
322
+ private readonly marks;
323
+ /** Per agent, the check against the newest set seen and its raise run one at a time. */
324
+ private readonly markTurns;
325
+ constructor(ctx: Ctx, attestor: AttestorClient);
326
+ private markKey;
327
+ /** The newest set this client (or, through credentialMarks, this machine) has seen. */
328
+ private markOf;
329
+ private inTurn;
330
+ private raiseMark;
331
+ /** Why a stored set at `at` is not taken, given the newest seen, or undefined. */
332
+ private staleness;
333
+ /** The EIP-712 digest of a set, as the owner signs it. */
334
+ private setDigest;
335
+ private attestorUrl;
336
+ private domain;
337
+ private ownerHeaders;
338
+ /**
339
+ * The agent's public URL, for the container routes: the deployment row's
340
+ * `url`, else its AgentCard's (without the `/hello` path), as the CLI
341
+ * resolves it. The public row carries only the AgentCard's.
342
+ */
343
+ agentUrl(sealId: Hash): Promise<string>;
344
+ /**
345
+ * Owner-signed read of the stored set (no values). The set is checked to be
346
+ * one this wallet signed, down to each definition and stored value, and no
347
+ * older than the newest this client has seen, since every change signs the
348
+ * other entries again from it; one that is not throws
349
+ * {@link CredentialsUnverifiedError}.
350
+ */
351
+ get(sealId: Hash): Promise<{
352
+ version: number;
353
+ ownerEpoch: number;
354
+ document: CredentialDocument | null;
355
+ definitions: CredentialDefinition[];
356
+ }>;
357
+ /** The definitions of a stored document this wallet signed for this agent, or throws. */
358
+ private verified;
359
+ /**
360
+ * Replace the agent's whole credential set (compare-and-swap on the version
361
+ * {@link get} returned). Entries without `value` keep their stored value.
362
+ * Stores the set at the attestor, then pushes it to the running container;
363
+ * a push failure is returned as a warning (the next boot applies it).
364
+ */
365
+ put(sealId: Hash, entries: CredentialInput[], opts: {
366
+ baseVersion: number;
367
+ agentUrl?: string;
368
+ }): Promise<{
369
+ version: number;
370
+ pushWarning?: string;
371
+ }>;
372
+ /**
373
+ * Remove one entry. The attestor stores the new set, then the container
374
+ * gets it, so the entry stops working at once; pushWarning says why the
375
+ * running container did not take it (it then applies at the next boot).
376
+ * Revoke the key at its provider as well: removing it here does not.
377
+ */
378
+ remove(sealId: Hash, name: string, opts?: {
379
+ agentUrl?: string;
380
+ }): Promise<{
381
+ version: number;
382
+ pushWarning?: string;
383
+ }>;
384
+ /** Turn advance permission to reveal one entry on or off. */
385
+ setAllowReveal(sealId: Hash, name: string, allow: boolean, opts?: {
386
+ agentUrl?: string;
387
+ }): Promise<{
388
+ version: number;
389
+ pushWarning?: string;
390
+ }>;
391
+ /**
392
+ * Set the agent's model key for one provider (the entry `model.<provider>`),
393
+ * then push it to the running agent. The agent's settings choose which
394
+ * provider it uses: a key for that provider takes effect at once (sealed
395
+ * swaps it in, or restarts the framework with it); one for another provider
396
+ * is kept until the settings switch to it. The key is bound to the provider's
397
+ * route in the registry version the attestor serves now, checked against
398
+ * this agent's image first.
399
+ *
400
+ * `value` is the key, or the key sealed for this owner elsewhere
401
+ * ({@link sealModelKey}), stored as it is: the owner signs its ciphertext's
402
+ * hash and never has the key.
403
+ *
404
+ * The owner signs the read of the stored set, the new set and the write:
405
+ * three signatures, and a fourth for the push. `newAgent`: the agent was
406
+ * created a moment ago by this wallet (`AgentApi.deploy`) and has no set
407
+ * yet, so the read is skipped (two signatures); should one be stored by
408
+ * then, the write is refused as a conflict and made again after a read.
409
+ * `sealedTo`: the agentSeal address a key given in clear was sealed to.
410
+ */
411
+ setModelKey(sealId: Hash, provider: string, value: string | SealedModelKey, opts?: {
412
+ agentUrl?: string;
413
+ push?: boolean;
414
+ newAgent?: boolean;
415
+ }): Promise<{
416
+ version: number;
417
+ valueHash: Hash;
418
+ pushWarning?: string;
419
+ sealedTo?: Address;
420
+ }>;
421
+ /**
422
+ * Seal a model key to one agent for its owner, signing nothing: for the
423
+ * integrator whose server holds the key while the owner signs in a browser
424
+ * (issue #166). The server calls this (a read-only client is enough: no
425
+ * wallet) and hands the owner only the result, which the owner stores with
426
+ * {@link setModelKey} or passes to `start` / `reset` / `retry` as
427
+ * `sealedModelKey`. The key never reaches the owner.
428
+ *
429
+ * The value is bound, as every value in the set, to `owner`, the agent, the
430
+ * chain and the entry `model.<provider>`; once the agent is minted, `owner`
431
+ * must be its on-chain owner (a {@link SecretEnvRefusedError} otherwise).
432
+ * LEGACY(model-key): `framework` / `sealedImage` matter only for the
433
+ * request copy older images read (`secretEnv`), and go with it.
434
+ */
435
+ sealModelKey(sealId: Hash, opts: {
436
+ owner: Address;
437
+ apiKey: string;
438
+ provider?: string;
439
+ framework?: string;
440
+ sealedImage?: string;
441
+ }): Promise<SealedModelKey>;
442
+ /** Remove the agent's model key for one provider (see {@link setModelKey}). */
443
+ removeModelKey(sealId: Hash, provider: string, opts?: {
444
+ agentUrl?: string;
445
+ }): Promise<{
446
+ version: number;
447
+ pushWarning?: string;
448
+ }>;
449
+ /**
450
+ * The agent's model keys: the providers its credential set holds a key for,
451
+ * and which key the running agent uses. `inUse` is null when the agent
452
+ * cannot be asked (not running), `unsupported` when its image predates
453
+ * model keys in the set.
454
+ */
455
+ modelKeys(sealId: Hash, opts?: {
456
+ agentUrl?: string;
457
+ }): Promise<ModelKeysView>;
458
+ /**
459
+ * Whether the agent has a model key for `provider`: one in its credential
460
+ * set, or (asked of the running agent; LEGACY(model-key)) the key handed
461
+ * over with the create/reset request being for that provider.
462
+ */
463
+ hasModelKey(sealId: Hash, provider: string, opts?: {
464
+ agentUrl?: string;
465
+ }): Promise<boolean>;
466
+ /**
467
+ * After a boot: when the credential set holds a key for the provider the
468
+ * running agent uses and the agent does not run on it (it booted before the
469
+ * key was stored, or did not get the set at its boot), push the set again.
470
+ */
471
+ resyncModelKey(sealId: Hash, opts?: {
472
+ agentUrl?: string;
473
+ }): Promise<'in_sync' | 'pushed' | 'not_running' | 'unsupported'>;
474
+ /** The agent's agentSeal key values are sealed to, checked as
475
+ * `agentSealPubkey` checks it, with its address. */
476
+ private sealingKey;
477
+ private buildDocument;
478
+ private store;
479
+ /** Owner-signed request to the running container (`/_seal/...`). */
480
+ private sealRequest;
481
+ private push;
482
+ /**
483
+ * Connect a login entry's MCP server: start the owner's OAuth login and
484
+ * return the link the owner opens to consent (valid 10 minutes); the
485
+ * authorization server returns the browser to the agent, which completes
486
+ * the login itself and keeps the tokens.
487
+ */
488
+ connect(sealId: Hash, name: string, opts?: {
489
+ agentUrl?: string;
490
+ }): Promise<{
491
+ authorizeUrl: string;
492
+ }>;
493
+ /**
494
+ * Disconnect a login entry: the running agent asks the authorization
495
+ * server to revoke its tokens (RFC 7009) when the server offers that, and
496
+ * forgets them; then the entry is removed. `revoked` says whether the
497
+ * server confirmed; `note` says why not (no revocation endpoint, the agent
498
+ * not running, …), in which case revoke the app's access at the service.
499
+ */
500
+ disconnect(sealId: Hash, name: string, opts?: {
501
+ agentUrl?: string;
502
+ }): Promise<{
503
+ version: number;
504
+ revoked: boolean;
505
+ forgotten: boolean;
506
+ changed?: boolean;
507
+ note?: string;
508
+ pushWarning?: string;
509
+ }>;
510
+ /**
511
+ * The entries the running agent has loaded (names and where they may go,
512
+ * never values). A login entry is listed with `status: 'awaiting_login'`
513
+ * until its login is done, then with `logged_in_at`.
514
+ */
515
+ loaded(sealId: Hash, opts?: {
516
+ agentUrl?: string;
517
+ }): Promise<LoadedCredentials>;
518
+ /** Requests waiting for the owner on this agent, with sealed's facts and the agent's reason. */
519
+ pending(sealId: Hash, opts?: {
520
+ agentUrl?: string;
521
+ }): Promise<PendingCredentialRequest[]>;
522
+ /** Pending counts across every agent the wallet owns (from the attestor). */
523
+ pendingCounts(): Promise<Array<{
524
+ seal_id: string;
525
+ agent_id: string | null;
526
+ pending: number;
527
+ updated_at: number;
528
+ }>>;
529
+ /** Where the attestor emails this wallet about pending requests, and whether it sends any. */
530
+ notifyAddress(): Promise<{
531
+ email: string | null;
532
+ enabled: boolean;
533
+ }>;
534
+ /** Set (an address) or stop (null) email about pending requests on any agent this wallet owns. */
535
+ setNotifyAddress(email: string | null): Promise<{
536
+ email: string | null;
537
+ enabled: boolean;
538
+ }>;
539
+ /**
540
+ * Approve one pending request once: an EIP-712 Approval bound to this boot,
541
+ * this request id and its digest, valid for `ttlSeconds` (default 1 h, never
542
+ * past the request's own expiry). The agent sends the same request again
543
+ * and gets its answer; the approval is then spent.
544
+ */
545
+ approveOnce(sealId: Hash, authReqId: string, opts?: {
546
+ agentUrl?: string;
547
+ ttlSeconds?: number;
548
+ }): Promise<void>;
549
+ /** Refuse one pending request. */
550
+ deny(sealId: Hash, authReqId: string, opts?: {
551
+ agentUrl?: string;
552
+ }): Promise<void>;
553
+ private decide;
554
+ /**
555
+ * What the agent did with its credentials (never values), oldest first.
556
+ * `after` is Unix seconds. A record with `count` stands for that many
557
+ * successful uses of a value sealed supplies itself (its inference key),
558
+ * from `first` to `ts`.
559
+ */
560
+ audit(sealId: Hash, opts?: {
561
+ after?: number;
562
+ agentUrl?: string;
563
+ }): Promise<Array<{
564
+ ts: string;
565
+ op: string;
566
+ names: string[];
567
+ host?: string;
568
+ method?: string;
569
+ result: string;
570
+ count?: number;
571
+ first?: string;
572
+ }>>;
573
+ }
574
+ //# sourceMappingURL=Credentials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Credentials.d.ts","sourceRoot":"","sources":["../src/Credentials.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAwF,KAAK,OAAO,EAAE,KAAK,IAAI,EAAY,MAAM,MAAM,CAAC;AAC/I,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAIrC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGvD,2EAA2E;AAC3E,eAAO,MAAM,uBAAuB,yBAAyB,CAAC;AAC9D,eAAO,MAAM,0BAA0B,MAAM,CAAC;AAE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