@niadra/sdk 0.9.0 → 0.10.3

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.
Files changed (87) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/README.md +40 -1
  3. package/dist/ai-sdk.d.cts +3 -3
  4. package/dist/ai-sdk.d.ts +3 -3
  5. package/dist/anthropic.d.cts +4 -4
  6. package/dist/anthropic.d.ts +4 -4
  7. package/dist/bedrock.d.cts +4 -4
  8. package/dist/bedrock.d.ts +4 -4
  9. package/dist/cli.js +368 -104
  10. package/dist/cli.js.map +1 -1
  11. package/dist/{client-B_ip8T2o.d.cts → client-rmWhZJOx.d.cts} +212 -21
  12. package/dist/{client-B_ip8T2o.d.ts → client-rmWhZJOx.d.ts} +212 -21
  13. package/dist/cloudflare-agents.d.cts +3 -3
  14. package/dist/cloudflare-agents.d.ts +3 -3
  15. package/dist/elevenlabs.cjs +7 -5
  16. package/dist/elevenlabs.cjs.map +1 -1
  17. package/dist/elevenlabs.d.cts +5 -5
  18. package/dist/elevenlabs.d.ts +5 -5
  19. package/dist/elevenlabs.js +7 -5
  20. package/dist/elevenlabs.js.map +1 -1
  21. package/dist/genkit.d.cts +3 -3
  22. package/dist/genkit.d.ts +3 -3
  23. package/dist/google-adk.cjs +7 -5
  24. package/dist/google-adk.cjs.map +1 -1
  25. package/dist/google-adk.d.cts +3 -3
  26. package/dist/google-adk.d.ts +3 -3
  27. package/dist/google-adk.js +7 -5
  28. package/dist/google-adk.js.map +1 -1
  29. package/dist/google-genai.d.cts +4 -4
  30. package/dist/google-genai.d.ts +4 -4
  31. package/dist/index.cjs +378 -106
  32. package/dist/index.cjs.map +1 -1
  33. package/dist/index.d.cts +13 -5
  34. package/dist/index.d.ts +13 -5
  35. package/dist/index.js +378 -106
  36. package/dist/index.js.map +1 -1
  37. package/dist/{intercept-CxmBLfoj.d.cts → intercept-C0XODsy9.d.cts} +1 -1
  38. package/dist/{intercept-CBaPK_-k.d.ts → intercept-veMDudKV.d.ts} +1 -1
  39. package/dist/langchain.cjs.map +1 -1
  40. package/dist/langchain.d.cts +3 -3
  41. package/dist/langchain.d.ts +3 -3
  42. package/dist/langchain.js.map +1 -1
  43. package/dist/livekit.cjs +10 -2
  44. package/dist/livekit.cjs.map +1 -1
  45. package/dist/livekit.d.cts +3 -3
  46. package/dist/livekit.d.ts +3 -3
  47. package/dist/livekit.js +10 -2
  48. package/dist/livekit.js.map +1 -1
  49. package/dist/llamaindex.d.cts +3 -3
  50. package/dist/llamaindex.d.ts +3 -3
  51. package/dist/mastra.d.cts +3 -3
  52. package/dist/mastra.d.ts +3 -3
  53. package/dist/openai-agents.d.cts +3 -3
  54. package/dist/openai-agents.d.ts +3 -3
  55. package/dist/retell.cjs +7 -5
  56. package/dist/retell.cjs.map +1 -1
  57. package/dist/retell.d.cts +5 -5
  58. package/dist/retell.d.ts +5 -5
  59. package/dist/retell.js +7 -5
  60. package/dist/retell.js.map +1 -1
  61. package/dist/{shared-BLkAbvuf.d.ts → shared-Cs7h5C4Y.d.ts} +1 -1
  62. package/dist/{shared-DEkF2Y_z.d.cts → shared-zaTBum17.d.cts} +1 -1
  63. package/dist/strands.d.cts +3 -3
  64. package/dist/strands.d.ts +3 -3
  65. package/dist/twilio.cjs +10 -2
  66. package/dist/twilio.cjs.map +1 -1
  67. package/dist/twilio.d.cts +4 -4
  68. package/dist/twilio.d.ts +4 -4
  69. package/dist/twilio.js +10 -2
  70. package/dist/twilio.js.map +1 -1
  71. package/dist/vapi.cjs +7 -5
  72. package/dist/vapi.cjs.map +1 -1
  73. package/dist/vapi.d.cts +5 -5
  74. package/dist/vapi.d.ts +5 -5
  75. package/dist/vapi.js +7 -5
  76. package/dist/vapi.js.map +1 -1
  77. package/dist/voltagent.d.cts +3 -3
  78. package/dist/voltagent.d.ts +3 -3
  79. package/dist/{webhook-BaraTaA9.d.ts → webhook-2V5QgnKI.d.ts} +1 -1
  80. package/dist/{webhook-CuR0Wckd.d.cts → webhook-CX7nvQig.d.cts} +1 -1
  81. package/dist/whatsapp.cjs +10 -2
  82. package/dist/whatsapp.cjs.map +1 -1
  83. package/dist/whatsapp.d.cts +2 -2
  84. package/dist/whatsapp.d.ts +2 -2
  85. package/dist/whatsapp.js +10 -2
  86. package/dist/whatsapp.js.map +1 -1
  87. package/package.json +3 -2
@@ -33,7 +33,7 @@ type DeliveryPath = "t0" | "t1" | "t2" | "t3" | "t4" | "holdout" | "not_modified
33
33
  * Kinds of history items the navigation calls can filter on. A system event is never an item: it
34
34
  * changes its object's state, so filter on `object`.
35
35
  */
36
- type HistoryItemKind = "episode" | "fact" | "open_item" | "action" | "object" | "trait";
36
+ type HistoryItemKind = "episode" | "fact" | "open_item" | "action" | "object" | "trait" | "system_event";
37
37
  /**
38
38
  * The shape of the pack. Channel views (`voice`, `chat`) size it for the medium; `account`
39
39
  * and `partner` read an organization; `task:<name>` views serve internal agents.
@@ -1167,12 +1167,14 @@ interface OutcomeLink {
1167
1167
  /** The outcome definition of the `measurement` document. */
1168
1168
  outcome: string;
1169
1169
  position?: number | null;
1170
+ /** The purchase it counts in, when the revenue definition counts a split purchase's parts as one order. */
1171
+ purchase?: string | null;
1170
1172
  /** The state the object or its line is in. */
1171
1173
  state: string;
1172
1174
  turn_id?: string | null;
1173
1175
  /** When the outcome first counted. */
1174
1176
  valid_at: string;
1175
- /** In the currency's minor units; absent: none. */
1177
+ /** In the currency's minor units, as the signed revenue definition counts it; absent: none. */
1176
1178
  value_minor?: number | null;
1177
1179
  }
