lua-cli 3.4.0 → 3.5.0-alpha.2

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 (66) hide show
  1. package/README.md +1 -0
  2. package/dist/api/agent.api.service.d.ts +13 -0
  3. package/dist/api/agent.api.service.js +17 -0
  4. package/dist/api/agent.api.service.js.map +1 -1
  5. package/dist/api/chat.api.service.d.ts +2 -1
  6. package/dist/api/chat.api.service.js +7 -2
  7. package/dist/api/chat.api.service.js.map +1 -1
  8. package/dist/api/developer.api.service.d.ts +13 -0
  9. package/dist/api/developer.api.service.js +17 -0
  10. package/dist/api/developer.api.service.js.map +1 -1
  11. package/dist/api/lazy-instances.d.ts +8 -0
  12. package/dist/api/lazy-instances.js +16 -0
  13. package/dist/api/lazy-instances.js.map +1 -1
  14. package/dist/api/logs.api.service.d.ts +2 -1
  15. package/dist/api/logs.api.service.js +2 -0
  16. package/dist/api/logs.api.service.js.map +1 -1
  17. package/dist/api/unifiedto.api.service.d.ts +81 -0
  18. package/dist/api/unifiedto.api.service.js +99 -0
  19. package/dist/api/unifiedto.api.service.js.map +1 -0
  20. package/dist/api/user.data.api.service.d.ts +11 -3
  21. package/dist/api/user.data.api.service.js +42 -3
  22. package/dist/api/user.data.api.service.js.map +1 -1
  23. package/dist/api-exports.d.ts +19 -3
  24. package/dist/api-exports.js +18 -4
  25. package/dist/api-exports.js.map +1 -1
  26. package/dist/cli/command-definitions.js +103 -16
  27. package/dist/cli/command-definitions.js.map +1 -1
  28. package/dist/commands/chat.js +51 -23
  29. package/dist/commands/chat.js.map +1 -1
  30. package/dist/commands/compile.d.ts +1 -2
  31. package/dist/commands/compile.js +2 -3
  32. package/dist/commands/compile.js.map +1 -1
  33. package/dist/commands/configure.d.ts +17 -1
  34. package/dist/commands/configure.js +29 -4
  35. package/dist/commands/configure.js.map +1 -1
  36. package/dist/commands/index.d.ts +1 -0
  37. package/dist/commands/index.js +1 -0
  38. package/dist/commands/index.js.map +1 -1
  39. package/dist/commands/integrations.d.ts +17 -0
  40. package/dist/commands/integrations.js +1778 -0
  41. package/dist/commands/integrations.js.map +1 -0
  42. package/dist/commands/logs.js +33 -12
  43. package/dist/commands/logs.js.map +1 -1
  44. package/dist/commands/marketplace.js +3 -2
  45. package/dist/commands/marketplace.js.map +1 -1
  46. package/dist/commands/mcp.d.ts +19 -0
  47. package/dist/commands/mcp.js +3 -3
  48. package/dist/commands/mcp.js.map +1 -1
  49. package/dist/commands/sync.d.ts +5 -9
  50. package/dist/commands/sync.js +146 -102
  51. package/dist/commands/sync.js.map +1 -1
  52. package/dist/commands/test.js +41 -13
  53. package/dist/commands/test.js.map +1 -1
  54. package/dist/interfaces/mcp.d.ts +11 -0
  55. package/dist/interfaces/unifiedto.d.ts +91 -0
  56. package/dist/interfaces/unifiedto.js +6 -0
  57. package/dist/interfaces/unifiedto.js.map +1 -0
  58. package/dist/interfaces/user.d.ts +9 -0
  59. package/dist/types/api-contracts.d.ts +5 -3
  60. package/dist/utils/auth-flows.d.ts +29 -1
  61. package/dist/utils/auth-flows.js +84 -1
  62. package/dist/utils/auth-flows.js.map +1 -1
  63. package/dist/utils/sandbox.d.ts +2 -2
  64. package/dist/utils/sandbox.js +1 -1
  65. package/package.json +1 -1
  66. package/template/package.json +1 -1
