lua-cli 3.0.3 → 3.1.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 (43) hide show
  1. package/README.md +8 -1
  2. package/dist/api/job.api.service.d.ts +3 -1
  3. package/dist/api/job.api.service.js +7 -2
  4. package/dist/api/logs.api.service.d.ts +11 -13
  5. package/dist/api/logs.api.service.js +20 -17
  6. package/dist/api/marketplace.api.service.d.ts +25 -0
  7. package/dist/api/marketplace.api.service.js +105 -0
  8. package/dist/api/user.data.api.service.js +7 -2
  9. package/dist/cli/command-definitions.d.ts +6 -0
  10. package/dist/cli/command-definitions.js +25 -1
  11. package/dist/commands/env.d.ts +11 -0
  12. package/dist/commands/env.js +1 -79
  13. package/dist/commands/index.d.ts +1 -0
  14. package/dist/commands/index.js +1 -0
  15. package/dist/commands/logs.js +128 -68
  16. package/dist/commands/marketplace.d.ts +12 -0
  17. package/dist/commands/marketplace.js +1593 -0
  18. package/dist/commands/persona.js +9 -4
  19. package/dist/common/job.instance.js +1 -3
  20. package/dist/common/user.instance.d.ts +5 -2
  21. package/dist/common/user.instance.js +55 -21
  22. package/dist/config/constants.d.ts +1 -1
  23. package/dist/config/constants.js +5 -1
  24. package/dist/index.js +6 -4
  25. package/dist/interfaces/index.d.ts +5 -4
  26. package/dist/interfaces/marketplace.d.ts +99 -0
  27. package/dist/interfaces/marketplace.js +2 -0
  28. package/dist/interfaces/user.d.ts +19 -0
  29. package/dist/interfaces/user.js +1 -0
  30. package/dist/types/compile.types.d.ts +48 -41
  31. package/dist/types/compile.types.js +1 -0
  32. package/dist/utils/env-loader.utils.d.ts +9 -0
  33. package/dist/utils/env-loader.utils.js +88 -0
  34. package/dist/utils/job-management.d.ts +3 -3
  35. package/dist/utils/postprocessor-management.d.ts +3 -3
  36. package/dist/utils/preprocessor-management.d.ts +3 -3
  37. package/dist/utils/semver.d.ts +27 -0
  38. package/dist/utils/semver.js +75 -0
  39. package/dist/utils/skill-management.d.ts +4 -4
  40. package/dist/utils/webhook-management.d.ts +3 -3
  41. package/dist/web/app.js +3 -3
  42. package/package.json +1 -1
  43. package/template/README.md +13 -0
@@ -2,7 +2,7 @@
2
2
  * Job Management Utilities
3
3
  * Handles job creation via API and YAML configuration management
4
4
  */
5
- import { SkillConfig } from '../types/compile.types.js';
5
+ import { YamlConfig } from '../types/compile.types.js';
6
6
  /**
7
7
  * Ensures all detected jobs exist in the YAML config with valid job IDs.
8
8
  * If a job doesn't exist or has no ID, creates it via the API.
@@ -11,7 +11,7 @@ import { SkillConfig } from '../types/compile.types.js';
11
11
  * @param config - The skill configuration from lua.skill.yaml
12
12
  * @returns Updated jobs array with valid job IDs
13
13
  */
14
- export declare function ensureJobsExistInYaml(jobsArray: any[], config: SkillConfig): Promise<any[]>;
14
+ export declare function ensureJobsExistInYaml(jobsArray: any[], config: YamlConfig): Promise<any[]>;
15
15
  /**
16
16
  * Syncs the server jobs with the YAML configuration.
17
17
  * Performs a two-way sync:
@@ -21,4 +21,4 @@ export declare function ensureJobsExistInYaml(jobsArray: any[], config: SkillCon
21
21
  * @param config - The skill configuration from lua.skill.yaml
22
22
  * @returns Array of messages about sync operations
23
23
  */
24
- export declare function syncServerJobsWithYaml(config: SkillConfig): Promise<string[]>;
24
+ export declare function syncServerJobsWithYaml(config: YamlConfig): Promise<string[]>;
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * PostProcessor Management Utilities
3
3
  */
4
- import { SkillConfig } from '../types/compile.types.js';
4
+ import { YamlConfig } from '../types/compile.types.js';
5
5
  /**
6
6
  * Ensures all detected postprocessors exist in the YAML config with valid IDs.
7
7
  */