1178
1180
  interface OutcomePage {
@@ -1519,6 +1521,12 @@ interface DerivedState {
1519
1521
  logic: "yes" | "no" | "unobserved";
1520
1522
  /** The related objects it was computed over. */
1521
1523
  over: number;
1524
+ /**
1525
+ * When it is not `yes`, the related objects, as `type:namespace:id`, that kept it from `yes`: for `all` and
1526
+ * `any` the ones the condition does not hold for or that are not known, for `count`, `min` and `max` the
1527
+ * ones not known. In the relation's order, the first 10.
1528
+ */
1529
+ pieces_out?: string[];
1522
1530
  /**
1523
1531
  * How many of them were not known: out of the working set, not an exact match (`status_field`), or with the
1524
1532
  * data the condition reads not observed.
@@ -2142,6 +2150,11 @@ interface BudgetBlock {
2142
2150
  interface ContextResponse {
2143
2151
  /** `true` when `known_etag` still matches; `text` is then omitted. */
2144
2152
  not_modified: boolean;
2153
+ /**
2154
+ * `about` named an organization with no active link to the subject: the pack is the subject's own, without
2155
+ * that organization's block. It never says whether the organization exists.
2156
+ */
2157
+ about_unlinked?: boolean;
2145
2158
  text?: string | null;
2146
2159
  variables: Record<string, string>;
2147
2160
  version: string;
@@ -2271,6 +2284,11 @@ interface SearchResponse {
2271
2284
  window?: TimeWindow | null;
2272
2285
  /** Filters the server could not read and left out, such as `when`. */
2273
2286
  ignored?: string[];
2287
+ /**
2288
+ * `about` named an organization with no active link to the subject: the rows are the subject's own. It
2289
+ * never says whether the organization exists.
2290
+ */
2291
+ about_unlinked?: boolean;
2274
2292
  }
2275
2293
  /** Body of `POST /v1/history/timeline`. */
2276
2294
  interface TimelineRequest {
@@ -2291,6 +2309,8 @@ interface OpenItemRequest {
2291
2309
  item_id: string;
2292
2310
  /** The customer the item must belong to; any other item answers 404. */
2293
2311
  subject?: Handle | null;
2312
+ /** The organization the customer acts for: also an item of it the customer's view shows. */
2313
+ about?: Handle | null;
2294
2314
  verification?: Verification;
2295
2315
  conversation_id?: string | null;
2296
2316
  }
@@ -2301,6 +2321,11 @@ interface TimelineResponse {
2301
2321
  as_of?: string | null;
2302
2322
  window?: TimeWindow | null;
2303
2323
  ignored?: string[];
2324
+ /**
2325
+ * `about` named an organization with no active link to the subject: the rows are the subject's own. It
2326
+ * never says whether the organization exists.
2327
+ */
2328
+ about_unlinked?: boolean;
2304
2329
  }
2305
2330
  /** One version of a history item. */
2306
2331
  interface ItemVersion {
@@ -2668,6 +2693,19 @@ declare const TOOL_DEFINITIONS: readonly ToolDefinition[];
2668
2693
  */
2669
2694
  declare const AGENT_MEMORY_TOOL_DEFINITIONS: readonly ToolDefinition[];
2670
2695
 
2696
+ /**
2697
+ * Where the SDK reports what it swallowed in fail-open mode. Messages carry status codes,
2698
+ * error codes and request ids, never handles, message text or other personal data.
2699
+ */
2700
+ interface Logger {
2701
+ debug(message: string, ...details: unknown[]): void;
2702
+ warn(message: string, ...details: unknown[]): void;
2703
+ error(message: string, ...details: unknown[]): void;
2704
+ }
2705
+ /** Warnings and errors go to the console; debug output is off unless you pass your own logger. */
2706
+ declare const consoleLogger: Logger;
2707
+ declare const silentLogger: Logger;
2708
+
2671
2709
  /**
2672
2710
  * When a request may be sent again.
2673
2711
  *
@@ -2699,6 +2737,8 @@ interface RequestSpec {
2699
2737
  retry: RetryPolicy;
2700
2738
  signal?: AbortSignal | undefined;
2701
2739
  headers?: Record<string, string> | undefined;
2740
+ /** `false` for the SDK's own upkeep (the keep-warm ping): it is not the client's use. */
2741
+ activity?: boolean;
2702
2742
  }
2703
2743
 
2704
2744
  /** `GET /v1/sources/me`: what a key authenticates as. */
@@ -2926,6 +2966,86 @@ interface ContextUseEntry {
2926
2966
  */
2927
2967
  slots: Record<string, unknown>[];
2928
2968
  }
2969
+ type LinkMethod = "system_import" | "co_occurrence" | "declared" | "login";
2970
+ /** Body of `POST /v1/identity/links`: a person who acts for an organization (an account or a partner). */
2971
+ interface LinkRequest {
2972
+ person: Handle;
2973
+ organization: Handle;
2974
+ /** buyer, driver, broker, technical_contact, owner... */
2975
+ role: string;
2976
+ /** Whether the person reads what the organization's other contacts said; needs the `admin` scope. */
2977
+ can_see_contacts?: boolean;
2978
+ valid_from?: string | null;
2979
+ valid_to?: string | null;
2980
+ method?: LinkMethod;
2981
+ }
2982
+ /** A person-organization link: from `valid_from` until `valid_to` (open when absent). */
2983
+ interface Link {
2984
+ link_id: string;
2985
+ person_handle_id: string;
2986
+ org_handle_id: string;
2987
+ role: string;
2988
+ can_see_contacts: boolean;
2989
+ valid_from: string;
2990
+ valid_to?: string | null;
2991
+ }
2992
+ /** A rate with its 95% Wilson interval; `n` is the denominator, so a small sample gets a wide interval. */
2993
+ interface ContextUseRate {
2994
+ value: number;
2995
+ low: number;
2996
+ high: number;
2997
+ n: number;
2998
+ }
2999
+ /** One group of the context-use report: the dimensions asked for, the counts and the rates. */
3000
+ interface ContextUseBucket {
3001
+ day?: string | null;
3002
+ source_id?: string | null;
3003
+ vendor?: string | null;
3004
+ channel?: string | null;
3005
+ view?: string | null;
3006
+ experiment_group?: string | null;
3007
+ sessions: number;
3008
+ no_context: number;
3009
+ deliveries: number;
3010
+ not_measured: number;
3011
+ late_deliveries: number;
3012
+ deliveries_used: number;
3013
+ questions: number;
3014
+ repeated: number;
3015
+ contradicted: number;
3016
+ selection_misses: number;
3017
+ transfers: number;
3018
+ transfers_unread: number;
3019
+ recontacts: number;
3020
+ trimmed_deliveries: number;
3021
+ tokens_saved: number;
3022
+ answers_checked: number;
3023
+ unbacked_values: number;
3024
+ guard_violations: number;
3025
+ unbacked_per_1000?: number | null;
3026
+ usage_rate?: ContextUseRate | null;
3027
+ repetition_rate?: ContextUseRate | null;
3028
+ transfer_unread_rate?: ContextUseRate | null;
3029
+ recontact_rate?: ContextUseRate | null;
3030
+ }
3031
+ /** `GET /v1/context-use`: how the agents used the context they read; the other blocks pass through as sent. */
3032
+ interface ContextUseReport {
3033
+ since: string;
3034
+ until: string;
3035
+ group_by: string[];
3036
+ buckets: ContextUseBucket[];
3037
+ [block: string]: unknown;
3038
+ }
3039
+ type ContextUseDimension = "day" | "source_id" | "vendor" | "channel" | "view" | "experiment_group";
3040
+ interface ContextUseParams {
3041
+ since?: string;
3042
+ until?: string;
3043
+ group_by?: ContextUseDimension[];
3044
+ source_id?: string;
3045
+ channel?: string;
3046
+ view?: string;
3047
+ experiment_group?: string;
3048
+ }
2929
3049
 
2930
3050
  /**
2931
3051
  * The write side: items of `POST /v1/batch`. A batch mixes item types, and one bad item never
@@ -3903,19 +4023,6 @@ declare class InternalText {
3903
4023
  private fingerprints;
3904
4024
  }
3905
4025
 
3906
- /**
3907
- * Where the SDK reports what it swallowed in fail-open mode. Messages carry status codes,
3908
- * error codes and request ids, never handles, message text or other personal data.
3909
- */
3910
- interface Logger {
3911
- debug(message: string, ...details: unknown[]): void;
3912
- warn(message: string, ...details: unknown[]): void;
3913
- error(message: string, ...details: unknown[]): void;
3914
- }
3915
- /** Warnings and errors go to the console; debug output is off unless you pass your own logger. */
3916
- declare const consoleLogger: Logger;
3917
- declare const silentLogger: Logger;
3918
-
3919
4026
  /**
3920
4027
  * Writes the agent's code made that must reach Niadra, sent in the background and in order: coordination
3921
4028
  * declarations, and agent state writes made while Niadra was out of reach.
@@ -3928,6 +4035,8 @@ declare const silentLogger: Logger;
3928
4035
 
3929
4036
  interface Write {
3930
4037
  send(): Promise<unknown>;
4038
+ /** `POST /v1/coordination/declare`: what a refusal names in the log. */
4039
+ route?: string;
3931
4040
  settled?: (answer: unknown, error: unknown) => void;
3932
4041
  }
3933
4042
  declare class Outbox {
@@ -4770,7 +4879,8 @@ declare class TurnRecorder implements Submit {
4770
4879
  /** Turns lost so far: dropped whole by a full queue, refused by the API, or not kept by the space. */
4771
4880
  get dropped(): number;
4772
4881
  sent(accepted: number, duplicates: number): void;
4773
- rejected(count: number, codes: readonly string[]): void;
4882
+ /** `reasons`: the API's code and detail of each refusal (field paths and rules, never a value). */
4883
+ rejected(count: number, reasons: readonly string[]): void;
4774
4884
  /** The space does not record turns: these are dropped, and with `off` (a 404) recording stops a while. */
4775
4885
  notRecorded(count: number, off: boolean): void;
4776
4886
  modeRefused(): void;
@@ -4856,7 +4966,13 @@ declare class SuppressionCopy {
4856
4966
  * refuses without a token): `defer`, `unavailable`;
4857
4967
  * - any other purpose (`transactional`, `service`...): `allow`, `unchecked`, and the declaration says so.
4858
4968
  *
4859
- * `failOpen` overrides the purpose's direction; a space that does not coordinate (404) holds nothing back.
4969
+ * A check the API refuses (400, 401, 403 or 422: a purpose or channel the space does not declare, a key without the
4970
+ * `coordinate` scope) is the integration's error, not an outage: an outbound contact gets `defer` with the reason
4971
+ * `invalid_request` (an inbound message is never held: `allow`), the problem is logged with its request id, and
4972
+ * `strict: true` throws it.
4973
+ *
4974
+ * `failOpen` overrides the purpose's direction when Niadra did not answer; a space that does not coordinate
4975
+ * (404) holds nothing back.
4860
4976
  * Declarations (`conversation.declare`) leave in the background with an idempotency key and are sent again
4861
4977
  * until Niadra takes them; a turn records its decisions and the effects it reported.
4862
4978
  */
@@ -4892,7 +5008,8 @@ declare class Coordinator {
4892
5008
  private readonly outbox;
4893
5009
  private readonly suppressions;
4894
5010
  private readonly declareNow;
4895
- constructor(outbox: Outbox, suppressions: SuppressionCopy, declareNow: (body: Record<string, unknown>, key: string) => Promise<unknown>);
5011
+ private readonly logger?;
5012
+ constructor(outbox: Outbox, suppressions: SuppressionCopy, declareNow: (body: Record<string, unknown>, key: string) => Promise<unknown>, logger?: Logger | undefined);
4896
5013
  failed(request: CheckRequest, failOpen: boolean | undefined, error?: unknown): Promise<CheckResult>;
4897
5014
  decided(result: CheckResult, request: CheckRequest, checked: Checked): CheckResult;
4898
5015
  /** Queues one declaration; returns its idempotency key, or `""` in a replay, where nothing leaves. */
@@ -5026,6 +5143,8 @@ interface AgentHost {
5026
5143
  budgetMs?: number;
5027
5144
  }): Promise<ClaimVerdict>;
5028
5145
  enabled: boolean;
5146
+ /** Throw what the API refused instead of falling back. */
5147
+ strict: boolean;
5029
5148
  navigationMs: number;
5030
5149
  }
5031
5150
  /** A turn's options: its kind, the build it runs on, the agent and its role, and an id of your own. */
@@ -6253,6 +6372,13 @@ interface ObjectTimelineParams {
6253
6372
  * Per-method time budgets in milliseconds. They are the SDK's own and deliberately short:
6254
6373
  * managed agent platforms allow 7 to 10 seconds per turn and self-hosted frameworks allow no
6255
6374
  * limit at all, so a slow memory call must never become a slow agent.
6375
+ *
6376
+ * `context` and `navigation` left at their defaults are what the API may take: the client measures
6377
+ * the round trip to the region once when it starts (`VoiceOptions.probe`) and adds it on top, so an
6378
+ * agent far from the region (Sao Paulo is 170 ms from us-east-2) is not timed out by the network.
6379
+ * A value you set is a ceiling the SDK keeps; when the measured round trip plus 50 ms exceeds it,
6380
+ * the client logs one warning, since every such read would run out of time. Before the measurement
6381
+ * ends, the defaults apply as they are (with `connect` on top while no connection is open).
6256
6382
  */
6257
6383
  interface Timeouts {
6258
6384
  /** `context()` for every view except `voice`. */
@@ -6294,6 +6420,12 @@ interface Timeouts {
6294
6420
  * on after its turn's budget.
6295
6421
  */
6296
6422
  prefetch: number;
6423
+ /**
6424
+ * Added once to a call's budget when no connection to the API is likely open (no answer within
6425
+ * `keepAliveMs`): TCP and TLS take a few round trips, 300 ms or more from another continent. With a
6426
+ * connection open, budgets are exact. 0 never adds it.
6427
+ */
6428
+ connect: number;
6297
6429
  }
6298
6430
  declare const DEFAULT_TIMEOUTS: Timeouts;
6299
6431
  /** How `context()` reuses packs inside a conversation. */
@@ -6328,8 +6460,9 @@ interface VoiceOptions {
6328
6460
  */
6329
6461
  minCoverage: number;
6330
6462
  /**
6331
- * Measure the round trip to the region once, with `GET /healthz`, and log a warning when the
6332
- * voice budgets cannot hold it.
6463
+ * Measure the round trip to the region once, with `GET /healthz`, when the client starts: the
6464
+ * default read budgets add it (`Timeouts`), and a warning says when a budget you set, or a voice
6465
+ * budget once the client reads in voice, cannot hold it. `false` measures nothing.
6333
6466
  */
6334
6467
  probe: boolean;
6335
6468
  }
@@ -6387,8 +6520,20 @@ interface ClientOptions {
6387
6520
  strict?: boolean;
6388
6521
  /** Flush queued events when a Node process is about to exit. Defaults to `true`. */
6389
6522
  flushOnExit?: boolean;
6523
+ /**
6524
+ * While a conversation or task is open and the client was used in the last 10 minutes, keep the connection to
6525
+ * the region open with a `GET /healthz` every 100 s of quiet, so a turn after a long pause does not pay for a
6526
+ * new connection (`warm.ts`). Defaults to `true`; `false` never pings.
6527
+ */
6528
+ keepWarm?: boolean;
6390
6529
  /** A `fetch` implementation. Defaults to the global one. */
6391
6530
  fetch?: typeof fetch;
6531
+ /**
6532
+ * How long your `fetch` keeps an idle connection open: 4 s, undici's default over HTTP/1.1. A `fetch` with an undici
6533
+ * `Agent({ keepAliveTimeout: 120_000 })` keeps a conversation's turns on one connection; say so here, and
6534
+ * `timeouts.connect` is spent only when a connection really closed.
6535
+ */
6536
+ keepAliveMs?: number;
6392
6537
  logger?: Logger;
6393
6538
  /** Extra headers sent with every request. */
6394
6539
  defaultHeaders?: Record<string, string>;
@@ -6566,6 +6711,11 @@ interface OpenParams {
6566
6711
  * 404 otherwise. `tools()` passes the bound customer.
6567
6712
  */
6568
6713
  subject?: Handle;
6714
+ /**
6715
+ * The organization the customer acts for: also an item of it the customer's view shows (the pack's
6716
+ * account block). Needs `subject`; `tools()` passes the bound one.
6717
+ */
6718
+ about?: Handle;
6569
6719
  }
6570
6720
  /**
6571
6721
  * The Niadra client.
@@ -6588,6 +6738,12 @@ declare class Niadra {
6588
6738
  readonly enabled: boolean;
6589
6739
  private readonly core;
6590
6740
  private readonly timeouts;
6741
+ private readonly keepWarm;
6742
+ private warmTimer;
6743
+ /** The read budgets the caller left at their defaults: they take the measured round trip on top. */
6744
+ private readonly defaultReads;
6745
+ private voiceStarted;
6746
+ private voiceWarned;
6591
6747
  private readonly strict;
6592
6748
  /** Where the client reports what it swallows in fail-open mode. */
6593
6749
  readonly logger: Logger;
@@ -6850,6 +7006,29 @@ declare class Niadra {
6850
7006
  * `ok: false`.
6851
7007
  */
6852
7008
  feedback(params: FeedbackParams): Promise<WriteResult>;
7009
+ /**
7010
+ * How the space's agents used the context they read (`GET /v1/context-use`): sessions, deliveries, use,
7011
+ * repetition, transfers and recontact, with intervals, grouped by `group_by`. A key of an `analyst` source
7012
+ * with the `analytics` scope reads every source of the space; a key with `admin` reads its own source.
7013
+ */
7014
+ contextUse(params?: ContextUseParams, options?: RequestOptions): Promise<Result<ContextUseReport>>;
7015
+ /**
7016
+ * Links a person to the organization they act for (an account or a partner), as a system of record that
7017
+ * knows who works for whom: a CRM, an HR system. Needs a key with the `identity:link` scope (or `admin`);
7018
+ * `can_see_contacts` needs `admin`. Reads with `about` reach the organization through the link.
7019
+ */
7020
+ link(params: Omit<LinkRequest, "method"> & {
7021
+ method?: LinkMethod;
7022
+ idempotency_key?: string;
7023
+ }, options?: RequestOptions): Promise<Result<Link>>;
7024
+ /**
7025
+ * Ends a link, from `valid_to` (now when absent): the person no longer acts for the organization, and reads
7026
+ * with `about` for the pair go on with the person's own memory. Needs `identity:link` or `admin`.
7027
+ */
7028
+ endLink(linkId: string, params?: {
7029
+ valid_to?: string;
7030
+ idempotency_key?: string;
7031
+ }, options?: RequestOptions): Promise<Result<Link>>;
6853
7032
  /**
6854
7033
  * Up to 500 corrections in one call, each with its own idempotency key (minted when missing).
6855
7034
  * Resolves with `accepted`, `duplicates` for replayed keys and one error per refused item, by index.
@@ -6936,6 +7115,15 @@ declare class Niadra {
6936
7115
  private voiceCache;
6937
7116
  /** Measures the round trip to the region once per client, in the background. */
6938
7117
  private probe;
7118
+ /**
7119
+ * A read budget: one the caller left at its default is what the API may take, and the measured round trip
7120
+ * to the region goes on top, so an agent far from the region (Sao Paulo, 170 ms from us-east-2) is not
7121
+ * timed out by the network; one the caller set is a ceiling.
7122
+ */
7123
+ private readBudget;
7124
+ /** The client reads in voice: the voice budgets' warnings matter from now on. */
7125
+ private startVoice;
7126
+ private warnVoice;
6939
7127
  /**
6940
7128
  * A voice turn: the pinned body from memory, and the slots of the read of its words when that
6941
7129
  * read lands within `timeout`. See `voice.ts`.
@@ -6953,8 +7141,11 @@ declare class Niadra {
6953
7141
  private enqueue;
6954
7142
  private sendTurns;
6955
7143
  private sendNow;
7144
+ /** Notes an open conversation or task; the first one starts the keep-warm timer (`warm.ts`). */
7145
+ private warm;
7146
+ private warmTick;
6956
7147
  private endScope;
6957
7148
  private sendBatch;
6958
7149
  }
6959
7150
 
6960
- export { type AssertionOutcome as $, AGENT_MEMORY_TOOL_DEFINITIONS as A, type AgentState as B, type ConstraintsBlock as C, type Conflict as D, AgentStateHandle as E, type AgentStateMeta as F, type AgentStateMetaPage as G, type HardConstraint as H, InternalText as I, type AgentStateReadRequest as J, type AgentStateScope as K, type Logger as L, type Mode as M, NiadraError as N, type ObjectRef as O, type AgentStateWrite as P, type AgentStateWriteResult as Q, Resolvers as R, type SubjectKind as S, type TurnPins as T, type AgentTurnOptions as U, type AnchorEvidence as V, Api as W, type ArmComparison as X, type ArmOutcomes as Y, type AskedAttribute as Z, type AssertionMethod as _, type ClaimRecord as a, type Conflict$1 as a$, type AssertionStats as a0, type Attribute as a1, type AttributeEntry as a2, type AttributionReport as a3, type AttributionRow as a4, type AttributionTotal as a5, type Backing as a6, type BackingReport as a7, Sources as a8, type BatchItem as a9, type CheckRequest as aA, type CheckResult as aB, ClaimCheck as aC, type CheckOptions$1 as aD, type ClaimContractSummary as aE, type ClaimEvidence as aF, type ClaimEvidenceRef as aG, type ClaimKind as aH, type ClaimOutputs as aI, type ClaimParams as aJ, type ClaimRelease as aK, type ClaimRequest as aL, type ClaimValue as aM, type ClaimVerdict as aN, type ClaimVia as aO, type Claimed as aP, type ClientOptions as aQ, type Closes as aR, type Commitment as aS, type CommitmentDecided as aT, type CommitmentDecidedDetail as aU, type CommitmentMade as aV, type CommitmentMadeDetail as aW, type CommitmentRef as aX, type CommitmentWithdrawn as aY, type CommitmentWithdrawnDetail as aZ, type CompanyRule as a_, type BatchRequest as aa, type BatchResponse as ab, type BiFile as ac, type BiUpload as ad, type BiUploadRequest as ae, BlobError as af, type BlobStore as ag, type BlockSubject as ah, type BoundArg as ai, type BoundTools as aj, type BudgetBlock as ak, type BudgetCut as al, type BudgetPack as am, type BudgetUse as an, type CacheDirectives as ao, type CacheOptions as ap, CallCapture as aq, type CaseClosed as ar, type CaseOpened as as, type Change as at, type ChangePage as au, type ChangeSinceSeen as av, type ChannelState as aw, type CheckBatchRequest as ax, type CheckBatchResponse as ay, type CheckOptions as az, type ClaimCategory as b, type EffectDetail as b$, type ConflictCounts as b0, type ConstraintOrigin as b1, type ConstraintsRequest as b2, type ContactBudget as b3, type ContactBudgetUse as b4, type ContactClaims as b5, type ContactCount as b6, ContactGateway as b7, type ContactKey as b8, type ContactKeys as b9, type CoordinationReportPage as bA, type CorrectParams as bB, type CorrectionAction as bC, type CorrectionRequest as bD, type CounterfactualCase as bE, type CounterfactualEngaged as bF, type CounterfactualEngagement as bG, type CounterfactualRunCreate as bH, type CounterfactualRunPage as bI, type CreateAgentNoteRequest as bJ, DEFAULT_CACHE as bK, DEFAULT_QUEUE as bL, DEFAULT_TIMEOUTS as bM, DEFAULT_VOICE as bN, DELETE as bO, type DataIssue as bP, type DataIssuePage as bQ, Declarations as bR, type DeclareRequest as bS, type DeclareResult as bT, type DeliveryPath as bU, type DerivedState as bV, type Detect as bW, type DriftChanges as bX, type Effect as bY, type EffectCount as bZ, type EffectDeclared as b_, type ContactMade as ba, type ContactMadeDetail as bb, type VerifyParams$1 as bc, type Refusal as bd, type Content as be, type ContentMarker as bf, type ContentMode as bg, type ContentRelease as bh, type ContentReleaseResult as bi, ContentResolver as bj, type ContextFormat as bk, type ContextOptions as bl, type ContextPack as bm, type ContextParams as bn, type ContextRequest as bo, type ContextSource as bp, type ContextStamp as bq, type ContextUseEntry as br, Conversation as bs, type ConversationAction as bt, type ConversationEndedItem as bu, type ConversationEvent as bv, type ConversationParams as bw, type CoordinationBlock as bx, type CoordinationOverview as by, type CoordinationReport as bz, Niadra as c, type LeaseDetail as c$, type EffectKind as c0, type EffectReserve as c1, type EffectSeen as c2, type EffectSettle as c3, type EffectState as c4, type EffectStatus as c5, type Engaged as c6, type EpisodeOut as c7, type Erasure as c8, type EventItem as c9, type HandoffDeclared as cA, type HandoffDetail as cB, type HandoffItem as cC, type HandoffOutcome as cD, type HandoffPackage as cE, type HandoffParams as cF, type HeartbeatItem as cG, type HistoryFilters as cH, type HistoryItem as cI, type HistoryItemKind as cJ, type IdentifyItem as cK, type IdentifyParams as cL, type IdentityCalibration as cM, type Include as cN, type Inference as cO, type InferenceCorrection as cP, type InferencePage as cQ, type IngestStatus as cR, type InterestState as cS, type InterleavingReport as cT, type InterleavingRow as cU, type InterleavingTotal as cV, type InternalText$1 as cW, type ItemError as cX, type ItemVersion as cY, type KeyIdentity as cZ, type LeaseDeclared as c_, type EventKind as ca, type Evidence as cb, type ExperimentReport as cc, type ExperimentResult as cd, type ExportPackage as ce, FAIL_CLOSED as cf, type FactHistory as cg, type FactOut as ch, type Feature as ci, type Feedback as cj, type FeedbackAction as ck, type FeedbackParams as cl, type FeedbackRequest as cm, type Fetched as cn, type FieldCoverage as co, type FieldState as cp, type ForgetTarget as cq, type GatewayOptions as cr, Guard as cs, type GuardLike as ct, type GuardOptions as cu, type Guarded as cv, type HandleType as cw, type Handoff as cx, type HandoffContext as cy, type HandoffCreate as cz, type ContextResponse as d, type Presented as d$, type LegalHold as d0, type LegalHoldCreate as d1, type LegalHoldRelease as d2, type LiveTurn as d3, type Lock as d4, MAX_BATCH_ITEMS as d5, MAX_EVENT_TEXT as d6, MAX_MEDIA_BYTES as d7, type MediaUpload as d8, type MediaUploadRequest as d9, type ObjectTimelineParams as dA, type Observation as dB, type OpenItemOut as dC, type OpenItemRequest as dD, type OpenObject as dE, type OpenParams as dF, type OpenedItem as dG, type Origin as dH, type OutcomeLink as dI, type OutcomePage as dJ, type OutcomeRequest as dK, type OutcomeState as dL, type Owner as dM, type OwnershipClaim as dN, type OwnershipCount as dO, PERSONAL_DATA_TOOL_ERROR as dP, type PackGuard as dQ, type PackLayer as dR, type PackSection as dS, type PackSlot as dT, type PackSlotDerived as dU, type PackStamp as dV, type PowerRequest as dW, type PowerResult as dX, type Preference as dY, type PrefetchParams as dZ, type PrefetchRequest as d_, type MediaUploadResponse as da, MemorySeen as db, NOT_FOUND as dc, type Natures as dd, type Negation as de, NiadraAPIError as df, NiadraAbortError as dg, NiadraAuthenticationError as dh, NiadraConfigError as di, NiadraConnectionError as dj, NiadraContactTokenError as dk, NiadraPermissionError as dl, NiadraRateLimitError as dm, NiadraReplayRefusedError as dn, NiadraTimeoutError as dp, NiadraValidationError as dq, type Notification as dr, type NotificationPage as ds, type ObjectCoverage as dt, type ObjectPush as du, type ObjectPushRequest as dv, type ObjectPushResponse as dw, type ObjectRead as dx, type ObjectSnapshotResponse as dy, type ObjectTimeline as dz, type ContextResult as e, type SourceCoverage as e$, type PresentedItem as e0, type PreviousValue as e1, type Problem as e2, type ProfileMatch as e3, type ProfileMemory as e4, type PromiseRef as e5, type PromoteRequest as e6, type PromoteResponse as e7, type ProposalStatus as e8, type Provenance as e9, type Result as eA, type ResultObjects as eB, type ReviewRequest as eC, type ReviewRequestCreate as eD, type ReviewRequestPage as eE, type ReviewResolution as eF, type Scenario as eG, type ScenarioCreate as eH, type ScenarioFromReport as eI, type ScenarioPage as eJ, type ScenarioRun as eK, type ScenarioRunCreate as eL, type ScenarioRunSummary as eM, type ScenarioUpdate as eN, type ScenarioVerdict as eO, type SdkProfile as eP, type SearchRequest as eQ, type SearchResponse as eR, type Seen as eS, type SeenTokens as eT, type ShadowRequest as eU, type ShadowRun as eV, type Shown as eW, type ShownValue as eX, type SlotChannelRank as eY, type SlotWhy as eZ, type SoftConstraint as e_, type QueueOptions as ea, type ReadingResult as eb, type ReconcileRequest as ec, type ReconcileResult as ed, type ReconciledLine as ee, type ToolOptions as ef, type Recurrence as eg, type Refetch as eh, type RefreshRelease as ei, type RefreshReleased as ej, type RefreshRequest as ek, type RefreshRequestPage as el, type Refusal$1 as em, type ReleaseDetail as en, type RememberParams as eo, type RememberResult as ep, type Rendered as eq, type ReplayAssertion as er, type ReplayBlocker as es, type ReplayCase as et, type ReplayCaseRequest as eu, type ReplayHistoryEntry as ev, type ReplayResult as ew, type RequestOptions as ex, type Resolved as ey, type Resolver as ez, type ModelUsage as f, type TurnRead as f$, type Speaker as f0, type SpeakerRef as f1, type StateMode as f2, type StateReadRequest as f3, type StateReadResponse as f4, type StateRef as f5, type StateVerifyRequest as f6, type StateVerifyResponse as f7, type StateView as f8, type StateViewRequest as f9, type Timestamp as fA, type Timings as fB, type ToolBinding as fC, type ToolCapabilities as fD, type ToolDefinition as fE, type ToolOptions$1 as fF, type TrackEvent as fG, type TraitOut as fH, type TurnAgent as fI, type TurnBlob as fJ, type TurnBuild as fK, type TurnCall as fL, type TurnCompilerPins as fM, type TurnConstraints as fN, type TurnCoordination as fO, type TurnCost as fP, type TurnEffect as fQ, type Flag as fR, TurnFrame as fS, type TurnIndexEntry as fT, type TurnIndexPage as fU, type TurnKind as fV, type TurnObservation as fW, type TurnOptions as fX, type TurnOutput as fY, type TurnParams as fZ, type TurnProvenance as f_, type StateWrite as fa, type Subject as fb, type SubjectToken as fc, type SubjectTokenRequest as fd, type Suppression as fe, type SuppressionAdded as ff, type SuppressionAddedDetail as fg, type SuppressionLifted as fh, type SuppressionLiftedDetail as fi, type SuppressionPage as fj, type SuppressionSalt as fk, TOOL_DEFINITIONS as fl, TOOL_NAMES as fm, type TargetModel as fn, Task as fo, type TaskAction as fp, type TaskEndedItem as fq, type TaskEvent as fr, type TaskLockDeclared as fs, type TaskLockDetail as ft, type TaskParams as fu, type TimeWindow as fv, type TimelineRequest as fw, type TimelineResponse as fx, type Timeouts as fy, type TimerState as fz, type Handle as g, type TurnRecord as g0, TurnRecorder as g1, type TurnRecordingOptions as g2, type TurnRecordingSummary as g3, type TurnSearchRequest as g4, type TurnSearchResponse as g5, type TurnSummary as g6, type TurnTokens as g7, type TurnView as g8, type TurnsRequest as g9, type WriteResult as gA, check as gB, consoleLogger as gC, currentCall as gD, currentTurn as gE, guardStream as gF, guardText as gG, recipientHash as gH, renderLive as gI, renderSuffix as gJ, silentLogger as gK, tool as gL, verifyContactToken as gM, violated as gN, type TurnsResponse as ga, type TypeCoverage as gb, type TypeFingerprintRequest as gc, type TypeFingerprintResponse as gd, type UnbackedValue as ge, type UnmetDemand as gf, type UnmetDemandPage as gg, type Unwatch as gh, type UploadParams as gi, type ValueEvidence as gj, type ValueKind as gk, type ValueState as gl, type Verdict as gm, type Verification as gn, type VerificationResult as go, type VerifyCheck as gp, type VerifyItem as gq, type VerifyMethod as gr, type VerifyParams as gs, type View as gt, type Visibility as gu, type VoiceInfo as gv, type VoiceOptions as gw, type Watch as gx, type WhereExpression as gy, type WorkingState as gz, AGENT_MEMORY_TOOL_NAMES as h, type ActionEvent as i, type ActionInfo as j, type Actions as k, Admin as l, type AgentMemoryBlock as m, type AgentMemoryParams as n, type AgentMemoryResult as o, type AgentMemorySearchRequest as p, type AgentMemorySearchResponse as q, type AgentMemorySource as r, shingles as s, type AgentNote as t, type AgentNoteKind as u, type AgentNoteOrigin as v, type AgentNoteProposal as w, type AgentNoteStatus as x, type AgentNoteVisibility as y, AgentSession as z };
7151
+ export { type AssertionOutcome as $, AGENT_MEMORY_TOOL_DEFINITIONS as A, type AgentState as B, type ConstraintsBlock as C, type Conflict as D, AgentStateHandle as E, type AgentStateMeta as F, type AgentStateMetaPage as G, type HardConstraint as H, InternalText as I, type AgentStateReadRequest as J, type AgentStateScope as K, type Logger as L, type Mode as M, NiadraError as N, type ObjectRef as O, type AgentStateWrite as P, type AgentStateWriteResult as Q, Resolvers as R, type SubjectKind as S, type TurnPins as T, type AgentTurnOptions as U, type AnchorEvidence as V, Api as W, type ArmComparison as X, type ArmOutcomes as Y, type AskedAttribute as Z, type AssertionMethod as _, type ClaimRecord as a, type Conflict$1 as a$, type AssertionStats as a0, type Attribute as a1, type AttributeEntry as a2, type AttributionReport as a3, type AttributionRow as a4, type AttributionTotal as a5, type Backing as a6, type BackingReport as a7, Sources as a8, type BatchItem as a9, type CheckRequest as aA, type CheckResult as aB, ClaimCheck as aC, type CheckOptions$1 as aD, type ClaimContractSummary as aE, type ClaimEvidence as aF, type ClaimEvidenceRef as aG, type ClaimKind as aH, type ClaimOutputs as aI, type ClaimParams as aJ, type ClaimRelease as aK, type ClaimRequest as aL, type ClaimValue as aM, type ClaimVerdict as aN, type ClaimVia as aO, type Claimed as aP, type ClientOptions as aQ, type Closes as aR, type Commitment as aS, type CommitmentDecided as aT, type CommitmentDecidedDetail as aU, type CommitmentMade as aV, type CommitmentMadeDetail as aW, type CommitmentRef as aX, type CommitmentWithdrawn as aY, type CommitmentWithdrawnDetail as aZ, type CompanyRule as a_, type BatchRequest as aa, type BatchResponse as ab, type BiFile as ac, type BiUpload as ad, type BiUploadRequest as ae, BlobError as af, type BlobStore as ag, type BlockSubject as ah, type BoundArg as ai, type BoundTools as aj, type BudgetBlock as ak, type BudgetCut as al, type BudgetPack as am, type BudgetUse as an, type CacheDirectives as ao, type CacheOptions as ap, CallCapture as aq, type CaseClosed as ar, type CaseOpened as as, type Change as at, type ChangePage as au, type ChangeSinceSeen as av, type ChannelState as aw, type CheckBatchRequest as ax, type CheckBatchResponse as ay, type CheckOptions as az, type ClaimCategory as b, type Detect as b$, type ConflictCounts as b0, type ConstraintOrigin as b1, type ConstraintsRequest as b2, type ContactBudget as b3, type ContactBudgetUse as b4, type ContactClaims as b5, type ContactCount as b6, ContactGateway as b7, type ContactKey as b8, type ContactKeys as b9, type ConversationEvent as bA, type ConversationParams as bB, type CoordinationBlock as bC, type CoordinationOverview as bD, type CoordinationReport as bE, type CoordinationReportPage as bF, type CorrectParams as bG, type CorrectionAction as bH, type CorrectionRequest as bI, type CounterfactualCase as bJ, type CounterfactualEngaged as bK, type CounterfactualEngagement as bL, type CounterfactualRunCreate as bM, type CounterfactualRunPage as bN, type CreateAgentNoteRequest as bO, DEFAULT_CACHE as bP, DEFAULT_QUEUE as bQ, DEFAULT_TIMEOUTS as bR, DEFAULT_VOICE as bS, DELETE as bT, type DataIssue as bU, type DataIssuePage as bV, Declarations as bW, type DeclareRequest as bX, type DeclareResult as bY, type DeliveryPath as bZ, type DerivedState as b_, type ContactMade as ba, type ContactMadeDetail as bb, type VerifyParams$1 as bc, type Refusal as bd, type Content as be, type ContentMarker as bf, type ContentMode as bg, type ContentRelease as bh, type ContentReleaseResult as bi, ContentResolver as bj, type ContextFormat as bk, type ContextOptions as bl, type ContextPack as bm, type ContextParams as bn, type ContextRequest as bo, type ContextSource as bp, type ContextStamp as bq, type ContextUseBucket as br, type ContextUseDimension as bs, type ContextUseEntry as bt, type ContextUseParams as bu, type ContextUseRate as bv, type ContextUseReport as bw, Conversation as bx, type ConversationAction as by, type ConversationEndedItem as bz, Niadra as c, type InternalText$1 as c$, type DriftChanges as c0, type Effect as c1, type EffectCount as c2, type EffectDeclared as c3, type EffectDetail as c4, type EffectKind as c5, type EffectReserve as c6, type EffectSeen as c7, type EffectSettle as c8, type EffectState as c9, type Guarded as cA, type HandleType as cB, type Handoff as cC, type HandoffContext as cD, type HandoffCreate as cE, type HandoffDeclared as cF, type HandoffDetail as cG, type HandoffItem as cH, type HandoffOutcome as cI, type HandoffPackage as cJ, type HandoffParams as cK, type HeartbeatItem as cL, type HistoryFilters as cM, type HistoryItem as cN, type HistoryItemKind as cO, type IdentifyItem as cP, type IdentifyParams as cQ, type IdentityCalibration as cR, type Include as cS, type Inference as cT, type InferenceCorrection as cU, type InferencePage as cV, type IngestStatus as cW, type InterestState as cX, type InterleavingReport as cY, type InterleavingRow as cZ, type InterleavingTotal as c_, type EffectStatus as ca, type Engaged as cb, type EpisodeOut as cc, type Erasure as cd, type EventItem as ce, type EventKind as cf, type Evidence as cg, type ExperimentReport as ch, type ExperimentResult as ci, type ExportPackage as cj, FAIL_CLOSED as ck, type FactHistory as cl, type FactOut as cm, type Feature as cn, type Feedback as co, type FeedbackAction as cp, type FeedbackParams as cq, type FeedbackRequest as cr, type Fetched as cs, type FieldCoverage as ct, type FieldState as cu, type ForgetTarget as cv, type GatewayOptions as cw, Guard as cx, type GuardLike as cy, type GuardOptions as cz, type ContextResponse as d, type PackSlot as d$, type ItemError as d0, type ItemVersion as d1, type KeyIdentity as d2, type LeaseDeclared as d3, type LeaseDetail as d4, type LegalHold as d5, type LegalHoldCreate as d6, type LegalHoldRelease as d7, type Link as d8, type LinkMethod as d9, type NotificationPage as dA, type ObjectCoverage as dB, type ObjectPush as dC, type ObjectPushRequest as dD, type ObjectPushResponse as dE, type ObjectRead as dF, type ObjectSnapshotResponse as dG, type ObjectTimeline as dH, type ObjectTimelineParams as dI, type Observation as dJ, type OpenItemOut as dK, type OpenItemRequest as dL, type OpenObject as dM, type OpenParams as dN, type OpenedItem as dO, type Origin as dP, type OutcomeLink as dQ, type OutcomePage as dR, type OutcomeRequest as dS, type OutcomeState as dT, type Owner as dU, type OwnershipClaim as dV, type OwnershipCount as dW, PERSONAL_DATA_TOOL_ERROR as dX, type PackGuard as dY, type PackLayer as dZ, type PackSection as d_, type LinkRequest as da, type LiveTurn as db, type Lock as dc, MAX_BATCH_ITEMS as dd, MAX_EVENT_TEXT as de, MAX_MEDIA_BYTES as df, type MediaUpload as dg, type MediaUploadRequest as dh, type MediaUploadResponse as di, MemorySeen as dj, NOT_FOUND as dk, type Natures as dl, type Negation as dm, NiadraAPIError as dn, NiadraAbortError as dp, NiadraAuthenticationError as dq, NiadraConfigError as dr, NiadraConnectionError as ds, NiadraContactTokenError as dt, NiadraPermissionError as du, NiadraRateLimitError as dv, NiadraReplayRefusedError as dw, NiadraTimeoutError as dx, NiadraValidationError as dy, type Notification as dz, type ContextResult as e, type SeenTokens as e$, type PackSlotDerived as e0, type PackStamp as e1, type PowerRequest as e2, type PowerResult as e3, type Preference as e4, type PrefetchParams as e5, type PrefetchRequest as e6, type Presented as e7, type PresentedItem as e8, type PreviousValue as e9, type ReplayBlocker as eA, type ReplayCase as eB, type ReplayCaseRequest as eC, type ReplayHistoryEntry as eD, type ReplayResult as eE, type RequestOptions as eF, type Resolved as eG, type Resolver as eH, type Result as eI, type ResultObjects as eJ, type ReviewRequest as eK, type ReviewRequestCreate as eL, type ReviewRequestPage as eM, type ReviewResolution as eN, type Scenario as eO, type ScenarioCreate as eP, type ScenarioFromReport as eQ, type ScenarioPage as eR, type ScenarioRun as eS, type ScenarioRunCreate as eT, type ScenarioRunSummary as eU, type ScenarioUpdate as eV, type ScenarioVerdict as eW, type SdkProfile as eX, type SearchRequest as eY, type SearchResponse as eZ, type Seen as e_, type Problem as ea, type ProfileMatch as eb, type ProfileMemory as ec, type PromiseRef as ed, type PromoteRequest as ee, type PromoteResponse as ef, type ProposalStatus as eg, type Provenance as eh, type QueueOptions as ei, type ReadingResult as ej, type ReconcileRequest as ek, type ReconcileResult as el, type ReconciledLine as em, type ToolOptions as en, type Recurrence as eo, type Refetch as ep, type RefreshRelease as eq, type RefreshReleased as er, type RefreshRequest as es, type RefreshRequestPage as et, type Refusal$1 as eu, type ReleaseDetail as ev, type RememberParams as ew, type RememberResult as ex, type Rendered as ey, type ReplayAssertion as ez, type ModelUsage as f, type TurnIndexEntry as f$, type ShadowRequest as f0, type ShadowRun as f1, type Shown as f2, type ShownValue as f3, type SlotChannelRank as f4, type SlotWhy as f5, type SoftConstraint as f6, type SourceCoverage as f7, type Speaker as f8, type SpeakerRef as f9, type TaskLockDeclared as fA, type TaskLockDetail as fB, type TaskParams as fC, type TimeWindow as fD, type TimelineRequest as fE, type TimelineResponse as fF, type Timeouts as fG, type TimerState as fH, type Timestamp as fI, type Timings as fJ, type ToolBinding as fK, type ToolCapabilities as fL, type ToolDefinition as fM, type ToolOptions$1 as fN, type TrackEvent as fO, type TraitOut as fP, type TurnAgent as fQ, type TurnBlob as fR, type TurnBuild as fS, type TurnCall as fT, type TurnCompilerPins as fU, type TurnConstraints as fV, type TurnCoordination as fW, type TurnCost as fX, type TurnEffect as fY, type Flag as fZ, TurnFrame as f_, type StateMode as fa, type StateReadRequest as fb, type StateReadResponse as fc, type StateRef as fd, type StateVerifyRequest as fe, type StateVerifyResponse as ff, type StateView as fg, type StateViewRequest as fh, type StateWrite as fi, type Subject as fj, type SubjectToken as fk, type SubjectTokenRequest as fl, type Suppression as fm, type SuppressionAdded as fn, type SuppressionAddedDetail as fo, type SuppressionLifted as fp, type SuppressionLiftedDetail as fq, type SuppressionPage as fr, type SuppressionSalt as fs, TOOL_DEFINITIONS as ft, TOOL_NAMES as fu, type TargetModel as fv, Task as fw, type TaskAction as fx, type TaskEndedItem as fy, type TaskEvent as fz, type Handle as g, type TurnIndexPage as g0, type TurnKind as g1, type TurnObservation as g2, type TurnOptions as g3, type TurnOutput as g4, type TurnParams as g5, type TurnProvenance as g6, type TurnRead as g7, type TurnRecord as g8, TurnRecorder as g9, type VerifyParams as gA, type View as gB, type Visibility as gC, type VoiceInfo as gD, type VoiceOptions as gE, type Watch as gF, type WhereExpression as gG, type WorkingState as gH, type WriteResult as gI, check as gJ, consoleLogger as gK, currentCall as gL, currentTurn as gM, guardStream as gN, guardText as gO, recipientHash as gP, renderLive as gQ, renderSuffix as gR, silentLogger as gS, tool as gT, verifyContactToken as gU, violated as gV, type TurnRecordingOptions as ga, type TurnRecordingSummary as gb, type TurnSearchRequest as gc, type TurnSearchResponse as gd, type TurnSummary as ge, type TurnTokens as gf, type TurnView as gg, type TurnsRequest as gh, type TurnsResponse as gi, type TypeCoverage as gj, type TypeFingerprintRequest as gk, type TypeFingerprintResponse as gl, type UnbackedValue as gm, type UnmetDemand as gn, type UnmetDemandPage as go, type Unwatch as gp, type UploadParams as gq, type ValueEvidence as gr, type ValueKind as gs, type ValueState as gt, type Verdict as gu, type Verification as gv, type VerificationResult as gw, type VerifyCheck as gx, type VerifyItem as gy, type VerifyMethod as gz, AGENT_MEMORY_TOOL_NAMES as h, type ActionEvent as i, type ActionInfo as j, type Actions as k, Admin as l, type AgentMemoryBlock as m, type AgentMemoryParams as n, type AgentMemoryResult as o, type AgentMemorySearchRequest as p, type AgentMemorySearchResponse as q, type AgentMemorySource as r, shingles as s, type AgentNote as t, type AgentNoteKind as u, type AgentNoteOrigin as v, type AgentNoteProposal as w, type AgentNoteStatus as x, type AgentNoteVisibility as y, AgentSession as z };
@@ -1,8 +1,8 @@
1
1
  import { ToolSet } from 'ai';
2
- import { c as Niadra, g as Handle, fX as TurnOptions, f as ModelUsage } from './client-B_ip8T2o.cjs';
2
+ import { c as Niadra, g as Handle, g3 as TurnOptions, f as ModelUsage } from './client-rmWhZJOx.cjs';
3
3
  import { NiadraMiddleware } from './ai-sdk.cjs';
4
- import { b as Session, a as ProofSource, A as AgentMemoryOption } from './shared-DEkF2Y_z.cjs';
5
- export { P as Proof, c as attestationProof } from './shared-DEkF2Y_z.cjs';
4
+ import { b as Session, a as ProofSource, A as AgentMemoryOption } from './shared-zaTBum17.cjs';
5
+ export { P as Proof, c as attestationProof } from './shared-zaTBum17.cjs';
6
6
 
7
7
  /**
8
8
  * Niadra for the Cloudflare Agents SDK (`agents` 0.x): one helper per `Agent` instance (a Durable
@@ -1,8 +1,8 @@
1
1
  import { ToolSet } from 'ai';
2
- import { c as Niadra, g as Handle, fX as TurnOptions, f as ModelUsage } from './client-B_ip8T2o.js';
2
+ import { c as Niadra, g as Handle, g3 as TurnOptions, f as ModelUsage } from './client-rmWhZJOx.js';
3
3
  import { NiadraMiddleware } from './ai-sdk.js';
4
- import { b as Session, a as ProofSource, A as AgentMemoryOption } from './shared-BLkAbvuf.js';
5
- export { P as Proof, c as attestationProof } from './shared-BLkAbvuf.js';
4
+ import { b as Session, a as ProofSource, A as AgentMemoryOption } from './shared-Cs7h5C4Y.js';
5
+ export { P as Proof, c as attestationProof } from './shared-Cs7h5C4Y.js';
6
6
 
7
7
  /**
8
8
  * Niadra for the Cloudflare Agents SDK (`agents` 0.x): one helper per `Agent` instance (a Durable
@@ -6,7 +6,7 @@ var TOOL_DEFINITIONS = [
6
6
  "type": "function",
7
7
  "function": {
8
8
  "name": "search_customer_history",
9
- "description": "Search everything that already happened with this customer: past conversations, promises, agent actions, orders and invoices. Use it when the customer refers to something earlier or asks whether a problem happened before. Do not call it when the answer is already in the context block, including its 'Do hist\xF3rico' line, which already counts recurrences. Returns short items with date, channel and outcome, plus a recurrence count. Open one with open_history_item.",
9
+ "description": "Search everything that already happened with this customer: past conversations, promises, agent actions, orders and invoices. Use it when the customer refers to something earlier or asks whether a problem happened before. Do not call it when the answer is already in the context block, including its 'Hist\xF3rico' line, which already counts recurrences. Returns short items with date, channel and outcome, plus a recurrence count. Open a conversation (`episode:`) or an object (`object:`) with open_history_item; the other items are complete as listed.",
10
10
  "parameters": {
11
11
  "type": "object",
12
12
  "properties": {
@@ -50,7 +50,8 @@ var TOOL_DEFINITIONS = [
50
50
  "open_item",
51
51
  "action",
52
52
  "object",
53
- "trait"
53
+ "trait",
54
+ "system_event"
54
55
  ]
55
56
  }
56
57
  },
@@ -77,7 +78,7 @@ var TOOL_DEFINITIONS = [
77
78
  "type": "function",
78
79
  "function": {
79
80
  "name": "get_customer_timeline",
80
- "description": "List this customer's conversations and agent actions in order, newest first, one line each. Use it to leaf through the history when you do not know what to search for. Pass next_cursor to continue. Prefer search_customer_history for a specific question.",
81
+ "description": "List this customer's conversations, agent actions and system events in order, newest first, one line each. Use it to leaf through the history when you do not know what to search for; filters.item_kinds also lists the open items, facts, patterns or objects it names. Pass next_cursor to continue. Prefer search_customer_history for a specific question.",
81
82
  "parameters": {
82
83
  "type": "object",
83
84
  "properties": {
@@ -125,7 +126,8 @@ var TOOL_DEFINITIONS = [
125
126
  "open_item",
126
127
  "action",
127
128
  "object",
128
- "trait"
129
+ "trait",
130
+ "system_event"
129
131
  ]
130
132
  }
131
133
  },
@@ -144,7 +146,7 @@ var TOOL_DEFINITIONS = [
144
146
  "type": "function",
145
147
  "function": {
146
148
  "name": "open_history_item",
147
- "description": "Open one conversation or business object returned by search_customer_history or get_customer_timeline: what was asked, what was promised and by whom, the outcome and what memory came from it. Use it only after a search or timeline pointed to the item.",
149
+ "description": "Open one conversation (`episode:`) or business object (`object:`) returned by search_customer_history or get_customer_timeline: what was asked, what was promised and by whom, the outcome and what memory came from it. Actions, events, facts and promises are complete as listed and do not open. Use it only after a search or timeline pointed to the item.",
148
150
  "parameters": {
149
151
  "type": "object",
150
152
  "properties": {