@tangle-network/hub-sdk 0.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/LICENSE ADDED
@@ -0,0 +1,11 @@
1
+ Copyright (c) 2025 Tangle Network
2
+
3
+ All rights reserved.
4
+
5
+ This software and associated documentation files (the "Software") are proprietary
6
+ and confidential. No part of this Software may be reproduced, distributed, or
7
+ transmitted in any form or by any means, including photocopying, recording, or
8
+ other electronic or mechanical methods, without the prior written permission of
9
+ Tangle Network.
10
+
11
+ For licensing inquiries, contact: hello@tangle.tools
@@ -0,0 +1,279 @@
1
+ //#region src/types.d.ts
2
+ type HubPrincipalKind = "user_session" | "api_key" | "sandbox_runtime";
3
+ interface HubSuccessEnvelope<TData> {
4
+ success: true;
5
+ data: TData;
6
+ }
7
+ interface HubErrorEnvelope {
8
+ success: false;
9
+ error: HubErrorBody;
10
+ }
11
+ type HubEnvelope<TData> = HubSuccessEnvelope<TData> | HubErrorEnvelope;
12
+ interface HubErrorBody {
13
+ code: HubErrorCode;
14
+ message: string;
15
+ details?: unknown;
16
+ }
17
+ type HubErrorCode = "HUB_UNAUTHENTICATED" | "HUB_FORBIDDEN" | "HUB_INVALID_INPUT" | "HUB_PROVIDER_MISSING" | "HUB_CONNECTION_MISSING" | "HUB_CONNECTION_REVOKED" | "HUB_TOKEN_EXPIRED" | "HUB_TOKEN_REPLAYED" | "HUB_TOKEN_REVOKED" | "HUB_TOKEN_ACTION_MISMATCH" | "HUB_POLICY_DENIED" | "HUB_APPROVAL_REQUIRED" | "HUB_EXECUTOR_FAILURE" | "HUB_PROVIDER_FAILURE" | "HUB_CONFIG_MISSING" | "HUB_NOT_FOUND" | "HUB_NOT_IMPLEMENTED";
18
+ interface HubStatusResponse {
19
+ contract: unknown;
20
+ principal: HubPrincipal;
21
+ connections: HubStatusConnections;
22
+ }
23
+ interface HubPrincipal {
24
+ kind: HubPrincipalKind;
25
+ userId: string;
26
+ apiKeyId?: string;
27
+ sandboxId?: string;
28
+ requestId?: string;
29
+ }
30
+ interface HubStatusConnections {
31
+ connectedProviderCount: number;
32
+ unhealthyProviderCount: number;
33
+ }
34
+ interface HubConnection {
35
+ id: string;
36
+ providerId: string;
37
+ displayName: string;
38
+ accountDisplay: string | null;
39
+ scopes: string[];
40
+ status: "active" | "revoked" | "unhealthy" | "reconnect_required";
41
+ health: "unknown" | "healthy" | "unhealthy" | "rate_limited";
42
+ createdAt: string;
43
+ updatedAt: string;
44
+ lastUsedAt: string | null;
45
+ }
46
+ interface HubConnectionsResponse {
47
+ connections: HubConnection[];
48
+ }
49
+ interface HubOAuthStartRequest {
50
+ provider: string;
51
+ returnUrl?: string;
52
+ cli?: boolean;
53
+ }
54
+ interface HubOAuthCallbackSuccessQuery {
55
+ provider: string;
56
+ code: string;
57
+ state: string;
58
+ error?: undefined;
59
+ }
60
+ interface HubOAuthCallbackErrorQuery {
61
+ provider: string;
62
+ error: string;
63
+ state: string;
64
+ code?: undefined;
65
+ }
66
+ type HubOAuthCallbackQuery = HubOAuthCallbackSuccessQuery | HubOAuthCallbackErrorQuery;
67
+ interface HubOAuthStartResponse {
68
+ provider: string;
69
+ redirectUrl: string;
70
+ state: string;
71
+ expiresAt: string;
72
+ scopes: string[];
73
+ cli: boolean;
74
+ }
75
+ interface HubOAuthCallbackResponse {
76
+ connectionId: string;
77
+ provider: string;
78
+ cli: boolean;
79
+ reconnected: boolean;
80
+ }
81
+ interface HubConnectionDeleteRequest {
82
+ connectionId: string;
83
+ }
84
+ interface HubConnectionDeleteResponse {
85
+ connection: HubConnection;
86
+ }
87
+ interface HubToolSource {
88
+ sourceId: string;
89
+ providerId: string;
90
+ displayName: string;
91
+ toolCount: number;
92
+ connectionStatus: "connected" | "missing" | "unknown";
93
+ health: "healthy" | "unhealthy" | "rate_limited" | "unknown";
94
+ configured: boolean;
95
+ }
96
+ interface HubTool {
97
+ path: string;
98
+ providerId?: string;
99
+ title?: string;
100
+ description?: string;
101
+ inputSchema?: unknown;
102
+ outputSchema?: unknown;
103
+ connectionRequired?: boolean;
104
+ connectionStatus?: "connected" | "missing" | "unknown";
105
+ requiredConnectionProviderId?: string;
106
+ policyState?: "allow" | "ask" | "deny" | "unknown";
107
+ }
108
+ interface HubToolSourcesResponse {
109
+ sources: HubToolSource[];
110
+ }
111
+ interface HubToolsSearchRequest {
112
+ query: string;
113
+ provider?: string;
114
+ }
115
+ interface HubToolsSearchResponse {
116
+ tools: HubTool[];
117
+ }
118
+ interface HubToolsDescribeRequest {
119
+ path: string;
120
+ }
121
+ interface HubToolsDescribeResponse {
122
+ tool: HubTool;
123
+ }
124
+ interface HubExecRequest {
125
+ path: string;
126
+ input?: unknown;
127
+ connectionId?: string;
128
+ }
129
+ interface HubExecResponse<TResult = unknown> {
130
+ result: TResult;
131
+ }
132
+ interface HubTokenMintRequest {
133
+ connectionId?: string;
134
+ provider?: string;
135
+ actionPath: string;
136
+ ttlSeconds?: number;
137
+ }
138
+ interface HubTokenMintResponse {
139
+ token: string;
140
+ tokenId: string;
141
+ expiresAt: string;
142
+ }
143
+ interface HubCapabilityToken {
144
+ id: string;
145
+ providerId: string;
146
+ connectionId: string;
147
+ connectionDisplay: string | null;
148
+ actionPath: string;
149
+ expiresAt: string;
150
+ status: "active" | "consumed" | "expired" | "revoked";
151
+ principalKind: HubPrincipalKind;
152
+ createdAt: string;
153
+ }
154
+ interface HubTokensListResponse {
155
+ tokens: HubCapabilityToken[];
156
+ }
157
+ interface HubTokenRevokeResponse {
158
+ tokenId: string;
159
+ status: HubCapabilityToken["status"];
160
+ }
161
+ type HubPolicyDecision = "allow" | "ask" | "deny";
162
+ interface HubPolicyUpdateRequest {
163
+ connectionId: string;
164
+ actionPath: string;
165
+ decision: HubPolicyDecision;
166
+ }
167
+ interface HubPolicyListRequest {
168
+ connectionId: string;
169
+ }
170
+ interface HubPolicy {
171
+ id: string;
172
+ connectionId: string;
173
+ providerId: string;
174
+ actionPath: string;
175
+ decision: HubPolicyDecision;
176
+ createdAt: string;
177
+ updatedAt: string;
178
+ }
179
+ interface HubPolicyResponse {
180
+ policy: HubPolicy;
181
+ }
182
+ interface HubPolicyListResponse {
183
+ policies: HubPolicy[];
184
+ }
185
+ interface HubAuditEvent {
186
+ id: string;
187
+ action: string;
188
+ targetUserId: string | null;
189
+ targetKeyId: string | null;
190
+ metadata: unknown;
191
+ createdAt: string;
192
+ }
193
+ interface HubAuditResponse {
194
+ events: HubAuditEvent[];
195
+ nextCursor: string | null;
196
+ }
197
+ interface HubUnimplementedErrorEnvelope extends HubErrorEnvelope {
198
+ error: HubErrorEnvelope["error"] & {
199
+ code: "HUB_NOT_IMPLEMENTED";
200
+ };
201
+ }
202
+ //#endregion
203
+ //#region src/client.d.ts
204
+ type HubAuthHeaders = () => HeadersInit | Promise<HeadersInit>;
205
+ interface HubClientOptions {
206
+ baseUrl: string;
207
+ apiKey?: string;
208
+ authHeaders?: HubAuthHeaders;
209
+ fetch?: typeof fetch;
210
+ }
211
+ declare class HubSdkError extends Error {
212
+ readonly code: HubErrorBody["code"];
213
+ readonly details?: unknown;
214
+ readonly status?: number;
215
+ constructor(error: HubErrorBody, options?: {
216
+ status?: number;
217
+ });
218
+ }
219
+ declare class HubClient {
220
+ readonly baseUrl: string;
221
+ readonly fetch: typeof fetch;
222
+ readonly apiKey?: string;
223
+ readonly authHeaders?: HubAuthHeaders;
224
+ readonly connections: HubConnectionsClient;
225
+ readonly permissions: HubPermissionsClient;
226
+ readonly tokens: HubTokensClient;
227
+ readonly tools: HubToolsClient;
228
+ constructor(options: HubClientOptions);
229
+ status(): Promise<HubStatusResponse>;
230
+ private request;
231
+ private buildHeaders;
232
+ }
233
+ interface HubTokenListOptions {
234
+ includeExpired?: boolean;
235
+ }
236
+ declare class HubTokensClient {
237
+ private readonly request;
238
+ constructor(request: <TData>(path: string, init: RequestInit) => Promise<TData>);
239
+ mint(options: {
240
+ actionPath: string;
241
+ connectionId?: string;
242
+ provider?: string;
243
+ ttlSeconds?: number;
244
+ }): Promise<HubTokenMintResponse>;
245
+ list(options?: HubTokenListOptions): Promise<HubTokensListResponse>;
246
+ revoke(tokenId: string): Promise<HubTokenRevokeResponse>;
247
+ }
248
+ declare class HubPermissionsClient {
249
+ private readonly request;
250
+ constructor(request: <TData>(path: string, init: RequestInit) => Promise<TData>);
251
+ list(connectionId: string): Promise<HubPolicyListResponse>;
252
+ set(input: HubPolicyUpdateRequest): Promise<HubPolicyResponse>;
253
+ }
254
+ interface HubToolSearchOptions {
255
+ provider?: string;
256
+ }
257
+ interface HubToolInvokeOptions {
258
+ connectionId?: string;
259
+ }
260
+ declare class HubToolsClient {
261
+ private readonly request;
262
+ constructor(request: <TData>(path: string, init: RequestInit) => Promise<TData>);
263
+ search(query: string, options?: HubToolSearchOptions): Promise<HubToolsSearchResponse>;
264
+ describe(path: string): Promise<HubToolsDescribeResponse>;
265
+ invoke<TResult = unknown>(path: string, input: unknown, options?: HubToolInvokeOptions): Promise<HubExecResponse<TResult>>;
266
+ private buildExecInit;
267
+ }
268
+ declare class HubConnectionsClient {
269
+ private readonly request;
270
+ constructor(request: <TData>(path: string, init: RequestInit) => Promise<TData>);
271
+ list(): Promise<HubConnectionsResponse>;
272
+ revoke(connectionId: string): Promise<HubConnectionDeleteResponse>;
273
+ }
274
+ //#endregion
275
+ //#region src/redaction.d.ts
276
+ declare function redactHubValue(value: unknown): unknown;
277
+ //#endregion
278
+ export { type HubAuditResponse, type HubAuthHeaders, type HubCapabilityToken, HubClient, type HubClientOptions, type HubConnection, type HubConnectionDeleteRequest, type HubConnectionDeleteResponse, HubConnectionsClient, type HubConnectionsResponse, type HubEnvelope, type HubErrorBody, type HubErrorCode, type HubErrorEnvelope, type HubExecRequest, type HubExecResponse, type HubOAuthCallbackErrorQuery, type HubOAuthCallbackQuery, type HubOAuthCallbackResponse, type HubOAuthCallbackSuccessQuery, type HubOAuthStartRequest, type HubOAuthStartResponse, HubPermissionsClient, type HubPolicy, type HubPolicyDecision, type HubPolicyListRequest, type HubPolicyListResponse, type HubPolicyResponse, type HubPolicyUpdateRequest, type HubPrincipal, type HubPrincipalKind, HubSdkError, type HubStatusConnections, type HubStatusResponse, type HubSuccessEnvelope, type HubTokenListOptions, type HubTokenMintRequest, type HubTokenMintResponse, type HubTokenRevokeResponse, HubTokensClient, type HubTokensListResponse, type HubTool, type HubToolInvokeOptions, type HubToolSearchOptions, type HubToolSource, type HubToolSourcesResponse, HubToolsClient, type HubToolsDescribeRequest, type HubToolsDescribeResponse, type HubToolsSearchRequest, type HubToolsSearchResponse, type HubUnimplementedErrorEnvelope, redactHubValue };
279
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/client.ts","../src/redaction.ts"],"mappings":";KAAY,gBAAA;AAAA,UAEK,kBAAA;EACf,OAAA;EACA,IAAA,EAAM,KAAA;AAAA;AAAA,UAGS,gBAAA;EACf,OAAA;EACA,KAAA,EAAO,YAAA;AAAA;AAAA,KAGG,WAAA,UAAqB,kBAAA,CAAmB,KAAA,IAAS,gBAAA;AAAA,UAE5C,YAAA;EACf,IAAA,EAAM,YAAA;EACN,OAAA;EACA,OAAA;AAAA;AAAA,KAGU,YAAA;AAAA,UAmBK,iBAAA;EACf,QAAA;EACA,SAAA,EAAW,YAAA;EACX,WAAA,EAAa,oBAAA;AAAA;AAAA,UAGE,YAAA;EACf,IAAA,EAAM,gBAAA;EACN,MAAA;EACA,QAAA;EACA,SAAA;EACA,SAAA;AAAA;AAAA,UAGe,oBAAA;EACf,sBAAA;EACA,sBAAA;AAAA;AAAA,UAGe,aAAA;EACf,EAAA;EACA,UAAA;EACA,WAAA;EACA,cAAA;EACA,MAAA;EACA,MAAA;EACA,MAAA;EACA,SAAA;EACA,SAAA;EACA,UAAA;AAAA;AAAA,UAGe,sBAAA;EACf,WAAA,EAAa,aAAA;AAAA;AAAA,UAGE,oBAAA;EACf,QAAA;EACA,SAAA;EACA,GAAA;AAAA;AAAA,UAG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A,KACH,OAAA,CAAQ,KAAA;EAGT,IAAA,CAAA,GAAQ,OAAA,CAAQ,sBAAA;EAMhB,MAAA,CAAO,YAAA,WAAuB,OAAA,CAAQ,2BAAA;AAAA;;;iBCpS9B,cAAA,CAAe,KAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,188 @@
1
+ //#region src/redaction.ts
2
+ const SECRET_KEY_PATTERN = /(api[_-]?key|authorization|capability[_-]?token|token|secret)/i;
3
+ const SECRET_VALUE_PATTERN = /\b(?:sk-tan[-_]|hubcap_|hct_|gh[pousr]_)[A-Za-z0-9_=-]+\b/g;
4
+ function redactHubValue(value) {
5
+ if (typeof value === "string") return value.replace(SECRET_VALUE_PATTERN, "[REDACTED]");
6
+ if (Array.isArray(value)) return value.map((item) => redactHubValue(item));
7
+ if (value && typeof value === "object") return Object.fromEntries(Object.entries(value).map(([key, entryValue]) => [key, SECRET_KEY_PATTERN.test(key) ? "[REDACTED]" : redactHubValue(entryValue)]));
8
+ return value;
9
+ }
10
+ //#endregion
11
+ //#region src/client.ts
12
+ var HubSdkError = class extends Error {
13
+ code;
14
+ details;
15
+ status;
16
+ constructor(error, options = {}) {
17
+ super(String(redactHubValue(error.message)));
18
+ this.name = "HubSdkError";
19
+ this.code = error.code;
20
+ this.details = redactHubValue(error.details);
21
+ this.status = options.status;
22
+ }
23
+ };
24
+ var HubClient = class {
25
+ baseUrl;
26
+ fetch;
27
+ apiKey;
28
+ authHeaders;
29
+ connections;
30
+ permissions;
31
+ tokens;
32
+ tools;
33
+ constructor(options) {
34
+ this.baseUrl = options.baseUrl.replace(/\/+$/, "");
35
+ this.apiKey = options.apiKey;
36
+ this.authHeaders = options.authHeaders;
37
+ this.fetch = options.fetch ?? fetch;
38
+ this.connections = new HubConnectionsClient((path, init) => this.request(path, init));
39
+ this.permissions = new HubPermissionsClient((path, init) => this.request(path, init));
40
+ this.tokens = new HubTokensClient((path, init) => this.request(path, init));
41
+ this.tools = new HubToolsClient((path, init) => this.request(path, init));
42
+ }
43
+ async status() {
44
+ return this.request("/v1/hub/status", { method: "GET" });
45
+ }
46
+ async request(path, init) {
47
+ const response = await this.fetch(`${this.baseUrl}${path}`, {
48
+ ...init,
49
+ headers: await this.buildHeaders(init.headers)
50
+ });
51
+ const envelope = await response.json();
52
+ if (!envelope.success) throw new HubSdkError(envelope.error, { status: response.status });
53
+ return envelope.data;
54
+ }
55
+ async buildHeaders(headers) {
56
+ const mergedHeaders = new Headers(headers);
57
+ mergedHeaders.set("Accept", "application/json");
58
+ if (this.apiKey) mergedHeaders.set("Authorization", `Bearer ${this.apiKey}`);
59
+ if (this.authHeaders) for (const [key, value] of new Headers(await this.authHeaders())) mergedHeaders.set(key, value);
60
+ for (const [key, value] of new Headers(headers)) mergedHeaders.set(key, value);
61
+ return mergedHeaders;
62
+ }
63
+ };
64
+ var HubTokensClient = class {
65
+ constructor(request) {
66
+ this.request = request;
67
+ }
68
+ async mint(options) {
69
+ return this.request("/v1/hub/tokens", {
70
+ method: "POST",
71
+ body: JSON.stringify(options),
72
+ headers: { "Content-Type": "application/json" }
73
+ });
74
+ }
75
+ async list(options = {}) {
76
+ const searchParams = new URLSearchParams();
77
+ if (options.includeExpired) searchParams.set("includeExpired", "true");
78
+ const query = searchParams.toString();
79
+ return { tokens: (await this.request(`/v1/hub/tokens${query ? `?${query}` : ""}`, { method: "GET" })).tokens.map((token) => ({
80
+ id: token.id,
81
+ providerId: token.providerId,
82
+ connectionId: token.connectionId,
83
+ connectionDisplay: token.connectionDisplay,
84
+ actionPath: token.actionPath,
85
+ expiresAt: token.expiresAt,
86
+ status: token.status,
87
+ principalKind: token.principalKind,
88
+ createdAt: token.createdAt
89
+ })) };
90
+ }
91
+ async revoke(tokenId) {
92
+ const response = await this.request(`/v1/hub/tokens/${encodeURIComponent(tokenId)}`, { method: "DELETE" });
93
+ return {
94
+ tokenId: response.tokenId,
95
+ status: response.status
96
+ };
97
+ }
98
+ };
99
+ var HubPermissionsClient = class {
100
+ constructor(request) {
101
+ this.request = request;
102
+ }
103
+ async list(connectionId) {
104
+ return this.request(`/v1/hub/policies?connectionId=${encodeURIComponent(connectionId)}`, { method: "GET" });
105
+ }
106
+ async set(input) {
107
+ return this.request("/v1/hub/policies", {
108
+ method: "PUT",
109
+ body: JSON.stringify(input),
110
+ headers: { "Content-Type": "application/json" }
111
+ });
112
+ }
113
+ };
114
+ var HubToolsClient = class {
115
+ constructor(request) {
116
+ this.request = request;
117
+ }
118
+ async search(query, options = {}) {
119
+ return this.request("/v1/hub/tools/search", {
120
+ method: "POST",
121
+ body: JSON.stringify({
122
+ query,
123
+ provider: options.provider
124
+ }),
125
+ headers: { "Content-Type": "application/json" }
126
+ });
127
+ }
128
+ async describe(path) {
129
+ return this.request("/v1/hub/tools/describe", {
130
+ method: "POST",
131
+ body: JSON.stringify({ path }),
132
+ headers: { "Content-Type": "application/json" }
133
+ });
134
+ }
135
+ async invoke(path, input, options = {}) {
136
+ const execInit = this.buildExecInit(path, input, options.connectionId);
137
+ try {
138
+ return await this.request("/v1/hub/exec", execInit);
139
+ } catch (error) {
140
+ if (!(error instanceof HubSdkError) || !requiresCapabilityToken(error)) throw error;
141
+ }
142
+ const minted = await this.request("/v1/hub/tokens", {
143
+ method: "POST",
144
+ body: JSON.stringify({
145
+ actionPath: path,
146
+ connectionId: options.connectionId,
147
+ provider: options.connectionId ? void 0 : path.split(".")[0]
148
+ }),
149
+ headers: { "Content-Type": "application/json" }
150
+ });
151
+ return this.request("/v1/hub/exec", {
152
+ ...execInit,
153
+ headers: {
154
+ "Content-Type": "application/json",
155
+ Authorization: `Bearer ${minted.token}`
156
+ }
157
+ });
158
+ }
159
+ buildExecInit(path, input, connectionId) {
160
+ return {
161
+ method: "POST",
162
+ body: JSON.stringify({
163
+ path,
164
+ input,
165
+ connectionId
166
+ }),
167
+ headers: { "Content-Type": "application/json" }
168
+ };
169
+ }
170
+ };
171
+ function requiresCapabilityToken(error) {
172
+ return error.code === "HUB_APPROVAL_REQUIRED";
173
+ }
174
+ var HubConnectionsClient = class {
175
+ constructor(request) {
176
+ this.request = request;
177
+ }
178
+ async list() {
179
+ return this.request("/v1/hub/connections", { method: "GET" });
180
+ }
181
+ async revoke(connectionId) {
182
+ return this.request(`/v1/hub/connections/${encodeURIComponent(connectionId)}`, { method: "DELETE" });
183
+ }
184
+ };
185
+ //#endregion
186
+ export { HubClient, HubConnectionsClient, HubPermissionsClient, HubSdkError, HubTokensClient, HubToolsClient, redactHubValue };
187
+
188
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/redaction.ts","../src/client.ts"],"sourcesContent":["const SECRET_KEY_PATTERN =\n /(api[_-]?key|authorization|capability[_-]?token|token|secret)/i;\nconst SECRET_VALUE_PATTERN =\n /\\b(?:sk-tan[-_]|hubcap_|hct_|gh[pousr]_)[A-Za-z0-9_=-]+\\b/g;\n\nexport function redactHubValue(value: unknown): unknown {\n if (typeof value === \"string\") {\n return value.replace(SECRET_VALUE_PATTERN, \"[REDACTED]\");\n }\n\n if (Array.isArray(value)) {\n return value.map((item) => redactHubValue(item));\n }\n\n if (value && typeof value === \"object\") {\n return Object.fromEntries(\n Object.entries(value).map(([key, entryValue]) => [\n key,\n SECRET_KEY_PATTERN.test(key)\n ? \"[REDACTED]\"\n : redactHubValue(entryValue),\n ]),\n );\n }\n\n return value;\n}\n","import { redactHubValue } from \"./redaction.js\";\nimport type {\n HubConnectionDeleteResponse,\n HubConnectionsResponse,\n HubEnvelope,\n HubErrorBody,\n HubExecResponse,\n HubPolicyListResponse,\n HubPolicyResponse,\n HubPolicyUpdateRequest,\n HubStatusResponse,\n HubTokenMintResponse,\n HubTokenRevokeResponse,\n HubTokensListResponse,\n HubToolsDescribeResponse,\n HubToolsSearchResponse,\n} from \"./types.js\";\n\nexport type HubAuthHeaders = () => HeadersInit | Promise<HeadersInit>;\n\nexport interface HubClientOptions {\n baseUrl: string;\n apiKey?: string;\n authHeaders?: HubAuthHeaders;\n fetch?: typeof fetch;\n}\n\nexport class HubSdkError extends Error {\n readonly code: HubErrorBody[\"code\"];\n readonly details?: unknown;\n readonly status?: number;\n\n constructor(error: HubErrorBody, options: { status?: number } = {}) {\n super(String(redactHubValue(error.message)));\n this.name = \"HubSdkError\";\n this.code = error.code;\n this.details = redactHubValue(error.details);\n this.status = options.status;\n }\n}\n\nexport class HubClient {\n readonly baseUrl: string;\n readonly fetch: typeof fetch;\n readonly apiKey?: string;\n readonly authHeaders?: HubAuthHeaders;\n readonly connections: HubConnectionsClient;\n readonly permissions: HubPermissionsClient;\n readonly tokens: HubTokensClient;\n readonly tools: HubToolsClient;\n\n constructor(options: HubClientOptions) {\n this.baseUrl = options.baseUrl.replace(/\\/+$/, \"\");\n this.apiKey = options.apiKey;\n this.authHeaders = options.authHeaders;\n this.fetch = options.fetch ?? fetch;\n this.connections = new HubConnectionsClient((path, init) =>\n this.request(path, init),\n );\n this.permissions = new HubPermissionsClient((path, init) =>\n this.request(path, init),\n );\n this.tokens = new HubTokensClient((path, init) => this.request(path, init));\n this.tools = new HubToolsClient((path, init) => this.request(path, init));\n }\n\n async status(): Promise<HubStatusResponse> {\n return this.request<HubStatusResponse>(\"/v1/hub/status\", { method: \"GET\" });\n }\n\n private async request<TData>(\n path: string,\n init: RequestInit,\n ): Promise<TData> {\n const response = await this.fetch(`${this.baseUrl}${path}`, {\n ...init,\n headers: await this.buildHeaders(init.headers),\n });\n const envelope = (await response.json()) as HubEnvelope<TData>;\n\n if (!envelope.success) {\n throw new HubSdkError(envelope.error, { status: response.status });\n }\n\n return envelope.data;\n }\n\n private async buildHeaders(headers: HeadersInit | undefined) {\n const mergedHeaders = new Headers(headers);\n mergedHeaders.set(\"Accept\", \"application/json\");\n\n if (this.apiKey) {\n mergedHeaders.set(\"Authorization\", `Bearer ${this.apiKey}`);\n }\n\n if (this.authHeaders) {\n for (const [key, value] of new Headers(await this.authHeaders())) {\n mergedHeaders.set(key, value);\n }\n }\n\n for (const [key, value] of new Headers(headers)) {\n mergedHeaders.set(key, value);\n }\n\n return mergedHeaders;\n }\n}\n\nexport interface HubTokenListOptions {\n includeExpired?: boolean;\n}\n\nexport class HubTokensClient {\n constructor(\n private readonly request: <TData>(\n path: string,\n init: RequestInit,\n ) => Promise<TData>,\n ) {}\n\n async mint(options: {\n actionPath: string;\n connectionId?: string;\n provider?: string;\n ttlSeconds?: number;\n }): Promise<HubTokenMintResponse> {\n return this.request<HubTokenMintResponse>(\"/v1/hub/tokens\", {\n method: \"POST\",\n body: JSON.stringify(options),\n headers: { \"Content-Type\": \"application/json\" },\n });\n }\n\n async list(\n options: HubTokenListOptions = {},\n ): Promise<HubTokensListResponse> {\n const searchParams = new URLSearchParams();\n if (options.includeExpired) searchParams.set(\"includeExpired\", \"true\");\n const query = searchParams.toString();\n const response = await this.request<HubTokensListResponse>(\n `/v1/hub/tokens${query ? `?${query}` : \"\"}`,\n { method: \"GET\" },\n );\n return {\n tokens: response.tokens.map((token) => ({\n id: token.id,\n providerId: token.providerId,\n connectionId: token.connectionId,\n connectionDisplay: token.connectionDisplay,\n actionPath: token.actionPath,\n expiresAt: token.expiresAt,\n status: token.status,\n principalKind: token.principalKind,\n createdAt: token.createdAt,\n })),\n };\n }\n\n async revoke(tokenId: string): Promise<HubTokenRevokeResponse> {\n const response = await this.request<HubTokenRevokeResponse>(\n `/v1/hub/tokens/${encodeURIComponent(tokenId)}`,\n { method: \"DELETE\" },\n );\n return {\n tokenId: response.tokenId,\n status: response.status,\n };\n }\n}\n\nexport class HubPermissionsClient {\n constructor(\n private readonly request: <TData>(\n path: string,\n init: RequestInit,\n ) => Promise<TData>,\n ) {}\n\n async list(connectionId: string): Promise<HubPolicyListResponse> {\n return this.request<HubPolicyListResponse>(\n `/v1/hub/policies?connectionId=${encodeURIComponent(connectionId)}`,\n { method: \"GET\" },\n );\n }\n\n async set(input: HubPolicyUpdateRequest): Promise<HubPolicyResponse> {\n return this.request<HubPolicyResponse>(\"/v1/hub/policies\", {\n method: \"PUT\",\n body: JSON.stringify(input),\n headers: { \"Content-Type\": \"application/json\" },\n });\n }\n}\n\nexport interface HubToolSearchOptions {\n provider?: string;\n}\n\nexport interface HubToolInvokeOptions {\n connectionId?: string;\n}\n\nexport class HubToolsClient {\n constructor(\n private readonly request: <TData>(\n path: string,\n init: RequestInit,\n ) => Promise<TData>,\n ) {}\n\n async search(\n query: string,\n options: HubToolSearchOptions = {},\n ): Promise<HubToolsSearchResponse> {\n return this.request<HubToolsSearchResponse>(\"/v1/hub/tools/search\", {\n method: \"POST\",\n body: JSON.stringify({ query, provider: options.provider }),\n headers: { \"Content-Type\": \"application/json\" },\n });\n }\n\n async describe(path: string): Promise<HubToolsDescribeResponse> {\n return this.request<HubToolsDescribeResponse>(\"/v1/hub/tools/describe\", {\n method: \"POST\",\n body: JSON.stringify({ path }),\n headers: { \"Content-Type\": \"application/json\" },\n });\n }\n\n async invoke<TResult = unknown>(\n path: string,\n input: unknown,\n options: HubToolInvokeOptions = {},\n ): Promise<HubExecResponse<TResult>> {\n const execInit = this.buildExecInit(path, input, options.connectionId);\n try {\n return await this.request<HubExecResponse<TResult>>(\n \"/v1/hub/exec\",\n execInit,\n );\n } catch (error) {\n if (!(error instanceof HubSdkError) || !requiresCapabilityToken(error)) {\n throw error;\n }\n }\n\n const minted = await this.request<HubTokenMintResponse>(\"/v1/hub/tokens\", {\n method: \"POST\",\n body: JSON.stringify({\n actionPath: path,\n connectionId: options.connectionId,\n provider: options.connectionId ? undefined : path.split(\".\")[0],\n }),\n headers: { \"Content-Type\": \"application/json\" },\n });\n\n return this.request<HubExecResponse<TResult>>(\"/v1/hub/exec\", {\n ...execInit,\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: `Bearer ${minted.token}`,\n },\n });\n }\n\n private buildExecInit(\n path: string,\n input: unknown,\n connectionId: string | undefined,\n ): RequestInit {\n return {\n method: \"POST\",\n body: JSON.stringify({ path, input, connectionId }),\n headers: { \"Content-Type\": \"application/json\" },\n };\n }\n}\n\nfunction requiresCapabilityToken(error: HubSdkError): boolean {\n return error.code === \"HUB_APPROVAL_REQUIRED\";\n}\n\nexport class HubConnectionsClient {\n constructor(\n private readonly request: <TData>(\n path: string,\n init: RequestInit,\n ) => Promise<TData>,\n ) {}\n\n async list(): Promise<HubConnectionsResponse> {\n return this.request<HubConnectionsResponse>(\"/v1/hub/connections\", {\n method: \"GET\",\n });\n }\n\n async revoke(connectionId: string): Promise<HubConnectionDeleteResponse> {\n return this.request<HubConnectionDeleteResponse>(\n `/v1/hub/connections/${encodeURIComponent(connectionId)}`,\n { method: \"DELETE\" },\n );\n }\n}\n"],"mappings":";AAAA,MAAM,qBACJ;AACF,MAAM,uBACJ;AAEF,SAAgB,eAAe,OAAyB;AACtD,KAAI,OAAO,UAAU,SACnB,QAAO,MAAM,QAAQ,sBAAsB,aAAa;AAG1D,KAAI,MAAM,QAAQ,MAAM,CACtB,QAAO,MAAM,KAAK,SAAS,eAAe,KAAK,CAAC;AAGlD,KAAI,SAAS,OAAO,UAAU,SAC5B,QAAO,OAAO,YACZ,OAAO,QAAQ,MAAM,CAAC,KAAK,CAAC,KAAK,gBAAgB,CAC/C,KACA,mBAAmB,KAAK,IAAI,GACxB,eACA,eAAe,WAAW,CAC/B,CAAC,CACH;AAGH,QAAO;;;;ACET,IAAa,cAAb,cAAiC,MAAM;CACrC;CACA;CACA;CAEA,YAAY,OAAqB,UAA+B,EAAE,EAAE;AAClE,QAAM,OAAO,eAAe,MAAM,QAAQ,CAAC,CAAC;AAC5C,OAAK,OAAO;AACZ,OAAK,OAAO,MAAM;AAClB,OAAK,UAAU,eAAe,MAAM,QAAQ;AAC5C,OAAK,SAAS,QAAQ;;;AAI1B,IAAa,YAAb,MAAuB;CACrB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA,YAAY,SAA2B;AACrC,OAAK,UAAU,QAAQ,QAAQ,QAAQ,QAAQ,GAAG;AAClD,OAAK,SAAS,QAAQ;AACtB,OAAK,cAAc,QAAQ;AAC3B,OAAK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AAuB,mBAAmB,aAAa,IACvD,EAAE,QAAQ,UAAU,CACrB"}
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@tangle-network/hub-sdk",
3
+ "version": "0.2.0",
4
+ "description": "Typed SDK for Tangle Hub tool discovery and execution",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.js",
11
+ "types": "./dist/index.d.ts"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "devDependencies": {
18
+ "@types/node": "25.6.0",
19
+ "tsdown": "0.21.10",
20
+ "typescript": "^6.0.3",
21
+ "vitest": "^4.1.5"
22
+ },
23
+ "scripts": {
24
+ "build": "tsdown",
25
+ "check-types": "tsc --noEmit",
26
+ "test": "vitest run",
27
+ "test:watch": "vitest"
28
+ }
29
+ }