@jixo/cli 0.23.7 → 0.24.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 (80) hide show
  1. package/assets/bundle/google-aistudio.browser.js +231 -1
  2. package/assets/bundle/groq.browser.js +3714 -0
  3. package/assets/prompt.json +1 -4
  4. package/bundle/external-B5Q4zVIg.js +285 -0
  5. package/bundle/external-DSiJ5HUn.js +285 -0
  6. package/bundle/file-replacer-BBkQrlEp.js +19525 -0
  7. package/bundle/file-replacer-BRQH97p5.js +3 -0
  8. package/bundle/file-replacer-BjxkSo7g.js +3 -0
  9. package/bundle/file-replacer-Cn6P6P9p.js +19525 -0
  10. package/bundle/gen-prompt-C9t2IJs3.js +4 -0
  11. package/bundle/gen-prompt-CP097hvk.js +4 -0
  12. package/bundle/gen-prompt-CdL3aAGF.js +18145 -0
  13. package/bundle/gen-prompt-D01J11yn.js +18145 -0
  14. package/bundle/index.js +24835 -58291
  15. package/dist/commands/groq.d.ts +8 -0
  16. package/dist/commands/groq.d.ts.map +1 -0
  17. package/dist/commands/groq.js +70 -0
  18. package/dist/commands/groq.js.map +1 -0
  19. package/dist/prompts.json +2 -14
  20. package/dist/runCli.d.ts.map +1 -1
  21. package/dist/runCli.js +3 -1
  22. package/dist/runCli.js.map +1 -1
  23. package/package.json +3 -3
  24. package/dist/cli.d.ts +0 -2
  25. package/dist/cli.d.ts.map +0 -1
  26. package/dist/cli.js +0 -83
  27. package/dist/cli.js.map +0 -1
  28. package/dist/commands/daemon.d.ts +0 -5
  29. package/dist/commands/daemon.d.ts.map +0 -1
  30. package/dist/commands/daemon.js +0 -20
  31. package/dist/commands/daemon.js.map +0 -1
  32. package/dist/commands/doctor/config.d.ts +0 -3
  33. package/dist/commands/doctor/config.d.ts.map +0 -1
  34. package/dist/commands/doctor/config.js +0 -17
  35. package/dist/commands/doctor/config.js.map +0 -1
  36. package/dist/commands/doctor/doctor.d.ts +0 -3
  37. package/dist/commands/doctor/doctor.d.ts.map +0 -1
  38. package/dist/commands/doctor/doctor.js +0 -158
  39. package/dist/commands/doctor/doctor.js.map +0 -1
  40. package/dist/commands/doctor/doctor.test.d.ts +0 -2
  41. package/dist/commands/doctor/doctor.test.d.ts.map +0 -1
  42. package/dist/commands/doctor/doctor.test.js +0 -14
  43. package/dist/commands/doctor/doctor.test.js.map +0 -1
  44. package/dist/commands/doctor/index.d.ts +0 -2
  45. package/dist/commands/doctor/index.d.ts.map +0 -1
  46. package/dist/commands/doctor/index.js +0 -8
  47. package/dist/commands/doctor/index.js.map +0 -1
  48. package/dist/commands/doctor/types.d.ts +0 -45
  49. package/dist/commands/doctor/types.d.ts.map +0 -1
  50. package/dist/commands/doctor/types.js +0 -3
  51. package/dist/commands/doctor/types.js.map +0 -1
  52. package/dist/commands/init.d.ts +0 -2
  53. package/dist/commands/init.d.ts.map +0 -1
  54. package/dist/commands/init.js +0 -40
  55. package/dist/commands/init.js.map +0 -1
  56. package/dist/commands/tasks/run.d.ts +0 -10
  57. package/dist/commands/tasks/run.d.ts.map +0 -1
  58. package/dist/commands/tasks/run.js +0 -44
  59. package/dist/commands/tasks/run.js.map +0 -1
  60. package/dist/config.d.ts +0 -15
  61. package/dist/config.d.ts.map +0 -1
  62. package/dist/config.js +0 -23
  63. package/dist/config.js.map +0 -1
  64. package/dist/env.d.ts +0 -6
  65. package/dist/env.d.ts.map +0 -1
  66. package/dist/env.js +0 -16
  67. package/dist/env.js.map +0 -1
  68. /package/bundle/{acorn-BoNAepQd.js → acorn-CU7YmuGp.js} +0 -0
  69. /package/bundle/{angular-pDmFHCFc.js → angular-BZFEnvyh.js} +0 -0
  70. /package/bundle/{babel-CxK7_76E.js → babel-BC5Ty8sN.js} +0 -0
  71. /package/bundle/{estree-CfdzwKX-.js → estree-DZTSfOv_.js} +0 -0
  72. /package/bundle/{flow-CGeR1fbg.js → flow-CNTeHoxv.js} +0 -0
  73. /package/bundle/{glimmer-CX3iu1jj.js → glimmer-DYkbcawC.js} +0 -0
  74. /package/bundle/{graphql-C32NbEjQ.js → graphql-fCaNVuM0.js} +0 -0
  75. /package/bundle/{html-BYSSlHHY.js → html-Bb8ztcZq.js} +0 -0
  76. /package/bundle/{markdown-DiTmrgL1.js → markdown-ChusAllR.js} +0 -0
  77. /package/bundle/{meriyah-DM8jkzWU.js → meriyah-9NeL3We4.js} +0 -0
  78. /package/bundle/{postcss-Au71UEeZ.js → postcss-DXCUuMfC.js} +0 -0
  79. /package/bundle/{typescript-Dn4uCwAY.js → typescript-C2HFEnMP.js} +0 -0
  80. /package/bundle/{yaml-D6G3z4bP.js → yaml-ByEZ6gmG.js} +0 -0