@@ -0,0 +1,91 @@
1
+ /**
2
+ * UnifiedTo Interfaces
3
+ * Types for UnifiedTo integration API responses
4
+ */
5
+ /**
6
+ * Auth support types for integrations
7
+ */
8
+ export type UnifiedToAuthSupport = 'token' | 'oauth' | 'both';
9
+ /**
10
+ * OAuth scope mapping (unified scope -> original provider scopes)
11
+ */
12
+ export interface UnifiedToOAuthScope {
13
+ unifiedScope: string;
14
+ originalScopes: string[];
15
+ }
16
+ /**
17
+ * Token auth field info
18
+ */
19
+ export interface UnifiedToTokenField {
20
+ name: string;
21
+ instructions?: string;
22
+ }
23
+ /**
24
+ * Available integration from UnifiedTo
25
+ */
26
+ export interface UnifiedToIntegrationResponse {
27
+ type: string;
28
+ name: string;
29
+ categories: string[];
30
+ logoUrl?: string;
31
+ authSupport: UnifiedToAuthSupport;
32
+ oauthConfigured: boolean;
33
+ oauthScopes?: UnifiedToOAuthScope[];
34
+ tokenFields?: UnifiedToTokenField[];
35
+ }
36
+ /**
37
+ * Auth URL response from UnifiedTo
38
+ */
39
+ export interface UnifiedToAuthUrlResponse {
40
+ authUrl: string;
41
+ integrationType: string;
42
+ }
43
+ /**
44
+ * Connected account (connection) response
45
+ */
46
+ export interface UnifiedToConnectionResponse {
47
+ id: string;
48
+ integrationType: string;
49
+ status: string;
50
+ integrationName?: string;
51
+ logoUrl?: string;
52
+ createdAt: string;
53
+ updatedAt?: string;
54
+ }
55
+ /**
56
+ * Available webhook event info (derived from integration support data)
57
+ */
58
+ export interface WebhookEventInfo {
59
+ objectType: string;
60
+ objectTypeDisplay: string;
61
+ event: 'created' | 'updated' | 'deleted';
62
+ webhookType: 'native' | 'virtual';
63
+ availableFilters: string[];
64
+ }
65
+ /**
66
+ * Request params for creating a webhook subscription
67
+ */
68
+ export interface CreateWebhookSubscriptionParams {
69
+ connectionId: string;
70
+ objectType: string;
71
+ event: 'created' | 'updated' | 'deleted';
72
+ hookUrl: string;
73
+ interval?: number;
74
+ filters?: Record<string, string>;
75
+ }
76
+ /**
77
+ * Webhook subscription response
78
+ */
79
+ export interface WebhookSubscriptionResponse {
80
+ id: string;
81
+ connectionId: string;
82
+ integrationType: string;
83
+ objectType: string;
84
+ event: string;
85
+ hookUrl: string;
86
+ webhookType: 'native' | 'virtual';
87
+ interval?: number;
88
+ filters?: Record<string, string>;
89
+ status: string;
90
+ createdAt: string;
91
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * UnifiedTo Interfaces
3
+ * Types for UnifiedTo integration API responses
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=unifiedto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unifiedto.js","sourceRoot":"","sources":["../../src/interfaces/unifiedto.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
@@ -38,3 +38,12 @@ export interface ProfileResponse {
38
38
  name?: string;
39
39
  };
40
40
  }
41
+ /**
42
+ * Options for looking up a user by email or phone
43
+ */
44
+ export interface UserLookupOptions {
45
+ /** Email address to look up */
46
+ email?: string;
47
+ /** Phone number to look up (with or without + prefix) */
48
+ phone?: string;
49
+ }
@@ -1,5 +1,6 @@
1
1
  import { Message } from "../interfaces/message.js";
2
2
  import { GetCustomDataResponse, UpdateCustomDataResponse, DeleteCustomDataResponse } from "../interfaces/custom.data.js";
3
+ import { UserLookupOptions } from "../interfaces/user.js";
3
4
  import DataEntryInstance from "../common/data.entry.instance.js";
4
5
  /**
5
6
  * API Contract Interfaces
@@ -14,10 +15,11 @@ import DataEntryInstance from "../common/data.entry.instance.js";
14
15
  */
