@cef-ai/vault-sdk 4.4.0 → 5.1.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 (64) hide show
  1. package/README.md +35 -19
  2. package/dist/agreements/payload.d.ts +15 -1
  3. package/dist/agreements/payload.d.ts.map +1 -1
  4. package/dist/agreements/payload.js +13 -1
  5. package/dist/agreements/payload.js.map +1 -1
  6. package/dist/agreements/sign.d.ts +16 -3
  7. package/dist/agreements/sign.d.ts.map +1 -1
  8. package/dist/agreements/sign.js +16 -1
  9. package/dist/agreements/sign.js.map +1 -1
  10. package/dist/client.d.ts +54 -52
  11. package/dist/client.d.ts.map +1 -1
  12. package/dist/client.js +95 -98
  13. package/dist/client.js.map +1 -1
  14. package/dist/core/connect-scopes.d.ts +18 -0
  15. package/dist/core/connect-scopes.d.ts.map +1 -0
  16. package/dist/core/connect-scopes.js +72 -0
  17. package/dist/core/connect-scopes.js.map +1 -0
  18. package/dist/core/endpoints.d.ts +22 -1
  19. package/dist/core/endpoints.d.ts.map +1 -1
  20. package/dist/core/endpoints.js +22 -1
  21. package/dist/core/endpoints.js.map +1 -1
  22. package/dist/core/errors.d.ts +13 -1
  23. package/dist/core/errors.d.ts.map +1 -1
  24. package/dist/core/errors.js +14 -2
  25. package/dist/core/errors.js.map +1 -1
  26. package/dist/core/types.d.ts +70 -3
  27. package/dist/core/types.d.ts.map +1 -1
  28. package/dist/fluent/agent-connection.d.ts +16 -1
  29. package/dist/fluent/agent-connection.d.ts.map +1 -1
  30. package/dist/fluent/agent-connection.js +20 -0
  31. package/dist/fluent/agent-connection.js.map +1 -1
  32. package/dist/fluent/service.d.ts +34 -0
  33. package/dist/fluent/service.d.ts.map +1 -0
  34. package/dist/fluent/service.js +41 -0
  35. package/dist/fluent/service.js.map +1 -0
  36. package/dist/fluent/vault.d.ts +57 -8
  37. package/dist/fluent/vault.d.ts.map +1 -1
  38. package/dist/fluent/vault.js +60 -6
  39. package/dist/fluent/vault.js.map +1 -1
  40. package/dist/index.d.ts +2 -3
  41. package/dist/index.d.ts.map +1 -1
  42. package/dist/index.js +7 -10
  43. package/dist/index.js.map +1 -1
  44. package/dist/internal/agents.d.ts +54 -7
  45. package/dist/internal/agents.d.ts.map +1 -1
  46. package/dist/internal/agents.js +110 -8
  47. package/dist/internal/agents.js.map +1 -1
  48. package/dist/internal/cubbies.d.ts +33 -0
  49. package/dist/internal/cubbies.d.ts.map +1 -1
  50. package/dist/internal/cubbies.js +39 -0
  51. package/dist/internal/cubbies.js.map +1 -1
  52. package/dist/internal/memory.d.ts +79 -5
  53. package/dist/internal/memory.d.ts.map +1 -1
  54. package/dist/internal/memory.js +53 -9
  55. package/dist/internal/memory.js.map +1 -1
  56. package/dist/internal/vaults.d.ts +8 -5
  57. package/dist/internal/vaults.d.ts.map +1 -1
  58. package/dist/internal/vaults.js +0 -10
  59. package/dist/internal/vaults.js.map +1 -1
  60. package/package.json +2 -2
  61. package/dist/internal/gateway-info.d.ts +0 -16
  62. package/dist/internal/gateway-info.d.ts.map +0 -1
  63. package/dist/internal/gateway-info.js +0 -34
  64. package/dist/internal/gateway-info.js.map +0 -1