@@ -1,3 +1,122 @@
1
+ const isPromiseLike = (value) => value !== null && typeof value?.then === "function";
2
+ const func_remember = /* @__NO_SIDE_EFFECTS__ */ (func, key) => {
3
+ let result;
4
+ const once_fn = function(...args) {
5
+ const newKey = key?.apply(this, args);
6
+ if (result === void 0 || newKey !== result.key) result = {
7
+ key: newKey,
8
+ res: func.apply(this, args)
9
+ };
10
+ return result.res;
11
+ };
12
+ const once_fn_mix = Object.assign(once_fn, {
13
+ get source() {
14
+ return func;
15
+ },
16
+ get key() {
17
+ return result?.key;
18
+ },
19
+ get runned() {
20
+ return result != null;
21
+ },
22
+ get returnValue() {
23
+ return result?.res;
24
+ },
25
+ reset() {
26
+ result = void 0;
27
+ },
28
+ rerun(...args) {
29
+ once_fn_mix.reset();
30
+ return once_fn_mix(...args);
31
+ }
32
+ });
33
+ Object.defineProperties(once_fn_mix, {
34
+ source: {
35
+ value: func,
36
+ writable: false,
37
+ configurable: true,
38
+ enumerable: true
39
+ },
40
+ key: {
41
+ get: () => result?.key,
42
+ configurable: true,
43
+ enumerable: true
44
+ },
45
+ runned: {
46
+ get: () => result != null,
47
+ configurable: true,
48
+ enumerable: true
49
+ },
50
+ returnValue: {
51
+ get: () => result?.res,
52
+ configurable: true,
53
+ enumerable: true
54
+ }
55
+ });
56
+ return once_fn_mix;
57
+ };
58
+ const wrapSuccess = (result) => {
59
+ return Object.defineProperties([void 0, result], {
60
+ success: {
61
+ value: true,
62
+ writable: false,
63
+ enumerable: false,
64
+ configurable: true
65
+ },
66
+ result: {
67
+ value: result,
68
+ writable: false,
69
+ enumerable: false,
70
+ configurable: true
71
+ },
72
+ error: {
73
+ value: void 0,
74
+ writable: false,
75
+ enumerable: false,
76
+ configurable: true
77
+ }
78
+ });
79
+ };
80
+ const wrapError = (err, errorParser) => {
81
+ const error = errorParser ? errorParser(err) : err;
82
+ return Object.defineProperties([error, void 0], {
83
+ success: {
84
+ value: false,
85
+ writable: false,
86
+ enumerable: false,
87
+ configurable: true
88
+ },
89
+ result: {
90
+ value: void 0,
91
+ writable: false,
92
+ enumerable: false,
93
+ configurable: true
94
+ },
95
+ error: {
96
+ value: error,
97
+ writable: false,
98
+ enumerable: false,
99
+ configurable: true
100
+ }
101
+ });
102
+ };
103
+ const func_catch = /* @__PURE__ */ Object.assign((fn, errorParser) => {
104
+ return Object.assign(function() {
105
+ try {
106
+ const res = fn.apply(this, arguments);
107
+ if (isPromiseLike(res)) return res.then((value) => wrapSuccess(value), (err) => wrapError(err, errorParser));
108
+ return wrapSuccess(res);
109
+ } catch (err) {
110
+ return wrapError(err, errorParser);
111
+ }
112
+ }, { catchType(errorParser$1) {
113
+ return func_catch(fn, errorParser$1);
114
+ } });
115
+ }, {
116
+ wrapSuccess,
117
+ wrapError
118
+ });
119
+ const effect_symbol = Symbol.for("effect");
1
120
  let rootDirHandle;