15
16
  export interface UserDataAPI {
16
17
  /**
17
- * Retrieves current user data.
18
- * @returns Promise resolving to user data
18
+ * Retrieves user data by userId, email, or phone.
19
+ * @param identifier - Optional userId string or lookup options object
20
+ * @returns Promise resolving to user data, or null if not found
19
21
  */
20
- get(): Promise<any>;
22
+ get(identifier?: string | UserLookupOptions): Promise<any>;
21
23
  /**
22
24
  * Updates user data.
23
25
  * @param data - Data to update
@@ -3,13 +3,41 @@
3
3
  * Handles different authentication methods (API key and email OTP)
4
4
  */
5
5
  /**
6
- * Handles API key authentication flow.
6
+ * Handles API key authentication flow (interactive).
7
7
  * Prompts for API key, validates it, and saves it securely.
8
8
  *
9
9
  * @returns Promise that resolves when authentication is complete
10
10
  * @throws Error if API key is invalid
11
11
  */
12
12
  export declare function handleApiKeyAuth(): Promise<void>;
13
+ /**
14
+ * Handles API key authentication (non-interactive).
15
+ * Validates the provided API key and saves it securely.
16
+ *
17
+ * @param apiKey - The API key to validate and save
18
+ * @returns Promise that resolves when authentication is complete
19
+ * @throws Error if API key is invalid
20
+ */
21
+ export declare function handleApiKeyAuthNonInteractive(apiKey: string): Promise<void>;
22
+ /**
23
+ * Handles email OTP request (non-interactive step 1).
24
+ * Sends OTP to the provided email address.
25
+ *
26
+ * @param email - Email address to send OTP to
27
+ * @returns Promise that resolves when OTP is sent
28
+ * @throws Error if email is invalid or OTP sending fails
29
+ */
30
+ export declare function handleEmailOtpRequest(email: string): Promise<void>;
31
+ /**
32
+ * Handles email OTP verification (non-interactive step 2).
33
+ * Verifies the OTP, generates an API key, and saves it.
34
+ *
35
+ * @param email - Email address the OTP was sent to
36
+ * @param otp - The OTP code received via email
37
+ * @returns Promise that resolves when authentication is complete
38
+ * @throws Error if OTP is invalid or API key generation fails
39
+ */
40
+ export declare function handleEmailOtpVerify(email: string, otp: string): Promise<void>;
13
41
  /**
14
42
  * Handles email authentication flow with OTP verification.
15
43
  * Sends OTP to email, verifies it, generates API key, and saves it.
@@ -12,8 +12,11 @@ const OTP_CONFIG = {
12
12
  MAX_ATTEMPTS: 3,
13
13
  OTP_LENGTH: 6,
14
14
  };
15
+ // ============================================================================
16
+ // INTERACTIVE AUTHENTICATION FLOWS
17
+ // ============================================================================
15
18
  /**
16
- * Handles API key authentication flow.
19
+ * Handles API key authentication flow (interactive).
17
20
  * Prompts for API key, validates it, and saves it securely.
18
21
  *
19
22
  * @returns Promise that resolves when authentication is complete
@@ -35,6 +38,86 @@ export async function handleApiKeyAuth() {
35
38
  await saveApiKey(answers.apiKey);
36
39
  writeSuccess("āœ… API key saved securely.");
37
40
  }
41
+ // ============================================================================
42
+ // NON-INTERACTIVE AUTHENTICATION FLOWS
43
+ // ============================================================================
44
+ /**
45
+ * Handles API key authentication (non-interactive).
46
+ * Validates the provided API key and saves it securely.
47
+ *
48
+ * @param apiKey - The API key to validate and save
49
+ * @returns Promise that resolves when authentication is complete
50
+ * @throws Error if API key is invalid
51
+ */
52
+ export async function handleApiKeyAuthNonInteractive(apiKey) {
53
+ writeProgress("šŸ” Validating API key...");
54
+ const data = await checkApiKey(apiKey);
55
+ if (!data) {
56
+ throw new Error("Invalid API key. Please check your key and try again.");
57
+ }
58
+ await saveApiKey(apiKey);
59
+ writeSuccess("āœ… API key validated and saved securely.");
60
+ writeInfo(` Welcome, ${data.fullName || data.email}!`);
61
+ }
62
+ /**
63
+ * Handles email OTP request (non-interactive step 1).
64
+ * Sends OTP to the provided email address.
65
+ *
66
+ * @param email - Email address to send OTP to
67
+ * @returns Promise that resolves when OTP is sent
68
+ * @throws Error if email is invalid or OTP sending fails
69
+ */
70
+ export async function handleEmailOtpRequest(email) {
71
+ // Validate email format
72
+ const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
73
+ if (!emailRegex.test(email)) {
74
+ throw new Error("Invalid email address format.");
75
+ }
76
+ writeProgress(`šŸ“§ Sending OTP to ${email}...`);
77
+ const otpSent = await requestEmailOTP(email);
78
+ if (!otpSent) {
79
+ throw new Error("Failed to send OTP. Please check your email address and try again.");
80
+ }
81
+ writeSuccess("āœ… OTP sent successfully!");
82
+ writeInfo("\nšŸ“¬ Check your email for the 6-digit code, then run:");
83
+ writeInfo(` lua auth configure --email ${email} --otp <code>\n`);
84
+ }
85
+ /**
86
+ * Handles email OTP verification (non-interactive step 2).
87
+ * Verifies the OTP, generates an API key, and saves it.
88
+ *
89
+ * @param email - Email address the OTP was sent to
90
+ * @param otp - The OTP code received via email
91
+ * @returns Promise that resolves when authentication is complete
92
+ * @throws Error if OTP is invalid or API key generation fails
93
+ */
94
+ export async function handleEmailOtpVerify(email, otp) {
95
+ // Validate OTP format
96
+ if (otp.length !== OTP_CONFIG.OTP_LENGTH) {
97
+ throw new Error(`OTP must be ${OTP_CONFIG.OTP_LENGTH} digits.`);
98
+ }
99
+ writeProgress("šŸ” Verifying OTP...");
100
+ const signInToken = await verifyOTPAndGetToken(email, otp);
101
+ if (!signInToken) {
102
+ throw new Error("Invalid OTP. Please check the code and try again.");
103
+ }
104
+ writeSuccess("āœ… OTP verified successfully!");
105
+ writeProgress("šŸ”‘ Generating API key...");
106
+ const apiKey = await generateApiKey(signInToken);
107
+ if (!apiKey) {
108
+ throw new Error("Failed to generate API key. Please try again.");
109
+ }
110
+ await saveApiKey(apiKey);
111
+ writeSuccess("āœ… API key generated and saved securely.");
112
+ // Guide user to next steps
113
+ writeInfo("\nšŸŽ‰ You're all set! Here's what to do next:\n");
114
+ writeInfo(" 1ļøāƒ£ Create a new project directory:");
115
+ writeInfo(" mkdir my-agent && cd my-agent\n");
116
+ writeInfo(" 2ļøāƒ£ Initialize your agent:");
117
+ writeInfo(" lua init\n");
118
+ writeInfo(" 3ļøāƒ£ Follow the prompts to create or select an agent\n");
119
+ writeInfo("šŸ’” Tip: Run 'lua --help' to see all available commands\n");
120
+ }
38
121
  /**
39
122
  * Handles email authentication flow with OTP verification.
40
123
  * Sends OTP to email, verifies it, generates API key, and saves it.
@@ -1 +1 @@
1
- {"version":3,"file":"auth-flows.js","sourceRoot":"","sources":["../../src/utils/auth-flows.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EACL,UAAU,EACV,WAAW,EACX,eAAe,EACf,oBAAoB,EACpB,cAAc,EACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAc,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAEhG;;GAEG;AACH,MAAM,UAAU,GAAG;IACjB,YAAY,EAAE,CAAC;IACf,UAAU,EAAE,CAAC;CACL,CAAC;AAEX;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC;QACpC;YACE,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,oBAAoB;YAC7B,IAAI,EAAE,GAAG;SACV;KACF,CAAC,CAAC;IAEH,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/C,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK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CAAC,CAAC;YACpF,CAAC;QACH,CAAC;IACH,CAAC;IAED,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC;QAC3C;YACE,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,YAAY;YAClB,OAAO,EAAE,+BAA+B;YACxC,OAAO,EAAE;gBACP,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;gBACrC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;aAClC;SACF;KACF,CAAC,CAAC;IAEH,OAAO,UAAU,CAAC;AACpB,CAAC"}
@@ -77,9 +77,9 @@ export declare function executeJob(options: ExecuteJobOptions): Promise<any>;
77
77
  * Executes a preprocessor in a sandboxed environment.
78
78
  *
79
79
  * @param options - PreProcessor execution options
80
- * @returns Processed message string
80
+ * @returns PreProcessorResult - { action: 'block', response: string } or { action: 'proceed', modifiedMessage?: ChatMessage[] }
81
81
  */
82
- export declare function executePreProcessor(options: ExecutePreProcessorOptions): Promise<any[]>;
82
+ export declare function executePreProcessor(options: ExecutePreProcessorOptions): Promise<any>;
83
83
  /**
84
84
  * Executes a postprocessor in a sandboxed environment.
85
85
  *
@@ -472,7 +472,7 @@ try{
472
472
  * Executes a preprocessor in a sandboxed environment.
473
473
  *
474
474
  * @param options - PreProcessor execution options
475
- * @returns Processed message string
475
+ * @returns PreProcessorResult - { action: 'block', response: string } or { action: 'proceed', modifiedMessage?: ChatMessage[] }
476
476
  */
477
477
  export async function executePreProcessor(options) {
478
478
  const { processorCode, messages, channel, apiKey, agentId } = options;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lua-cli",
3
- "version": "3.4.0",
3
+ "version": "3.5.0-alpha.2",
4
4
  "description": "Build, test, and deploy AI agents with custom tools, webhooks, and scheduled jobs. Features LuaAgent unified configuration, streaming chat, and batch deployment.",
5
5
  "readmeFilename": "README.md",
6
6
  "main": "dist/api-exports.js",
@@ -20,7 +20,7 @@
20
20
  "inquirer": "^12.9.6",
21
21
  "stripe": "^17.5.0",
22
22
  "js-yaml": "^4.1.0",
23
- "lua-cli": "^3.4.0",
23
+ "lua-cli": "^3.5.0-alpha.2",
24
24
  "openai": "^5.23.0",
25
25
  "uuid": "^13.0.0",
26
26
  "zod": "^3.24.1"