vibecodeagent 0.0.0-stage → 0.1.65

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 (109) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +46 -2
  3. package/THIRD-PARTY-NOTICES.txt +1427 -0
  4. package/dist/agen.js +138920 -0
  5. package/dist/bin.js +1245 -0
  6. package/dist/daemon.js +163701 -0
  7. package/dist/node_modules/node-ensure/index.js +10 -0
  8. package/dist/node_modules/node-ensure/package.json +31 -0
  9. package/dist/node_modules/pdf-parse/lib/pdf-parse.js +102 -0
  10. package/dist/node_modules/pdf-parse/lib/pdf.js/v1.10.100/build/pdf.js +18538 -0
  11. package/dist/node_modules/pdf-parse/lib/pdf.js/v1.10.100/build/pdf.worker.js +45507 -0
  12. package/dist/node_modules/pdf-parse/package.json +49 -0
  13. package/dist/node_modules/sql.js/dist/sql-wasm.js +186 -0
  14. package/dist/node_modules/sql.js/dist/sql-wasm.wasm +0 -0
  15. package/dist/node_modules/sql.js/package.json +58 -0
  16. package/dist/resources/skills/builtin/.gitkeep +0 -0
  17. package/dist/resources/skills/builtin/NOTICE.md +35 -0
  18. package/dist/resources/skills/builtin/README.md +74 -0
  19. package/dist/resources/skills/builtin/backend-engineering/SKILL.md +102 -0
  20. package/dist/resources/skills/builtin/backend-engineering/references/api-contracts.md +320 -0
  21. package/dist/resources/skills/builtin/backend-engineering/references/auth-and-secrets.md +268 -0
  22. package/dist/resources/skills/builtin/backend-engineering/references/concurrency-and-jobs.md +386 -0
  23. package/dist/resources/skills/builtin/backend-engineering/references/data-modelling.md +367 -0
  24. package/dist/resources/skills/builtin/backend-engineering/references/deploy-and-config.md +228 -0
  25. package/dist/resources/skills/builtin/backend-engineering/references/migrations.md +320 -0
  26. package/dist/resources/skills/builtin/backend-engineering/references/observability.md +301 -0
  27. package/dist/resources/skills/builtin/backend-engineering/references/plan-template.md +152 -0
  28. package/dist/resources/skills/builtin/backend-engineering/references/review-audit.md +213 -0
  29. package/dist/resources/skills/builtin/backend-engineering/references/security.md +251 -0
  30. package/dist/resources/skills/builtin/backend-engineering/references/stack-go.md +238 -0
  31. package/dist/resources/skills/builtin/backend-engineering/references/stack-node.md +274 -0
  32. package/dist/resources/skills/builtin/backend-engineering/references/stack-python.md +296 -0
  33. package/dist/resources/skills/builtin/backend-engineering/references/testing-and-perf.md +298 -0
  34. package/dist/resources/skills/builtin/backend-engineering/references/validation-and-errors.md +266 -0
  35. package/dist/resources/skills/builtin/dasar-vibecode/SKILL.md +312 -0
  36. package/dist/resources/skills/builtin/excel-maker/SKILL.md +71 -0
  37. package/dist/resources/skills/builtin/frontend-design/SKILL.md +131 -0
  38. package/dist/resources/skills/builtin/frontend-design/data/app-interface.csv +33 -0
  39. package/dist/resources/skills/builtin/frontend-design/data/catalog-summary.json +78 -0
  40. package/dist/resources/skills/builtin/frontend-design/data/charts.csv +26 -0
  41. package/dist/resources/skills/builtin/frontend-design/data/colors.csv +193 -0
  42. package/dist/resources/skills/builtin/frontend-design/data/data-provenance.json +1348 -0
  43. package/dist/resources/skills/builtin/frontend-design/data/google-font-licenses.json +20185 -0
  44. package/dist/resources/skills/builtin/frontend-design/data/google-fonts.csv +1935 -0
  45. package/dist/resources/skills/builtin/frontend-design/data/icons.csv +106 -0
  46. package/dist/resources/skills/builtin/frontend-design/data/landing.csv +35 -0
  47. package/dist/resources/skills/builtin/frontend-design/data/motion.csv +18 -0
  48. package/dist/resources/skills/builtin/frontend-design/data/phosphor-icons-upstream.json +32582 -0
  49. package/dist/resources/skills/builtin/frontend-design/data/products.csv +193 -0
  50. package/dist/resources/skills/builtin/frontend-design/data/react-performance.csv +45 -0
  51. package/dist/resources/skills/builtin/frontend-design/data/stacks/angular.csv +51 -0
  52. package/dist/resources/skills/builtin/frontend-design/data/stacks/astro.csv +54 -0
  53. package/dist/resources/skills/builtin/frontend-design/data/stacks/avalonia.csv +57 -0
  54. package/dist/resources/skills/builtin/frontend-design/data/stacks/flutter.csv +53 -0
  55. package/dist/resources/skills/builtin/frontend-design/data/stacks/html-tailwind.csv +60 -0
  56. package/dist/resources/skills/builtin/frontend-design/data/stacks/javafx.csv +76 -0
  57. package/dist/resources/skills/builtin/frontend-design/data/stacks/jetpack-compose.csv +53 -0
  58. package/dist/resources/skills/builtin/frontend-design/data/stacks/laravel.csv +51 -0
  59. package/dist/resources/skills/builtin/frontend-design/data/stacks/nextjs.csv +62 -0
  60. package/dist/resources/skills/builtin/frontend-design/data/stacks/nuxt-ui.csv +71 -0
  61. package/dist/resources/skills/builtin/frontend-design/data/stacks/nuxtjs.csv +68 -0
  62. package/dist/resources/skills/builtin/frontend-design/data/stacks/react-native.csv +52 -0
  63. package/dist/resources/skills/builtin/frontend-design/data/stacks/react.csv +62 -0
  64. package/dist/resources/skills/builtin/frontend-design/data/stacks/shadcn.csv +69 -0
  65. package/dist/resources/skills/builtin/frontend-design/data/stacks/svelte.csv +56 -0
  66. package/dist/resources/skills/builtin/frontend-design/data/stacks/swiftui.csv +51 -0
  67. package/dist/resources/skills/builtin/frontend-design/data/stacks/threejs.csv +54 -0
  68. package/dist/resources/skills/builtin/frontend-design/data/stacks/uno.csv +60 -0
  69. package/dist/resources/skills/builtin/frontend-design/data/stacks/uwp.csv +56 -0
  70. package/dist/resources/skills/builtin/frontend-design/data/stacks/vue.csv +50 -0
  71. package/dist/resources/skills/builtin/frontend-design/data/stacks/winui.csv +60 -0
  72. package/dist/resources/skills/builtin/frontend-design/data/stacks/wpf.csv +57 -0
  73. package/dist/resources/skills/builtin/frontend-design/data/styles.csv +89 -0
  74. package/dist/resources/skills/builtin/frontend-design/data/typography.csv +75 -0
  75. package/dist/resources/skills/builtin/frontend-design/data/ui-reasoning.csv +193 -0
  76. package/dist/resources/skills/builtin/frontend-design/data/ux-guidelines.csv +120 -0
  77. package/dist/resources/skills/builtin/frontend-design/references/animation-patterns.md +705 -0
  78. package/dist/resources/skills/builtin/frontend-design/references/app-polish.md +117 -0
  79. package/dist/resources/skills/builtin/frontend-design/references/apple-fluid.md +278 -0
  80. package/dist/resources/skills/builtin/frontend-design/references/art-direction.md +280 -0
  81. package/dist/resources/skills/builtin/frontend-design/references/case-studies.md +599 -0
  82. package/dist/resources/skills/builtin/frontend-design/references/craft.md +128 -0
  83. package/dist/resources/skills/builtin/frontend-design/references/expo.md +251 -0
  84. package/dist/resources/skills/builtin/frontend-design/references/layout-systems.md +533 -0
  85. package/dist/resources/skills/builtin/frontend-design/references/libraries.md +72 -0
  86. package/dist/resources/skills/builtin/frontend-design/references/motion.md +222 -0
  87. package/dist/resources/skills/builtin/frontend-design/references/picker.md +197 -0
  88. package/dist/resources/skills/builtin/frontend-design/references/plan-template.md +73 -0
  89. package/dist/resources/skills/builtin/frontend-design/references/prototype.md +85 -0
  90. package/dist/resources/skills/builtin/frontend-design/references/recipes-expo.md +385 -0
  91. package/dist/resources/skills/builtin/frontend-design/references/recipes-web.md +421 -0
  92. package/dist/resources/skills/builtin/frontend-design/references/review-audit.md +107 -0
  93. package/dist/resources/skills/builtin/frontend-design/references/sonner.md +143 -0
  94. package/dist/resources/skills/builtin/frontend-design/references/technical-stack.md +543 -0
  95. package/dist/resources/skills/builtin/frontend-design/references/theming.md +60 -0
  96. package/dist/resources/skills/builtin/frontend-design/references/typography.md +393 -0
  97. package/dist/resources/skills/builtin/frontend-design/references/ux-rules.md +256 -0
  98. package/dist/resources/skills/builtin/frontend-design/references/vocabulary.md +169 -0
  99. package/dist/resources/skills/builtin/frontend-design/scripts/core.py +993 -0
  100. package/dist/resources/skills/builtin/frontend-design/scripts/design_system.py +1643 -0
  101. package/dist/resources/skills/builtin/frontend-design/scripts/reasoning_contract.py +123 -0
  102. package/dist/resources/skills/builtin/frontend-design/scripts/search.py +171 -0
  103. package/dist/resources/skills/builtin/frontend-design/scripts/validate_data.py +1091 -0
  104. package/dist/resources/skills/builtin/kerja-agentik/SKILL.md +117 -0
  105. package/dist/resources/skills/builtin/pdf-maker/SKILL.md +51 -0
  106. package/dist/resources/skills/builtin/tinjau-keamanan/SKILL.md +53 -0
  107. package/dist/resources/skills/builtin/word-maker/SKILL.md +58 -0
  108. package/dist/resources/skills/builtin/write-swift/SKILL.md +388 -0
  109. package/package.json +35 -4
