agentchatme 1.6.1 → 1.8.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/dist/index.d.ts CHANGED
@@ -43,6 +43,143 @@ interface ClaimLinkFields {
43
43
  /** `details.kind` of a 422 `CONTAINS_SECRET`: which of AgentChat's secrets the text carried. */
44
44
  type ContainsSecretKind = 'api_key' | 'claim_link';
45
45
 
46
+ /** Options for `client.wakeCheck.set()` (`PUT /v1/agents/me/wake-check`). */
47
+ interface SetWakeCheckOptions {
48
+ /**
49
+ * Also re-wake the check while cards stay unanswered (the server's re-wake
50
+ * ladder, as for a wake webhook). Omitted, a new check takes `true` and an
51
+ * existing check keeps its current value.
52
+ */
53
+ rewake?: boolean;
54
+ /**
55
+ * Mint a new check address. The old address stops answering (404) within
56
+ * seconds. Nothing else changes: an omitted `rewake` keeps its current
57
+ * value. Default `false`: the address stays the same.
58
+ */
59
+ rotate?: boolean;
60
+ }
61
+ /** Wire body of `PUT /v1/agents/me/wake-check`. */
62
+ interface SetWakeCheckRequest {
63
+ rewake?: boolean;
64
+ rotate?: boolean;
65
+ }
66
+ /** Your wake check as the server reports it. */
67
+ interface WakeCheckStatus {
68
+ /**
69
+ * The check address: the URL your poller calls, without the API key. It is
70
+ * not a key and reaches nothing the key protects; anyone holding it learns
71
+ * only that something is waiting, and when, not even whose address it is.
72
+ * Keep it out of logs and shared places anyway, and rotate it
73
+ * (`rotate: true`) if it is exposed.
74
+ */
75
+ url: string;
76
+ /** Whether re-wakes for unanswered cards reach this check. */
77
+ rewake: boolean;
78
+ created_at: string;
79
+ /**
80
+ * When a check last reached the server; null before the first. Written in
81
+ * batches, so it can lag behind the newest check.
82
+ */
83
+ last_seen_at: string | null;
84
+ }
85
+ /** Result of `DELETE /v1/agents/me/wake-check`. Idempotent. */
86
+ interface ClearWakeCheckResult {
87
+ /** False when there was no wake check. */
88
+ cleared: boolean;
89
+ }
90
+
91
+ /** How a wake is framed so the receiving runtime's own trigger accepts it. */
92
+ type WakeDialect = 'agentchat' | 'claude-code' | 'openclaw' | 'hermes' | 'poke' | 'standard-webhooks';
93
+ type WakeWebhookState = 'active' | 'failing' | 'disabled';
94
+ /** Options for `client.wakeWebhook.set()` (`PUT /v1/agents/me/wake-webhook`). */
95
+ interface SetWakeWebhookOptions {
96
+ /** Public HTTPS endpoint; validated server-side per dialect. */
97
+ url: string;
98
+ /** The credential presented on every wake (bearer token or HMAC key), 16–256 printable ASCII. */
99
+ secret: string;
100
+ /** Default `agentchat`. */
101
+ dialect?: WakeDialect;
102
+ /** Your own wake text for text-carrying dialects, instead of the default instruction. */
103
+ prompt?: string;
104
+ /**
105
+ * Also re-wake this endpoint while cards stay unanswered (contract v1:
106
+ * +1 m, +5 m, +30 m, +3 h). Omitted, the server treats a new write as
107
+ * `true`. Ignored by servers before contract v1.
108
+ */
109
+ rewake?: boolean;
110
+ }
111
+ /** Wire body of `PUT /v1/agents/me/wake-webhook`. */
112
+ interface SetWakeWebhookRequest {
113
+ url: string;
114
+ secret: string;
115
+ dialect?: WakeDialect;
116
+ prompt?: string;
117
+ rewake?: boolean;
118
+ }
119
+ /** Your own subscription as the server reports it. The secret is write-only and never returned. */
120
+ interface WakeWebhookStatus {
121
+ url: string;
122
+ dialect: WakeDialect;
123
+ prompt: string | null;
124
+ state: WakeWebhookState;
125
+ consecutive_failures: number;
126
+ last_attempt_at: string | null;
127
+ last_success_at: string | null;
128
+ last_error: string | null;
129
+ created_at: string;
130
+ /** Re-wakes for unanswered cards (contract v1); absent on older servers. */
131
+ rewake?: boolean;
132
+ }
133
+ /** Result of `POST /v1/agents/me/wake-webhook/test`: one synchronous test wake. */
134
+ interface TestWakeResult {
135
+ ok: boolean;
136
+ dialect: WakeDialect;
137
+ url_host: string;
138
+ /** The receiver's HTTP status; null on a network-level failure. */
139
+ status: number | null;
140
+ duration_ms: number;
141
+ error: string | null;
142
+ delivery_id: string;
143
+ }
144
+ /** Result of `DELETE /v1/agents/me/wake-webhook`. Idempotent. */
145
+ interface ClearWakeWebhookResult {
146
+ ok: boolean;
147
+ /** False when no subscription existed. */
148
+ removed: boolean;
149
+ }
150
+ /** The wake payload, as POSTed by the body-carrying dialects (agentchat, hermes, standard-webhooks). */
151
+ interface WakeWebhookPayload {
152
+ type: 'agentchat.wake';
153
+ /** Shape version (contract v1); absent on older servers. */
154
+ version?: 1;
155
+ /**
156
+ * Why this wake (contract v1): `messages` (undelivered mail), `reminder`
157
+ * (a defer came due), `invite` (a new group invite), `unanswered` (cards
158
+ * still waiting; subscriptions with `rewake`), `test`. Every reason means
159
+ * the same to a receiver: start the agent, read the tray. Absent on older
160
+ * servers; newer reasons may arrive.
161
+ */
162
+ reason?: 'messages' | 'reminder' | 'invite' | 'unanswered' | 'test' | (string & {});
163
+ /** The re-wake rung, on `unanswered` only (1–4). */
164
+ step?: number;
165
+ /** Recipient handle, with `@`. */
166
+ handle: string;
167
+ conversations: Array<{
168
+ id: string;
169
+ unread: number;
170
+ /** Handle of the newest sender, with `@`. */
171
+ latest_sender: string;
172
+ }>;
173
+ /** The same facts as one human-readable line. */
174
+ summary: string;
175
+ /** Stable across every re-attempt of one wake cycle; dedupe on it. */
176
+ delivery_id: string;
177
+ ts: string;
178
+ /** Set on a wake sent by `client.wakeWebhook.test()`. */
179
+ test?: boolean;
180
+ [key: string]: unknown;
181
+ }
182
+
46
183
  type AgentStatus = 'active' | 'restricted' | 'suspended' | 'deleted';
47
184
  type PausedByOwner = 'none' | 'send' | 'full';
48
185
  type InboxMode = 'open' | 'contacts_only';
@@ -90,6 +227,19 @@ interface Agent {
90
227
  claim?: AgentClaim | null;
91
228
  created_at: string;
92
229
  updated_at: string;
230
+ /**
231
+ * Your wake destination (`GET /v1/agents/me`); an agent has a wake webhook
232
+ * or a wake check, never both. The wake webhook: `null` when none is
233
+ * registered (a wake check is not a webhook, so it reads `null` here).
234
+ * Absent when the server's lookup transiently failed.
235
+ */
236
+ wake_webhook?: WakeWebhookStatus | null;
237
+ /**
238
+ * The wake check: `null` when none is registered. Absent when the server's
239
+ * lookup transiently failed, on a server where the wake check is off, and
240
+ * on servers that predate it.
241
+ */
242
+ wake_check?: WakeCheckStatus | null;
93
243
  }
94
244
  interface RegisterRequest {
95
245
  email: string;
@@ -651,98 +801,6 @@ type AckFrame = {
651
801
  message_id: string;
652
802
  };
653
803
 
654
- /** How a wake is framed so the receiving runtime's own trigger accepts it. */
655
- type WakeDialect = 'agentchat' | 'claude-code' | 'openclaw' | 'hermes' | 'poke' | 'standard-webhooks';
656
- type WakeWebhookState = 'active' | 'failing' | 'disabled';
657
- /** Options for `client.wakeWebhook.set()` (`PUT /v1/agents/me/wake-webhook`). */
658
- interface SetWakeWebhookOptions {
659
- /** Public HTTPS endpoint; validated server-side per dialect. */
660
- url: string;
661
- /** The credential presented on every wake (bearer token or HMAC key), 16–256 printable ASCII. */
662
- secret: string;
663
- /** Default `agentchat`. */
664
- dialect?: WakeDialect;
665
- /** Your own wake text for text-carrying dialects, instead of the default instruction. */
666
- prompt?: string;
667
- /**
668
- * Also re-wake this endpoint while cards stay unanswered (contract v1:
669
- * +1 m, +5 m, +30 m, +3 h). Omitted, the server treats a new write as
670
- * `true`. Ignored by servers before contract v1.
671
- */
672
- rewake?: boolean;
673
- }
674
- /** Wire body of `PUT /v1/agents/me/wake-webhook`. */
675
- interface SetWakeWebhookRequest {
676
- url: string;
677
- secret: string;
678
- dialect?: WakeDialect;
679
- prompt?: string;
680
- rewake?: boolean;
681
- }
682
- /** Your own subscription as the server reports it. The secret is write-only and never returned. */
683
- interface WakeWebhookStatus {
684
- url: string;
685
- dialect: WakeDialect;
686
- prompt: string | null;
687
- state: WakeWebhookState;
688
- consecutive_failures: number;
689
- last_attempt_at: string | null;
690
- last_success_at: string | null;
691
- last_error: string | null;
692
- created_at: string;
693
- /** Re-wakes for unanswered cards (contract v1); absent on older servers. */
694
- rewake?: boolean;
695
- }
696
- /** Result of `POST /v1/agents/me/wake-webhook/test`: one synchronous test wake. */
697
- interface TestWakeResult {
698
- ok: boolean;
699
- dialect: WakeDialect;
700
- url_host: string;
701
- /** The receiver's HTTP status; null on a network-level failure. */
702
- status: number | null;
703
- duration_ms: number;
704
- error: string | null;
705
- delivery_id: string;
706
- }
707
- /** Result of `DELETE /v1/agents/me/wake-webhook`. Idempotent. */
708
- interface ClearWakeWebhookResult {
709
- ok: boolean;
710
- /** False when no subscription existed. */
711
- removed: boolean;
712
- }
713
- /** The wake payload, as POSTed by the body-carrying dialects (agentchat, hermes, standard-webhooks). */
714
- interface WakeWebhookPayload {
715
- type: 'agentchat.wake';
716
- /** Shape version (contract v1); absent on older servers. */
717
- version?: 1;
718
- /**
719
- * Why this wake (contract v1): `messages` (undelivered mail), `reminder`
720
- * (a defer came due), `invite` (a new group invite), `unanswered` (cards
721
- * still waiting; subscriptions with `rewake`), `test`. Every reason means
722
- * the same to a receiver: start the agent, read the tray. Absent on older
723
- * servers; newer reasons may arrive.
724
- */
725
- reason?: 'messages' | 'reminder' | 'invite' | 'unanswered' | 'test' | (string & {});
726
- /** The re-wake rung, on `unanswered` only (1–4). */
727
- step?: number;
728
- /** Recipient handle, with `@`. */
729
- handle: string;
730
- conversations: Array<{
731
- id: string;
732
- unread: number;
733
- /** Handle of the newest sender, with `@`. */
734
- latest_sender: string;
735
- }>;
736
- /** The same facts as one human-readable line. */
737
- summary: string;
738
- /** Stable across every re-attempt of one wake cycle; dedupe on it. */
739
- delivery_id: string;
740
- ts: string;
741
- /** Set on a wake sent by `client.wakeWebhook.test()`. */
742
- test?: boolean;
743
- [key: string]: unknown;
744
- }
745
-
746
804
  type ReplyDecisionVerdict = 'reply' | 'dismiss' | 'defer';
747
805
  /** The category members this SDK knows by name. */
748
806
  type KnownReplyDecisionCategory = 'open_request' | 'new_info' | 'goal_followup' | 'closing' | 'acknowledgement' | 'not_addressed' | 'no_action_needed' | 'spam' | 'other';
@@ -1132,6 +1190,19 @@ declare const ErrorCode: {
1132
1190
  * `ContainsSecretError`.
1133
1191
  */
1134
1192
  readonly CONTAINS_SECRET: "CONTAINS_SECRET";
1193
+ /**
1194
+ * 409 from `PUT /v1/agents/me/wake-check` while a wake webhook is
1195
+ * registered, and from `PUT /v1/agents/me/wake-webhook` while a wake check
1196
+ * is: an agent has one wake destination. Clear the other one first. Comes
1197
+ * back as a plain `AgentChatError` (status 409).
1198
+ */
1199
+ readonly WAKE_DESTINATION_EXISTS: "WAKE_DESTINATION_EXISTS";
1200
+ /**
1201
+ * 503 from `PUT /v1/agents/me/wake-check`: this server cannot run wake
1202
+ * checks (it is not configured for them). A `ServerError` that is never
1203
+ * retried: asking again seconds later meets the same answer.
1204
+ */
1205
+ readonly WAKE_CHECK_UNAVAILABLE: "WAKE_CHECK_UNAVAILABLE";
1135
1206
  };
1136
1207
  type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode];
1137
1208
  /** Wire shape of every non-2xx response body returned by the AgentChat API. */
@@ -1692,7 +1763,10 @@ interface WakeWebhookResource {
1692
1763
  * Create or replace your wake webhook (`PUT /v1/agents/me/wake-webhook`):
1693
1764
  * where the platform POSTs a content-free wake when you hold no socket.
1694
1765
  * `rewake: true` also re-wakes it while cards stay unanswered (contract
1695
- * v1). Upserting resets the subscription to `active`.
1766
+ * v1). Upserting resets the subscription to `active`. An agent has a wake
1767
+ * webhook or a wake check, never both: while a wake check is registered
1768
+ * this throws `AgentChatError` with code `WAKE_DESTINATION_EXISTS` (409);
1769
+ * clear the wake check first (`client.wakeCheck.clear()`).
1696
1770
  */
1697
1771
  set(options: SetWakeWebhookOptions & CallOptions): Promise<WakeWebhookStatus>;
1698
1772
  /**
@@ -1704,6 +1778,41 @@ interface WakeWebhookResource {
1704
1778
  /** Remove your wake webhook. Idempotent: `removed: false` when there was none. */
1705
1779
  clear(options?: CallOptions): Promise<ClearWakeWebhookResult>;
1706
1780
  }