2
121
  const prepareDirHandle = async () => {
3
122
  if (rootDirHandle) return rootDirHandle;
@@ -21,6 +140,117 @@ const prepareDirHandle = async () => {
21
140
  throw e;
22
141
  }
23
142
  };
143
+ const getEasyFs = /* @__PURE__ */ func_remember(async () => {
144
+ const [error, dirHandle] = await func_catch(prepareDirHandle)();
145
+ if (!dirHandle) {
146
+ getEasyFs.reset();
147
+ throw error;
148
+ }
149
+ const getHandle = async (path, { create = false } = {}) => {
150
+ let curr = dirHandle;
151
+ const parts = path.split("/").filter(Boolean);
152
+ const last = parts.at(-1);
153
+ for (let i = 0; i < parts.length - 1; i++) curr = await curr.getDirectoryHandle(parts[i], { create });
154
+ return {
155
+ parent: curr,
156
+ name: last,
157
+ async getFile() {
158
+ if (!last) throw new Error("No file name");
159
+ return curr.getFileHandle(last, { create });
160
+ },
161
+ async getDir() {
162
+ if (!last) return curr;
163
+ return curr.getDirectoryHandle(last, { create });
164
+ }
165
+ };
166
+ };
167
+ const writeFile = async (filePath, data, opts) => {
168
+ const { getFile } = await getHandle(filePath, { create: true });
169
+ const handle = await getFile();
170
+ const w = await handle.createWritable();
171
+ if (!opts?.append) await w.truncate(0);
172
+ await w.write(data);
173
+ await w.close();
174
+ };
175
+ const createWriteStream = async (filePath) => {
176
+ const { getFile } = await getHandle(filePath, { create: true });
177
+ const handle = await getFile();
178
+ return handle.createWritable();
179
+ };
180
+ const readFileText = async (filePath) => {
181
+ const { getFile } = await getHandle(filePath);
182
+ const file = await (await getFile()).getFile();
183
+ return file.text();
184
+ };
185
+ const readFileBinary = async (filePath) => {
186
+ const { getFile } = await getHandle(filePath);
187
+ const file = await (await getFile()).getFile();
188
+ return file.bytes();
189
+ };
190
+ const createReadStream = async (filePath) => {
191
+ const { getFile } = await getHandle(filePath);
192
+ const file = await (await getFile()).getFile();
193
+ return file.stream();
194
+ };
195
+ const readdir = async (dirPath) => {
196
+ const { getDir } = await getHandle(dirPath);
197
+ const dir = await getDir();
198
+ return Array.fromAsync(dir.keys());
199
+ };
200
+ const mkdir = async (dirPath, opts) => {
201
+ const parts = dirPath.split("/").filter(Boolean);
202
+ let curr = dirHandle;
203
+ for (const segment of parts) {
204
+ curr = await curr.getDirectoryHandle(segment, { create: true });
205
+ if (!opts?.recursive) break;
206
+ }
207
+ };
208
+ const exists = async (path) => {
209
+ try {
210
+ await getHandle(path);
211
+ return true;
212
+ } catch {
213
+ return false;
214
+ }
215
+ };
216
+ const stat = async (path) => {
217
+ const { getFile, getDir } = await getHandle(path);
218
+ try {
219
+ const h = await getFile();
220
+ const f = await h.getFile();
221
+ return {
222
+ isFile: true,
223
+ size: f.size,
224
+ lastModified: f.lastModified
225
+ };
226
+ } catch {
227
+ await getDir();
228
+ return { isFile: false };
229
+ }
230
+ };
231
+ const rm = async (path, opts) => {
232
+ try {
233
+ const { parent, name } = await getHandle(path);
234
+ if (!name) throw new Error("Invalid path");
235
+ await parent.removeEntry(name, { recursive: opts?.recursive });
236
+ return true;
237
+ } catch {
238
+ return false;
239
+ }
240
+ };
241
+ return {
242
+ writeFile,
243
+ createWriteStream,
244
+ readFileText,
245
+ readFileBinary,
246
+ createReadStream,
247
+ readdir,
248
+ mkdir,
249
+ exists,
250
+ stat,
251
+ rm
252
+ };
253
+ });
24
254
  const styles = {
25
255
  header: "color: #4CAF50; font-size: 18px; font-weight: bold; border-bottom: 2px solid #4CAF50; padding-bottom: 5px;",
26
256
  info: "color: #2196F3; font-style: italic;",
@@ -94,7 +324,7 @@ const fillFunctionCall = async () => {
94
324
  buttonEle.click();
95
325
  await rootDirHandle$1.removeEntry(callTaskname);
96
326
  };
97
- const syncInput = async (fps = 2) => {
327
+ const syncInput = async (fps = 3) => {
98
328
  (async () => {
99
329
  while (true) {
100
330
  await fillFunctionCall();