package/README.md CHANGED
@@ -20,6 +20,7 @@ import { VaultSDK, type EnsureProgressEvent } from "@cef-ai/vault-sdk";
20
20
  const sdk = new VaultSDK({
21
21
  endpoint: "https://vault.cere.io",
22
22
  garEndpoint: "https://gar.cere.io",
23
+ chainUrl: "wss://rpc.cere.network", // the vault-delegate grant step
23
24
  s3GatewayAuthInfoUrl: "https://ddc-s3-gateway.compute.dev.ddcdragon.com/auth/info",
24
25
  // Override to point at the prod marketplace; defaults to the dev cluster URL.
25
26
  marketplaceEndpoint: "https://agent-marketplace.compute.dev.ddcdragon.com",
@@ -46,6 +47,7 @@ const signer = await CereWallet.fromMnemonic(process.env.WALLET_MNEMONIC!);
46
47
  const sdk = new VaultSDK({
47
48
  endpoint: "https://vault.cere.io",
48
49
  garEndpoint: "https://gar.cere.io",
50
+ chainUrl: "wss://rpc.devnet.cere.network/ws",
49
51
  s3GatewayAuthInfoUrl: "https://ddc-s3-gateway.compute.dev.ddcdragon.com/auth/info",
50
52
  signer,
51
53
  });
@@ -54,9 +56,11 @@ const vault = await sdk.vault.ensure({ onboard: false });
54
56
 
55
57
  ## Onboarding
56
58
 
57
- `vault-sdk` is web3-free (ADR-033): it never talks to a chain and never
58
- depends on `@cere-ddc-sdk/*`. `vault.ensure()` still runs a lightweight,
59
- HTTP-only onboarding **status check** by default:
59
+ `vault-sdk` depends on no `@cere-ddc-sdk/*` package and stays chain-free at
60
+ module load — the chain stack (`@cef-ai/account` → `@cef-ai/chain`) is
61
+ loaded lazily, only when `vault.ensure()` actually runs the vault-delegate
62
+ grant step. `vault.ensure()` also runs a lightweight, HTTP-only onboarding
63
+ **status check** by default:
60
64
 
61
65
  1. **Status check** — `GET /auth/onboarding/status` (404 means prod, skip
62
66
  the rest of this section entirely).
@@ -90,7 +94,7 @@ const vault = await sdk.vault.ensure({ onProgress: (e) => console.log(e.kind) })
90
94
  | `inspecting-wallet` | Gateway status probe is in flight. |
91
95
  | `funding-wallet` | Devnet auto-fund (CERE drip + DDC seed deposit); never fires on prod. |
92
96
  | `gateway-authorization-required` | Onboarding required; carries `status: OnboardingStatus`. `ensure()` throws `OnboardingRequiredError` right after this fires. |
93
- | `signing-delegation` | Building the DDC delegation token natively via `@cef-ai/account`'s `buildDelegationToken`. |
97
+ | `authorizing-vault` | Granting vault-api write delegation: `ensureVaultDelegate` checks/submits the on-chain `NonTransfer` proxy. Only fires on the default (tokenless) path. |
94
98
  | `provisioning-vault` | Calling `POST /api/v1/vaults` to claim the record. |
95
99
 
96
100
  One error can surface from the pipeline:
@@ -100,11 +104,22 @@ One error can surface from the pipeline:
100
104
  `false`). Run `@cef-ai/account`'s `provisioning.ensure` externally, then
101
105
  retry `ensure()`.
102
106
 
103
- There are no more optional `@cere-ddc-sdk/*` dependencies. The DDC
104
- delegation token is minted natively via `@cef-ai/account`'s
105
- `buildDelegationToken` — no `@cere-ddc-sdk/ddc-client` install required —
106
- and on-chain proxy submission lives entirely in `@cef-ai/account`'s
107
- `provisioning.ensure`, not in this SDK.
107
+ ## Write delegation (the claim's authorization)
108
+
109
+ By default `vault.ensure()` claims the vault **tokenless**: after the
110
+ onboarding check it grants vault-api's delegate key an on-chain
111
+ `NonTransfer` proxy (`@cef-ai/account`'s `ensureVaultDelegate`, which
112
+ discovers the key from `GET {endpoint}/api/v1/delegate-info` and skips
113
+ submission when the grant already exists), then POSTs
114
+ `{name, label: "vault"}` — vault-api routes that shape through its proxy
115
+ saga. This needs a `signer` and a `chainUrl` (constructor or per call);
116
+ without a `chainUrl` the wallet path fails with a config error.
117
+
118
+ `opts.delegationToken` is the legacy escape hatch: when passed, the grant
119
+ step is skipped entirely and the token-bearing claim body of the old flow
120
+ is sent instead (vault-api accepts both shapes). Nothing in this SDK mints
121
+ DDC delegation tokens any more — the `@cef-ai/account` native builder was
122
+ removed with the migration; token-holding callers bring their own.
108
123
 
109
124
  ## Connecting an agent
110
125
 
@@ -141,12 +156,13 @@ exported from `@cef-ai/vault-sdk/internal`.
141
156
 
142
157
  | Method | Maps to |
143
158
  | --- | --- |
144
- | `sdk.vault.ensure({ onboard?, onProgress?, delegationToken? })` | runs the onboarding pipeline + `POST /api/v1/vaults` |
145
- | `sdk.vault.current()` / `.rotateCredentials()` | `GET` / `PUT /api/v1/vaults[/credentials]` |
159
+ | `sdk.vault.ensure({ onboard?, onProgress?, chainUrl?, delegationToken? })` | onboarding check + on-chain vault-delegate grant + `POST /api/v1/vaults` (tokenless by default) |
160
+ | `sdk.vault.current()` | `GET /api/v1/vaults` |
146
161
  | `vault.scopes.{list,get,create,update,delete}` | `/api/v1/vaults/:v/scopes` |
147
162
  | `vault.agents.connect({ agentId, scope, settings })` (signs GAR internally) | `POST {garEndpoint}/api/v1/agreements` + `POST /api/v1/vaults/:v/agents` |
148
163
  | `vault.agents.{list,get}` → `AgentConnectionHandle` | `/api/v1/vaults/:v/agents` |
149
164
  | `handle.update(settings)` / `handle.disconnect()` | `PATCH` / `DELETE` |
165
+ | `handle.setCeiling({ gpuUnits?, a2aTokens? })` — spend ceiling; `gpuUnits` = platform-metered, `a2aTokens` = agent self-reported (integer); absent/0 = no ceiling, `{}` clears both; read back as `handle.ceiling` (absent = none) | `PUT /agents/:a/ceiling` |
150
166
  | `handle.cubby(alias).query(...)` / `.exec(...)` | `/scopes/:s/cubbies/:alias/{query,exec}` |
151
167
  | `handle.jobs.list({ state?, cursor?, limit? })` | `/agents/:a/jobs` |
152
168
  | `vault.scope(s).publish(input)` | `POST /scopes/:s/events` |
@@ -164,10 +180,10 @@ exported from `@cef-ai/vault-sdk/internal`.
164
180
  | Field | Description |
165
181
  | --- | --- |
166
182
  | `endpoint: string` | Base URL for the vault API (wallet-authenticated). |
183
+ | `chainUrl?: string` | Cere node WS URL. Required on `vault.ensure()`'s wallet path (signer + no `delegationToken`): drives the on-chain vault-delegate grant. Also settable per call. |
167
184
  | `garEndpoint?: string` | Base URL for the Global Agent Registry. Required for `vault.agents.connect`. |
168
185
  | `marketplaceEndpoint?: string` | Base URL for the agent marketplace API (separate host from the vault API; reads are unauthenticated). Default: dev cluster URL (`https://agent-marketplace.compute.dev.ddcdragon.com`). |
169
- | `s3GatewayAuthInfoUrl?: string` | Gateway `/auth/info` URL used to fetch the gateway pubkey when `s3GatewayPubkey` is not set. Default: dev cluster gateway. |
170
- | `s3GatewayPubkey?: string` | Static gateway pubkey; skips the `/auth/info` round-trip during `vault.ensure()`. |
186
+ | `s3GatewayAuthInfoUrl?: string` | Gateway `/auth/info` URL; its dirname is the gateway base the onboarding pipeline talks to. Default: dev cluster gateway. |
171
187
  | `signer?: Signer` / `auth?: AuthProvider` | Authenticated calls. Mutually exclusive — `auth` overrides `signer`. `Signer` is `@cef-ai/signer`'s canonical interface. |
172
188
  | `fetch?: typeof fetch` | Inject a custom fetch for tests / non-browser runtimes. |
173
189
  | `timeoutMs?: number` | Per-request timeout (default 30 s). |
@@ -221,12 +237,12 @@ Browser-extension and CereWalletNative adapters live in their own packages.
221
237
  `VaultHttpClient` and `endpoints`.
222
238
 
223
239
  Onboarding primitives (`runOnboarding`, `pollUntilProxyReady`,
224
- `getOnboardingStatus`, `runBootstrap`, `signerToOnboardingSigner`) and
225
- `getGatewayInfo` live under their respective files in `src/internal/` for
226
- advanced consumers that need to drive the HTTP-only status/bootstrap
227
- pipeline piecewise. Use them only when the fluent surface isn't enough.
228
- On-chain proxy registration is not part of this SDK at all — see
229
- `@cef-ai/account`'s `provisioning.ensure`.
240
+ `getOnboardingStatus`, `runBootstrap`, `signerToOnboardingSigner`) live
241
+ under their respective files in `src/internal/` for advanced consumers that
242
+ need to drive the HTTP-only status/bootstrap pipeline piecewise. Use them
243
+ only when the fluent surface isn't enough. On-chain proxy registration is
244
+ not part of this SDK at all — see `@cef-ai/account`'s `provisioning.ensure`
245
+ (gateway proxy) and `ensureVaultDelegate` (vault-api write delegate).
230
246
 
