lua-cli 3.26.0 → 3.28.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.
@@ -415,7 +415,10 @@ declare interface ApiResponse<T = any> {
415
415
  message: string;
416
416
  code?: string;
417
417
  statusCode?: number;
418
+ retryAfterSeconds?: number;
418
419
  error?: string;
420
+ oldAccountLabel?: string;
421
+ newAccountLabel?: string;
419
422
  };
420
423
  }
421
424
 
@@ -851,6 +854,13 @@ export declare const Channels: ChannelsApi;
851
854
  * subject: 'Your order',
852
855
  * html: '<p>Thanks for your order!</p>',
853
856
  * });
857
+ *
858
+ * // Post into a Teams group chat the agent is already part of
859
+ * await Channels.send({
860
+ * channel: 'teams',
861
+ * to: { conversationId: '19:9495c339...@thread.v2' },
862
+ * text: 'Sample LOT-4471 is missing origin and cupping score.',
863
+ * });
854
864
  * ```
855
865
  */
856
866
  export declare interface ChannelsApi {
@@ -858,6 +868,11 @@ export declare interface ChannelsApi {
858
868
  * Send a text message on any supported channel.
859
869
  * Returns `ChannelSendOutput` — check `persisted` if memory durability matters.
860
870
  *
871
+ * Address a person with `userId` (any channel), `phoneNumber` (whatsapp/sms)
872
+ * or `email`. Address a shared conversation with `conversationId` (teams
873
+ * only) — everyone in it receives the message, and because there is no single
874
+ * recipient the send returns `persisted: false`.
875
+ *
861
876
  * @example
862
877
  * ```typescript
