@tangle-network/hub-sdk 0.54.2-develop.20260927014918.a761d6e → 0.60.12-develop.20261003134057.9c42e58

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
@@ -88,6 +88,15 @@ interface HubAllowanceUsage {
88
88
  turns: number;
89
89
  }>;
90
90
  }
91
+ interface HubAllowanceSyncInput {
92
+ source: string;
93
+ revision: number;
94
+ expiresAt: string | null;
95
+ reference: string | null;
96
+ }
97
+ interface HubAllowanceSyncReceipt extends HubAllowanceSyncInput {
98
+ member: string;
99
+ }
91
100
  interface HubAllowanceGrant {
92
101
  member: string;
93
102
  tier: "paid";
@@ -112,6 +121,10 @@ declare class HubAllowancesClient {
112
121
  expiresAt: string;
113
122
  reference?: string | null;
114
123
  }): Promise<HubAllowanceGrant>;
124
+ /** Synchronize a paid grant by durable product revision. Null expiry writes
125
+ * a retained revocation. A delayed older update is refused, never reactivated.
126
+ * There is no fallback to the unversioned grant endpoint on older servers. */
127
+ syncGrant(meter: string, member: string, input: HubAllowanceSyncInput): Promise<HubAllowanceSyncReceipt>;
115
128
  revoke(meter: string, member: string): Promise<void>;
116
129
  /** Turns per member and per line on one UTC day (default today). */
117
130
  usage(meter: string, day?: string): Promise<HubAllowanceUsage>;
@@ -243,128 +256,6 @@ declare class HubInboundWebhooksClient {
243
256
  private path;
244
257
  }
245
258
  //#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
- /** Fences references so no order can take them again. Call it as the last
346
- * step before retiring the resource they name: a purchase that races the
347
- * retirement is then refused (`409 number_reference_fenced`) instead of
348
- * binding a line to a resource that is gone. Refused with
349
- * `409 number_reference_held` while a live order holds one of them; cancel
350
- * it first. A cancelled order no longer holds its reference, so the fence
351
- * succeeds as soon as `cancel` returns, whether or not its release is still
352
- * pending. Repeating a fence is harmless. */
353
- fence(input: {
354
- clientReferences: string[];
355
- }): Promise<{
356
- clientReferences: string[];
357
- }>;
358
- advance(id: string): Promise<{
359
- order: HubNumberOrder;
360
- }>;
361
- cancel(id: string): Promise<{
362
- order: HubNumberOrder;
363
- }>;
364
- private path;
365
- private post;
366
- }
367
- //#endregion
368
259
  //#region src/types.d.ts
369
260
  type HubPrincipalKind = "user_session" | "api_key" | "sandbox_runtime";