231
247
  ## Spec
232
248
 
@@ -28,7 +28,21 @@ export interface BuildVaultAgreementPayloadOptions {
28
28
  /** Agent service pubkey from the manifest — same handling as `userPubKey`. */
29
29
  asPubKey: string;
30
30
  agentId: string;
31
- scope: string;
31
+ /**
32
+ * The full set of vault scopes this agreement grants — GAR's
33
+ * `Metadata.Scopes` is a list, not a single value. ONE agreement is
34
+ * signed per (agent service, user) regardless of how many scopes are
35
+ * named here: the vault-api's admission check
36
+ * (`Agreement.CheckScopeGrant` in the vault repo) keys consent on
37
+ * (asPubKey, userPubKey) only and explicitly discards its `scope`
38
+ * parameter — it does not gate per scope. This list is still the honest,
39
+ * durable record of what the user actually consented to, which is why it
40
+ * carries the whole set rather than one representative entry. A
41
+ * single-scope caller (`signAndSubmitAgreement`'s singular `scope` input)
42
+ * passes a one-element array here, so the wire payload for a single-scope
43
+ * connect is unchanged from before this field existed.
44
+ */
45
+ scopes: string[];
32
46
  /** Injectable clock for deterministic tests. Defaults to `nowRFC3339`. */
33
47
  createdAt?: () => string;
34
48
  }
