@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/dist/index.js CHANGED
@@ -5,6 +5,7 @@ export { VaultSDK } from "./client.js";
5
5
  export { OnboardingRequiredError, OnboardingTimeoutError, } from "./internal/onboarding.js";
6
6
  export { Vault } from "./fluent/vault.js";
7
7
  export { ScopeHandle } from "./fluent/scope.js";
8
+ export { ServiceHandle } from "./fluent/service.js";
8
9
  export { AgentConnectionHandle } from "./fluent/agent-connection.js";
9
10
  export { JobHandle } from "./fluent/job.js";
10
11
  export { CubbyHandle } from "./fluent/cubby.js";
@@ -20,15 +21,11 @@ export { VaultRequestError, VaultNotImplementedError, VaultSignerRequiredError,
20
21
  // `SignedGrant.role`/`.scopes` instead and end up with a signature it checked
21
22
  // and did not act on.
22
23
  export { GRANT_ISSUED_AT_HEADER, GRANT_SCHEMA, GRANT_SCHEMA_V2, GRANT_SIGNATURE_HEADER, GrantVerificationError, NO_GRANT_EXPIRY, NO_PRIVACY_CEILING, PRIVACY_CEILINGS, canonicalGrantBytes, canonicalGrantBytesWithCeiling, canonicalPubkeyHex, decodeGrantDoc, grantExpiry, isValidPrivacyCeiling, privacyCeiling, vaultIdFor, verifyGrant, verifyGrantSig, verifySignedRoster, } from "./core/grant-doc.js";
23
- // Delegate-grant surface — `vault.delegate.{pubkey,grant,revoke}` (see
24
- // `client.ts`) covers the common connect-time flow, but the frontend also
25
- // needs direct access to `VaultInfo`'s `DelegateInfo` type (Task 3 left
26
- // `VaultInfo` itself importable only via `@cef-ai/vault-sdk/internal`) and to
27
- // `registerDelegate`/`revokeDelegate` for lower-level or custom flows (e.g.
28
- // re-registering a grant with a pre-fetched pubkey without round-tripping
29
- // through the SDK instance). Re-exported here via the leaf `delegate-grants`
30
- // subpath — never the `@cef-ai/account` root barrel — to keep vault-sdk
31
- // chain-free (ADR-033).
24
+ // Vault-api's delegate identity (`VaultInfo` / `DelegateInfo`) stays exported
25
+ // for the frontend. The `registerDelegate`/`revokeDelegate` re-exports (and
26
+ // the `vault.delegate.{pubkey,grant,revoke}` namespace they backed) were
27
+ // removed with the gateway's `/auth/delegates` API: vault write delegation is
28
+ // now a durable on-chain NonTransfer proxy grant
29
+ // (`@cef-ai/account`'s `ensureVaultDelegate`).
32
30
  export { VaultInfo } from "./internal/vault-info.js";
33
- export { registerDelegate, revokeDelegate, GatewayDelegateError, } from "@cef-ai/account/delegate-grants";
34
31
  //# 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,uEAAuE;AACvE,wEAAwE;AACxE,kCAAkC;AAElC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAOvC,OAAO,EACL,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAAE,KAAK,EAAE,MAA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rB,cAAc,EACd,UAAU,EACV,WAAW,EACX,cAAc,EACd,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AA4C7B,8EAA8E;AAC9E,4EAA4E;AAC5E,yEAAyE;AACzE,8EAA8E;AAC9E,iDAAiD;AACjD,+CAA+C;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { VaultHttpClient } from "../core/http.js";
2
- import type { AgentConnection, AgentConnectionStatus, ConnectAgentRequest } from "../core/types.js";
2
+ import type { AgentConnection, AgentConnectionStatus, ConnectAgentRequest, ConnectionCeiling } from "../core/types.js";
3
3
  export interface ListAgentsOptions {
4
4
  status?: AgentConnectionStatus;
5
5
  }
@@ -7,17 +7,64 @@ export declare class Agents {
7
7
  private readonly http;
8
8
  constructor(http: VaultHttpClient);
9
9
  /**
10
- * Low-level surface — POSTs a `ConnectAgentRequest` (`{ agentId, scope,
11
- * settings?, agreementSignature? }`) with a pre-signed `agreementSignature`.
12
- * `version`/`manifestCid` are not sent; the vault-api resolves the manifest
13
- * from the DDC registry. For the high-level flow that signs the GAR
14
- * agreement on your behalf, use `vault.agents.connect({ agentId, scope, settings })`
15
- * from `@cef-ai/vault-sdk` (requires `garEndpoint` + `wallet` on the SDK config).
10
+ * Low-level surface — POSTs a `ConnectAgentRequest` (`{ agentId, scope?,
11
+ * scopes?, settings?, agreementSignature? }`) with a pre-signed
12
+ * `agreementSignature`. Pass `scopes` for a set of vault scopes, or the
13
+ * singular `scope` for callers that predate the set — exactly one of the
14
+ * two is required (`ScopeSelector`); whichever is supplied is sent through
15
+ * untouched, never derived from the other. `version`/`manifestCid` are not
16
+ * sent; the vault-api resolves the manifest from the DDC registry. For the
17
+ * high-level flow that signs the GAR agreement on your behalf, use
18
+ * `vault.agents.connect({ agentId, scope, settings })` from
19
+ * `@cef-ai/vault-sdk` (requires `garEndpoint` + `wallet` on the SDK config).
20
+ *
21
+ * `ceiling` (optional) is the connection's spend ceiling, written
22
+ * atomically with the connection row. Set it here to avoid a window where
23
+ * the connection exists with no ceiling; use {@link setCeiling} to change it
24
+ * later. It is validated exactly as `setCeiling` validates (see there) and a
25
+ * violation rejects with `VaultRequestError(status 0, "BAD_REQUEST")` before
26
+ * any request is made. When present it is sent as `{ gpuUnits, a2aTokens }`
27
+ * with both axes explicit (absent axis = `0` = no ceiling on that axis);
28
+ * when `undefined` the `ceiling` key is omitted from the body. The resolved
29
+ * connection's `ceiling` reports what the server stored (absent when
30
+ * neither axis is set).
16
31
  */
17
32
  connect(v: string, req: ConnectAgentRequest): Promise<AgentConnection>;
18
33
  list(v: string, opts?: ListAgentsOptions): Promise<AgentConnection[]>;
19
34
  get(v: string, a: string): Promise<AgentConnection>;
20
35
  update(v: string, a: string, settings: Record<string, unknown>): Promise<AgentConnection>;
36
+ /**
37
+ * Set (replace) the connection's spend ceiling —
38
+ * `PUT /vaults/:v/agents/:a/ceiling`, wallet-signed like {@link update}.
39
+ *
40
+ * Both axes are always sent; an absent axis is sent as `0` (= no ceiling on
41
+ * that axis), so `setCeiling(v, a, {})` clears both. This is a full replace,
42
+ * not a merge: omitting `a2aTokens` clears an existing token ceiling.
43
+ *
44
+ * Validated before sending: only the keys `gpuUnits` and `a2aTokens` are
45
+ * allowed (any other own key is refused, even with an `undefined` value,
46
+ * mirroring vault-api's unknown-field refusal); each axis must be a finite
47
+ * number >= 0; `a2aTokens` must be an integer <= `Number.MAX_SAFE_INTEGER`.
48
+ * A violation throws {@link VaultRequestError} with `status` 0 and `code`
49
+ * "BAD_REQUEST" (the same code vault-api uses), and no request is made; the
50
+ * returned promise rejects. `status` 0 is also what a network failure
51
+ * carries — distinguish a validation refusal by `code === "BAD_REQUEST"`.
52
+ *
53
+ * Resolves to the updated {@link AgentConnection}; its `ceiling` is absent
54
+ * when both axes are 0.
55
+ */
56
+ setCeiling(v: string, a: string, ceiling: ConnectionCeiling): Promise<AgentConnection>;
21
57
  disconnect(v: string, a: string): Promise<void>;
22
58
  }
59
+ /**
60
+ * Client-side mirror of vault-api's ceiling validation. Returns the wire body
61
+ * (`{ gpuUnits, a2aTokens }`, both axes explicit). Throws
62
+ * `VaultRequestError(status 0, "BAD_REQUEST")` on a violation. Shared by
63
+ * `setCeiling`, `connect` and the fluent `vault.agents.connect` (which calls it
64
+ * before the GAR agreement is signed, so a bad ceiling costs no ceremony).
65
+ */
66
+ export declare function validateCeiling(c: ConnectionCeiling): {
67
+ gpuUnits: number;
68
+ a2aTokens: number;
69
+ };
23
70
  //# sourceMappingURL=agents.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/internal/agents.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEpG,MAAM,WAAW,iBAAiB;IAAG,MAAM,CAAC,EAAE,qBAAqB,CAAA;CAAE;AAErE,qBAAa,MAAM;IACL,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,eAAe;IAElD;;;;;;;OAOG;IACH,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,mBAAmB,GAAG,OAAO,CAAC,eAAe,CAAC;IAGhE,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,GAAE,iBAAsB,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAK/E,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAGnD,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC;IAGzF,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAA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,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAiC7F"}
@@ -1,19 +1,50 @@
1
1
  import { endpoints } from "../core/endpoints.js";
2
+ import { resolveConnectScopes } from "../core/connect-scopes.js";
3
+ import { VaultRequestError } from "../core/errors.js";
2
4
  export class Agents {
3
5
  http;
4
6
  constructor(http) {
5
7
  this.http = http;
6
8
  }
7
9
  /**
8
- * Low-level surface — POSTs a `ConnectAgentRequest` (`{ agentId, scope,
9
- * settings?, agreementSignature? }`) with a pre-signed `agreementSignature`.
10
- * `version`/`manifestCid` are not sent; the vault-api resolves the manifest
11
- * from the DDC registry. For the high-level flow that signs the GAR
12
- * agreement on your behalf, use `vault.agents.connect({ agentId, scope, settings })`
13
- * from `@cef-ai/vault-sdk` (requires `garEndpoint` + `wallet` on the SDK config).
10
+ * Low-level surface — POSTs a `ConnectAgentRequest` (`{ agentId, scope?,
11
+ * scopes?, settings?, agreementSignature? }`) with a pre-signed
12
+ * `agreementSignature`. Pass `scopes` for a set of vault scopes, or the
13
+ * singular `scope` for callers that predate the set — exactly one of the
14
+ * two is required (`ScopeSelector`); whichever is supplied is sent through
15
+ * untouched, never derived from the other. `version`/`manifestCid` are not
16
+ * sent; the vault-api resolves the manifest from the DDC registry. For the
17
+ * high-level flow that signs the GAR agreement on your behalf, use
18
+ * `vault.agents.connect({ agentId, scope, settings })` from
19
+ * `@cef-ai/vault-sdk` (requires `garEndpoint` + `wallet` on the SDK config).
20
+ *
21
+ * `ceiling` (optional) is the connection's spend ceiling, written
22
+ * atomically with the connection row. Set it here to avoid a window where
23
+ * the connection exists with no ceiling; use {@link setCeiling} to change it
24
+ * later. It is validated exactly as `setCeiling` validates (see there) and a
25
+ * violation rejects with `VaultRequestError(status 0, "BAD_REQUEST")` before
26
+ * any request is made. When present it is sent as `{ gpuUnits, a2aTokens }`
27
+ * with both axes explicit (absent axis = `0` = no ceiling on that axis);
28
+ * when `undefined` the `ceiling` key is omitted from the body. The resolved
29
+ * connection's `ceiling` reports what the server stored (absent when
30
+ * neither axis is set).
14
31
  */
15
- connect(v, req) {
16
- return this.http.send("POST", endpoints.agents(v), { body: req });
32
+ async connect(v, req) {
33
+ // The ceiling is validated (and normalised to the two-axis wire body)
34
+ // before the request goes out — the same `validateCeiling` setCeiling
35
+ // uses. Absent → the key stays off the body entirely.
36
+ const { ceiling, ...rest } = req;
37
+ const body = ceiling === undefined ? { ...rest } : { ...rest, ceiling: validateCeiling(ceiling) };
38
+ // Validates the scope selector without rewriting it — `req` is still
39
+ // forwarded exactly as given below; see resolveConnectScopes for why
40
+ // this check is needed even though `ConnectAgentRequest` is typed to
41
+ // forbid both-or-neither already. `connect` is `async` (rather than
42
+ // just returning the `http.send` promise) specifically so this
43
+ // validation failure is a rejected promise like every other error from
44
+ // this method, not a synchronous throw a caller's `await`/`.catch`
45
+ // wouldn't expect.
46
+ resolveConnectScopes(req, "Agents.connect");
47
+ return this.http.send("POST", endpoints.agents(v), { body });
17
48
  }
18
49
  async list(v, opts = {}) {
19
50
  const res = await this.http.send("GET", endpoints.agents(v), { query: { status: opts.status } });
@@ -25,8 +56,79 @@ export class Agents {
25
56
  update(v, a, settings) {
26
57
  return this.http.send("PATCH", endpoints.agent(v, a), { body: { settings } });
27
58
  }
59
+ /**
60
+ * Set (replace) the connection's spend ceiling —
61
+ * `PUT /vaults/:v/agents/:a/ceiling`, wallet-signed like {@link update}.
62
+ *
63
+ * Both axes are always sent; an absent axis is sent as `0` (= no ceiling on
64
+ * that axis), so `setCeiling(v, a, {})` clears both. This is a full replace,
65
+ * not a merge: omitting `a2aTokens` clears an existing token ceiling.
66
+ *
67
+ * Validated before sending: only the keys `gpuUnits` and `a2aTokens` are
68
+ * allowed (any other own key is refused, even with an `undefined` value,
69
+ * mirroring vault-api's unknown-field refusal); each axis must be a finite
70
+ * number >= 0; `a2aTokens` must be an integer <= `Number.MAX_SAFE_INTEGER`.
71
+ * A violation throws {@link VaultRequestError} with `status` 0 and `code`
72
+ * "BAD_REQUEST" (the same code vault-api uses), and no request is made; the
73
+ * returned promise rejects. `status` 0 is also what a network failure
74
+ * carries — distinguish a validation refusal by `code === "BAD_REQUEST"`.
75
+ *
76
+ * Resolves to the updated {@link AgentConnection}; its `ceiling` is absent
77
+ * when both axes are 0.
78
+ */
79
+ async setCeiling(v, a, ceiling) {
80
+ // `async` so a validation failure is a rejected promise, not a sync throw.
81
+ const body = validateCeiling(ceiling);
82
+ return this.http.send("PUT", endpoints.agentCeiling(v, a), { body: { ...body } });
83
+ }
28
84
  disconnect(v, a) {
29
85
  return this.http.send("DELETE", endpoints.agent(v, a), { body: {} });
30
86
  }
31
87
  }
88
+ function invalidCeiling(msg) {
89
+ return new VaultRequestError(`invalid ceiling: ${msg}`, 0, "BAD_REQUEST");
90
+ }
91
+ /**
92
+ * Client-side mirror of vault-api's ceiling validation. Returns the wire body
93
+ * (`{ gpuUnits, a2aTokens }`, both axes explicit). Throws
94
+ * `VaultRequestError(status 0, "BAD_REQUEST")` on a violation. Shared by
95
+ * `setCeiling`, `connect` and the fluent `vault.agents.connect` (which calls it
96
+ * before the GAR agreement is signed, so a bad ceiling costs no ceremony).
97
+ */
98
+ export function validateCeiling(c) {
99
+ if (c === null || typeof c !== "object" || Array.isArray(c)) {
100
+ throw invalidCeiling("expected an object { gpuUnits?, a2aTokens? }");
101
+ }
102
+ // Mirror vault-api's DisallowUnknownFields: a misspelled key (`a2a_tokens`)
103
+ // would otherwise be dropped and its axis sent as 0 — silently clearing a
104
+ // ceiling in force. Checked before the axes are read. A key present with an
105
+ // `undefined` value is refused too: the key itself is the mistake.
106
+ for (const k of Object.keys(c)) {
107
+ if (k !== "gpuUnits" && k !== "a2aTokens") {
108
+ throw invalidCeiling(`unknown field ${JSON.stringify(k)} (expected { gpuUnits?, a2aTokens? })`);
109
+ }
110
+ }
111
+ const axis = (name) => {
112
+ const v = c[name];
113
+ if (v === undefined)
114
+ return 0;
115
+ if (typeof v !== "number" || !Number.isFinite(v)) {
116
+ throw invalidCeiling(`${name} must be a finite number (got ${String(v)})`);
117
+ }
118
+ if (v < 0)
119
+ throw invalidCeiling(`${name} must be >= 0 (got ${v})`);
120
+ return v;
121
+ };
122
+ const gpuUnits = axis("gpuUnits");
123
+ const a2aTokens = axis("a2aTokens");
124
+ if (!Number.isInteger(a2aTokens)) {
125
+ throw invalidCeiling(`a2aTokens must be an integer (got ${a2aTokens})`);
126
+ }
127
+ // Above 2^53 the number no longer round-trips exactly through JSON (and
128
+ // above 2^63 the server fails to decode it into int64 at all).
129
+ if (a2aTokens > Number.MAX_SAFE_INTEGER) {
130
+ throw invalidCeiling(`a2aTokens must be <= Number.MAX_SAFE_INTEGER (got ${a2aTokens})`);
131
+ }
132
+ return { gpuUnits, a2aTokens };
133
+ }
32
134
  //# sourceMappingURL=agents.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"agents.js","sourceRoot":"","sources":["../../src/internal/agents.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAKjD,MAAM,OAAO,MAAM;IACY;IAA7B,YAA6B,IAAqB;QAArB,SAAI,GAAJ,IAAI,CAAiB;IAAG,CAAC;IAEtD;;;;;;;OAOG;IACH,OAAO,CAAC,CAAS,EAAE,GAAwB;QACzC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,GAAyC,EAAE,CAAC,CAAC;IAC1G,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,CAAS,EAAE,OAA0B,EAAE;QAChD,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAC9B,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAClE,OAAO,GAAG,CAAC,KAAK,IAAI,EAA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C3B,IAAI,CAAC,KAAK,SAAS;YAAE,OAAO,CAAC,CAAC;QAC9B,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;YACjD,MAAM,cAAc,CAAC,GAAG,IAAI,iCAAiC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAC7E,CAAC;QACD,IAAI,CAAC,GAAG,CAAC;YAAE,MAAM,cAAc,CAAC,GAAG,IAAI,sBAAsB,CAAC,GAAG,CAAC,CAAC;QACnE,OAAO,CAAC,CAAC;IACX,CAAC,CAAC;IACF,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC;IAClC,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC;IACpC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC;QACjC,MAAM,cAAc,CAAC,qCAAqC,SAAS,GAAG,CAAC,CAAC;IAC1E,CAAC;IACD,wEAAwE;IACxE,+DAA+D;IAC/D,IAAI,SAAS,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;QACxC,MAAM,cAAc,CAAC,qDAAqD,SAAS,GAAG,CAAC,CAAC;IAC1F,CAAC;IACD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;AACjC,CAAC"}
@@ -11,5 +11,38 @@ export declare class Cubbies {
11
11
  * for normal write flows.
12
12
  */
13
13
  exec(v: string, s: string, a: string, alias: string, sql: string, params?: unknown[]): Promise<CubbyExecResponse>;
14
+ /**
15
+ * Read a cubby the AGENT SERVICE owns, rather than one of its agents.
16
+ *
17
+ * One database per service, so what a coordinator writes its specialists can
18
+ * read without a copy. `as` is the service's public key — the half of an
19
+ * agent id before the colon.
20
+ */
21
+ serviceQuery<Row = unknown[]>(v: string, as: string, alias: string, sql: string, params?: unknown[]): Promise<CubbyQueryResponse<Row>>;
22
+ /** The write half of {@link serviceQuery}; needs a member-level grant. */
23
+ serviceExec(v: string, as: string, alias: string, sql: string, params?: unknown[]): Promise<CubbyExecResponse>;
24
+ /**
25
+ * Every cubby this service holds in (vault, scope).
26
+ *
27
+ * There is nothing else to ask: a service cubby has no declaration — an alias
28
+ * passing the shape rule is legal and the first write creates the file — so
29
+ * the registry IS the list.
30
+ */
31
+ serviceList(v: string, as: string): Promise<ServiceCubby[]>;
32
+ /** Create one with its schema. Member level, like exec. */
33
+ serviceProvision(v: string, as: string, alias: string, migrations: CubbyMigration[]): Promise<void>;
34
+ /** Remove one, and its file. Member level, like exec. */
35
+ serviceDelete(v: string, as: string, alias: string): Promise<void>;
36
+ }
37
+ /** One migration, as the platform applies them. */
38
+ export interface CubbyMigration {
39
+ version: number;
40
+ up: string;
41
+ }
42
+ /** What the registry knows about one cubby of a service. */
43
+ export interface ServiceCubby {
44
+ alias: string;
45
+ sizeBytes: number;
46
+ schemaVersion: number;
14
47
  }
15
48
  //# sourceMappingURL=cubbies.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cubbies.d.ts","sourceRoot":"","sources":["../../src/internal/cubbies.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE9E,qBAAa,OAAO;IACN,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,eAAe;IAElD,KAAK,CAAC,GAAG,GAAG,OAAO,EAAE,EACnB,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,GAAE,OAAO,EAAO,GAClF,OAAO,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAInC;;;;;OAKG;IACH,IAAI,CACF,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAA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,GAAG,EAAE,MAAM,EAAE,MAAM,GAAE,OAAO,EAAO,GACxE,OAAO,CAAC,iBAAiB,CAAC;IAM7B;;;;;;OAMG;IACG,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAOjE,2DAA2D;IAC3D,gBAAgB,CACd,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,GACjE,OAAO,CAAC,IAAI,CAAC;IAMhB,yDAAyD;IACzD,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGnE;AAED,mDAAmD;AACnD,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,4DAA4D;AAC5D,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;CACvB"}
@@ -16,5 +16,44 @@ export class Cubbies {
16
16
  exec(v, s, a, alias, sql, params = []) {
17
17
  return this.http.send("POST", endpoints.cubbyExec(v, s, a, alias), { body: { sql, params } });
18
18
  }
19
+ /**
20
+ * Read a cubby the AGENT SERVICE owns, rather than one of its agents.
21
+ *
22
+ * One database per service, so what a coordinator writes its specialists can
23
+ * read without a copy. `as` is the service's public key — the half of an
24
+ * agent id before the colon.
25
+ */
26
+ serviceQuery(v, as, alias, sql, params = []) {
27
+ return this.http.send("POST", endpoints.serviceCubbyQuery(v, as, alias), {
28
+ body: { sql, params },
29
+ });
30
+ }
31
+ /** The write half of {@link serviceQuery}; needs a member-level grant. */
32
+ serviceExec(v, as, alias, sql, params = []) {
33
+ return this.http.send("POST", endpoints.serviceCubbyExec(v, as, alias), {
34
+ body: { sql, params },
35
+ });
36
+ }
37
+ /**
38
+ * Every cubby this service holds in (vault, scope).
39
+ *
40
+ * There is nothing else to ask: a service cubby has no declaration — an alias
41
+ * passing the shape rule is legal and the first write creates the file — so
42
+ * the registry IS the list.
43
+ */
44
+ async serviceList(v, as) {
45
+ const body = await this.http.send("GET", endpoints.serviceCubbies(v, as));
46
+ return body?.data ?? [];
47
+ }
48
+ /** Create one with its schema. Member level, like exec. */
49
+ serviceProvision(v, as, alias, migrations) {
50
+ return this.http.send("POST", endpoints.serviceCubbyProvision(v, as, alias), {
51
+ body: { migrations },
52
+ });
53
+ }
54
+ /** Remove one, and its file. Member level, like exec. */
55
+ serviceDelete(v, as, alias) {
56
+ return this.http.send("DELETE", endpoints.serviceCubby(v, as, alias));
57
+ }
19
58
  }
20
59
  //# sourceMappingURL=cubbies.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cubbies.js","sourceRoot":"","sources":["../../src/internal/cubbies.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGjD,MAAM,OAAO,OAAO;IACW;IAA7B,YAA6B,IAAqB;QAArB,SAAI,GAAJ,IAAI,CAAiB;IAAG,CAAC;IAEtD,KAAK,CACH,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,KAAa,EAAE,GAAW,EAAE,SAAoB,EAAE;QAEnF,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;IACjG,CAAC;IAED;;;;;OAKG;IACH,IAAI,CACF,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,KAAa,EAAE,GAAW,EAAE,SAAoB,EAAE;QAEnF,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EA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AAC,EAAE;YACvE,IAAI,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE;SACtB,CAAC,CAAC;IACL,CAAC;IAED,0EAA0E;IAC1E,WAAW,CACT,CAAS,EAAE,EAAU,EAAE,KAAa,EAAE,GAAW,EAAE,SAAoB,EAAE;QAEzE,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,gBAAgB,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE;YACtE,IAAI,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE;SACtB,CAAC,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,WAAW,CAAC,CAAS,EAAE,EAAU;QACrC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAC/B,KAAK,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC,EAAE,EAAE,CAAC,CACvC,CAAC;QACF,OAAO,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC;IAC1B,CAAC;IAED,2DAA2D;IAC3D,gBAAgB,CACd,CAAS,EAAE,EAAU,EAAE,KAAa,EAAE,UAA4B;QAElE,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,qBAAqB,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE;YAC3E,IAAI,EAAE,EAAE,UAAU,EAAE;SACrB,CAAC,CAAC;IACL,CAAC;IAED,yDAAyD;IACzD,aAAa,CAAC,CAAS,EAAE,EAAU,EAAE,KAAa;QAChD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;IACxE,CAAC;CACF"}
@@ -12,12 +12,42 @@ import type { VaultHttpClient } from "../core/http.js";
12
12
  export interface MemoryRows {
13
13
  columns: string[];
14
14
  rows: unknown[][];
15
+ /**
16
+ * The paged read tools (`record_search`, `record_list`) mint an opaque
17
+ * keyset cursor when a full page was returned and more rows exist; pass it
18
+ * back as the matching tool's `cursor` request param to fetch the next
19
+ * page. ABSENT on the last page (and on every unpaged tool) — the server
20
+ * marks it `omitempty`, so its absence means "no more rows". The one
21
+ * additive sibling key on an otherwise untouched `{ columns, rows }`
22
+ * envelope: the cursor rides beside the columns, never inside them.
23
+ */
24
+ cursor?: string;
15
25
  }
16
26
  /**
17
27
  * The memory bank's READ surface for browser clients (the memory-route UI).
18
28
  * One route, five tools: `POST /api/v1/vaults/:vaultId/memory/:tool` with
19
- * the Go json-tag body keys (`match`, `limit`, `id`, `type`, `privacy` —
20
- * all `omitempty`, so undefined fields are omitted from the body entirely).
29
+ * the Go json-tag body keys (`match`, `limit`, `id`, `type`, `privacy`,
30
+ * `scope`, `cursor`, `edge_type`, `direction`, `domain` — all `omitempty`, so
31
+ * undefined fields are omitted from the body entirely).
32
+ *
33
+ * `scope` narrows within the caller's grants (an ungranted scope yields an
34
+ * empty result, never an error); `cursor` pages the read tools (see
35
+ * `MemoryRows.cursor`). `domain` (on `search`, `list`, `countByType` — the
36
+ * three reads the server applies it to) narrows by the record's SUBJECT tag:
37
+ * `domain` is the record's subject tag (e.g. sales), NOT the vault scope —
38
+ * narrowing by it is not an access control; the UI labels it Topic. Two
39
+ * axes: `scope` is access, `domain` is subject.
40
+ *
41
+ * `record_neighbours` filters by `edge_type` and `direction`
42
+ * (`in`|`out`|`both`, relative to the anchor record — `out` is
43
+ * anchor → far; absent means `both`). The SDK sends the direction as-given:
44
+ * enum validation is the server's job, the TS type is the only client-side
45
+ * constraint.
46
+ *
47
+ * `record_search`'s projection is seven positional columns — `id, type,
48
+ * title, scope, privacy, rank, snippet` (the FTS5 `snippet` is appended
49
+ * after the six historical columns, aliased because the columns array goes
50
+ * out verbatim and the UI reads it by name).
21
51
  *
22
52
  * Writes are agent-side (`ctx.memory` in `@cef-ai/agent-sdk`) per the spec —
23
53
  * this class exposes no write methods on purpose.
@@ -26,23 +56,67 @@ export declare class Memory {
26
56
  private readonly http;
27
57
  private readonly vaultId;
28
58
  constructor(http: VaultHttpClient, vaultId: string);
29
- /** Full-text search, optionally narrowed to a type and/or privacy class. */
59
+ /** Full-text search, optionally narrowed to a type, privacy class, and/or scope. */
30
60
  search(match: string, opts?: {
31
61
  limit?: number;
32
62
  type?: string;
33
63
  privacy?: string;
64
+ scope?: string;
65
+ cursor?: string;
66
+ /**
67
+ * The record's subject tag (e.g. `sales`, `hiring`, `engineering`) —
68
+ * wire `domain`, sent only when set. Narrows WITHIN the caller's
69
+ * grants; an absent domain adds no predicate.
70
+ *
71
+ * `domain` is the record's subject tag (e.g. sales), NOT the vault
72
+ * scope — narrowing by it is not an access control; the UI labels it
73
+ * Topic. (The product UI's "Domain" is the vault SCOPE, the access
74
+ * axis — that is `scope` here.)
75
+ */
76
+ domain?: string;
34
77
  }): Promise<MemoryRows>;
35
78
  /** Browse records newest-first, gated by the caller's grants and ceiling. */
36
79
  list(type?: string, opts?: {
37
80
  limit?: number;
81
+ scope?: string;
82
+ cursor?: string;
83
+ /**
84
+ * The record's subject tag (e.g. `sales`, `hiring`, `engineering`) —
85
+ * wire `domain`, sent only when set. Narrows WITHIN the caller's
86
+ * grants; an absent domain adds no predicate.
87
+ *
88
+ * `domain` is the record's subject tag (e.g. sales), NOT the vault
89
+ * scope — narrowing by it is not an access control; the UI labels it
90
+ * Topic. (The product UI's "Domain" is the vault SCOPE, the access
91
+ * axis — that is `scope` here.)
92
+ */
93
+ domain?: string;
38
94
  }): Promise<MemoryRows>;
39
95
  /** Fetch a single record by id. */
40
96
  get(id: string): Promise<MemoryRows>;
41
97
  /** Records connected to the given one by a relation. */
42
98
  neighbours(id: string, opts?: {
43
99
  limit?: number;
100
+ edgeType?: string;
101
+ direction?: "in" | "out" | "both";
102
+ }): Promise<MemoryRows>;
103
+ /**
104
+ * Row counts grouped by record type, optionally narrowed to one scope
105
+ * and/or one subject `domain`.
106
+ */
107
+ countByType(opts?: {
108
+ scope?: string;
109
+ /**
110
+ * The record's subject tag (e.g. `sales`, `hiring`, `engineering`) —
111
+ * wire `domain`, sent only when set. Narrows WITHIN the caller's
112
+ * grants; an absent domain adds no predicate.
113
+ *
114
+ * `domain` is the record's subject tag (e.g. sales), NOT the vault
115
+ * scope — narrowing by it is not an access control; the UI labels it
116
+ * Topic. (The product UI's "Domain" is the vault SCOPE, the access
117
+ * axis — that is `scope` here.)
118
+ */
119
+ domain?: string;
44
120
  }): Promise<MemoryRows>;
45
- /** Row counts grouped by record type. */
46
- countByType(): Promise<MemoryRows>;
47
121
  }
48
122
  //# sourceMappingURL=memory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/internal/memory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGvD;;;;;;;;;GASG;AACH,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC;CACnB;AAED;;;;;;;;GAQG;AACH,qBAAa,MAAM;IAEf,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBADP,IAAI,EAAE,eAAe,EACrB,OAAO,EAAE,MAAM;IAGlC,4EAA4E;IAC5E,MAAM,CACJ,KAAK,EAAE,MAAM,EACb,IAAI,GAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAO,GAC7D,OAAO,CAAC,UAAU,CAAC;IAMtB,6EAA6E;IAC7E,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,GAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAAC,UAAU,CAAC;IAMvE,mCAA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CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB;;;;;;;;;WASG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC;KACZ,GACL,OAAO,CAAC,UAAU,CAAC;IAYtB,mCAAmC;IACnC,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAMpC,wDAAwD;IACxD,UAAU,CACR,EAAE,EAAE,MAAM,EACV,IAAI,GAAE;QACJ,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,IAAI,GAAG,KAAK,GAAG,MAAM,CAAC;KAC9B,GACL,OAAO,CAAC,UAAU,CAAC;IAetB;;;OAGG;IACH,WAAW,CACT,IAAI,GAAE;QACJ,KAAK,CAAC,EAAE,MAAM,CAAC;QACf;;;;;;;;;WASG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC;KACZ,GACL,OAAO,CAAC,UAAU,CAAC;CAOvB"}
@@ -2,8 +2,28 @@ import { endpoints } from "../core/endpoints.js";
2
2
  /**
3
3
  * The memory bank's READ surface for browser clients (the memory-route UI).
4
4
  * One route, five tools: `POST /api/v1/vaults/:vaultId/memory/:tool` with
5
- * the Go json-tag body keys (`match`, `limit`, `id`, `type`, `privacy` —
6
- * all `omitempty`, so undefined fields are omitted from the body entirely).
5
+ * the Go json-tag body keys (`match`, `limit`, `id`, `type`, `privacy`,
6
+ * `scope`, `cursor`, `edge_type`, `direction`, `domain` — all `omitempty`, so
7
+ * undefined fields are omitted from the body entirely).
8
+ *
9
+ * `scope` narrows within the caller's grants (an ungranted scope yields an
10
+ * empty result, never an error); `cursor` pages the read tools (see
11
+ * `MemoryRows.cursor`). `domain` (on `search`, `list`, `countByType` — the
12
+ * three reads the server applies it to) narrows by the record's SUBJECT tag:
13
+ * `domain` is the record's subject tag (e.g. sales), NOT the vault scope —
14
+ * narrowing by it is not an access control; the UI labels it Topic. Two
15
+ * axes: `scope` is access, `domain` is subject.
16
+ *
17
+ * `record_neighbours` filters by `edge_type` and `direction`
18
+ * (`in`|`out`|`both`, relative to the anchor record — `out` is
19
+ * anchor → far; absent means `both`). The SDK sends the direction as-given:
20
+ * enum validation is the server's job, the TS type is the only client-side
21
+ * constraint.
22
+ *
23
+ * `record_search`'s projection is seven positional columns — `id, type,
24
+ * title, scope, privacy, rank, snippet` (the FTS5 `snippet` is appended
25
+ * after the six historical columns, aliased because the columns array goes
26
+ * out verbatim and the UI reads it by name).
7
27
  *
8
28
  * Writes are agent-side (`ctx.memory` in `@cef-ai/agent-sdk`) per the spec —
9
29
  * this class exposes no write methods on purpose.
@@ -15,16 +35,30 @@ export class Memory {
15
35
  this.http = http;
16
36
  this.vaultId = vaultId;
17
37
  }
18
- /** Full-text search, optionally narrowed to a type and/or privacy class. */
38
+ /** Full-text search, optionally narrowed to a type, privacy class, and/or scope. */
19
39
  search(match, opts = {}) {
20
40
  return this.http.send("POST", endpoints.memoryTool(this.vaultId, "record_search"), {
21
- body: { match, limit: opts.limit, type: opts.type, privacy: opts.privacy },
41
+ body: {
42
+ match,
43
+ limit: opts.limit,
44
+ type: opts.type,
45
+ privacy: opts.privacy,
46
+ scope: opts.scope,
47
+ cursor: opts.cursor,
48
+ domain: opts.domain,
49
+ },
22
50
  });
23
51
  }
24
52
  /** Browse records newest-first, gated by the caller's grants and ceiling. */
25
53
  list(type, opts = {}) {
26
54
  return this.http.send("POST", endpoints.memoryTool(this.vaultId, "record_list"), {
27
- body: { type, limit: opts.limit },
55
+ body: {
56
+ type,
57
+ limit: opts.limit,
58
+ scope: opts.scope,
59
+ cursor: opts.cursor,
60
+ domain: opts.domain,
61
+ },
28
62
  });
29
63
  }
30
64
  /** Fetch a single record by id. */
@@ -35,11 +69,21 @@ export class Memory {
35
69
  }
36
70
  /** Records connected to the given one by a relation. */
37
71
  neighbours(id, opts = {}) {
38
- return this.http.send("POST", endpoints.memoryTool(this.vaultId, "record_neighbours"), { body: { id, limit: opts.limit } });
72
+ return this.http.send("POST", endpoints.memoryTool(this.vaultId, "record_neighbours"), {
73
+ body: {
74
+ id,
75
+ limit: opts.limit,
76
+ edge_type: opts.edgeType,
77
+ direction: opts.direction,
78
+ },
79
+ });
39
80
  }
40
- /** Row counts grouped by record type. */
41
- countByType() {
42
- return this.http.send("POST", endpoints.memoryTool(this.vaultId, "record_count_by_type"), { body: {} });
81
+ /**
82
+ * Row counts grouped by record type, optionally narrowed to one scope
83
+ * and/or one subject `domain`.
84
+ */
85
+ countByType(opts = {}) {
86
+ return this.http.send("POST", endpoints.memoryTool(this.vaultId, "record_count_by_type"), { body: { scope: opts.scope, domain: opts.domain } });
43
87
  }
44
88
  }
45
89
  //# sourceMappingURL=memory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"memory.js","sourceRoot":"","sources":["../../src/internal/memory.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAiBjD;;;;;;;;GAQG;AACH,MAAM,OAAO,MAAM;IAEE;IACA;IAFnB,YACmB,IAAqB,EACrB,OAAe;QADf,SAAI,GAAJ,IAAI,CAAiB;QACrB,YAAO,GAAP,OAAO,CAAQ;IAC/B,CAAC;IAEJ,4EAA4E;IAC5E,MAAM,CACJ,KAAa,EACb,OAA4D,EAAE;QAE9D,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,eAAe,CAAC,EAAE;YACjF,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE;SAC3E,CAAC,CAAC;IACL,CAAC;IAED,6EAA6E;IAC7E,IAAI,CAAC,IAAa,EAAE,OAA2B,EAAE;QAC/C,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,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