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.
Files changed (55) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.md +244 -63
  3. package/dist/commands/agents.js +17 -17
  4. package/dist/commands/apiKey.js +24 -19
  5. package/dist/commands/compile.d.ts +1 -0
  6. package/dist/commands/compile.js +1004 -0
  7. package/dist/commands/configure.js +93 -68
  8. package/dist/commands/deploy-new.d.ts +0 -0
  9. package/dist/commands/deploy-new.js +130 -0
  10. package/dist/commands/deploy.d.ts +19 -0
  11. package/dist/commands/deploy.js +81 -763
  12. package/dist/commands/destroy.js +26 -21
  13. package/dist/commands/dev.d.ts +63 -0
  14. package/dist/commands/dev.js +656 -0
  15. package/dist/commands/index.d.ts +4 -2
  16. package/dist/commands/index.js +4 -2
  17. package/dist/commands/init.js +297 -62
  18. package/dist/commands/push.d.ts +22 -0
  19. package/dist/commands/push.js +127 -0
  20. package/dist/commands/test.js +14 -15
  21. package/dist/index.d.ts +1 -1
  22. package/dist/index.js +35 -19
  23. package/dist/services/api.d.ts +195 -0
  24. package/dist/services/api.js +209 -0
  25. package/dist/services/auth.d.ts +102 -0
  26. package/dist/services/auth.js +129 -40
  27. package/dist/skill.d.ts +22 -1
  28. package/dist/skill.js +21 -1
  29. package/dist/types/index.d.ts +16 -2
  30. package/dist/types/index.js +16 -1
  31. package/dist/user-data-api.d.ts +52 -0
  32. package/dist/user-data-api.js +151 -0
  33. package/dist/utils/cli.d.ts +34 -0
  34. package/dist/utils/cli.js +58 -0
  35. package/dist/utils/files.d.ts +4 -1
  36. package/dist/utils/files.js +61 -14
  37. package/dist/web/app.css +1050 -0
  38. package/dist/web/app.js +79 -0
  39. package/dist/web/tools-page.css +377 -0
  40. package/package.json +18 -5
  41. package/template/package-lock.json +32 -3
  42. package/template/package.json +3 -1
  43. package/template/{index.ts → src/index.ts} +13 -4
  44. package/template/src/tools/UserPreferencesTool.ts +73 -0
  45. package/template/tools/UserPreferencesTool.ts +73 -0
  46. package/template/tsconfig.json +1 -1
  47. package/template/.lua/deploy.json +0 -145
  48. /package/template/{services → src/services}/ApiService.ts +0 -0
  49. /package/template/{services → src/services}/GetWeather.ts +0 -0
  50. /package/template/{services → src/services}/MathService.ts +0 -0
  51. /package/template/{tools → src/tools}/AdvancedMathTool.ts +0 -0
  52. /package/template/{tools → src/tools}/CalculatorTool.ts +0 -0
  53. /package/template/{tools → src/tools}/CreatePostTool.ts +0 -0
  54. /package/template/{tools → src/tools}/GetUserDataTool.ts +0 -0
  55. /package/template/{tools → src/tools}/GetWeatherTool.ts +0 -0
@@ -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
- const apiKey = await loadApiKey();
5
- if (!apiKey) {
6
- console.log("ℹ️ No API key found to delete.");
7
- return;
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
- if (confirm) {
18
- const deleted = await deleteApiKey();
19
- if (deleted) {
20
- console.log(" API key deleted successfully.");
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
- console.log(" Failed to delete API key.");
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>;