@@ -1 +1 @@
1
- {"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../src/agreements/payload.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,IAAI,CAAC;IACd,qBAAqB,EAAE,MAAM,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,KAAK,CAAC;IACf,UAAU,EAAE,IAAI,CAAC;IACjB,QAAQ,EAAE;QAAE,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iCAAiC;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,gCAAgC;IAC/C,OAAO,EAAE,uBAAuB,CAAC;IACjC,4EAA4E;IAC5E,KAAK,EAAE,UAAU,CAAC;CACnB;AAID,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,iCAAiC,GACtC,gCAAgC,CAelC"}
1
+ {"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../src/agreements/payload.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,IAAI,CAAC;IACd,qBAAqB,EAAE,MAAM,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,KAAK,CAAC;IACf,UAAU,EAAE,IAAI,CAAC;IACjB,QAAQ,EAAE;QAAE,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iCAAiC;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;;;;;;;;;OAaG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,gCAAgC;IAC/C,OAAO,EAAE,uBAAuB,CAAC;IACjC,4EAA4E;IAC5E,KAAK,EAAE,UAAU,CAAC;CACnB;AAID,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,iCAAiC,GACtC,gCAAgC,CA6BlC"}
@@ -2,6 +2,18 @@
2
2
  import { nowRFC3339, stripHexPrefix } from "../core/canonical.js";
3
3
  const enc = new TextEncoder();
