@tangle-network/hub-sdk 0.19.1-develop.20260805180846.4acfc47 → 0.19.1

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/dist/index.d.ts CHANGED
@@ -1,3 +1,357 @@
1
+ //#region src/allowances.d.ts
2
+ /**
3
+ * Allowances: a developer's per-member daily allowance on a meter, and the
4
+ * paywall decision past it. The platform counts every admitted turn and reads
5
+ * each payer's dollars from the ledger; the app keeps only its checkout and
6
+ * records a paying member with {@link HubAllowancesClient.grant}.
7
+ *
8
+ * Only the meter's owner may call these, signed in or with a root API key of
9
+ * their own. A delegated or resource-bound key, such as the key a hosted end
10
+ * user's sandbox runs on, is refused.
11
+ */
12
+ type HubAllowanceTier = "free" | "paid" | "owner";
13
+ type HubAllowanceRole = "owner" | "member";
14
+ interface HubAllowancePlanInput {
15
+ free: {
16
+ turnsPerDay: number;
17
+ usdPerDay: number | null;
18
+ };
19
+ /** Null turns billing off: past the free allowance nothing lifts the limit. */
20
+ paid: {
21
+ turnsPerDay: number;
22
+ usdPerDay: number | null;
23
+ priceUsdMonthly: number;
24
+ } | null;
25
+ owner?: {
26
+ turnsPerDay: number;
27
+ };
28
+ /** Key resource type whose ledger spend counts against a payer's dollars. */
29
+ spendResourceType: string | null;
30
+ }
31
+ interface HubAllowancePlan extends HubAllowancePlanInput {
32
+ meter: string;
33
+ owner: {
34
+ turnsPerDay: number;
35
+ };
36
+ /** False while the meter runs on the default plan. */
37
+ configured: boolean;
38
+ updatedAt: string | null;
39
+ }
40
+ interface HubAllowanceSubject {
41
+ member: string;
42
+ role?: HubAllowanceRole;
43
+ /** The member whose keys pay for the turn, when that is someone else. */
44
+ payer?: string;
45
+ payerRole?: HubAllowanceRole;
46
+ }
47
+ interface HubAllowanceDecision {
48
+ /** `paywall`: paying lifts the limit. `allowance_reached`: nothing does today. */
49
+ decision: "admit" | "paywall" | "allowance_reached";
50
+ tier: HubAllowanceTier;
51
+ paywall: boolean;
52
+ turns: {
53
+ used: number;
54
+ limit: number;
55
+ };
56
+ usd: {
57
+ spent: number;
58
+ limit: number;
59
+ remaining: number;
60
+ } | null;
61
+ day: string;
62
+ resetsAt: string;
63
+ /**
64
+ * A paying payer's spend in the current paid period against what funds it:
65
+ * the plan price less Tangle's 10% fee, plus the free daily allowance for
66
+ * the period. A paid turn is refused once `remaining` is gone.
67
+ */
68
+ period?: {
69
+ spent: number;
70
+ funded: number;
71
+ remaining: number;
72
+ startsAt: string;
73
+ endsAt: string;
74
+ };
75
+ replay?: boolean;
76
+ }
77
+ interface HubAllowanceUsage {
78
+ day: string;
79
+ turns: number;
80
+ members: Array<{
81
+ member: string;
82
+ turns: number;
83
+ tier: HubAllowanceTier;
84
+ usdSpent: number | null;
85
+ }>;
86
+ lines: Array<{
87
+ line: string;
88
+ turns: number;
89
+ }>;
90
+ }
91
+ interface HubAllowanceGrant {
92
+ member: string;
93
+ tier: "paid";
94
+ expiresAt: string;
95
+ reference: string | null;
96
+ }
97
+ declare class HubAllowancesClient {
98
+ private readonly request;
99
+ constructor(request: <T>(path: string, init: RequestInit) => Promise<T>);
100
+ plan(meter: string): Promise<HubAllowancePlan>;
101
+ setPlan(meter: string, plan: HubAllowancePlanInput): Promise<HubAllowancePlan>;
102
+ /** Admit one turn or refuse it. Retrying the same `turnId` never counts twice. */
103
+ admit(meter: string, input: HubAllowanceSubject & {
104
+ turnId: string;
105
+ line?: string;
106
+ channel?: string;
107
+ }): Promise<HubAllowanceDecision>;
108
+ /** What the member's next turn would get, without counting anything. */
109
+ status(meter: string, subject: HubAllowanceSubject): Promise<HubAllowanceDecision>;
110
+ /** Move a member to the paid allowance until `expiresAt` (the paid period's end). */
111
+ grant(meter: string, member: string, input: {
112
+ expiresAt: string;
113
+ reference?: string | null;
114
+ }): Promise<HubAllowanceGrant>;
115
+ revoke(meter: string, member: string): Promise<void>;
116
+ /** Turns per member and per line on one UTC day (default today). */
117
+ usage(meter: string, day?: string): Promise<HubAllowanceUsage>;
118
+ private path;
119
+ private memberPath;
120
+ private body;
121
+ }
122
+ //#endregion
123
+ //#region src/apps.d.ts
124
+ /** App identity and customer permissions over the existing Platform transport.
125
+ * These operations do not authorize spending or expose upstream credentials. */
126
+ interface HubApp {
127
+ id: string;
128
+ clientId: string;
129
+ oauthClientId: string | null;
130
+ name: string;
131
+ redirectUris: string[];
132
+ allowedScopes: string[];
133
+ homepageUrl: string | null;
134
+ status: "active" | "revoked";
135
+ createdAt: string;
136
+ updatedAt: string;
137
+ }
138
+ interface HubAppCreateInput {
139
+ name: string;
140
+ redirectUris: string[];
141
+ allowedScopes: string[];
142
+ homepageUrl?: string;
143
+ /** Associate an existing owned login client in the same transaction as creation. */
144
+ oauthClientId?: string;
145
+ }
146
+ interface HubAppGrant {
147
+ id: string;
148
+ appId: string;
149
+ userId: string;
150
+ connectionId: string;
151
+ scopes: string[];
152
+ status: "active" | "revoked";
153
+ createdAt: string;
154
+ updatedAt: string;
155
+ revokedAt: string | null;
156
+ /** Display metadata is additive; older deployments may omit it. */
157
+ appName?: string | null;
158
+ oauthClientId?: string | null;
159
+ providerId?: string | null;
160
+ accountDisplay?: string | null;
161
+ connectionDisplayName?: string | null;
162
+ }
163
+ interface HubAppGrantRevoked {
164
+ grantId: string;
165
+ status: "revoked";
166
+ revokedAt: string | null;
167
+ tokensRevoked: number;
168
+ }
169
+ declare class HubAppsClient {
170
+ private readonly request;
171
+ readonly grants: {
172
+ list: () => Promise<HubAppGrant[]>;
173
+ revoke: (grantId: string) => Promise<HubAppGrantRevoked>;
174
+ };
175
+ constructor(request: <T>(path: string, init: RequestInit) => Promise<T>);
176
+ list(): Promise<HubApp[]>;
177
+ /** The secret is returned only by creation; keep it in your server vault. */
178
+ create(input: HubAppCreateInput): Promise<{
179
+ app: HubApp;
180
+ clientSecret: string;
181
+ }>;
182
+ /** Immutable association of two existing records with the same owner. */
183
+ linkOAuthClient(appId: string, clientId: string): Promise<{
184
+ appId: string;
185
+ oauthClientId: string;
186
+ }>;
187
+ revoke(appId: string): Promise<{
188
+ appId: string;
189
+ grantsRevoked: number;
190
+ tokensRevoked: number;
191
+ }>;
192
+ }
193
+ //#endregion
194
+ //#region src/inbound-webhooks.d.ts
195
+ /** Provider setup uses the existing authenticated Hub transport and vault. */
196
+ interface HubInboundWebhookCreateOptions {
197
+ /** Inkbox identity that owns all selected channels. */
198
+ identityId?: string;
199
+ mailboxId?: string;
200
+ phoneNumberId?: string;
201
+ imessage?: boolean;
202
+ /** Linq: explicit owned lines; omitted does not mean every account line. */
203
+ phoneNumbers?: string[];
204
+ /** Linq WhatsApp: explicit opaque IDs from numbers.list, not E.164 phone strings. */
205
+ phoneNumberIds?: string[];
206
+ /** Contiguity Console secret, or an existing Inkbox identity signing key. */
207
+ signingSecret?: string;
208
+ }
209
+ interface HubInboundWebhookCreateResponse {
210
+ url: string;
211
+ /** True only when the provider subscription was created by the server. */
212
+ provisioned?: boolean;
213
+ /** Self-configured legacy providers can return a newly minted secret once. */
214
+ secret?: string;
215
+ inboundAddress?: string;
216
+ requiresProviderSetup?: boolean;
217
+ }
218
+ interface HubInboundWebhookStatus {
219
+ configured: boolean;
220
+ url?: string;
221
+ /** Configuration is not evidence of a real delivered message. */
222
+ deliveryVerified: false;
223
+ requiresProviderSetup?: boolean;
224
+ }
225
+ /** Live provider readback for one explicitly selected Linq WhatsApp number. */
226
+ interface HubInboundPhoneNumberScope {
227
+ configured: true;
228
+ provisioned: true;
229
+ subscribed: true;
230
+ phoneNumberIds: string[];
231
+ }
232
+ declare class HubInboundWebhooksClient {
233
+ private readonly request;
234
+ constructor(request: <T>(path: string, init: RequestInit) => Promise<T>);
235
+ create(connectionId: string, options?: HubInboundWebhookCreateOptions): Promise<HubInboundWebhookCreateResponse>;
236
+ get(connectionId: string): Promise<HubInboundWebhookStatus>;
237
+ /** Add one owned Linq WhatsApp number without rotating the webhook secret. */
238
+ ensurePhoneNumber(connectionId: string, phoneNumberId: string): Promise<HubInboundPhoneNumberScope>;
239
+ /** Remove event subscriptions first. This does not silently rotate a live URL. */
240
+ delete(connectionId: string): Promise<{
241
+ removed: boolean;
242
+ }>;
243
+ private path;
244
+ }
245
+ //#endregion
246
+ //#region src/managed-numbers.d.ts
247
+ interface HubNumberReadiness {
248
+ configured: boolean;
249
+ provider: "inkbox";
250
+ transports: Array<"sms" | "imessage">;
251
+ billing: "prepaid_activation";
252
+ automaticRentalBilling: false;
253
+ deliveryVerified: false;
254
+ }
255
+ interface HubNumberQuote {
256
+ transport: "sms" | "imessage";
257
+ activationCents: number;
258
+ currency: "usd";
259
+ termsVersion: string;
260
+ terms: string;
261
+ expiresAt: number;
262
+ /** The binding the quote was issued for. Absent from older servers. */
263
+ clientReference?: string;
264
+ /** Opaque. Pass it back to `create`; never decode it. */
265
+ token: string;
266
+ }
267
+ /** One page of the owner's orders, newest first. */
268
+ interface HubNumberOrderPage {
269
+ orders: HubNumberOrder[];
270
+ /** Present while more orders exist. Older servers omit it and return one
271
+ * bounded page, so an absent cursor never proves an order does not exist. */
272
+ nextCursor?: string | null;
273
+ }
274
+ interface HubNumberListQuery {
275
+ /** Only orders requested for this binding, including closed ones. */
276
+ clientReference?: string;
277
+ cursor?: string;
278
+ /** 1 to 100; the server default is 100. */
279
+ limit?: number;
280
+ }
281
+ /** An operator's terminal decision on an order stuck in `needs_review`.
282
+ * Read-only for a creator: the resolution is made through the platform's
283
+ * admin surface, never through this client. */
284
+ interface HubNumberResolution {
285
+ action: "release" | "settle" | "abandon";
286
+ operator: string;
287
+ reason: string;
288
+ at: number;
289
+ /** Present while the operator's action is still running. The decision is
290
+ * not final and the order can still return to review. */
291
+ pending?: true;
292
+ /** Present when a `settle` handed a live, unfinished order back to
293
+ * provisioning, so the order is working again rather than closed. */
294
+ requeued?: true;
295
+ }
296
+ interface HubNumberOrder {
297
+ id: string;
298
+ clientReference: string;
299
+ transport: "sms" | "imessage";
300
+ status: "pending" | "provider_pending" | "needs_review" | "ready_for_setup" | "cancelled";
301
+ phase: "identity" | "number" | "credential" | "connection" | "complete";
302
+ address: string | null;
303
+ connectionId: string | null;
304
+ identityId: string | null;
305
+ providerNumberId: string | null;
306
+ billingStatus: "unreserved" | "reserved" | "settled" | "released";
307
+ cancellation: "none" | "requested" | "needs_review" | "released" | "abandoned";
308
+ errorCode: string | null;
309
+ nextAttemptAt: number | null;
310
+ resolution: HubNumberResolution | null;
311
+ deliveryVerified: false;
312
+ activationCents: number;
313
+ currency: "usd";
314
+ terms: string;
315
+ }
316
+ /** Administrative number operations through Hub's authenticated transport.
317
+ * A mutation is one attempt; an uncertain create reuses its quote and reference. */
318
+ declare class HubManagedNumbersClient {
319
+ private readonly request;
320
+ constructor(request: <T>(path: string, init: RequestInit) => Promise<T>);
321
+ readiness(): Promise<HubNumberReadiness>;
322
+ /** One page of orders. Scope by `clientReference` to ask about one binding,
323
+ * and follow `nextCursor` for the rest; a page is never ownership evidence. */
324
+ list(query?: HubNumberListQuery): Promise<HubNumberOrderPage>;
325
+ get(id: string): Promise<{
326
+ order: HubNumberOrder;
327
+ }>;
328
+ quote(input: {
329
+ transport: "sms" | "imessage";
330
+ clientReference: string;
331
+ }): Promise<{
332
+ quote: HubNumberQuote;
333
+ }>;
334
+ /** `clientReference` and `transport`, when given, must match the signed
335
+ * quote or Hub refuses the purchase with a conflict. */
336
+ create(input: {
337
+ quoteToken: string;
338
+ consent: true;
339
+ state?: string;
340
+ clientReference?: string;
341
+ transport?: "sms" | "imessage";
342
+ }): Promise<{
343
+ order: HubNumberOrder;
344
+ }>;
345
+ advance(id: string): Promise<{
346
+ order: HubNumberOrder;
347
+ }>;
348
+ cancel(id: string): Promise<{
349
+ order: HubNumberOrder;
350
+ }>;
351
+ private path;
352
+ private post;
353
+ }
354
+ //#endregion
1
355
  //#region src/types.d.ts