370
261
  interface HubSuccessEnvelope<TData> {
@@ -590,6 +481,7 @@ interface HubOAuthStartRequest {
590
481
  returnUrl?: string;
591
482
  cli?: boolean;
592
483
  connectionParameters?: Record<string, string>;
484
+ requestedScopes?: readonly string[];
593
485
  }
594
486
  interface HubOAuthCallbackSuccessQuery {
595
487
  provider: string;
@@ -1603,6 +1495,284 @@ interface HubWorkflowRunStepsPage {
1603
1495
  nextCursor: number | null;
1604
1496
  }
1605
1497
  //#endregion
1498
+ //#region src/lines.d.ts
1499
+ interface HubLineMember {
1500
+ id: string;
1501
+ label: string | null;
1502
+ role: string;
1503
+ self?: boolean;
1504
+ consent?: "enabled" | "required";
1505
+ }
1506
+ interface HubLineContext {
1507
+ self: {
1508
+ id: string;
1509
+ label: string | null;
1510
+ role: string;
1511
+ };
1512
+ line: {
1513
+ id: string;
1514
+ label: string | null;
1515
+ transport: string;
1516
+ };
1517
+ members: HubLineMember[];
1518
+ capabilities: Record<string, {
1519
+ allowed: boolean;
1520
+ reason?: string;
1521
+ }>;
1522
+ pendingReminders: Array<{
1523
+ messageId: string;
1524
+ wakeAt?: string;
1525
+ prompt: string | null;
1526
+ }>;
1527
+ quotas: {
1528
+ selfMessagesToday: number;
1529
+ selfMessagesPerDay: number;
1530
+ selfMessagesPending: number;
1531
+ selfMessagesPendingLimit: number;
1532
+ };
1533
+ }
1534
+ interface HubLineSendInput {
1535
+ toMember: string;
1536
+ text: string;
1537
+ notBefore?: string;
1538
+ onBehalfOf?: string;
1539
+ idempotencyKey?: string;
1540
+ }
1541
+ interface HubLineOwnerSendInput {
1542
+ memberId: string;
1543
+ text: string;
1544
+ notBefore?: string;
1545
+ idempotencyKey: string;
1546
+ }
1547
+ interface HubLineReminderInput {
1548
+ text: string;
1549
+ notBefore: string;
1550
+ idempotencyKey: string;
1551
+ }
1552
+ interface HubLineApplicationDispatchCurrentInput {
1553
+ attachmentId: string;
1554
+ memberId: string;
1555
+ memberRevision: string;
1556
+ senderAddress: string;
1557
+ textSha256: string;
1558
+ binding: string;
1559
+ dispatchFence: string;
1560
+ dispatchDeadline: string;
1561
+ }
1562
+ interface HubLineMemberApplication {
1563
+ id: string;
1564
+ lineId: string;
1565
+ attachmentId: string;
1566
+ memberId: string;
1567
+ subjectId: string;
1568
+ status: "active" | "revoked";
1569
+ application: {
1570
+ url: string;
1571
+ binding: string;
1572
+ };
1573
+ /** Hub's name for the app at this callback; present on reads. */
1574
+ app?: {
1575
+ name: string;
1576
+ };
1577
+ createdAt: string;
1578
+ revokedAt: string | null;
1579
+ }
1580
+ interface HubLineMemberApplicationInput {
1581
+ expectedSelectionId: string | null;
1582
+ expectedMemberRevision: string;
1583
+ subjectId: string;
1584
+ application: {
1585
+ url: string;
1586
+ binding: string;
1587
+ secret: string;
1588
+ };
1589
+ }
1590
+ interface HubLineSendReceipt {
1591
+ message: {
1592
+ id: string;
1593
+ status: string;
1594
+ text: string | null;
1595
+ };
1596
+ eligibleAt: string | null;
1597
+ expiresAt: string;
1598
+ }
1599
+ interface HubLineReminderReceipt {
1600
+ state: "queued" | "skipped";
1601
+ lineId: string;
1602
+ messageId?: string;
1603
+ sessionId?: string;
1604
+ completion?: string;
1605
+ reason?: string;
1606
+ }
1607
+ interface HubLineScheduledSendOptions {
1608
+ lineId: string;
1609
+ memberId: string;
1610
+ text: string;
1611
+ timezone: string;
1612
+ name?: string;
1613
+ notBefore?: string;
1614
+ }
1615
+ interface HubLineCheckinOptions {
1616
+ lineId: string;
1617
+ member: string;
1618
+ timezone: string;
1619
+ prompt: string;
1620
+ name?: string;
1621
+ }
1622
+ /** Line calls share HubClient authentication and envelope handling. */
1623
+ declare class HubLinesClient {
1624
+ private readonly request;
1625
+ private readonly createWorkflow;
1626
+ private readonly requestApplicationDispatchCurrent?;
1627
+ readonly members: {
1628
+ list: (lineId: string) => Promise<HubLineMember[]>;
1629
+ };
1630
+ readonly memberApplications: {
1631
+ get: (lineId: string, memberId: string) => Promise<{
1632
+ memberRevision: string;
1633
+ selection: HubLineMemberApplication | null;
1634
+ }>;
1635
+ select: (lineId: string, memberId: string, input: HubLineMemberApplicationInput) => Promise<HubLineMemberApplication>;
1636
+ clear: (lineId: string, memberId: string, input: {
1637
+ expectedSelectionId: string;
1638
+ expectedMemberRevision: string;
1639
+ }) => Promise<void>;
1640
+ };
1641
+ readonly checkins: {
1642
+ schedule: (cron: string, options: HubLineCheckinOptions) => Promise<HubWorkflow>;
1643
+ };
1644
+ constructor(request: <T>(path: string, init: RequestInit) => Promise<T>, createWorkflow: (yaml: string) => Promise<HubWorkflow>, requestApplicationDispatchCurrent?: ((path: string, init: RequestInit, callbackBearer: string) => Promise<{
1645
+ current: boolean;
1646
+ }>) | undefined);
1647
+ scheduleSend(cron: string, options: HubLineScheduledSendOptions): Promise<HubWorkflow>;
1648
+ context(): Promise<HubLineContext>;
1649
+ send(lineId: string, input: HubLineSendInput | HubLineOwnerSendInput): Promise<HubLineSendReceipt>;
1650
+ remind(lineId: string, input: HubLineReminderInput): Promise<HubLineReminderReceipt>;
1651
+ applicationDispatchCurrent(lineId: string, messageId: string, input: HubLineApplicationDispatchCurrentInput, callbackBearer: string): Promise<boolean>;
1652
+ }
1653
+ //#endregion
1654
+ //#region src/managed-numbers.d.ts
1655
+ interface HubNumberReadiness {
1656
+ configured: boolean;
1657
+ provider: "inkbox";
1658
+ transports: Array<"sms" | "imessage">;
1659
+ billing: "prepaid_activation";
1660
+ automaticRentalBilling: false;
1661
+ deliveryVerified: false;
1662
+ }
1663
+ interface HubNumberQuote {
1664
+ transport: "sms" | "imessage";
1665
+ activationCents: number;
1666
+ currency: "usd";
1667
+ termsVersion: string;
1668
+ terms: string;
1669
+ expiresAt: number;
1670
+ /** The binding the quote was issued for. Absent from older servers. */
1671
+ clientReference?: string;
1672
+ /** Opaque. Pass it back to `create`; never decode it. */
1673
+ token: string;
1674
+ }
1675
+ /** One page of the owner's orders, newest first. */
1676
+ interface HubNumberOrderPage {
1677
+ orders: HubNumberOrder[];
1678
+ /** Present while more orders exist. Older servers omit it and return one
1679
+ * bounded page, so an absent cursor never proves an order does not exist. */
1680
+ nextCursor?: string | null;
1681
+ }
1682
+ interface HubNumberListQuery {
1683
+ /** Only orders requested for this binding, including closed ones. */
1684
+ clientReference?: string;
1685
+ cursor?: string;
1686
+ /** 1 to 100; the server default is 100. */
1687
+ limit?: number;
1688
+ }
1689
+ /** An operator's terminal decision on an order stuck in `needs_review`.
1690
+ * Read-only for a creator: the resolution is made through the platform's
1691
+ * admin surface, never through this client. */
1692
+ interface HubNumberResolution {
1693
+ action: "release" | "settle" | "abandon";
1694
+ operator: string;
1695
+ reason: string;
1696
+ at: number;
1697
+ /** Present while the operator's action is still running. The decision is
1698
+ * not final and the order can still return to review. */
1699
+ pending?: true;
1700
+ /** Present when a `settle` handed a live, unfinished order back to
1701
+ * provisioning, so the order is working again rather than closed. */
1702
+ requeued?: true;
1703
+ }
1704
+ interface HubNumberOrder {
1705
+ id: string;
1706
+ clientReference: string;
1707
+ transport: "sms" | "imessage";
1708
+ status: "pending" | "provider_pending" | "needs_review" | "ready_for_setup" | "cancelled";
1709
+ phase: "identity" | "number" | "credential" | "connection" | "complete";
1710
+ address: string | null;
1711
+ connectionId: string | null;
1712
+ identityId: string | null;
1713
+ providerNumberId: string | null;
1714
+ billingStatus: "unreserved" | "reserved" | "settled" | "released";
1715
+ cancellation: "none" | "requested" | "needs_review" | "released" | "abandoned";
1716
+ errorCode: string | null;
1717
+ nextAttemptAt: number | null;
1718
+ resolution: HubNumberResolution | null;
1719
+ deliveryVerified: false;
1720
+ activationCents: number;
1721
+ currency: "usd";
1722
+ terms: string;
1723
+ }
1724
+ /** Administrative number operations through Hub's authenticated transport.
1725
+ * A mutation is one attempt; an uncertain create reuses its quote and reference. */
1726
+ declare class HubManagedNumbersClient {
1727
+ private readonly request;
1728
+ constructor(request: <T>(path: string, init: RequestInit) => Promise<T>);
1729
+ readiness(): Promise<HubNumberReadiness>;
1730
+ /** One page of orders. Scope by `clientReference` to ask about one binding,
1731
+ * and follow `nextCursor` for the rest; a page is never ownership evidence. */
1732
+ list(query?: HubNumberListQuery): Promise<HubNumberOrderPage>;
1733
+ get(id: string): Promise<{
1734
+ order: HubNumberOrder;
1735
+ }>;
1736
+ quote(input: {
1737
+ transport: "sms" | "imessage";
1738
+ clientReference: string;
1739
+ }): Promise<{
1740
+ quote: HubNumberQuote;
1741
+ }>;
1742
+ /** `clientReference` and `transport`, when given, must match the signed
1743
+ * quote or Hub refuses the purchase with a conflict. */
1744
+ create(input: {
1745
+ quoteToken: string;
1746
+ consent: true;
1747
+ state?: string;
1748
+ clientReference?: string;
1749
+ transport?: "sms" | "imessage";
1750
+ }): Promise<{
1751
+ order: HubNumberOrder;
1752
+ }>;
1753
+ /** Fences references so no order can take them again. Call it as the last
1754
+ * step before retiring the resource they name: a purchase that races the
1755
+ * retirement is then refused (`409 number_reference_fenced`) instead of
1756
+ * binding a line to a resource that is gone. Refused with
1757
+ * `409 number_reference_held` while a live order holds one of them; cancel
1758
+ * it first. A cancelled order no longer holds its reference, so the fence
1759
+ * succeeds as soon as `cancel` returns, whether or not its release is still
1760
+ * pending. Repeating a fence is harmless. */
1761
+ fence(input: {
1762
+ clientReferences: string[];
1763
+ }): Promise<{
1764
+ clientReferences: string[];
1765
+ }>;
1766
+ advance(id: string): Promise<{
1767
+ order: HubNumberOrder;
1768
+ }>;
1769
+ cancel(id: string): Promise<{
1770
+ order: HubNumberOrder;
1771
+ }>;
1772
+ private path;
1773
+ private post;
1774
+ }
1775
+ //#endregion
1606
1776
  //#region src/client.d.ts
1607
1777
  type HubAuthHeaders = () => HeadersInit | Promise<HeadersInit>;
1608
1778
  interface HubClientOptions {
@@ -1631,11 +1801,19 @@ interface HubClientFromEnvOptions {
1631
1801
  }
1632
1802
  declare function resolveHubBaseUrl(env?: HubEnv): string;
1633
1803
  declare function resolveHubAuth(env?: HubEnv): string;
1634
- declare class HubClient {
1804
+ declare class HubTransport {
1635
1805
  readonly baseUrl: string;
1636
1806
  readonly fetch: typeof fetch;
1637
1807
  readonly apiKey?: string;
1638
1808
  readonly authHeaders?: HubAuthHeaders;
1809
+ constructor(options: HubClientOptions);
1810
+ protected request<TData>(path: string, init: RequestInit, options?: {
1811
+ auth?: "client" | "caller";
1812
+ validateData?: (data: unknown) => data is TData;
1813
+ }): Promise<TData>;
1814
+ protected buildHeaders(headers: HeadersInit | undefined, callerAuth?: boolean): Promise<Headers>;
1815
+ }
1816
+ declare class HubClient extends HubTransport {
1639
1817
  readonly allowances: HubAllowancesClient;
1640
1818
  readonly apps: HubAppsClient;
1641
1819
  readonly connections: HubConnectionsClient;
@@ -1649,10 +1827,10 @@ declare class HubClient {
1649
1827
  readonly audit: HubAuditClient;
1650
1828
  readonly githubApp: HubGithubAppClient;
1651
1829
  readonly workflows: HubWorkflowsClient;
1830
+ readonly lines: HubLinesClient;
1652
1831
  constructor(options: HubClientOptions);
1653
1832
  static fromEnv(options?: HubClientFromEnvOptions): HubClient;
1654
1833
  status(): Promise<HubStatusResponse>;
1655
- private request;
1656
1834
  /**
1657
1835
  * Open a streaming (Server-Sent Events) response and return its raw body.
1658
1836
  * Shares auth-header building + `fetch` with {@link request}, but does NOT
@@ -1673,7 +1851,6 @@ declare class HubClient {
1673
1851
  * otherwise an `HUB_HTTP_<status>` transport error.
1674
1852
  */
1675
1853
  private requestBytes;
1676
- private buildHeaders;
1677
1854
  }
1678
1855
  interface HubTokenListOptions {
1679
1856
  includeExpired?: boolean;
@@ -1744,6 +1921,8 @@ interface HubConnectionStartOptions {
1744
1921
  returnUrl?: string;
1745
1922
  cli?: boolean;
1746
1923
  connectionParameters?: Record<string, string>;
1924
+ /** GitHub accepts the exact read:user, repo, read:org set. */
1925
+ requestedScopes?: readonly string[];
1747
1926
  }
1748
1927
  declare class HubChannelsClient {
1749
1928
  private readonly request;
@@ -2195,8 +2374,157 @@ declare function authenticateHubEventRequest(input: AuthenticateHubEventRequestI
2195
2374
  declare function verifyHubEventSignature(input: VerifyHubEventSignatureInput): Promise<HubEventSignatureResult>;
2196
2375
  declare function parseHubEventDelivery(input: string | unknown): HubEventDelivery;
2197
2376
  //#endregion
2377
+ //#region src/line-grants.d.ts
2378
+ interface HubLineGrantBinding {
2379
+ workspaceId: string;
2380
+ workspaceAgentId: string;
2381
+ }
2382
+ interface HubLineGrant {
2383
+ id: string;
2384
+ lineId: string;
2385
+ connectionId: string;
2386
+ workspaceId: string;
2387
+ workspaceAgentId: string;
2388
+ agentProfileVersion: string;
2389
+ backendSha256: string;
2390
+ attachmentId: string | null;
2391
+ intakeMode: "guests" | "owner_only";
2392
+ /** "application" grants select the app's callback for the owner member instead of attaching. */
2393
+ execution: "backend" | "application";
2394
+ applicationOrigin: string | null;
2395
+ priorAttachmentId: string | null;
2396
+ priorAttachmentActive: boolean;
2397
+ monthlyBudgetUsd: number;
2398
+ monthlySpentUsd: number;
2399
+ }
2400
+ interface HubLineGrantLine {
2401
+ id: string;
2402
+ connectionId: string;
2403
+ transport: "sms" | "imessage";
2404
+ status: string;
2405
+ address: string | null;
2406
+ attachment: {
2407
+ id: string;
2408
+ sandboxId: string;
2409
+ status: string;
2410
+ } | null;
2411
+ }
2412
+ interface HubLineGrantAttachInput {
2413
+ workspaceAgentId: string;
2414
+ agentProfileVersion: string;
2415
+ renewalCode?: string;
2416
+ respond: {
2417
+ kind: "agent";
2418
+ backend: Record<string, unknown>;
2419
+ };
2420
+ }
2421
+ interface HubLineGrantAttachment {
2422
+ id: string;
2423
+ sandboxId: string;
2424
+ status: string;
2425
+ members?: Array<{
2426
+ id: string;
2427
+ role: string;
2428
+ }>;
2429
+ }
2430
+ interface HubLineGrantThread {
2431
+ id: string;
2432
+ lineId: string;
2433
+ attachmentId: string;
2434
+ }
2435
+ interface HubLineGrantMessage {
2436
+ id: string;
2437
+ threadId: string;
2438
+ direction: string;
2439
+ text: string | null;
2440
+ }
2441
+ /** The consented owner member on the owner's current attachment. */
2442
+ interface HubLineGrantMemberApplication {
2443
+ lineId: string;
2444
+ attachmentId: string;
2445
+ memberId: string;
2446
+ subjectId: string;
2447
+ /** Pass back unchanged as `expectedMemberRevision`. */
2448
+ memberRevision: string;
2449
+ /** False until the owner has texted the line and Hub recorded consent. */
2450
+ eligible: boolean;
2451
+ /** Hub-derived; every callback for this grant carries it. */
2452
+ binding: string;
2453
+ selection: {
2454
+ id: string; /** True when this grant's callback is the selected application. */
2455
+ own: boolean;
2456
+ /**
2457
+ * Hub's name for the app that answers the owner's texts, shown to the
2458
+ * owner in every app they consented on this line: a registered app's
2459
+ * name, or "Another app" when Hub has none. Absent before Platform named
2460
+ * selection holders.
2461
+ */
2462
+ app?: {
2463
+ name: string;
2464
+ }; /** When the current app started answering. */
2465
+ selectedAt?: string; /** This app's own callback; never returned for another app. */
2466
+ url?: string;
2467
+ createdAt?: string;
2468
+ } | null;
2469
+ }
2470
+ interface HubLineGrantSelectApplicationInput {
2471
+ /** The current selection exactly as read. */
2472
+ expectedSelectionId: string | null;
2473
+ /**
2474
+ * Set only when the owner chose to move their texts here from the app shown
2475
+ * in `selection.app`: that selection's id, also passed as
2476
+ * `expectedSelectionId`. Without it Hub never replaces another app.
2477
+ */
2478
+ replaceSelectionId?: string;
2479
+ expectedMemberRevision: string;
2480
+ /** HTTPS callback on the owner-approved application origin. */
2481
+ url: string;
2482
+ /** Bearer Hub sends to the callback; 32-512 printable ASCII characters. */
2483
+ secret: string;
2484
+ }
2485
+ interface HubLineGrantApplicationSelection {
2486
+ id: string;
2487
+ lineId: string;
2488
+ attachmentId: string;
2489
+ memberId: string;
2490
+ subjectId: string;
2491
+ status: string;
2492
+ application: {
2493
+ url: string;
2494
+ binding: string;
2495
+ };
2496
+ createdAt: string;
2497
+ revokedAt: string | null;
2498
+ }
2499
+ /** Every call uses HubTransport's authHeaders, so one-use app broker tokens can be minted per request. */
2500
+ declare class HubLineGrantsClient extends HubTransport {
2501
+ current(binding: HubLineGrantBinding): Promise<HubLineGrant>;
2502
+ line(binding: HubLineGrantBinding): Promise<HubLineGrantLine>;
2503
+ attach(binding: HubLineGrantBinding, input: HubLineGrantAttachInput): Promise<HubLineGrantAttachment>;
2504
+ detach(binding: HubLineGrantBinding): Promise<{
2505
+ detached: boolean;
2506
+ }>;
2507
+ threads(binding: HubLineGrantBinding): Promise<HubLineGrantThread[]>;
2508
+ messages(binding: HubLineGrantBinding, threadId: string): Promise<HubLineGrantMessage[]>;
2509
+ memberApplication(binding: HubLineGrantBinding): Promise<HubLineGrantMemberApplication>;
2510
+ /**
2511
+ * Route the owner's texts to this app's callback; the incumbent attachment
2512
+ * stays. `replaceSelectionId` moves them from another app on the owner's
2513
+ * explicit choice.
2514
+ */
2515
+ selectApplication(binding: HubLineGrantBinding, input: HubLineGrantSelectApplicationInput): Promise<HubLineGrantApplicationSelection>;
2516
+ /** Return the owner's texts to the incumbent attachment. */
2517
+ clearApplication(binding: HubLineGrantBinding, input: {
2518
+ expectedSelectionId: string;
2519
+ expectedMemberRevision: string;
2520
+ }): Promise<void>;
2521
+ revoke(binding: HubLineGrantBinding): Promise<{
2522
+ revoked: boolean;
2523
+ }>;
2524
+ }
2525
+ //#endregion
2198
2526
  //#region src/redaction.d.ts
2199
2527
  declare function redactHubValue(value: unknown): unknown;
2200
2528
  //#endregion
2201
- 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 };
2529
+ 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 HubAllowanceSyncInput, type HubAllowanceSyncReceipt, 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, type HubLineApplicationDispatchCurrentInput, type HubLineCheckinOptions, type HubLineContext, type HubLineGrant, type HubLineGrantApplicationSelection, type HubLineGrantAttachInput, type HubLineGrantAttachment, type HubLineGrantBinding, type HubLineGrantLine, type HubLineGrantMemberApplication, type HubLineGrantMessage, type HubLineGrantSelectApplicationInput, type HubLineGrantThread, HubLineGrantsClient, type HubLineMember, type HubLineMemberApplication, type HubLineMemberApplicationInput, type HubLineOwnerSendInput, type HubLineReminderInput, type HubLineReminderReceipt, type HubLineScheduledSendOptions, type HubLineSendInput, type HubLineSendReceipt, HubLinesClient, 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 };
2202
2530
  //# sourceMappingURL=index.d.ts.map