@akanjs/devkit 0.0.97 → 0.0.99

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 (65) hide show
  1. package/index.cjs +21 -0
  2. package/index.js +1 -21
  3. package/package.json +4 -4
  4. package/src/{aiEditor.mjs → aiEditor.cjs} +56 -22
  5. package/src/aiEditor.js +22 -56
  6. package/src/auth.cjs +72 -0
  7. package/src/auth.js +18 -48
  8. package/src/{builder.mjs → builder.cjs} +44 -11
  9. package/src/builder.js +11 -44
  10. package/src/{capacitorApp.mjs → capacitorApp.cjs} +42 -9
  11. package/src/capacitorApp.js +9 -42
  12. package/src/commandDecorators/{argMeta.mjs → argMeta.cjs} +34 -3
  13. package/src/commandDecorators/argMeta.js +3 -34
  14. package/src/commandDecorators/{command.mjs → command.cjs} +70 -37
  15. package/src/commandDecorators/command.js +37 -70
  16. package/src/commandDecorators/commandMeta.cjs +30 -0
  17. package/src/commandDecorators/commandMeta.js +2 -25
  18. package/src/commandDecorators/index.cjs +29 -0
  19. package/src/commandDecorators/index.js +5 -29
  20. package/src/commandDecorators/targetMeta.cjs +57 -0
  21. package/src/commandDecorators/targetMeta.js +2 -26
  22. package/src/commandDecorators/types.cjs +15 -0
  23. package/src/commandDecorators/types.js +0 -15
  24. package/src/constants.cjs +47 -0
  25. package/src/constants.js +4 -33
  26. package/src/createTunnel.cjs +49 -0
  27. package/src/createTunnel.js +4 -27
  28. package/src/{dependencyScanner.mjs → dependencyScanner.cjs} +38 -5
  29. package/src/dependencyScanner.js +5 -38
  30. package/src/{executors.mjs → executors.cjs} +123 -89
  31. package/src/executors.d.ts +1 -1
  32. package/src/executors.js +89 -123
  33. package/src/{extractDeps.mjs → extractDeps.cjs} +25 -2
  34. package/src/extractDeps.js +2 -25
  35. package/src/getCredentials.cjs +44 -0
  36. package/src/getCredentials.js +6 -39
  37. package/src/getModelFileData.cjs +66 -0
  38. package/src/getModelFileData.js +6 -39
  39. package/src/{getRelatedCnsts.mjs → getRelatedCnsts.cjs} +48 -9
  40. package/src/getRelatedCnsts.js +9 -48
  41. package/src/index.cjs +53 -0
  42. package/src/index.js +17 -53
  43. package/src/selectModel.cjs +46 -0
  44. package/src/selectModel.js +6 -39
  45. package/src/streamAi.cjs +62 -0
  46. package/src/streamAi.js +7 -30
  47. package/src/types.cjs +15 -0
  48. package/src/types.js +0 -15
  49. package/src/uploadRelease.cjs +85 -0
  50. package/src/uploadRelease.js +15 -48
  51. package/index.mjs +0 -1
  52. package/src/auth.mjs +0 -42
  53. package/src/commandDecorators/commandMeta.mjs +0 -7
  54. package/src/commandDecorators/index.mjs +0 -5
  55. package/src/commandDecorators/targetMeta.mjs +0 -33
  56. package/src/commandDecorators/types.mjs +0 -0
  57. package/src/constants.mjs +0 -18
  58. package/src/createTunnel.mjs +0 -26
  59. package/src/getCredentials.mjs +0 -11
  60. package/src/getModelFileData.mjs +0 -33
  61. package/src/index.mjs +0 -17
  62. package/src/selectModel.mjs +0 -13
  63. package/src/streamAi.mjs +0 -39
  64. package/src/types.mjs +0 -0
  65. package/src/uploadRelease.mjs +0 -52
