lua-cli 3.27.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
 
@@ -1829,6 +1832,13 @@ declare abstract class HttpClient {
1829
1832
  * @protected
1830
1833
  */
1831
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>>;
1832
1842
  /**
1833
1843
  * Performs an HTTP PUT request
1834
1844
  * @param url - The relative URL path to request (will be appended to baseUrl)
@@ -1925,6 +1935,18 @@ declare interface InboxPushInput {
1925
1935
  /** Idempotency/revision key: same key = revise the existing card in place,
1926
1936
  * never a second knock. Omit for one-shot notices. */
1927
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;
1928
1950
  /** Conversation the card should hand off into when the user acts. */
1929
1951
  threadId?: string;
1930
1952
  }
@@ -3262,6 +3284,10 @@ export declare class LuaTrigger<T = any> {
3262
3284
  readonly verify?: (ctx: TriggerContext<T>) => boolean | Promise<boolean>;
3263
3285
  readonly filter?: (ctx: TriggerContext<T>) => boolean | Promise<boolean>;
3264
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
+ };
3265
3291
  constructor(config: LuaTriggerConfig<T>);
3266
3292
  getName(): string;
3267
3293
  getDescription(): string;
@@ -3301,6 +3327,24 @@ export declare interface LuaTriggerConfig<T = any> {
3301
3327
  * transform to forward larger or hand-picked fields as the message.
3302
3328
  */
3303
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
+ };
3304
3348
  }
3305
3349
 
3306
3350
  /**
@@ -4355,6 +4399,7 @@ export declare class LuaWebhook {
4355
4399
  private readonly querySchema?;
4356
4400
  private readonly headerSchema?;
4357
4401
  private readonly bodySchema?;
4402
+ private readonly secret?;
4358
4403
  private readonly executeFunction;
4359
4404
  /**
4360
4405
  * Creates a new LuaWebhook instance.
@@ -4368,6 +4413,11 @@ export declare class LuaWebhook {
4368
4413
  * @param config.execute - Function that processes the webhook request
4369
4414
  */
4370
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;
4371
4421
  /**
4372
4422
  * Gets the webhook name.
4373
4423
  */
@@ -4414,6 +4464,14 @@ export declare interface LuaWebhookConfig {
4414
4464
  headerSchema?: ZodType;
4415
4465
  /** Optional Zod schema for body validation */
4416
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;
4417
4475
  /** Function that executes the webhook logic */
4418
4476
  execute: (event: LuaWebhookEvent) => Promise<any>;
4419
4477
  }