lua-cli 3.37.0 → 3.39.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/api-exports.d.ts +99 -0
- package/dist/api-exports.js +1130 -2
- package/dist/api-exports.js.map +1 -1
- package/dist/index.js +3788 -229
- package/dist/index.js.map +1 -1
- package/dist/workflow-builder.js +1114 -0
- package/dist/workflow-builder.js.map +1 -1
- package/docs/CLI_REFERENCE.md +16 -1
- package/docs/README.md +2 -2
- package/package.json +3 -3
- package/template/package.json +1 -1
package/dist/api-exports.d.ts
CHANGED
|
@@ -1444,6 +1444,18 @@ export declare type ChatMessage = TextMessage | ImageMessage | FileMessage;
|
|
|
1444
1444
|
*/
|
|
1445
1445
|
export declare type ContainerArm = StepRef | [LuaMapConfig, StepRef];
|
|
1446
1446
|
|
|
1447
|
+
/** Teams: resource-specific permissions are granted per chat by whoever adds the app; file access is a tenant-wide grant. */
|
|
1448
|
+
declare interface ConversationAccess {
|
|
1449
|
+
/** False when only messages that mention the agent are delivered. */
|
|
1450
|
+
canReadAllMessages: boolean;
|
|
1451
|
+
/** False when people are known only once they speak. */
|
|
1452
|
+
canReadMembers: boolean;
|
|
1453
|
+
/** False when files attached in the conversation cannot be opened. */
|
|
1454
|
+
canReadFiles: boolean;
|
|
1455
|
+
/** Provider permission names the conversation has not granted, e.g. `ChatMessage.Read.Chat`. */
|
|
1456
|
+
missing: string[];
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1447
1459
|
/**
|
|
1448
1460
|
* Who is in the conversation this turn runs in.
|
|
1449
1461
|
*/
|
|
@@ -1488,6 +1500,11 @@ export declare interface ConversationRef {
|
|
|
1488
1500
|
agentId: string;
|
|
1489
1501
|
name?: string;
|
|
1490
1502
|
}>;
|
|
1503
|
+
/**
|
|
1504
|
+
* What the channel lets the agent do in this conversation. Absent when the
|
|
1505
|
+
* platform could not determine it (a shared bot outside Lua's tenant).
|
|
1506
|
+
*/
|
|
1507
|
+
access?: ConversationAccess;
|
|
1491
1508
|
}
|
|
1492
1509
|
|
|
1493
1510
|
/**
|
|
@@ -3122,6 +3139,46 @@ export declare const lit: <const V extends string | number | boolean | null>(v:
|
|
|
3122
3139
|
|
|
3123
3140
|
export { Literal }
|
|
3124
3141
|
|
|
3142
|
+
/**
|
|
3143
|
+
* Structured logging: `log.debug/info/warn/error(message, fields?)`.
|
|
3144
|
+
*
|
|
3145
|
+
* One call writes one log row. The level becomes the row's severity, exactly as
|
|
3146
|
+
* the matching `console.*` call would, and `fields` travels BESIDE the message
|
|
3147
|
+
* rather than inside it — so a log drain delivers each field as its own
|
|
3148
|
+
* `app.<key>` attribute that the destination can filter and group on, instead
|
|
3149
|
+
* of a line someone has to parse.
|
|
3150
|
+
*
|
|
3151
|
+
* `console.*` is untouched: it still serialises every argument into the
|
|
3152
|
+
* message text.
|
|
3153
|
+
*
|
|
3154
|
+
* ```typescript
|
|
3155
|
+
* import { log } from 'lua-cli';
|
|
3156
|
+
*
|
|
3157
|
+
* log.error('Knowledge base search failed', {
|
|
3158
|
+
* tags: ['domain/search'], // → "domain/search" + tags.count: 1
|
|
3159
|
+
* conversation_id: conversationId,
|
|
3160
|
+
* error_type: 'timeout',
|
|
3161
|
+
* duration_ms: 1432,
|
|
3162
|
+
* });
|
|
3163
|
+
* ```
|
|
3164
|
+
*
|
|
3165
|
+
* The rules, all enforced at the call so `lua test` and production agree:
|
|
3166
|
+
* at most 32 keys (an array's `.count` sibling counts); a key must match
|
|
3167
|
+
* `^[a-z][a-z0-9_]{0,63}$` and may not look like an API key; values are
|
|
3168
|
+
* `string | number | boolean | string[]`; an array element may not contain a
|
|
3169
|
+
* comma. A value over 1 KiB or a map over 8 KiB is clamped, not refused.
|
|
3170
|
+
*
|
|
3171
|
+
* Available in skills, tools, webhooks, triggers, jobs and processors. Workflow
|
|
3172
|
+
* steps keep `ctx.log`.
|
|
3173
|
+
*/
|
|
3174
|
+
export declare const log: LuaLog;
|
|
3175
|
+
|
|
3176
|
+
/** The `fields` argument of `log.debug/info/warn/error`. */
|
|
3177
|
+
export declare type LogFields = Record<string, LogFieldValue>;
|
|
3178
|
+
|
|
3179
|
+
/** What a skill author may put in a `log.*` field map. */
|
|
3180
|
+
declare type LogFieldValue = string | number | boolean | string[];
|
|
3181
|
+
|
|
3125
3182
|
export declare interface LoopOptions {
|
|
3126
3183
|
/** default 100 */
|
|
3127
3184
|
maxIterations?: number;
|
|
@@ -3609,6 +3666,48 @@ export declare interface LuaJobConfig {
|
|
|
3609
3666
|
metadata?: Record<string, any>;
|
|
3610
3667
|
}
|
|
3611
3668
|
|
|
3669
|
+
/**
|
|
3670
|
+
* The `log` global skill code sees. One call = one log row; the level is the
|
|
3671
|
+
* row's `subType`, so a drain's `minSeverity` filter selects it exactly as it
|
|
3672
|
+
* selects the same primitive's `console.*` lines.
|
|
3673
|
+
*/
|
|
3674
|
+
export declare interface LuaLog {
|
|
3675
|
+
/** `subType: 'debug'`. */
|
|
3676
|
+
debug(message: string, fields?: LogFields): void;
|
|
3677
|
+
/** `subType: 'info'`. */
|
|
3678
|
+
info(message: string, fields?: LogFields): void;
|
|
3679
|
+
/** `subType: 'warn'`. */
|
|
3680
|
+
warn(message: string, fields?: LogFields): void;
|
|
3681
|
+
/** `subType: 'error'`. */
|
|
3682
|
+
error(message: string, fields?: LogFields): void;
|
|
3683
|
+
}
|
|
3684
|
+
|
|
3685
|
+
/**
|
|
3686
|
+
* The error a `log.*` call throws when its fields are structurally invalid —
|
|
3687
|
+
* too many keys, a key the pattern refuses, a nested object, a bad value type,
|
|
3688
|
+
* or a comma inside an array element.
|
|
3689
|
+
*
|
|
3690
|
+
* Length is NOT structural: a value over 1 KiB, or a map over 8 KiB, is clamped
|
|
3691
|
+
* and marked with `lua_fields_clamped: true` rather than throwing. A log call
|
|
3692
|
+
* must never break a working tool.
|
|
3693
|
+
*
|
|
3694
|
+
* Deliberately a SHAPE, not the class: the class is not a sandbox global, and
|
|
3695
|
+
* `lua compile` strips every `lua-cli` import, so an `instanceof` check written
|
|
3696
|
+
* against it would type-check here and throw `ReferenceError` in the sandbox.
|
|
3697
|
+
* The stable identity is `name`:
|
|
3698
|
+
*
|
|
3699
|
+
* ```typescript
|
|
3700
|
+
* try {
|
|
3701
|
+
* log.info('searched', fields);
|
|
3702
|
+
* } catch (err: any) {
|
|
3703
|
+
* if (err?.name === 'LuaLogFieldsError') await fixTheFields();
|
|
3704
|
+
* }
|
|
3705
|
+
* ```
|
|
3706
|
+
*/
|
|
3707
|
+
export declare type LuaLogFieldsError = Error & {
|
|
3708
|
+
name: 'LuaLogFieldsError';
|
|
3709
|
+
};
|
|
3710
|
+
|
|
3612
3711
|
export { LuaMapConfig }
|
|
3613
3712
|
|
|
3614
3713
|
/**
|