lua-cli 3.20.0 → 3.22.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 +32 -0
- package/dist/api-exports.js +31 -2
- package/dist/api-exports.js.map +1 -1
- package/dist/index.js +1317 -319
- package/dist/index.js.map +1 -1
- package/docs/CLI_REFERENCE.md +21 -18
- package/docs/README.md +2 -2
- package/docs/api/Templates.md +24 -1
- package/package.json +3 -3
- package/template/package.json +1 -1
package/dist/api-exports.d.ts
CHANGED
|
@@ -59,6 +59,9 @@ declare interface AgentInvocationInput {
|
|
|
59
59
|
* the original BAC-107 spec; wired through as part of PRO-186.
|
|
60
60
|
*/
|
|
61
61
|
webhookPayload?: unknown;
|
|
62
|
+
/** Per-call timeout in ms. Absent ⇒ the client default (120s). Set by scheduled agent jobs
|
|
63
|
+
* to 180s so the cloud tier cuts off at the same point the desktop's local runner does. */
|
|
64
|
+
timeoutMs?: number;
|
|
62
65
|
}
|
|
63
66
|
|
|
64
67
|
/**
|
|
@@ -2714,12 +2717,30 @@ export declare interface LuaRuntime {
|
|
|
2714
2717
|
* // Or add tools after construction
|
|
2715
2718
|
* skill.addTool(anotherTool);
|
|
2716
2719
|
* ```
|
|
2720
|
+
*
|
|
2721
|
+
* @example
|
|
2722
|
+
* ```typescript
|
|
2723
|
+
* // Skill with condition - the whole skill is hidden from non-premium users
|
|
2724
|
+
* class PremiumSkill extends LuaSkill {
|
|
2725
|
+
* name = "premium-skill";
|
|
2726
|
+
* description = "Advanced tools for premium users";
|
|
2727
|
+
* context = "Use these tools for premium workflows.";
|
|
2728
|
+
* tools = [premiumSearchTool];
|
|
2729
|
+
*
|
|
2730
|
+
* // Condition runs before the skill's tools and context reach the LLM
|
|
2731
|
+
* condition = async () => {
|
|
2732
|
+
* const user = await User.get();
|
|
2733
|
+
* return user.data?.isPremium === true;
|
|
2734
|
+
* };
|
|
2735
|
+
* }
|
|
2736
|
+
* ```
|
|
2717
2737
|
*/
|
|
2718
2738
|
export declare class LuaSkill {
|
|
2719
2739
|
private readonly tools;
|
|
2720
2740
|
private readonly name;
|
|
2721
2741
|
private readonly description;
|
|
2722
2742
|
private readonly context;
|
|
2743
|
+
private readonly condition?;
|
|
2723
2744
|
/**
|
|
2724
2745
|
* Creates a new LuaSkill instance.
|
|
2725
2746
|
*
|
|
@@ -2728,9 +2749,11 @@ export declare class LuaSkill {
|
|
|
2728
2749
|
* @param config.description - Short description of what the skill does (1-2 sentences)
|
|
2729
2750
|
* @param config.context - Detailed explanation of how the agent should use the tools
|
|
2730
2751
|
* @param config.tools - Optional array of tools to add immediately
|
|
2752
|
+
* @param config.condition - Optional async gate; false hides the skill's tools and context
|
|
2731
2753
|
*/
|
|
2732
2754
|
constructor(config: LuaSkillConfig);
|
|
2733
2755
|
getContext(): SkillContextText;
|
|
2756
|
+
getCondition(): (() => Promise<boolean>) | undefined;
|
|
2734
2757
|
/**
|
|
2735
2758
|
* Adds a single tool to the skill.
|
|
2736
2759
|
* Tool name is validated before being added.
|
|
@@ -2772,6 +2795,12 @@ declare interface LuaSkillConfig {
|
|
|
2772
2795
|
context: SkillContextText;
|
|
2773
2796
|
/** Optional array of tools to add during construction */
|
|
2774
2797
|
tools?: LuaTool<any>[];
|
|
2798
|
+
/**
|
|
2799
|
+
* Optional async function that determines if the whole skill should be
|
|
2800
|
+
* available. When it returns false the skill's tools are hidden AND the
|
|
2801
|
+
* skill's context is left out of the agent prompt.
|
|
2802
|
+
*/
|
|
2803
|
+
condition?: () => Promise<boolean>;
|
|
2775
2804
|
}
|
|
2776
2805
|
|
|
2777
2806
|
export declare interface LuaTool<TInput extends ZodType = ZodType> {
|
|
@@ -5035,6 +5064,9 @@ export declare interface SendTemplateValues {
|
|
|
5035
5064
|
image_url?: string;
|
|
5036
5065
|
video_url?: string;
|
|
5037
5066
|
document_url?: string;
|
|
5067
|
+
image_id?: string;
|
|
5068
|
+
video_id?: string;
|
|
5069
|
+
document_id?: string;
|
|
5038
5070
|
document_filename?: string;
|
|
5039
5071
|
};
|
|
5040
5072
|
body?: Record<string, string>;
|
package/dist/api-exports.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
3
3
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
4
|
-
var __esm = (fn, res) => function __init() {
|
|
5
|
-
|
|
4
|
+
var __esm = (fn, res, err) => function __init() {
|
|
5
|
+
if (err) throw err[0];
|
|
6
|
+
try {
|
|
7
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
8
|
+
} catch (e) {
|
|
9
|
+
throw err = [e], e;
|
|
10
|
+
}
|
|
6
11
|
};
|
|
7
12
|
var __export = (target, all) => {
|
|
8
13
|
for (var name in all)
|
|
@@ -2228,6 +2233,18 @@ var init_skill_handler = __esm({
|
|
|
2228
2233
|
return toolData;
|
|
2229
2234
|
}).filter(Boolean);
|
|
2230
2235
|
const sourceArchive = buildSourceArchive(archiveEntries);
|
|
2236
|
+
let condition;
|
|
2237
|
+
let conditionS3Hash;
|
|
2238
|
+
if (skill.hasCondition) {
|
|
2239
|
+
const skillCode = loadArtifact(skill, projectPath);
|
|
2240
|
+
if (bundleAccumulator) {
|
|
2241
|
+
const rawGzip = compressForPushRaw(skillCode);
|
|
2242
|
+
conditionS3Hash = hashBundle(rawGzip);
|
|
2243
|
+
bundleAccumulator.set(conditionS3Hash, rawGzip);
|
|
2244
|
+
} else {
|
|
2245
|
+
condition = compressForPush(skillCode);
|
|
2246
|
+
}
|
|
2247
|
+
}
|
|
2231
2248
|
return {
|
|
2232
2249
|
name: skill.name,
|
|
2233
2250
|
description: skill.description,
|
|
@@ -2236,6 +2253,12 @@ var init_skill_handler = __esm({
|
|
|
2236
2253
|
context: skill.context
|
|
2237
2254
|
} : {},
|
|
2238
2255
|
tools,
|
|
2256
|
+
...condition ? {
|
|
2257
|
+
condition
|
|
2258
|
+
} : {},
|
|
2259
|
+
...conditionS3Hash ? {
|
|
2260
|
+
conditionS3Hash
|
|
2261
|
+
} : {},
|
|
2239
2262
|
...sourceArchive ? {
|
|
2240
2263
|
sourceArchive,
|
|
2241
2264
|
archiveSchemaVersion: SOURCE_ARCHIVE_SCHEMA_VERSION
|
|
@@ -5940,6 +5963,7 @@ var LuaSkill = class {
|
|
|
5940
5963
|
name;
|
|
5941
5964
|
description;
|
|
5942
5965
|
context;
|
|
5966
|
+
condition;
|
|
5943
5967
|
/**
|
|
5944
5968
|
* Creates a new LuaSkill instance.
|
|
5945
5969
|
*
|
|
@@ -5948,6 +5972,7 @@ var LuaSkill = class {
|
|
|
5948
5972
|
* @param config.description - Short description of what the skill does (1-2 sentences)
|
|
5949
5973
|
* @param config.context - Detailed explanation of how the agent should use the tools
|
|
5950
5974
|
* @param config.tools - Optional array of tools to add immediately
|
|
5975
|
+
* @param config.condition - Optional async gate; false hides the skill's tools and context
|
|
5951
5976
|
*/
|
|
5952
5977
|
constructor(config) {
|
|
5953
5978
|
if (!config.name || !config.name.trim()) {
|
|
@@ -5956,6 +5981,7 @@ var LuaSkill = class {
|
|
|
5956
5981
|
this.name = config.name;
|
|
5957
5982
|
this.description = config.description;
|
|
5958
5983
|
this.context = config.context;
|
|
5984
|
+
this.condition = config.condition;
|
|
5959
5985
|
if (typeof this.context === "object") {
|
|
5960
5986
|
if (!this.context.base && !this.context.voice && !this.context.text) {
|
|
5961
5987
|
throw new Error("Skill context object must have at least one of: base, voice, text");
|
|
@@ -5968,6 +5994,9 @@ var LuaSkill = class {
|
|
|
5968
5994
|
getContext() {
|
|
5969
5995
|
return this.context;
|
|
5970
5996
|
}
|
|
5997
|
+
getCondition() {
|
|
5998
|
+
return this.condition;
|
|
5999
|
+
}
|
|
5971
6000
|
/**
|
|
5972
6001
|
* Adds a single tool to the skill.
|
|
5973
6002
|
* Tool name is validated before being added.
|