4
4
  export function buildVaultAgreementPayloadV2(opts) {
5
+ // `scopes` is typed as required, but an untyped JS caller can still pass
6
+ // `undefined` or `[]` — without this check that silently stringifies to
7
+ // `metadata: {}` and submits an agreement recording no scope at all.
8
+ if (!opts.scopes || opts.scopes.length === 0) {
9
+ throw new Error("buildVaultAgreementPayloadV2: `scopes` must be a non-empty array — " +
10
+ "an agreement must record at least one scope");
11
+ }
12
+ // Dedupe while preserving first-seen order: the vault-api dedupes the
13
+ // connection itself, so a duplicated `scopes` input would otherwise
14
+ // produce a consent record on GAR that disagrees with the row it consents
15
+ // to. `Set` preserves insertion order for strings.
16
+ const scopes = Array.from(new Set(opts.scopes));
5
17
  const clock = opts.createdAt ?? nowRFC3339;
6
18
  // Insertion order matters — see VaultAgreementPayloadV2 doc comment.
7
19
  const payload = {
@@ -12,7 +24,7 @@ export function buildVaultAgreementPayloadV2(opts) {
12
24
  user_pub_key: stripHexPrefix(opts.userPubKey),
13
25
  revoked: false,
14
26
  expires_at: null,
15
- metadata: { scopes: [opts.scope] },
27
+ metadata: { scopes },
16
28
  created_at: clock(),
17
29
  };
18
30
  return { payload, bytes: enc.encode(JSON.stringify(payload)) };
@@ -1 +1 @@
1
- {"version":3,"file":"payload.js","sourceRoot":"","sources":["../../src/agreements/payload.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAC5B,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AA0ClE,MAAM,GAAG,GAAG,IAAI,WAAW,EAAE,CAAC;AAE9B,MAAM,UAAU,4BAA4B,CAC1C,IAAuC;IAEvC,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,IAAI,UAAU,CAAC;IAC3C,qEAAqE;IACrE,MAAM,OAAO,GAA4B;QACvC,OAAO,EAAE,IAAI;QACb,qBAAqB,EAAE,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC;QACpD,QAAQ,EAAE,IAAI,CAAC,OAAO;QACtB,QAAQ,EAAE,IAAI,CAAC,OAAO;QACtB,YAAY,EAAE,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC;QAC7C,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,EAAE,MAAM,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;QAClC,UAAU,EAAE,KAAK,EAAE;KACpB,CAAC;IACF,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;AACjE,CAAC"}
1
+ {"version":3,"file":"payload.js","sourceRoot":"","sources":["../../src/agreements/payload.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAC5B,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAwDlE,MAAM,GAAG,GAAG,IAAI,WAAW,EAAE,CAAC;AAE9B,MAAM,UAAU,4BAA4B,CAC1C,IAAuC;IAEvC,yEAAyE;IACzE,wEAAwE;IACxE,qEAAqE;IACrE,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7C,MAAM,IAAI,KAAK,CACb,qEAAqE;YACnE,6CAA6C,CAChD,CAAC;IACJ,CAAC;IACD,sEAAsE;IACtE,oEAAoE;IACpE,0EAA0E;IAC1E,mDAAmD;IACnD,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAChD,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,IAAI,UAAU,CAAC;IAC3C,qEAAqE;IACrE,MAAM,OAAO,GAA4B;QACvC,OAAO,EAAE,IAAI;QACb,qBAAqB,EAAE,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC;QACpD,QAAQ,EAAE,IAAI,CAAC,OAAO;QACtB,QAAQ,EAAE,IAAI,CAAC,OAAO;QACtB,YAAY,EAAE,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC;QAC7C,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,EAAE,MAAM,EAAE;QACpB,UAAU,EAAE,KAAK,EAAE;KACpB,CAAC;IACF,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;AACjE,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import type { Signer } from "@cef-ai/signer";
2
2
  import type { GarClient } from "./gar-client.js";
3
- export interface SignAndSubmitAgreementOptions {
3
+ import type { ScopeSelector } from "../core/types.js";
4
+ export type SignAndSubmitAgreementOptions = ScopeSelector & {
4
5
  /** Signer — must implement `sign(bytes, intent?)`. */
5
6
  signer: Signer;
6
7
  /** Vault to bind the agreement to. */
@@ -17,11 +18,10 @@ export interface SignAndSubmitAgreementOptions {
17
18
  agentId: string;
18
19
  agentServicePubkey: string;
19
20
  };
20
- scope: string;
21
21
  gar: GarClient;
22
22
  /** Injectable clock for deterministic tests. */
23
23
  clock?: () => string;
24
- }
24
+ };
25
25
  export interface SignAndSubmitAgreementResult {
26
26
  /**
27
27
  * Bare hex (no `0x` prefix) of the 64-byte ed25519 signature. PR #19 of the
@@ -33,6 +33,19 @@ export interface SignAndSubmitAgreementResult {
33
33
  * High-level orchestrator: build a v2 agreement payload, sign the JSON bytes
34
34
  * with the user's signer, POST the signed envelope to GAR, and return the
35
35
  * bare-hex signature for the vault-api `agents.connect` body.
36
+ *
37
+ * ONE agreement is signed and submitted per call, regardless of how many
38
+ * scopes are named — its `metadata.scopes` carries the whole set. This is
39
+ * not a simplification of "N agreements, one per scope": the vault-api's
40
+ * admission check (`Agreement.CheckScopeGrant` in the vault repo) keys
41
+ * consent on (agent-service pubkey, user pubkey) only and explicitly
42
+ * discards the scope it's passed, so N agreements for the same (AS, user)
43
+ * pair would just be the same check answered N times — no additional
44
+ * enforcement, N wallet ceremonies, and N POSTs to the same GAR key (whose
45
+ * update-vs-duplicate semantics are undetermined; see the vault-sdk
46
+ * changeset/report for what was and wasn't verified). A single-scope caller
47
+ * (`scope` rather than `scopes`) gets a one-element list — same wire
48
+ * payload as before `scopes` existed.
36
49
  */
37
50
  export declare function signAndSubmitAgreement(opts: SignAndSubmitAgreementOptions): Promise<SignAndSubmitAgreementResult>;
38
51
  //# sourceMappingURL=sign.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sign.d.ts","sourceRoot":"","sources":["../../src/agreements/sign.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAG7C,OAAO,KAAK,EAAE,SAAS,EAA2B,MAAM,iBAAiB,CAAC;AAE1E,MAAM,WAAW,6BAA6B;IAC5C,s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C3C;;;OAGG;IACH,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,6BAA6B,GAClC,OAAO,CAAC,4BAA4B,CAAC,CAoCvC"}
@@ -2,10 +2,24 @@
2
2
  import { bytesToHex, encodeBase64Url, ensure0xHex, strip0xHex, } from "../core/canonical.js";
3
3
  import { VaultSignerRequiredError } from "../core/errors.js";
4
4
  import { buildVaultAgreementPayloadV2 } from "./payload.js";
5
+ import { resolveConnectScopes } from "../core/connect-scopes.js";
5
6
  /**
6
7
  * High-level orchestrator: build a v2 agreement payload, sign the JSON bytes
7
8
  * with the user's signer, POST the signed envelope to GAR, and return the
8
9
  * bare-hex signature for the vault-api `agents.connect` body.
10
+ *
11
+ * ONE agreement is signed and submitted per call, regardless of how many
12
+ * scopes are named — its `metadata.scopes` carries the whole set. This is
13
+ * not a simplification of "N agreements, one per scope": the vault-api's
14
+ * admission check (`Agreement.CheckScopeGrant` in the vault repo) keys
15
+ * consent on (agent-service pubkey, user pubkey) only and explicitly
16
+ * discards the scope it's passed, so N agreements for the same (AS, user)
17
+ * pair would just be the same check answered N times — no additional
18
+ * enforcement, N wallet ceremonies, and N POSTs to the same GAR key (whose
19
+ * update-vs-duplicate semantics are undetermined; see the vault-sdk
20
+ * changeset/report for what was and wasn't verified). A single-scope caller
21
+ * (`scope` rather than `scopes`) gets a one-element list — same wire
22
+ * payload as before `scopes` existed.
9
23
  */
10
24
  export async function signAndSubmitAgreement(opts) {
11
25
  if (typeof opts.signer?.sign !== "function") {
@@ -15,12 +29,13 @@ export async function signAndSubmitAgreement(opts) {
15
29
  if (!agentServicePubkey) {
16
30
  throw new Error("signAndSubmitAgreement: `agent.agentServicePubkey` is required");
17
31
  }
32
+ const scopes = resolveConnectScopes(opts, "signAndSubmitAgreement");
18
33
  const { bytes } = buildVaultAgreementPayloadV2({
19
34
  vaultId: opts.vault.id,
20
35
  userPubKey: opts.vault.userPubKey,
21
36
  asPubKey: agentServicePubkey,
22
37
  agentId,
23
- scope: opts.scope,
38
+ scopes,
24
39
  createdAt: opts.clock,
25
40
  });
26
41
  const sigBytes = await opts.signer.sign(bytes, "data");
@@ -1 +1 @@
1
- {"version":3,"file":"sign.js","sourceRoot":"","sources":["../../src/agreements/sign.ts"],"names":[],"mappings":"AAAA,yBAAyB;AACzB,OAAO,EACL,UAAU,EACV,eAAe,EACf,WAAW,EACX,UAAU,GACX,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,4BAA4B,EAAE,MAAM,cAAc,CAAC;AA4B5D;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,IAAmC;IAEnC,IAAI,OAAO,IAAI,CAAC,MAAM,EAAE,IAAI,KAAK,UAAU,EAAE,CAAC;QAC5C,MAAM,IAAI,wBAAwB,EAAE,CAAC;IACvC,CAAC;IACD,MAAM,EAAE,OAAO,EAAE,kBAAkB,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;IACnD,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CACb,gEAAgE,CACjE,CAAC;IACJ,CAAC;IAED,MAAM,EAAE,KAAK,EAAE,GAAG,4BAA4B,CAAC;QAC7C,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE;QACtB,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU;QACjC,QAAQ,EAAE,kBAAkB;QAC5B,OAAO;QACP,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,SAAS,EAAE,IAAI,CAAC,KAAK;KACtB,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvD,MAAM,UAAU,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;IAExC,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E,IAAI,CAAC,KAAK,CAAC,EAAE;QACtB,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU;QACjC,QAAQ,EAAE,kBAAkB;QAC5B,OAAO;QACP,MAAM;QACN,SAAS,EAAE,IAAI,CAAC,KAAK;KACtB,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvD,MAAM,UAAU,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;IAExC,MAAM,QAAQ,GAA4B;QACxC,OAAO,EAAE,eAAe,CAAC,KAAK,CAAC;QAC/B,SAAS,EAAE;YACT,SAAS,EAAE,SAAS;YACpB,MAAM,EAAE,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC;YAC1C,KAAK,EAAE,WAAW,CAAC,UAAU,CAAC;SAC/B;KACF,CAAC;IAEF,MAAM,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAEvC,OAAO,EAAE,kBAAkB,EAAE,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;AACxD,CAAC"}
package/dist/client.d.ts CHANGED
@@ -7,6 +7,15 @@ import type { AuthProvider } from "./auth/provider.js";
7
7
  import type { Signer } from "@cef-ai/signer";
8
8
  export interface VaultSDKConfig {
9
9
  endpoint: string;
10
+ /**
11
+ * Cere node WS URL. Required on `vault.ensure()`'s wallet path (a signer
12
+ * and no `delegationToken`): the SDK grants vault-api durable write
13
+ * delegation by submitting an on-chain `NonTransfer` proxy via
14
+ * `@cef-ai/account`'s `ensureVaultDelegate` before claiming the vault.
15
+ * Absence there is a config error. Not needed when a `delegationToken` is
16
+ * passed (the legacy escape hatch skips the grant).
17
+ */
18
+ chainUrl?: string;
10
19
  /**
11
20
  * Base URL for the agent marketplace API. The marketplace is a separate
12
21
  * service from the vault API and is accessed unauthenticated — the SDK
@@ -31,26 +40,32 @@ export interface VaultSDKConfig {
31
40
  fetch?: typeof fetch;
32
41
  timeoutMs?: number;
33
42
  /**
34
- * S3 Gateway ed25519 pubkey (`0x`-hex or bare hex). When set, the SDK can
35
- * build a delegation token internally on `vault.ensure()` if none is passed.
36
- * Skip the round-trip when you know the gateway identity ahead of time.
37
- */
38
- s3GatewayPubkey?: string;
39
- /**
40
- * Fallback URL used to fetch the gateway pubkey when `s3GatewayPubkey` is
41
- * not set. Defaults to the dev gateway. Override for prod.
43
+ * Gateway `/auth/info` URL. Its DIRNAME (the URL minus `/auth/info`) is the
44
+ * gateway base the HTTP-only onboarding pipeline talks to
45
+ * (`/auth/onboarding/status` + `/auth/onboarding/bootstrap`). Defaults to
46
+ * the dev gateway. Override for prod. (The pubkey-fetch role is gone — the
47
+ * SDK no longer mints delegation tokens.)
42
48
  */
43
49
  s3GatewayAuthInfoUrl?: string;
44
50
  }
45
51
  export interface EnsureVaultOptions {
46
52
  name?: string;
47
53
  /**
48
- * Pre-built DDC delegation token. Optional: if omitted, the SDK builds one
49
- * internally using the configured `wallet` and either `s3GatewayPubkey`
50
- * (static) or `s3GatewayAuthInfoUrl` (fetched), via `@cef-ai/account`'s
51
- * native `buildDelegationToken` — no `@cere-ddc-sdk` dependency required.
54
+ * Pre-built DDC delegation token — the LEGACY escape hatch. When provided,
55
+ * `ensure()` skips the on-chain vault-delegate grant entirely and sends the
56
+ * token-bearing claim body the old flow sent (vault-api accepts both
57
+ * shapes). When omitted (the default), `ensure()` grants vault-api an
58
+ * on-chain `NonTransfer` proxy via `ensureVaultDelegate` — which needs
59
+ * `chainUrl` (config or per-call) and a `signer` — and then claims the
60
+ * vault TOKENLESS (`{name, label: "vault"}`).
52
61
  */
53
62
  delegationToken?: string;
63
+ /**
64
+ * Per-call Cere node WS URL for the vault-delegate grant step. Overrides
65
+ * `VaultSDKConfig.chainUrl`. Only consulted on the wallet path (no
66
+ * `delegationToken`).
67
+ */
68
+ chainUrl?: string;
54
69
  /**
55
70
  * Run the DDC onboarding status/bootstrap check (HTTP-only: gateway
56
71
  * `/auth/onboarding/status` + `/auth/onboarding/bootstrap`) before
@@ -64,6 +79,13 @@ export interface EnsureVaultOptions {
64
79
  onboard?: boolean;
65
80
  /** Progress hook for UIs that want to drive a stepper / spinner. */
66
81
  onProgress?: (e: EnsureProgressEvent) => void;
82
+ /**
83
+ * Test seam for the claim retry loop's backoff (2s then 5s between the
84
+ * up-to-3 claim attempts). Defaults to a real `setTimeout` sleep; tests
85
+ * inject a recorder so "the backoff actually happened" is assertable
86
+ * without wall-clock waits.
87
+ */
88
+ sleep?: (ms: number) => Promise<void>;
67
89
  }
68
90
  /**
69
91
  * Progress signal emitted by `vault.ensure()` so UIs can render a
@@ -74,6 +96,8 @@ export interface EnsureVaultOptions {
74
96
  * `provisioning.ensure`, so the intermediate chain-submission stages
75
97
  * (`authorizing-gateway` / `authorization-submitted` /
76
98
  * `awaiting-chain-confirmation` / `gateway-authorized`) no longer exist.
99
+ * `authorizing-vault` fires on the default (tokenless) path only — the
100
+ * `delegationToken` escape hatch skips the grant step and its event.
77
101
  */
78
102
  export type EnsureProgressEvent = {
79
103
  kind: "inspecting-wallet";
@@ -83,21 +107,20 @@ export type EnsureProgressEvent = {
83
107
  kind: "gateway-authorization-required";
84
108
  status: OnboardingStatus;
85
109
  } | {
86
- kind: "signing-delegation";
110
+ kind: "authorizing-vault";
87
111
  } | {
88
112
  kind: "provisioning-vault";
89
113
  };
90
114
  export declare class VaultSDK {
91
115
  private readonly http;
92
116
  private readonly marketplaceHttp;
117
+ private readonly endpoint;
118
+ private readonly chainUrl?;
93
119
  private readonly vaults;
94
- private readonly vaultInfo;
95
120
  private readonly gar?;
96
121
  private readonly signer?;
97
- private readonly s3GatewayPubkey?;
98
122
  private readonly s3GatewayAuthInfoUrl;
99
123
  private readonly fetchFn;
100
- private cachedGatewayPubkey?;
101
124
  readonly marketplace: Marketplace;
102
125
  readonly health: Health;
103
126
  /**
@@ -107,11 +130,6 @@ export declare class VaultSDK {
107
130
  */
108
131
  readonly memberships: Memberships;
109
132
  constructor(config: VaultSDKConfig);
110
- /**
111
- * Resolves the gateway pubkey: prefers the static config, falls back to
112
- * `/auth/info` (cached for the SDK's lifetime).
113
- */
114
- private resolveGatewayPubkey;
115
133
  /**
116
134
  * Strip `/auth/info` (and any trailing slash) off the configured auth-info
117
135
  * URL to reach the gateway base — the prefix the onboarding endpoints sit
@@ -119,6 +137,21 @@ export declare class VaultSDK {
119
137
  * a config-shape concern.
120
138
  */
121
139
  private gatewayBaseUrl;
140
+ /**
141
+ * The claim POST of `vault.ensure()`, with the bounded retry the 425
142
+ * contract implies. The SAME `ClaimVaultRequest` is re-sent on every
143
+ * attempt (the auth layer re-signs it each time, so with the default
144
+ * clock each retry carries a fresh timestamp; the claim itself stays
145
+ * idempotent server-side — a claim for a wallet that already owns a
146
+ * vault resolves to that vault). Bounded: `CLAIM_MAX_ATTEMPTS` POSTs
147
+ * total, backoff per `CLAIM_BACKOFF_MS` via the injectable `sleep`.
148
+ *
149
+ * Non-retryable failures — and exhaustion — re-throw the LAST error
150
+ * unchanged: the server's own `VaultRequestError`, never a retry wrapper.
151
+ * No progress events fire between attempts; the caller already saw
152
+ * `provisioning-vault` once and a stepper must not replay it.
153
+ */
154
+ private claimVaultWithRetry;
122
155
  vault: {
123
156
  ensure: (opts?: EnsureVaultOptions) => Promise<Vault>;
124
157
  current: () => Promise<Vault>;
@@ -148,37 +181,6 @@ export declare class VaultSDK {
148
181
  * `@cef-ai/vault-sdk/internal` for the raw absent-vs-empty distinction.
149
182
  */
150
183
  rename: (vaultId: string, displayName: string) => Promise<Vault>;
151
- /**
152
- * Rotate the SigV4 delegation credential.
153
- *
154
- * FOLLOW-UP (multi-credential gateway): the gateway's `PUT
155
- * /auth/credentials` never returns a secret, so this path cannot yield
156
- * fresh S3 credentials against the real gateway today. vault-api is being
157
- * redesigned in a parallel PR to rotate via register-new + revoke-old;
158
- * this method's semantics will change with it. Left untouched here on
159
- * purpose — do not rework or build on it until that lands.
160
- */
161
- rotateCredentials: (vaultId: string, delegationToken: string) => Promise<Vault>;
162
- delegate: {
163
- /** vault-api's delegate signing pubkey (T_v subject). */
164
- pubkey: () => Promise<string>;
165
- /**
166
- * Grant vault-api autonomous S3-credential refresh for `bucketId`:
167
- * owner signs T_v (subject = delegate pubkey) and registers it with the
168
- * gateway. The SDK resolves vault-api's delegate pubkey itself (via
169
- * `VaultInfo.delegate()`) unless the caller already knows it and passes
170
- * `delegatePubkey` to skip the round-trip.
171
- */
172
- grant: (opts: {
173
- bucketId: bigint;
174
- delegatePubkey?: string;
175
- }) => Promise<void>;
176
- /** Revoke that grant. */
177
- revoke: (opts: {
178
- bucketId: bigint;
179
- delegatePubkey?: string;
180
- }) => Promise<void>;
181
- };
182
184
  };
183
185
  }
184
186
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAgB1C,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAS7C,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sDAAsD;IACtD,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB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