@@ -0,0 +1,66 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var getModelFileData_exports = {};
29
+ __export(getModelFileData_exports, {
30
+ getModelFileData: () => getModelFileData
31
+ });
32
+ module.exports = __toCommonJS(getModelFileData_exports);
33
+ var import_fs = __toESM(require("fs"), 1);
34
+ const getModelFileData = (modulePath, modelName) => {
35
+ const moduleType = modulePath.startsWith("apps") ? "app" : "lib";
36
+ const moduleName = modulePath.split("/")[1];
37
+ const constantFilePath = `${modulePath}/lib/${modelName}/${modelName}.constant.ts`;
38
+ const unitFilePath = `${modulePath}/lib/${modelName}/${modelName}.Unit.tsx`;
39
+ const viewFilePath = `${modulePath}/lib/${modelName}/${modelName}.View.tsx`;
40
+ const constantFileStr = import_fs.default.readFileSync(constantFilePath, "utf8");
41
+ const unitFileStr = import_fs.default.readFileSync(unitFilePath, "utf8");
42
+ const viewFileStr = import_fs.default.readFileSync(viewFilePath, "utf8");
43
+ const constantFileLines = constantFileStr.split("\n");
44
+ const importLibNames = constantFileLines.filter((line) => line.startsWith("import { cnst as ")).map((line) => line.split("cnst as ")[1].split(" ")[0]);
45
+ const importLocalPaths = constantFileLines.filter((line) => line.startsWith("import { ") && line.includes('from "../')).map((line) => line.split("from ")[1].split('"')[1]);
46
+ const importModelNames = importLocalPaths.map((path) => path.split("/")[1]).filter((name) => !name.startsWith("_"));
47
+ const hasImportScalar = !!importLocalPaths.map((path) => path.split("/")[1]).filter((name) => name.startsWith("_")).length;
48
+ return {
49
+ moduleType,
50
+ moduleName,
51
+ modelName,
52
+ constantFilePath,
53
+ unitFilePath,
54
+ viewFilePath,
55
+ importModelNames,
56
+ hasImportScalar,
57
+ importLibNames,
58
+ constantFileStr,
59
+ unitFileStr,
60
+ viewFileStr
61
+ };
62
+ };
63
+ // Annotate the CommonJS export names for ESM import in node:
64
+ 0 && (module.exports = {
65
+ getModelFileData
66
+ });
@@ -1,45 +1,13 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var getModelFileData_exports = {};
29
- __export(getModelFileData_exports, {
30
- getModelFileData: () => getModelFileData
31
- });
32
- module.exports = __toCommonJS(getModelFileData_exports);
33
- var import_fs = __toESM(require("fs"));
1
+ import fs from "fs";
34
2
  const getModelFileData = (modulePath, modelName) => {
35
3
  const moduleType = modulePath.startsWith("apps") ? "app" : "lib";
36
4
  const moduleName = modulePath.split("/")[1];
37
5
  const constantFilePath = `${modulePath}/lib/${modelName}/${modelName}.constant.ts`;
38
6
  const unitFilePath = `${modulePath}/lib/${modelName}/${modelName}.Unit.tsx`;
39
7
  const viewFilePath = `${modulePath}/lib/${modelName}/${modelName}.View.tsx`;
40
- const constantFileStr = import_fs.default.readFileSync(constantFilePath, "utf8");
41
- const unitFileStr = import_fs.default.readFileSync(unitFilePath, "utf8");
42
- const viewFileStr = import_fs.default.readFileSync(viewFilePath, "utf8");
8
+ const constantFileStr = fs.readFileSync(constantFilePath, "utf8");
9
+ const unitFileStr = fs.readFileSync(unitFilePath, "utf8");
10
+ const viewFileStr = fs.readFileSync(viewFilePath, "utf8");
43
11
  const constantFileLines = constantFileStr.split("\n");
44
12
  const importLibNames = constantFileLines.filter((line) => line.startsWith("import { cnst as ")).map((line) => line.split("cnst as ")[1].split(" ")[0]);
45
13
  const importLocalPaths = constantFileLines.filter((line) => line.startsWith("import { ") && line.includes('from "../')).map((line) => line.split("from ")[1].split('"')[1]);
@@ -60,7 +28,6 @@ const getModelFileData = (modulePath, modelName) => {
60
28
  viewFileStr
61
29
  };
62
30
  };
