lua-cli 3.7.0 → 3.7.3

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/dist/api/ai.api.service.d.ts +20 -0
  2. package/dist/api/ai.api.service.d.ts.map +1 -0
  3. package/dist/api/ai.api.service.js +38 -0
  4. package/dist/api/ai.api.service.js.map +1 -0
  5. package/dist/api/lazy-instances.d.ts +4 -4
  6. package/dist/api/lazy-instances.d.ts.map +1 -1
  7. package/dist/api/lazy-instances.js +9 -9
  8. package/dist/api/lazy-instances.js.map +1 -1
  9. package/dist/api-exports.d.ts +28 -30
  10. package/dist/api-exports.d.ts.map +1 -1
  11. package/dist/api-exports.js +6 -59
  12. package/dist/api-exports.js.map +1 -1
  13. package/dist/cli/command-definitions.d.ts.map +1 -1
  14. package/dist/cli/command-definitions.js +1 -0
  15. package/dist/cli/command-definitions.js.map +1 -1
  16. package/dist/commands/init.d.ts +1 -0
  17. package/dist/commands/init.d.ts.map +1 -1
  18. package/dist/commands/init.js +6 -6
  19. package/dist/commands/init.js.map +1 -1
  20. package/dist/interfaces/agent.d.ts +7 -0
  21. package/dist/interfaces/agent.d.ts.map +1 -1
  22. package/dist/services/auth.d.ts.map +1 -1
  23. package/dist/services/auth.js +11 -3
  24. package/dist/services/auth.js.map +1 -1
  25. package/dist/utils/init-agent.d.ts +1 -1
  26. package/dist/utils/init-agent.d.ts.map +1 -1
  27. package/dist/utils/init-agent.js +7 -2
  28. package/dist/utils/init-agent.js.map +1 -1
  29. package/dist/utils/keytar-loader.d.ts +20 -0
  30. package/dist/utils/keytar-loader.d.ts.map +1 -0
  31. package/dist/utils/keytar-loader.js +28 -0
  32. package/dist/utils/keytar-loader.js.map +1 -0
  33. package/dist/utils/sandbox-storage.d.ts.map +1 -1
  34. package/dist/utils/sandbox-storage.js +19 -1
  35. package/dist/utils/sandbox-storage.js.map +1 -1
  36. package/dist/utils/sandbox.d.ts.map +1 -1
  37. package/dist/utils/sandbox.js +6 -17
  38. package/dist/utils/sandbox.js.map +1 -1
  39. package/docs/README.md +1 -1
  40. package/docs/api/AI.md +157 -640
  41. package/node_modules/@lua/shared-types/dist/index.d.mts +92 -0
  42. package/node_modules/@lua/shared-types/dist/index.d.ts +92 -0
  43. package/node_modules/@lua/shared-types/dist/index.js +104 -0
  44. package/node_modules/@lua/shared-types/dist/index.mjs +79 -0
  45. package/node_modules/@lua/shared-types/package.json +26 -0
  46. package/node_modules/@lua/shared-types/src/ai-generate.types.ts +79 -0
  47. package/node_modules/@lua/shared-types/src/ai-generate.utils.ts +19 -0
  48. package/node_modules/@lua/shared-types/src/channel.type.ts +21 -0
  49. package/node_modules/@lua/shared-types/src/index.ts +4 -0
  50. package/node_modules/@lua/shared-types/src/unstructured-types.ts +58 -0
  51. package/node_modules/@lua/shared-types/tsconfig.json +12 -0
  52. package/node_modules/@lua/shared-types/tsup.config.ts +9 -0
  53. package/package.json +19 -10
  54. package/scripts/resolve-workspace-deps.cjs +61 -0
  55. package/template/.gitignore +0 -21
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Pre-pack script: resolves workspace:* references in package.json
3
+ * before npm creates the tarball.
4
+ *
5
+ * pnpm does this automatically during `pnpm publish`, but `npm publish`
6
+ * does not. This script bridges the gap so both work.
7
+ *
8
+ * Usage: Called automatically via the "prepack" lifecycle hook.
9
+ */
10
+
11
+ const fs = require('fs');
12
+ const path = require('path');
13
+
14
+ const pkgPath = path.join(__dirname, '..', 'package.json');
15
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
16
+
17
+ let changed = false;
18
+
19
+ for (const depType of ['dependencies', 'devDependencies', 'optionalDependencies', 'peerDependencies']) {
20
+ const deps = pkg[depType];
21
+ if (!deps) continue;
22
+
23
+ for (const [name, version] of Object.entries(deps)) {
24
+ if (typeof version === 'string' && version.startsWith('workspace:')) {
25
+ // Extract the modifier after "workspace:" (e.g., *, ^, ~)
26
+ const modifier = version.slice('workspace:'.length);
27
+
28
+ // Resolve the actual version from the workspace package
29
+ const possiblePaths = [
30
+ path.join(__dirname, '..', '..', name.replace('@lua/', ''), 'package.json'),
31
+ path.join(__dirname, '..', '..', name.split('/').pop(), 'package.json'),
32
+ ];
33
+
34
+ let resolved = false;
35
+ for (const depPkgPath of possiblePaths) {
36
+ if (fs.existsSync(depPkgPath)) {
37
+ const depPkg = JSON.parse(fs.readFileSync(depPkgPath, 'utf8'));
38
+ // Preserve pnpm workspace modifiers: ^ → ^version, ~ → ~version, * → version
39
+ const prefix = modifier === '^' ? '^' : modifier === '~' ? '~' : '';
40
+ deps[name] = prefix + depPkg.version;
41
+ console.log(` Resolved ${name}: ${version} → ${deps[name]}`);
42
+ resolved = true;
43
+ changed = true;
44
+ break;
45
+ }
46
+ }
47
+
48
+ if (!resolved) {
49
+ console.error(` Error: Could not resolve workspace dependency ${name}`);
50
+ process.exit(1);
51
+ }
52
+ }
53
+ }
54
+ }
55
+
56
+ if (changed) {
57
+ fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n');
58
+ console.log('Workspace dependencies resolved for publishing.');
59
+ } else {
60
+ console.log('No workspace dependencies found.');
61
+ }
@@ -1,21 +0,0 @@
1
- # Compiled output
2
- dist/
3
- dist-v2/
4
- *.js
5
- *.js.map
6
-
7
- # Dependencies
8
- node_modules/
9
-
10
- # Environment files
11
- .env
12
- .env.local
13
-
14
- # IDE files
15
- .vscode/
16
- .idea/
17
- .lua/
18
-
19
- # OS files
20
- .DS_Store
21
- Thumbs.db