8
- export declare function ensurePostProcessorsExistInYaml(postprocessorsArray: any[], config: SkillConfig): Promise<any[]>;
9
- export declare function syncServerPostProcessorsWithYaml(config: SkillConfig): Promise<string[]>;
8
+ export declare function ensurePostProcessorsExistInYaml(postprocessorsArray: any[], config: YamlConfig): Promise<any[]>;
9
+ export declare function syncServerPostProcessorsWithYaml(config: YamlConfig): Promise<string[]>;
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * PreProcessor Management Utilities
3
3
  */
4
- import { SkillConfig } from '../types/compile.types.js';
4
+ import { YamlConfig } from '../types/compile.types.js';
5
5
  /**
6
6
  * Ensures all detected preprocessors exist in the YAML config with valid IDs.
7
7
  */
8
- export declare function ensurePreProcessorsExistInYaml(preprocessorsArray: any[], config: SkillConfig): Promise<any[]>;
9
- export declare function syncServerPreProcessorsWithYaml(config: SkillConfig): Promise<string[]>;
8
+ export declare function ensurePreProcessorsExistInYaml(preprocessorsArray: any[], config: YamlConfig): Promise<any[]>;
9
+ export declare function syncServerPreProcessorsWithYaml(config: YamlConfig): Promise<string[]>;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Semantic Versioning Utilities
3
+ */
4
+ /**
5
+ * Parses a semantic version string into its components.
6
+ * Supports standard semver (X.Y.Z) and pre-release tags (X.Y.Z-tag).
7
+ *
8
+ * @param version The version string to parse
9
+ * @returns Object containing major, minor, patch, and preRelease components
10
+ */
11
+ export declare function parseVersion(version: string): {
12
+ major: number;
13
+ minor: number;
14
+ patch: number;
15
+ preRelease: string | null;
16
+ };
17
+ /**
18
+ * Compares two semantic version strings.
19
+ *
20
+ * @param version1 First version string
21
+ * @param version2 Second version string
22
+ * @returns number:
23
+ * - negative if version1 < version2
24
+ * - positive if version1 > version2
25
+ * - 0 if version1 === version2
26
+ */
27
+ export declare function compareVersions(version1: string, version2: string): number;
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Semantic Versioning Utilities
3
+ */
4
+ /**
5
+ * Parses a semantic version string into its components.
6
+ * Supports standard semver (X.Y.Z) and pre-release tags (X.Y.Z-tag).
7
+ *
8
+ * @param version The version string to parse
9
+ * @returns Object containing major, minor, patch, and preRelease components
10
+ */
11
+ export function parseVersion(version) {
12
+ const [versionPart, preReleasePart] = version.split('-');
13
+ const [major, minor, patch] = versionPart.split('.').map(Number);
14
+ const preRelease = preReleasePart ? preReleasePart.split('+')[0] : null;
15
+ return {
16
+ major: isNaN(major) ? 0 : major,
17
+ minor: isNaN(minor) ? 0 : minor,
18
+ patch: isNaN(patch) ? 0 : patch,
19
+ preRelease
20
+ };
21
+ }
22
+ /**
23
+ * Compares two semantic version strings.
24
+ *
25
+ * @param version1 First version string
26
+ * @param version2 Second version string
27
+ * @returns number:
28
+ * - negative if version1 < version2
29
+ * - positive if version1 > version2
30
+ * - 0 if version1 === version2
31
+ */
32
+ export function compareVersions(version1, version2) {
33
+ const v1 = parseVersion(version1);
34
+ const v2 = parseVersion(version2);
35
+ // Compare major.minor.patch first
36
+ if (v1.major !== v2.major)
37
+ return v1.major - v2.major;
38
+ if (v1.minor !== v2.minor)
39
+ return v1.minor - v2.minor;
40
+ if (v1.patch !== v2.patch)
41
+ return v1.patch - v2.patch;
42
+ // If major.minor.patch are equal, compare pre-release identifiers
43
+ // A version without a pre-release tag is always greater than one with a tag
44
+ if (v1.preRelease && !v2.preRelease)
45
+ return -1; // pre-release is lower than release
46
+ if (!v1.preRelease && v2.preRelease)
47
+ return 1; // release is higher than pre-release
48
+ if (!v1.preRelease && !v2.preRelease)
49
+ return 0; // both are releases
50
+ // Both have pre-release identifiers, compare them
51
+ const preReleaseOrder = ['alpha', 'beta', 'rc', 'preview', 'dev'];
52
+ const getPreReleaseType = (preRelease) => {
53
+ // Extract the type part (e.g., "alpha" from "alpha.1")
54
+ const type = preRelease.toLowerCase().split('.')[0].replace(/[0-9]/g, '');
55
+ const index = preReleaseOrder.indexOf(type);
56
+ return index === -1 ? preReleaseOrder.length : index; // Unknown types go to end
57
+ };
58
+ const type1 = getPreReleaseType(v1.preRelease);
59
+ const type2 = getPreReleaseType(v2.preRelease);
60
+ if (type1 !== type2)
61
+ return type1 - type2;
62
+ // Same pre-release type, compare the full pre-release string lexicographically
63
+ // or try to compare numeric parts if they exist (e.g., alpha.1 vs alpha.2)
64
+ const getPreReleaseNum = (preRelease) => {
65
+ const parts = preRelease.split('.');
66
+ const num = parts.length > 1 ? parseInt(parts[parts.length - 1], 10) : -1;
67
+ return isNaN(num) ? -1 : num;
68
+ };
69
+ const num1 = getPreReleaseNum(v1.preRelease);
70
+ const num2 = getPreReleaseNum(v2.preRelease);
71
+ if (num1 !== -1 && num2 !== -1 && num1 !== num2) {
72
+ return num1 - num2;
73
+ }
74
+ return v1.preRelease.localeCompare(v2.preRelease);
75
+ }
@@ -2,7 +2,7 @@
2
2
  * Skill Management Utilities