63
- // Annotate the CommonJS export names for ESM import in node:
64
- 0 && (module.exports = {
31
+ export {
65
32
  getModelFileData
66
- });
33
+ };
@@ -1,6 +1,44 @@
1
- import * as fs from "fs";
2
- import ora from "ora";
3
- import * as ts from "typescript";
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var getRelatedCnsts_exports = {};
29
+ __export(getRelatedCnsts_exports, {
30
+ analyzeProperties: () => analyzeProperties,
31
+ collectExportedFiles: () => collectExportedFiles,
32
+ collectImportedFiles: () => collectImportedFiles,
33
+ createSymbolCache: () => createSymbolCache,
34
+ createTsProgram: () => createTsProgram,
35
+ getRelatedCnsts: () => getRelatedCnsts,
36
+ parseTsConfig: () => parseTsConfig
37
+ });
38
+ module.exports = __toCommonJS(getRelatedCnsts_exports);
39
+ var fs = __toESM(require("fs"), 1);
40
+ var import_ora = __toESM(require("ora"), 1);
41
+ var ts = __toESM(require("typescript"), 1);
4
42
  const parseTsConfig = (tsConfigPath = "./tsconfig.json") => {
5
43
  const configFile = ts.readConfigFile(tsConfigPath, (path) => {
6
44
  return ts.sys.readFile(path);
@@ -14,7 +52,7 @@ const parseTsConfig = (tsConfigPath = "./tsconfig.json") => {
14
52
  const collectImportedFiles = (constantFilePath, parsedConfig) => {
15
53
  const allFilesToAnalyze = /* @__PURE__ */ new Set([constantFilePath]);
16
54
  const analyzedFiles = /* @__PURE__ */ new Set();
17
- const spinner = ora("Collecting related files...");
55
+ const spinner = (0, import_ora.default)("Collecting related files...");
18
56
  spinner.start();
19
57
  function collectImported(filePath) {
20
58
  if (analyzedFiles.has(filePath))
@@ -49,7 +87,7 @@ const collectImportedFiles = (constantFilePath, parsedConfig) => {
49
87
  const collectExportedFiles = (constantFilePath, parsedConfig) => {
50
88
  const allFilesToAnalyze = /* @__PURE__ */ new Set([constantFilePath]);
51
89
  const analyzedFiles = /* @__PURE__ */ new Set();
52
- const spinner = ora("Collecting files from exports...");
90
+ const spinner = (0, import_ora.default)("Collecting files from exports...");
53
91
  spinner.start();
54
92
  function collectExported(filePath) {
55
93
  if (analyzedFiles.has(filePath))
@@ -102,7 +140,7 @@ const collectExportedFiles = (constantFilePath, parsedConfig) => {
102
140
  };
103
141
  };
104
142
  const createTsProgram = (filePaths, options) => {
105
- const spinner = ora("Creating TypeScript program for all files...");
143
+ const spinner = (0, import_ora.default)("Creating TypeScript program for all files...");
106
144
  spinner.start();
107
145
  const program = ts.createProgram(Array.from(filePaths), options);
108
146
  const checker = program.getTypeChecker();
@@ -127,7 +165,7 @@ const analyzeProperties = (filesToAnalyze, program, checker) => {
127
165
  const analyzedFiles = /* @__PURE__ */ new Set();
128
166
  const sourceLineCache = /* @__PURE__ */ new Map();
129
167
  const getCachedSymbol = createSymbolCache(checker);
130
- const spinner = ora("Analyzing property relationships...");
168
+ const spinner = (0, import_ora.default)("Analyzing property relationships...");
131
169
  spinner.start();
132
170
  function analyzeFileProperties(filePath) {
133
171
  if (analyzedFiles.has(filePath))
@@ -210,7 +248,8 @@ const getRelatedCnsts = (constantFilePath) => {
210
248
  const propertyMap = analyzeProperties(allFilesToAnalyze, program, checker);
211
249
  return Array.from(propertyMap.entries()).map(([key, value]) => ({ key, ...value }));
212
250
  };
213
- export {
251
+ // Annotate the CommonJS export names for ESM import in node:
252
+ 0 && (module.exports = {
214
253
  analyzeProperties,
215
254
  collectExportedFiles,
216
255
  collectImportedFiles,
@@ -218,4 +257,4 @@ export {
218
257
  createTsProgram,
219
258
  getRelatedCnsts,
220
259
  parseTsConfig
221
- };
260
+ });
@@ -1,44 +1,6 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var getRelatedCnsts_exports = {};
29
- __export(getRelatedCnsts_exports, {
30
- analyzeProperties: () => analyzeProperties,
31
- collectExportedFiles: () => collectExportedFiles,
32
- collectImportedFiles: () => collectImportedFiles,
33
- createSymbolCache: () => createSymbolCache,
34
- createTsProgram: () => createTsProgram,
35
- getRelatedCnsts: () => getRelatedCnsts,
36
- parseTsConfig: () => parseTsConfig
37
- });
38
- module.exports = __toCommonJS(getRelatedCnsts_exports);
39
- var fs = __toESM(require("fs"));
40
- var import_ora = __toESM(require("ora"));
41
- var ts = __toESM(require("typescript"));
1
+ import * as fs from "fs";
2
+ import ora from "ora";
3
+ import * as ts from "typescript";
42
4
  const parseTsConfig = (tsConfigPath = "./tsconfig.json") => {
43
5
  const configFile = ts.readConfigFile(tsConfigPath, (path) => {
44
6
  return ts.sys.readFile(path);
@@ -52,7 +14,7 @@ const parseTsConfig = (tsConfigPath = "./tsconfig.json") => {
52
14
  const collectImportedFiles = (constantFilePath, parsedConfig) => {
53
15
  const allFilesToAnalyze = /* @__PURE__ */ new Set([constantFilePath]);
54
16
  const analyzedFiles = /* @__PURE__ */ new Set();
55
- const spinner = (0, import_ora.default)("Collecting related files...");
17
+ const spinner = ora("Collecting related files...");
56
18
  spinner.start();
57
19
  function collectImported(filePath) {
58
20
  if (analyzedFiles.has(filePath))
@@ -87,7 +49,7 @@ const collectImportedFiles = (constantFilePath, parsedConfig) => {
87
49
  const collectExportedFiles = (constantFilePath, parsedConfig) => {
88
50
  const allFilesToAnalyze = /* @__PURE__ */ new Set([constantFilePath]);
89
51
  const analyzedFiles = /* @__PURE__ */ new Set();
90
- const spinner = (0, import_ora.default)("Collecting files from exports...");
52
+ const spinner = ora("Collecting files from exports...");
91
53
  spinner.start();
92
54
  function collectExported(filePath) {
93
55
  if (analyzedFiles.has(filePath))
@@ -140,7 +102,7 @@ const collectExportedFiles = (constantFilePath, parsedConfig) => {
140
102
  };
141
103
  };
142
104
  const createTsProgram = (filePaths, options) => {
143
- const spinner = (0, import_ora.default)("Creating TypeScript program for all files...");
105
+ const spinner = ora("Creating TypeScript program for all files...");
144
106
  spinner.start();
145
107
  const program = ts.createProgram(Array.from(filePaths), options);
146
108
  const checker = program.getTypeChecker();
@@ -165,7 +127,7 @@ const analyzeProperties = (filesToAnalyze, program, checker) => {
165
127
  const analyzedFiles = /* @__PURE__ */ new Set();
166
128
  const sourceLineCache = /* @__PURE__ */ new Map();
167
129
  const getCachedSymbol = createSymbolCache(checker);
168
- const spinner = (0, import_ora.default)("Analyzing property relationships...");
130
+ const spinner = ora("Analyzing property relationships...");
169
131
  spinner.start();
170
132
  function analyzeFileProperties(filePath) {
171
133
  if (analyzedFiles.has(filePath))
@@ -248,8 +210,7 @@ const getRelatedCnsts = (constantFilePath) => {
248
210
  const propertyMap = analyzeProperties(allFilesToAnalyze, program, checker);
249
211
  return Array.from(propertyMap.entries()).map(([key, value]) => ({ key, ...value }));
250
212
  };
251
- // Annotate the CommonJS export names for ESM import in node:
252
- 0 && (module.exports = {
213
+ export {
253
214
  analyzeProperties,
254
215
  collectExportedFiles,
255
216
  collectImportedFiles,
@@ -257,4 +218,4 @@ const getRelatedCnsts = (constantFilePath) => {
257
218
  createTsProgram,
258
219
  getRelatedCnsts,
259
220
  parseTsConfig
260
- });
221
+ };
package/src/index.cjs ADDED
@@ -0,0 +1,53 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var src_exports = {};
16
+ module.exports = __toCommonJS(src_exports);
17
+ __reExport(src_exports, require("./createTunnel"), module.exports);
18
+ __reExport(src_exports, require("./getCredentials"), module.exports);
19
+ __reExport(src_exports, require("./uploadRelease"), module.exports);
20
+ __reExport(src_exports, require("./getModelFileData"), module.exports);
21
+ __reExport(src_exports, require("./getRelatedCnsts"), module.exports);
22
+ __reExport(src_exports, require("./selectModel"), module.exports);
23
+ __reExport(src_exports, require("./streamAi"), module.exports);
24
+ __reExport(src_exports, require("./executors"), module.exports);
25
+ __reExport(src_exports, require("./dependencyScanner"), module.exports);
26
+ __reExport(src_exports, require("./constants"), module.exports);
27
+ __reExport(src_exports, require("./auth"), module.exports);
28
+ __reExport(src_exports, require("./types"), module.exports);
29
+ __reExport(src_exports, require("./capacitorApp"), module.exports);
30
+ __reExport(src_exports, require("./extractDeps"), module.exports);
31
+ __reExport(src_exports, require("./commandDecorators"), module.exports);
32
+ __reExport(src_exports, require("./aiEditor"), module.exports);
33
+ __reExport(src_exports, require("./builder"), module.exports);
34
+ // Annotate the CommonJS export names for ESM import in node:
35
+ 0 && (module.exports = {
36
+ ...require("./createTunnel"),
37
+ ...require("./getCredentials"),
38
+ ...require("./uploadRelease"),
39
+ ...require("./getModelFileData"),
40
+ ...require("./getRelatedCnsts"),
41
+ ...require("./selectModel"),
42
+ ...require("./streamAi"),
43
+ ...require("./executors"),
44
+ ...require("./dependencyScanner"),
45
+ ...require("./constants"),
46
+ ...require("./auth"),
47
+ ...require("./types"),
48
+ ...require("./capacitorApp"),
49
+ ...require("./extractDeps"),
50
+ ...require("./commandDecorators"),
51
+ ...require("./aiEditor"),
52
+ ...require("./builder")
53
+ });
package/src/index.js CHANGED
@@ -1,53 +1,17 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from))
8
- if (!__hasOwnProp.call(to, key) && key !== except)
9
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
- }
11
- return to;
12
- };
13
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
- var src_exports = {};
16
- module.exports = __toCommonJS(src_exports);
17
- __reExport(src_exports, require("./createTunnel"), module.exports);
18
- __reExport(src_exports, require("./getCredentials"), module.exports);
19
- __reExport(src_exports, require("./uploadRelease"), module.exports);
20
- __reExport(src_exports, require("./getModelFileData"), module.exports);
21
- __reExport(src_exports, require("./getRelatedCnsts"), module.exports);
22
- __reExport(src_exports, require("./selectModel"), module.exports);
23
- __reExport(src_exports, require("./streamAi"), module.exports);
24
- __reExport(src_exports, require("./executors"), module.exports);
25
- __reExport(src_exports, require("./dependencyScanner"), module.exports);
26
- __reExport(src_exports, require("./constants"), module.exports);
27
- __reExport(src_exports, require("./auth"), module.exports);
28
- __reExport(src_exports, require("./types"), module.exports);
29
- __reExport(src_exports, require("./capacitorApp"), module.exports);
30
- __reExport(src_exports, require("./extractDeps"), module.exports);
31
- __reExport(src_exports, require("./commandDecorators"), module.exports);
32
- __reExport(src_exports, require("./aiEditor"), module.exports);
33
- __reExport(src_exports, require("./builder"), module.exports);
34
- // Annotate the CommonJS export names for ESM import in node:
35
- 0 && (module.exports = {
36
- ...require("./createTunnel"),
37
- ...require("./getCredentials"),
38
- ...require("./uploadRelease"),
39
- ...require("./getModelFileData"),
40
- ...require("./getRelatedCnsts"),
41
- ...require("./selectModel"),
42
- ...require("./streamAi"),
43
- ...require("./executors"),
44
- ...require("./dependencyScanner"),
45
- ...require("./constants"),
46
- ...require("./auth"),
47
- ...require("./types"),
48
- ...require("./capacitorApp"),
49
- ...require("./extractDeps"),
50
- ...require("./commandDecorators"),
51
- ...require("./aiEditor"),
52
- ...require("./builder")
53
- });
1
+ export * from "./createTunnel";
2
+ export * from "./getCredentials";
3
+ export * from "./uploadRelease";
4
+ export * from "./getModelFileData";
5
+ export * from "./getRelatedCnsts";
6
+ export * from "./selectModel";
7
+ export * from "./streamAi";
8
+ export * from "./executors";
9
+ export * from "./dependencyScanner";
10
+ export * from "./constants";
11
+ export * from "./auth";
12
+ export * from "./types";
13
+ export * from "./capacitorApp";
14
+ export * from "./extractDeps";
15
+ export * from "./commandDecorators";
16
+ export * from "./aiEditor";
17
+ export * from "./builder";
@@ -0,0 +1,46 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var selectModel_exports = {};
29
+ __export(selectModel_exports, {
30
+ selectModel: () => selectModel
31
+ });
32
+ module.exports = __toCommonJS(selectModel_exports);
33
+ var import_prompts = require("@inquirer/prompts");
34
+ var import_fs = __toESM(require("fs"), 1);
35
+ const selectModel = async (modulePath) => {
36
+ const modelNames = import_fs.default.readdirSync(`${modulePath}/lib`).filter((dir) => !dir.includes(".") && !dir.startsWith("_"));
37
+ const modelName = await (0, import_prompts.select)({
38
+ message: "Select the model to create the unit for",
39
+ choices: modelNames.map((name) => ({ name, value: name }))
40
+ });
41
+ return modelName;
42
+ };
43
+ // Annotate the CommonJS export names for ESM import in node:
44
+ 0 && (module.exports = {
45
+ selectModel
46
+ });
@@ -1,46 +1,13 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var selectModel_exports = {};
29
- __export(selectModel_exports, {
30
- selectModel: () => selectModel
31
- });
32
- module.exports = __toCommonJS(selectModel_exports);
33
- var import_prompts = require("@inquirer/prompts");
34
- var import_fs = __toESM(require("fs"));
1
+ import { select } from "@inquirer/prompts";
2
+ import fs from "fs";
35
3
  const selectModel = async (modulePath) => {
36
- const modelNames = import_fs.default.readdirSync(`${modulePath}/lib`).filter((dir) => !dir.includes(".") && !dir.startsWith("_"));
37
- const modelName = await (0, import_prompts.select)({
4
+ const modelNames = fs.readdirSync(`${modulePath}/lib`).filter((dir) => !dir.includes(".") && !dir.startsWith("_"));
5
+ const modelName = await select({
38
6
  message: "Select the model to create the unit for",
39
7
  choices: modelNames.map((name) => ({ name, value: name }))
40
8
  });
41
9
  return modelName;
42
10
  };
43
- // Annotate the CommonJS export names for ESM import in node:
44
- 0 && (module.exports = {
11
+ export {
45
12
  selectModel
46
- });
13
+ };
@@ -0,0 +1,62 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var streamAi_exports = {};
19
+ __export(streamAi_exports, {
20
+ streamAi: () => streamAi
21
+ });
22
+ module.exports = __toCommonJS(streamAi_exports);
23
+ var import_prompts = require("@langchain/core/prompts");
24
+ var import_runnables = require("@langchain/core/runnables");
25
+ var import_openai = require("@langchain/openai");
26
+ const streamAi = async (question, callback = (chunk) => {
27
+ process.stdout.write(chunk);
28
+ }) => {
29
+ const createStreamingModel = (apiKey = process.env.DEEPSEEK_API_KEY) => {
30
+ if (!apiKey)
31
+ throw new Error(`process.env.DEEPSEEK_API_KEY is not set`);
32
+ return new import_openai.ChatOpenAI({
33
+ modelName: "deepseek-reasoner",
34
+ temperature: 0.7,
35
+ streaming: true,
36
+ // Enable streaming
37
+ configuration: { baseURL: "https://api.deepseek.com/v1", apiKey }
38
+ });
39
+ };
40
+ const createProcessingChain = () => {
41
+ return import_runnables.RunnableSequence.from([import_prompts.PromptTemplate.fromTemplate(`Answer concisely: {question}`), createStreamingModel()]);
42
+ };
43
+ try {
44
+ const chain = createProcessingChain();
45
+ const stream = await chain.stream({ question });
46
+ let fullResponse = "";
47
+ for await (const chunk of stream) {
48
+ const content = chunk.content;
49
+ if (typeof content === "string") {
50
+ fullResponse += content;
51
+ callback(content);
52
+ }
53
+ }
54
+ return { content: fullResponse };
55
+ } catch (error) {
56
+ throw new Error("Failed to stream response");
57
+ }
58
+ };
59
+ // Annotate the CommonJS export names for ESM import in node:
60
+ 0 && (module.exports = {
61
+ streamAi
62
+ });