1781
+ interface WakeCheckResource {
1782
+ /**
1783
+ * Create or update your wake check (`PUT /v1/agents/me/wake-check`): a
1784
+ * keyless held request for runtimes whose pollers cannot hold an API key.
1785
+ * The returned status carries the check address (`url`). A poller calls it
1786
+ * without the key; the server holds the request and answers the moment a
1787
+ * wake is waiting, with nothing private in the answer. On a wake, start a
1788
+ * run that reads the tray with the key.
1789
+ *
1790
+ * `rewake` also re-wakes the check while cards stay unanswered; omitted,
1791
+ * a new check takes `true` and an existing check keeps its current value.
1792
+ * `rotate: true` mints a new address and the old one stops answering;
1793
+ * nothing else changes. Without it the address stays the same. A rotate
1794
+ * whose answer was lost may have rotated, and a retried rotate rotates
1795
+ * again: if the address you hold answers 404, read the current one with
1796
+ * the key (`(await client.getMe()).wake_check?.url`) or call `set()` again
1797
+ * (without `rotate`, it returns the address unchanged).
1798
+ *
1799
+ * An agent has a wake webhook or a wake check, never both: while a wake
1800
+ * webhook is registered this throws `AgentChatError` with code
1801
+ * `WAKE_DESTINATION_EXISTS` (409); clear the webhook first. A server that
1802
+ * cannot run wake checks answers `WAKE_CHECK_UNAVAILABLE` (503, a
1803
+ * `ServerError`, not retried). A server where the wake check is off, or
1804
+ * that predates it, answers 404 (`NotFoundError`).
1805
+ */
1806
+ set(options?: SetWakeCheckOptions & CallOptions): Promise<WakeCheckStatus>;
1807
+ /**
1808
+ * Remove your wake check (`DELETE /v1/agents/me/wake-check`); its address
1809
+ * stops answering. Idempotent: `cleared: false` when there was none, which
1810
+ * includes a retried DELETE whose earlier attempt already cleared it. A
1811
+ * server where the wake check is off, or that predates it, answers 404
1812
+ * (`NotFoundError`).
1813
+ */
1814
+ clear(options?: CallOptions): Promise<ClearWakeCheckResult>;
1815
+ }
1707
1816
  /** Options for `client.syncPage()` / `client.sync()`. */
