lua-cli 1.2.1 → 1.3.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/CHANGELOG.md +50 -0
- package/README.md +244 -63
- package/dist/commands/agents.js +17 -17
- package/dist/commands/apiKey.js +24 -19
- package/dist/commands/compile.d.ts +1 -0
- package/dist/commands/compile.js +1004 -0
- package/dist/commands/configure.js +93 -68
- package/dist/commands/deploy-new.d.ts +0 -0
- package/dist/commands/deploy-new.js +130 -0
- package/dist/commands/deploy.d.ts +19 -0
- package/dist/commands/deploy.js +81 -763
- package/dist/commands/destroy.js +26 -21
- package/dist/commands/dev.d.ts +63 -0
- package/dist/commands/dev.js +656 -0
- package/dist/commands/index.d.ts +4 -2
- package/dist/commands/index.js +4 -2
- package/dist/commands/init.js +297 -62
- package/dist/commands/push.d.ts +22 -0
- package/dist/commands/push.js +127 -0
- package/dist/commands/test.js +14 -15
- package/dist/index.d.ts +1 -1
- package/dist/index.js +35 -19
- package/dist/services/api.d.ts +195 -0
- package/dist/services/api.js +209 -0
- package/dist/services/auth.d.ts +102 -0
- package/dist/services/auth.js +129 -40
- package/dist/skill.d.ts +22 -1
- package/dist/skill.js +21 -1
- package/dist/types/index.d.ts +16 -2
- package/dist/types/index.js +16 -1
- package/dist/user-data-api.d.ts +52 -0
- package/dist/user-data-api.js +151 -0
- package/dist/utils/cli.d.ts +34 -0
- package/dist/utils/cli.js +58 -0
- package/dist/utils/files.d.ts +4 -1
- package/dist/utils/files.js +61 -14
- package/dist/web/app.css +1050 -0
- package/dist/web/app.js +79 -0
- package/dist/web/tools-page.css +377 -0
- package/package.json +18 -5
- package/template/package-lock.json +32 -3
- package/template/package.json +3 -1
- package/template/{index.ts → src/index.ts} +13 -4
- package/template/src/tools/UserPreferencesTool.ts +73 -0
- package/template/tools/UserPreferencesTool.ts +73 -0
- package/template/tsconfig.json +1 -1
- package/template/.lua/deploy.json +0 -145
- /package/template/{services → src/services}/ApiService.ts +0 -0
- /package/template/{services → src/services}/GetWeather.ts +0 -0
- /package/template/{services → src/services}/MathService.ts +0 -0
- /package/template/{tools → src/tools}/AdvancedMathTool.ts +0 -0
- /package/template/{tools → src/tools}/CalculatorTool.ts +0 -0
- /package/template/{tools → src/tools}/CreatePostTool.ts +0 -0
- /package/template/{tools → src/tools}/GetUserDataTool.ts +0 -0
- /package/template/{tools → src/tools}/GetWeatherTool.ts +0 -0
package/dist/commands/destroy.js
CHANGED
|
@@ -1,29 +1,34 @@
|
|
|
1
1
|
import inquirer from "inquirer";
|
|
2
2
|
import { loadApiKey, deleteApiKey } from "../services/auth.js";
|
|
3
|
+
import { withErrorHandling, clearPromptLines, writeProgress, writeSuccess } from "../utils/cli.js";
|
|
3
4
|
export async function destroyCommand() {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const { confirm } = await inquirer.prompt([
|
|
10
|
-
{
|
|
11
|
-
type: "confirm",
|
|
12
|
-
name: "confirm",
|
|
13
|
-
message: "Are you sure you want to delete your API key? This action cannot be undone.",
|
|
14
|
-
default: false
|
|
5
|
+
return withErrorHandling(async () => {
|
|
6
|
+
const apiKey = await loadApiKey();
|
|
7
|
+
if (!apiKey) {
|
|
8
|
+
writeProgress("ℹ️ No API key found to delete.");
|
|
9
|
+
return;
|
|
15
10
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
const { confirm } = await inquirer.prompt([
|
|
12
|
+
{
|
|
13
|
+
type: "confirm",
|
|
14
|
+
name: "confirm",
|
|
15
|
+
message: "Are you sure you want to delete your API key? This action cannot be undone.",
|
|
16
|
+
default: false
|
|
17
|
+
}
|
|
18
|
+
]);
|
|
19
|
+
// Clear the confirmation prompt lines
|
|
20
|
+
clearPromptLines(2);
|
|
21
|
+
if (confirm) {
|
|
22
|
+
const deleted = await deleteApiKey();
|
|
23
|
+
if (deleted) {
|
|
24
|
+
writeSuccess("✅ API key deleted successfully.");
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
writeProgress("❌ Failed to delete API key.");
|
|
28
|
+
}
|
|
21
29
|
}
|
|
22
30
|
else {
|
|
23
|
-
|
|
31
|
+
writeProgress("ℹ️ API key deletion cancelled.");
|
|
24
32
|
}
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
console.log("ℹ️ API key deletion cancelled.");
|
|
28
|
-
}
|
|
33
|
+
}, "logout");
|
|
29
34
|
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export interface DevVersionResponse {
|
|
2
|
+
success: boolean;
|
|
3
|
+
data?: {
|
|
4
|
+
message: string;
|
|
5
|
+
skillId: string;
|
|
6
|
+
version: string;
|
|
7
|
+
publishedAt: string;
|
|
8
|
+
};
|
|
9
|
+
error?: {
|
|
10
|
+
message: string;
|
|
11
|
+
error: string;
|
|
12
|
+
statusCode: number;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export interface UpdateDevVersionResponse {
|
|
16
|
+
success: boolean;
|
|
17
|
+
data?: {
|
|
18
|
+
message: string;
|
|
19
|
+
skillId: string;
|
|
20
|
+
version: string;
|
|
21
|
+
updatedAt: string;
|
|
22
|
+
};
|
|
23
|
+
error?: {
|
|
24
|
+
message: string;
|
|
25
|
+
error: string;
|
|
26
|
+
statusCode: number;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export interface ChatMessage {
|
|
30
|
+
type: "text";
|
|
31
|
+
text: string;
|
|
32
|
+
}
|
|
33
|
+
export interface ChatRequest {
|
|
34
|
+
messages: ChatMessage[];
|
|
35
|
+
navigate: boolean;
|
|
36
|
+
skillOverride: Array<{
|
|
37
|
+
skillId: string;
|
|
38
|
+
sandboxId: string;
|
|
39
|
+
}>;
|
|
40
|
+
personaOverride?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface ChatResponse {
|
|
43
|
+
text: string;
|
|
44
|
+
files: any[];
|
|
45
|
+
reasoningDetails: any[];
|
|
46
|
+
toolCalls: any[];
|
|
47
|
+
toolResults: any[];
|
|
48
|
+
finishReason: string;
|
|
49
|
+
usage: {
|
|
50
|
+
promptTokens: number;
|
|
51
|
+
completionTokens: number;
|
|
52
|
+
totalTokens: number;
|
|
53
|
+
};
|
|
54
|
+
warnings: any[];
|
|
55
|
+
request: any;
|
|
56
|
+
response: any;
|
|
57
|
+
steps: any[];
|
|
58
|
+
sources: any[];
|
|
59
|
+
}
|
|
60
|
+
export declare function sendChatMessage(apiKey: string, agentId: string, skillId: string, sandboxId: string, message: string, persona?: string): Promise<string | null>;
|
|
61
|
+
export declare function updateDevVersion(apiKey: string, agentId: string, skillId: string, sandboxVersionId: string, versionData: any): Promise<UpdateDevVersionResponse>;
|
|
62
|
+
export declare function pushDevVersion(apiKey: string, agentId: string, skillId: string, versionData: any): Promise<DevVersionResponse>;
|
|
63
|
+
export declare function devCommand(): Promise<void>;
|