3
3
  * Handles skill creation via API and YAML configuration management
4
4
  */
5
- import { SkillConfig } from '../types/compile.types.js';
5
+ import { YamlConfig } from '../types/compile.types.js';
6
6
  /**
7
7
  * Ensures all detected skills exist in the YAML config with valid skill IDs.
8
8
  * If a skill doesn't exist or has no ID, creates it via the API.
@@ -11,7 +11,7 @@ import { SkillConfig } from '../types/compile.types.js';
11
11
  * @param config - The skill configuration from lua.skill.yaml
12
12
  * @returns Updated skills array with valid skill IDs
13
13
  */
14
- export declare function ensureSkillsExistInYaml(skillsArray: any[], config: SkillConfig): Promise<any[]>;
14
+ export declare function ensureSkillsExistInYaml(skillsArray: any[], config: YamlConfig): Promise<any[]>;
15
15
  /**
16
16
  * Updates the YAML file with skills from the deploy.json file.
17
17
  * This ensures the YAML reflects what's actually in the compiled code.
@@ -21,7 +21,7 @@ export declare function ensureSkillsExistInYaml(skillsArray: any[], config: Skil
21
21
  * @param deployJsonPath - Path to the deploy.json file
22
22
  * @param config - Current skill configuration
23
23
  */
24
- export declare function syncYamlWithDeployJson(deployJsonPath: string, config: SkillConfig): Promise<void>;
24
+ export declare function syncYamlWithDeployJson(deployJsonPath: string, config: YamlConfig): Promise<void>;
25
25
  /**
26
26
  * Syncs the server skills with the YAML configuration.
27
27
  * Performs a two-way sync:
@@ -31,4 +31,4 @@ export declare function syncYamlWithDeployJson(deployJsonPath: string, config: S
31
31
  * @param config - The skill configuration from lua.skill.yaml
32
32
  * @returns Array of messages about sync operations
33
33
  */
34
- export declare function syncServerSkillsWithYaml(config: SkillConfig): Promise<string[]>;
34
+ export declare function syncServerSkillsWithYaml(config: YamlConfig): Promise<string[]>;
@@ -2,7 +2,7 @@
2
2
  * Webhook Management Utilities
3
3
  * Handles webhook creation via API and YAML configuration management
4
4
  */
5
- import { SkillConfig } from '../types/compile.types.js';
5
+ import { YamlConfig } from '../types/compile.types.js';
6
6
  /**
7
7
  * Ensures all detected webhooks exist in the YAML config with valid webhook IDs.
8
8
  * If a webhook doesn't exist or has no ID, creates it via the API.
@@ -11,7 +11,7 @@ import { SkillConfig } from '../types/compile.types.js';
11
11
  * @param config - The skill configuration from lua.skill.yaml
12
12
  * @returns Updated webhooks array with valid webhook IDs
13
13
  */
14
- export declare function ensureWebhooksExistInYaml(webhooksArray: any[], config: SkillConfig): Promise<any[]>;
14
+ export declare function ensureWebhooksExistInYaml(webhooksArray: any[], config: YamlConfig): Promise<any[]>;
15
15
  /**
16
16
  * Syncs the server webhooks with the YAML configuration.
17
17
  * Performs a two-way sync:
@@ -21,4 +21,4 @@ export declare function ensureWebhooksExistInYaml(webhooksArray: any[], config:
21
21
  * @param config - The skill configuration from lua.skill.yaml
22
22
  * @returns Array of messages about sync operations
23
23
  */
24
- export declare function syncServerWebhooksWithYaml(config: SkillConfig): Promise<string[]>;
24
+ export declare function syncServerWebhooksWithYaml(config: YamlConfig): Promise<string[]>;