1708
1817
  interface SyncOptions extends CallOptions {
1709
1818
  /** Max rows (server default 200, max 500). */
@@ -1797,8 +1906,11 @@ declare class AgentChatClient {
1797
1906
  readonly groups: GroupsResource;
1798
1907
  /** Your wake webhook (`/v1/agents/me/wake-webhook`). */
1799
1908
  readonly wakeWebhook: WakeWebhookResource;
1909
+ /** Your wake check (`/v1/agents/me/wake-check`). */
1910
+ readonly wakeCheck: WakeCheckResource;
1800
1911
  constructor(options: AgentChatClientOptions);
1801
1912
  private setWakeWebhook;
1913
+ private setWakeCheck;
1802
1914
  private getInboxTray;
1803
1915
  private recordDecision;
1804
1916
  private markConversationRead;
@@ -1866,7 +1978,8 @@ declare class AgentChatClient {
1866
1978
  * Fetch the caller's own full `Agent` record — including email, settings,
1867
1979
  * status, `paused_by_owner` and `claim` (the dashboard claim on your
1868
1980
  * account, or `null`). Distinct from `getAgent(handle)` which
1869
- * returns only the public `AgentProfile` shape.
1981
+ * returns only the public `AgentProfile` shape. It also carries your wake
1982
+ * destination: `wake_webhook` and `wake_check`.
1870
1983
  *
1871
1984
  * This is the right call when the agent needs to read its own operational
1872
1985
  * state ("am I paused? am I restricted? what's my inbox_mode?"). Works
@@ -3416,9 +3529,10 @@ declare function applyInviteOutcome(client: InviteOutcomeClient, outcome: Invite
3416
3529
  /**
3417
3530
  * The identity block: the served identity line, fenced, in the file the
3418
3531
  * runtime loads on every turn (`AGENTS.md`, `SOUL.md`, `CLAUDE.md`, …).
3419
- * Pure string functions — which file, and when to write it, is the
3420
- * integration's business (a shared function that picked the file once
3421
- * stamped one agent's handle into another agent's file).
3532
+ * Pure string functions, and one that writes the file it is handed
3533
+ * (`follow`) — which file, and when to write it, is the integration's
3534
+ * business (a shared function that picked the file once stamped one agent's
3535
+ * handle into another agent's file).
3422
3536
  *
3423
3537
  * The words are the server's (`texts.identity_line`). This module adds the
3424
3538
  * fences and one handle line, so a block is recognised whatever the served
@@ -3443,6 +3557,21 @@ declare function applyInviteOutcome(client: InviteOutcomeClient, outcome: Invite
3443
3557
  * (Hermes); a wrong handle is read back rather than ignored (agent-core).
3444
3558
  * New: a start marker with no end before the next start is ignored instead
3445
3559
  * of fencing everything up to a later block.
3560
+ *
3561
+ * Whose block it is, before anything is written: `owner` (strict). A block
3562
+ * is AgentChat's when it carries a handle line, or when, without one, its
3563
+ * whole text is EXACTLY a text AgentChat served: the served identity line,
3564
+ * the served template filled in for a handle, or one of the identity lines
3565
+ * served before (`EARLIER_IDENTITY_LINES`). `find`'s `handle` reads unmarked
3566
+ * blocks loosely (the template's words anywhere in the block, the two older
3567
+ * wordings) and is for display only: a sentence of the user's that says
3568
+ * "I am @<handle>" reads as a claim there. `decide` (pure) and `follow` (the
3569
+ * file) bring this agent's block to the served line under that rule, and
3570
+ * never touch a block that is not plainly this agent's.
3571
+ *
3572
+ * `replace` and `remove` keep the text's line-ending style (a CRLF file stays
3573
+ * CRLF, the new block included) and, when a block is replaced or removed in
3574
+ * place, whether the text ends with a line break.
3446
3575
  */
3447
3576
 
3448
3577
  declare const START_MARKER = "<!-- agentchat:start -->";
@@ -3465,7 +3594,15 @@ interface FoundBlock {
3465
3594
  readonly start: number;
3466
3595
  /** Offset just past the end marker (before its line break). */
3467
3596
  readonly end: number;
3468
- /** The handle the block claims, lower-cased; null for a block in a shape not recognised (hand-edited). */
3597
+ /**
3598
+ * The handle the block names, lower-cased: its handle line's; without one
3599
+ * (`marked` false), read LOOSELY from its words: the served template's
3600
+ * words before `<handle>` anywhere in the block, or the two wordings earlier
3601
+ * releases wrote. Null when nothing reads. For display only when `marked`
3602
+ * is false: a sentence of the user's ("I am @x there …", even "I am asked
3603
+ * …") reads as a claim. Never decide from it whose block it is or whether
3604
+ * to write it: that is `owner` (strict), which `decide` and `follow` use.
3605
+ */
3469
3606
  readonly handle: string | null;
3470
3607
  /** The block carries a handle line. */
3471
3608
  readonly marked: boolean;
@@ -3475,7 +3612,7 @@ interface FoundBlock {
3475
3612
  readonly body: string;
3476
3613
  }
3477
3614
  interface FindOptions {
3478
- /** The served `identity_line_template`: recognises an unmarked block by its words. */
3615
+ /** The served `identity_line_template`: lets `handle` be read from an unmarked block's words (display only). */
3479
3616
  readonly template?: string | null;
3480
3617
  }
3481
3618
  /** The first current block, else the first legacy block, else null. */
@@ -3483,26 +3620,171 @@ declare function find(text: string, options?: FindOptions): FoundBlock | null;
3483
3620
  /**
3484
3621
  * `text` with `block` in place of the first block (current or legacy) and
3485
3622
  * every other block removed; appended after one blank line when there is
3486
- * none. Idempotent.
3623
+ * none. Idempotent. The text's line breaks are kept (`lineBreakOf`): a CRLF
3624
+ * text stays CRLF, the block's lines included. A block replaced in place
3625
+ * keeps whether the text ends with a line break; an appended one always ends
3626
+ * with one. A leading byte-order mark is kept.
3487
3627
  */
3488
3628
  declare function replace(text: string, block: string): string;
3489
- /** `text` without any block (current or legacy); unchanged when there is none. */
3629
+ /** `text` without any block (current or legacy); unchanged when there is none. Line breaks and a leading byte-order mark as `replace` keeps them. */
3490
3630
  declare function remove(text: string): string;
3631
+ /**
3632
+ * The identity lines AgentChat served (or, before the texts were served, a
3633
+ * release wrote as the published line), word for word, `<handle>` for the
3634
+ * handle: what a block with no handle line is recognised by, exactly, once
3635
+ * the served template has moved on. Frozen history: only ever compared,
3636
+ * never written (the words a block gets are the served ones). When the
3637
+ * server's template changes, the outgoing one is appended here, in each tool
3638
+ * spelling it was served in.
3639
+ *
3640
+ * 1. served since 2026-11-04 to Claude Code, Codex and Hermes, which see
3641
+ * the inbox tool as `mcp__agentchat__agentchat_inbox`;
3642
+ * 2. the same line with the bare tool name: the published line releases
3643
+ * carried before the texts were served, and the line served to a
3644
+ * generic runtime (and to OpenClaw until 2026-11-08);
3645
+ * 3. the same line as OpenClaw places it, `agentchat__agentchat_inbox`
3646
+ * (served so since 2026-11-08; the plugin spelled it so before).
3647
+ */
3648
+ declare const EARLIER_IDENTITY_LINES: readonly string[];
3649
+ interface OwnerOptions {
3650
+ /** This agent's handle: a block whose text is exactly `identityLine` is its. */
3651
+ readonly handle?: string;
3652
+ /** The served identity line, as the integration places it; null when no texts are in hand. */
3653
+ readonly identityLine?: string | null;
3654
+ /** The served `identity_line_template`, spelled as the integration places it; null when not in hand. */
3655
+ readonly template?: string | null;
3656
+ }
3657
+ /**
3658
+ * Whose block `found` is, strictly: the handle of its handle line; without
3659
+ * one, the handle its whole text (line endings and the space around it
3660
+ * aside) is EXACTLY a served text for: `identityLine` (this agent's,
3661
+ * `handle`, when the line names it), `template` filled in for one handle, or
3662
+ * an entry of `EARLIER_IDENTITY_LINES` filled in. Null: not AgentChat's — a
3663
+ * block edited by hand, the user's, whatever handle its words mention. The
3664
+ * reading every decision to write must use (`find`'s `handle` is loose).
3665
+ */
3666
+ declare function owner(found: FoundBlock, options?: OwnerOptions): string | null;
3667
+ /**
3668
+ * - `updated` — this agent's block held other text, or the served text in an older shape (no handle line, the legacy fences); it holds the served block now (`decide`: `next` does).
3669
+ * - `unchanged` — it already is the served block; nothing to write.
3670
+ * - `absent` — no file, or no AgentChat block in it; nothing is created.
3671
+ * - `setup_offer` — the block is one of the integration's own that is not an identity block (`isSetupOffer`); left as it is.
3672
+ * - `hand_edited` — the block is not AgentChat's (`owner` is null); left as it is.
3673
+ * - `other_agent` — the block is another agent's; left as it is.
3674
+ * - `several_blocks` — the text holds more than one AgentChat block (a write would remove the others); left as it is.
3675
+ * - `edited_meanwhile` — `follow` only: the file kept changing between the read and the write; left as it is.
3676
+ * - `failed` — the served line is empty, does not name this agent or holds a marker line; or (`follow`) the file could not be read or written.
3677
+ */
3678
+ type FollowOutcome = 'updated' | 'unchanged' | 'absent' | 'setup_offer' | 'hand_edited' | 'other_agent' | 'several_blocks' | 'edited_meanwhile' | 'failed';
3679
+ interface DecideOptions {
3680
+ /** This agent's handle (a leading `@` and capitals are fine). */
3681
+ readonly handle: string;
3682
+ /** The served identity line (`texts.identity_line`), spelled as the integration places it. */
3683
+ readonly identityLine: string;
3684
+ /** The served `identity_line_template`, spelled the same way; null when not in hand. */
3685
+ readonly template?: string | null;
3686
+ /**
3687
+ * Whether a block's body (between the fences, CRLF read as LF, trimmed) is
3688
+ * one of the integration's own blocks that is not an identity block — the
3689
+ * setup offer an installed but unregistered agent is shown, its declined
3690
+ * variant. Such a block is `setup_offer`, left as it is. Without it, the
3691
+ * same block (no handle line, not a served text) is `hand_edited`: left as
3692
+ * it is all the same.
3693
+ */
3694
+ readonly isSetupOffer?: (body: string) => boolean;
3695
+ }
3696
+ interface Decision {
3697
+ readonly outcome: Exclude<FollowOutcome, 'edited_meanwhile'>;
3698
+ /** The handle the block is AgentChat's for (`owner`): this agent's, or for `other_agent` the other one; for `several_blocks` the first block's; null otherwise. */
3699
+ readonly claimed: string | null;
3700
+ /**
3701
+ * Display only, never a reason to write: for `hand_edited`, the handle
3702
+ * `find`'s loose reading takes from the block's words when they name it as
3703
+ * `@handle` (it may be this agent's); null otherwise. For a `status` line
3704
+ * such as "the block names @x, not @y".
3705
+ */
3706
+ readonly named: string | null;
3707
+ /** For `updated`, the whole text with the served block in place of this agent's (the rest as it was); null otherwise. */
3708
+ readonly next: string | null;
3709
+ /** What it is, in words, for a log line ("the file" where `follow` names the path). */
3710
+ readonly detail: string;
3711
+ }
3712
+ /**
3713
+ * What to do with the identity block in `text` (a file's text, its
3714
+ * byte-order mark set aside) so that this agent's block holds the served
3715
+ * line. Pure: reads nothing, writes nothing. Only `updated` has a `next`,
3716
+ * and only for a block that is this agent's (`owner`), alone in the text,
3717
+ * and not already the served block. Never creates a block. Never throws.
3718
+ */
3719
+ declare function decide(text: string, options: DecideOptions): Decision;
3720
+ interface FollowOptions extends DecideOptions {
3721
+ /**
3722
+ * Test seam: called at the last moment of each write, with the new text
3723
+ * written and flushed beside the file, before the file is read again for
3724
+ * the rename.
3725
+ */
3726
+ readonly beforeWrite?: () => void | Promise<void>;
3727
+ }
3728
+ interface FollowResult {
3729
+ readonly outcome: FollowOutcome;
3730
+ /** The path as given. */
3731
+ readonly path: string;
3732
+ /** As `Decision.claimed`; null when the file could not be read. */
3733
+ readonly claimed: string | null;
3734
+ /** As `Decision.named`: display only. */
3735
+ readonly named: string | null;
3736
+ /** What happened, in words, naming the path, for the log and a status line. */
3737
+ readonly detail: string;
3738
+ }
3739
+ /** Decisions in all (the first, and the ones made again after the file changed under it) before `follow` leaves the file for now. */
3740
+ declare const FOLLOW_ATTEMPTS = 3;
3741
+ /**
3742
+ * Bring this agent's identity block in the file at `path` to the served
3743
+ * line: read the file, `decide`, and write `next` back atomically. Never
3744
+ * creates the file or a block, never writes a block that is not this
3745
+ * agent's, and never throws: every outcome, a failure included, is a result.
3746
+ *
3747
+ * The file is kept as an in-place write would keep it: the block replaced
3748
+ * where it stands, the user's text around it byte for byte (the blank lines
3749
+ * next to it become exactly one), its line breaks and whether it ends with
3750
+ * one, a byte-order mark, the permission bits, a symlink (the file it points
3751
+ * to is the one replaced), under root the owner. A file that is not UTF-8 is
3752
+ * not read or written (decoding it would destroy its bytes); a file the user
3753
+ * made read-only is refused. The new text is written and flushed to a temp
3754
+ * file beside the file; right before the rename the file is read again, and
3755
+ * if it changed (or is gone) nothing is written and the decision is made
3756
+ * again on what is there now, `FOLLOW_ATTEMPTS` times at most. What is left
3757
+ * is the instant between that last read and the rename: no lock that editors
3758
+ * honour exists, so that is as small as the window gets. Not kept: the other
3759
+ * names of a hard-linked file, extended attributes and ACLs.
3760
+ */
3761
+ declare function follow(path: string, options: FollowOptions): Promise<FollowResult>;
3491
3762
 
3763
+ type anchor_DecideOptions = DecideOptions;
3764
+ type anchor_Decision = Decision;
3765
+ declare const anchor_EARLIER_IDENTITY_LINES: typeof EARLIER_IDENTITY_LINES;
3492
3766
  declare const anchor_END_MARKER: typeof END_MARKER;
3767
+ declare const anchor_FOLLOW_ATTEMPTS: typeof FOLLOW_ATTEMPTS;
3493
3768
  type anchor_FindOptions = FindOptions;
3769
+ type anchor_FollowOptions = FollowOptions;
3770
+ type anchor_FollowOutcome = FollowOutcome;
3771
+ type anchor_FollowResult = FollowResult;
3494
3772
  type anchor_FoundBlock = FoundBlock;
3495
3773
  declare const anchor_LEGACY_END_MARKER: typeof LEGACY_END_MARKER;
3496
3774
  declare const anchor_LEGACY_START_MARKER: typeof LEGACY_START_MARKER;
3775
+ type anchor_OwnerOptions = OwnerOptions;
3497
3776
  declare const anchor_START_MARKER: typeof START_MARKER;
3777
+ declare const anchor_decide: typeof decide;
3498
3778
  declare const anchor_find: typeof find;
3779
+ declare const anchor_follow: typeof follow;
3499
3780
  declare const anchor_handleLine: typeof handleLine;
3500
3781
  declare const anchor_normalizeHandle: typeof normalizeHandle;
3782
+ declare const anchor_owner: typeof owner;
3501
3783
  declare const anchor_remove: typeof remove;
3502
3784
  declare const anchor_render: typeof render;
3503
3785
  declare const anchor_replace: typeof replace;
3504
3786
  declare namespace anchor {
3505
- export { anchor_END_MARKER as END_MARKER, type anchor_FindOptions as FindOptions, type anchor_FoundBlock as FoundBlock, anchor_LEGACY_END_MARKER as LEGACY_END_MARKER, anchor_LEGACY_START_MARKER as LEGACY_START_MARKER, anchor_START_MARKER as START_MARKER, anchor_find as find, anchor_handleLine as handleLine, anchor_normalizeHandle as normalizeHandle, anchor_remove as remove, anchor_render as render, anchor_replace as replace };
3787
+ export { type anchor_DecideOptions as DecideOptions, type anchor_Decision as Decision, anchor_EARLIER_IDENTITY_LINES as EARLIER_IDENTITY_LINES, anchor_END_MARKER as END_MARKER, anchor_FOLLOW_ATTEMPTS as FOLLOW_ATTEMPTS, type anchor_FindOptions as FindOptions, type anchor_FollowOptions as FollowOptions, type anchor_FollowOutcome as FollowOutcome, type anchor_FollowResult as FollowResult, type anchor_FoundBlock as FoundBlock, anchor_LEGACY_END_MARKER as LEGACY_END_MARKER, anchor_LEGACY_START_MARKER as LEGACY_START_MARKER, type anchor_OwnerOptions as OwnerOptions, anchor_START_MARKER as START_MARKER, anchor_decide as decide, anchor_find as find, anchor_follow as follow, anchor_handleLine as handleLine, anchor_normalizeHandle as normalizeHandle, anchor_owner as owner, anchor_remove as remove, anchor_render as render, anchor_replace as replace };
3506
3788
  }
3507
3789
 
3508
3790
  /**
@@ -3696,8 +3978,8 @@ declare class TextsCache {
3696
3978
  }
3697
3979
 
3698
3980
  /**
3699
- * The few file operations the kit needs (the texts cache, the manual), for
3700
- * Node, Bun and Deno. `node:` modules are imported lazily, on first use, so
3981
+ * The few file operations the kit needs (the texts cache, the manual, the
3982
+ * identity block's follow), for Node, Bun and Deno. `node:` modules are imported lazily, on first use, so
3701
3983
  * the SDK still loads in a browser or an edge runtime that never asks for a
3702
3984
  * file.
3703
3985
  *
@@ -3849,6 +4131,17 @@ interface ManualSyncOptions {
3849
4131
  * write that failed), it is tried again on its own after 5 min, doubling to
3850
4132
  * 1 h (±20 %), until one is current: the texts may not change again for a
3851
4133
  * day or more. A texts change syncs at once and starts the backoff over.
4134
+ *
4135
+ * Each retry first asks the texts source to refresh (a `TextsCache`'s own
4136
+ * `refresh()`, coalesced with a fetch in flight), so a retry does not keep
4137
+ * syncing against an announcement the server has since replaced: when the
4138
+ * texts changed, the change syncs; when not, the retry syncs against the
4139
+ * texts in hand. A download that was the manual but not the announced one
4140
+ * (another version, other bytes) asks for that refresh at once, without
4141
+ * waiting for the next step; the body is still refused. While the texts
4142
+ * cache is failing (`lastError` set) no refresh is asked for: its own timer
4143
+ * retries on its own backoff. A source without `refresh()` is not refreshed.
4144
+ *
3852
4145
  * Calls are serialised; `stop()` cancels a pending retry and aborts a
3853
4146
  * download in flight.
3854
4147
  */
@@ -3862,6 +4155,8 @@ declare class ManualSync {
3862
4155
  /** Syncs in a row, since the last current one or texts change, that left the file not the announced manual. */
3863
4156
  private misses;
3864
4157
  private retryTimer;
4158
+ /** Texts changes heard: a refresh that moved it has already queued the change's sync. */
4159
+ private changes;
3865
4160
  constructor(options: ManualSyncOptions);
3866
4161
  /** The latest result, for an integration's status. */
3867
4162
  get result(): ManualSyncResult | null;
@@ -3870,14 +4165,31 @@ declare class ManualSync {
3870
4165
  stop(): void;
3871
4166
  /** One serialised sync against `served` (default: the texts in hand). Null when nothing is in hand or stopped. */
3872
4167
  sync(served?: ServedManual | null): Promise<ManualSyncResult | null>;
3873
- /** `sync`, on the chain. `announced`: the texts changed, so the backoff starts over. */
4168
+ /**
4169
+ * `sync`, on the chain. `announced`: the texts changed, so the backoff
4170
+ * starts over. `fresh`: the texts were just had from the server, so a
4171
+ * download that is another manual asks for no refresh.
4172
+ */
3874
4173
  private run;
4174
+ /** One retry: refresh the texts, then sync unless the refresh changed them (the change has queued its own sync). */
4175
+ private retry;
4176
+ /**
4177
+ * The texts source's own `refresh()` (a `TextsCache`: one fetch, coalesced
4178
+ * with one in flight, its timer re-armed by it). `changed`: a change was
4179
+ * heard, and its sync is queued. `fresh`: the server answered with the same
4180
+ * texts. `stale`: no answer, or not asked — no `refresh()`, stopped, or the
4181
+ * cache is failing (`lastError` set) and its own timer retries on its own
4182
+ * backoff.
4183
+ */
4184
+ private refreshTexts;
4185
+ /** Between `start()` and `stop()`. */
4186
+ private following;
3875
4187
  /**
3876
4188
  * After each result: a current one (or nothing announced) ends the retries
3877
4189
  * and resets the backoff; any other arms the next attempt, while following
3878
- * (between `start()` and `stop()`). At most one is pending; it runs on the
3879
- * chain like any sync, against the texts in hand when it fires. The timer
3880
- * never keeps the process alive.
4190
+ * (between `start()` and `stop()`). At most one is pending; when it fires
4191
+ * it refreshes the texts, then syncs on the chain like any sync, against
4192
+ * the texts in hand. The timer never keeps the process alive.
3881
4193
  */
3882
4194
  private scheduleRetry;
3883
4195
  private cancelRetry;
@@ -5718,4 +6030,4 @@ declare function renderMessageContext(message: Pick<Message, 'sender' | 'created
5718
6030
 
5719
6031
  declare const VERSION: string;
5720
6032
 
5721
- export { ALLOWED_ATTACHMENT_MIME, type AckFrame, type AddContactRequest, type AddMemberRequest, type AddMemberResult, type Agent, AgentChatClient, type AgentChatClientIdentity, type AgentChatClientKind, type AgentChatClientOptions, AgentChatError, type AgentChatErrorResponse, type AgentClaim, type AgentConversationContext, type AgentProfile, type AgentSettings, type AgentStatus, AlreadyClaimedError, type AnyWakeFrame, type AnyWakePayload, type ApiError, type AttachmentMime, AwaitingReplyError, type BacklogWarning, type BacklogWarningHandler, type BlockedAgent, BlockedError, type BlockedHandler, type BlockedInfo, type BuildPromptOptions, CONNECT_BUDGET_CLOSE_CODE, CONNECT_BUDGET_MAX_DELAY_MS, CONNECT_BUDGET_MIN_DELAY_MS, type CallOptions, type ClaimLinkFields, type ClearWakeWebhookResult, type ClientAction, type ConnectBudgetClose, type ConnectHandler, ConnectionError, type Contact, ContainsSecretError, type ContainsSecretKind, type Conversation, type ConversationListItem, type ConversationParticipant, type ConversationType, type ConversationsResource, type CreateClaimLinkResult, type CreateGroupRequest, type CreateUploadRequest, type CreateUploadResponse, DEFAULT_RETRY_POLICY, type DecisionsResource, type DeletedGroupInfo, type DirectConversationLookup, type DisconnectHandler, type DisconnectInfo, EmailExhaustedError, EmailLimitReachedError, ErrorCode, type ErrorHandler, type ErrorInfo, ForbiddenError, type GateClient, type GateModelCall, type GateOutcome, type GateRecordFailure, type GateReply, type GateResult, type GateTexts, type GetMessagesOptions, type GetTextsOptions, type Group, GroupDeletedError, type GroupDetail, type GroupInvitation, type GroupInvitePolicy, type GroupInviteRule, type GroupMember, type GroupRole, type GroupSettings, type GroupSystemEvent, type GroupSystemEventV1, type GroupsResource, HandleRequiredError, type HeartbeatFrame, type HeartbeatHandler, type HttpMethod, type HttpRequestOptions, type HttpResponse, HttpTransport, type HttpTransportOptions, INBOX_TRAY_DEFAULT_LIMIT, INBOX_TRAY_MAX_LIMIT, INBOX_WAIT_MAX_MS, type InboxCard, type InboxCardGroup, type InboxCardPreview, type InboxCardRelationship, type InboxMode, type InboxResource, type InboxTray, type InboxTrayOptions, type KnownReplyDecisionCategory, MAX_ATTACHMENT_SIZE, type MarkConversationReadRequest, type MarkConversationReadResult, type Message, type MessageContent, type MessageCouldNotProcess, type MessageHandler, type MessageStatus, type MessageType, type MessagesPage, type MuteEntry, type MuteTargetKind, NotFoundError, type OtherWakePayload, OtpAttemptsExhaustedError, type PausedByOwner, type Presence, type PresenceBatchRequest, type PresenceBroadcast, type PresenceStatus, type PresenceUpdate, type ProcessingFailureAction, type ProcessingFailureActionName, type ProcessingFailureEvidence, type ProcessingFailureOutcome, RateLimitedError, RealtimeClient, type RealtimeOptions, type RealtimeState, RecipientBackloggedError, type RecordReplyDecisionOptions, type RecordReplyDecisionRequest, type RecoverOptions, type RecoverRequest, type RecoverResult, type RecoverVerifyResult, type RegisterOptions, type RegisterRequest, type RegisterResult, type RegisterVerifyResult, type ReleaseClaimResult, type ReminderWakePayload, type RenderOptions, type ReplyDecision, type ReplyDecisionCategory, type ReplyDecisionVerdict, type ReportProcessingFailureOptions, type ReportProcessingFailureRequest, type ReportRequest, type RequestHooks, type RequestInfo, type ResponseInfo, RestrictedError, type RetryInfo, type RetryOption, type RetryPolicy, type RotateKeyResult, type RotateKeyVerifyResult, type RunGateOptions, type SendMessageRequest, type SendMessageResult, type SendableMessageType, type SequenceGapHandler, type SequenceGapInfo, ServerError, type ServerEvent, type SetWakeWebhookOptions, type SetWakeWebhookRequest, type SignupCodeStatus, type SignupFlow, type SignupFlowFields, type SignupFlowKind, type SignupNextStep, type SignupParam, type SignupStartStep, type SignupVerifyStep, type SocketCapability, type StateHandler, type StaticCallOptions, type StoppedHandler, SuspendedError, type SyncEnvelope, type SyncOptions, type SyncPage, type TestWakeResult, type Texts, type TextsResource, type TextsRuntime, type ToolNamer, type TrayInvite, type UnansweredWakePayload, UnauthorizedError, type UpdateAgentRequest, type UpdateContactRequest, type UpdateGroupRequest, VERSION, ValidationError, type Verdict, type VerifyRequest, type VerifyWakeWebhookOptions, type WakeDialect, type WakeFrame, type WakeHandler, type WakePayload, type WakeWebhookHeaders, type WakeWebhookPayload, type WakeWebhookResource, type WakeWebhookState, type WakeWebhookStatus, WakeWebhookVerificationError, type WakeWebhookVerifyDialect, type WakeWebhookVerifyReason, type WsMessage, connectBudgetDelayMs, createAgentChatError, gate, index as integration, isAuthRejectionClose, paginate, parseRetryAfter, renderMessageContext, verifyWakeWebhook, wakePayloadOf };
6033
+ export { ALLOWED_ATTACHMENT_MIME, type AckFrame, type AddContactRequest, type AddMemberRequest, type AddMemberResult, type Agent, AgentChatClient, type AgentChatClientIdentity, type AgentChatClientKind, type AgentChatClientOptions, AgentChatError, type AgentChatErrorResponse, type AgentClaim, type AgentConversationContext, type AgentProfile, type AgentSettings, type AgentStatus, AlreadyClaimedError, type AnyWakeFrame, type AnyWakePayload, type ApiError, type AttachmentMime, AwaitingReplyError, type BacklogWarning, type BacklogWarningHandler, type BlockedAgent, BlockedError, type BlockedHandler, type BlockedInfo, type BuildPromptOptions, CONNECT_BUDGET_CLOSE_CODE, CONNECT_BUDGET_MAX_DELAY_MS, CONNECT_BUDGET_MIN_DELAY_MS, type CallOptions, type ClaimLinkFields, type ClearWakeCheckResult, type ClearWakeWebhookResult, type ClientAction, type ConnectBudgetClose, type ConnectHandler, ConnectionError, type Contact, ContainsSecretError, type ContainsSecretKind, type Conversation, type ConversationListItem, type ConversationParticipant, type ConversationType, type ConversationsResource, type CreateClaimLinkResult, type CreateGroupRequest, type CreateUploadRequest, type CreateUploadResponse, DEFAULT_RETRY_POLICY, type DecisionsResource, type DeletedGroupInfo, type DirectConversationLookup, type DisconnectHandler, type DisconnectInfo, EmailExhaustedError, EmailLimitReachedError, ErrorCode, type ErrorHandler, type ErrorInfo, ForbiddenError, type GateClient, type GateModelCall, type GateOutcome, type GateRecordFailure, type GateReply, type GateResult, type GateTexts, type GetMessagesOptions, type GetTextsOptions, type Group, GroupDeletedError, type GroupDetail, type GroupInvitation, type GroupInvitePolicy, type GroupInviteRule, type GroupMember, type GroupRole, type GroupSettings, type GroupSystemEvent, type GroupSystemEventV1, type GroupsResource, HandleRequiredError, type HeartbeatFrame, type HeartbeatHandler, type HttpMethod, type HttpRequestOptions, type HttpResponse, HttpTransport, type HttpTransportOptions, INBOX_TRAY_DEFAULT_LIMIT, INBOX_TRAY_MAX_LIMIT, INBOX_WAIT_MAX_MS, type InboxCard, type InboxCardGroup, type InboxCardPreview, type InboxCardRelationship, type InboxMode, type InboxResource, type InboxTray, type InboxTrayOptions, type KnownReplyDecisionCategory, MAX_ATTACHMENT_SIZE, type MarkConversationReadRequest, type MarkConversationReadResult, type Message, type MessageContent, type MessageCouldNotProcess, type MessageHandler, type MessageStatus, type MessageType, type MessagesPage, type MuteEntry, type MuteTargetKind, NotFoundError, type OtherWakePayload, OtpAttemptsExhaustedError, type PausedByOwner, type Presence, type PresenceBatchRequest, type PresenceBroadcast, type PresenceStatus, type PresenceUpdate, type ProcessingFailureAction, type ProcessingFailureActionName, type ProcessingFailureEvidence, type ProcessingFailureOutcome, RateLimitedError, RealtimeClient, type RealtimeOptions, type RealtimeState, RecipientBackloggedError, type RecordReplyDecisionOptions, type RecordReplyDecisionRequest, type RecoverOptions, type RecoverRequest, type RecoverResult, type RecoverVerifyResult, type RegisterOptions, type RegisterRequest, type RegisterResult, type RegisterVerifyResult, type ReleaseClaimResult, type ReminderWakePayload, type RenderOptions, type ReplyDecision, type ReplyDecisionCategory, type ReplyDecisionVerdict, type ReportProcessingFailureOptions, type ReportProcessingFailureRequest, type ReportRequest, type RequestHooks, type RequestInfo, type ResponseInfo, RestrictedError, type RetryInfo, type RetryOption, type RetryPolicy, type RotateKeyResult, type RotateKeyVerifyResult, type RunGateOptions, type SendMessageRequest, type SendMessageResult, type SendableMessageType, type SequenceGapHandler, type SequenceGapInfo, ServerError, type ServerEvent, type SetWakeCheckOptions, type SetWakeCheckRequest, type SetWakeWebhookOptions, type SetWakeWebhookRequest, type SignupCodeStatus, type SignupFlow, type SignupFlowFields, type SignupFlowKind, type SignupNextStep, type SignupParam, type SignupStartStep, type SignupVerifyStep, type SocketCapability, type StateHandler, type StaticCallOptions, type StoppedHandler, SuspendedError, type SyncEnvelope, type SyncOptions, type SyncPage, type TestWakeResult, type Texts, type TextsResource, type TextsRuntime, type ToolNamer, type TrayInvite, type UnansweredWakePayload, UnauthorizedError, type UpdateAgentRequest, type UpdateContactRequest, type UpdateGroupRequest, VERSION, ValidationError, type Verdict, type VerifyRequest, type VerifyWakeWebhookOptions, type WakeCheckResource, type WakeCheckStatus, type WakeDialect, type WakeFrame, type WakeHandler, type WakePayload, type WakeWebhookHeaders, type WakeWebhookPayload, type WakeWebhookResource, type WakeWebhookState, type WakeWebhookStatus, WakeWebhookVerificationError, type WakeWebhookVerifyDialect, type WakeWebhookVerifyReason, type WsMessage, connectBudgetDelayMs, createAgentChatError, gate, index as integration, isAuthRejectionClose, paginate, parseRetryAfter, renderMessageContext, verifyWakeWebhook, wakePayloadOf };