863
878
  * const result = await Channels.send({
@@ -957,6 +972,8 @@ export declare interface ChannelSendOptions {
957
972
  */
958
973
  export declare interface ChannelSendOutput {
959
974
  delivered: boolean;
975
+ /** False for conversation-scoped sends: a shared conversation has no single
976
+ * user to attribute the message to, so nothing is written to agent memory. */
960
977
  persisted: boolean;
961
978
  /**
962
979
  * True when the send was deferred to the WhatsApp message-request queue
@@ -975,11 +992,15 @@ export declare interface ChannelSendOutput {
975
992
 
976
993
  /** Recipient — exactly one of the fields must be set. userId works on every
977
994
  * channel (resolved via the user's channel history); raw identifiers only on
978
- * cold-start-capable channels (whatsapp/sms → phoneNumber, email → email). */
995
+ * cold-start-capable channels (whatsapp/sms → phoneNumber, email → email).
996
+ * `conversationId` addresses a shared conversation rather than a person —
997
+ * everyone in it receives the message. Teams only, and warm-only: the agent
998
+ * must already be part of that conversation. */
979
999
  export declare interface ChannelSendTarget {
980
1000
  userId?: string;
981
1001
  phoneNumber?: string;
982
1002
  email?: string;
1003
+ conversationId?: string;
983
1004
  }
984
1005
 
985
1006
  /**
@@ -1059,6 +1080,13 @@ export declare interface ChatHistoryMessage {
1059
1080
  model?: string;
1060
1081
  /** True when the turn reached that model through the Auto selector. */
1061
1082
  autoModelRequested?: boolean;
1083
+ author?: {
1084
+ userId: string;
1085
+ };
1086
+ agent?: {
1087
+ agentId: string;
1088
+ name?: string;
1089
+ };
1062
1090
  /**
1063
1091
  * Permanent recording for a voice-note turn (Lua Desktop). Populated by the
1064
1092
  * admin threads history endpoint from the row's `content.metadata.audio` — a
@@ -1804,6 +1832,13 @@ declare abstract class HttpClient {
1804
1832
  * @protected
1805
1833
  */
1806
1834
  protected httpPost<T>(url: string, data?: any, headers?: Record<string, string>): Promise<ApiResponse<T>>;
1835
+ /**
1836
+ * Performs one HTTP POST attempt.
1837
+ *
1838
+ * Use this only when a successful response contains a one-time secret that
1839
+ * cannot be recovered after an ambiguous network or server failure.
1840
+ */
1841
+ protected httpPostOnce<T>(url: string, data?: any, headers?: Record<string, string>): Promise<ApiResponse<T>>;
1807
1842
  /**
1808
1843
  * Performs an HTTP PUT request
1809
1844
  * @param url - The relative URL path to request (will be appended to baseUrl)
@@ -1900,6 +1935,18 @@ declare interface InboxPushInput {
1900
1935
  /** Idempotency/revision key: same key = revise the existing card in place,
1901
1936
  * never a second knock. Omit for one-shot notices. */
1902
1937
  key?: string;
1938
+ /** Cross-route resolution (PRO-1208 follow-up #2) — only meaningful on a
1939
+ * plain NOTICE push that carries a `key`. When `true`, this notice
1940
+ * declares it REPORTS THE RESOLUTION of whatever an open same-key
1941
+ * question card is still asking — the agent settled the cycle itself
1942
+ * (re-reviewed after the fix landed and auto-approved; the incident
1943
+ * closed on its own). Once the notice lands, the stale question card is
1944
+ * superseded: settled, no live actions, and never a knock. An in-flight
1945
+ * user answer always wins — their explicit decision stands. WITHOUT this
1946
+ * flag a same-key notice never touches the question track: routine
1947
+ * progress updates coexist with an open ask. Ignored without `key`, and
1948
+ * on question/fix pushes. Must be the literal boolean `true`. */
1949
+ resolvesQuestion?: boolean;
1903
1950
  /** Conversation the card should hand off into when the user acts. */
1904
1951
  threadId?: string;
1905
1952
  }
@@ -3237,6 +3284,10 @@ export declare class LuaTrigger<T = any> {
3237
3284
  readonly verify?: (ctx: TriggerContext<T>) => boolean | Promise<boolean>;
3238
3285
  readonly filter?: (ctx: TriggerContext<T>) => boolean | Promise<boolean>;
3239
3286
  readonly transform?: (ctx: TriggerContext<T>) => string | AgentInvocationInput | Promise<string | AgentInvocationInput>;
3287
+ readonly tool?: {
3288
+ name: string;
3289
+ input?: (ctx: TriggerContext<T>) => Record<string, unknown> | Promise<Record<string, unknown>>;
3290
+ };
3240
3291
  constructor(config: LuaTriggerConfig<T>);
3241
3292
  getName(): string;
3242
3293
  getDescription(): string;
@@ -3276,6 +3327,24 @@ export declare interface LuaTriggerConfig<T = any> {
3276
3327
  * transform to forward larger or hand-picked fields as the message.
3277
3328
  */
3278
3329
  transform?: (ctx: TriggerContext<T>) => string | AgentInvocationInput | Promise<string | AgentInvocationInput>;
3330
+ /**
3331
+ * Direct tool binding: after `verify`/`filter` pass, the platform executes
3332
+ * this named skill tool DIRECTLY — no chat turn, no LLM, no visible
3333
+ * conversation thread. `name` is the BARE authored tool name (skill-first
3334
+ * resolution server-side); it must be a static string literal — the
3335
+ * compiler carries it into the trigger version as declared metadata.
3336
+ * `input` maps the trigger context to the tool's arguments and runs in the
3337
+ * same server-side slot sandbox (15s budget shared with verify/filter) —
3338
+ * it CANNOT call platform APIs. Omit `input` to execute with `{}`.
3339
+ *
3340
+ * Declaring BOTH `tool` and `transform` runs the tool; the transform is
3341
+ * ignored (the compiler warns). Approval-gated tools are refused server-
3342
+ * side (fail closed) — the execution row records the refusal.
3343
+ */
3344
+ tool?: {
3345
+ name: string;
3346
+ input?: (ctx: TriggerContext<T>) => Record<string, unknown> | Promise<Record<string, unknown>>;
3347
+ };
3279
3348
  }
3280
3349
 
3281
3350
  /**
@@ -4330,6 +4399,7 @@ export declare class LuaWebhook {
4330
4399
  private readonly querySchema?;
4331
4400
  private readonly headerSchema?;
4332
4401
  private readonly bodySchema?;
4402
+ private readonly secret?;
4333
4403
  private readonly executeFunction;
4334
4404
  /**
4335
4405
  * Creates a new LuaWebhook instance.
@@ -4343,6 +4413,11 @@ export declare class LuaWebhook {
4343
4413
  * @param config.execute - Function that processes the webhook request
4344
4414
  */
4345
4415
  constructor(config: LuaWebhookConfig);
4416
+ /**
4417
+ * Gets the webhook's signing key, if one is configured.
4418
+ * Never print this — it is the shared secret callers sign with.
4419
+ */
4420
+ getSecret(): string | undefined;
4346
4421
  /**
4347
4422
  * Gets the webhook name.
4348
4423
  */
@@ -4389,6 +4464,14 @@ export declare interface LuaWebhookConfig {
4389
4464
  headerSchema?: ZodType;
4390
4465
  /** Optional Zod schema for body validation */
4391
4466
  bodySchema?: ZodType;
4467
+ /**
4468
+ * Optional HMAC-SHA256 signing key. When set, Lua rejects any call to this
4469
+ * webhook that does not carry `x-lua-signature: sha256=<hex digest of the
4470
+ * raw request body>`. Must be a literal or a `const` resolvable at compile
4471
+ * time — the compiler cannot read a runtime expression. Rotate by changing
4472
+ * it and re-deploying.
4473
+ */
4474
+ secret?: string;
4392
4475
  /** Function that executes the webhook logic */
4393
4476
  execute: (event: LuaWebhookEvent) => Promise<any>;
4394
4477
  }