package/dist/bin.js ADDED
@@ -0,0 +1,1245 @@
1
+ #!/usr/bin/env node
2
+
3
+ // apps/cli/src/peluncur/bin.ts
4
+ var import_node_child_process5 = require("node:child_process");
5
+ var import_node_fs6 = require("node:fs");
6
+
7
+ // apps/vscode/src/bersama/runtime-salinan.ts
8
+ var import_node_crypto = require("node:crypto");
9
+ var import_node_fs2 = require("node:fs");
10
+ var import_node_path = require("node:path");
11
+
12
+ // apps/vscode/src/bersama/kunci-berkas.ts
13
+ var import_node_child_process = require("node:child_process");
14
+ var import_node_fs = require("node:fs");
15
+ var import_promises = require("node:fs/promises");
16
+ function detikUtcDariWmic(teks) {
17
+ const m = /^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.\d+([+-])(\d{3})$/.exec(teks.trim());
18
+ if (m === null) return null;
19
+ const [, th, bl, tg, j, mn, dt, tanda, selisih] = m;
20
+ const lokalMs = Date.UTC(Number(th), Number(bl) - 1, Number(tg), Number(j), Number(mn), Number(dt));
21
+ const menit = Number(selisih) * (tanda === "-" ? -1 : 1);
22
+ return String(Math.floor((lokalMs - menit * 6e4) / 1e3));
23
+ }
24
+ function detikUtcDariFiletime(teks) {
25
+ if (!/^\d+$/.test(teks.trim())) return null;
26
+ return String(Math.floor(Number(BigInt(teks.trim()) / 10000000n - 11644473600n)));
27
+ }
28
+ function jalankan(program, argumen, opsi2 = {}) {
29
+ return new Promise((selesai) => {
30
+ try {
31
+ (0, import_node_child_process.execFile)(program, argumen, { encoding: "utf8", timeout: 5e3, maxBuffer: 1024 * 1024, ...opsi2 }, (galat, stdout) => {
32
+ const keluarNonNol = galat !== null && typeof galat.code === "number" && galat.killed !== true;
33
+ selesai({ stdout: typeof stdout === "string" ? stdout : "", gagalJalan: galat !== null && !keluarNonNol });
34
+ });
35
+ } catch {
36
+ selesai({ stdout: "", gagalJalan: true });
37
+ }
38
+ });
39
+ }
40
+ async function waktuMulaiStabil(pid, platform = process.platform) {
41
+ try {
42
+ if (platform === "linux") {
43
+ const isi = await (0, import_promises.readFile)(`/proc/${String(pid)}/stat`, "utf8");
44
+ const mulai = isi.slice(isi.lastIndexOf(")") + 2).split(" ")[19];
45
+ return mulai !== void 0 && mulai.length > 0 ? mulai : null;
46
+ }
47
+ if (platform === "win32") {
48
+ const w = await jalankan("wmic", ["process", "where", `ProcessId=${String(pid)}`, "get", "CreationDate", "/value"], {
49
+ windowsHide: true
50
+ });
51
+ const cocok = /CreationDate=(\S+)/.exec(w.stdout);
52
+ if (cocok?.[1] !== void 0) return detikUtcDariWmic(cocok[1]);
53
+ if (!w.gagalJalan) return null;
54
+ const ps = await jalankan(
55
+ "powershell",
56
+ ["-NoProfile", "-NonInteractive", "-Command", `(Get-CimInstance Win32_Process -Filter "ProcessId=${String(pid)}").CreationDate.ToFileTimeUtc()`],
57
+ { windowsHide: true }
58
+ );
59
+ return detikUtcDariFiletime(ps.stdout);
60
+ }
61
+ const r = await jalankan("ps", ["-o", "lstart=", "-p", String(pid)], {
62
+ env: { ...process.env, LC_ALL: "C", LANG: "C", TZ: "UTC" }
63
+ });
64
+ const teks = r.stdout.trim();
65
+ return teks.length > 0 ? teks : null;
66
+ } catch {
67
+ return null;
68
+ }
69
+ }
70
+ var mulaiSendiri = null;
71
+ function waktuMulaiSendiri() {
72
+ mulaiSendiri ??= waktuMulaiStabil(process.pid).then((v) => {
73
+ if (v === null) mulaiSendiri = null;
74
+ return v;
75
+ });
76
+ return mulaiSendiri;
77
+ }
78
+ function bacaMulai(pid, o) {
79
+ if (o.waktuMulai !== void 0) return Promise.resolve(o.waktuMulai(pid));
80
+ if (pid === process.pid) return waktuMulaiSendiri();
81
+ return waktuMulaiStabil(pid);
82
+ }
83
+ function prosesHidup(pid) {
84
+ try {
85
+ process.kill(pid, 0);
86
+ return true;
87
+ } catch (e) {
88
+ return e.code === "EPERM";
89
+ }
90
+ }
91
+ async function pemegangHidup(isi, o = {}) {
92
+ const hidup = o.hidup ?? prosesHidup;
93
+ if (!hidup(isi.pid)) return false;
94
+ if (isi.mulai === null) return true;
95
+ const kini = await bacaMulai(isi.pid, o);
96
+ return kini === null || kini === isi.mulai;
97
+ }
98
+ function bacaIsi(path) {
99
+ try {
100
+ const x = JSON.parse((0, import_node_fs.readFileSync)(path, "utf8"));
101
+ if (typeof x.pid !== "number") return null;
102
+ return { pid: x.pid, mulai: typeof x.mulai === "string" ? x.mulai : null };
103
+ } catch {
104
+ return null;
105
+ }
106
+ }
107
+ function umurMs(path) {
108
+ try {
109
+ return Date.now() - (0, import_node_fs.statSync)(path).mtimeMs;
110
+ } catch {
111
+ return Number.POSITIVE_INFINITY;
112
+ }
113
+ }
114
+ async function ambilKunci(path, o = {}) {
115
+ const pid = o.pidSendiri ?? process.pid;
116
+ const mulai = await bacaMulai(pid, o);
117
+ for (let coba = 0; coba < 2; coba += 1) {
118
+ try {
119
+ const fd = (0, import_node_fs.openSync)(path, "wx", 384);
120
+ try {
121
+ (0, import_node_fs.writeSync)(fd, JSON.stringify({ pid, mulai }));
122
+ } finally {
123
+ (0, import_node_fs.closeSync)(fd);
124
+ }
125
+ return true;
126
+ } catch (e) {
127
+ if (e.code !== "EEXIST") throw e;
128
+ const isi = bacaIsi(path);
129
+ if (isi !== null && isi.pid === pid) return true;
130
+ if (isi !== null && await pemegangHidup(isi, o)) return false;
131
+ if (isi === null && umurMs(path) < 2e3) return false;
132
+ const lagi = bacaIsi(path);
133
+ if (JSON.stringify(lagi) !== JSON.stringify(isi)) return false;
134
+ try {
135
+ (0, import_node_fs.unlinkSync)(path);
136
+ } catch {
137
+ }
138
+ }
139
+ }
140
+ return false;
141
+ }
142
+ function lepasKunci(path, pidSendiri = process.pid) {
143
+ const isi = bacaIsi(path);
144
+ if (isi === null || isi.pid !== pidSendiri) return;
145
+ try {
146
+ (0, import_node_fs.unlinkSync)(path);
147
+ } catch {
148
+ }
149
+ }
150
+
151
+ // apps/vscode/src/bersama/runtime-salinan.ts
152
+ function idBuildDari(versi, dirDist, berkas) {
153
+ const h = (0, import_node_crypto.createHash)("sha256");
154
+ for (const n of berkas) h.update((0, import_node_fs2.readFileSync)((0, import_node_path.join)(dirDist, n)));
155
+ return `${versi}+${h.digest("hex").slice(0, 12)}`;
156
+ }
157
+ function salinRekursif(dari, ke) {
158
+ const st = (0, import_node_fs2.statSync)(dari);
159
+ if (st.isDirectory()) {
160
+ (0, import_node_fs2.mkdirSync)(ke, { recursive: true });
161
+ for (const n of (0, import_node_fs2.readdirSync)(dari)) salinRekursif((0, import_node_path.join)(dari, n), (0, import_node_path.join)(ke, n));
162
+ } else {
163
+ (0, import_node_fs2.copyFileSync)(dari, ke);
164
+ }
165
+ }
166
+ function siapkanRuntimeDari(dirDist, dirRuntime, build2, isi) {
167
+ const tujuan = (0, import_node_path.join)(dirRuntime, build2);
168
+ if ((0, import_node_fs2.existsSync)((0, import_node_path.join)(tujuan, ".lengkap"))) return tujuan;
169
+ (0, import_node_fs2.mkdirSync)(dirRuntime, { recursive: true, mode: 448 });
170
+ const sementara = `${tujuan}.tmp-${String(process.pid)}`;
171
+ (0, import_node_fs2.rmSync)(sementara, { recursive: true, force: true });
172
+ (0, import_node_fs2.mkdirSync)(sementara, { recursive: true, mode: 448 });
173
+ for (const n of isi) salinRekursif((0, import_node_path.join)(dirDist, n), (0, import_node_path.join)(sementara, n));
174
+ (0, import_node_fs2.writeFileSync)((0, import_node_path.join)(sementara, ".lengkap"), build2);
175
+ try {
176
+ (0, import_node_fs2.rmSync)(tujuan, { recursive: true, force: true });
177
+ (0, import_node_fs2.renameSync)(sementara, tujuan);
178
+ } catch (e) {
179
+ (0, import_node_fs2.rmSync)(sementara, { recursive: true, force: true });
180
+ if (!(0, import_node_fs2.existsSync)((0, import_node_path.join)(tujuan, ".lengkap"))) throw e;
181
+ }
182
+ return tujuan;
183
+ }
184
+ function bersihkanRuntimeLamaDi(dirRuntime, build2) {
185
+ let isi;
186
+ try {
187
+ isi = (0, import_node_fs2.readdirSync)(dirRuntime);
188
+ } catch {
189
+ return;
190
+ }
191
+ for (const n of isi) {
192
+ if (n === build2) continue;
193
+ (0, import_node_fs2.rmSync)((0, import_node_path.join)(dirRuntime, n), { recursive: true, force: true });
194
+ }
195
+ }
196
+ function bacaJson(path) {
197
+ try {
198
+ return JSON.parse((0, import_node_fs2.readFileSync)(path, "utf8"));
199
+ } catch {
200
+ return null;
201
+ }
202
+ }
203
+ async function bacaPemegangHidup(berkas) {
204
+ const info = bacaJson(berkas.info);
205
+ const kunci = bacaJson(berkas.kunci);
206
+ if (info === null || kunci === null || typeof info.pid !== "number" || info.pid !== kunci.pid) return null;
207
+ if (!await pemegangHidup({ pid: kunci.pid, mulai: typeof kunci.mulai === "string" ? kunci.mulai : null })) return null;
208
+ let token;
209
+ try {
210
+ token = (0, import_node_fs2.readFileSync)(berkas.token, "utf8").trim();
211
+ } catch {
212
+ return null;
213
+ }
214
+ return token.length > 0 ? { info, token } : null;
215
+ }
216
+ var tunda = (ms) => new Promise((r) => setTimeout(r, ms));
217
+ function prosesHidup2(pid) {
218
+ try {
219
+ process.kill(pid, 0);
220
+ return true;
221
+ } catch (e) {
222
+ return e.code === "EPERM";
223
+ }
224
+ }
225
+ async function tungguMati(pid, batasMs) {
226
+ const akhir = Date.now() + batasMs;
227
+ while (Date.now() < akhir) {
228
+ if (!prosesHidup2(pid)) return true;
229
+ await tunda(100);
230
+ }
231
+ return !prosesHidup2(pid);
232
+ }
233
+ async function hentikanPaksa(pid) {
234
+ for (const [sinyal, tunggu] of [
235
+ ["SIGTERM", 5e3],
236
+ ["SIGKILL", 5e3]
237
+ ]) {
238
+ try {
239
+ process.kill(pid, sinyal);
240
+ } catch {
241
+ return true;
242
+ }
243
+ if (await tungguMati(pid, tunggu)) return true;
244
+ }
245
+ return false;
246
+ }
247
+ function rotasiLog(path) {
248
+ try {
249
+ if ((0, import_node_fs2.statSync)(path).size > 5 * 1024 * 1024) (0, import_node_fs2.renameSync)(path, `${path}.1`);
250
+ } catch {
251
+ }
252
+ }
253
+ function ekorLog(path) {
254
+ try {
255
+ const isi = (0, import_node_fs2.readFileSync)(path, "utf8");
256
+ return isi.slice(-2e3);
257
+ } catch {
258
+ return "";
259
+ }
260
+ }
261
+
262
+ // apps/cli/src/bersama/jalur-cli.ts
263
+ var import_node_os2 = require("node:os");
264
+ var import_node_path4 = require("node:path");
265
+
266
+ // apps/vscode/src/bersama/jalur-host.ts
267
+ var import_node_path3 = require("node:path");
268
+
269
+ // packages/core/src/util/paths.ts
270
+ var import_node_os = require("node:os");
271
+ var import_node_path2 = require("node:path");
272
+ function expandHome(p) {
273
+ if (p === "~") return (0, import_node_os.homedir)();
274
+ if (p.startsWith("~/") || p.startsWith("~\\")) return (0, import_node_path2.join)((0, import_node_os.homedir)(), p.slice(2));
275
+ return p;
276
+ }
277
+
278
+ // apps/vscode/src/bersama/jalur-host.ts
279
+ function dasarVibecode(home) {
280
+ const env = process.env["VIBECODE_HOME"];
281
+ return env !== void 0 && env.length > 0 ? (0, import_node_path3.resolve)(expandHome(env)) : (0, import_node_path3.join)(home, ".vibecode");
282
+ }
283
+
284
+ // apps/cli/src/bersama/jalur-cli.ts
285
+ function jalurCli(home = (0, import_node_os2.homedir)()) {
286
+ const dir = (0, import_node_path4.join)(dasarVibecode(home), "cli");
287
+ return {
288
+ dir,
289
+ data: (0, import_node_path4.join)(dir, "data"),
290
+ kunci: (0, import_node_path4.join)(dir, "daemon.kunci"),
291
+ kunciPeluncur: (0, import_node_path4.join)(dir, "peluncur.kunci"),
292
+ info: (0, import_node_path4.join)(dir, "daemon.json"),
293
+ token: (0, import_node_path4.join)(dir, "daemon.token"),
294
+ log: (0, import_node_path4.join)(dir, "daemon.log"),
295
+ runtime: (0, import_node_path4.join)(dir, "runtime"),
296
+ petaId: (0, import_node_path4.join)(dir, "data", "v2-ids.jsonl"),
297
+ catatanSesi: (0, import_node_path4.join)(dir, "data", "v2-catatan.jsonl"),
298
+ kunciInduk: (0, import_node_path4.join)(dir, "master.key"),
299
+ kunciIndukLokasi: (0, import_node_path4.join)(dir, "master.key.where")
300
+ };
301
+ }
302
+
303
+ // apps/cli/src/peluncur/argumen.ts
304
+ var import_node_path5 = require("node:path");
305
+ var BERNILAI = /* @__PURE__ */ new Set(["--server", "--password-file", "--launcher", "-s", "--session", "--prompt", "-m", "--model", "--agent"]);
306
+ var MILIK_PELUNCUR = /* @__PURE__ */ new Set(["--server", "--password-file", "--launcher"]);
307
+ function susunArgumenTui(argv, cwd, folderAda) {
308
+ const argumen = [];
309
+ let posisional;
310
+ for (let i = 0; i < argv.length; i++) {
311
+ const arg = argv[i];
312
+ const samaDengan = arg.startsWith("--") ? arg.indexOf("=") : -1;
313
+ const opsi2 = samaDengan === -1 ? arg : arg.slice(0, samaDengan);
314
+ if (MILIK_PELUNCUR.has(opsi2)) return { galat: `${opsi2} is set by vibecode itself` };
315
+ if (BERNILAI.has(opsi2)) {
316
+ argumen.push(arg);
317
+ if (samaDengan === -1 && i + 1 < argv.length) argumen.push(argv[++i]);
318
+ continue;
319
+ }
320
+ if (!arg.startsWith("-") && posisional === void 0) {
321
+ posisional = arg;
322
+ continue;
323
+ }
324
+ argumen.push(arg);
325
+ }
326
+ const direktori = posisional === void 0 ? cwd : (0, import_node_path5.resolve)(cwd, posisional);
327
+ if (!folderAda(direktori)) return { galat: `Directory not found: ${direktori}` };
328
+ return { direktori, argumen: [...argumen, direktori] };
329
+ }
330
+
331
+ // apps/cli/src/peluncur/akun.ts
332
+ var import_node_http = require("node:http");
333
+ var import_node_readline = require("node:readline");
334
+
335
+ // packages/protocol/src/kredit-tampil.ts
336
+ var MIKRO_PER_KREDIT = 1e6;
337
+
338
+ // apps/cli/src/bersama/rute-akun.ts
339
+ var JALUR_MASUK = "/vibecode/akun/masuk";
340
+ var JALUR_KELUAR = "/vibecode/akun/keluar";
341
+ var JALUR_STATUS = "/vibecode/akun/status";
342
+
343
+ // apps/cli/src/peluncur/akun.ts
344
+ function olahKetikan(teks, potongan) {
345
+ let t = teks;
346
+ for (let i = 0; i < potongan.length; i++) {
347
+ const c = potongan[i];
348
+ if (c === "\r" || c === "\n") return { teks: t, akhir: "selesai" };
349
+ if (c === "") return { teks: "", akhir: "batal" };
350
+ if (c === "") {
351
+ if (t === "") return { teks: "", akhir: "batal" };
352
+ continue;
353
+ }
354
+ if (c === "\x7F" || c === "\b") {
355
+ t = Array.from(t).slice(0, -1).join("");
356
+ continue;
357
+ }
358
+ if (c === "") {
359
+ t = "";
360
+ continue;
361
+ }
362
+ if (c === "\x1B") {
363
+ const n = potongan[i + 1];
364
+ if (n === "[" || n === "O") {
365
+ i += 2;
366
+ while (i < potongan.length && !/[@-~]/.test(potongan[i])) i++;
367
+ }
368
+ continue;
369
+ }
370
+ if (c < " ") continue;
371
+ t += c;
372
+ }
373
+ return { teks: t };
374
+ }
375
+ function bacaRahasia(tanya, masuk = process.stdin, keluar = process.stdout) {
376
+ keluar.write(tanya);
377
+ if (!masuk.isTTY) {
378
+ return barisPertama(masuk).then((b) => {
379
+ keluar.write("\n");
380
+ return b;
381
+ });
382
+ }
383
+ return new Promise((selesai) => {
384
+ let teks = "";
385
+ masuk.setRawMode(true);
386
+ masuk.setEncoding("utf8");
387
+ masuk.resume();
388
+ const saat = (d) => {
389
+ const h = olahKetikan(teks, typeof d === "string" ? d : d.toString("utf8"));
390
+ teks = h.teks;
391
+ if (h.akhir === void 0) return;
392
+ masuk.off("data", saat);
393
+ masuk.setRawMode(false);
394
+ masuk.pause();
395
+ keluar.write("\n");
396
+ selesai(h.akhir === "selesai" ? teks : null);
397
+ };
398
+ masuk.on("data", saat);
399
+ });
400
+ }
401
+ function barisPertama(masuk) {
402
+ return new Promise((selesai) => {
403
+ const rl = (0, import_node_readline.createInterface)({ input: masuk, terminal: false });
404
+ let dapat = false;
405
+ rl.once("line", (baris) => {
406
+ dapat = true;
407
+ rl.close();
408
+ selesai(baris);
409
+ });
410
+ rl.once("close", () => {
411
+ if (!dapat) selesai(null);
412
+ });
413
+ });
414
+ }
415
+ function tanyaBaris(tanya, masuk = process.stdin, keluar = process.stdout) {
416
+ return new Promise((selesai) => {
417
+ const tty = masuk.isTTY === true;
418
+ const rl = (0, import_node_readline.createInterface)({ input: masuk, output: keluar, terminal: tty });
419
+ let dapat = false;
420
+ rl.question(tanya, (jawab) => {
421
+ dapat = true;
422
+ rl.close();
423
+ selesai(jawab);
424
+ });
425
+ rl.once("close", () => {
426
+ if (!tty) keluar.write("\n");
427
+ if (!dapat) selesai(null);
428
+ });
429
+ });
430
+ }
431
+ function mintaDaemon(port, token, metode, jalur, badan) {
432
+ return new Promise((selesai, gagal) => {
433
+ const teks = badan === void 0 ? void 0 : JSON.stringify(badan);
434
+ const req = (0, import_node_http.request)(
435
+ {
436
+ host: "127.0.0.1",
437
+ port,
438
+ method: metode,
439
+ path: jalur,
440
+ headers: {
441
+ authorization: `Basic ${Buffer.from(`vibecode:${token}`).toString("base64")}`,
442
+ ...teks !== void 0 ? { "content-type": "application/json", "content-length": Buffer.byteLength(teks) } : {}
443
+ }
444
+ },
445
+ (res) => {
446
+ let isi = "";
447
+ res.setEncoding("utf8");
448
+ res.on("data", (d) => isi += d);
449
+ res.on("end", () => {
450
+ let data = {};
451
+ try {
452
+ const j = JSON.parse(isi);
453
+ if (typeof j === "object" && j !== null) data = j;
454
+ } catch {
455
+ }
456
+ selesai({ status: res.statusCode ?? 0, data });
457
+ });
458
+ }
459
+ );
460
+ req.on("error", gagal);
461
+ if (teks !== void 0) req.write(teks);
462
+ req.end();
463
+ });
464
+ }
465
+ function teksCredit(mikro) {
466
+ const kredit = mikro / MIKRO_PER_KREDIT;
467
+ const teks = kredit >= 1 ? kredit.toLocaleString("en-US", { maximumFractionDigits: 2 }) : kredit.toLocaleString("en-US", { maximumSignificantDigits: 3 });
468
+ return `$${teks} Credit`;
469
+ }
470
+ var NAMA_PAKET = { free: "Free", lite: "Lite", pro: "Pro", max: "Max" };
471
+ function teksStatus(s, d) {
472
+ const baris = [];
473
+ if (s.akun === null) baris.push(["Account", "Unknown (could not read the sign-in state)"]);
474
+ else if (!s.akun.tersedia) baris.push(["Account", "Not available in this build"]);
475
+ else if (!s.akun.masuk) baris.push(["Account", "Not signed in (run `vibecode login`, or use /connect in VibeCode)"]);
476
+ else baris.push(["Account", `${s.akun.email ?? "Signed in"}${s.paket !== null ? ` \xB7 ${NAMA_PAKET[s.paket]} plan` : ""}`]);
477
+ if (s.creditMikro !== null) baris.push(["Credit", teksCredit(s.creditMikro)]);
478
+ if (s.kunciOpenRouter !== null) {
479
+ baris.push(["OpenRouter", s.kunciOpenRouter === 0 ? "No keys" : `${s.kunciOpenRouter} key${s.kunciOpenRouter === 1 ? "" : "s"}`]);
480
+ }
481
+ baris.push(["Local endpoint", s.urlLokal ?? "Not set"]);
482
+ baris.push(["Daemon", `running \xB7 pid ${d.pid} \xB7 port ${d.port} \xB7 v${d.versi}`]);
483
+ const lebar = Math.max(...baris.map(([k]) => k.length));
484
+ return baris.map(([k, v]) => `${k.padEnd(lebar)} ${v}`).join("\n");
485
+ }
486
+ function pesanGalat(j) {
487
+ return typeof j.data["message"] === "string" ? j.data["message"] : `The VibeCode daemon answered ${j.status}.`;
488
+ }
489
+ function opsi(argv, nama) {
490
+ for (let i = 0; i < argv.length; i++) {
491
+ const a = argv[i];
492
+ if (a === nama) return argv[i + 1];
493
+ if (a.startsWith(`${nama}=`)) return a.slice(nama.length + 1);
494
+ }
495
+ return void 0;
496
+ }
497
+ async function perintahLogin(argv, d) {
498
+ const email = (opsi(argv, "--email") ?? await d.tanya("Email: ") ?? "").trim();
499
+ if (email === "") {
500
+ d.tulisGalat("Email is empty.");
501
+ return 2;
502
+ }
503
+ const sandi = await d.rahasia("Password: ");
504
+ if (sandi === null) {
505
+ d.tulisGalat("Cancelled.");
506
+ return 130;
507
+ }
508
+ const { port, token } = await d.sambung();
509
+ const j = await d.minta(port, token, "POST", JALUR_MASUK, { email, sandi });
510
+ if (j.status !== 200) {
511
+ d.tulisGalat(pesanGalat(j));
512
+ return 1;
513
+ }
514
+ d.tulis(`Signed in as ${typeof j.data["email"] === "string" ? j.data["email"] : email}.`);
515
+ return 0;
516
+ }
517
+ async function perintahLogout(d) {
518
+ const { port, token } = await d.sambung();
519
+ const j = await d.minta(port, token, "POST", JALUR_KELUAR);
520
+ if (j.status !== 200) {
521
+ d.tulisGalat(pesanGalat(j));
522
+ return 1;
523
+ }
524
+ d.tulis(j.data["keluar"] === true ? "Signed out. Running VibeCode sessions were stopped." : "You were not signed in.");
525
+ return 0;
526
+ }
527
+ async function perintahStatus(d) {
528
+ const { port, token, info } = await d.sambung();
529
+ const j = await d.minta(port, token, "GET", JALUR_STATUS);
530
+ if (j.status !== 200) {
531
+ d.tulisGalat(pesanGalat(j));
532
+ return 1;
533
+ }
534
+ d.tulis(teksStatus(j.data, info));
535
+ return 0;
536
+ }
537
+
538
+ // apps/cli/src/peluncur/biner-tui.ts
539
+ var import_node_child_process2 = require("node:child_process");
540
+ var import_node_fs3 = require("node:fs");
541
+ var import_node_path6 = require("node:path");
542
+ function osTui(platform) {
543
+ return platform === "darwin" ? "darwin" : platform === "linux" ? "linux" : platform === "win32" ? "windows" : null;
544
+ }
545
+ function namaPaketTui(o) {
546
+ const dasar = `${o.awalan}-${o.os}-${o.arch}`;
547
+ const baseline = o.arch === "x64" && !o.avx2;
548
+ if (o.os === "linux") {
549
+ if (o.musl) {
550
+ if (o.arch !== "x64") return [`${dasar}-musl`, dasar];
551
+ return baseline ? [`${dasar}-baseline-musl`, `${dasar}-musl`, `${dasar}-baseline`, dasar] : [`${dasar}-musl`, `${dasar}-baseline-musl`, dasar, `${dasar}-baseline`];
552
+ }
553
+ if (o.arch !== "x64") return [dasar, `${dasar}-musl`];
554
+ return baseline ? [`${dasar}-baseline`, dasar, `${dasar}-baseline-musl`, `${dasar}-musl`] : [dasar, `${dasar}-baseline`, `${dasar}-musl`, `${dasar}-baseline-musl`];
555
+ }
556
+ if (o.arch !== "x64") return [dasar];
557
+ return baseline ? [`${dasar}-baseline`, dasar] : [dasar, `${dasar}-baseline`];
558
+ }
559
+ function cariBinerTui(mulai, paket, biner, ada) {
560
+ let dir = mulai;
561
+ for (; ; ) {
562
+ const nm = (0, import_node_path6.join)(dir, "node_modules");
563
+ if (ada(nm)) {
564
+ for (const n of paket) {
565
+ const calon = (0, import_node_path6.join)(nm, n, "bin", biner);
566
+ if (ada(calon)) return calon;
567
+ }
568
+ }
569
+ const atas = (0, import_node_path6.dirname)(dir);
570
+ if (atas === dir) return null;
571
+ dir = atas;
572
+ }
573
+ }
574
+ function adaAvx2(platform, arch) {
575
+ if (arch !== "x64") return false;
576
+ try {
577
+ if (platform === "linux") return /(^|\s)avx2(\s|$)/i.test((0, import_node_fs3.readFileSync)("/proc/cpuinfo", "utf8"));
578
+ if (platform === "darwin") {
579
+ const r = (0, import_node_child_process2.spawnSync)("sysctl", ["-n", "hw.optional.avx2_0"], { encoding: "utf8", timeout: 1500 });
580
+ return r.status === 0 && r.stdout.trim() === "1";
581
+ }
582
+ if (platform === "win32") {
583
+ const skrip = '(Add-Type -MemberDefinition "[DllImport(""kernel32.dll"")] public static extern bool IsProcessorFeaturePresent(int ProcessorFeature);" -Name Kernel32 -Namespace Win32 -PassThru)::IsProcessorFeaturePresent(40)';
584
+ const r = (0, import_node_child_process2.spawnSync)("powershell.exe", ["-NoProfile", "-NonInteractive", "-Command", skrip], { encoding: "utf8", timeout: 3e3, windowsHide: true });
585
+ return r.status === 0 && ["true", "1"].includes(r.stdout.trim().toLowerCase());
586
+ }
587
+ } catch {
588
+ }
589
+ return false;
590
+ }
591
+ function adaMusl(platform, ada) {
592
+ if (platform !== "linux") return false;
593
+ if (ada("/etc/alpine-release")) return true;
594
+ try {
595
+ const r = (0, import_node_child_process2.spawnSync)("ldd", ["--version"], { encoding: "utf8", timeout: 1500 });
596
+ return `${r.stdout}${r.stderr}`.toLowerCase().includes("musl");
597
+ } catch {
598
+ return false;
599
+ }
600
+ }
601
+
602
+ // apps/cli/src/peluncur/daemon.ts
603
+ var import_node_child_process3 = require("node:child_process");
604
+ var import_node_fs4 = require("node:fs");
605
+ var import_node_http2 = require("node:http");
606
+ var import_node_os3 = require("node:os");
607
+ var import_node_path7 = require("node:path");
608
+
609
+ // apps/vscode/src/extension/versi.ts
610
+ function bandingkanVersi(a, b) {
611
+ const urai = (v) => v.trim().replace(/^v/i, "").split("-")[0].split(".").map((x2) => {
612
+ const n = Number.parseInt(x2, 10);
613
+ return Number.isFinite(n) ? n : 0;
614
+ });
615
+ const x = urai(a);
616
+ const y = urai(b);
617
+ for (let i = 0; i < Math.max(x.length, y.length, 3); i += 1) {
618
+ const d = (x[i] ?? 0) - (y[i] ?? 0);
619
+ if (d !== 0) return d;
620
+ }
621
+ return 0;
622
+ }
623
+
624
+ // apps/cli/src/bersama/rute-daemon.ts
625
+ var JALUR_BERHENTI = "/vibecode/daemon/berhenti";
626
+ var JALUR_IMPOR_DESKTOP = "/vibecode/daemon/impor-desktop";
627
+
628
+ // apps/cli/src/peluncur/daemon.ts
629
+ var ISI_RUNTIME_CLI = ["daemon.js", "agen.js", "node_modules", "resources"];
630
+ var BERKAS_SIDIK_CLI = ["daemon.js", "agen.js"];
631
+ function idBuildCli(versi, dirDist) {
632
+ return idBuildDari(versi, dirDist, BERKAS_SIDIK_CLI);
633
+ }
634
+ function daemonMenjawab(port, sandi, batasMs = 2e3) {
635
+ return new Promise((selesai) => {
636
+ const req = (0, import_node_http2.get)(
637
+ {
638
+ host: "127.0.0.1",
639
+ port,
640
+ path: "/api/info",
641
+ headers: { authorization: `Basic ${Buffer.from(`vibecode:${sandi}`).toString("base64")}` },
642
+ timeout: batasMs
643
+ },
644
+ (res) => {
645
+ res.resume();
646
+ selesai(res.statusCode === 200);
647
+ }
648
+ );
649
+ req.on("timeout", () => req.destroy());
650
+ req.on("error", () => selesai(false));
651
+ });
652
+ }
653
+ async function bacaDaemonHidup(jalur, menjawab = daemonMenjawab) {
654
+ const h = await bacaPemegangHidup(jalur);
655
+ if (h === null || typeof h.info.port !== "number" || typeof h.info.versi !== "string") return null;
656
+ return await menjawab(h.info.port, h.token) ? h : null;
657
+ }
658
+ function putusanDaemon(versiHidup, build2) {
659
+ if (versiHidup === build2) return "pakai";
660
+ return bandingkanVersi(build2, versiHidup) < 0 ? "pakai-lebih-baru" : "ganti";
661
+ }
662
+ function mintaDaemonBerhenti(d, paksa, batasMs = 1e4) {
663
+ return new Promise((selesai, gagal) => {
664
+ const badan = JSON.stringify({ paksa });
665
+ const req = (0, import_node_http2.request)(
666
+ {
667
+ host: "127.0.0.1",
668
+ port: d.info.port,
669
+ method: "POST",
670
+ path: JALUR_BERHENTI,
671
+ timeout: batasMs,
672
+ headers: {
673
+ authorization: `Basic ${Buffer.from(`vibecode:${d.token}`).toString("base64")}`,
674
+ "content-type": "application/json",
675
+ "content-length": Buffer.byteLength(badan)
676
+ }
677
+ },
678
+ (res) => {
679
+ let isi = "";
680
+ res.setEncoding("utf8");
681
+ res.on("data", (x) => isi += x);
682
+ res.on("end", () => {
683
+ try {
684
+ const j = JSON.parse(isi);
685
+ selesai({ ok: j.ok === true, ...j.status !== void 0 ? { status: j.status } : {} });
686
+ } catch {
687
+ gagal(new Error(`The VibeCode background service answered ${String(res.statusCode)}.`));
688
+ }
689
+ });
690
+ }
691
+ );
692
+ req.on("timeout", () => req.destroy(new Error("The VibeCode background service did not answer the stop request.")));
693
+ req.on("error", gagal);
694
+ req.end(badan);
695
+ });
696
+ }
697
+ function teksPekerjaan(s) {
698
+ const bagian = [];
699
+ const sesi = s?.sesiSibuk ?? 0;
700
+ if (sesi > 0) bagian.push(`${sesi} session${sesi === 1 ? "" : "s"} working`);
701
+ if (s?.prosesLatar === true) bagian.push("background processes");
702
+ const term = s?.terminalHidup ?? 0;
703
+ if (term > 0) bagian.push(`${term} running shell command${term === 1 ? "" : "s"}`);
704
+ return bagian.length > 0 ? bagian.join(", ") : "work in progress";
705
+ }
706
+ var tunda2 = (ms) => new Promise((r) => setTimeout(r, ms));
707
+ function sambungan(h, catatan) {
708
+ return { ...h, url: `http://127.0.0.1:${String(h.info.port)}`, ...catatan !== void 0 ? { catatan } : {} };
709
+ }
710
+ async function pastikanDaemon(o) {
711
+ const baca = o.baca ?? ((j) => bacaDaemonHidup(j));
712
+ const berhenti = o.berhenti ?? mintaDaemonBerhenti;
713
+ const luncur = o.luncurkan ?? luncurkan;
714
+ const mati = o.tungguMati ?? tungguMati;
715
+ const kunci = o.kunciPeluncur ?? { ambil: (p) => ambilKunci(p), lepas: (p) => lepasKunci(p) };
716
+ (0, import_node_fs4.mkdirSync)(o.jalur.dir, { recursive: true, mode: 448 });
717
+ const akhir = Date.now() + (o.batasMs ?? 6e4);
718
+ let sudahMinta = false;
719
+ while (Date.now() < akhir) {
720
+ const h = await baca(o.jalur);
721
+ if (h !== null) {
722
+ const p = putusanDaemon(h.info.versi, o.build);
723
+ if (p === "pakai") return sambungan(h);
724
+ const versi = h.info.versi.split("+")[0];
725
+ if (p === "pakai-lebih-baru") return sambungan(h, `A newer VibeCode background service (${versi}) is running; using it.`);
726
+ if (o.bolehGanti === false) return sambungan(h);
727
+ if (sudahMinta) return sambungan(h, `The previous VibeCode background service (${versi}) did not stop; using it.`);
728
+ sudahMinta = true;
729
+ let r;
730
+ try {
731
+ r = await berhenti(h, false);
732
+ } catch {
733
+ return sambungan(h, `The VibeCode background service ${versi} did not answer; using it. Run \`vibecode daemon restart\` to switch.`);
734
+ }
735
+ if (!r.ok) {
736
+ return sambungan(
737
+ h,
738
+ `VibeCode was updated, but the background service ${versi} is still busy (${teksPekerjaan(r.status)}); this terminal uses it. Run \`vibecode daemon restart\` when it is done to switch to the new version.`
739
+ );
740
+ }
741
+ if (!await mati(h.info.pid, 15e3)) return sambungan(h, `The VibeCode background service ${versi} did not stop; using it.`);
742
+ continue;
743
+ }
744
+ if (!await kunci.ambil(o.jalur.kunciPeluncur)) {
745
+ await tunda2(250);
746
+ continue;
747
+ }
748
+ try {
749
+ if (await baca(o.jalur) === null) await luncur(o);
750
+ } finally {
751
+ kunci.lepas(o.jalur.kunciPeluncur);
752
+ }
753
+ const hidup = await baca(o.jalur);
754
+ if (hidup !== null && hidup.info.versi === o.build) {
755
+ try {
756
+ bersihkanRuntimeLamaDi(o.jalur.runtime, o.build);
757
+ } catch {
758
+ }
759
+ }
760
+ }
761
+ throw new Error(`The VibeCode background service could not be started. See ${o.jalur.log}`);
762
+ }
763
+ async function luncurkan(o) {
764
+ const runtime = siapkanRuntimeDari(o.dirDist, o.jalur.runtime, o.build, ISI_RUNTIME_CLI);
765
+ (0, import_node_fs4.mkdirSync)(o.jalur.dir, { recursive: true, mode: 448 });
766
+ rotasiLog(o.jalur.log);
767
+ const fd = (0, import_node_fs4.openSync)(o.jalur.log, "a", 384);
768
+ const kunciInduk2 = await o.kunciInduk();
769
+ const anak = (0, import_node_child_process3.spawn)(o.node, [(0, import_node_path7.join)(runtime, "daemon.js")], {
770
+ cwd: (0, import_node_os3.homedir)(),
771
+ detached: true,
772
+ stdio: ["pipe", fd, fd],
773
+ windowsHide: true,
774
+ env: { ...process.env, ELECTRON_RUN_AS_NODE: "1" }
775
+ });
776
+ (0, import_node_fs4.closeSync)(fd);
777
+ let keluar = null;
778
+ anak.on("exit", (kode) => {
779
+ keluar = kode ?? -1;
780
+ });
781
+ anak.on("error", () => {
782
+ keluar = -1;
783
+ });
784
+ anak.stdin?.end(`${JSON.stringify({ kunciInduk: kunciInduk2, versi: o.build, varian: "cli", dirRuntime: runtime })}
785
+ `);
786
+ anak.unref();
787
+ const baca = o.baca ?? ((j) => bacaDaemonHidup(j));
788
+ const akhir = Date.now() + 3e4;
789
+ while (Date.now() < akhir) {
790
+ if (await baca(o.jalur) !== null) return;
791
+ if (keluar !== null && keluar !== 0) {
792
+ throw new Error(`The VibeCode background service exited with code ${String(keluar)}.
793
+ ${ekorLog(o.jalur.log)}`);
794
+ }
795
+ await tunda2(150);
796
+ }
797
+ throw new Error(`The VibeCode background service was not ready within 30 seconds.
798
+ ${ekorLog(o.jalur.log)}`);
799
+ }
800
+
801
+ // apps/cli/src/peluncur/kunci-induk.ts
802
+ var import_node_child_process4 = require("node:child_process");
803
+ var import_node_crypto2 = require("node:crypto");
804
+ var import_node_fs5 = require("node:fs");
805
+ var import_node_path8 = require("node:path");
806
+ var POLA_KUNCI = /^[0-9a-f]{64}$/;
807
+ var LAYANAN = "VibeCode CLI";
808
+ function akunBrankas(dirCli) {
809
+ return `master-key-${(0, import_node_crypto2.createHash)("sha256").update(dirCli).digest("hex").slice(0, 12)}`;
810
+ }
811
+ var GalatBrankas = class extends Error {
812
+ };
813
+ function kutipSecurity(x) {
814
+ return `"${x.replace(/[\\"]/g, (c) => `\\${c}`)}"`;
815
+ }
816
+ function brankasMac(jalankan2, akun, keychain) {
817
+ const ekor = keychain !== void 0 ? [keychain] : [];
818
+ return {
819
+ nama: "macOS keychain",
820
+ baca: async () => {
821
+ const r = await jalankan2("/usr/bin/security", ["find-generic-password", "-s", LAYANAN, "-a", akun, "-w", ...ekor]);
822
+ if (r.kode === 0) return r.keluaran.trim();
823
+ if (r.kode === 44) return null;
824
+ if (r.habisWaktu === true) {
825
+ throw new GalatBrankas("the keychain did not answer in time; it may be locked and waiting for an unlock prompt. Unlock it with `security unlock-keychain` and try again.");
826
+ }
827
+ throw new GalatBrankas(
828
+ r.kode === 152 || /interaction is not allowed/i.test(r.galat) ? "the keychain is locked (for example in an SSH session). Unlock it with `security unlock-keychain` and try again." : r.galat.trim() || `security exited with code ${String(r.kode)}`
829
+ );
830
+ },
831
+ simpan: async (nilai) => {
832
+ if (keychain === void 0) {
833
+ const d = await jalankan2("/usr/bin/security", ["default-keychain"]);
834
+ if (d.kode !== 0 || d.keluaran.trim() === "") throw new GalatBrankas(d.galat.trim() || "no default keychain");
835
+ }
836
+ const baris = ["add-generic-password", "-U", "-s", LAYANAN, "-a", akun, "-w", nilai, ...ekor].map(kutipSecurity).join(" ");
837
+ await jalankan2("/usr/bin/security", ["-i"], `${baris}
838
+ `);
839
+ }
840
+ };
841
+ }
842
+ function brankasLinux(jalankan2, akun) {
843
+ const atribut = ["service", "vibecode-cli", "account", akun];
844
+ return {
845
+ nama: "Secret Service keyring",
846
+ baca: async () => {
847
+ const r = await jalankan2("secret-tool", ["lookup", ...atribut]);
848
+ if (r.kode === 0 && r.keluaran.trim() !== "") return r.keluaran.trim();
849
+ if (r.kode === 1 && r.galat.trim() === "") return null;
850
+ throw new GalatBrankas(r.galat.trim() || `secret-tool exited with code ${String(r.kode)}`);
851
+ },
852
+ simpan: async (nilai) => {
853
+ const r = await jalankan2("secret-tool", ["store", `--label=${LAYANAN} master key`, ...atribut], nilai);
854
+ if (r.kode !== 0) throw new GalatBrankas(r.galat.trim() || `secret-tool exited with code ${String(r.kode)}`);
855
+ }
856
+ };
857
+ }
858
+ var PS_LINDUNGI = "$s=[Console]::In.ReadToEnd().Trim(); Add-Type -AssemblyName System.Security; [Convert]::ToBase64String([Security.Cryptography.ProtectedData]::Protect([Text.Encoding]::UTF8.GetBytes($s),$null,[Security.Cryptography.DataProtectionScope]::CurrentUser))";
859
+ var PS_BUKA = "$s=[Console]::In.ReadToEnd().Trim(); Add-Type -AssemblyName System.Security; [Text.Encoding]::UTF8.GetString([Security.Cryptography.ProtectedData]::Unprotect([Convert]::FromBase64String($s),$null,[Security.Cryptography.DataProtectionScope]::CurrentUser))";
860
+ function brankasWindows(jalankan2, berkas, fs) {
861
+ const ps = (skrip, masukan) => jalankan2("powershell.exe", ["-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-Command", skrip], masukan);
862
+ return {
863
+ nama: "Windows DPAPI",
864
+ baca: async () => {
865
+ const blob = fs.baca(berkas);
866
+ if (blob === null || blob.trim() === "") return null;
867
+ const r = await ps(PS_BUKA, blob.trim());
868
+ if (r.kode !== 0) throw new GalatBrankas(r.galat.trim() || `PowerShell exited with code ${String(r.kode)}`);
869
+ return r.keluaran.trim();
870
+ },
871
+ simpan: async (nilai) => {
872
+ const r = await ps(PS_LINDUNGI, nilai);
873
+ if (r.kode !== 0 || r.keluaran.trim() === "") throw new GalatBrankas(r.galat.trim() || `PowerShell exited with code ${String(r.kode)}`);
874
+ fs.tulis(berkas, r.keluaran.trim());
875
+ }
876
+ };
877
+ }
878
+ var berkasNyata = {
879
+ baca: (p) => {
880
+ try {
881
+ return (0, import_node_fs5.readFileSync)(p, "utf8");
882
+ } catch {
883
+ return null;
884
+ }
885
+ },
886
+ tulis: (p, isi) => {
887
+ (0, import_node_fs5.mkdirSync)((0, import_node_path8.dirname)(p), { recursive: true, mode: 448 });
888
+ (0, import_node_fs5.writeFileSync)(p, isi, { mode: 384 });
889
+ (0, import_node_fs5.chmodSync)(p, 384);
890
+ },
891
+ hapus: (p) => (0, import_node_fs5.rmSync)(p, { force: true })
892
+ };
893
+ function jalankanBerbatas(batasMs) {
894
+ return (perintah, argumen, masukan) => new Promise((selesai) => {
895
+ let keluaran = "";
896
+ let galat = "";
897
+ const anak = (0, import_node_child_process4.spawn)(perintah, [...argumen], { stdio: ["pipe", "pipe", "pipe"], windowsHide: true });
898
+ const jam = setTimeout(() => {
899
+ anak.kill("SIGKILL");
900
+ selesai({ kode: null, keluaran, galat: `${perintah} did not finish within ${String(Math.round(batasMs / 1e3))} seconds`, habisWaktu: true });
901
+ }, batasMs);
902
+ anak.stdout.setEncoding("utf8").on("data", (d) => keluaran += d);
903
+ anak.stderr.setEncoding("utf8").on("data", (d) => galat += d);
904
+ anak.on("error", (e) => {
905
+ clearTimeout(jam);
906
+ selesai({ kode: null, keluaran, galat: e.message });
907
+ });
908
+ anak.on("close", (kode) => {
909
+ clearTimeout(jam);
910
+ selesai({ kode, keluaran, galat });
911
+ });
912
+ anak.stdin.on("error", () => void 0);
913
+ anak.stdin.end(masukan ?? "");
914
+ });
915
+ }
916
+ var jalankanNyata = jalankanBerbatas(2e4);
917
+ function depKunciIndukNyata(jalur, platform = process.platform) {
918
+ const akun = akunBrankas(jalur.dir);
919
+ const brankas = platform === "darwin" ? brankasMac(jalankanNyata, akun) : platform === "linux" ? brankasLinux(jalankanNyata, akun) : platform === "win32" ? brankasWindows(jalankanNyata, `${jalur.kunciInduk}.dpapi`, berkasNyata) : null;
920
+ return { brankas, berkas: berkasNyata, acak: () => (0, import_node_crypto2.randomBytes)(32).toString("hex"), peringatan: (t) => console.error(t) };
921
+ }
922
+ async function simpanTerbukti(b, nilai) {
923
+ try {
924
+ await b.simpan(nilai);
925
+ return await b.baca() === nilai;
926
+ } catch {
927
+ return false;
928
+ }
929
+ }
930
+ function catatLokasi(jalur, d, lokasi) {
931
+ d.berkas.tulis(jalur.kunciIndukLokasi, `${lokasi}
932
+ `);
933
+ }
934
+ var PERINGATAN_BERKAS = "No system keychain is available, so the VibeCode CLI key is kept in a private file (~/.vibecode/cli/master.key).";
935
+ async function kunciInduk(jalur, d) {
936
+ const tercatat = d.berkas.baca(jalur.kunciIndukLokasi)?.trim();
937
+ if (tercatat === "brankas") {
938
+ if (d.brankas === null) throw new Error("The VibeCode CLI key is recorded in a system keychain that is not available here.");
939
+ let nilai;
940
+ try {
941
+ nilai = await d.brankas.baca();
942
+ } catch (e) {
943
+ throw new Error(`Could not read the VibeCode CLI key from the ${d.brankas.nama}: ${e instanceof Error ? e.message : String(e)}`, { cause: e });
944
+ }
945
+ if (nilai !== null && POLA_KUNCI.test(nilai)) return nilai;
946
+ const baru = d.acak();
947
+ if (!await simpanTerbukti(d.brankas, baru)) throw new Error(`Could not save the VibeCode CLI key to the ${d.brankas.nama}.`);
948
+ d.peringatan("The VibeCode CLI key was missing from the keychain, so a new one was made. Sign in again with `vibecode login` or /connect.");
949
+ return baru;
950
+ }
951
+ if (tercatat === "berkas") {
952
+ const ada = d.berkas.baca(jalur.kunciInduk)?.trim();
953
+ if (ada !== void 0 && POLA_KUNCI.test(ada)) return ada;
954
+ const baru = d.acak();
955
+ d.berkas.tulis(jalur.kunciInduk, baru);
956
+ return baru;
957
+ }
958
+ const lama = d.berkas.baca(jalur.kunciInduk)?.trim();
959
+ const kunci = lama !== void 0 && POLA_KUNCI.test(lama) ? lama : d.acak();
960
+ if (d.brankas !== null && await simpanTerbukti(d.brankas, kunci)) {
961
+ catatLokasi(jalur, d, "brankas");
962
+ if (lama !== void 0) d.berkas.hapus(jalur.kunciInduk);
963
+ return kunci;
964
+ }
965
+ d.berkas.tulis(jalur.kunciInduk, kunci);
966
+ catatLokasi(jalur, d, "berkas");
967
+ if (d.brankas !== null || lama === void 0) d.peringatan(PERINGATAN_BERKAS);
968
+ return kunci;
969
+ }
970
+
971
+ // apps/cli/src/peluncur/perintah-daemon.ts
972
+ var BANTUAN_DAEMON = `Usage:
973
+ vibecode daemon stop [--force] stop the background service (refuses while it is working, unless --force)
974
+ vibecode daemon restart [--force] stop it, then start the installed version
975
+ vibecode daemon log [--lines <n>] show the log file and its last lines (default 80)
976
+ vibecode daemon endpoint make sure it runs and print its address as JSON`;
977
+ var TUNGGU_BERHENTI_MS = 15e3;
978
+ async function hentikan(d, h, paksa) {
979
+ let r;
980
+ try {
981
+ r = await d.berhenti(h, paksa);
982
+ } catch {
983
+ r = null;
984
+ }
985
+ if (r === null) {
986
+ if (!paksa) {
987
+ d.tulisGalat("The VibeCode background service did not answer. Run `vibecode daemon stop --force` to end it.");
988
+ return false;
989
+ }
990
+ if (await d.hentikanPaksa(h.info.pid)) return true;
991
+ d.tulisGalat(`The VibeCode background service (pid ${String(h.info.pid)}) could not be stopped.`);
992
+ return false;
993
+ }
994
+ if (!r.ok) {
995
+ d.tulisGalat(
996
+ `The VibeCode background service is still busy (${teksPekerjaan(r.status)}). Run it again with --force to stop it anyway; running work stops.`
997
+ );
998
+ return false;
999
+ }
1000
+ if (await d.tungguMati(h.info.pid, TUNGGU_BERHENTI_MS)) return true;
1001
+ if (paksa && await d.hentikanPaksa(h.info.pid)) return true;
1002
+ d.tulisGalat(`The VibeCode background service (pid ${String(h.info.pid)}) did not stop. Run it again with --force.`);
1003
+ return false;
1004
+ }
1005
+ function opsiBaris(argv, bawaan) {
1006
+ let nilai;
1007
+ for (let i = 0; i < argv.length; i++) {
1008
+ const a = argv[i];
1009
+ if (a === "--lines") nilai = argv[++i];
1010
+ else if (a.startsWith("--lines=")) nilai = a.slice("--lines=".length);
1011
+ else return null;
1012
+ if (nilai === void 0) return null;
1013
+ }
1014
+ if (nilai === void 0) return bawaan;
1015
+ const n = Number(nilai);
1016
+ return Number.isInteger(n) && n > 0 ? n : null;
1017
+ }
1018
+ async function perintahDaemon(argv, d) {
1019
+ const sub = argv[0];
1020
+ const sisa = argv.slice(1);
1021
+ if (sub === "stop" || sub === "restart") {
1022
+ const paksa = sisa.includes("--force");
1023
+ if (!sisa.every((a) => a === "--force")) {
1024
+ d.tulisGalat(BANTUAN_DAEMON);
1025
+ return 2;
1026
+ }
1027
+ const h = await d.baca();
1028
+ if (h === null) {
1029
+ if (sub === "stop") {
1030
+ d.tulis("The VibeCode background service is not running.");
1031
+ return 0;
1032
+ }
1033
+ } else if (!await hentikan(d, h, paksa)) {
1034
+ return 1;
1035
+ }
1036
+ if (sub === "stop") {
1037
+ d.tulis("VibeCode background service stopped.");
1038
+ return 0;
1039
+ }
1040
+ const s = await d.pastikan();
1041
+ d.tulis(`VibeCode background service started (version ${s.info.versi.split("+")[0]}, pid ${String(s.info.pid)}).`);
1042
+ return 0;
1043
+ }
1044
+ if (sub === "log") {
1045
+ const baris = opsiBaris(sisa, 80);
1046
+ if (baris === null) {
1047
+ d.tulisGalat(BANTUAN_DAEMON);
1048
+ return 2;
1049
+ }
1050
+ d.tulis(d.jalur.log);
1051
+ const isi = d.bacaBerkas(d.jalur.log);
1052
+ if (isi === null || isi.trim() === "") {
1053
+ d.tulis("(the log is empty)");
1054
+ return 0;
1055
+ }
1056
+ d.tulis(isi.replace(/\n$/, "").split("\n").slice(-baris).join("\n"));
1057
+ return 0;
1058
+ }
1059
+ if (sub === "endpoint") {
1060
+ if (sisa.length > 0) {
1061
+ d.tulisGalat(BANTUAN_DAEMON);
1062
+ return 2;
1063
+ }
1064
+ const s = await d.pastikan({ bolehGanti: false });
1065
+ d.tulis(JSON.stringify({ url: s.url }));
1066
+ return 0;
1067
+ }
1068
+ d.tulisGalat(BANTUAN_DAEMON);
1069
+ return sub === void 0 || sub === "help" || sub === "--help" || sub === "-h" ? 0 : 2;
1070
+ }
1071
+ async function perintahImporDesktop(argv, d) {
1072
+ if (argv.length > 0) {
1073
+ d.tulisGalat("Usage: vibecode import-desktop");
1074
+ return 2;
1075
+ }
1076
+ const s = await d.pastikan();
1077
+ const j = await d.minta(s.info.port, s.token, "POST", JALUR_IMPOR_DESKTOP);
1078
+ if (j.status !== 200) {
1079
+ d.tulisGalat(typeof j.data["message"] === "string" ? j.data["message"] : `The VibeCode background service answered ${String(j.status)}.`);
1080
+ return 1;
1081
+ }
1082
+ const n = (k) => typeof j.data[k] === "number" ? j.data[k] : 0;
1083
+ const sesi = n("sesi");
1084
+ const jamak = (x, kata) => `${String(x)} ${kata}${x === 1 ? "" : "s"}`;
1085
+ if (sesi === 0) {
1086
+ d.tulis(n("dilewati") > 0 ? `Nothing new to import (${jamak(n("dilewati"), "session")} already in the CLI).` : "The desktop app has no sessions to import.");
1087
+ return 0;
1088
+ }
1089
+ d.tulis(
1090
+ `Imported ${jamak(sesi, "session")} (${jamak(n("pesan"), "message")}) from the VibeCode desktop app.` + (n("dilewati") > 0 ? ` ${jamak(n("dilewati"), "session")} already in the CLI ${n("dilewati") === 1 ? "was" : "were"} left unchanged.` : "") + " Each session opens in the folder it was started in."
1091
+ );
1092
+ return 0;
1093
+ }
1094
+
1095
+ // apps/cli/src/peluncur/perintah-tui.ts
1096
+ var import_node_path9 = require("node:path");
1097
+ function bunfigTerdekat(entri, ada) {
1098
+ let dir = (0, import_node_path9.dirname)(entri);
1099
+ for (; ; ) {
1100
+ if (ada((0, import_node_path9.join)(dir, "bunfig.toml"))) return dir;
1101
+ const atas = (0, import_node_path9.dirname)(dir);
1102
+ if (atas === dir) return void 0;
1103
+ dir = atas;
1104
+ }
1105
+ }
1106
+ function perintahTui(env, ada, paket) {
1107
+ if (env !== void 0 && env !== "") {
1108
+ if (!ada(env)) throw new Error(`VIBECODE_TUI_BIN points to a file that does not exist: ${env}`);
1109
+ if (!env.endsWith(".ts") && !env.endsWith(".tsx")) return { perintah: env, awal: [] };
1110
+ const cwd = bunfigTerdekat(env, ada);
1111
+ return { perintah: "bun", awal: ["run", env], ...cwd !== void 0 ? { cwd } : {} };
1112
+ }
1113
+ const biner = paket.cari();
1114
+ if (biner !== null) return { perintah: biner, awal: [] };
1115
+ throw new Error(
1116
+ paket.calon.length === 0 ? "The VibeCode terminal UI is not available for this operating system." : `The VibeCode terminal UI for this computer is not installed (${paket.calon.map((n) => `"${n}"`).join(" or ")}). Reinstall with: npm install -g ${paket.namaCli}`
1117
+ );
1118
+ }
1119
+
1120
+ // apps/cli/src/peluncur/bin.ts
1121
+ var VERSI = true ? "0.1.65" : "0.0.0-dev";
1122
+ var NAMA_CLI = true ? "vibecodeagent" : "vibecodeagent";
1123
+ var AWALAN_TUI = true ? "@vibecodeagent/cli" : "@vibecodeagent/cli";
1124
+ var BINER_TUI = true ? "vibecode-tui" : "vibecode-tui";
1125
+ var BANTUAN = `VibeCode, the AI coding agent, in your terminal.
1126
+
1127
+ Usage:
1128
+ vibecode [dir] [options] open VibeCode in a folder (default: this folder)
1129
+ vibecode login sign in with your VibeCode email and password
1130
+ vibecode logout sign out (running sessions are stopped)
1131
+ vibecode status show your account, Credit, keys and the background service
1132
+ vibecode import-desktop copy your sessions from the VibeCode desktop app
1133
+ vibecode daemon <command> stop, restart, or read the log of the background service
1134
+
1135
+ Options:
1136
+ -c, --continue continue the last session in this folder
1137
+ -s, --session <id> open a session
1138
+ --prompt <text> send a prompt on start
1139
+ -m, --model <id> model to use (provider/model)
1140
+ --agent <id> permission mode to start in
1141
+ -h, --help show this help
1142
+ -v, --version print the version
1143
+
1144
+ Google sign-in, OpenRouter keys and local endpoints are under /connect inside VibeCode.
1145
+ To open a folder named like a command, write it as a path: vibecode ./status
1146
+
1147
+ ${BANTUAN_DAEMON}`;
1148
+ var DIR_DIST = __dirname;
1149
+ var buildTembolok;
1150
+ function build() {
1151
+ buildTembolok ??= idBuildCli(VERSI, DIR_DIST);
1152
+ return buildTembolok;
1153
+ }
1154
+ function opsiPastikan() {
1155
+ const jalur = jalurCli();
1156
+ return { jalur, dirDist: DIR_DIST, build: build(), node: process.execPath, kunciInduk: () => kunciInduk(jalur, depKunciIndukNyata(jalur)) };
1157
+ }
1158
+ async function pastikan(o = {}) {
1159
+ const s = await pastikanDaemon({ ...opsiPastikan(), ...o });
1160
+ if (s.catatan !== void 0) console.error(s.catatan);
1161
+ return s;
1162
+ }
1163
+ function depAkun() {
1164
+ return {
1165
+ sambung: async () => {
1166
+ const s = await pastikan();
1167
+ return { port: s.info.port, token: s.token, info: { pid: s.info.pid, port: s.info.port, versi: s.info.versi.split("+")[0] } };
1168
+ },
1169
+ minta: mintaDaemon,
1170
+ tanya: (t) => tanyaBaris(t),
1171
+ rahasia: (t) => bacaRahasia(t),
1172
+ tulis: (t) => console.log(t),
1173
+ tulisGalat: (t) => console.error(t)
1174
+ };
1175
+ }
1176
+ function depDaemon() {
1177
+ const jalur = jalurCli();
1178
+ return {
1179
+ jalur,
1180
+ baca: () => bacaDaemonHidup(jalur),
1181
+ pastikan,
1182
+ berhenti: (h, paksa) => mintaDaemonBerhenti(h, paksa),
1183
+ tungguMati,
1184
+ hentikanPaksa,
1185
+ minta: mintaDaemon,
1186
+ bacaBerkas: (p) => {
1187
+ try {
1188
+ return (0, import_node_fs6.readFileSync)(p, "utf8");
1189
+ } catch {
1190
+ return null;
1191
+ }
1192
+ },
1193
+ tulis: (t) => console.log(t),
1194
+ tulisGalat: (t) => console.error(t)
1195
+ };
1196
+ }
1197
+ function binerTui() {
1198
+ const os = osTui(process.platform);
1199
+ const calon = os === null ? [] : namaPaketTui({ awalan: AWALAN_TUI, os, arch: process.arch, avx2: adaAvx2(process.platform, process.arch), musl: adaMusl(process.platform, import_node_fs6.existsSync) });
1200
+ const biner = process.platform === "win32" ? `${BINER_TUI}.exe` : BINER_TUI;
1201
+ return perintahTui(process.env["VIBECODE_TUI_BIN"], import_node_fs6.existsSync, { calon, namaCli: NAMA_CLI, cari: () => cariBinerTui(DIR_DIST, calon, biner, import_node_fs6.existsSync) });
1202
+ }
1203
+ async function utama() {
1204
+ const argv = process.argv.slice(2);
1205
+ if (argv[0] === "daemon") return perintahDaemon(argv.slice(1), depDaemon());
1206
+ if (argv[0] === "import-desktop") return perintahImporDesktop(argv.slice(1), depDaemon());
1207
+ if (argv[0] === "--version" || argv[0] === "-v") {
1208
+ console.log(VERSI);
1209
+ return 0;
1210
+ }
1211
+ if (argv[0] === "--help" || argv[0] === "-h" || argv[0] === "help") {
1212
+ console.log(BANTUAN);
1213
+ return 0;
1214
+ }
1215
+ if (argv[0] === "login") return perintahLogin(argv.slice(1), depAkun());
1216
+ if (argv[0] === "logout") return perintahLogout(depAkun());
1217
+ if (argv[0] === "status") return perintahStatus(depAkun());
1218
+ const tujuan = susunArgumenTui(argv, process.cwd(), (p) => (0, import_node_fs6.statSync)(p, { throwIfNoEntry: false })?.isDirectory() === true);
1219
+ if ("galat" in tujuan) {
1220
+ console.error(tujuan.galat);
1221
+ return 2;
1222
+ }
1223
+ const tui = binerTui();
1224
+ const s = await pastikan();
1225
+ const peluncur = JSON.stringify([process.execPath, __filename]);
1226
+ const anak = (0, import_node_child_process5.spawn)(tui.perintah, [...tui.awal, "--server", s.url, "--password-file", jalurCli().token, "--launcher", peluncur, ...tujuan.argumen], {
1227
+ stdio: "inherit",
1228
+ cwd: tui.cwd ?? tujuan.direktori
1229
+ });
1230
+ return await new Promise((selesai) => {
1231
+ anak.on("exit", (kode, sinyal) => selesai(sinyal !== null ? 130 : kode ?? 0));
1232
+ anak.on("error", (e) => {
1233
+ console.error(e.message);
1234
+ selesai(1);
1235
+ });
1236
+ });
1237
+ }
1238
+ void utama().then(
1239
+ (kode) => process.exit(kode),
1240
+ (e) => {
1241
+ console.error(e instanceof Error ? e.message : String(e));
1242
+ process.exit(1);
1243
+ }
1244
+ );
1245
+ //# sourceMappingURL=bin.js.map