@cef-ai/vault-sdk 4.4.0 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -19
- package/dist/agreements/payload.d.ts +15 -1
- package/dist/agreements/payload.d.ts.map +1 -1
- package/dist/agreements/payload.js +13 -1
- package/dist/agreements/payload.js.map +1 -1
- package/dist/agreements/sign.d.ts +16 -3
- package/dist/agreements/sign.d.ts.map +1 -1
- package/dist/agreements/sign.js +16 -1
- package/dist/agreements/sign.js.map +1 -1
- package/dist/client.d.ts +54 -52
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +95 -98
- package/dist/client.js.map +1 -1
- package/dist/core/connect-scopes.d.ts +18 -0
- package/dist/core/connect-scopes.d.ts.map +1 -0
- package/dist/core/connect-scopes.js +72 -0
- package/dist/core/connect-scopes.js.map +1 -0
- package/dist/core/endpoints.d.ts +28 -1
- package/dist/core/endpoints.d.ts.map +1 -1
- package/dist/core/endpoints.js +31 -1
- package/dist/core/endpoints.js.map +1 -1
- package/dist/core/errors.d.ts +13 -1
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +14 -2
- package/dist/core/errors.js.map +1 -1
- package/dist/core/types.d.ts +70 -3
- package/dist/core/types.d.ts.map +1 -1
- package/dist/fluent/agent-connection.d.ts +16 -1
- package/dist/fluent/agent-connection.d.ts.map +1 -1
- package/dist/fluent/agent-connection.js +20 -0
- package/dist/fluent/agent-connection.js.map +1 -1
- package/dist/fluent/service.d.ts +34 -0
- package/dist/fluent/service.d.ts.map +1 -0
- package/dist/fluent/service.js +41 -0
- package/dist/fluent/service.js.map +1 -0
- package/dist/fluent/vault.d.ts +75 -8
- package/dist/fluent/vault.d.ts.map +1 -1
- package/dist/fluent/vault.js +82 -6
- package/dist/fluent/vault.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -10
- package/dist/index.js.map +1 -1
- package/dist/internal/agents.d.ts +54 -7
- package/dist/internal/agents.d.ts.map +1 -1
- package/dist/internal/agents.js +110 -8
- package/dist/internal/agents.js.map +1 -1
- package/dist/internal/connectors.d.ts +161 -0
- package/dist/internal/connectors.d.ts.map +1 -0
- package/dist/internal/connectors.js +66 -0
- package/dist/internal/connectors.js.map +1 -0
- package/dist/internal/cubbies.d.ts +33 -0
- package/dist/internal/cubbies.d.ts.map +1 -1
- package/dist/internal/cubbies.js +39 -0
- package/dist/internal/cubbies.js.map +1 -1
- package/dist/internal/memory.d.ts +79 -5
- package/dist/internal/memory.d.ts.map +1 -1
- package/dist/internal/memory.js +53 -9
- package/dist/internal/memory.js.map +1 -1
- package/dist/internal/vaults.d.ts +8 -5
- package/dist/internal/vaults.d.ts.map +1 -1
- package/dist/internal/vaults.js +0 -10
- package/dist/internal/vaults.js.map +1 -1
- package/dist/internal-exports.d.ts +1 -0
- package/dist/internal-exports.d.ts.map +1 -1
- package/dist/internal-exports.js +1 -0
- package/dist/internal-exports.js.map +1 -1
- package/package.json +3 -3
- package/dist/internal/gateway-info.d.ts +0 -16
- package/dist/internal/gateway-info.d.ts.map +0 -1
- package/dist/internal/gateway-info.js +0 -34
- package/dist/internal/gateway-info.js.map +0 -1
|
@@ -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,M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,GAAG,EAAE,MAAM,EAAE,MAAM,GAAE,OAAO,EAAO,GACxE,OAAO,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAMnC,0EAA0E;IAC1E,WAAW,CACT,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,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"}
|
package/dist/internal/cubbies.js
CHANGED
|
@@ -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;A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AA2D;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
|
-
*
|
|
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
|
|
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;
|
|
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;IAClB;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,qBAAa,MAAM;IAEf,OAAO,CAAC,QAAQ,CAA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,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
|
-
*
|
|
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
|
|
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: {
|
|
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: {
|
|
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"), {
|
|
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
|
-
/**
|
|
41
|
-
|
|
42
|
-
|
|
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;
|
|
1
|
+
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../../src/internal/memory.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AA2BjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;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,oFAAoF;IACpF,MAAM,CACJ,KAAa,EACb,OAiBI,EAAE;QAEN,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,eAAe,CAAC,EAAE;YACjF,IAAI,EAAE;gBACJ,KAAK;gBACL,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB;SACF,CAAC,CAAC;IACL,CAAC;IAED,6EAA6E;IAC7E,IAAI,C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AAC;IACJ,CAAC;CACF"}
|
|
@@ -6,15 +6,19 @@ import type { VaultRecord } from "../core/types.js";
|
|
|
6
6
|
* `s3gateway/client.go` pass-through contract), so gateway-visible fields
|
|
7
7
|
* like `label` must be inside this body before `WalletAuthProvider` signs it
|
|
8
8
|
* — vault-api cannot inject them afterwards without breaking the signature.
|
|
9
|
+
*
|
|
10
|
+
* `delegation_token` is OPTIONAL: absent (the default) means a TOKENLESS
|
|
11
|
+
* claim, which vault-api routes through the proxy saga — the on-chain
|
|
12
|
+
* NonTransfer grant `vault.ensure()` submitted beforehand is the
|
|
13
|
+
* authorization. Present means the legacy token-bearing claim. The key is
|
|
14
|
+
* omitted from the wire body entirely when absent; a present-but-empty
|
|
15
|
+
* value would be a third shape neither path accepts.
|
|
9
16
|
*/
|
|
10
17
|
export interface ClaimVaultRequest {
|
|
11
18
|
name?: string;
|
|
12
|
-
delegation_token
|
|
19
|
+
delegation_token?: string;
|
|
13
20
|
label?: string;
|
|
14
21
|
}
|
|
15
|
-
export interface RotateCredentialRequest {
|
|
16
|
-
delegation_token: string;
|
|
17
|
-
}
|
|
18
22
|
/**
|
|
19
23
|
* Body of `PATCH /api/v1/vaults/:vaultId` — the user-editable vault fields.
|
|
20
24
|
*
|
|
@@ -44,6 +48,5 @@ export declare class Vaults {
|
|
|
44
48
|
* patch would skip.
|
|
45
49
|
*/
|
|
46
50
|
patch(vaultId: string, req: PatchVaultRequest): Promise<VaultRecord>;
|
|
47
|
-
rotateCredentials(vaultId: string, req: RotateCredentialRequest): Promise<VaultRecord>;
|
|
48
51
|
}
|
|
49
52
|
//# sourceMappingURL=vaults.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vaults.d.ts","sourceRoot":"","sources":["../../src/internal/vaults.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD
|
|
1
|
+
{"version":3,"file":"vaults.d.ts","sourceRoot":"","sources":["../../src/internal/vaults.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,iBAAiB;IAAG,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE;AAE/F;;;;;;;;;;GAUG;AACH,MAAM,WAAW,iBAAiB;IAAG,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE;AAE9E,qBAAa,MAAM;IACL,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,eAAe;IAElD,KAAK,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,WAAW,CAAC;IAGnD,OAAO,IAAI,OAAO,CAAC,WAAW,CAAC;IAG/B,wEAAwE;IACxE,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAG3C;;;;;OAKG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,WAAW,CAAC;CAOrE"}
|
package/dist/internal/vaults.js
CHANGED
|
@@ -25,15 +25,5 @@ export class Vaults {
|
|
|
25
25
|
body: req,
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
|
-
// NOTE (multi-credential gateway): the gateway's PUT /auth/credentials
|
|
29
|
-
// never returns a secret, so this rotation path cannot hand back fresh S3
|
|
30
|
-
// credentials against the real gateway. vault-api is being reworked to
|
|
31
|
-
// register-new + revoke-old rotation semantics in a parallel PR; this
|
|
32
|
-
// method's contract will change with it. Do not build on it until then.
|
|
33
|
-
rotateCredentials(vaultId, req) {
|
|
34
|
-
return this.http.send("PUT", endpoints.vaultCredentials(vaultId), {
|
|
35
|
-
body: req,
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
28
|
}
|
|
39
29
|
//# sourceMappingURL=vaults.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vaults.js","sourceRoot":"","sources":["../../src/internal/vaults.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"vaults.js","sourceRoot":"","sources":["../../src/internal/vaults.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAgCjD,MAAM,OAAO,MAAM;IACY;IAA7B,YAA6B,IAAqB;QAArB,SAAI,GAAJ,IAAI,CAAiB;IAAG,CAAC;IAEtD,KAAK,CAAC,GAAsB;QAC1B,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,GAAyC,EAAE,CAAC,CAAC;IACzG,CAAC;IACD,OAAO;QACL,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC;IACnD,CAAC;IACD,wEAAwE;IACxE,IAAI,CAAC,OAAe;QAClB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IACzD,CAAC;IACD;;;;;OAKG;IACH,KAAK,CAAC,OAAe,EAAE,GAAsB;QAC3C,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE;YACvD,IAAI,EAAE,GAAyC;SAChD,CAAC,CAAC;IACL,CAAC;CAGF"}
|
|
@@ -7,6 +7,7 @@ export { Cubbies } from "./internal/cubbies.js";
|
|
|
7
7
|
export { Health } from "./internal/health.js";
|
|
8
8
|
export { Marketplace } from "./internal/marketplace.js";
|
|
9
9
|
export { Memberships } from "./internal/memberships.js";
|
|
10
|
+
export { AgentConnectionAccess, Connections, listConnectors } from "./internal/connectors.js";
|
|
10
11
|
export type { PutMemberOptions, PutScopesOptions } from "./internal/memberships.js";
|
|
11
12
|
export { VaultHttpClient } from "./core/http.js";
|
|
12
13
|
export { endpoints } from "./core/endpoints.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal-exports.d.ts","sourceRoot":"","sources":["../src/internal-exports.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAEpF,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"internal-exports.d.ts","sourceRoot":"","sources":["../src/internal-exports.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC9F,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAEpF,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/internal-exports.js
CHANGED
|
@@ -9,6 +9,7 @@ export { Cubbies } from "./internal/cubbies.js";
|
|
|
9
9
|
export { Health } from "./internal/health.js";
|
|
10
10
|
export { Marketplace } from "./internal/marketplace.js";
|
|
11
11
|
export { Memberships } from "./internal/memberships.js";
|
|
12
|
+
export { AgentConnectionAccess, Connections, listConnectors } from "./internal/connectors.js";
|
|
12
13
|
export { VaultHttpClient } from "./core/http.js";
|
|
13
14
|
export { endpoints } from "./core/endpoints.js";
|
|
14
15
|
//# sourceMappingURL=internal-exports.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal-exports.js","sourceRoot":"","sources":["../src/internal-exports.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,yEAAyE;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"internal-exports.js","sourceRoot":"","sources":["../src/internal-exports.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,yEAAyE;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG9F,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cef-ai/vault-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"@polkadot/keyring": "^14.0.3",
|
|
26
26
|
"@polkadot/util": "^14.0.3",
|
|
27
27
|
"@polkadot/util-crypto": "^14.0.3",
|
|
28
|
-
"@cef-ai/account": "1.3.1",
|
|
29
28
|
"@cef-ai/signer": "1.0.0",
|
|
30
|
-
"@cef-ai/transport": "1.1.0"
|
|
29
|
+
"@cef-ai/transport": "1.1.0",
|
|
30
|
+
"@cef-ai/account": "2.0.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/node": "^20.11.0",
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export interface GatewayInfo {
|
|
2
|
-
/** ed25519 pubkey, `0x`-prefixed hex when the gateway returns it that way. */
|
|
3
|
-
pubkey: string;
|
|
4
|
-
/** Optional cluster id when the gateway exposes it. */
|
|
5
|
-
clusterId?: string;
|
|
6
|
-
/** Optional region label when the gateway exposes it. */
|
|
7
|
-
region?: string;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Fetch the gateway's `/auth/info`. Throws on non-OK responses, missing
|
|
11
|
-
* pubkey, or invalid JSON. No caching here — the SDK caches one level
|
|
12
|
-
* up (`VaultSDK.cachedGatewayPubkey`) so it can be invalidated cleanly
|
|
13
|
-
* when needed.
|
|
14
|
-
*/
|
|
15
|
-
export declare function getGatewayInfo(authInfoUrl: string, fetchFn?: typeof fetch): Promise<GatewayInfo>;
|
|
16
|
-
//# sourceMappingURL=gateway-info.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gateway-info.d.ts","sourceRoot":"","sources":["../../src/internal/gateway-info.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,WAAW;IAC1B,8EAA8E;IAC9E,MAAM,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAUD;;;;;GAKG;AACH,wBAAsB,cAAc,CAClC,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,OAAO,KAAa,GAC5B,OAAO,CAAC,WAAW,CAAC,CAoBtB"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// src/internal/gateway-info.ts
|
|
2
|
-
//
|
|
3
|
-
// Single source of truth for the DDC S3 gateway's `/auth/info` payload —
|
|
4
|
-
// the gateway's ed25519 pubkey, plus optional cluster/region metadata.
|
|
5
|
-
// The pubkey is needed in two places:
|
|
6
|
-
// - building a delegation token's `subject` (delegation-token.ts)
|
|
7
|
-
// - calling `proxy.addProxy(<gw>, NonTransfer, 0)` (auto-add-proxy.ts)
|
|
8
|
-
// so it makes sense to fetch it from one helper.
|
|
9
|
-
/**
|
|
10
|
-
* Fetch the gateway's `/auth/info`. Throws on non-OK responses, missing
|
|
11
|
-
* pubkey, or invalid JSON. No caching here — the SDK caches one level
|
|
12
|
-
* up (`VaultSDK.cachedGatewayPubkey`) so it can be invalidated cleanly
|
|
13
|
-
* when needed.
|
|
14
|
-
*/
|
|
15
|
-
export async function getGatewayInfo(authInfoUrl, fetchFn = fetch) {
|
|
16
|
-
const res = await fetchFn(authInfoUrl, {
|
|
17
|
-
headers: { Accept: "application/json" },
|
|
18
|
-
});
|
|
19
|
-
if (!res.ok) {
|
|
20
|
-
throw new Error(`Gateway /auth/info ${res.status}: ${await res.text().catch(() => "")}`);
|
|
21
|
-
}
|
|
22
|
-
const info = (await res.json());
|
|
23
|
-
const pubkey = info.gateway_public_key ?? info.pubkey;
|
|
24
|
-
if (!pubkey) {
|
|
25
|
-
throw new Error(`Gateway /auth/info response is missing gateway_public_key: ${JSON.stringify(info)}`);
|
|
26
|
-
}
|
|
27
|
-
const out = { pubkey };
|
|
28
|
-
if (info.cluster_id !== undefined)
|
|
29
|
-
out.clusterId = info.cluster_id;
|
|
30
|
-
if (info.region !== undefined)
|
|
31
|
-
out.region = info.region;
|
|
32
|
-
return out;
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=gateway-info.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gateway-info.js","sourceRoot":"","sources":["../../src/internal/gateway-info.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,EAAE;AACF,yEAAyE;AACzE,uEAAuE;AACvE,sCAAsC;AACtC,oEAAoE;AACpE,yEAAyE;AACzE,iDAAiD;AAmBjD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,WAAmB,EACnB,UAAwB,KAAK;IAE7B,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,WAAW,EAAE;QACrC,OAAO,EAAE,EAAE,MAAM,EAAE,kBAAkB,EAAE;KACxC,CAAC,CAAC;IACH,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,sBAAsB,GAAG,CAAC,MAAM,KAAK,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CACxE,CAAC;IACJ,CAAC;IACD,MAAM,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAgB,CAAC;IAC/C,MAAM,MAAM,GAAG,IAAI,CAAC,kBAAkB,IAAI,IAAI,CAAC,MAAM,CAAC;IACtD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,8DAA8D,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CACrF,CAAC;IACJ,CAAC;IACD,MAAM,GAAG,GAAgB,EAAE,MAAM,EAAE,CAAC;IACpC,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS;QAAE,GAAG,CAAC,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC;IACnE,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS;QAAE,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IACxD,OAAO,GAAG,CAAC;AACb,CAAC"}
|