2
356
  type HubPrincipalKind = "user_session" | "api_key" | "sandbox_runtime";
3
357
  interface HubSuccessEnvelope<TData> {
@@ -14,7 +368,7 @@ interface HubErrorBody {
14
368
  message: string;
15
369
  details?: unknown;
16
370
  }
17
- type HubErrorCode = "HUB_UNAUTHENTICATED" | "HUB_FORBIDDEN" | "HUB_INVALID_INPUT" | "HUB_INVALID_STATE" | "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_CONFIG_INVALID" | "HUB_NOT_FOUND" | "HUB_NOT_IMPLEMENTED" | "HUB_CONFLICT" | "VALIDATION_ERROR" | "WORKFLOW_INVALID" | "NOT_FOUND" | "UNAUTHORIZED" | "CONFLICT" | "MISSING_RUN_INPUTS" | "WORKFLOW_DISABLED" | "PAYLOAD_TOO_LARGE" | "WORKFLOW_RUN_TIMEOUT" | `HUB_HTTP_${number}`;
371
+ type HubErrorCode = "HUB_UNAUTHENTICATED" | "HUB_FORBIDDEN" | "HUB_INVALID_INPUT" | "HUB_INVALID_STATE" | "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_PROVIDER_REJECTED" | "HUB_CONFIG_MISSING" | "HUB_CONFIG_INVALID" | "HUB_NOT_FOUND" | "HUB_NOT_IMPLEMENTED" | "HUB_CONFLICT" | "HUB_IDEMPOTENCY_CONFLICT" | "HUB_IDEMPOTENCY_IN_FLIGHT" | "VALIDATION_ERROR" | "WORKFLOW_INVALID" | "NOT_FOUND" | "UNAUTHORIZED" | "CONFLICT" | "MISSING_RUN_INPUTS" | "WORKFLOW_DISABLED" | "PAYLOAD_TOO_LARGE" | "WORKFLOW_RUN_TIMEOUT" | `HUB_HTTP_${number}`;
18
372
  interface HubStatusResponse {
19
373
  contract: unknown;
20
374
  principal: HubPrincipal;
@@ -36,6 +390,7 @@ interface HubConnection {
36
390
  providerId: string;
37
391
  displayName: string;
38
392
  accountDisplay: string | null;
393
+ providerAccountId: string | null;
39
394
  scopes: string[];
40
395
  status: "active" | "revoked" | "unhealthy" | "reconnect_required";
41
396
  health: "unknown" | "healthy" | "unhealthy" | "rate_limited";
@@ -168,6 +523,15 @@ interface HubEventDelivery {
168
523
  }
169
524
  /** A connector's auth model. */
170
525
  type HubProviderAuthKind = "oauth2" | "api_key" | "none" | "custom";
526
+ /** One non-secret value needed before an OAuth redirect can be built. Tenant-
527
+ * scoped providers use this for the account label in their OAuth hostname. */
528
+ interface HubOAuthConnectionParameter {
529
+ key: string;
530
+ label: string;
531
+ description: string;
532
+ placeholder: string;
533
+ required: true;
534
+ }
171
535
  interface HubProvider {
172
536
  providerId: string;
173
537
  title: string;
@@ -193,6 +557,9 @@ interface HubProvider {
193
557
  /** True when the provider's OAuth app credentials are wired, i.e. a connect
194
558
  * flow can actually start. UIs offer Connect only for configured providers. */
195
559
  configured: boolean;
560
+ /** Values the user must supply before OAuth starts. Empty or absent means the
561
+ * provider can redirect immediately. */
562
+ connectionParameters?: HubOAuthConnectionParameter[];
196
563
  /**
197
564
  * True when this deployment can receive this provider's inbound events.
198
565
  * This is separate from `configured`: OAuth can be ready while the shared
@@ -209,6 +576,7 @@ interface HubOAuthStartRequest {
209
576
  provider: string;
210
577
  returnUrl?: string;
211
578
  cli?: boolean;
579
+ connectionParameters?: Record<string, string>;
212
580
  }
213
581
  interface HubOAuthCallbackSuccessQuery {
214
582
  provider: string;
@@ -269,7 +637,18 @@ interface HubOAuthCallbackResponse {
269
637
  interface HubApiKeyConnectRequest {
270
638
  provider: string;
271
639
  apiKey: string;
640
+ /** Connector-owned setup values. Hub validates them before testing the key. */
641
+ metadata?: HubApiKeyConnectionMetadata;
272
642
  }
643
+ type HubApiKeyConnectionMetadata = {
644
+ propertyId: string;
645
+ currency?: string;
646
+ } | {
647
+ listings: Array<{
648
+ id: string;
649
+ pms: string;
650
+ }>;
651
+ };
273
652
  /** Result of an api-key connect: the created (or reconnected) connection.
274
653
  * Synchronous — there is no redirect leg, unlike the OAuth flow. */
275
654
  interface HubApiKeyConnectResponse {
@@ -285,7 +664,7 @@ interface HubConnectionDeleteResponse {
285
664
  interface HubConnectionHealthRequest {
286
665
  connectionId: string;
287
666
  }
288
- type HubConnectionHealthStatus = "healthy" | "reconnect_required" | "unhealthy" | "rate_limited";
667
+ type HubConnectionHealthStatus = "healthy" | "reconnect_required" | "unhealthy" | "rate_limited" | "unsupported";
289
668
  interface HubConnectionHealthError {
290
669
  code: string;
291
670
  message: string;
@@ -345,9 +724,18 @@ interface HubExecRequest {
345
724
  path: string;
346
725
  input?: unknown;
347
726
  connectionId?: string;
727
+ /** Caller-minted key for this exec. The platform ledger replays the first
728
+ * call's result for a retry that carries the same key, and rejects a key
729
+ * reused for a different request. On the capability-token arm the key only
730
+ * reaches the connector for provider-native dedupe: that arm is at-most-once
731
+ * per token and replays no stored result. */
732
+ idempotencyKey?: string;
348
733
  }
349
734
  interface HubExecResponse<TResult = unknown> {
350
735
  result: TResult;
736
+ /** True when the result was replayed from a previous call with the same
737
+ * idempotency key, so the action did not run again. */
738
+ replayed?: boolean;
351
739
  }
352
740
  interface HubTokenMintRequest {
353
741
  connectionId?: string;
@@ -505,7 +893,7 @@ interface HubGithubAppInstallation {
505
893
  accountType: string | null;
506
894
  /** "all" ⇒ every repo under the account; "selected" ⇒ only repoFullNames. */
507
895
  repositorySelection: "all" | "selected";
508
- /** Lowercased "owner/repo" — empty when repositorySelection = "all". */
896
+ /** Metadata omits names; use githubApp.listRepos(id) for a live caller-safe list. */
509
897
  repoFullNames: string[];
510
898
  suspended: boolean;
511
899
  }
@@ -558,8 +946,10 @@ interface HubGithubAppSyncResponse {
558
946
  }
559
947
  interface HubGithubAppListReposResponse {
560
948
  installationId: number;
561
- /** Lowercased "owner/repo" — covers the full registry view of the install. */
949
+ /** Complete live intersection of App coverage and the caller's GitHub access. */
562
950
  repoFullNames: string[];
951
+ /** True only when both upstream listings completed; failures return an error. */
952
+ complete: true;
563
953
  }
564
954
  interface HubGithubAppIsRepoInstalledRequest {
565
955
  owner: string;
@@ -1102,6 +1492,14 @@ interface HubWorkflowConnectionRequirement {
1102
1492
  /** Where to satisfy the requirement (App install flow for `github_app`,
1103
1493
  * integrations page otherwise); null when no target exists. */
1104
1494
  connectUrl: string | null;
1495
+ /** Another requirement in the same list that must be satisfied first — a
1496
+ * `github_app` install is claimed through the `github` connection, so it is
1497
+ * refused while that connection is missing. Null when nothing blocks this
1498
+ * requirement. The list is ordered prerequisite-first. */
1499
+ prerequisite: {
1500
+ provider: string;
1501
+ kind: "integration" | "github_app";
1502
+ } | null;
1105
1503
  }
1106
1504
  /**
1107
1505
  * Result of instantiating a template. `created: false` is NOT an error — an
@@ -1225,8 +1623,11 @@ declare class HubClient {
1225
1623
  readonly fetch: typeof fetch;
1226
1624
  readonly apiKey?: string;
1227
1625
  readonly authHeaders?: HubAuthHeaders;
1626
+ readonly allowances: HubAllowancesClient;
1627
+ readonly apps: HubAppsClient;
1228
1628
  readonly connections: HubConnectionsClient;
1229
1629
  readonly channels: HubChannelsClient;
1630
+ readonly numbers: HubManagedNumbersClient;
1230
1631
  readonly eventSubscriptions: HubEventSubscriptionsClient;
1231
1632
  readonly permissions: HubPermissionsClient;
1232
1633
  readonly tokens: HubTokensClient;
@@ -1304,6 +1705,13 @@ interface HubToolSearchOptions {
1304
1705
  interface HubToolInvokeOptions {
1305
1706
  connectionId?: string;
1306
1707
  approve?: boolean;
1708
+ /** Caller-minted key for this invoke. On the direct exec arm the platform
1709
+ * ledger replays the first call's result for a retry that carries the same
1710
+ * key, and refuses a key bound to a different request. The approval and
1711
+ * capability-token retries re-send the key, and the connector receives it
1712
+ * for provider-native dedupe. Capability-token execution stays at-most-once
1713
+ * per token: it refuses a replay instead of replaying a stored result. */
1714
+ idempotencyKey?: string;
1307
1715
  }
1308
1716
  declare class HubToolsClient {
1309
1717
  private readonly request;
@@ -1311,12 +1719,18 @@ declare class HubToolsClient {
1311
1719
  search(query: string, options?: HubToolSearchOptions): Promise<HubToolsSearchResponse>;
1312
1720
  sources(): Promise<HubToolSourcesResponse>;
1313
1721
  describe(path: string): Promise<HubToolsDescribeResponse>;
1314
- invoke<TResult = unknown>(path: string, input: unknown, options?: HubToolInvokeOptions): Promise<HubExecResponse<TResult>>;
1722
+ /**
1723
+ * Run one hub tool. `raw` is the tool input: the SDK forwards it verbatim as
1724
+ * the request body's `input`, and the server validates it against the tool's
1725
+ * own schema, so the client never gives it a shape.
1726
+ */
1727
+ invoke<TResult = unknown>(path: string, raw: unknown, options?: HubToolInvokeOptions): Promise<HubExecResponse<TResult>>;
1315
1728
  private buildExecInit;
1316
1729
  }
1317
1730
  interface HubConnectionStartOptions {
1318
1731
  returnUrl?: string;
1319
1732
  cli?: boolean;
1733
+ connectionParameters?: Record<string, string>;
1320
1734
  }
1321
1735
  declare class HubChannelsClient {
1322
1736
  private readonly request;
@@ -1334,6 +1748,7 @@ declare class HubEventSubscriptionsClient {
1334
1748
  }
1335
1749
  declare class HubConnectionsClient {
1336
1750
  private readonly request;
1751
+ readonly inboundWebhook: HubInboundWebhooksClient;
1337
1752
  constructor(request: <TData>(path: string, init: RequestInit) => Promise<TData>);
1338
1753
  list(): Promise<HubConnectionsResponse>;
1339
1754
  /** Connector catalog: every provider the hub can expose, each flagged with
@@ -1346,8 +1761,9 @@ declare class HubConnectionsClient {
1346
1761
  /** Connect a non-OAuth (api-key) connector by submitting the user's key.
1347
1762
  * The server validates the key with a live probe before persisting and
1348
1763
  * returns the created (or reconnected) connection — there is no redirect,
1349
- * unlike `start`. */
1350
- connectApiKey(provider: string, apiKey: string): Promise<HubApiKeyConnectResponse>;
1764
+ * unlike `start`. Cloudbeds requires propertyId metadata and PriceLabs
1765
+ * requires listing ID/PMS pairs; other providers have no metadata. */
1766
+ connectApiKey(provider: string, apiKey: string, metadata?: HubApiKeyConnectRequest["metadata"]): Promise<HubApiKeyConnectResponse>;
1351
1767
  revoke(connectionId: string): Promise<HubConnectionDeleteResponse>;
1352
1768
  health(connectionId: string): Promise<HubConnectionHealthResponse>;
1353
1769
  }
@@ -1629,15 +2045,18 @@ declare class HubWorkflowsClient {
1629
2045
  /**
1630
2046
  * Upsert a key; returns the entry with its NEW version (increments on every
1631
2047
  * write). Throws `HubSdkError(KV_VALUE_TOO_LARGE)` past the 64KiB value cap
1632
- * or `KV_KEY_LIMIT` past the per-workflow key cap.
2048
+ * or `KV_KEY_LIMIT` past the per-workflow key cap. `raw` is the caller's
2049
+ * value, stored and read back verbatim, so the client never gives it a shape.
1633
2050
  */
1634
- putKv(id: string, key: string, value: unknown): Promise<HubWorkflowKvEntry>;
2051
+ putKv(id: string, key: string, raw: unknown): Promise<HubWorkflowKvEntry>;
1635
2052
  /**
1636
2053
  * Compare-and-swap: the write lands only when the stored version still
1637
2054
  * equals `expectedVersion`; otherwise `HubSdkError(KV_VERSION_CONFLICT)`
1638
- * (409) — re-read and retry. Creation is {@link putKv}'s job.
2055
+ * (409) — re-read and retry. Creation is {@link putKv}'s job. `raw` is the
2056
+ * caller's value, stored and read back verbatim, so the client never gives it
2057
+ * a shape.
1639
2058
  */
1640
- casKv(id: string, key: string, expectedVersion: number, value: unknown): Promise<HubWorkflowKvEntry>;
2059
+ casKv(id: string, key: string, expectedVersion: number, raw: unknown): Promise<HubWorkflowKvEntry>;
1641
2060
  /** Delete a key; idempotent — `deleted` reports whether a row was removed. */
1642
2061
  deleteKv(id: string, key: string): Promise<HubWorkflowKvDeleteResponse>;
1643
2062
  /** The curated starter gallery runnable on THIS deployment: metadata,
@@ -1766,5 +2185,5 @@ declare function parseHubEventDelivery(input: string | unknown): HubEventDeliver
1766
2185
  //#region src/redaction.d.ts
1767
2186
  declare function redactHubValue(value: unknown): unknown;
1768
2187
  //#endregion
1769
- export { type AuthenticateHubEventRequestInput, type DeriveHubEventCallbackSecretInput, HUB_API_KEY_ENV_VAR, HUB_CAPABILITY_TOKEN_ENV_VAR, HUB_URL_ENV_VAR, type HubAgentIterationSpan, type HubAgentRunDetail, type HubApiKeyConnectRequest, type HubApiKeyConnectResponse, type HubApproval, type HubApprovalCapabilityToken, type HubApprovalDecisionResponse, type HubApprovalStatus, HubApprovalsClient, HubAuditClient, type HubAuditEvent, type HubAuditListRequest, type HubAuditResponse, type HubAuthHeaders, type HubCapabilityToken, type HubChannel, type HubChannelCreateResponse, type HubChannelDeleteResponse, HubChannelsClient, type HubChannelsResponse, HubClient, type HubClientFromEnvOptions, type HubClientOptions, type HubConnection, type HubConnectionDeleteRequest, type HubConnectionDeleteResponse, type HubConnectionHealthError, type HubConnectionHealthInfo, type HubConnectionHealthRequest, type HubConnectionHealthResponse, type HubConnectionHealthStatus, type HubConnectionStartOptions, HubConnectionsClient, type HubConnectionsResponse, type HubEmailChannel, type HubEmailChannelCreateRequest, type HubEnv, type HubEnvelope, type HubErrorBody, type HubErrorCode, type HubErrorEnvelope, type HubEventCondition, type HubEventConditionScalar, type HubEventDelivery, HubEventDeliveryError, type HubEventRequestFailureCode, type HubEventRequestResult, type HubEventSignatureFailure, type HubEventSignatureResult, type HubEventSubscription, type HubEventSubscriptionCallback, type HubEventSubscriptionCreateRequest, type HubEventSubscriptionCreateResponse, type HubEventSubscriptionDeleteResponse, type HubEventSubscriptionFilter, type HubEventSubscriptionSource, HubEventSubscriptionsClient, type HubEventSubscriptionsResponse, type HubExecRequest, type HubExecResponse, HubGithubAppClient, type HubGithubAppDisconnectResponse, type HubGithubAppInstallation, type HubGithubAppInstallationResponse, type HubGithubAppIsRepoInstalledRequest, type HubGithubAppIsRepoInstalledResponse, type HubGithubAppListInstallationsResponse, type HubGithubAppListReposResponse, type HubGithubAppManagedInstallation, type HubGithubAppMintInstallationTokenRequest, type HubGithubAppMintInstallationTokenResponse, type HubGithubAppSyncResponse, type HubGithubAppSyncedInstallation, type HubManualRunInput, type HubOAuthCallbackErrorQuery, type HubOAuthCallbackQuery, type HubOAuthCallbackResponse, type HubOAuthCallbackSuccessQuery, type HubOAuthStartRequest, type HubOAuthStartResponse, HubPermissionsClient, type HubPolicy, type HubPolicyDecision, type HubPolicyDeleteRequest, type HubPolicyDeleteResponse, type HubPolicyListRequest, type HubPolicyListResponse, type HubPolicyResponse, type HubPolicyUpdateRequest, type HubPrincipal, type HubPrincipalKind, type HubProvider, type HubProviderAuthKind, type HubProviderEvent, type HubProvidersResponse, HubSdkError, type HubStatusConnections, type HubStatusResponse, type HubSuccessEnvelope, type HubTokenListOptions, type HubTokenMintRequest, type HubTokenMintResponse, type HubTokenRevokeResponse, HubTokensClient, type HubTokensListResponse, type HubTool, type HubToolInvokeOptions, type HubToolRisk, type HubToolSearchOptions, type HubToolSource, type HubToolSourcesResponse, HubToolsClient, type HubToolsDescribeRequest, type HubToolsDescribeResponse, type HubToolsSearchRequest, type HubToolsSearchResponse, type HubUnimplementedErrorEnvelope, type HubWhatsappEmbeddedSignupCompleteRequest, type HubWhatsappEmbeddedSignupCompleteResponse, type HubWhatsappEmbeddedSignupStartRequest, type HubWhatsappEmbeddedSignupStartResponse, type HubWorkflow, type HubWorkflowAction, type HubWorkflowActionResult, type HubWorkflowAgentStep, type HubWorkflowArtifact, type HubWorkflowArtifactDownload, type HubWorkflowArtifactRef, type HubWorkflowArtifactsResponse, type HubWorkflowCondition, type HubWorkflowConditionOp, type HubWorkflowConditionScalar, type HubWorkflowConnectionRequirement, type HubWorkflowDecision, type HubWorkflowDecisionOnTimeout, type HubWorkflowDecisionResolveResult, type HubWorkflowDecisionResolvedVia, type HubWorkflowDecisionStatus, type HubWorkflowDistillationCandidate, type HubWorkflowEdgeVerdicts, type HubWorkflowEventFilter, type HubWorkflowFailureCluster, type HubWorkflowFleetEntry, type HubWorkflowFleetInsights, type HubWorkflowFleetWindow, type HubWorkflowGraphEdge, type HubWorkflowGraphJoinRule, type HubWorkflowGraphNode, type HubWorkflowGraphSpec, type HubWorkflowHealth, type HubWorkflowHookEndpoint, type HubWorkflowHookToken, type HubWorkflowKvDeleteResponse, type HubWorkflowKvEntry, type HubWorkflowKvEntryMeta, type HubWorkflowKvListResponse, type HubWorkflowNodeHealth, type HubWorkflowOnErrorOutcome, type HubWorkflowPendingDecision, type HubWorkflowPendingDecisionsResponse, type HubWorkflowProposal, type HubWorkflowProposalInput, type HubWorkflowRevision, type HubWorkflowRevisionMeta, type HubWorkflowRevisionSource, type HubWorkflowRevisionStatus, type HubWorkflowRun, type HubWorkflowRunCancelResult, type HubWorkflowRunDetail, type HubWorkflowRunEnqueued, type HubWorkflowRunInputs, type HubWorkflowRunRetried, type HubWorkflowRunStatus, type HubWorkflowRunStepsPage, type HubWorkflowRunStreamEvent, type HubWorkflowRunSummary, type HubWorkflowRunsPage, type HubWorkflowSchemaResponse, type HubWorkflowTemplate, type HubWorkflowTemplateCategory, type HubWorkflowTemplateInstantiateResult, type HubWorkflowTemplateParameter, type HubWorkflowTrigger, type HubWorkflowValidateResponse, type HubWorkflowValidationError, HubWorkflowsClient, type VerifyHubEventSignatureInput, authenticateHubEventRequest, deriveHubEventCallbackSecret, parseHubEventDelivery, redactHubValue, resolveHubAuth, resolveHubBaseUrl, verifyHubEventSignature };
2188
+ export { type AuthenticateHubEventRequestInput, type DeriveHubEventCallbackSecretInput, HUB_API_KEY_ENV_VAR, HUB_CAPABILITY_TOKEN_ENV_VAR, HUB_URL_ENV_VAR, type HubAgentIterationSpan, type HubAgentRunDetail, type HubAllowanceDecision, type HubAllowanceGrant, type HubAllowancePlan, type HubAllowancePlanInput, type HubAllowanceRole, type HubAllowanceSubject, type HubAllowanceTier, type HubAllowanceUsage, HubAllowancesClient, type HubApiKeyConnectRequest, type HubApiKeyConnectResponse, type HubApiKeyConnectionMetadata, type HubApp, type HubAppCreateInput, type HubAppGrant, type HubAppGrantRevoked, type HubApproval, type HubApprovalCapabilityToken, type HubApprovalDecisionResponse, type HubApprovalStatus, HubApprovalsClient, HubAppsClient, HubAuditClient, type HubAuditEvent, type HubAuditListRequest, type HubAuditResponse, type HubAuthHeaders, type HubCapabilityToken, type HubChannel, type HubChannelCreateResponse, type HubChannelDeleteResponse, HubChannelsClient, type HubChannelsResponse, HubClient, type HubClientFromEnvOptions, type HubClientOptions, type HubConnection, type HubConnectionDeleteRequest, type HubConnectionDeleteResponse, type HubConnectionHealthError, type HubConnectionHealthInfo, type HubConnectionHealthRequest, type HubConnectionHealthResponse, type HubConnectionHealthStatus, type HubConnectionStartOptions, HubConnectionsClient, type HubConnectionsResponse, type HubEmailChannel, type HubEmailChannelCreateRequest, type HubEnv, type HubEnvelope, type HubErrorBody, type HubErrorCode, type HubErrorEnvelope, type HubEventCondition, type HubEventConditionScalar, type HubEventDelivery, HubEventDeliveryError, type HubEventRequestFailureCode, type HubEventRequestResult, type HubEventSignatureFailure, type HubEventSignatureResult, type HubEventSubscription, type HubEventSubscriptionCallback, type HubEventSubscriptionCreateRequest, type HubEventSubscriptionCreateResponse, type HubEventSubscriptionDeleteResponse, type HubEventSubscriptionFilter, type HubEventSubscriptionSource, HubEventSubscriptionsClient, type HubEventSubscriptionsResponse, type HubExecRequest, type HubExecResponse, HubGithubAppClient, type HubGithubAppDisconnectResponse, type HubGithubAppInstallation, type HubGithubAppInstallationResponse, type HubGithubAppIsRepoInstalledRequest, type HubGithubAppIsRepoInstalledResponse, type HubGithubAppListInstallationsResponse, type HubGithubAppListReposResponse, type HubGithubAppManagedInstallation, type HubGithubAppMintInstallationTokenRequest, type HubGithubAppMintInstallationTokenResponse, type HubGithubAppSyncResponse, type HubGithubAppSyncedInstallation, type HubInboundPhoneNumberScope, type HubInboundWebhookCreateOptions, type HubInboundWebhookCreateResponse, type HubInboundWebhookStatus, HubInboundWebhooksClient, HubManagedNumbersClient, type HubManualRunInput, type HubNumberListQuery, type HubNumberOrder, type HubNumberOrderPage, type HubNumberQuote, type HubNumberReadiness, type HubNumberResolution, type HubOAuthCallbackErrorQuery, type HubOAuthCallbackQuery, type HubOAuthCallbackResponse, type HubOAuthCallbackSuccessQuery, type HubOAuthConnectionParameter, type HubOAuthStartRequest, type HubOAuthStartResponse, HubPermissionsClient, type HubPolicy, type HubPolicyDecision, type HubPolicyDeleteRequest, type HubPolicyDeleteResponse, type HubPolicyListRequest, type HubPolicyListResponse, type HubPolicyResponse, type HubPolicyUpdateRequest, type HubPrincipal, type HubPrincipalKind, type HubProvider, type HubProviderAuthKind, type HubProviderEvent, type HubProvidersResponse, HubSdkError, type HubStatusConnections, type HubStatusResponse, type HubSuccessEnvelope, type HubTokenListOptions, type HubTokenMintRequest, type HubTokenMintResponse, type HubTokenRevokeResponse, HubTokensClient, type HubTokensListResponse, type HubTool, type HubToolInvokeOptions, type HubToolRisk, type HubToolSearchOptions, type HubToolSource, type HubToolSourcesResponse, HubToolsClient, type HubToolsDescribeRequest, type HubToolsDescribeResponse, type HubToolsSearchRequest, type HubToolsSearchResponse, type HubUnimplementedErrorEnvelope, type HubWhatsappEmbeddedSignupCompleteRequest, type HubWhatsappEmbeddedSignupCompleteResponse, type HubWhatsappEmbeddedSignupStartRequest, type HubWhatsappEmbeddedSignupStartResponse, type HubWorkflow, type HubWorkflowAction, type HubWorkflowActionResult, type HubWorkflowAgentStep, type HubWorkflowArtifact, type HubWorkflowArtifactDownload, type HubWorkflowArtifactRef, type HubWorkflowArtifactsResponse, type HubWorkflowCondition, type HubWorkflowConditionOp, type HubWorkflowConditionScalar, type HubWorkflowConnectionRequirement, type HubWorkflowDecision, type HubWorkflowDecisionOnTimeout, type HubWorkflowDecisionResolveResult, type HubWorkflowDecisionResolvedVia, type HubWorkflowDecisionStatus, type HubWorkflowDistillationCandidate, type HubWorkflowEdgeVerdicts, type HubWorkflowEventFilter, type HubWorkflowFailureCluster, type HubWorkflowFleetEntry, type HubWorkflowFleetInsights, type HubWorkflowFleetWindow, type HubWorkflowGraphEdge, type HubWorkflowGraphJoinRule, type HubWorkflowGraphNode, type HubWorkflowGraphSpec, type HubWorkflowHealth, type HubWorkflowHookEndpoint, type HubWorkflowHookToken, type HubWorkflowKvDeleteResponse, type HubWorkflowKvEntry, type HubWorkflowKvEntryMeta, type HubWorkflowKvListResponse, type HubWorkflowNodeHealth, type HubWorkflowOnErrorOutcome, type HubWorkflowPendingDecision, type HubWorkflowPendingDecisionsResponse, type HubWorkflowProposal, type HubWorkflowProposalInput, type HubWorkflowRevision, type HubWorkflowRevisionMeta, type HubWorkflowRevisionSource, type HubWorkflowRevisionStatus, type HubWorkflowRun, type HubWorkflowRunCancelResult, type HubWorkflowRunDetail, type HubWorkflowRunEnqueued, type HubWorkflowRunInputs, type HubWorkflowRunRetried, type HubWorkflowRunStatus, type HubWorkflowRunStepsPage, type HubWorkflowRunStreamEvent, type HubWorkflowRunSummary, type HubWorkflowRunsPage, type HubWorkflowSchemaResponse, type HubWorkflowTemplate, type HubWorkflowTemplateCategory, type HubWorkflowTemplateInstantiateResult, type HubWorkflowTemplateParameter, type HubWorkflowTrigger, type HubWorkflowValidateResponse, type HubWorkflowValidationError, HubWorkflowsClient, type VerifyHubEventSignatureInput, authenticateHubEventRequest, deriveHubEventCallbackSecret, parseHubEventDelivery, redactHubValue, resolveHubAuth, resolveHubBaseUrl, verifyHubEventSignature };
1770
2189
  //# sourceMappingURL=index.d.ts.map