vybekiit 0.7.2 → 0.7.4
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.
- package/dist/bin.js +1170 -869
- package/package.json +8 -8
package/dist/bin.js
CHANGED
|
@@ -3084,7 +3084,7 @@ var require_dist = __commonJS({
|
|
|
3084
3084
|
function parse(stream, callback) {
|
|
3085
3085
|
const parser = new parser_1.Parser();
|
|
3086
3086
|
stream.on("data", (buffer) => parser.parse(buffer, callback));
|
|
3087
|
-
return new Promise((
|
|
3087
|
+
return new Promise((resolve14) => stream.on("end", () => resolve14()));
|
|
3088
3088
|
}
|
|
3089
3089
|
}
|
|
3090
3090
|
});
|
|
@@ -3846,12 +3846,12 @@ var require_client = __commonJS({
|
|
|
3846
3846
|
this._connect(callback);
|
|
3847
3847
|
return;
|
|
3848
3848
|
}
|
|
3849
|
-
return new this._Promise((
|
|
3849
|
+
return new this._Promise((resolve14, reject) => {
|
|
3850
3850
|
this._connect((error) => {
|
|
3851
3851
|
if (error) {
|
|
3852
3852
|
reject(error);
|
|
3853
3853
|
} else {
|
|
3854
|
-
|
|
3854
|
+
resolve14(this);
|
|
3855
3855
|
}
|
|
3856
3856
|
});
|
|
3857
3857
|
});
|
|
@@ -4198,8 +4198,8 @@ var require_client = __commonJS({
|
|
|
4198
4198
|
} else {
|
|
4199
4199
|
query = new Query2(config, values, callback);
|
|
4200
4200
|
if (!query.callback) {
|
|
4201
|
-
result = new this._Promise((
|
|
4202
|
-
query.callback = (err, res) => err ? reject(err) :
|
|
4201
|
+
result = new this._Promise((resolve14, reject) => {
|
|
4202
|
+
query.callback = (err, res) => err ? reject(err) : resolve14(res);
|
|
4203
4203
|
}).catch((err) => {
|
|
4204
4204
|
Error.captureStackTrace(err);
|
|
4205
4205
|
throw err;
|
|
@@ -4283,8 +4283,8 @@ var require_client = __commonJS({
|
|
|
4283
4283
|
if (cb) {
|
|
4284
4284
|
this.connection.once("end", cb);
|
|
4285
4285
|
} else {
|
|
4286
|
-
return new this._Promise((
|
|
4287
|
-
this.connection.once("end",
|
|
4286
|
+
return new this._Promise((resolve14) => {
|
|
4287
|
+
this.connection.once("end", resolve14);
|
|
4288
4288
|
});
|
|
4289
4289
|
}
|
|
4290
4290
|
}
|
|
@@ -4333,8 +4333,8 @@ var require_pg_pool = __commonJS({
|
|
|
4333
4333
|
const cb = function(err, client) {
|
|
4334
4334
|
err ? rej(err) : res(client);
|
|
4335
4335
|
};
|
|
4336
|
-
const result = new Promise2(function(
|
|
4337
|
-
res =
|
|
4336
|
+
const result = new Promise2(function(resolve14, reject) {
|
|
4337
|
+
res = resolve14;
|
|
4338
4338
|
rej = reject;
|
|
4339
4339
|
}).catch((err) => {
|
|
4340
4340
|
Error.captureStackTrace(err);
|
|
@@ -4395,7 +4395,7 @@ var require_pg_pool = __commonJS({
|
|
|
4395
4395
|
if (typeof Promise2.try === "function") {
|
|
4396
4396
|
return Promise2.try(f);
|
|
4397
4397
|
}
|
|
4398
|
-
return new Promise2((
|
|
4398
|
+
return new Promise2((resolve14) => resolve14(f()));
|
|
4399
4399
|
}
|
|
4400
4400
|
_isFull() {
|
|
4401
4401
|
return this._clients.length >= this.options.max;
|
|
@@ -4788,8 +4788,8 @@ var require_query2 = __commonJS({
|
|
|
4788
4788
|
NativeQuery.prototype._getPromise = function() {
|
|
4789
4789
|
if (this._promise) return this._promise;
|
|
4790
4790
|
this._promise = new Promise(
|
|
4791
|
-
function(
|
|
4792
|
-
this._once("end",
|
|
4791
|
+
function(resolve14, reject) {
|
|
4792
|
+
this._once("end", resolve14);
|
|
4793
4793
|
this._once("error", reject);
|
|
4794
4794
|
}.bind(this)
|
|
4795
4795
|
);
|
|
@@ -4967,12 +4967,12 @@ var require_client2 = __commonJS({
|
|
|
4967
4967
|
this._connect(callback);
|
|
4968
4968
|
return;
|
|
4969
4969
|
}
|
|
4970
|
-
return new this._Promise((
|
|
4970
|
+
return new this._Promise((resolve14, reject) => {
|
|
4971
4971
|
this._connect((error) => {
|
|
4972
4972
|
if (error) {
|
|
4973
4973
|
reject(error);
|
|
4974
4974
|
} else {
|
|
4975
|
-
|
|
4975
|
+
resolve14(this);
|
|
4976
4976
|
}
|
|
4977
4977
|
});
|
|
4978
4978
|
});
|
|
@@ -4996,8 +4996,8 @@ var require_client2 = __commonJS({
|
|
|
4996
4996
|
query = new NativeQuery(config, values, callback);
|
|
4997
4997
|
if (!query.callback) {
|
|
4998
4998
|
let resolveOut, rejectOut;
|
|
4999
|
-
result = new this._Promise((
|
|
5000
|
-
resolveOut =
|
|
4999
|
+
result = new this._Promise((resolve14, reject) => {
|
|
5000
|
+
resolveOut = resolve14;
|
|
5001
5001
|
rejectOut = reject;
|
|
5002
5002
|
}).catch((err) => {
|
|
5003
5003
|
Error.captureStackTrace(err);
|
|
@@ -5060,8 +5060,8 @@ var require_client2 = __commonJS({
|
|
|
5060
5060
|
}
|
|
5061
5061
|
let result;
|
|
5062
5062
|
if (!cb) {
|
|
5063
|
-
result = new this._Promise(function(
|
|
5064
|
-
cb = (err) => err ? reject(err) :
|
|
5063
|
+
result = new this._Promise(function(resolve14, reject) {
|
|
5064
|
+
cb = (err) => err ? reject(err) : resolve14();
|
|
5065
5065
|
});
|
|
5066
5066
|
}
|
|
5067
5067
|
this.native.end(function() {
|
|
@@ -5236,7 +5236,7 @@ var init_esm = __esm({
|
|
|
5236
5236
|
});
|
|
5237
5237
|
|
|
5238
5238
|
// src/bin.ts
|
|
5239
|
-
import
|
|
5239
|
+
import process33 from "process";
|
|
5240
5240
|
|
|
5241
5241
|
// ../packages/core/src/accessGate.ts
|
|
5242
5242
|
import { Data, Effect, Either } from "effect";
|
|
@@ -5689,8 +5689,8 @@ var walkPreferenceLadder = (walk) => Effect2.gen(function* () {
|
|
|
5689
5689
|
|
|
5690
5690
|
// src/cliRunner.ts
|
|
5691
5691
|
import { readFile as readFile26 } from "fs/promises";
|
|
5692
|
-
import { dirname as dirname18, join as
|
|
5693
|
-
import
|
|
5692
|
+
import { dirname as dirname18, join as join56 } from "path";
|
|
5693
|
+
import process32 from "process";
|
|
5694
5694
|
import { fileURLToPath as fileURLToPath9 } from "url";
|
|
5695
5695
|
|
|
5696
5696
|
// src/commands/createSurfaceRegistry.ts
|
|
@@ -5752,6 +5752,7 @@ Getting started:
|
|
|
5752
5752
|
vybekiit setup Welcome + set up Claude Code globally (skills, MCP, tools)
|
|
5753
5753
|
vybekiit doctor Full toolchain pass (agents, gh, cloud CLIs, skills, \u2026)
|
|
5754
5754
|
${createSurfaceUsage}
|
|
5755
|
+
vybekiit create --ui-library [directory] Full UI kit + gallery + Claude (report mode ready)
|
|
5755
5756
|
|
|
5756
5757
|
After your app exists (your AI coding tool drives these):
|
|
5757
5758
|
vybekiit list-pieces \xB7 list-page-recipes \xB7 list-presets
|
|
@@ -5767,6 +5768,7 @@ ${createSurfaceHelp}
|
|
|
5767
5768
|
Examples:
|
|
5768
5769
|
vybekiit setup
|
|
5769
5770
|
vybekiit create app --web
|
|
5771
|
+
vybekiit create --ui-library
|
|
5770
5772
|
vybekiit create app --mobile ./my-app
|
|
5771
5773
|
vybekiit doctor
|
|
5772
5774
|
|
|
@@ -5786,6 +5788,7 @@ Buyer journey:
|
|
|
5786
5788
|
vybekiit doctor
|
|
5787
5789
|
vybekiit doctor --ensure <tool> [--json]
|
|
5788
5790
|
vybekiit create app ${CREATE_SURFACE_PIPE_FLAGS} [directory]
|
|
5791
|
+
vybekiit create --ui-library [directory] (kit + @vybekiit/ui + gallery + Claude; report mode in)
|
|
5789
5792
|
|
|
5790
5793
|
Create / project:
|
|
5791
5794
|
vybekiit new [template] [directory] (deprecated \u2192 create app)
|
|
@@ -10727,221 +10730,786 @@ var runCreateApp = async (args) => {
|
|
|
10727
10730
|
return 0;
|
|
10728
10731
|
};
|
|
10729
10732
|
|
|
10730
|
-
// src/commands/
|
|
10733
|
+
// src/commands/createUiLibrary.ts
|
|
10734
|
+
import { spawn as spawn2 } from "child_process";
|
|
10735
|
+
import { access as access8, readdir as readdir7 } from "fs/promises";
|
|
10736
|
+
import { homedir as homedir2 } from "os";
|
|
10737
|
+
import { join as join13, resolve as resolve4 } from "path";
|
|
10738
|
+
import process8 from "process";
|
|
10739
|
+
import open from "open";
|
|
10740
|
+
|
|
10741
|
+
// src/global/runSessionOne.ts
|
|
10742
|
+
import { spawn } from "child_process";
|
|
10743
|
+
import { access as access7, readdir as readdir6 } from "fs/promises";
|
|
10744
|
+
import { homedir } from "os";
|
|
10745
|
+
import { join as join12 } from "path";
|
|
10746
|
+
import process7 from "process";
|
|
10747
|
+
|
|
10748
|
+
// src/global/exec.ts
|
|
10731
10749
|
import { execFile as execFile4 } from "child_process";
|
|
10732
|
-
|
|
10733
|
-
|
|
10734
|
-
|
|
10735
|
-
|
|
10736
|
-
|
|
10737
|
-
var HERE3 = dirname6(fileURLToPath3(import.meta.url));
|
|
10738
|
-
var findBinary = () => {
|
|
10739
|
-
const devBinary = resolve4(HERE3, "../../tools/dedup/target/release/vybekiit-dedup");
|
|
10740
|
-
if (existsSync3(devBinary)) {
|
|
10741
|
-
return devBinary;
|
|
10742
|
-
}
|
|
10743
|
-
const debugBinary = resolve4(HERE3, "../../tools/dedup/target/debug/vybekiit-dedup");
|
|
10744
|
-
if (existsSync3(debugBinary)) {
|
|
10745
|
-
return debugBinary;
|
|
10746
|
-
}
|
|
10747
|
-
return "vybekiit-dedup";
|
|
10748
|
-
};
|
|
10749
|
-
var readExecFileError = (error) => {
|
|
10750
|
-
if (typeof error !== "object" || error === null) {
|
|
10751
|
-
return;
|
|
10752
|
-
}
|
|
10753
|
-
if (!("stdout" in error)) {
|
|
10754
|
-
return;
|
|
10755
|
-
}
|
|
10756
|
-
return error;
|
|
10757
|
-
};
|
|
10758
|
-
var formatDedupExecError = (error) => {
|
|
10759
|
-
const execError = readExecFileError(error);
|
|
10760
|
-
if (execError !== void 0) {
|
|
10761
|
-
const stderr = typeof execError.stderr === "string" ? execError.stderr : "";
|
|
10762
|
-
const stdout = typeof execError.stdout === "string" ? execError.stdout : "";
|
|
10763
|
-
const exitCode = typeof execError.code === "number" ? execError.code : 1;
|
|
10764
|
-
if (stderr !== "") {
|
|
10765
|
-
process.stderr.write(stderr);
|
|
10750
|
+
var makeExec = (bin) => (args) => new Promise((resolve14) => {
|
|
10751
|
+
execFile4(bin, [...args], { encoding: "utf8" }, (error, stdout, stderr) => {
|
|
10752
|
+
if (error && "code" in error && error.code === "ENOENT") {
|
|
10753
|
+
resolve14({ code: 127, stdout: "", stderr: `${bin} not found` });
|
|
10754
|
+
return;
|
|
10766
10755
|
}
|
|
10767
|
-
|
|
10768
|
-
|
|
10769
|
-
|
|
10770
|
-
exitCode: 1,
|
|
10771
|
-
output: JSON.stringify({
|
|
10772
|
-
error: `Failed to run vybekiit-dedup: ${caughtMessage(error)}`
|
|
10773
|
-
})
|
|
10774
|
-
};
|
|
10775
|
-
};
|
|
10776
|
-
var runDedupBinary = async (binary, args) => {
|
|
10777
|
-
try {
|
|
10778
|
-
const { stdout, stderr } = await execFileAsync4(binary, args, {
|
|
10779
|
-
cwd: process.cwd(),
|
|
10780
|
-
timeout: 3e4,
|
|
10781
|
-
maxBuffer: 10 * 1024 * 1024
|
|
10782
|
-
});
|
|
10783
|
-
if (stderr !== "") {
|
|
10784
|
-
process.stderr.write(stderr);
|
|
10756
|
+
let code = 0;
|
|
10757
|
+
if (error) {
|
|
10758
|
+
code = typeof error.code === "number" ? error.code : 1;
|
|
10785
10759
|
}
|
|
10786
|
-
|
|
10787
|
-
}
|
|
10788
|
-
|
|
10760
|
+
resolve14({ code, stdout: stdout ?? "", stderr: stderr ?? "" });
|
|
10761
|
+
});
|
|
10762
|
+
});
|
|
10763
|
+
|
|
10764
|
+
// src/global/runSessionOne.ts
|
|
10765
|
+
var DEFAULT_FIRST_APP_DIR_NAME = "vybekiit-app";
|
|
10766
|
+
var SESSION_ONE_SEED_PROMPT = "Set up my app.";
|
|
10767
|
+
var shouldSkipSessionOne = (args, env = process7.env) => {
|
|
10768
|
+
if (args.includes("--skip-session-one") || args.includes("--skip-first-app")) {
|
|
10769
|
+
return true;
|
|
10789
10770
|
}
|
|
10771
|
+
const flag = env.VYBEKIIT_SKIP_SESSION_ONE;
|
|
10772
|
+
return flag === "1" || flag === "true" || flag === "yes";
|
|
10790
10773
|
};
|
|
10791
|
-
var
|
|
10792
|
-
|
|
10793
|
-
|
|
10794
|
-
|
|
10795
|
-
const [techId, packageName] = args;
|
|
10796
|
-
if (!techId) {
|
|
10797
|
-
return {
|
|
10798
|
-
json: JSON.stringify({ error: "Usage: vybekiit doc-fallback <tech-id>" }),
|
|
10799
|
-
exitCode: 1
|
|
10800
|
-
};
|
|
10774
|
+
var resolveFirstAppPath = (deps) => {
|
|
10775
|
+
const override = deps.env.VYBEKIIT_FIRST_APP_DIR?.trim();
|
|
10776
|
+
if (override !== void 0 && override !== "") {
|
|
10777
|
+
return override.startsWith("/") || /^[A-Za-z]:[\\/]/.test(override) ? override : join12(deps.homeDir(), override);
|
|
10801
10778
|
}
|
|
10802
|
-
|
|
10803
|
-
return { json: JSON.stringify(plan, null, 2), exitCode: plan.found ? 0 : 1 };
|
|
10779
|
+
return join12(deps.homeDir(), DEFAULT_FIRST_APP_DIR_NAME);
|
|
10804
10780
|
};
|
|
10805
|
-
|
|
10806
|
-
// src/commands/drop.ts
|
|
10807
|
-
import { join as join13, resolve as resolve6 } from "path";
|
|
10808
|
-
|
|
10809
|
-
// src/commands/dropFiles.ts
|
|
10810
|
-
import { access as access7, cp as cp3, mkdir as mkdir5, readdir as readdir6, readFile as readFile6, writeFile as writeFile5 } from "fs/promises";
|
|
10811
|
-
import { dirname as dirname7, join as join12 } from "path";
|
|
10812
|
-
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
10813
|
-
var HERE4 = dirname7(fileURLToPath4(import.meta.url));
|
|
10814
|
-
var resolveDropTemplateSource = async (template) => {
|
|
10815
|
-
const monorepoTemplates = join12(HERE4, "..", "..", "..", "templates");
|
|
10781
|
+
var defaultPathExists = async (path) => {
|
|
10816
10782
|
try {
|
|
10817
|
-
await access7(
|
|
10818
|
-
return
|
|
10783
|
+
await access7(path);
|
|
10784
|
+
return true;
|
|
10819
10785
|
} catch {
|
|
10820
|
-
|
|
10821
|
-
if (cleanup === void 0) {
|
|
10822
|
-
return { source };
|
|
10823
|
-
}
|
|
10824
|
-
return { cleanup, source };
|
|
10786
|
+
return false;
|
|
10825
10787
|
}
|
|
10826
10788
|
};
|
|
10827
|
-
var
|
|
10789
|
+
var defaultIsEmptyDir = async (path) => {
|
|
10828
10790
|
try {
|
|
10829
|
-
await
|
|
10830
|
-
|
|
10831
|
-
return { exists: true, hasFiles: contents.length > 0 };
|
|
10791
|
+
const entries = await readdir6(path);
|
|
10792
|
+
return entries.length === 0;
|
|
10832
10793
|
} catch {
|
|
10833
|
-
return
|
|
10794
|
+
return true;
|
|
10834
10795
|
}
|
|
10835
10796
|
};
|
|
10836
|
-
var
|
|
10837
|
-
|
|
10797
|
+
var defaultRunCommand = async (cwd, bin, args) => await new Promise((resolve14) => {
|
|
10798
|
+
const child = spawn(bin, [...args], {
|
|
10799
|
+
cwd,
|
|
10800
|
+
stdio: ["ignore", "inherit", "inherit"],
|
|
10801
|
+
env: process7.env
|
|
10802
|
+
});
|
|
10803
|
+
child.on("error", () => {
|
|
10804
|
+
resolve14({ code: 127 });
|
|
10805
|
+
});
|
|
10806
|
+
child.on("close", (code) => {
|
|
10807
|
+
resolve14({ code: code ?? 1 });
|
|
10808
|
+
});
|
|
10809
|
+
});
|
|
10810
|
+
var defaultStartDetached = (cwd, bin, args) => {
|
|
10838
10811
|
try {
|
|
10839
|
-
const
|
|
10840
|
-
|
|
10841
|
-
|
|
10842
|
-
|
|
10843
|
-
|
|
10844
|
-
|
|
10845
|
-
|
|
10846
|
-
|
|
10847
|
-
return await listTemplateFiles(join12(dir, entry.name), rel);
|
|
10848
|
-
}
|
|
10849
|
-
return [rel];
|
|
10850
|
-
})
|
|
10851
|
-
);
|
|
10852
|
-
return nestedFiles.flat();
|
|
10812
|
+
const child = spawn(bin, [...args], {
|
|
10813
|
+
cwd,
|
|
10814
|
+
detached: true,
|
|
10815
|
+
stdio: "ignore",
|
|
10816
|
+
env: process7.env
|
|
10817
|
+
});
|
|
10818
|
+
child.unref();
|
|
10819
|
+
return true;
|
|
10853
10820
|
} catch {
|
|
10854
|
-
return
|
|
10821
|
+
return false;
|
|
10855
10822
|
}
|
|
10856
10823
|
};
|
|
10857
|
-
var
|
|
10858
|
-
|
|
10859
|
-
|
|
10860
|
-
|
|
10861
|
-
|
|
10862
|
-
|
|
10863
|
-
|
|
10864
|
-
|
|
10865
|
-
|
|
10866
|
-
}
|
|
10824
|
+
var openClaudeWithSeed = async (appPath, prompt, platform = process7.platform) => {
|
|
10825
|
+
if (platform === "darwin") {
|
|
10826
|
+
const shellCommand = `cd ${JSON.stringify(appPath)} && claude ${JSON.stringify(prompt)}`;
|
|
10827
|
+
const osa = makeExec("osascript");
|
|
10828
|
+
const result = await osa([
|
|
10829
|
+
"-e",
|
|
10830
|
+
`tell application "Terminal" to do script ${JSON.stringify(shellCommand)}`
|
|
10831
|
+
]);
|
|
10832
|
+
if (result.code === 0) {
|
|
10867
10833
|
return true;
|
|
10868
10834
|
}
|
|
10869
|
-
}
|
|
10870
|
-
};
|
|
10871
|
-
var pinDeps = async (dest) => {
|
|
10872
|
-
const pkgPath = join12(dest, "package.json");
|
|
10835
|
+
}
|
|
10873
10836
|
try {
|
|
10874
|
-
const
|
|
10875
|
-
|
|
10876
|
-
|
|
10877
|
-
|
|
10878
|
-
|
|
10879
|
-
|
|
10880
|
-
|
|
10881
|
-
|
|
10882
|
-
}
|
|
10883
|
-
}
|
|
10884
|
-
}
|
|
10885
|
-
}
|
|
10886
|
-
await writeFile5(pkgPath, `${JSON.stringify(pkg, null, 2)}
|
|
10887
|
-
`);
|
|
10837
|
+
const child = spawn("claude", [prompt], {
|
|
10838
|
+
cwd: appPath,
|
|
10839
|
+
detached: true,
|
|
10840
|
+
stdio: "ignore",
|
|
10841
|
+
env: process7.env
|
|
10842
|
+
});
|
|
10843
|
+
child.unref();
|
|
10844
|
+
return true;
|
|
10888
10845
|
} catch {
|
|
10846
|
+
return false;
|
|
10889
10847
|
}
|
|
10890
10848
|
};
|
|
10891
|
-
var
|
|
10892
|
-
|
|
10893
|
-
|
|
10849
|
+
var defaultResolvePnpm = async () => {
|
|
10850
|
+
const pnpm = makeExec("pnpm");
|
|
10851
|
+
const version = await pnpm(["--version"]);
|
|
10852
|
+
if (version.code === 0) {
|
|
10853
|
+
return ["pnpm"];
|
|
10894
10854
|
}
|
|
10895
|
-
|
|
10896
|
-
|
|
10897
|
-
|
|
10898
|
-
|
|
10899
|
-
|
|
10900
|
-
|
|
10901
|
-
|
|
10902
|
-
|
|
10903
|
-
const bare = `--${name}`;
|
|
10904
|
-
let found;
|
|
10905
|
-
for (let index = 0; index < args.length; index += 1) {
|
|
10906
|
-
const arg = args[index];
|
|
10907
|
-
if (arg === void 0) {
|
|
10908
|
-
} else if (arg.startsWith(eqPrefix)) {
|
|
10909
|
-
const value = arg.slice(eqPrefix.length);
|
|
10910
|
-
if (value !== "") {
|
|
10911
|
-
found = value;
|
|
10912
|
-
break;
|
|
10913
|
-
}
|
|
10914
|
-
} else if (arg === bare) {
|
|
10915
|
-
const next = args[index + 1];
|
|
10916
|
-
if (next !== void 0 && !next.startsWith("--") && next !== "") {
|
|
10917
|
-
found = next;
|
|
10918
|
-
break;
|
|
10855
|
+
const corepack = makeExec("corepack");
|
|
10856
|
+
const enabled = await corepack(["enable"]);
|
|
10857
|
+
if (enabled.code === 0) {
|
|
10858
|
+
const prepared = await corepack(["prepare", "pnpm@10.33.2", "--activate"]);
|
|
10859
|
+
if (prepared.code === 0) {
|
|
10860
|
+
const again = await pnpm(["--version"]);
|
|
10861
|
+
if (again.code === 0) {
|
|
10862
|
+
return ["pnpm"];
|
|
10919
10863
|
}
|
|
10920
10864
|
}
|
|
10921
10865
|
}
|
|
10922
|
-
|
|
10923
|
-
|
|
10924
|
-
|
|
10925
|
-
|
|
10926
|
-
return false;
|
|
10927
|
-
}
|
|
10928
|
-
const prev = args[index - 1];
|
|
10929
|
-
if (prev === void 0 || !prev.startsWith("--")) {
|
|
10930
|
-
return false;
|
|
10866
|
+
const npx = makeExec("npx");
|
|
10867
|
+
const npxCheck = await npx(["-y", "pnpm@10.33.2", "--version"]);
|
|
10868
|
+
if (npxCheck.code === 0) {
|
|
10869
|
+
return ["npx", "-y", "pnpm@10.33.2"];
|
|
10931
10870
|
}
|
|
10932
|
-
|
|
10933
|
-
return valueNames.includes(name);
|
|
10871
|
+
return null;
|
|
10934
10872
|
};
|
|
10935
|
-
var
|
|
10936
|
-
|
|
10937
|
-
|
|
10938
|
-
|
|
10939
|
-
|
|
10940
|
-
|
|
10941
|
-
|
|
10942
|
-
|
|
10943
|
-
|
|
10944
|
-
|
|
10873
|
+
var defaultDeps = () => ({
|
|
10874
|
+
createApp: runCreateApp,
|
|
10875
|
+
pathExists: defaultPathExists,
|
|
10876
|
+
isEmptyDir: defaultIsEmptyDir,
|
|
10877
|
+
runCommand: defaultRunCommand,
|
|
10878
|
+
startDetached: defaultStartDetached,
|
|
10879
|
+
openClaude: (appPath, prompt) => openClaudeWithSeed(appPath, prompt, process7.platform),
|
|
10880
|
+
resolvePnpm: defaultResolvePnpm,
|
|
10881
|
+
homeDir: homedir,
|
|
10882
|
+
env: process7.env,
|
|
10883
|
+
platform: process7.platform
|
|
10884
|
+
});
|
|
10885
|
+
var formatSessionOneLines = (result) => {
|
|
10886
|
+
if (result.appPath === null) {
|
|
10887
|
+
return [
|
|
10888
|
+
"",
|
|
10889
|
+
"Session #1: could not create your first app automatically.",
|
|
10890
|
+
" Run: npx vybekiit create app --web",
|
|
10891
|
+
' Then open that folder in Claude Code and say: "Set up my app."',
|
|
10892
|
+
""
|
|
10893
|
+
];
|
|
10894
|
+
}
|
|
10895
|
+
const lines = [
|
|
10896
|
+
"",
|
|
10897
|
+
result.created ? `\u2705 Your first web app is ready at ${result.appPath}` : `\u2705 Using your app at ${result.appPath}`
|
|
10898
|
+
];
|
|
10899
|
+
if (result.depsInstalled) {
|
|
10900
|
+
lines.push(" \u2022 Dependencies installed");
|
|
10901
|
+
} else {
|
|
10902
|
+
lines.push(" \u2022 Dependencies still need install \u2014 in that folder run: pnpm install");
|
|
10903
|
+
}
|
|
10904
|
+
if (result.packagesBuilt) {
|
|
10905
|
+
lines.push(" \u2022 Kit packages built for local preview");
|
|
10906
|
+
} else if (result.depsInstalled) {
|
|
10907
|
+
lines.push(" \u2022 Kit packages still need a build \u2014 in that folder run: pnpm build:packages");
|
|
10908
|
+
}
|
|
10909
|
+
if (result.devStarted) {
|
|
10910
|
+
lines.push(" \u2022 Preview starting at http://localhost:3000");
|
|
10911
|
+
} else if (result.depsInstalled && result.packagesBuilt) {
|
|
10912
|
+
lines.push(" \u2022 Preview not started \u2014 in that folder run: pnpm dev");
|
|
10913
|
+
}
|
|
10914
|
+
if (result.claudeOpened) {
|
|
10915
|
+
lines.push(' \u2022 Claude Code opening with: "Set up my app."');
|
|
10916
|
+
} else {
|
|
10917
|
+
lines.push(' \u2022 Open Claude Code in that folder and say: "Set up my app."');
|
|
10918
|
+
lines.push(` cd ${result.appPath} && claude "Set up my app."`);
|
|
10919
|
+
}
|
|
10920
|
+
lines.push(
|
|
10921
|
+
"",
|
|
10922
|
+
"Report mode is built in \u2014 if something looks wrong, press Option+Shift+R",
|
|
10923
|
+
"(Alt+Shift+R on Windows), click it, and tell Claude what is off.",
|
|
10924
|
+
""
|
|
10925
|
+
);
|
|
10926
|
+
return lines;
|
|
10927
|
+
};
|
|
10928
|
+
var runSessionOne = async (deps = defaultDeps()) => {
|
|
10929
|
+
const appPath = resolveFirstAppPath(deps);
|
|
10930
|
+
const exists3 = await deps.pathExists(appPath);
|
|
10931
|
+
const empty = exists3 ? await deps.isEmptyDir(appPath) : true;
|
|
10932
|
+
let created = false;
|
|
10933
|
+
if (exists3 && !empty) {
|
|
10934
|
+
const looksLikeKit = await deps.pathExists(join12(appPath, "templates", "web"));
|
|
10935
|
+
if (!looksLikeKit) {
|
|
10936
|
+
const failed = {
|
|
10937
|
+
appPath: null,
|
|
10938
|
+
created: false,
|
|
10939
|
+
depsInstalled: false,
|
|
10940
|
+
packagesBuilt: false,
|
|
10941
|
+
devStarted: false,
|
|
10942
|
+
claudeOpened: false
|
|
10943
|
+
};
|
|
10944
|
+
return {
|
|
10945
|
+
...failed,
|
|
10946
|
+
lines: [
|
|
10947
|
+
"",
|
|
10948
|
+
`Session #1: ${appPath} already exists and is not a VybeKiit app.`,
|
|
10949
|
+
" Pick a free folder and run: npx vybekiit create app --web ~/my-app",
|
|
10950
|
+
" Or set VYBEKIIT_FIRST_APP_DIR and re-run install once.",
|
|
10951
|
+
""
|
|
10952
|
+
]
|
|
10953
|
+
};
|
|
10954
|
+
}
|
|
10955
|
+
} else {
|
|
10956
|
+
process7.stdout.write(`
|
|
10957
|
+
Creating your first web app at ${appPath}\u2026
|
|
10958
|
+
`);
|
|
10959
|
+
const code = await deps.createApp(["--web", appPath]);
|
|
10960
|
+
if (code !== 0) {
|
|
10961
|
+
const failed = {
|
|
10962
|
+
appPath: null,
|
|
10963
|
+
created: false,
|
|
10964
|
+
depsInstalled: false,
|
|
10965
|
+
packagesBuilt: false,
|
|
10966
|
+
devStarted: false,
|
|
10967
|
+
claudeOpened: false
|
|
10968
|
+
};
|
|
10969
|
+
return { ...failed, lines: formatSessionOneLines(failed) };
|
|
10970
|
+
}
|
|
10971
|
+
created = true;
|
|
10972
|
+
}
|
|
10973
|
+
const pnpm = await deps.resolvePnpm();
|
|
10974
|
+
if (pnpm === null) {
|
|
10975
|
+
const partial = {
|
|
10976
|
+
appPath,
|
|
10977
|
+
created,
|
|
10978
|
+
depsInstalled: false,
|
|
10979
|
+
packagesBuilt: false,
|
|
10980
|
+
devStarted: false,
|
|
10981
|
+
claudeOpened: false
|
|
10982
|
+
};
|
|
10983
|
+
const claudeOpened2 = await deps.openClaude(appPath, SESSION_ONE_SEED_PROMPT);
|
|
10984
|
+
return {
|
|
10985
|
+
...partial,
|
|
10986
|
+
claudeOpened: claudeOpened2,
|
|
10987
|
+
lines: formatSessionOneLines({ ...partial, claudeOpened: claudeOpened2 })
|
|
10988
|
+
};
|
|
10989
|
+
}
|
|
10990
|
+
const [pnpmBin, ...pnpmPrefix] = pnpm;
|
|
10991
|
+
process7.stdout.write("\nInstalling dependencies (this can take a few minutes)\u2026\n");
|
|
10992
|
+
const install = await deps.runCommand(appPath, pnpmBin, [...pnpmPrefix, "install"]);
|
|
10993
|
+
const depsInstalled = install.code === 0;
|
|
10994
|
+
let packagesBuilt = false;
|
|
10995
|
+
if (depsInstalled) {
|
|
10996
|
+
process7.stdout.write("\nBuilding kit packages for preview\u2026\n");
|
|
10997
|
+
const build = await deps.runCommand(appPath, pnpmBin, [...pnpmPrefix, "build:packages"]);
|
|
10998
|
+
packagesBuilt = build.code === 0;
|
|
10999
|
+
}
|
|
11000
|
+
let devStarted = false;
|
|
11001
|
+
if (depsInstalled && packagesBuilt) {
|
|
11002
|
+
devStarted = deps.startDetached(appPath, pnpmBin, [...pnpmPrefix, "dev"]);
|
|
11003
|
+
}
|
|
11004
|
+
const claudeOpened = await deps.openClaude(appPath, SESSION_ONE_SEED_PROMPT);
|
|
11005
|
+
const outcome = {
|
|
11006
|
+
appPath,
|
|
11007
|
+
created,
|
|
11008
|
+
depsInstalled,
|
|
11009
|
+
packagesBuilt,
|
|
11010
|
+
devStarted,
|
|
11011
|
+
claudeOpened
|
|
11012
|
+
};
|
|
11013
|
+
return { ...outcome, lines: formatSessionOneLines(outcome) };
|
|
11014
|
+
};
|
|
11015
|
+
|
|
11016
|
+
// src/commands/createUiLibrary.ts
|
|
11017
|
+
var DEFAULT_UI_LIBRARY_DIR_NAME = "vybekiit-ui-library";
|
|
11018
|
+
var UI_LIBRARY_GALLERY_URL = "https://ui.vybekiit.com";
|
|
11019
|
+
var UI_LIBRARY_SEED_PROMPT = `I opened my VybeKiit UI library workspace.
|
|
11020
|
+
|
|
11021
|
+
Work ONLY in this folder (the kit workspace). Do not claim the UI library is missing.
|
|
11022
|
+
|
|
11023
|
+
1. Confirm packages/ui (@vybekiit/ui) and templates/web/.vybekiit/agent/ui-catalog-index.json exist.
|
|
11024
|
+
2. Use the vybekiit MCP UI tools (list_ui_sources, search, get_component, suggest_ui_blend).
|
|
11025
|
+
3. Tell me how many sources/components the catalog has, then help me pick and use components.
|
|
11026
|
+
4. Report mode is built in \u2014 Option+Shift+R (Alt+Shift+R on Windows) for point-and-fix.
|
|
11027
|
+
|
|
11028
|
+
Speak plain language. One step at a time.`;
|
|
11029
|
+
var isUiLibraryCreateArgs = (args) => {
|
|
11030
|
+
if (args.length === 0) {
|
|
11031
|
+
return false;
|
|
11032
|
+
}
|
|
11033
|
+
const first = args[0];
|
|
11034
|
+
if (first === "--ui-library" || first === "ui-library") {
|
|
11035
|
+
return true;
|
|
11036
|
+
}
|
|
11037
|
+
if (first === "app") {
|
|
11038
|
+
return args.includes("--ui-library") || args.includes("ui-library");
|
|
11039
|
+
}
|
|
11040
|
+
return false;
|
|
11041
|
+
};
|
|
11042
|
+
var parseCreateUiLibraryArgs = (args, deps) => {
|
|
11043
|
+
const openGallery = !args.includes("--no-gallery");
|
|
11044
|
+
const skipClaude = args.includes("--skip-claude");
|
|
11045
|
+
const skipDev = args.includes("--skip-dev");
|
|
11046
|
+
const positionals = args.filter((arg) => {
|
|
11047
|
+
if (arg.startsWith("-")) {
|
|
11048
|
+
return false;
|
|
11049
|
+
}
|
|
11050
|
+
if (arg === "app" || arg === "ui-library") {
|
|
11051
|
+
return false;
|
|
11052
|
+
}
|
|
11053
|
+
return true;
|
|
11054
|
+
});
|
|
11055
|
+
const explicit = positionals[0];
|
|
11056
|
+
if (explicit !== void 0 && explicit !== "") {
|
|
11057
|
+
const destPath = explicit.startsWith("/") || /^[A-Za-z]:[\\/]/.test(explicit) ? explicit : resolve4(deps.cwd(), explicit);
|
|
11058
|
+
return { destPath, openGallery, skipClaude, skipDev };
|
|
11059
|
+
}
|
|
11060
|
+
const override = deps.env.VYBEKIIT_UI_LIBRARY_DIR?.trim();
|
|
11061
|
+
if (override !== void 0 && override !== "") {
|
|
11062
|
+
const destPath = override.startsWith("/") || /^[A-Za-z]:[\\/]/.test(override) ? override : join13(deps.homeDir(), override);
|
|
11063
|
+
return { destPath, openGallery, skipClaude, skipDev };
|
|
11064
|
+
}
|
|
11065
|
+
return {
|
|
11066
|
+
destPath: join13(deps.homeDir(), DEFAULT_UI_LIBRARY_DIR_NAME),
|
|
11067
|
+
openGallery,
|
|
11068
|
+
skipClaude,
|
|
11069
|
+
skipDev
|
|
11070
|
+
};
|
|
11071
|
+
};
|
|
11072
|
+
var defaultPathExists2 = async (path) => {
|
|
11073
|
+
try {
|
|
11074
|
+
await access8(path);
|
|
11075
|
+
return true;
|
|
11076
|
+
} catch {
|
|
11077
|
+
return false;
|
|
11078
|
+
}
|
|
11079
|
+
};
|
|
11080
|
+
var defaultIsEmptyDir2 = async (path) => {
|
|
11081
|
+
try {
|
|
11082
|
+
const entries = await readdir7(path);
|
|
11083
|
+
return entries.length === 0;
|
|
11084
|
+
} catch {
|
|
11085
|
+
return true;
|
|
11086
|
+
}
|
|
11087
|
+
};
|
|
11088
|
+
var defaultRunCommand2 = async (cwd, bin, args) => await new Promise((resolvePromise) => {
|
|
11089
|
+
const child = spawn2(bin, [...args], {
|
|
11090
|
+
cwd,
|
|
11091
|
+
stdio: ["ignore", "inherit", "inherit"],
|
|
11092
|
+
env: process8.env
|
|
11093
|
+
});
|
|
11094
|
+
child.on("error", () => {
|
|
11095
|
+
resolvePromise({ code: 127 });
|
|
11096
|
+
});
|
|
11097
|
+
child.on("close", (code) => {
|
|
11098
|
+
resolvePromise({ code: code ?? 1 });
|
|
11099
|
+
});
|
|
11100
|
+
});
|
|
11101
|
+
var defaultStartDetached2 = (cwd, bin, args) => {
|
|
11102
|
+
try {
|
|
11103
|
+
const child = spawn2(bin, [...args], {
|
|
11104
|
+
cwd,
|
|
11105
|
+
detached: true,
|
|
11106
|
+
stdio: "ignore",
|
|
11107
|
+
env: process8.env
|
|
11108
|
+
});
|
|
11109
|
+
child.unref();
|
|
11110
|
+
return true;
|
|
11111
|
+
} catch {
|
|
11112
|
+
return false;
|
|
11113
|
+
}
|
|
11114
|
+
};
|
|
11115
|
+
var defaultOpenUrl = async (url) => {
|
|
11116
|
+
try {
|
|
11117
|
+
await open(url);
|
|
11118
|
+
return true;
|
|
11119
|
+
} catch {
|
|
11120
|
+
return false;
|
|
11121
|
+
}
|
|
11122
|
+
};
|
|
11123
|
+
var defaultResolvePnpm2 = async () => {
|
|
11124
|
+
const tryBin = async (bin, checkArgs) => {
|
|
11125
|
+
const result = await defaultRunCommand2(process8.cwd(), bin, [...checkArgs]);
|
|
11126
|
+
return result.code === 0;
|
|
11127
|
+
};
|
|
11128
|
+
if (await tryBin("pnpm", ["--version"])) {
|
|
11129
|
+
return ["pnpm"];
|
|
11130
|
+
}
|
|
11131
|
+
if (await tryBin("npx", ["-y", "pnpm@10.33.2", "--version"])) {
|
|
11132
|
+
return ["npx", "-y", "pnpm@10.33.2"];
|
|
11133
|
+
}
|
|
11134
|
+
return null;
|
|
11135
|
+
};
|
|
11136
|
+
var defaultDeps2 = () => ({
|
|
11137
|
+
createApp: runCreateApp,
|
|
11138
|
+
pathExists: defaultPathExists2,
|
|
11139
|
+
isEmptyDir: defaultIsEmptyDir2,
|
|
11140
|
+
runCommand: defaultRunCommand2,
|
|
11141
|
+
startDetached: defaultStartDetached2,
|
|
11142
|
+
openClaude: (appPath, prompt) => openClaudeWithSeed(appPath, prompt, process8.platform),
|
|
11143
|
+
openUrl: defaultOpenUrl,
|
|
11144
|
+
resolvePnpm: defaultResolvePnpm2,
|
|
11145
|
+
homeDir: homedir2,
|
|
11146
|
+
env: process8.env,
|
|
11147
|
+
platform: process8.platform,
|
|
11148
|
+
cwd: () => process8.cwd()
|
|
11149
|
+
});
|
|
11150
|
+
var formatCreateUiLibraryLines = (result) => {
|
|
11151
|
+
const lines = ["", "UI library ready path:"];
|
|
11152
|
+
if (result.appPath === null) {
|
|
11153
|
+
lines.push(" \u2022 Could not create or open a kit workspace.");
|
|
11154
|
+
lines.push(" \u2022 Accept the GitHub invite, run: gh auth login --web");
|
|
11155
|
+
lines.push(" \u2022 Then: npx -y vybekiit@latest create --ui-library");
|
|
11156
|
+
lines.push("");
|
|
11157
|
+
return lines;
|
|
11158
|
+
}
|
|
11159
|
+
lines.push(` \u2022 Kit workspace: ${result.appPath}`);
|
|
11160
|
+
if (result.created) {
|
|
11161
|
+
lines.push(" \u2022 Created a new web kit with @vybekiit/ui + mirrored components");
|
|
11162
|
+
} else {
|
|
11163
|
+
lines.push(" \u2022 Reused existing kit workspace");
|
|
11164
|
+
}
|
|
11165
|
+
if (result.depsInstalled) {
|
|
11166
|
+
lines.push(" \u2022 Dependencies installed");
|
|
11167
|
+
} else {
|
|
11168
|
+
lines.push(" \u2022 Install deps next: cd that folder && pnpm install");
|
|
11169
|
+
}
|
|
11170
|
+
if (result.packagesBuilt) {
|
|
11171
|
+
lines.push(" \u2022 Kit packages built");
|
|
11172
|
+
} else if (result.depsInstalled) {
|
|
11173
|
+
lines.push(" \u2022 Build packages: pnpm build:packages");
|
|
11174
|
+
}
|
|
11175
|
+
if (result.devStarted) {
|
|
11176
|
+
lines.push(" \u2022 Local app preview starting (http://localhost:3000)");
|
|
11177
|
+
}
|
|
11178
|
+
if (result.galleryOpened) {
|
|
11179
|
+
lines.push(` \u2022 UI gallery opened: ${UI_LIBRARY_GALLERY_URL}`);
|
|
11180
|
+
} else {
|
|
11181
|
+
lines.push(` \u2022 Browse the gallery: ${UI_LIBRARY_GALLERY_URL}`);
|
|
11182
|
+
}
|
|
11183
|
+
lines.push(" \u2022 Report mode: Option+Shift+R (Alt+Shift+R on Windows)");
|
|
11184
|
+
if (result.claudeOpened) {
|
|
11185
|
+
lines.push(" \u2022 Claude Code opening in the kit folder with UI-library instructions");
|
|
11186
|
+
} else {
|
|
11187
|
+
lines.push(
|
|
11188
|
+
` \u2022 Open Claude in that folder: cd ${result.appPath} && claude ${JSON.stringify(UI_LIBRARY_SEED_PROMPT.slice(0, 40))}\u2026`
|
|
11189
|
+
);
|
|
11190
|
+
}
|
|
11191
|
+
lines.push(
|
|
11192
|
+
"",
|
|
11193
|
+
"Claude must work inside this folder \u2014 that is where MCP UI search and @vybekiit/ui live.",
|
|
11194
|
+
""
|
|
11195
|
+
);
|
|
11196
|
+
return lines;
|
|
11197
|
+
};
|
|
11198
|
+
var runCreateUiLibrary = async (args = [], deps = defaultDeps2()) => {
|
|
11199
|
+
const inputs = parseCreateUiLibraryArgs(args, deps);
|
|
11200
|
+
const appPath = inputs.destPath;
|
|
11201
|
+
const exists3 = await deps.pathExists(appPath);
|
|
11202
|
+
const empty = exists3 ? await deps.isEmptyDir(appPath) : true;
|
|
11203
|
+
let created = false;
|
|
11204
|
+
if (exists3 && !empty) {
|
|
11205
|
+
const looksLikeKit = await deps.pathExists(join13(appPath, "templates", "web"));
|
|
11206
|
+
if (!looksLikeKit) {
|
|
11207
|
+
const failed = {
|
|
11208
|
+
exitCode: 1,
|
|
11209
|
+
appPath: null,
|
|
11210
|
+
created: false,
|
|
11211
|
+
depsInstalled: false,
|
|
11212
|
+
packagesBuilt: false,
|
|
11213
|
+
devStarted: false,
|
|
11214
|
+
galleryOpened: false,
|
|
11215
|
+
claudeOpened: false
|
|
11216
|
+
};
|
|
11217
|
+
return {
|
|
11218
|
+
...failed,
|
|
11219
|
+
lines: [
|
|
11220
|
+
"",
|
|
11221
|
+
`${appPath} already exists and is not a VybeKiit kit workspace.`,
|
|
11222
|
+
" Pick a free folder: npx -y vybekiit@latest create --ui-library ~/my-ui-kit",
|
|
11223
|
+
" Or set VYBEKIIT_UI_LIBRARY_DIR and re-run.",
|
|
11224
|
+
""
|
|
11225
|
+
]
|
|
11226
|
+
};
|
|
11227
|
+
}
|
|
11228
|
+
} else {
|
|
11229
|
+
process8.stdout.write(`
|
|
11230
|
+
Creating UI library kit workspace at ${appPath}\u2026
|
|
11231
|
+
`);
|
|
11232
|
+
const code = await deps.createApp(["--web", appPath]);
|
|
11233
|
+
if (code !== 0) {
|
|
11234
|
+
const failed = {
|
|
11235
|
+
exitCode: 1,
|
|
11236
|
+
appPath: null,
|
|
11237
|
+
created: false,
|
|
11238
|
+
depsInstalled: false,
|
|
11239
|
+
packagesBuilt: false,
|
|
11240
|
+
devStarted: false,
|
|
11241
|
+
galleryOpened: false,
|
|
11242
|
+
claudeOpened: false
|
|
11243
|
+
};
|
|
11244
|
+
return { ...failed, lines: formatCreateUiLibraryLines(failed) };
|
|
11245
|
+
}
|
|
11246
|
+
created = true;
|
|
11247
|
+
}
|
|
11248
|
+
const pnpm = await deps.resolvePnpm();
|
|
11249
|
+
let depsInstalled = false;
|
|
11250
|
+
let packagesBuilt = false;
|
|
11251
|
+
let devStarted = false;
|
|
11252
|
+
if (pnpm !== null) {
|
|
11253
|
+
const [pnpmBin, ...pnpmPrefix] = pnpm;
|
|
11254
|
+
process8.stdout.write("\nInstalling dependencies (this can take a few minutes)\u2026\n");
|
|
11255
|
+
const install = await deps.runCommand(appPath, pnpmBin, [...pnpmPrefix, "install"]);
|
|
11256
|
+
depsInstalled = install.code === 0;
|
|
11257
|
+
if (depsInstalled) {
|
|
11258
|
+
process8.stdout.write("\nBuilding kit packages\u2026\n");
|
|
11259
|
+
const build = await deps.runCommand(appPath, pnpmBin, [...pnpmPrefix, "build:packages"]);
|
|
11260
|
+
packagesBuilt = build.code === 0;
|
|
11261
|
+
}
|
|
11262
|
+
if (!inputs.skipDev && depsInstalled && packagesBuilt) {
|
|
11263
|
+
devStarted = deps.startDetached(appPath, pnpmBin, [...pnpmPrefix, "dev"]);
|
|
11264
|
+
}
|
|
11265
|
+
}
|
|
11266
|
+
let galleryOpened = false;
|
|
11267
|
+
if (inputs.openGallery) {
|
|
11268
|
+
process8.stdout.write(`
|
|
11269
|
+
Opening UI gallery: ${UI_LIBRARY_GALLERY_URL}
|
|
11270
|
+
`);
|
|
11271
|
+
galleryOpened = await deps.openUrl(UI_LIBRARY_GALLERY_URL);
|
|
11272
|
+
}
|
|
11273
|
+
let claudeOpened = false;
|
|
11274
|
+
if (!inputs.skipClaude) {
|
|
11275
|
+
claudeOpened = await deps.openClaude(appPath, UI_LIBRARY_SEED_PROMPT);
|
|
11276
|
+
}
|
|
11277
|
+
const outcome = {
|
|
11278
|
+
exitCode: 0,
|
|
11279
|
+
appPath,
|
|
11280
|
+
created,
|
|
11281
|
+
depsInstalled,
|
|
11282
|
+
packagesBuilt,
|
|
11283
|
+
devStarted,
|
|
11284
|
+
galleryOpened,
|
|
11285
|
+
claudeOpened
|
|
11286
|
+
};
|
|
11287
|
+
return { ...outcome, lines: formatCreateUiLibraryLines(outcome) };
|
|
11288
|
+
};
|
|
11289
|
+
var runCreateUiLibraryCommand = async (args) => {
|
|
11290
|
+
const result = await runCreateUiLibrary(args);
|
|
11291
|
+
for (const line of result.lines) {
|
|
11292
|
+
process8.stdout.write(`${line}
|
|
11293
|
+
`);
|
|
11294
|
+
}
|
|
11295
|
+
return result.exitCode;
|
|
11296
|
+
};
|
|
11297
|
+
|
|
11298
|
+
// src/commands/dedup.ts
|
|
11299
|
+
import { execFile as execFile5 } from "child_process";
|
|
11300
|
+
import { existsSync as existsSync3 } from "fs";
|
|
11301
|
+
import { dirname as dirname6, resolve as resolve5 } from "path";
|
|
11302
|
+
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
11303
|
+
import { promisify as promisify4 } from "util";
|
|
11304
|
+
var execFileAsync4 = promisify4(execFile5);
|
|
11305
|
+
var HERE3 = dirname6(fileURLToPath3(import.meta.url));
|
|
11306
|
+
var findBinary = () => {
|
|
11307
|
+
const devBinary = resolve5(HERE3, "../../tools/dedup/target/release/vybekiit-dedup");
|
|
11308
|
+
if (existsSync3(devBinary)) {
|
|
11309
|
+
return devBinary;
|
|
11310
|
+
}
|
|
11311
|
+
const debugBinary = resolve5(HERE3, "../../tools/dedup/target/debug/vybekiit-dedup");
|
|
11312
|
+
if (existsSync3(debugBinary)) {
|
|
11313
|
+
return debugBinary;
|
|
11314
|
+
}
|
|
11315
|
+
return "vybekiit-dedup";
|
|
11316
|
+
};
|
|
11317
|
+
var readExecFileError = (error) => {
|
|
11318
|
+
if (typeof error !== "object" || error === null) {
|
|
11319
|
+
return;
|
|
11320
|
+
}
|
|
11321
|
+
if (!("stdout" in error)) {
|
|
11322
|
+
return;
|
|
11323
|
+
}
|
|
11324
|
+
return error;
|
|
11325
|
+
};
|
|
11326
|
+
var formatDedupExecError = (error) => {
|
|
11327
|
+
const execError = readExecFileError(error);
|
|
11328
|
+
if (execError !== void 0) {
|
|
11329
|
+
const stderr = typeof execError.stderr === "string" ? execError.stderr : "";
|
|
11330
|
+
const stdout = typeof execError.stdout === "string" ? execError.stdout : "";
|
|
11331
|
+
const exitCode = typeof execError.code === "number" ? execError.code : 1;
|
|
11332
|
+
if (stderr !== "") {
|
|
11333
|
+
process.stderr.write(stderr);
|
|
11334
|
+
}
|
|
11335
|
+
return { exitCode, output: stdout };
|
|
11336
|
+
}
|
|
11337
|
+
return {
|
|
11338
|
+
exitCode: 1,
|
|
11339
|
+
output: JSON.stringify({
|
|
11340
|
+
error: `Failed to run vybekiit-dedup: ${caughtMessage(error)}`
|
|
11341
|
+
})
|
|
11342
|
+
};
|
|
11343
|
+
};
|
|
11344
|
+
var runDedupBinary = async (binary, args) => {
|
|
11345
|
+
try {
|
|
11346
|
+
const { stdout, stderr } = await execFileAsync4(binary, args, {
|
|
11347
|
+
cwd: process.cwd(),
|
|
11348
|
+
timeout: 3e4,
|
|
11349
|
+
maxBuffer: 10 * 1024 * 1024
|
|
11350
|
+
});
|
|
11351
|
+
if (stderr !== "") {
|
|
11352
|
+
process.stderr.write(stderr);
|
|
11353
|
+
}
|
|
11354
|
+
return { exitCode: 0, output: stdout };
|
|
11355
|
+
} catch (error) {
|
|
11356
|
+
return formatDedupExecError(error);
|
|
11357
|
+
}
|
|
11358
|
+
};
|
|
11359
|
+
var runDedup = async (args) => runDedupBinary(findBinary(), args);
|
|
11360
|
+
|
|
11361
|
+
// src/commands/docFallback.ts
|
|
11362
|
+
var runDocFallback = (args) => {
|
|
11363
|
+
const [techId, packageName] = args;
|
|
11364
|
+
if (!techId) {
|
|
11365
|
+
return {
|
|
11366
|
+
json: JSON.stringify({ error: "Usage: vybekiit doc-fallback <tech-id>" }),
|
|
11367
|
+
exitCode: 1
|
|
11368
|
+
};
|
|
11369
|
+
}
|
|
11370
|
+
const plan = planDocFallback(techId, packageName);
|
|
11371
|
+
return { json: JSON.stringify(plan, null, 2), exitCode: plan.found ? 0 : 1 };
|
|
11372
|
+
};
|
|
11373
|
+
|
|
11374
|
+
// src/commands/drop.ts
|
|
11375
|
+
import { join as join15, resolve as resolve7 } from "path";
|
|
11376
|
+
|
|
11377
|
+
// src/commands/dropFiles.ts
|
|
11378
|
+
import { access as access9, cp as cp3, mkdir as mkdir5, readdir as readdir8, readFile as readFile6, writeFile as writeFile5 } from "fs/promises";
|
|
11379
|
+
import { dirname as dirname7, join as join14 } from "path";
|
|
11380
|
+
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
11381
|
+
var HERE4 = dirname7(fileURLToPath4(import.meta.url));
|
|
11382
|
+
var resolveDropTemplateSource = async (template) => {
|
|
11383
|
+
const monorepoTemplates = join14(HERE4, "..", "..", "..", "templates");
|
|
11384
|
+
try {
|
|
11385
|
+
await access9(join14(monorepoTemplates, template));
|
|
11386
|
+
return { source: monorepoTemplates };
|
|
11387
|
+
} catch {
|
|
11388
|
+
const { cleanup, source } = await resolveTemplatesSource(template);
|
|
11389
|
+
if (cleanup === void 0) {
|
|
11390
|
+
return { source };
|
|
11391
|
+
}
|
|
11392
|
+
return { cleanup, source };
|
|
11393
|
+
}
|
|
11394
|
+
};
|
|
11395
|
+
var readDropDestinationState = async (dest) => {
|
|
11396
|
+
try {
|
|
11397
|
+
await access9(dest);
|
|
11398
|
+
const contents = await readdir8(dest);
|
|
11399
|
+
return { exists: true, hasFiles: contents.length > 0 };
|
|
11400
|
+
} catch {
|
|
11401
|
+
return { exists: false, hasFiles: false };
|
|
11402
|
+
}
|
|
11403
|
+
};
|
|
11404
|
+
var shouldBlockDestination = (flags, state) => state.hasFiles && !flags.force && !flags.merge;
|
|
11405
|
+
var listTemplateFiles = async (dir, prefix = "") => {
|
|
11406
|
+
try {
|
|
11407
|
+
const entries = await readdir8(dir, { withFileTypes: true });
|
|
11408
|
+
const nestedFiles = await Promise.all(
|
|
11409
|
+
entries.map(async (entry) => {
|
|
11410
|
+
const rel = prefix === "" ? entry.name : `${prefix}/${entry.name}`;
|
|
11411
|
+
if (!shouldCopyDropPath(rel)) {
|
|
11412
|
+
return [];
|
|
11413
|
+
}
|
|
11414
|
+
if (entry.isDirectory()) {
|
|
11415
|
+
return await listTemplateFiles(join14(dir, entry.name), rel);
|
|
11416
|
+
}
|
|
11417
|
+
return [rel];
|
|
11418
|
+
})
|
|
11419
|
+
);
|
|
11420
|
+
return nestedFiles.flat();
|
|
11421
|
+
} catch {
|
|
11422
|
+
return [];
|
|
11423
|
+
}
|
|
11424
|
+
};
|
|
11425
|
+
var copyDropTemplate = async (context) => {
|
|
11426
|
+
const { dest, flags, templateDir } = context;
|
|
11427
|
+
await mkdir5(dest, { recursive: true });
|
|
11428
|
+
await cp3(templateDir, dest, {
|
|
11429
|
+
recursive: true,
|
|
11430
|
+
force: !flags.merge,
|
|
11431
|
+
filter: (src) => {
|
|
11432
|
+
if (!shouldCopyDropPath(src)) {
|
|
11433
|
+
return false;
|
|
11434
|
+
}
|
|
11435
|
+
return true;
|
|
11436
|
+
}
|
|
11437
|
+
});
|
|
11438
|
+
};
|
|
11439
|
+
var pinDeps = async (dest) => {
|
|
11440
|
+
const pkgPath = join14(dest, "package.json");
|
|
11441
|
+
try {
|
|
11442
|
+
const raw = await readFile6(pkgPath, "utf8");
|
|
11443
|
+
const pkg = JSON.parse(raw);
|
|
11444
|
+
for (const field of ["dependencies", "devDependencies"]) {
|
|
11445
|
+
const deps = pkg[field];
|
|
11446
|
+
if (deps !== void 0) {
|
|
11447
|
+
for (const [key, value] of Object.entries(deps)) {
|
|
11448
|
+
if (value === "workspace:*" || value.startsWith("workspace:")) {
|
|
11449
|
+
deps[key] = "*";
|
|
11450
|
+
}
|
|
11451
|
+
}
|
|
11452
|
+
}
|
|
11453
|
+
}
|
|
11454
|
+
await writeFile5(pkgPath, `${JSON.stringify(pkg, null, 2)}
|
|
11455
|
+
`);
|
|
11456
|
+
} catch {
|
|
11457
|
+
}
|
|
11458
|
+
};
|
|
11459
|
+
var cleanupDropSource = async (cleanup) => {
|
|
11460
|
+
if (cleanup !== void 0) {
|
|
11461
|
+
await cleanup();
|
|
11462
|
+
}
|
|
11463
|
+
};
|
|
11464
|
+
|
|
11465
|
+
// src/commands/dropInput.ts
|
|
11466
|
+
import { resolve as resolve6 } from "path";
|
|
11467
|
+
|
|
11468
|
+
// src/lib/argvFlags.ts
|
|
11469
|
+
var readFlagValue = (args, name) => {
|
|
11470
|
+
const eqPrefix = `--${name}=`;
|
|
11471
|
+
const bare = `--${name}`;
|
|
11472
|
+
let found;
|
|
11473
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
11474
|
+
const arg = args[index];
|
|
11475
|
+
if (arg === void 0) {
|
|
11476
|
+
} else if (arg.startsWith(eqPrefix)) {
|
|
11477
|
+
const value = arg.slice(eqPrefix.length);
|
|
11478
|
+
if (value !== "") {
|
|
11479
|
+
found = value;
|
|
11480
|
+
break;
|
|
11481
|
+
}
|
|
11482
|
+
} else if (arg === bare) {
|
|
11483
|
+
const next = args[index + 1];
|
|
11484
|
+
if (next !== void 0 && !next.startsWith("--") && next !== "") {
|
|
11485
|
+
found = next;
|
|
11486
|
+
break;
|
|
11487
|
+
}
|
|
11488
|
+
}
|
|
11489
|
+
}
|
|
11490
|
+
return found;
|
|
11491
|
+
};
|
|
11492
|
+
var isValueOfKnownFlag = (args, index, valueNames) => {
|
|
11493
|
+
if (index === 0) {
|
|
11494
|
+
return false;
|
|
11495
|
+
}
|
|
11496
|
+
const prev = args[index - 1];
|
|
11497
|
+
if (prev === void 0 || !prev.startsWith("--")) {
|
|
11498
|
+
return false;
|
|
11499
|
+
}
|
|
11500
|
+
const name = prev.slice(2);
|
|
11501
|
+
return valueNames.includes(name);
|
|
11502
|
+
};
|
|
11503
|
+
var filterPositionals = (args, valueNames) => args.filter((arg, index) => {
|
|
11504
|
+
if (arg.startsWith("--")) {
|
|
11505
|
+
return false;
|
|
11506
|
+
}
|
|
11507
|
+
if (isValueOfKnownFlag(args, index, valueNames)) {
|
|
11508
|
+
return false;
|
|
11509
|
+
}
|
|
11510
|
+
return true;
|
|
11511
|
+
});
|
|
11512
|
+
var hasBoolFlag = (args, name) => args.includes(`--${name}`);
|
|
10945
11513
|
|
|
10946
11514
|
// src/commands/dropTypes.ts
|
|
10947
11515
|
var DROP_MODE_LABELS = {
|
|
@@ -11054,7 +11622,7 @@ var promptForDropInputs = async (parsed) => {
|
|
|
11054
11622
|
}
|
|
11055
11623
|
const mode = dropMode(parsed.flags);
|
|
11056
11624
|
const confirmed = await confirm3({
|
|
11057
|
-
message: `Drop "${picked}" -> ${
|
|
11625
|
+
message: `Drop "${picked}" -> ${resolve6(destPath)}${mode === "new" ? "" : ` (${mode})`}?`
|
|
11058
11626
|
});
|
|
11059
11627
|
if (isCancel6(confirmed) || !confirmed) {
|
|
11060
11628
|
cancel4("Cancelled.");
|
|
@@ -11223,7 +11791,7 @@ var runDrop = async (args) => {
|
|
|
11223
11791
|
if (inputs === null) {
|
|
11224
11792
|
return 1;
|
|
11225
11793
|
}
|
|
11226
|
-
const dest =
|
|
11794
|
+
const dest = resolve7(process.cwd(), inputs.destPath);
|
|
11227
11795
|
let cleanup;
|
|
11228
11796
|
try {
|
|
11229
11797
|
const { cleanup: resolvedCleanup, source } = await resolveDropTemplateSource(inputs.template);
|
|
@@ -11231,7 +11799,7 @@ var runDrop = async (args) => {
|
|
|
11231
11799
|
const context = {
|
|
11232
11800
|
...inputs,
|
|
11233
11801
|
dest,
|
|
11234
|
-
templateDir:
|
|
11802
|
+
templateDir: join15(source, inputs.template)
|
|
11235
11803
|
};
|
|
11236
11804
|
const destination = await readDropDestinationState(dest);
|
|
11237
11805
|
if (shouldBlockDestination(inputs.flags, destination)) {
|
|
@@ -11252,9 +11820,9 @@ var runDrop = async (args) => {
|
|
|
11252
11820
|
};
|
|
11253
11821
|
|
|
11254
11822
|
// src/commands/feedbackCmd.ts
|
|
11255
|
-
import
|
|
11823
|
+
import process9 from "process";
|
|
11256
11824
|
import { confirm, isCancel } from "@clack/prompts";
|
|
11257
|
-
import
|
|
11825
|
+
import open2 from "open";
|
|
11258
11826
|
|
|
11259
11827
|
// src/feedback/feedbackClient.ts
|
|
11260
11828
|
import { Schema as Schema3 } from "effect";
|
|
@@ -11321,7 +11889,7 @@ var createFeedbackIntakeClient = (options = {}) => {
|
|
|
11321
11889
|
|
|
11322
11890
|
// src/feedback/feedbackFiles.ts
|
|
11323
11891
|
import { chmod, lstat as lstat2, mkdir as mkdir6, readFile as readFile7, realpath, rename, writeFile as writeFile6 } from "fs/promises";
|
|
11324
|
-
import { isAbsolute, join as
|
|
11892
|
+
import { isAbsolute, join as join16, relative } from "path";
|
|
11325
11893
|
var FeedbackFileError = class extends Error {
|
|
11326
11894
|
code;
|
|
11327
11895
|
constructor(code, message, cause) {
|
|
@@ -11335,7 +11903,7 @@ var isBeneath = (candidatePath, parentPath) => {
|
|
|
11335
11903
|
return pathFromParent !== "" && !pathFromParent.startsWith("..") && !isAbsolute(pathFromParent);
|
|
11336
11904
|
};
|
|
11337
11905
|
var readFeedbackDraft = async (draftPath, projectRoot) => {
|
|
11338
|
-
const draftsDirectory = await realpath(
|
|
11906
|
+
const draftsDirectory = await realpath(join16(projectRoot, ".vybekiit", "feedback-drafts"));
|
|
11339
11907
|
const draftEntry = await lstat2(draftPath).catch(() => void 0);
|
|
11340
11908
|
if (!draftEntry?.isFile() || draftEntry.isSymbolicLink()) {
|
|
11341
11909
|
throw new FeedbackFileError(
|
|
@@ -11370,8 +11938,8 @@ var readFeedbackDraft = async (draftPath, projectRoot) => {
|
|
|
11370
11938
|
}
|
|
11371
11939
|
};
|
|
11372
11940
|
var recordFeedbackSubmission = async (projectRoot, submission) => {
|
|
11373
|
-
const feedbackDirectory =
|
|
11374
|
-
const submissionsPath =
|
|
11941
|
+
const feedbackDirectory = join16(projectRoot, ".vybekiit");
|
|
11942
|
+
const submissionsPath = join16(feedbackDirectory, "feedback-submissions.json");
|
|
11375
11943
|
const temporaryPath = `${submissionsPath}.${process.pid}.tmp`;
|
|
11376
11944
|
await mkdir6(feedbackDirectory, { recursive: true, mode: 448 });
|
|
11377
11945
|
let submissions = [];
|
|
@@ -11395,17 +11963,17 @@ var recordFeedbackSubmission = async (projectRoot, submission) => {
|
|
|
11395
11963
|
|
|
11396
11964
|
// src/commands/feedbackCmd.ts
|
|
11397
11965
|
var defaultDependencies = () => ({
|
|
11398
|
-
projectRoot:
|
|
11966
|
+
projectRoot: process9.cwd(),
|
|
11399
11967
|
interactive: isInteractive(),
|
|
11400
11968
|
confirm: async () => {
|
|
11401
11969
|
const answer = await confirm({ message: "Send this private feedback report to VybeKiit?" });
|
|
11402
11970
|
return !isCancel(answer) && answer;
|
|
11403
11971
|
},
|
|
11404
|
-
openBrowser:
|
|
11405
|
-
sleep: async (milliseconds) => await new Promise((
|
|
11406
|
-
writeOutput: (message) =>
|
|
11972
|
+
openBrowser: open2,
|
|
11973
|
+
sleep: async (milliseconds) => await new Promise((resolve14) => setTimeout(resolve14, milliseconds)),
|
|
11974
|
+
writeOutput: (message) => process9.stdout.write(`${message}
|
|
11407
11975
|
`),
|
|
11408
|
-
writeError: (message) =>
|
|
11976
|
+
writeError: (message) => process9.stderr.write(`${message}
|
|
11409
11977
|
`),
|
|
11410
11978
|
now: () => /* @__PURE__ */ new Date(),
|
|
11411
11979
|
client: createFeedbackIntakeClient()
|
|
@@ -11488,21 +12056,21 @@ var runFeedback = async (args, suppliedDependencies) => {
|
|
|
11488
12056
|
};
|
|
11489
12057
|
|
|
11490
12058
|
// src/commands/init.ts
|
|
11491
|
-
import { join as
|
|
12059
|
+
import { join as join21 } from "path";
|
|
11492
12060
|
|
|
11493
12061
|
// src/commands/initAssets.ts
|
|
11494
|
-
import { execFile as
|
|
11495
|
-
import { cp as cp4, mkdir as mkdir7, readdir as
|
|
11496
|
-
import { dirname as dirname8, join as
|
|
12062
|
+
import { execFile as execFile6 } from "child_process";
|
|
12063
|
+
import { cp as cp4, mkdir as mkdir7, readdir as readdir9, readFile as readFile9, writeFile as writeFile7 } from "fs/promises";
|
|
12064
|
+
import { dirname as dirname8, join as join18 } from "path";
|
|
11497
12065
|
import { fileURLToPath as fileURLToPath5 } from "url";
|
|
11498
12066
|
import { promisify as promisify5 } from "util";
|
|
11499
12067
|
|
|
11500
12068
|
// src/commands/initTypes.ts
|
|
11501
|
-
import { access as
|
|
11502
|
-
import { join as
|
|
12069
|
+
import { access as access10, readFile as readFile8 } from "fs/promises";
|
|
12070
|
+
import { join as join17 } from "path";
|
|
11503
12071
|
var pathExists4 = async (path) => {
|
|
11504
12072
|
try {
|
|
11505
|
-
await
|
|
12073
|
+
await access10(path);
|
|
11506
12074
|
return true;
|
|
11507
12075
|
} catch {
|
|
11508
12076
|
return false;
|
|
@@ -11510,7 +12078,7 @@ var pathExists4 = async (path) => {
|
|
|
11510
12078
|
};
|
|
11511
12079
|
var readInitPackageJson = async (cwd) => {
|
|
11512
12080
|
try {
|
|
11513
|
-
const raw = await readFile8(
|
|
12081
|
+
const raw = await readFile8(join17(cwd, "package.json"), "utf8");
|
|
11514
12082
|
return JSON.parse(raw);
|
|
11515
12083
|
} catch {
|
|
11516
12084
|
return null;
|
|
@@ -11518,20 +12086,20 @@ var readInitPackageJson = async (cwd) => {
|
|
|
11518
12086
|
};
|
|
11519
12087
|
|
|
11520
12088
|
// src/commands/initAssets.ts
|
|
11521
|
-
var execFileAsync5 = promisify5(
|
|
12089
|
+
var execFileAsync5 = promisify5(execFile6);
|
|
11522
12090
|
var HERE5 = dirname8(fileURLToPath5(import.meta.url));
|
|
11523
12091
|
var copyClaudeHooks = async (cwd, templateDir) => {
|
|
11524
|
-
const claudeSource =
|
|
12092
|
+
const claudeSource = join18(templateDir, ".claude");
|
|
11525
12093
|
if (!await pathExists4(claudeSource)) {
|
|
11526
12094
|
process.stdout.write(" \u26A0\uFE0F Could not copy .claude hooks (source missing)\n");
|
|
11527
12095
|
return;
|
|
11528
12096
|
}
|
|
11529
|
-
await cp4(claudeSource,
|
|
12097
|
+
await cp4(claudeSource, join18(cwd, ".claude"), { recursive: true, force: true });
|
|
11530
12098
|
process.stdout.write(" \u2705 .claude/settings.json + hooks\n");
|
|
11531
12099
|
};
|
|
11532
12100
|
var copyWorkflows = async (cwd, templateDir, pm) => {
|
|
11533
|
-
const workflowsDir =
|
|
11534
|
-
const workflowsSource =
|
|
12101
|
+
const workflowsDir = join18(cwd, ".github", "workflows");
|
|
12102
|
+
const workflowsSource = join18(templateDir, ".github", "workflows");
|
|
11535
12103
|
if (!await pathExists4(workflowsSource)) {
|
|
11536
12104
|
process.stdout.write(" \u26A0\uFE0F Could not copy workflows (source missing)\n");
|
|
11537
12105
|
return;
|
|
@@ -11544,23 +12112,23 @@ var copyWorkflows = async (cwd, templateDir, pm) => {
|
|
|
11544
12112
|
process.stdout.write(" \u2705 .github/workflows/ (CI pipeline)\n");
|
|
11545
12113
|
};
|
|
11546
12114
|
var copyPrePushHook = async (cwd, templateDir) => {
|
|
11547
|
-
const huskySource =
|
|
12115
|
+
const huskySource = join18(templateDir, ".husky", "pre-push");
|
|
11548
12116
|
if (!await pathExists4(huskySource)) {
|
|
11549
12117
|
process.stdout.write(" \u26A0\uFE0F Could not copy pre-push hook\n");
|
|
11550
12118
|
return;
|
|
11551
12119
|
}
|
|
11552
|
-
const huskyDir =
|
|
12120
|
+
const huskyDir = join18(cwd, ".husky");
|
|
11553
12121
|
await mkdir7(huskyDir, { recursive: true });
|
|
11554
|
-
await cp4(huskySource,
|
|
12122
|
+
await cp4(huskySource, join18(huskyDir, "pre-push"), { force: true });
|
|
11555
12123
|
process.stdout.write(" \u2705 .husky/pre-push\n");
|
|
11556
12124
|
};
|
|
11557
12125
|
var copySecurityFile = async (cwd, templateDir) => {
|
|
11558
|
-
const dest =
|
|
12126
|
+
const dest = join18(cwd, "SECURITY.md");
|
|
11559
12127
|
if (await pathExists4(dest)) {
|
|
11560
12128
|
process.stdout.write(" \u2713 SECURITY.md (already exists)\n");
|
|
11561
12129
|
return;
|
|
11562
12130
|
}
|
|
11563
|
-
const source =
|
|
12131
|
+
const source = join18(templateDir, "SECURITY.md");
|
|
11564
12132
|
if (!await pathExists4(source)) {
|
|
11565
12133
|
process.stdout.write(" \u26A0\uFE0F Could not copy SECURITY.md\n");
|
|
11566
12134
|
return;
|
|
@@ -11569,8 +12137,8 @@ var copySecurityFile = async (cwd, templateDir) => {
|
|
|
11569
12137
|
process.stdout.write(" \u2705 SECURITY.md\n");
|
|
11570
12138
|
};
|
|
11571
12139
|
var createDevScriptsDir = async (cwd) => {
|
|
11572
|
-
const devScriptsDir =
|
|
11573
|
-
const gitkeepPath =
|
|
12140
|
+
const devScriptsDir = join18(cwd, "dev-scripts");
|
|
12141
|
+
const gitkeepPath = join18(devScriptsDir, ".gitkeep");
|
|
11574
12142
|
await mkdir7(devScriptsDir, { recursive: true });
|
|
11575
12143
|
if (await pathExists4(gitkeepPath)) {
|
|
11576
12144
|
process.stdout.write(" \u2713 dev-scripts/ (already exists)\n");
|
|
@@ -11585,8 +12153,8 @@ var createDevScriptsDir = async (cwd) => {
|
|
|
11585
12153
|
};
|
|
11586
12154
|
var generatePlatformConfigs = async (cwd) => {
|
|
11587
12155
|
const possiblePaths = [
|
|
11588
|
-
|
|
11589
|
-
|
|
12156
|
+
join18(cwd, ".claude", "platforms", "generate-platform-configs.sh"),
|
|
12157
|
+
join18(
|
|
11590
12158
|
HERE5,
|
|
11591
12159
|
"..",
|
|
11592
12160
|
"..",
|
|
@@ -11614,7 +12182,7 @@ var generatePlatformConfigs = async (cwd) => {
|
|
|
11614
12182
|
return;
|
|
11615
12183
|
}
|
|
11616
12184
|
}
|
|
11617
|
-
const agentsPath =
|
|
12185
|
+
const agentsPath = join18(cwd, "AGENTS.md");
|
|
11618
12186
|
if (await pathExists4(agentsPath)) {
|
|
11619
12187
|
process.stdout.write(" \u2713 AGENTS.md (already exists)\n");
|
|
11620
12188
|
return;
|
|
@@ -11626,7 +12194,7 @@ var generatePlatformConfigs = async (cwd) => {
|
|
|
11626
12194
|
process.stdout.write(" \u2705 AGENTS.md (universal agent instructions)\n");
|
|
11627
12195
|
};
|
|
11628
12196
|
var adaptWorkflows = async (dir, pm) => {
|
|
11629
|
-
const files = await
|
|
12197
|
+
const files = await readdir9(dir);
|
|
11630
12198
|
const replacements = {
|
|
11631
12199
|
npm: {
|
|
11632
12200
|
"pnpm install --frozen-lockfile": "npm ci",
|
|
@@ -11652,7 +12220,7 @@ var adaptWorkflows = async (dir, pm) => {
|
|
|
11652
12220
|
const workflowFiles = files.filter((file) => file.endsWith(".yml"));
|
|
11653
12221
|
await Promise.all(
|
|
11654
12222
|
workflowFiles.map(async (file) => {
|
|
11655
|
-
const path =
|
|
12223
|
+
const path = join18(dir, file);
|
|
11656
12224
|
let content = await readFile9(path, "utf8");
|
|
11657
12225
|
for (const [from, to] of Object.entries(replacements[pm])) {
|
|
11658
12226
|
content = content.replaceAll(from, to);
|
|
@@ -11664,7 +12232,7 @@ var adaptWorkflows = async (dir, pm) => {
|
|
|
11664
12232
|
|
|
11665
12233
|
// src/commands/initDetect.ts
|
|
11666
12234
|
import { existsSync as existsSync4 } from "fs";
|
|
11667
|
-
import { join as
|
|
12235
|
+
import { join as join19 } from "path";
|
|
11668
12236
|
var packageManagerFromManifest = (value) => {
|
|
11669
12237
|
if (value === void 0 || value === "") {
|
|
11670
12238
|
return null;
|
|
@@ -11691,7 +12259,7 @@ var detectPackageManager = async (cwd) => {
|
|
|
11691
12259
|
["package-lock.json", "npm"]
|
|
11692
12260
|
];
|
|
11693
12261
|
const lockfileMatches = checks.map(([file, pm]) => ({
|
|
11694
|
-
found: existsSync4(
|
|
12262
|
+
found: existsSync4(join19(cwd, file)),
|
|
11695
12263
|
pm
|
|
11696
12264
|
}));
|
|
11697
12265
|
const match = lockfileMatches.find((entry) => entry.found);
|
|
@@ -11759,9 +12327,9 @@ var writeInitSuccess = (pm) => {
|
|
|
11759
12327
|
|
|
11760
12328
|
// src/commands/initPatches.ts
|
|
11761
12329
|
import { readFile as readFile10, writeFile as writeFile8 } from "fs/promises";
|
|
11762
|
-
import { join as
|
|
12330
|
+
import { join as join20 } from "path";
|
|
11763
12331
|
var patchGitignore = async (cwd) => {
|
|
11764
|
-
const gitignorePath =
|
|
12332
|
+
const gitignorePath = join20(cwd, ".gitignore");
|
|
11765
12333
|
const content = await pathExists4(gitignorePath) ? await readFile10(gitignorePath, "utf8") : "";
|
|
11766
12334
|
const needed = ["dev-scripts/", ".env", ".env.*", "!.env.example"];
|
|
11767
12335
|
const additions = needed.filter((pattern) => !content.includes(pattern));
|
|
@@ -11776,7 +12344,7 @@ ${additions.join("\n")}
|
|
|
11776
12344
|
process.stdout.write(" \u2713 .gitignore (already has required entries)\n");
|
|
11777
12345
|
};
|
|
11778
12346
|
var patchPackageScripts = async (cwd, pm) => {
|
|
11779
|
-
const pkgPath =
|
|
12347
|
+
const pkgPath = join20(cwd, "package.json");
|
|
11780
12348
|
const pkg = await readInitPackageJson(cwd);
|
|
11781
12349
|
if (pkg === null) {
|
|
11782
12350
|
process.stdout.write(" \u26A0\uFE0F package.json scripts skipped (package.json missing)\n");
|
|
@@ -11801,7 +12369,7 @@ var patchPackageScripts = async (cwd, pm) => {
|
|
|
11801
12369
|
// src/commands/init.ts
|
|
11802
12370
|
var runInit = async (args) => {
|
|
11803
12371
|
const [targetPath] = args;
|
|
11804
|
-
const cwd = targetPath !== void 0 && targetPath !== "" ?
|
|
12372
|
+
const cwd = targetPath !== void 0 && targetPath !== "" ? join21(process.cwd(), targetPath) : process.cwd();
|
|
11805
12373
|
process.stdout.write("\u{1F512} VybeKiit init: bootstrapping security guardrails...\n");
|
|
11806
12374
|
process.stdout.write("\n");
|
|
11807
12375
|
const pm = await detectPackageManager(cwd);
|
|
@@ -11820,7 +12388,7 @@ var runInit = async (args) => {
|
|
|
11820
12388
|
try {
|
|
11821
12389
|
const { cleanup: resolvedCleanup, source } = await resolveTemplatesSource(projectType);
|
|
11822
12390
|
cleanup = resolvedCleanup;
|
|
11823
|
-
const templateDir =
|
|
12391
|
+
const templateDir = join21(source, projectType);
|
|
11824
12392
|
await copyClaudeHooks(cwd, templateDir);
|
|
11825
12393
|
await copyWorkflows(cwd, templateDir, pm);
|
|
11826
12394
|
await copyPrePushHook(cwd, templateDir);
|
|
@@ -11902,8 +12470,8 @@ var runLintExtensionSkill = async (args) => {
|
|
|
11902
12470
|
};
|
|
11903
12471
|
|
|
11904
12472
|
// src/commands/liveWorkDataCmd.ts
|
|
11905
|
-
import { resolve as
|
|
11906
|
-
import
|
|
12473
|
+
import { resolve as resolve8 } from "path";
|
|
12474
|
+
import process10 from "process";
|
|
11907
12475
|
|
|
11908
12476
|
// ../packages/db/src/types.ts
|
|
11909
12477
|
import { Data as Data3 } from "effect";
|
|
@@ -12101,8 +12669,8 @@ var isRailwayStatusLinked = (code, stdout, stderr) => {
|
|
|
12101
12669
|
}
|
|
12102
12670
|
return blob.includes("project") && !blob.includes("no linked");
|
|
12103
12671
|
};
|
|
12104
|
-
var delay = (ms) => new Promise((
|
|
12105
|
-
setTimeout(
|
|
12672
|
+
var delay = (ms) => new Promise((resolve14) => {
|
|
12673
|
+
setTimeout(resolve14, ms);
|
|
12106
12674
|
});
|
|
12107
12675
|
var isRailwayRateLimited = (blob) => {
|
|
12108
12676
|
const lower = blob.toLowerCase();
|
|
@@ -14886,9 +15454,9 @@ import { Effect as Effect12, Either as Either2 } from "effect";
|
|
|
14886
15454
|
|
|
14887
15455
|
// ../packages/core/src/node.ts
|
|
14888
15456
|
import { existsSync as existsSync5, readFileSync as readFileSync3 } from "fs";
|
|
14889
|
-
import { join as
|
|
15457
|
+
import { join as join22 } from "path";
|
|
14890
15458
|
var loadEnvFile = (cwd, filename = ".env") => {
|
|
14891
|
-
const path =
|
|
15459
|
+
const path = join22(cwd, filename);
|
|
14892
15460
|
if (!existsSync5(path)) {
|
|
14893
15461
|
return {};
|
|
14894
15462
|
}
|
|
@@ -14913,7 +15481,7 @@ var mergeEnvFile = (processEnv, fileEnv) => ({ ...processEnv, ...fileEnv });
|
|
|
14913
15481
|
|
|
14914
15482
|
// src/doctor/writeEnvKeys.ts
|
|
14915
15483
|
import { existsSync as existsSync6, readFileSync as readFileSync4, writeFileSync as writeFileSync2 } from "fs";
|
|
14916
|
-
import { join as
|
|
15484
|
+
import { join as join23 } from "path";
|
|
14917
15485
|
var TRAILING_NEWLINES_PATTERN = /\n*$/;
|
|
14918
15486
|
var renderEnvValue = (value) => {
|
|
14919
15487
|
if (value.includes(" ")) {
|
|
@@ -14930,7 +15498,7 @@ var replaceEnvLine = (lines, key, newLine) => {
|
|
|
14930
15498
|
return true;
|
|
14931
15499
|
};
|
|
14932
15500
|
var writeEnvKeys = (cwd, keys) => {
|
|
14933
|
-
const path =
|
|
15501
|
+
const path = join23(cwd, ".env");
|
|
14934
15502
|
const existing = existsSync6(path) ? readFileSync4(path, "utf8") : "";
|
|
14935
15503
|
const lines = existing.length > 0 ? existing.split("\n") : [];
|
|
14936
15504
|
for (const [key, value] of Object.entries(keys)) {
|
|
@@ -14961,7 +15529,7 @@ var parseLiveWorkDataFlags = (args) => {
|
|
|
14961
15529
|
const modeRaw = readFlagValue(args, "mode") ?? "demo";
|
|
14962
15530
|
const vendorRaw = readFlagValue(args, "vendor");
|
|
14963
15531
|
const cwdRaw = readFlagValue(args, "cwd");
|
|
14964
|
-
const cwd =
|
|
15532
|
+
const cwd = resolve8(process10.cwd(), cwdRaw === void 0 || cwdRaw === "" ? "." : cwdRaw);
|
|
14965
15533
|
if (!isLiveWorkMode(modeRaw)) {
|
|
14966
15534
|
return {
|
|
14967
15535
|
mode: "demo",
|
|
@@ -15024,7 +15592,7 @@ var toFailurePayload = (error) => {
|
|
|
15024
15592
|
}
|
|
15025
15593
|
return failure;
|
|
15026
15594
|
};
|
|
15027
|
-
var resolveLiveWorkEnv = (cwd) => mergeEnv(
|
|
15595
|
+
var resolveLiveWorkEnv = (cwd) => mergeEnv(process10.env, loadEnvFile2(cwd));
|
|
15028
15596
|
var writeDataPin = (cwd, keys) => Effect12.try({
|
|
15029
15597
|
try: () => {
|
|
15030
15598
|
writeEnvKeys2(cwd, keys);
|
|
@@ -15079,8 +15647,8 @@ var runLiveWorkData = async (args) => {
|
|
|
15079
15647
|
};
|
|
15080
15648
|
|
|
15081
15649
|
// src/commands/liveWorkHostCmd.ts
|
|
15082
|
-
import { resolve as
|
|
15083
|
-
import
|
|
15650
|
+
import { resolve as resolve9 } from "path";
|
|
15651
|
+
import process11 from "process";
|
|
15084
15652
|
|
|
15085
15653
|
// ../packages/deploy/src/deployEffect.ts
|
|
15086
15654
|
import { Effect as Effect13 } from "effect";
|
|
@@ -15097,7 +15665,7 @@ var failDeploy = (code, message) => Effect13.fail(deployError(code, message));
|
|
|
15097
15665
|
// ../packages/deploy/src/liveWork/cloudflareProvision.ts
|
|
15098
15666
|
import { mkdirSync as mkdirSync2, writeFileSync as writeFileSync3 } from "fs";
|
|
15099
15667
|
import { tmpdir as tmpdir3 } from "os";
|
|
15100
|
-
import { join as
|
|
15668
|
+
import { join as join24 } from "path";
|
|
15101
15669
|
import { Effect as Effect14 } from "effect";
|
|
15102
15670
|
|
|
15103
15671
|
// ../packages/deploy/src/liveWork/types.ts
|
|
@@ -15155,10 +15723,10 @@ var defaultLiveWorkProjectName = (prefix = "vybekiit-lw") => {
|
|
|
15155
15723
|
return `${prefix}-${stamp}`.toLowerCase().replaceAll(/[^a-z0-9-]/g, "-").slice(0, 58);
|
|
15156
15724
|
};
|
|
15157
15725
|
var writeDemoStaticSite = (parentDir) => {
|
|
15158
|
-
const buildDir =
|
|
15726
|
+
const buildDir = join24(parentDir, "site");
|
|
15159
15727
|
mkdirSync2(buildDir, { recursive: true });
|
|
15160
15728
|
writeFileSync3(
|
|
15161
|
-
|
|
15729
|
+
join24(buildDir, "index.html"),
|
|
15162
15730
|
`<!doctype html><html lang="en"><head><meta charset="utf-8"/><title>VybeKiit Live work</title></head><body><main data-vybekiit-live-work="1"><h1>Live work host OK</h1></main></body></html>
|
|
15163
15731
|
`,
|
|
15164
15732
|
"utf8"
|
|
@@ -15205,8 +15773,8 @@ var verifyHostUrl = (url, fetchImpl = globalThis.fetch, options = {}) => Effect1
|
|
|
15205
15773
|
lastMessage = caughtMessage(cause, "Host verify failed");
|
|
15206
15774
|
}
|
|
15207
15775
|
if (i < attempts - 1) {
|
|
15208
|
-
await new Promise((
|
|
15209
|
-
setTimeout(
|
|
15776
|
+
await new Promise((resolve14) => {
|
|
15777
|
+
setTimeout(resolve14, delayMs);
|
|
15210
15778
|
});
|
|
15211
15779
|
}
|
|
15212
15780
|
}
|
|
@@ -15235,7 +15803,7 @@ var createCloudflarePagesHost = (options) => Effect14.gen(function* () {
|
|
|
15235
15803
|
})
|
|
15236
15804
|
);
|
|
15237
15805
|
}
|
|
15238
|
-
const parent = options.cwd ??
|
|
15806
|
+
const parent = options.cwd ?? join24(tmpdir3(), defaultLiveWorkProjectName("vybekiit-lw-site"));
|
|
15239
15807
|
mkdirSync2(parent, { recursive: true });
|
|
15240
15808
|
buildDir = writeDemoStaticSite(parent);
|
|
15241
15809
|
}
|
|
@@ -15336,7 +15904,7 @@ var mapCloudflareCause = (cause) => {
|
|
|
15336
15904
|
// ../packages/deploy/src/liveWork/githubPagesProvision.ts
|
|
15337
15905
|
import { mkdirSync as mkdirSync3, readFileSync as readFileSync5 } from "fs";
|
|
15338
15906
|
import { tmpdir as tmpdir4 } from "os";
|
|
15339
|
-
import { join as
|
|
15907
|
+
import { join as join25 } from "path";
|
|
15340
15908
|
import { Effect as Effect15 } from "effect";
|
|
15341
15909
|
var readGithubToken = (env) => {
|
|
15342
15910
|
for (const key of ["GITHUB_TOKEN", "GH_TOKEN"]) {
|
|
@@ -15464,7 +16032,7 @@ var createGithubPagesHost = (options) => Effect15.gen(function* () {
|
|
|
15464
16032
|
);
|
|
15465
16033
|
}
|
|
15466
16034
|
if (options.createPages === void 0) {
|
|
15467
|
-
const parent = options.cwd ??
|
|
16035
|
+
const parent = options.cwd ?? join25(tmpdir4(), defaultLiveWorkProjectName("vybekiit-lw-gp-site"));
|
|
15468
16036
|
mkdirSync3(parent, { recursive: true });
|
|
15469
16037
|
buildDir = writeDemoStaticSite(parent);
|
|
15470
16038
|
}
|
|
@@ -15521,7 +16089,7 @@ var createGithubPagesHost = (options) => Effect15.gen(function* () {
|
|
|
15521
16089
|
if (!createRepo.ok) {
|
|
15522
16090
|
throw mapGithubHttp(createRepo.status, createText, "github_pages_repo_create_failed");
|
|
15523
16091
|
}
|
|
15524
|
-
const indexPath =
|
|
16092
|
+
const indexPath = join25(buildDir, "index.html");
|
|
15525
16093
|
let indexHtml;
|
|
15526
16094
|
try {
|
|
15527
16095
|
indexHtml = readFileSync5(indexPath, "utf8");
|
|
@@ -15624,8 +16192,8 @@ var createGithubPagesHost = (options) => Effect15.gen(function* () {
|
|
|
15624
16192
|
}
|
|
15625
16193
|
}
|
|
15626
16194
|
}
|
|
15627
|
-
await new Promise((
|
|
15628
|
-
setTimeout(
|
|
16195
|
+
await new Promise((resolve14) => {
|
|
16196
|
+
setTimeout(resolve14, 3e3);
|
|
15629
16197
|
});
|
|
15630
16198
|
}
|
|
15631
16199
|
return makeProvisionedHost(
|
|
@@ -15672,7 +16240,7 @@ var resolveHostLadderOrder = (env, namedVendor) => resolveLadderOrder(HOST_PREFE
|
|
|
15672
16240
|
import { createHash as createHash2 } from "crypto";
|
|
15673
16241
|
import { mkdirSync as mkdirSync4, readdirSync, readFileSync as readFileSync6, statSync } from "fs";
|
|
15674
16242
|
import { tmpdir as tmpdir5 } from "os";
|
|
15675
|
-
import { join as
|
|
16243
|
+
import { join as join26, relative as relative2 } from "path";
|
|
15676
16244
|
import { Effect as Effect16 } from "effect";
|
|
15677
16245
|
var readNetlifyAuthToken = (env) => {
|
|
15678
16246
|
const value = env.NETLIFY_AUTH_TOKEN;
|
|
@@ -15693,7 +16261,7 @@ var collectStaticFiles = (buildDir) => {
|
|
|
15693
16261
|
const out = /* @__PURE__ */ new Map();
|
|
15694
16262
|
const walk = (dir) => {
|
|
15695
16263
|
for (const entry of readdirSync(dir)) {
|
|
15696
|
-
const full =
|
|
16264
|
+
const full = join26(dir, entry);
|
|
15697
16265
|
const st = statSync(full);
|
|
15698
16266
|
if (st.isDirectory()) {
|
|
15699
16267
|
walk(full);
|
|
@@ -15775,7 +16343,7 @@ var createNetlifyHost = (options) => Effect16.gen(function* () {
|
|
|
15775
16343
|
);
|
|
15776
16344
|
}
|
|
15777
16345
|
if (options.createSite === void 0) {
|
|
15778
|
-
const parent = options.cwd ??
|
|
16346
|
+
const parent = options.cwd ?? join26(tmpdir5(), defaultLiveWorkProjectName("vybekiit-lw-nl-site"));
|
|
15779
16347
|
mkdirSync4(parent, { recursive: true });
|
|
15780
16348
|
buildDir = writeDemoStaticSite(parent);
|
|
15781
16349
|
}
|
|
@@ -15952,8 +16520,8 @@ var createNetlifyHost = (options) => Effect16.gen(function* () {
|
|
|
15952
16520
|
}
|
|
15953
16521
|
}
|
|
15954
16522
|
}
|
|
15955
|
-
await new Promise((
|
|
15956
|
-
setTimeout(
|
|
16523
|
+
await new Promise((resolve14) => {
|
|
16524
|
+
setTimeout(resolve14, 2e3);
|
|
15957
16525
|
});
|
|
15958
16526
|
}
|
|
15959
16527
|
try {
|
|
@@ -16030,7 +16598,7 @@ var buyerHostSuccessMessage = (provider, hopped, fromProvider) => {
|
|
|
16030
16598
|
// ../packages/deploy/src/liveWork/railwayHostProvision.ts
|
|
16031
16599
|
import { mkdirSync as mkdirSync5, writeFileSync as writeFileSync4 } from "fs";
|
|
16032
16600
|
import { tmpdir as tmpdir6 } from "os";
|
|
16033
|
-
import { join as
|
|
16601
|
+
import { join as join27 } from "path";
|
|
16034
16602
|
import { Effect as Effect17 } from "effect";
|
|
16035
16603
|
var defaultRailwayHostCliRunner = async (args, options = {}) => {
|
|
16036
16604
|
const { execFile: execFile8 } = await import("child_process");
|
|
@@ -16093,11 +16661,11 @@ var createRailwayHost = (options) => Effect17.gen(function* () {
|
|
|
16093
16661
|
})
|
|
16094
16662
|
);
|
|
16095
16663
|
}
|
|
16096
|
-
workDir = workDir ??
|
|
16664
|
+
workDir = workDir ?? join27(tmpdir6(), defaultLiveWorkProjectName("vybekiit-lw-r-site"));
|
|
16097
16665
|
mkdirSync5(workDir, { recursive: true });
|
|
16098
16666
|
buildDir = writeDemoStaticSite(workDir);
|
|
16099
16667
|
writeFileSync4(
|
|
16100
|
-
|
|
16668
|
+
join27(workDir, "package.json"),
|
|
16101
16669
|
JSON.stringify({
|
|
16102
16670
|
name: projectName,
|
|
16103
16671
|
private: true,
|
|
@@ -16199,7 +16767,7 @@ var mapRailwayHostCause = (cause) => {
|
|
|
16199
16767
|
// ../packages/deploy/src/liveWork/renderProvision.ts
|
|
16200
16768
|
import { mkdirSync as mkdirSync6 } from "fs";
|
|
16201
16769
|
import { tmpdir as tmpdir7 } from "os";
|
|
16202
|
-
import { join as
|
|
16770
|
+
import { join as join28 } from "path";
|
|
16203
16771
|
import { Effect as Effect18 } from "effect";
|
|
16204
16772
|
var readRenderApiKey = (env) => {
|
|
16205
16773
|
const value = env.RENDER_API_KEY;
|
|
@@ -16282,7 +16850,7 @@ var createRenderHost = (options) => Effect18.gen(function* () {
|
|
|
16282
16850
|
);
|
|
16283
16851
|
}
|
|
16284
16852
|
if (options.mode !== "buyer" && (options.buildDir === void 0 || options.buildDir.length === 0)) {
|
|
16285
|
-
const parent = options.cwd ??
|
|
16853
|
+
const parent = options.cwd ?? join28(tmpdir7(), defaultLiveWorkProjectName("vybekiit-lw-rd-site"));
|
|
16286
16854
|
mkdirSync6(parent, { recursive: true });
|
|
16287
16855
|
writeDemoStaticSite(parent);
|
|
16288
16856
|
}
|
|
@@ -16411,7 +16979,7 @@ import { Effect as Effect20 } from "effect";
|
|
|
16411
16979
|
// ../packages/deploy/src/liveWork/vercelProvision.ts
|
|
16412
16980
|
import { mkdirSync as mkdirSync7 } from "fs";
|
|
16413
16981
|
import { tmpdir as tmpdir8 } from "os";
|
|
16414
|
-
import { join as
|
|
16982
|
+
import { join as join29 } from "path";
|
|
16415
16983
|
import { Effect as Effect19 } from "effect";
|
|
16416
16984
|
var defaultVercelCliRunner = async (args, options = {}) => {
|
|
16417
16985
|
const { execFile: execFile8 } = await import("child_process");
|
|
@@ -16472,7 +17040,7 @@ var createVercelHost = (options) => Effect19.gen(function* () {
|
|
|
16472
17040
|
})
|
|
16473
17041
|
);
|
|
16474
17042
|
}
|
|
16475
|
-
const parent = options.cwd ??
|
|
17043
|
+
const parent = options.cwd ?? join29(tmpdir8(), defaultLiveWorkProjectName("vybekiit-lw-v-site"));
|
|
16476
17044
|
mkdirSync7(parent, { recursive: true });
|
|
16477
17045
|
buildDir = writeDemoStaticSite(parent);
|
|
16478
17046
|
}
|
|
@@ -16859,7 +17427,7 @@ var parseLiveWorkHostFlags = (args) => {
|
|
|
16859
17427
|
const cwdRaw = readFlagValue(args, "cwd");
|
|
16860
17428
|
const buildDirRaw = readFlagValue(args, "build-dir");
|
|
16861
17429
|
const projectNameRaw = readFlagValue(args, "project-name");
|
|
16862
|
-
const cwd =
|
|
17430
|
+
const cwd = resolve9(process11.cwd(), cwdRaw === void 0 || cwdRaw === "" ? "." : cwdRaw);
|
|
16863
17431
|
if (!isLiveWorkMode2(modeRaw)) {
|
|
16864
17432
|
return {
|
|
16865
17433
|
mode: "buyer",
|
|
@@ -16884,7 +17452,7 @@ var parseLiveWorkHostFlags = (args) => {
|
|
|
16884
17452
|
pin: !hasBoolFlag(args, "no-pin"),
|
|
16885
17453
|
preferExisting: !hasBoolFlag(args, "fresh"),
|
|
16886
17454
|
...vendorRaw !== void 0 && vendorRaw !== "" && isHostLadderProvider(vendorRaw) ? { vendor: vendorRaw } : {},
|
|
16887
|
-
...buildDirRaw !== void 0 && buildDirRaw !== "" ? { buildDir:
|
|
17455
|
+
...buildDirRaw !== void 0 && buildDirRaw !== "" ? { buildDir: resolve9(cwd, buildDirRaw) } : {},
|
|
16888
17456
|
...projectNameRaw !== void 0 && projectNameRaw !== "" ? { projectName: projectNameRaw } : {}
|
|
16889
17457
|
};
|
|
16890
17458
|
};
|
|
@@ -16922,7 +17490,7 @@ var runLiveWorkHost = async (args) => {
|
|
|
16922
17490
|
exitCode: 1
|
|
16923
17491
|
};
|
|
16924
17492
|
}
|
|
16925
|
-
const env = mergeEnv(
|
|
17493
|
+
const env = mergeEnv(process11.env, loadEnvFile2(flags.cwd));
|
|
16926
17494
|
const either = await Effect23.runPromise(
|
|
16927
17495
|
Effect23.either(
|
|
16928
17496
|
runHostLiveWork({
|
|
@@ -16963,8 +17531,8 @@ var runLiveWorkHost = async (args) => {
|
|
|
16963
17531
|
};
|
|
16964
17532
|
|
|
16965
17533
|
// src/commands/liveWorkPaymentsCmd.ts
|
|
16966
|
-
import { resolve as
|
|
16967
|
-
import
|
|
17534
|
+
import { resolve as resolve10 } from "path";
|
|
17535
|
+
import process12 from "process";
|
|
16968
17536
|
|
|
16969
17537
|
// ../packages/payments/src/liveWork/journeyEvents.ts
|
|
16970
17538
|
var toPaymentsLiveWorkJourneyEvents = (result) => {
|
|
@@ -17175,7 +17743,7 @@ var parseLiveWorkPaymentsFlags = (args) => {
|
|
|
17175
17743
|
const modeRaw = readFlagValue(args, "mode") ?? "buyer";
|
|
17176
17744
|
const vendorRaw = readFlagValue(args, "vendor");
|
|
17177
17745
|
const cwdRaw = readFlagValue(args, "cwd");
|
|
17178
|
-
const cwd =
|
|
17746
|
+
const cwd = resolve10(process12.cwd(), cwdRaw === void 0 || cwdRaw === "" ? "." : cwdRaw);
|
|
17179
17747
|
if (!isLiveWorkMode3(modeRaw)) {
|
|
17180
17748
|
return {
|
|
17181
17749
|
mode: "buyer",
|
|
@@ -17233,7 +17801,7 @@ var runLiveWorkPayments = async (args) => {
|
|
|
17233
17801
|
exitCode: 1
|
|
17234
17802
|
};
|
|
17235
17803
|
}
|
|
17236
|
-
const env = mergeEnv(
|
|
17804
|
+
const env = mergeEnv(process12.env, loadEnvFile2(flags.cwd));
|
|
17237
17805
|
const either = await Effect26.runPromise(
|
|
17238
17806
|
Effect26.either(
|
|
17239
17807
|
runPaymentsLiveWork({
|
|
@@ -17273,9 +17841,9 @@ var runLiveWorkPayments = async (args) => {
|
|
|
17273
17841
|
};
|
|
17274
17842
|
|
|
17275
17843
|
// src/commands/localDev.ts
|
|
17276
|
-
import { spawn } from "child_process";
|
|
17277
|
-
import { access as
|
|
17278
|
-
import { dirname as dirname9, join as
|
|
17844
|
+
import { spawn as spawn3 } from "child_process";
|
|
17845
|
+
import { access as access11 } from "fs/promises";
|
|
17846
|
+
import { dirname as dirname9, join as join30 } from "path";
|
|
17279
17847
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
17280
17848
|
|
|
17281
17849
|
// src/lib/agentDetection.ts
|
|
@@ -17400,15 +17968,15 @@ var listAgents = () => Object.values(AGENTS);
|
|
|
17400
17968
|
// src/commands/localDev.ts
|
|
17401
17969
|
var HERE6 = dirname9(fileURLToPath6(import.meta.url));
|
|
17402
17970
|
var PORT = 3005;
|
|
17403
|
-
var resolveMonorepoRoot = () =>
|
|
17971
|
+
var resolveMonorepoRoot = () => join30(HERE6, "..", "..", "..");
|
|
17404
17972
|
var openBrowser = async (url) => {
|
|
17405
|
-
const { default:
|
|
17406
|
-
await
|
|
17973
|
+
const { default: open3 } = await import("open");
|
|
17974
|
+
await open3(url);
|
|
17407
17975
|
};
|
|
17408
17976
|
var runLocalDev = async () => {
|
|
17409
17977
|
const root = resolveMonorepoRoot();
|
|
17410
17978
|
try {
|
|
17411
|
-
await
|
|
17979
|
+
await access11(join30(root, "pnpm-workspace.yaml"));
|
|
17412
17980
|
} catch {
|
|
17413
17981
|
process.stderr.write("\u274C vybekiit local-dev must be run from inside the VybeKiit monorepo.\n");
|
|
17414
17982
|
return 1;
|
|
@@ -17422,8 +17990,8 @@ var runLocalDev = async () => {
|
|
|
17422
17990
|
process.stdout.write(` URL: http://localhost:${PORT}
|
|
17423
17991
|
`);
|
|
17424
17992
|
process.stdout.write("\n");
|
|
17425
|
-
const appDir =
|
|
17426
|
-
const child =
|
|
17993
|
+
const appDir = join30(root, "apps", "localDevelopmentWebsite");
|
|
17994
|
+
const child = spawn3("pnpm", ["dev"], {
|
|
17427
17995
|
cwd: appDir,
|
|
17428
17996
|
stdio: "pipe",
|
|
17429
17997
|
env: { ...process.env, VYBEKIIT_AGENT_ID: agent.id }
|
|
@@ -17447,19 +18015,19 @@ var runLocalDev = async () => {
|
|
|
17447
18015
|
child.stderr.on("data", (data) => {
|
|
17448
18016
|
process.stderr.write(data.toString());
|
|
17449
18017
|
});
|
|
17450
|
-
return new Promise((
|
|
18018
|
+
return new Promise((resolve14) => {
|
|
17451
18019
|
child.on("close", (code) => {
|
|
17452
18020
|
const exitCode = code === null ? 0 : code;
|
|
17453
|
-
|
|
18021
|
+
resolve14(exitCode);
|
|
17454
18022
|
});
|
|
17455
18023
|
});
|
|
17456
18024
|
};
|
|
17457
18025
|
|
|
17458
18026
|
// src/commands/new.ts
|
|
17459
|
-
import
|
|
18027
|
+
import process13 from "process";
|
|
17460
18028
|
var runNew = async (args) => {
|
|
17461
18029
|
const [template, dir] = args;
|
|
17462
|
-
|
|
18030
|
+
process13.stderr.write(
|
|
17463
18031
|
`Note: \`vybekiit new\` is deprecated. Use \`vybekiit create app ${CREATE_SURFACE_PIPE_FLAGS}\`.
|
|
17464
18032
|
`
|
|
17465
18033
|
);
|
|
@@ -17470,24 +18038,24 @@ var runNew = async (args) => {
|
|
|
17470
18038
|
if (template === void 0 || template === "") {
|
|
17471
18039
|
return await runCreateApp([]);
|
|
17472
18040
|
}
|
|
17473
|
-
|
|
18041
|
+
process13.stderr.write(
|
|
17474
18042
|
`Unknown surface "${template}". Use ${CREATE_SURFACE_LIST_FLAGS} (spa is not a create-app surface).
|
|
17475
18043
|
`
|
|
17476
18044
|
);
|
|
17477
|
-
|
|
18045
|
+
process13.stderr.write(
|
|
17478
18046
|
"Examples:\n vybekiit create app --web my-app\n vybekiit create app --mobile\n"
|
|
17479
18047
|
);
|
|
17480
18048
|
return 1;
|
|
17481
18049
|
};
|
|
17482
18050
|
|
|
17483
18051
|
// src/commands/piecesCmd.ts
|
|
17484
|
-
import
|
|
18052
|
+
import process14 from "process";
|
|
17485
18053
|
|
|
17486
18054
|
// src/lib/pageRecipeCatalog.ts
|
|
17487
18055
|
import { readFile as readFile12 } from "fs/promises";
|
|
17488
|
-
import { join as
|
|
17489
|
-
var PAGE_RECIPE_MANIFEST_RELATIVE =
|
|
17490
|
-
var pageRecipeManifestPath = (kitRoot) =>
|
|
18056
|
+
import { join as join31 } from "path";
|
|
18057
|
+
var PAGE_RECIPE_MANIFEST_RELATIVE = join31("scripts", "data", "page-recipe-manifest.json");
|
|
18058
|
+
var pageRecipeManifestPath = (kitRoot) => join31(kitRoot, PAGE_RECIPE_MANIFEST_RELATIVE);
|
|
17491
18059
|
var nonEmptyOr = (value, fallback) => {
|
|
17492
18060
|
if (value === void 0 || value === "") {
|
|
17493
18061
|
return fallback;
|
|
@@ -17575,8 +18143,8 @@ var loadPageRecipes = async (kitRoot) => {
|
|
|
17575
18143
|
var findPageRecipe = (recipes, idOrSlug) => recipes.find((recipe) => recipe.id === idOrSlug || recipe.slug === idOrSlug);
|
|
17576
18144
|
|
|
17577
18145
|
// src/lib/pageRecipeInstall.ts
|
|
17578
|
-
import { access as
|
|
17579
|
-
import { basename as basename2, dirname as dirname11, join as
|
|
18146
|
+
import { access as access13, mkdir as mkdir8, readFile as readFile14, writeFile as writeFile9 } from "fs/promises";
|
|
18147
|
+
import { basename as basename2, dirname as dirname11, join as join34, relative as relative4, resolve as resolve12 } from "path";
|
|
17580
18148
|
|
|
17581
18149
|
// src/lib/pageRecipeImports.ts
|
|
17582
18150
|
var SHARED_IMPORT_PATTERN = /from\s+['"]((?:\.\.\/)+shared\/[^'"]+|\.\/shared\/[^'"]+)['"]/g;
|
|
@@ -17641,8 +18209,8 @@ var rewriteInstalledSource = (source) => (
|
|
|
17641
18209
|
);
|
|
17642
18210
|
|
|
17643
18211
|
// src/lib/pageRecipePlanFiles.ts
|
|
17644
|
-
import { access as
|
|
17645
|
-
import { basename, dirname as dirname10, join as
|
|
18212
|
+
import { access as access12, readFile as readFile13 } from "fs/promises";
|
|
18213
|
+
import { basename, dirname as dirname10, join as join33, relative as relative3 } from "path";
|
|
17646
18214
|
|
|
17647
18215
|
// src/lib/pageRecipeRouteStub.ts
|
|
17648
18216
|
var buildRouteStub = (exportName, componentImportPath, targetRoute) => `import { ${exportName} } from '${componentImportPath}';
|
|
@@ -17744,7 +18312,7 @@ export const foregroundTripletFor = (hex: string): string => {
|
|
|
17744
18312
|
`;
|
|
17745
18313
|
|
|
17746
18314
|
// src/lib/resolveAppSurface.ts
|
|
17747
|
-
import { join as
|
|
18315
|
+
import { join as join32, resolve as resolve11 } from "path";
|
|
17748
18316
|
var stripLeadingSlashes = (route) => {
|
|
17749
18317
|
let result = route;
|
|
17750
18318
|
while (result.startsWith("/")) {
|
|
@@ -17760,31 +18328,31 @@ var stripTrailingSlashes = (route) => {
|
|
|
17760
18328
|
return result;
|
|
17761
18329
|
};
|
|
17762
18330
|
var appRootCandidates = (dest) => {
|
|
17763
|
-
const root =
|
|
18331
|
+
const root = resolve11(dest);
|
|
17764
18332
|
return [
|
|
17765
18333
|
root,
|
|
17766
|
-
|
|
17767
|
-
|
|
17768
|
-
|
|
17769
|
-
|
|
17770
|
-
|
|
18334
|
+
join32(root, "templates", "web"),
|
|
18335
|
+
join32(root, "web"),
|
|
18336
|
+
join32(root, "templates", "spa"),
|
|
18337
|
+
join32(root, "spa"),
|
|
18338
|
+
join32(root, "apps", "web")
|
|
17771
18339
|
];
|
|
17772
18340
|
};
|
|
17773
18341
|
var fallbackLayout = (dest) => {
|
|
17774
|
-
const root =
|
|
18342
|
+
const root = resolve11(dest);
|
|
17775
18343
|
return {
|
|
17776
18344
|
appRoot: root,
|
|
17777
18345
|
appDir: void 0,
|
|
17778
18346
|
usesLocaleSegment: false,
|
|
17779
|
-
componentsDir:
|
|
18347
|
+
componentsDir: join32(root, "src", "components", "pageRecipes")
|
|
17780
18348
|
};
|
|
17781
18349
|
};
|
|
17782
18350
|
var probeAppRoot = async (candidate) => {
|
|
17783
|
-
const appAtRoot =
|
|
17784
|
-
const appUnderSrc =
|
|
17785
|
-
const srcDir =
|
|
18351
|
+
const appAtRoot = join32(candidate, "app");
|
|
18352
|
+
const appUnderSrc = join32(candidate, "src", "app");
|
|
18353
|
+
const srcDir = join32(candidate, "src");
|
|
17786
18354
|
const [hasPackage, hasAppAtRoot, hasAppUnderSrc, hasSrc] = await Promise.all([
|
|
17787
|
-
pathExists3(
|
|
18355
|
+
pathExists3(join32(candidate, "package.json")),
|
|
17788
18356
|
pathExists3(appAtRoot),
|
|
17789
18357
|
pathExists3(appUnderSrc),
|
|
17790
18358
|
pathExists3(srcDir)
|
|
@@ -17798,8 +18366,8 @@ var probeAppRoot = async (candidate) => {
|
|
|
17798
18366
|
} else if (hasAppUnderSrc) {
|
|
17799
18367
|
appDir = appUnderSrc;
|
|
17800
18368
|
}
|
|
17801
|
-
const usesLocaleSegment = appDir !== void 0 && await pathExists3(
|
|
17802
|
-
const componentsDir = hasSrc ?
|
|
18369
|
+
const usesLocaleSegment = appDir !== void 0 && await pathExists3(join32(appDir, "[locale]"));
|
|
18370
|
+
const componentsDir = hasSrc ? join32(candidate, "src", "components", "pageRecipes") : join32(candidate, "components", "pageRecipes");
|
|
17803
18371
|
return {
|
|
17804
18372
|
appRoot: candidate,
|
|
17805
18373
|
appDir,
|
|
@@ -17819,7 +18387,7 @@ var routeSegmentPath = (targetRoute, usesLocaleSegment) => {
|
|
|
17819
18387
|
const trimmed = stripTrailingSlashes(stripLeadingSlashes(targetRoute));
|
|
17820
18388
|
const body = trimmed === "" ? "index" : trimmed;
|
|
17821
18389
|
if (usesLocaleSegment) {
|
|
17822
|
-
return
|
|
18390
|
+
return join32("[locale]", body);
|
|
17823
18391
|
}
|
|
17824
18392
|
return body;
|
|
17825
18393
|
};
|
|
@@ -17827,7 +18395,7 @@ var routeSegmentPath = (targetRoute, usesLocaleSegment) => {
|
|
|
17827
18395
|
// src/lib/pageRecipePlanFiles.ts
|
|
17828
18396
|
var pathExists5 = async (path) => {
|
|
17829
18397
|
try {
|
|
17830
|
-
await
|
|
18398
|
+
await access12(path);
|
|
17831
18399
|
return true;
|
|
17832
18400
|
} catch {
|
|
17833
18401
|
return false;
|
|
@@ -17856,7 +18424,7 @@ var resolveSourceFile = async (basePath) => {
|
|
|
17856
18424
|
var findKitSharedDir = async (fromFile) => {
|
|
17857
18425
|
let dir = dirname10(fromFile);
|
|
17858
18426
|
for (let depth = 0; depth < 6; depth += 1) {
|
|
17859
|
-
const candidate =
|
|
18427
|
+
const candidate = join33(dir, "shared");
|
|
17860
18428
|
if (await pathExists5(candidate)) {
|
|
17861
18429
|
return candidate;
|
|
17862
18430
|
}
|
|
@@ -17870,12 +18438,12 @@ var findKitSharedDir = async (fromFile) => {
|
|
|
17870
18438
|
};
|
|
17871
18439
|
var loadSharedModule = async (options) => {
|
|
17872
18440
|
const { spec, appRoot, componentsDir, kitSharedDir } = options;
|
|
17873
|
-
const kitSharedBase =
|
|
18441
|
+
const kitSharedBase = join33(kitSharedDir, stripLeadingDotSlash(spec));
|
|
17874
18442
|
const kitSharedFile = await resolveSourceFile(kitSharedBase);
|
|
17875
18443
|
if (kitSharedFile === null) {
|
|
17876
18444
|
throw new Error(`Missing shared recipe dependency: ${spec}`);
|
|
17877
18445
|
}
|
|
17878
|
-
const sharedDest =
|
|
18446
|
+
const sharedDest = join33(componentsDir, "shared", basename(kitSharedFile));
|
|
17879
18447
|
const sharedRaw = await readFile13(kitSharedFile, "utf8");
|
|
17880
18448
|
const sharedContent = rewriteInstalledSource(sharedRaw);
|
|
17881
18449
|
const nextSpecs = collectRelativeImports(sharedRaw).map((rel) => stripLeadingDotSlash(rel));
|
|
@@ -17955,7 +18523,7 @@ var planRouteFile = async (options) => {
|
|
|
17955
18523
|
return [];
|
|
17956
18524
|
}
|
|
17957
18525
|
const segment = routeSegmentPath(recipe.targetRoute, usesLocaleSegment);
|
|
17958
|
-
const routeFile =
|
|
18526
|
+
const routeFile = join33(appDir, segment, "page.tsx");
|
|
17959
18527
|
const importPath = `@/components/pageRecipes/${stripComponentExtension(recipeFileName)}`;
|
|
17960
18528
|
if (await pathExists5(routeFile)) {
|
|
17961
18529
|
return [];
|
|
@@ -17973,7 +18541,7 @@ var themeHelperFiles = (layout, needsThemeHelper) => {
|
|
|
17973
18541
|
if (!needsThemeHelper) {
|
|
17974
18542
|
return [];
|
|
17975
18543
|
}
|
|
17976
|
-
const helperDest =
|
|
18544
|
+
const helperDest = join33(layout.componentsDir, "shared", "themeHelpers.ts");
|
|
17977
18545
|
return [
|
|
17978
18546
|
{
|
|
17979
18547
|
absolutePath: helperDest,
|
|
@@ -18001,7 +18569,7 @@ var buildInstallFollowUps = (recipe) => {
|
|
|
18001
18569
|
// src/lib/pageRecipeInstall.ts
|
|
18002
18570
|
var pathExists6 = async (path) => {
|
|
18003
18571
|
try {
|
|
18004
|
-
await
|
|
18572
|
+
await access13(path);
|
|
18005
18573
|
return true;
|
|
18006
18574
|
} catch {
|
|
18007
18575
|
return false;
|
|
@@ -18010,7 +18578,7 @@ var pathExists6 = async (path) => {
|
|
|
18010
18578
|
var planPageRecipeInstall = async (options) => {
|
|
18011
18579
|
const { kitRoot, dest, recipe } = options;
|
|
18012
18580
|
const layout = await resolveAppSurface(dest);
|
|
18013
|
-
const sourceAbs =
|
|
18581
|
+
const sourceAbs = join34(kitRoot, recipe.sourcePath);
|
|
18014
18582
|
if (!await pathExists6(sourceAbs)) {
|
|
18015
18583
|
throw new Error(
|
|
18016
18584
|
`Recipe source not found at ${recipe.sourcePath}. Re-run from a kit workspace or with kit access.`
|
|
@@ -18018,7 +18586,7 @@ var planPageRecipeInstall = async (options) => {
|
|
|
18018
18586
|
}
|
|
18019
18587
|
const recipeSource = await readFile14(sourceAbs, "utf8");
|
|
18020
18588
|
const recipeFileName = basename2(recipe.sourcePath);
|
|
18021
|
-
const recipeDest =
|
|
18589
|
+
const recipeDest = join34(layout.componentsDir, recipeFileName);
|
|
18022
18590
|
const shared = await planSharedFiles({
|
|
18023
18591
|
sourceAbs,
|
|
18024
18592
|
recipeSource,
|
|
@@ -18078,9 +18646,9 @@ var applyPageRecipeInstall = async (plan, options = { force: false }) => {
|
|
|
18078
18646
|
};
|
|
18079
18647
|
var resolveInstallDest = (destArg, cwd) => {
|
|
18080
18648
|
if (destArg === void 0 || destArg === "") {
|
|
18081
|
-
return
|
|
18649
|
+
return resolve12(cwd);
|
|
18082
18650
|
}
|
|
18083
|
-
return
|
|
18651
|
+
return resolve12(cwd, destArg);
|
|
18084
18652
|
};
|
|
18085
18653
|
|
|
18086
18654
|
// src/commands/pieceCatalog.ts
|
|
@@ -18278,7 +18846,7 @@ var runAddPageRecipe = async (args) => {
|
|
|
18278
18846
|
if (recipe === void 0) {
|
|
18279
18847
|
return recipeError(`Unknown page recipe "${recipeId}". Run: vybekiit list-page-recipes`);
|
|
18280
18848
|
}
|
|
18281
|
-
const dest = resolveInstallDest(destArg,
|
|
18849
|
+
const dest = resolveInstallDest(destArg, process14.cwd());
|
|
18282
18850
|
const plan = await planPageRecipeInstall({ kitRoot, dest, recipe });
|
|
18283
18851
|
if (flags.dryRun) {
|
|
18284
18852
|
return {
|
|
@@ -18302,12 +18870,12 @@ var runAddPageRecipe = async (args) => {
|
|
|
18302
18870
|
};
|
|
18303
18871
|
|
|
18304
18872
|
// src/commands/piecesInteractive.ts
|
|
18305
|
-
import
|
|
18873
|
+
import process17 from "process";
|
|
18306
18874
|
import { cancel, isCancel as isCancel2, select } from "@clack/prompts";
|
|
18307
18875
|
|
|
18308
18876
|
// src/commands/presetsCmd.ts
|
|
18309
|
-
import { resolve as
|
|
18310
|
-
import
|
|
18877
|
+
import { resolve as resolve13 } from "path";
|
|
18878
|
+
import process15 from "process";
|
|
18311
18879
|
import { Effect as Effect27, Either as Either5 } from "effect";
|
|
18312
18880
|
var POSTGRES_PROVIDERS = ["supabase", "neon", "railway"];
|
|
18313
18881
|
var NOSQL_PROVIDERS = ["mongodb", "firebase", "aws"];
|
|
@@ -18335,10 +18903,10 @@ var parseFlags = (args) => {
|
|
|
18335
18903
|
};
|
|
18336
18904
|
var resolvePresetEnv = (cwd) => {
|
|
18337
18905
|
if (cwd === void 0 || cwd === "") {
|
|
18338
|
-
return
|
|
18906
|
+
return process15.env;
|
|
18339
18907
|
}
|
|
18340
|
-
const absolute =
|
|
18341
|
-
return mergeEnv(
|
|
18908
|
+
const absolute = resolve13(process15.cwd(), cwd);
|
|
18909
|
+
return mergeEnv(process15.env, loadEnvFile2(absolute));
|
|
18342
18910
|
};
|
|
18343
18911
|
var databaseUrlFromEnv = (env) => env.DATABASE_URL;
|
|
18344
18912
|
var isNosqlProvider2 = (provider) => provider === "mongodb" || provider === "firebase" || provider === "aws";
|
|
@@ -18442,7 +19010,7 @@ var runApplyPreset = async (args) => {
|
|
|
18442
19010
|
result.ok ? {
|
|
18443
19011
|
ok: true,
|
|
18444
19012
|
...result.value,
|
|
18445
|
-
...flags.cwd === void 0 ? {} : { cwd:
|
|
19013
|
+
...flags.cwd === void 0 ? {} : { cwd: resolve13(process15.cwd(), flags.cwd) }
|
|
18446
19014
|
} : result,
|
|
18447
19015
|
null,
|
|
18448
19016
|
2
|
|
@@ -18504,7 +19072,7 @@ var runListPresets = () => {
|
|
|
18504
19072
|
|
|
18505
19073
|
// src/commands/reportModeCmd.ts
|
|
18506
19074
|
import { spawnSync } from "child_process";
|
|
18507
|
-
import
|
|
19075
|
+
import process16 from "process";
|
|
18508
19076
|
|
|
18509
19077
|
// ../packages/reportMode/src/deeplink.ts
|
|
18510
19078
|
var inferVybeAssistant = (options) => {
|
|
@@ -18533,8 +19101,8 @@ var inferVybeAssistant = (options) => {
|
|
|
18533
19101
|
};
|
|
18534
19102
|
|
|
18535
19103
|
// src/lib/reportModeInstall.ts
|
|
18536
|
-
import { access as
|
|
18537
|
-
import { dirname as dirname12, join as
|
|
19104
|
+
import { access as access14, mkdir as mkdir9, readdir as readdir10, readFile as readFile16, writeFile as writeFile11 } from "fs/promises";
|
|
19105
|
+
import { dirname as dirname12, join as join35, relative as relative5 } from "path";
|
|
18538
19106
|
|
|
18539
19107
|
// src/lib/packageJsonDeps.ts
|
|
18540
19108
|
import { readFile as readFile15, writeFile as writeFile10 } from "fs/promises";
|
|
@@ -18568,12 +19136,12 @@ var INSTALLABLE_SURFACES = ["web", "mobile", "extension"];
|
|
|
18568
19136
|
var isInstallableSurface = (surface) => INSTALLABLE_SURFACES.includes(surface);
|
|
18569
19137
|
var listFilesRecursive = async (dir, prefix = "") => {
|
|
18570
19138
|
try {
|
|
18571
|
-
const entries = await
|
|
19139
|
+
const entries = await readdir10(dir, { withFileTypes: true });
|
|
18572
19140
|
const nested = await Promise.all(
|
|
18573
19141
|
entries.map(async (entry) => {
|
|
18574
19142
|
const rel = prefix === "" ? entry.name : `${prefix}/${entry.name}`;
|
|
18575
19143
|
if (entry.isDirectory()) {
|
|
18576
|
-
return await listFilesRecursive(
|
|
19144
|
+
return await listFilesRecursive(join35(dir, entry.name), rel);
|
|
18577
19145
|
}
|
|
18578
19146
|
return [rel];
|
|
18579
19147
|
})
|
|
@@ -18594,7 +19162,7 @@ var defaultReportModeFs = {
|
|
|
18594
19162
|
},
|
|
18595
19163
|
exists: async (path) => {
|
|
18596
19164
|
try {
|
|
18597
|
-
await
|
|
19165
|
+
await access14(path);
|
|
18598
19166
|
return true;
|
|
18599
19167
|
} catch {
|
|
18600
19168
|
return false;
|
|
@@ -18644,11 +19212,11 @@ var rewriteContent = (relativePath, raw, applyRewrite) => {
|
|
|
18644
19212
|
};
|
|
18645
19213
|
var toPlannedFile = async (options) => {
|
|
18646
19214
|
const { fs, sourceDir, dest, relativePath, applyRewrite } = options;
|
|
18647
|
-
const raw = await fs.readText(
|
|
19215
|
+
const raw = await fs.readText(join35(sourceDir, relativePath));
|
|
18648
19216
|
if (raw === null) {
|
|
18649
19217
|
return null;
|
|
18650
19218
|
}
|
|
18651
|
-
const absolutePath =
|
|
19219
|
+
const absolutePath = join35(dest, relativePath);
|
|
18652
19220
|
return {
|
|
18653
19221
|
relativePath,
|
|
18654
19222
|
absolutePath,
|
|
@@ -18660,7 +19228,7 @@ var buildPlannedFiles = async (options) => {
|
|
|
18660
19228
|
const { fs, sourceDir, dest, sources, applyRewrite } = options;
|
|
18661
19229
|
const subtreeGroups = await Promise.all(
|
|
18662
19230
|
sources.subtrees.map(async (subtree) => {
|
|
18663
|
-
const names = await fs.listFiles(
|
|
19231
|
+
const names = await fs.listFiles(join35(sourceDir, subtree));
|
|
18664
19232
|
return names.map((name) => `${subtree}/${name}`);
|
|
18665
19233
|
})
|
|
18666
19234
|
);
|
|
@@ -18708,7 +19276,7 @@ var planRewrite = async (options) => {
|
|
|
18708
19276
|
return { applied: false, reason: `No i18n rewrite for the ${surface} surface.` };
|
|
18709
19277
|
}
|
|
18710
19278
|
const usesLocaleSegment = appSurface?.usesLocaleSegment === true;
|
|
18711
|
-
const hasI18nNavigation = await fs.exists(
|
|
19279
|
+
const hasI18nNavigation = await fs.exists(join35(dest, "src", "i18n", "navigation.ts"));
|
|
18712
19280
|
const hasNextIntlDep = destDeps["next-intl"] !== void 0;
|
|
18713
19281
|
if (usesLocaleSegment || hasI18nNavigation || hasNextIntlDep) {
|
|
18714
19282
|
return { applied: false, reason: "Project uses next-intl; kept @/i18n/navigation." };
|
|
@@ -18721,12 +19289,12 @@ var buildMountSpec = (surface, dest, appSurface) => {
|
|
|
18721
19289
|
const appDir = appSurface?.appDir;
|
|
18722
19290
|
const candidates = [];
|
|
18723
19291
|
if (appDir !== void 0 && appSurface?.usesLocaleSegment === true) {
|
|
18724
|
-
candidates.push(
|
|
19292
|
+
candidates.push(join35(appDir, "[locale]", "layout.tsx"));
|
|
18725
19293
|
}
|
|
18726
19294
|
if (appDir !== void 0) {
|
|
18727
|
-
candidates.push(
|
|
19295
|
+
candidates.push(join35(appDir, "layout.tsx"));
|
|
18728
19296
|
}
|
|
18729
|
-
candidates.push(
|
|
19297
|
+
candidates.push(join35(dest, "src", "app", "layout.tsx"));
|
|
18730
19298
|
return {
|
|
18731
19299
|
component: "ReportModeDevShell",
|
|
18732
19300
|
importStatement: "import { ReportModeDevShell } from '@/components/report-mode/report-mode-shell';",
|
|
@@ -18740,7 +19308,7 @@ var buildMountSpec = (surface, dest, appSurface) => {
|
|
|
18740
19308
|
component: "ReportModeDev",
|
|
18741
19309
|
importStatement: "import { ReportModeDev } from '@/components/report-mode/report-mode-dev';",
|
|
18742
19310
|
jsxTag: "<ReportModeDev />",
|
|
18743
|
-
candidatePaths: [
|
|
19311
|
+
candidatePaths: [join35(dest, "app", "_layout.tsx")],
|
|
18744
19312
|
anchor: void 0
|
|
18745
19313
|
};
|
|
18746
19314
|
}
|
|
@@ -18748,7 +19316,7 @@ var buildMountSpec = (surface, dest, appSurface) => {
|
|
|
18748
19316
|
component: "ReportModeDev",
|
|
18749
19317
|
importStatement: "import { ReportModeDev } from '@/components/report-mode/report-mode-dev';",
|
|
18750
19318
|
jsxTag: "<ReportModeDev />",
|
|
18751
|
-
candidatePaths: [
|
|
19319
|
+
candidatePaths: [join35(dest, "src", "components", "app-root.tsx")],
|
|
18752
19320
|
anchor: void 0
|
|
18753
19321
|
};
|
|
18754
19322
|
};
|
|
@@ -18815,9 +19383,9 @@ var planReportModeInstall = async (options) => {
|
|
|
18815
19383
|
if (!isInstallableSurface(surface)) {
|
|
18816
19384
|
return { available: false, surface };
|
|
18817
19385
|
}
|
|
18818
|
-
const sourceDir =
|
|
19386
|
+
const sourceDir = join35(kitRoot, "templates", surface);
|
|
18819
19387
|
const sources = SURFACE_SOURCES[surface];
|
|
18820
|
-
const destDeps = parseDependencies(await fs.readText(
|
|
19388
|
+
const destDeps = parseDependencies(await fs.readText(join35(dest, "package.json")));
|
|
18821
19389
|
const rewrite = await planRewrite({ surface, dest, fs, appSurface, destDeps });
|
|
18822
19390
|
const files = await buildPlannedFiles({
|
|
18823
19391
|
fs,
|
|
@@ -18833,7 +19401,7 @@ var planReportModeInstall = async (options) => {
|
|
|
18833
19401
|
}
|
|
18834
19402
|
const utilsFile = files.find((file) => file.relativePath === UTILS_FILE);
|
|
18835
19403
|
const willWriteUtils = utilsFile !== void 0 && !utilsFile.exists;
|
|
18836
|
-
const sourceDeps = parseDependencies(await fs.readText(
|
|
19404
|
+
const sourceDeps = parseDependencies(await fs.readText(join35(sourceDir, "package.json")));
|
|
18837
19405
|
const deps = buildDeps(surface, sourceDeps, willWriteUtils);
|
|
18838
19406
|
const env = buildEnv(surface, assistant);
|
|
18839
19407
|
const mount = await planMount(fs, buildMountSpec(surface, dest, appSurface));
|
|
@@ -18884,7 +19452,7 @@ var applyReportModeInstall = async (plan, options = { force: false }, seams = de
|
|
|
18884
19452
|
);
|
|
18885
19453
|
const written = outcomes.filter((row) => row.kind === "written").map((row) => row.path);
|
|
18886
19454
|
const skipped = outcomes.filter((row) => row.kind === "skipped").map((row) => row.path);
|
|
18887
|
-
const depsAdded = await seams.ensureDeps(
|
|
19455
|
+
const depsAdded = await seams.ensureDeps(join35(plan.dest, "package.json"), plan.deps);
|
|
18888
19456
|
if (Object.keys(plan.env).length > 0) {
|
|
18889
19457
|
seams.writeEnv(plan.dest, plan.env);
|
|
18890
19458
|
}
|
|
@@ -18901,7 +19469,7 @@ var applyReportModeInstall = async (plan, options = { force: false }, seams = de
|
|
|
18901
19469
|
};
|
|
18902
19470
|
|
|
18903
19471
|
// src/commands/reportModeCmd.ts
|
|
18904
|
-
var isCursorSession = () => Boolean(
|
|
19472
|
+
var isCursorSession = () => Boolean(process16.env.CURSOR_TRACE_ID || process16.env.CURSOR_SESSION_ID);
|
|
18905
19473
|
var succeeds = (command, args) => spawnSync(command, [...args], { stdio: "ignore" }).status === 0;
|
|
18906
19474
|
var resolveAssistant = () => inferVybeAssistant({
|
|
18907
19475
|
cursorSession: isCursorSession(),
|
|
@@ -18930,7 +19498,7 @@ var reportModeError = (error) => ({
|
|
|
18930
19498
|
var runAddReportMode = async (args) => {
|
|
18931
19499
|
const flags = parsePieceFlags(args);
|
|
18932
19500
|
const destArg = flags.to === void 0 || flags.to === "" ? flags.positionals.at(0) : flags.to;
|
|
18933
|
-
const dest = resolveInstallDest(destArg,
|
|
19501
|
+
const dest = resolveInstallDest(destArg, process16.cwd());
|
|
18934
19502
|
const surface = inferProjectSurfaceSync(dest).template;
|
|
18935
19503
|
let cleanup;
|
|
18936
19504
|
try {
|
|
@@ -18983,7 +19551,7 @@ var runAddReportMode = async (args) => {
|
|
|
18983
19551
|
// src/commands/piecesInteractive.ts
|
|
18984
19552
|
var runListPath = async () => {
|
|
18985
19553
|
const result = await runListPieces([]);
|
|
18986
|
-
|
|
19554
|
+
process17.stdout.write(`${result.json}
|
|
18987
19555
|
`);
|
|
18988
19556
|
return result.exitCode;
|
|
18989
19557
|
};
|
|
@@ -19001,9 +19569,9 @@ var runDbPresetPath = async () => {
|
|
|
19001
19569
|
return 1;
|
|
19002
19570
|
}
|
|
19003
19571
|
const result = await runApplyPreset([picked, "--dry-run"]);
|
|
19004
|
-
|
|
19572
|
+
process17.stdout.write(`${result.json}
|
|
19005
19573
|
`);
|
|
19006
|
-
|
|
19574
|
+
process17.stdout.write(
|
|
19007
19575
|
`
|
|
19008
19576
|
Dry-run shown. Apply for real with: vybekiit apply-preset ${picked}
|
|
19009
19577
|
(Needs DATABASE_URL in the project.)
|
|
@@ -19013,10 +19581,10 @@ Dry-run shown. Apply for real with: vybekiit apply-preset ${picked}
|
|
|
19013
19581
|
};
|
|
19014
19582
|
var runReportModePath = async () => {
|
|
19015
19583
|
const result = await runAddReportMode(["--to=."]);
|
|
19016
|
-
|
|
19584
|
+
process17.stdout.write(`${result.json}
|
|
19017
19585
|
`);
|
|
19018
19586
|
if (result.exitCode === 0) {
|
|
19019
|
-
|
|
19587
|
+
process17.stdout.write(
|
|
19020
19588
|
"\nInstalled Report Mode into the current folder. Wire any TODOs in the JSON report next.\n"
|
|
19021
19589
|
);
|
|
19022
19590
|
}
|
|
@@ -19030,7 +19598,7 @@ var runPageRecipePath = async () => {
|
|
|
19030
19598
|
cleanup = resolvedCleanup;
|
|
19031
19599
|
const recipes = await loadPageRecipes(kitRoot);
|
|
19032
19600
|
if (recipes.length === 0) {
|
|
19033
|
-
|
|
19601
|
+
process17.stderr.write("No page recipes available from the kit source.\n");
|
|
19034
19602
|
return 1;
|
|
19035
19603
|
}
|
|
19036
19604
|
const picked = await select({
|
|
@@ -19046,10 +19614,10 @@ var runPageRecipePath = async () => {
|
|
|
19046
19614
|
return 1;
|
|
19047
19615
|
}
|
|
19048
19616
|
const result = await runAddPageRecipe([picked, "--to=."]);
|
|
19049
|
-
|
|
19617
|
+
process17.stdout.write(`${result.json}
|
|
19050
19618
|
`);
|
|
19051
19619
|
if (result.exitCode === 0) {
|
|
19052
|
-
|
|
19620
|
+
process17.stdout.write(
|
|
19053
19621
|
`
|
|
19054
19622
|
Installed "${picked}" into the current folder. Wire the TODOs in the JSON report next.
|
|
19055
19623
|
`
|
|
@@ -19058,7 +19626,7 @@ Installed "${picked}" into the current folder. Wire the TODOs in the JSON report
|
|
|
19058
19626
|
return result.exitCode;
|
|
19059
19627
|
} catch (error) {
|
|
19060
19628
|
const message = caughtMessage(error);
|
|
19061
|
-
|
|
19629
|
+
process17.stderr.write(`${message}
|
|
19062
19630
|
`);
|
|
19063
19631
|
return 1;
|
|
19064
19632
|
} finally {
|
|
@@ -19069,7 +19637,7 @@ Installed "${picked}" into the current folder. Wire the TODOs in the JSON report
|
|
|
19069
19637
|
};
|
|
19070
19638
|
var runAddPiecesInteractive = async () => {
|
|
19071
19639
|
if (!isInteractive()) {
|
|
19072
|
-
|
|
19640
|
+
process17.stderr.write(
|
|
19073
19641
|
"add requires arguments in non-interactive mode. Try: vybekiit list-pieces\n"
|
|
19074
19642
|
);
|
|
19075
19643
|
return 1;
|
|
@@ -19172,9 +19740,9 @@ var runPlanDataModel = async (args) => {
|
|
|
19172
19740
|
};
|
|
19173
19741
|
|
|
19174
19742
|
// src/commands/planReadiness.ts
|
|
19175
|
-
import { access as
|
|
19176
|
-
import { join as
|
|
19177
|
-
import
|
|
19743
|
+
import { access as access15 } from "fs/promises";
|
|
19744
|
+
import { join as join36 } from "path";
|
|
19745
|
+
import process18 from "process";
|
|
19178
19746
|
var FEATURES = [
|
|
19179
19747
|
"sign-in",
|
|
19180
19748
|
"payments",
|
|
@@ -19186,13 +19754,13 @@ var FEATURES = [
|
|
|
19186
19754
|
var resolveFeatureName = (value) => FEATURES.find((feature) => feature === value);
|
|
19187
19755
|
var pathExists7 = async (path) => {
|
|
19188
19756
|
try {
|
|
19189
|
-
await
|
|
19757
|
+
await access15(path);
|
|
19190
19758
|
return true;
|
|
19191
19759
|
} catch {
|
|
19192
19760
|
return false;
|
|
19193
19761
|
}
|
|
19194
19762
|
};
|
|
19195
|
-
var runPlanReadiness = async (args, cwd =
|
|
19763
|
+
var runPlanReadiness = async (args, cwd = process18.cwd()) => {
|
|
19196
19764
|
const [featureArg, templateArg] = args;
|
|
19197
19765
|
const feature = featureArg === void 0 ? void 0 : resolveFeatureName(featureArg);
|
|
19198
19766
|
if (feature === void 0) {
|
|
@@ -19218,7 +19786,7 @@ var runPlanReadiness = async (args, cwd = process16.cwd()) => {
|
|
|
19218
19786
|
exitCode: 1
|
|
19219
19787
|
};
|
|
19220
19788
|
}
|
|
19221
|
-
const hasBackend = await pathExists7(
|
|
19789
|
+
const hasBackend = await pathExists7(join36(cwd, "backend", "package.json"));
|
|
19222
19790
|
const hasWeb = inferProjectSurfaceSync(cwd).template === "web";
|
|
19223
19791
|
const plan = planFeatureReadiness({
|
|
19224
19792
|
template,
|
|
@@ -19262,13 +19830,13 @@ var runPlanSetup = (args) => {
|
|
|
19262
19830
|
|
|
19263
19831
|
// src/commands/renderAgentLayer.ts
|
|
19264
19832
|
import { mkdir as mkdir10, writeFile as writeFile12 } from "fs/promises";
|
|
19265
|
-
import { dirname as dirname13, join as
|
|
19266
|
-
import
|
|
19833
|
+
import { dirname as dirname13, join as join37 } from "path";
|
|
19834
|
+
import process19 from "process";
|
|
19267
19835
|
var writeBuyerSkillStubs = async (cwd, template, skillContents) => {
|
|
19268
19836
|
const stubs = planBuyerSkillStubOutputs(template, skillContents);
|
|
19269
19837
|
await Promise.all(
|
|
19270
19838
|
stubs.map(async (stub) => {
|
|
19271
|
-
const absolute =
|
|
19839
|
+
const absolute = join37(cwd, stub.stubPath);
|
|
19272
19840
|
await mkdir10(dirname13(absolute), { recursive: true });
|
|
19273
19841
|
await writeFile12(absolute, stub.content, "utf8");
|
|
19274
19842
|
})
|
|
@@ -19285,7 +19853,7 @@ var resolveRenderTemplate = async (cwd, templateArg) => {
|
|
|
19285
19853
|
}
|
|
19286
19854
|
return "web";
|
|
19287
19855
|
};
|
|
19288
|
-
var runRenderAgentLayer = async (cwd =
|
|
19856
|
+
var runRenderAgentLayer = async (cwd = process19.cwd(), templateArg) => {
|
|
19289
19857
|
const template = await resolveRenderTemplate(cwd, templateArg);
|
|
19290
19858
|
const { contents, present } = await loadAgentLayerRenderInputs(cwd);
|
|
19291
19859
|
const skillContents = await listBuyerSkillContents(cwd);
|
|
@@ -19308,14 +19876,14 @@ var runRenderAgentLayer = async (cwd = process17.cwd(), templateArg) => {
|
|
|
19308
19876
|
};
|
|
19309
19877
|
|
|
19310
19878
|
// src/commands/setup.ts
|
|
19311
|
-
import
|
|
19879
|
+
import process28 from "process";
|
|
19312
19880
|
|
|
19313
19881
|
// src/doctor/gate.ts
|
|
19314
19882
|
import { spawnSync as spawnSync2 } from "child_process";
|
|
19315
|
-
import
|
|
19316
|
-
var { org: GATE_ORG, repos: GATE_REPOS } = readGateIdentity(
|
|
19883
|
+
import process20 from "process";
|
|
19884
|
+
var { org: GATE_ORG, repos: GATE_REPOS } = readGateIdentity(process20.env);
|
|
19317
19885
|
var SITE_URL = (() => {
|
|
19318
|
-
const value =
|
|
19886
|
+
const value = process20.env.VYBEKIIT_SITE_URL;
|
|
19319
19887
|
if (value !== void 0 && value.trim() !== "") {
|
|
19320
19888
|
return value;
|
|
19321
19889
|
}
|
|
@@ -19331,7 +19899,7 @@ var isOrgMember = () => {
|
|
|
19331
19899
|
};
|
|
19332
19900
|
var hasRepoAccess = () => GATE_REPOS.some((repo) => ghSucceeds(["api", `repos/${GATE_ORG}/${repo}`]));
|
|
19333
19901
|
var checkAccess = () => {
|
|
19334
|
-
if (
|
|
19902
|
+
if (process20.env.VYBEKIIT_SKIP_GATE === "1") {
|
|
19335
19903
|
return { allowed: true, reason: "skipped", org: GATE_ORG };
|
|
19336
19904
|
}
|
|
19337
19905
|
if (!ghSucceeds(["--version"])) {
|
|
@@ -19363,27 +19931,27 @@ var ensureAccessOrExit = () => {
|
|
|
19363
19931
|
if (result.allowed) {
|
|
19364
19932
|
return true;
|
|
19365
19933
|
}
|
|
19366
|
-
|
|
19934
|
+
process20.stderr.write(`${formatGateFailure(result)}
|
|
19367
19935
|
`);
|
|
19368
19936
|
return false;
|
|
19369
19937
|
};
|
|
19370
19938
|
|
|
19371
19939
|
// src/doctor/run.ts
|
|
19372
19940
|
import { spawnSync as spawnSync8 } from "child_process";
|
|
19373
|
-
import
|
|
19941
|
+
import process23 from "process";
|
|
19374
19942
|
|
|
19375
19943
|
// src/doctor/agentExperience.ts
|
|
19376
19944
|
import { spawnSync as spawnSync4 } from "child_process";
|
|
19377
19945
|
import { accessSync, constants } from "fs";
|
|
19378
|
-
import { homedir } from "os";
|
|
19379
|
-
import { join as
|
|
19946
|
+
import { homedir as homedir3 } from "os";
|
|
19947
|
+
import { join as join39 } from "path";
|
|
19380
19948
|
|
|
19381
19949
|
// src/doctor/mcpWire.ts
|
|
19382
19950
|
import { spawnSync as spawnSync3 } from "child_process";
|
|
19383
19951
|
import { existsSync as existsSync7, mkdirSync as mkdirSync8, readFileSync as readFileSync7, writeFileSync as writeFileSync5 } from "fs";
|
|
19384
|
-
import { dirname as dirname14, join as
|
|
19952
|
+
import { dirname as dirname14, join as join38 } from "path";
|
|
19385
19953
|
var CATALOG_RELATIVE_PATHS = [
|
|
19386
|
-
|
|
19954
|
+
join38(".claude", "mcp", "mcp-servers.json"),
|
|
19387
19955
|
"mcp-servers.json"
|
|
19388
19956
|
];
|
|
19389
19957
|
var defaultCommandExists = (command) => {
|
|
@@ -19416,7 +19984,7 @@ var createDefaultMcpWireDeps = () => ({
|
|
|
19416
19984
|
});
|
|
19417
19985
|
var findMcpCatalogPath = (cwd, pathExists9) => {
|
|
19418
19986
|
for (const relative6 of CATALOG_RELATIVE_PATHS) {
|
|
19419
|
-
const absolute =
|
|
19987
|
+
const absolute = join38(cwd, relative6);
|
|
19420
19988
|
if (pathExists9(absolute)) {
|
|
19421
19989
|
return absolute;
|
|
19422
19990
|
}
|
|
@@ -19621,7 +20189,7 @@ var wireCoreMcps = (cwd, agents, deps = createDefaultMcpWireDeps()) => {
|
|
|
19621
20189
|
let anyFailure = false;
|
|
19622
20190
|
for (const agent of capable) {
|
|
19623
20191
|
if (agent.id === "cursor") {
|
|
19624
|
-
const configPath =
|
|
20192
|
+
const configPath = join38(cwd, ".cursor", "mcp.json");
|
|
19625
20193
|
try {
|
|
19626
20194
|
const { written, added } = writeMergedMcpConfig(configPath, core, deps);
|
|
19627
20195
|
agentsWired.push("cursor");
|
|
@@ -19639,7 +20207,7 @@ var wireCoreMcps = (cwd, agents, deps = createDefaultMcpWireDeps()) => {
|
|
|
19639
20207
|
continue;
|
|
19640
20208
|
}
|
|
19641
20209
|
if (agent.id === "claude-code") {
|
|
19642
|
-
const configPath =
|
|
20210
|
+
const configPath = join38(cwd, ".mcp.json");
|
|
19643
20211
|
try {
|
|
19644
20212
|
const { written, added } = writeMergedMcpConfig(configPath, core, deps);
|
|
19645
20213
|
if (written && added.length > 0) {
|
|
@@ -19684,7 +20252,7 @@ var defaultCommandExists2 = (command) => {
|
|
|
19684
20252
|
const help = spawnSync4(command, ["--help"], { stdio: "ignore" });
|
|
19685
20253
|
return help.status === 0 || help.error === void 0;
|
|
19686
20254
|
};
|
|
19687
|
-
var
|
|
20255
|
+
var defaultPathExists3 = (path) => {
|
|
19688
20256
|
try {
|
|
19689
20257
|
accessSync(path, constants.F_OK);
|
|
19690
20258
|
return true;
|
|
@@ -19694,7 +20262,7 @@ var defaultPathExists = (path) => {
|
|
|
19694
20262
|
};
|
|
19695
20263
|
var createDefaultAgentExperienceDeps = () => ({
|
|
19696
20264
|
commandExists: defaultCommandExists2,
|
|
19697
|
-
pathExists:
|
|
20265
|
+
pathExists: defaultPathExists3,
|
|
19698
20266
|
env: process.env,
|
|
19699
20267
|
ensureProjectSkillLinks: async (cwd) => {
|
|
19700
20268
|
await ensureAgentSkillSymlinks(cwd);
|
|
@@ -19727,23 +20295,23 @@ var detectPresentAgents = (cwd, deps = createDefaultAgentExperienceDeps()) => {
|
|
|
19727
20295
|
if (deps.commandExists("gemini")) {
|
|
19728
20296
|
add("gemini");
|
|
19729
20297
|
}
|
|
19730
|
-
const home =
|
|
19731
|
-
if (deps.pathExists(
|
|
20298
|
+
const home = homedir3();
|
|
20299
|
+
if (deps.pathExists(join39(home, ".claude"))) {
|
|
19732
20300
|
add("claude-code");
|
|
19733
20301
|
}
|
|
19734
|
-
if (deps.pathExists(
|
|
20302
|
+
if (deps.pathExists(join39(home, ".codex"))) {
|
|
19735
20303
|
add("codex");
|
|
19736
20304
|
}
|
|
19737
|
-
if (deps.pathExists(
|
|
20305
|
+
if (deps.pathExists(join39(home, ".cursor"))) {
|
|
19738
20306
|
add("cursor");
|
|
19739
20307
|
}
|
|
19740
|
-
if (deps.pathExists(
|
|
20308
|
+
if (deps.pathExists(join39(cwd, ".claude"))) {
|
|
19741
20309
|
add("claude-code");
|
|
19742
20310
|
}
|
|
19743
|
-
if (deps.pathExists(
|
|
20311
|
+
if (deps.pathExists(join39(cwd, ".cursor"))) {
|
|
19744
20312
|
add("cursor");
|
|
19745
20313
|
}
|
|
19746
|
-
if (deps.pathExists(
|
|
20314
|
+
if (deps.pathExists(join39(cwd, "AGENTS.md"))) {
|
|
19747
20315
|
add("codex");
|
|
19748
20316
|
}
|
|
19749
20317
|
if (found.size === 0) {
|
|
@@ -19769,7 +20337,7 @@ var runAgentExperience = async (cwd, options, deps = createDefaultAgentExperienc
|
|
|
19769
20337
|
let ok = true;
|
|
19770
20338
|
const names = agents.map((agent) => agent.name).join(", ");
|
|
19771
20339
|
lines.push(`\u2713 agents detected - ${names}`);
|
|
19772
|
-
const hasProjectSkills = deps.pathExists(
|
|
20340
|
+
const hasProjectSkills = deps.pathExists(join39(cwd, ".agents", "skills")) || deps.pathExists(join39(cwd, "platform-skills.manifest.json")) || deps.pathExists(join39(cwd, "skills-lock.json"));
|
|
19773
20341
|
if (hasProjectSkills) {
|
|
19774
20342
|
try {
|
|
19775
20343
|
await deps.ensureProjectSkillLinks(cwd);
|
|
@@ -19821,17 +20389,17 @@ var runAgentExperience = async (cwd, options, deps = createDefaultAgentExperienc
|
|
|
19821
20389
|
);
|
|
19822
20390
|
}
|
|
19823
20391
|
}
|
|
19824
|
-
const kitRootAgentMcp =
|
|
19825
|
-
const surfaceAgentMcp =
|
|
20392
|
+
const kitRootAgentMcp = join39(cwd, "packages", "agentMcp");
|
|
20393
|
+
const surfaceAgentMcp = join39(cwd, "..", "..", "packages", "agentMcp");
|
|
19826
20394
|
const hasKitRootMcp = deps.pathExists(kitRootAgentMcp);
|
|
19827
20395
|
const hasSurfaceMcp = deps.pathExists(surfaceAgentMcp);
|
|
19828
20396
|
if (hasKitRootMcp || hasSurfaceMcp) {
|
|
19829
20397
|
try {
|
|
19830
20398
|
const layout = hasKitRootMcp ? "kit-root" : "surface";
|
|
19831
20399
|
const template = layout === "kit-root" ? ["web", "mobile", "extension", "backend", "spa"].find(
|
|
19832
|
-
(name) => deps.pathExists(
|
|
20400
|
+
(name) => deps.pathExists(join39(cwd, "templates", name))
|
|
19833
20401
|
) : void 0;
|
|
19834
|
-
const configPaths = [
|
|
20402
|
+
const configPaths = [join39(cwd, ".cursor", "mcp.json"), join39(cwd, ".mcp.json")];
|
|
19835
20403
|
for (const configPath of configPaths) {
|
|
19836
20404
|
await writeFirstPartyMcpConfigFile(
|
|
19837
20405
|
configPath,
|
|
@@ -19853,7 +20421,7 @@ var runAgentExperience = async (cwd, options, deps = createDefaultAgentExperienc
|
|
|
19853
20421
|
|
|
19854
20422
|
// src/doctor/assetsValidate.ts
|
|
19855
20423
|
import { existsSync as existsSync8, readFileSync as readFileSync8 } from "fs";
|
|
19856
|
-
import { join as
|
|
20424
|
+
import { join as join40 } from "path";
|
|
19857
20425
|
var ASSET_SURFACE_DIRS = {
|
|
19858
20426
|
web: "public",
|
|
19859
20427
|
spa: "public",
|
|
@@ -19874,9 +20442,9 @@ var OPTIMIZE_FILE_CANDIDATES = [
|
|
|
19874
20442
|
"scripts/optimize.ts"
|
|
19875
20443
|
];
|
|
19876
20444
|
var createDefaultAssetsValidateDeps = (cwd) => ({
|
|
19877
|
-
exists: (relativePath) => existsSync8(
|
|
20445
|
+
exists: (relativePath) => existsSync8(join40(cwd, relativePath)),
|
|
19878
20446
|
readUtf8: (relativePath) => {
|
|
19879
|
-
const absolute =
|
|
20447
|
+
const absolute = join40(cwd, relativePath);
|
|
19880
20448
|
if (!existsSync8(absolute)) {
|
|
19881
20449
|
return null;
|
|
19882
20450
|
}
|
|
@@ -20014,36 +20582,36 @@ var verifyAssetsPipeline = (cwd, surface = inferProjectSurfaceSync(cwd), deps =
|
|
|
20014
20582
|
};
|
|
20015
20583
|
|
|
20016
20584
|
// src/global/globalPaths.ts
|
|
20017
|
-
import { homedir as
|
|
20018
|
-
import { dirname as dirname15, join as
|
|
20019
|
-
import
|
|
20585
|
+
import { homedir as homedir4 } from "os";
|
|
20586
|
+
import { dirname as dirname15, join as join41 } from "path";
|
|
20587
|
+
import process21 from "process";
|
|
20020
20588
|
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
20021
20589
|
var MODULE_DIR = dirname15(fileURLToPath7(import.meta.url));
|
|
20022
20590
|
var resolveConfigDir = () => {
|
|
20023
|
-
const override =
|
|
20591
|
+
const override = process21.env.CLAUDE_CONFIG_DIR;
|
|
20024
20592
|
if (override !== void 0 && override.trim() !== "") {
|
|
20025
20593
|
return override.trim();
|
|
20026
20594
|
}
|
|
20027
|
-
return
|
|
20595
|
+
return join41(homedir4(), ".claude");
|
|
20028
20596
|
};
|
|
20029
20597
|
var resolveGlobalPaths = (configDir = resolveConfigDir()) => ({
|
|
20030
20598
|
configDir,
|
|
20031
|
-
skillsDir:
|
|
20032
|
-
commandsDir:
|
|
20033
|
-
memoryFile:
|
|
20034
|
-
settingsFile:
|
|
20599
|
+
skillsDir: join41(configDir, "skills"),
|
|
20600
|
+
commandsDir: join41(configDir, "commands"),
|
|
20601
|
+
memoryFile: join41(configDir, "CLAUDE.md"),
|
|
20602
|
+
settingsFile: join41(configDir, "settings.json"),
|
|
20035
20603
|
// At runtime this module is inlined into dist/bin.js, so MODULE_DIR is <install>/dist
|
|
20036
20604
|
// and the payload sits beside it at dist/global-skills.
|
|
20037
|
-
bundledSkillsDir:
|
|
20605
|
+
bundledSkillsDir: join41(MODULE_DIR, "global-skills")
|
|
20038
20606
|
});
|
|
20039
20607
|
|
|
20040
20608
|
// src/global/globalStatus.ts
|
|
20041
20609
|
import { readFile as readFile18, stat as stat2 } from "fs/promises";
|
|
20042
|
-
import { join as
|
|
20610
|
+
import { join as join43 } from "path";
|
|
20043
20611
|
|
|
20044
20612
|
// src/global/managedSkills.ts
|
|
20045
|
-
import { readdir as
|
|
20046
|
-
import { join as
|
|
20613
|
+
import { readdir as readdir11, stat } from "fs/promises";
|
|
20614
|
+
import { join as join42 } from "path";
|
|
20047
20615
|
var GLOBAL_SKILL_SAMPLE_SIZE = 5;
|
|
20048
20616
|
var MANAGED_SKILL_MARKER = ".vybekiit-managed";
|
|
20049
20617
|
var exists = async (path) => {
|
|
@@ -20056,13 +20624,13 @@ var exists = async (path) => {
|
|
|
20056
20624
|
};
|
|
20057
20625
|
var listManagedSkillNames = async (skillsDir) => {
|
|
20058
20626
|
try {
|
|
20059
|
-
const entries = await
|
|
20627
|
+
const entries = await readdir11(skillsDir, { withFileTypes: true });
|
|
20060
20628
|
const names = [];
|
|
20061
20629
|
for (const entry of entries) {
|
|
20062
20630
|
if (!entry.isDirectory()) {
|
|
20063
20631
|
continue;
|
|
20064
20632
|
}
|
|
20065
|
-
if (await exists(
|
|
20633
|
+
if (await exists(join42(skillsDir, entry.name, MANAGED_SKILL_MARKER))) {
|
|
20066
20634
|
names.push(entry.name);
|
|
20067
20635
|
}
|
|
20068
20636
|
}
|
|
@@ -20109,7 +20677,7 @@ var readGlobalStatus = async (paths) => {
|
|
|
20109
20677
|
}
|
|
20110
20678
|
const managed = await listManagedSkillNames(paths.skillsDir);
|
|
20111
20679
|
return {
|
|
20112
|
-
hasCommand: await exists2(
|
|
20680
|
+
hasCommand: await exists2(join43(paths.commandsDir, "vybekiit.md")),
|
|
20113
20681
|
hasMemory,
|
|
20114
20682
|
skillCount: managed.length,
|
|
20115
20683
|
skillSample: sampleManagedSkillNames(managed)
|
|
@@ -20128,9 +20696,9 @@ var formatGlobalStatus = (status) => {
|
|
|
20128
20696
|
};
|
|
20129
20697
|
|
|
20130
20698
|
// src/doctor/codexConfig.ts
|
|
20131
|
-
import { access as
|
|
20132
|
-
import { homedir as
|
|
20133
|
-
import { join as
|
|
20699
|
+
import { access as access16, mkdir as mkdir11, readFile as readFile19, writeFile as writeFile13 } from "fs/promises";
|
|
20700
|
+
import { homedir as homedir5 } from "os";
|
|
20701
|
+
import { join as join44 } from "path";
|
|
20134
20702
|
var FEATURES_BLOCK = ["[features]", "skills = true"].join("\n");
|
|
20135
20703
|
var FEATURES_SKILLS_ENABLED_PATTERN = /\[features\][\s\S]*?\bskills\s*=\s*true\b/m;
|
|
20136
20704
|
var FEATURES_BLOCK_PATTERN = /(\[features\][^[]*)/m;
|
|
@@ -20139,10 +20707,10 @@ var SKILLS_LINE_PATTERN = /\bskills\s*=\s*.*/m;
|
|
|
20139
20707
|
var codexConfigPath = () => {
|
|
20140
20708
|
const configuredHome = process.env.CODEX_HOME;
|
|
20141
20709
|
if (configuredHome !== void 0 && configuredHome.trim() !== "") {
|
|
20142
|
-
return
|
|
20710
|
+
return join44(configuredHome.trim(), "config.toml");
|
|
20143
20711
|
}
|
|
20144
|
-
const home =
|
|
20145
|
-
return
|
|
20712
|
+
const home = join44(homedir5(), ".codex");
|
|
20713
|
+
return join44(home, "config.toml");
|
|
20146
20714
|
};
|
|
20147
20715
|
var upsertFeaturesSkills = (content) => {
|
|
20148
20716
|
if (FEATURES_SKILLS_ENABLED_PATTERN.test(content)) {
|
|
@@ -20168,7 +20736,7 @@ ${FEATURES_BLOCK}
|
|
|
20168
20736
|
};
|
|
20169
20737
|
var ensureCodexSkillsEnabled = async () => {
|
|
20170
20738
|
const path = codexConfigPath();
|
|
20171
|
-
await mkdir11(
|
|
20739
|
+
await mkdir11(join44(path, ".."), { recursive: true });
|
|
20172
20740
|
let previous = "";
|
|
20173
20741
|
try {
|
|
20174
20742
|
previous = await readFile19(path, "utf8");
|
|
@@ -20187,7 +20755,7 @@ var ensureCodexSkillsEnabled = async () => {
|
|
|
20187
20755
|
|
|
20188
20756
|
// src/doctor/kitWorkspaceHealth.ts
|
|
20189
20757
|
import { existsSync as existsSync9, readdirSync as readdirSync2, readFileSync as readFileSync9, statSync as statSync2 } from "fs";
|
|
20190
|
-
import { join as
|
|
20758
|
+
import { join as join45 } from "path";
|
|
20191
20759
|
var readPackageJsonSafe = (packageJsonPath) => {
|
|
20192
20760
|
if (!existsSync9(packageJsonPath)) {
|
|
20193
20761
|
return null;
|
|
@@ -20220,7 +20788,7 @@ var listPackageRelDirs = (packagesRoot) => {
|
|
|
20220
20788
|
const top = readdirSync2(packagesRoot);
|
|
20221
20789
|
const rels = [];
|
|
20222
20790
|
for (const entry of top) {
|
|
20223
|
-
const abs =
|
|
20791
|
+
const abs = join45(packagesRoot, entry);
|
|
20224
20792
|
let isDir = false;
|
|
20225
20793
|
try {
|
|
20226
20794
|
isDir = statSync2(abs).isDirectory();
|
|
@@ -20230,7 +20798,7 @@ var listPackageRelDirs = (packagesRoot) => {
|
|
|
20230
20798
|
if (!isDir) {
|
|
20231
20799
|
continue;
|
|
20232
20800
|
}
|
|
20233
|
-
if (existsSync9(
|
|
20801
|
+
if (existsSync9(join45(abs, "package.json"))) {
|
|
20234
20802
|
rels.push(entry);
|
|
20235
20803
|
continue;
|
|
20236
20804
|
}
|
|
@@ -20241,10 +20809,10 @@ var listPackageRelDirs = (packagesRoot) => {
|
|
|
20241
20809
|
continue;
|
|
20242
20810
|
}
|
|
20243
20811
|
for (const child of nested) {
|
|
20244
|
-
const childAbs =
|
|
20812
|
+
const childAbs = join45(abs, child);
|
|
20245
20813
|
try {
|
|
20246
|
-
if (statSync2(childAbs).isDirectory() && existsSync9(
|
|
20247
|
-
rels.push(
|
|
20814
|
+
if (statSync2(childAbs).isDirectory() && existsSync9(join45(childAbs, "package.json"))) {
|
|
20815
|
+
rels.push(join45(entry, child));
|
|
20248
20816
|
}
|
|
20249
20817
|
} catch {
|
|
20250
20818
|
}
|
|
@@ -20253,15 +20821,15 @@ var listPackageRelDirs = (packagesRoot) => {
|
|
|
20253
20821
|
return rels;
|
|
20254
20822
|
};
|
|
20255
20823
|
var findMissingDistPackages = (cwd) => {
|
|
20256
|
-
const packagesRoot =
|
|
20824
|
+
const packagesRoot = join45(cwd, "packages");
|
|
20257
20825
|
const missing = [];
|
|
20258
20826
|
for (const relDir of listPackageRelDirs(packagesRoot)) {
|
|
20259
|
-
const packageDir =
|
|
20260
|
-
const pkg = readPackageJsonSafe(
|
|
20827
|
+
const packageDir = join45(packagesRoot, relDir);
|
|
20828
|
+
const pkg = readPackageJsonSafe(join45(packageDir, "package.json"));
|
|
20261
20829
|
if (pkg === null || !packageExpectsDist(pkg)) {
|
|
20262
20830
|
continue;
|
|
20263
20831
|
}
|
|
20264
|
-
if (!existsSync9(
|
|
20832
|
+
if (!existsSync9(join45(packageDir, "dist"))) {
|
|
20265
20833
|
const name = typeof pkg.name === "string" ? pkg.name : relDir;
|
|
20266
20834
|
missing.push({ name, relDir });
|
|
20267
20835
|
}
|
|
@@ -20269,7 +20837,7 @@ var findMissingDistPackages = (cwd) => {
|
|
|
20269
20837
|
return missing;
|
|
20270
20838
|
};
|
|
20271
20839
|
var verifyKitWorkspaceHealth = (cwd) => {
|
|
20272
|
-
const packagesRoot =
|
|
20840
|
+
const packagesRoot = join45(cwd, "packages");
|
|
20273
20841
|
if (!existsSync9(packagesRoot)) {
|
|
20274
20842
|
return { ok: true, lines: [] };
|
|
20275
20843
|
}
|
|
@@ -20287,7 +20855,7 @@ var verifyKitWorkspaceHealth = (cwd) => {
|
|
|
20287
20855
|
);
|
|
20288
20856
|
}
|
|
20289
20857
|
const buildRoots = ["tsconfig.base.json", "scripts/lib/tsupWorkspaceAliases.mjs"];
|
|
20290
|
-
const missingRoots = buildRoots.filter((rel) => !existsSync9(
|
|
20858
|
+
const missingRoots = buildRoots.filter((rel) => !existsSync9(join45(cwd, rel)));
|
|
20291
20859
|
if (missingRoots.length > 0 && missing.length > 0) {
|
|
20292
20860
|
lines.push(
|
|
20293
20861
|
`\u2717 Kit is also missing rebuild helpers (${missingRoots.join(", ")}). Re-run \`vybekiit create app\` with a current CLI so build roots ship with the workspace.`
|
|
@@ -20436,11 +21004,11 @@ var mergeDoctorTools = (providerTools, nativeTools) => {
|
|
|
20436
21004
|
|
|
20437
21005
|
// src/doctor/perfReadiness.ts
|
|
20438
21006
|
import { existsSync as existsSync10, readFileSync as readFileSync10 } from "fs";
|
|
20439
|
-
import { join as
|
|
21007
|
+
import { join as join46 } from "path";
|
|
20440
21008
|
var createDefaultPerfReadinessDeps = (cwd) => ({
|
|
20441
|
-
exists: (relativePath) => existsSync10(
|
|
21009
|
+
exists: (relativePath) => existsSync10(join46(cwd, relativePath)),
|
|
20442
21010
|
readUtf8: (relativePath) => {
|
|
20443
|
-
const absolute =
|
|
21011
|
+
const absolute = join46(cwd, relativePath);
|
|
20444
21012
|
if (!existsSync10(absolute)) {
|
|
20445
21013
|
return null;
|
|
20446
21014
|
}
|
|
@@ -20573,17 +21141,17 @@ var reportFor = (reports, name) => reports.find((r) => r.tool === name);
|
|
|
20573
21141
|
|
|
20574
21142
|
// src/doctor/platformSkills.ts
|
|
20575
21143
|
import { existsSync as existsSync11, readFileSync as readFileSync11 } from "fs";
|
|
20576
|
-
import { join as
|
|
20577
|
-
import
|
|
21144
|
+
import { join as join47 } from "path";
|
|
21145
|
+
import process22 from "process";
|
|
20578
21146
|
var readManifest = (cwd) => {
|
|
20579
|
-
const path =
|
|
21147
|
+
const path = join47(cwd, "platform-skills.manifest.json");
|
|
20580
21148
|
if (!existsSync11(path)) {
|
|
20581
21149
|
return null;
|
|
20582
21150
|
}
|
|
20583
21151
|
return JSON.parse(readFileSync11(path, "utf8"));
|
|
20584
21152
|
};
|
|
20585
21153
|
var readSkillsLock = (cwd) => {
|
|
20586
|
-
const path =
|
|
21154
|
+
const path = join47(cwd, "skills-lock.json");
|
|
20587
21155
|
if (!existsSync11(path)) {
|
|
20588
21156
|
return null;
|
|
20589
21157
|
}
|
|
@@ -20593,7 +21161,7 @@ var readSkillsLock = (cwd) => {
|
|
|
20593
21161
|
return null;
|
|
20594
21162
|
}
|
|
20595
21163
|
};
|
|
20596
|
-
var skillFileExists = (cwd, name) => existsSync11(
|
|
21164
|
+
var skillFileExists = (cwd, name) => existsSync11(join47(cwd, ".agents", "skills", name, "SKILL.md"));
|
|
20597
21165
|
var verifyPlatformSkills = (cwd) => {
|
|
20598
21166
|
const manifest = readManifest(cwd);
|
|
20599
21167
|
if (manifest === null) {
|
|
@@ -20617,7 +21185,7 @@ var verifyPlatformSkills = (cwd) => {
|
|
|
20617
21185
|
};
|
|
20618
21186
|
};
|
|
20619
21187
|
var templateLabelForPlatformSkills = (cwd) => {
|
|
20620
|
-
if (!existsSync11(
|
|
21188
|
+
if (!existsSync11(join47(cwd, "platform-skills.manifest.json"))) {
|
|
20621
21189
|
return null;
|
|
20622
21190
|
}
|
|
20623
21191
|
return inferProjectSurfaceSync(cwd).template;
|
|
@@ -20627,7 +21195,7 @@ var formatPlatformSkillsReport = (report) => {
|
|
|
20627
21195
|
return [];
|
|
20628
21196
|
}
|
|
20629
21197
|
const lines = [];
|
|
20630
|
-
const lockPath =
|
|
21198
|
+
const lockPath = join47(process22.cwd(), "skills-lock.json");
|
|
20631
21199
|
if (existsSync11(lockPath)) {
|
|
20632
21200
|
try {
|
|
20633
21201
|
const lock = JSON.parse(readFileSync11(lockPath, "utf8"));
|
|
@@ -20684,10 +21252,10 @@ var formatProductSurfaceHints = (env) => {
|
|
|
20684
21252
|
|
|
20685
21253
|
// src/doctor/projectHealth.ts
|
|
20686
21254
|
import { existsSync as existsSync12, readFileSync as readFileSync12 } from "fs";
|
|
20687
|
-
import { join as
|
|
21255
|
+
import { join as join48 } from "path";
|
|
20688
21256
|
var GITIGNORE_ENV_LINE_PATTERN = /^\.env/m;
|
|
20689
21257
|
var gitignoreCoversEnv = (cwd) => {
|
|
20690
|
-
const path =
|
|
21258
|
+
const path = join48(cwd, ".gitignore");
|
|
20691
21259
|
if (!existsSync12(path)) {
|
|
20692
21260
|
return false;
|
|
20693
21261
|
}
|
|
@@ -20695,7 +21263,7 @@ var gitignoreCoversEnv = (cwd) => {
|
|
|
20695
21263
|
return GITIGNORE_ENV_LINE_PATTERN.test(content) || content.includes(".env\n") || content.includes(".env\r\n");
|
|
20696
21264
|
};
|
|
20697
21265
|
var cursorignoreCoversEnv = (cwd) => {
|
|
20698
|
-
const path =
|
|
21266
|
+
const path = join48(cwd, ".cursorignore");
|
|
20699
21267
|
if (!existsSync12(path)) {
|
|
20700
21268
|
return false;
|
|
20701
21269
|
}
|
|
@@ -20785,7 +21353,7 @@ var formatRailwayStackReport = (env, agentSetup) => {
|
|
|
20785
21353
|
// src/doctor/runNativeProjectSetup.ts
|
|
20786
21354
|
import { spawnSync as spawnSync6 } from "child_process";
|
|
20787
21355
|
import { existsSync as existsSync13 } from "fs";
|
|
20788
|
-
import { join as
|
|
21356
|
+
import { join as join49 } from "path";
|
|
20789
21357
|
var runCommand = (options) => {
|
|
20790
21358
|
const { args, command, cwd, label, log } = options;
|
|
20791
21359
|
log.log(`[doctor] ${label}: ${command} ${args.join(" ")}`);
|
|
@@ -20793,7 +21361,7 @@ var runCommand = (options) => {
|
|
|
20793
21361
|
return result.status === 0;
|
|
20794
21362
|
};
|
|
20795
21363
|
var runExtensionSetup = (cwd, log) => {
|
|
20796
|
-
const wxtTypes =
|
|
21364
|
+
const wxtTypes = join49(cwd, ".wxt", "wxt.d.ts");
|
|
20797
21365
|
if (existsSync13(wxtTypes)) {
|
|
20798
21366
|
return ["\u2713 Extension - WXT types already generated."];
|
|
20799
21367
|
}
|
|
@@ -20812,7 +21380,7 @@ var runMobileSetup = (cwd, platform, log) => {
|
|
|
20812
21380
|
if (platform !== "darwin") {
|
|
20813
21381
|
return [];
|
|
20814
21382
|
}
|
|
20815
|
-
const podfile =
|
|
21383
|
+
const podfile = join49(cwd, "ios", "Podfile");
|
|
20816
21384
|
if (!existsSync13(podfile)) {
|
|
20817
21385
|
return [
|
|
20818
21386
|
"\u2192 Mobile - no `ios/` folder yet. Run `pnpm ios` (Simulator) or `npx expo prebuild --platform ios` before store builds."
|
|
@@ -20821,7 +21389,7 @@ var runMobileSetup = (cwd, platform, log) => {
|
|
|
20821
21389
|
const ok = runCommand({
|
|
20822
21390
|
log,
|
|
20823
21391
|
label: "installing iOS pods",
|
|
20824
|
-
cwd:
|
|
21392
|
+
cwd: join49(cwd, "ios"),
|
|
20825
21393
|
command: "pod",
|
|
20826
21394
|
args: ["install"]
|
|
20827
21395
|
});
|
|
@@ -20846,14 +21414,14 @@ var runNativeProjectSetup = (cwd, surface, platform, log = console) => {
|
|
|
20846
21414
|
// src/doctor/storageR2.ts
|
|
20847
21415
|
import { spawnSync as spawnSync7 } from "child_process";
|
|
20848
21416
|
import { readFileSync as readFileSync13 } from "fs";
|
|
20849
|
-
import { join as
|
|
21417
|
+
import { join as join50 } from "path";
|
|
20850
21418
|
var R2_BUCKET_UNSAFE_PATTERN = /[^a-z0-9-]/g;
|
|
20851
21419
|
var R2_BUCKET_DASH_RUN_PATTERN = /-+/g;
|
|
20852
21420
|
var R2_BUCKET_EDGE_DASH_PATTERN = /^-|-$/g;
|
|
20853
21421
|
var sanitizeBucketName = (name) => name.toLowerCase().replace(R2_BUCKET_UNSAFE_PATTERN, "-").replace(R2_BUCKET_DASH_RUN_PATTERN, "-").replace(R2_BUCKET_EDGE_DASH_PATTERN, "").slice(0, 40);
|
|
20854
21422
|
var readProjectName = (cwd) => {
|
|
20855
21423
|
try {
|
|
20856
|
-
const pkg = JSON.parse(readFileSync13(
|
|
21424
|
+
const pkg = JSON.parse(readFileSync13(join50(cwd, "package.json"), "utf8"));
|
|
20857
21425
|
if (pkg.name !== void 0 && pkg.name !== "" && pkg.name !== "my-vybekiit-app") {
|
|
20858
21426
|
return sanitizeBucketName(pkg.name);
|
|
20859
21427
|
}
|
|
@@ -21420,7 +21988,7 @@ var verifyPresetsDoctor = async (env) => {
|
|
|
21420
21988
|
|
|
21421
21989
|
// src/doctor/run.ts
|
|
21422
21990
|
var toPlatform = (platform) => platform === "darwin" || platform === "win32" || platform === "linux" ? platform : null;
|
|
21423
|
-
var isCursorSession2 = () => Boolean(
|
|
21991
|
+
var isCursorSession2 = () => Boolean(process23.env.CURSOR_TRACE_ID || process23.env.CURSOR_SESSION_ID);
|
|
21424
21992
|
var succeeds2 = (command, args) => spawnSync8(command, [...args], { stdio: "ignore" }).status === 0;
|
|
21425
21993
|
var errorCode = (error) => error !== void 0 && "code" in error && typeof error.code === "string" ? error.code : void 0;
|
|
21426
21994
|
var runInstall = (action, log) => {
|
|
@@ -21548,14 +22116,14 @@ var writeReportModeAssistant = (options) => {
|
|
|
21548
22116
|
}
|
|
21549
22117
|
};
|
|
21550
22118
|
var runDoctor = async (log = console) => {
|
|
21551
|
-
const platform = toPlatform(
|
|
22119
|
+
const platform = toPlatform(process23.platform);
|
|
21552
22120
|
if (platform === null) {
|
|
21553
|
-
log.error(`[doctor] This operating system (${
|
|
22121
|
+
log.error(`[doctor] This operating system (${process23.platform}) isn't supported yet.`);
|
|
21554
22122
|
return 1;
|
|
21555
22123
|
}
|
|
21556
|
-
const cwd =
|
|
22124
|
+
const cwd = process23.cwd();
|
|
21557
22125
|
const surface = inferProjectSurfaceSync(cwd);
|
|
21558
|
-
const env = mergeEnv(
|
|
22126
|
+
const env = mergeEnv(process23.env, loadEnvFile2(cwd));
|
|
21559
22127
|
const cursorSession = isCursorSession2();
|
|
21560
22128
|
if (cursorSession) {
|
|
21561
22129
|
log.log("\u2713 Cursor - you're in Cursor; no separate agent install needed.");
|
|
@@ -21598,9 +22166,9 @@ var runDoctor = async (log = console) => {
|
|
|
21598
22166
|
|
|
21599
22167
|
// src/global/installState.ts
|
|
21600
22168
|
import { mkdir as mkdir12, readFile as readFile20, writeFile as writeFile14 } from "fs/promises";
|
|
21601
|
-
import { join as
|
|
22169
|
+
import { join as join51 } from "path";
|
|
21602
22170
|
var INSTALL_STATE_FILENAME = ".vybekiit-install.json";
|
|
21603
|
-
var installStatePath = (configDir) =>
|
|
22171
|
+
var installStatePath = (configDir) => join51(configDir, INSTALL_STATE_FILENAME);
|
|
21604
22172
|
var readInstallState = async (configDir) => {
|
|
21605
22173
|
try {
|
|
21606
22174
|
const raw = await readFile20(installStatePath(configDir), "utf8");
|
|
@@ -21641,7 +22209,7 @@ var writeInstallState = async (configDir, version, options = {}, now = () => /*
|
|
|
21641
22209
|
};
|
|
21642
22210
|
|
|
21643
22211
|
// src/global/runGlobalInstall.ts
|
|
21644
|
-
import
|
|
22212
|
+
import process25 from "process";
|
|
21645
22213
|
import { confirm as confirm2, isCancel as isCancel3 } from "@clack/prompts";
|
|
21646
22214
|
|
|
21647
22215
|
// src/global/awareness.ts
|
|
@@ -21772,15 +22340,15 @@ var installAwareness = async (paths) => {
|
|
|
21772
22340
|
|
|
21773
22341
|
// src/global/cliVersion.ts
|
|
21774
22342
|
import { readFile as readFile22 } from "fs/promises";
|
|
21775
|
-
import { dirname as dirname17, join as
|
|
22343
|
+
import { dirname as dirname17, join as join52 } from "path";
|
|
21776
22344
|
import { fileURLToPath as fileURLToPath8 } from "url";
|
|
21777
22345
|
var MODULE_DIR2 = dirname17(fileURLToPath8(import.meta.url));
|
|
21778
22346
|
var readCliVersion = async () => {
|
|
21779
22347
|
const candidates = [
|
|
21780
22348
|
// Published layout: dist/*.js → cli/package.json
|
|
21781
|
-
|
|
22349
|
+
join52(MODULE_DIR2, "..", "package.json"),
|
|
21782
22350
|
// Source layout: src/global/*.ts → cli/package.json
|
|
21783
|
-
|
|
22351
|
+
join52(MODULE_DIR2, "..", "..", "package.json")
|
|
21784
22352
|
];
|
|
21785
22353
|
for (const candidate of candidates) {
|
|
21786
22354
|
try {
|
|
@@ -21791,30 +22359,14 @@ var readCliVersion = async () => {
|
|
|
21791
22359
|
}
|
|
21792
22360
|
} catch {
|
|
21793
22361
|
}
|
|
21794
|
-
}
|
|
21795
|
-
return "0.0.0";
|
|
21796
|
-
};
|
|
21797
|
-
|
|
21798
|
-
// src/global/exec.ts
|
|
21799
|
-
import { execFile as execFile6 } from "child_process";
|
|
21800
|
-
var makeExec = (bin) => (args) => new Promise((resolve13) => {
|
|
21801
|
-
execFile6(bin, [...args], { encoding: "utf8" }, (error, stdout, stderr) => {
|
|
21802
|
-
if (error && "code" in error && error.code === "ENOENT") {
|
|
21803
|
-
resolve13({ code: 127, stdout: "", stderr: `${bin} not found` });
|
|
21804
|
-
return;
|
|
21805
|
-
}
|
|
21806
|
-
let code = 0;
|
|
21807
|
-
if (error) {
|
|
21808
|
-
code = typeof error.code === "number" ? error.code : 1;
|
|
21809
|
-
}
|
|
21810
|
-
resolve13({ code, stdout: stdout ?? "", stderr: stderr ?? "" });
|
|
21811
|
-
});
|
|
21812
|
-
});
|
|
22362
|
+
}
|
|
22363
|
+
return "0.0.0";
|
|
22364
|
+
};
|
|
21813
22365
|
|
|
21814
22366
|
// src/global/entitlement.ts
|
|
21815
22367
|
var MIRROR_ORG3 = "VybeKiit";
|
|
21816
22368
|
var SURFACE_MIRRORS = ["web", "mobile", "backend", "extension", "spa"];
|
|
21817
|
-
var
|
|
22369
|
+
var defaultDeps3 = { exec: makeExec("gh") };
|
|
21818
22370
|
var resolveLogin = async (exec) => {
|
|
21819
22371
|
const res = await exec(["api", "user", "--jq", ".login"]);
|
|
21820
22372
|
if (res.code !== 0) {
|
|
@@ -21823,7 +22375,7 @@ var resolveLogin = async (exec) => {
|
|
|
21823
22375
|
const login = res.stdout.trim();
|
|
21824
22376
|
return login === "" ? null : login;
|
|
21825
22377
|
};
|
|
21826
|
-
var checkEntitlement = async (deps =
|
|
22378
|
+
var checkEntitlement = async (deps = defaultDeps3) => {
|
|
21827
22379
|
const { exec } = deps;
|
|
21828
22380
|
if ((await exec(["--version"])).code === 127) {
|
|
21829
22381
|
return { entitled: false, reason: "gh-missing" };
|
|
@@ -21872,7 +22424,7 @@ var formatEntitlementBlock = (result) => {
|
|
|
21872
22424
|
};
|
|
21873
22425
|
|
|
21874
22426
|
// src/global/installGlobalMcp.ts
|
|
21875
|
-
import
|
|
22427
|
+
import process24 from "process";
|
|
21876
22428
|
var ZERO_CONFIG = [
|
|
21877
22429
|
{
|
|
21878
22430
|
name: "playwright",
|
|
@@ -21939,7 +22491,7 @@ var KEY_GATED = [
|
|
|
21939
22491
|
envKeys: ["TAVILY_API_KEY"]
|
|
21940
22492
|
}
|
|
21941
22493
|
];
|
|
21942
|
-
var
|
|
22494
|
+
var defaultDeps4 = { exec: makeExec("claude"), env: process24.env };
|
|
21943
22495
|
var buildAddArgs = (def, env) => {
|
|
21944
22496
|
if (def.transport === "sse") {
|
|
21945
22497
|
const [url = ""] = def.command;
|
|
@@ -21950,7 +22502,7 @@ var buildAddArgs = (def, env) => {
|
|
|
21950
22502
|
};
|
|
21951
22503
|
var hasKeys = (def, env) => (def.envKeys ?? []).every((key) => (env[key] ?? "") !== "");
|
|
21952
22504
|
var isZeroConfig = (def) => ZERO_CONFIG.some((entry) => entry.name === def.name);
|
|
21953
|
-
var installGlobalMcp = async (deps =
|
|
22505
|
+
var installGlobalMcp = async (deps = defaultDeps4) => {
|
|
21954
22506
|
const version = await deps.exec(["--version"]);
|
|
21955
22507
|
if (version.code === 127) {
|
|
21956
22508
|
return {
|
|
@@ -22000,8 +22552,8 @@ var installGlobalMcp = async (deps = defaultDeps2) => {
|
|
|
22000
22552
|
};
|
|
22001
22553
|
|
|
22002
22554
|
// src/global/installGlobalSkills.ts
|
|
22003
|
-
import { cp as cp5, mkdir as mkdir14, readdir as
|
|
22004
|
-
import { join as
|
|
22555
|
+
import { cp as cp5, mkdir as mkdir14, readdir as readdir12, readFile as readFile23, rm as rm5, stat as stat3, writeFile as writeFile16 } from "fs/promises";
|
|
22556
|
+
import { join as join53 } from "path";
|
|
22005
22557
|
var REQUIRED_MANAGED_SKILLS = ["feedback"];
|
|
22006
22558
|
var pathExists8 = async (path) => {
|
|
22007
22559
|
try {
|
|
@@ -22013,14 +22565,14 @@ var pathExists8 = async (path) => {
|
|
|
22013
22565
|
};
|
|
22014
22566
|
var listBundledSkills = async (sourceDir) => {
|
|
22015
22567
|
try {
|
|
22016
|
-
const manifest = JSON.parse(await readFile23(
|
|
22568
|
+
const manifest = JSON.parse(await readFile23(join53(sourceDir, "manifest.json"), "utf8"));
|
|
22017
22569
|
if (Array.isArray(manifest.skills)) {
|
|
22018
22570
|
return [...manifest.skills];
|
|
22019
22571
|
}
|
|
22020
22572
|
} catch {
|
|
22021
22573
|
}
|
|
22022
22574
|
try {
|
|
22023
|
-
const entries = await
|
|
22575
|
+
const entries = await readdir12(sourceDir, { withFileTypes: true });
|
|
22024
22576
|
return entries.filter((entry) => entry.isDirectory()).map((entry) => entry.name);
|
|
22025
22577
|
} catch {
|
|
22026
22578
|
return [];
|
|
@@ -22037,278 +22589,21 @@ var installGlobalSkills = async (paths, sourceDir = paths.bundledSkillsDir) => {
|
|
|
22037
22589
|
const installed = [];
|
|
22038
22590
|
const skipped = [];
|
|
22039
22591
|
for (const name of names) {
|
|
22040
|
-
const dest =
|
|
22592
|
+
const dest = join53(paths.skillsDir, name);
|
|
22041
22593
|
if (await pathExists8(dest)) {
|
|
22042
|
-
if (!await pathExists8(
|
|
22594
|
+
if (!await pathExists8(join53(dest, MANAGED_SKILL_MARKER))) {
|
|
22043
22595
|
skipped.push(name);
|
|
22044
22596
|
continue;
|
|
22045
22597
|
}
|
|
22046
22598
|
await rm5(dest, { recursive: true, force: true });
|
|
22047
22599
|
}
|
|
22048
|
-
await cp5(
|
|
22049
|
-
await writeFile16(
|
|
22600
|
+
await cp5(join53(sourceDir, name), dest, { recursive: true });
|
|
22601
|
+
await writeFile16(join53(dest, MANAGED_SKILL_MARKER), "", "utf8");
|
|
22050
22602
|
installed.push(name);
|
|
22051
22603
|
}
|
|
22052
22604
|
return { installed, skipped, path: paths.skillsDir };
|
|
22053
22605
|
};
|
|
22054
22606
|
|
|
22055
|
-
// src/global/runSessionOne.ts
|
|
22056
|
-
import { spawn as spawn2 } from "child_process";
|
|
22057
|
-
import { access as access15, readdir as readdir11 } from "fs/promises";
|
|
22058
|
-
import { homedir as homedir4 } from "os";
|
|
22059
|
-
import { join as join52 } from "path";
|
|
22060
|
-
import process23 from "process";
|
|
22061
|
-
var DEFAULT_FIRST_APP_DIR_NAME = "vybekiit-app";
|
|
22062
|
-
var SESSION_ONE_SEED_PROMPT = "Set up my app.";
|
|
22063
|
-
var shouldSkipSessionOne = (args, env = process23.env) => {
|
|
22064
|
-
if (args.includes("--skip-session-one") || args.includes("--skip-first-app")) {
|
|
22065
|
-
return true;
|
|
22066
|
-
}
|
|
22067
|
-
const flag = env.VYBEKIIT_SKIP_SESSION_ONE;
|
|
22068
|
-
return flag === "1" || flag === "true" || flag === "yes";
|
|
22069
|
-
};
|
|
22070
|
-
var resolveFirstAppPath = (deps) => {
|
|
22071
|
-
const override = deps.env.VYBEKIIT_FIRST_APP_DIR?.trim();
|
|
22072
|
-
if (override !== void 0 && override !== "") {
|
|
22073
|
-
return override.startsWith("/") || /^[A-Za-z]:[\\/]/.test(override) ? override : join52(deps.homeDir(), override);
|
|
22074
|
-
}
|
|
22075
|
-
return join52(deps.homeDir(), DEFAULT_FIRST_APP_DIR_NAME);
|
|
22076
|
-
};
|
|
22077
|
-
var defaultPathExists2 = async (path) => {
|
|
22078
|
-
try {
|
|
22079
|
-
await access15(path);
|
|
22080
|
-
return true;
|
|
22081
|
-
} catch {
|
|
22082
|
-
return false;
|
|
22083
|
-
}
|
|
22084
|
-
};
|
|
22085
|
-
var defaultIsEmptyDir = async (path) => {
|
|
22086
|
-
try {
|
|
22087
|
-
const entries = await readdir11(path);
|
|
22088
|
-
return entries.length === 0;
|
|
22089
|
-
} catch {
|
|
22090
|
-
return true;
|
|
22091
|
-
}
|
|
22092
|
-
};
|
|
22093
|
-
var defaultRunCommand = async (cwd, bin, args) => await new Promise((resolve13) => {
|
|
22094
|
-
const child = spawn2(bin, [...args], {
|
|
22095
|
-
cwd,
|
|
22096
|
-
stdio: ["ignore", "inherit", "inherit"],
|
|
22097
|
-
env: process23.env
|
|
22098
|
-
});
|
|
22099
|
-
child.on("error", () => {
|
|
22100
|
-
resolve13({ code: 127 });
|
|
22101
|
-
});
|
|
22102
|
-
child.on("close", (code) => {
|
|
22103
|
-
resolve13({ code: code ?? 1 });
|
|
22104
|
-
});
|
|
22105
|
-
});
|
|
22106
|
-
var defaultStartDetached = (cwd, bin, args) => {
|
|
22107
|
-
try {
|
|
22108
|
-
const child = spawn2(bin, [...args], {
|
|
22109
|
-
cwd,
|
|
22110
|
-
detached: true,
|
|
22111
|
-
stdio: "ignore",
|
|
22112
|
-
env: process23.env
|
|
22113
|
-
});
|
|
22114
|
-
child.unref();
|
|
22115
|
-
return true;
|
|
22116
|
-
} catch {
|
|
22117
|
-
return false;
|
|
22118
|
-
}
|
|
22119
|
-
};
|
|
22120
|
-
var openClaudeWithSeed = async (appPath, prompt, platform = process23.platform) => {
|
|
22121
|
-
if (platform === "darwin") {
|
|
22122
|
-
const shellCommand = `cd ${JSON.stringify(appPath)} && claude ${JSON.stringify(prompt)}`;
|
|
22123
|
-
const osa = makeExec("osascript");
|
|
22124
|
-
const result = await osa([
|
|
22125
|
-
"-e",
|
|
22126
|
-
`tell application "Terminal" to do script ${JSON.stringify(shellCommand)}`
|
|
22127
|
-
]);
|
|
22128
|
-
if (result.code === 0) {
|
|
22129
|
-
return true;
|
|
22130
|
-
}
|
|
22131
|
-
}
|
|
22132
|
-
try {
|
|
22133
|
-
const child = spawn2("claude", [prompt], {
|
|
22134
|
-
cwd: appPath,
|
|
22135
|
-
detached: true,
|
|
22136
|
-
stdio: "ignore",
|
|
22137
|
-
env: process23.env
|
|
22138
|
-
});
|
|
22139
|
-
child.unref();
|
|
22140
|
-
return true;
|
|
22141
|
-
} catch {
|
|
22142
|
-
return false;
|
|
22143
|
-
}
|
|
22144
|
-
};
|
|
22145
|
-
var defaultResolvePnpm = async () => {
|
|
22146
|
-
const pnpm = makeExec("pnpm");
|
|
22147
|
-
const version = await pnpm(["--version"]);
|
|
22148
|
-
if (version.code === 0) {
|
|
22149
|
-
return ["pnpm"];
|
|
22150
|
-
}
|
|
22151
|
-
const corepack = makeExec("corepack");
|
|
22152
|
-
const enabled = await corepack(["enable"]);
|
|
22153
|
-
if (enabled.code === 0) {
|
|
22154
|
-
const prepared = await corepack(["prepare", "pnpm@10.33.2", "--activate"]);
|
|
22155
|
-
if (prepared.code === 0) {
|
|
22156
|
-
const again = await pnpm(["--version"]);
|
|
22157
|
-
if (again.code === 0) {
|
|
22158
|
-
return ["pnpm"];
|
|
22159
|
-
}
|
|
22160
|
-
}
|
|
22161
|
-
}
|
|
22162
|
-
const npx = makeExec("npx");
|
|
22163
|
-
const npxCheck = await npx(["-y", "pnpm@10.33.2", "--version"]);
|
|
22164
|
-
if (npxCheck.code === 0) {
|
|
22165
|
-
return ["npx", "-y", "pnpm@10.33.2"];
|
|
22166
|
-
}
|
|
22167
|
-
return null;
|
|
22168
|
-
};
|
|
22169
|
-
var defaultDeps3 = () => ({
|
|
22170
|
-
createApp: runCreateApp,
|
|
22171
|
-
pathExists: defaultPathExists2,
|
|
22172
|
-
isEmptyDir: defaultIsEmptyDir,
|
|
22173
|
-
runCommand: defaultRunCommand,
|
|
22174
|
-
startDetached: defaultStartDetached,
|
|
22175
|
-
openClaude: (appPath, prompt) => openClaudeWithSeed(appPath, prompt, process23.platform),
|
|
22176
|
-
resolvePnpm: defaultResolvePnpm,
|
|
22177
|
-
homeDir: homedir4,
|
|
22178
|
-
env: process23.env,
|
|
22179
|
-
platform: process23.platform
|
|
22180
|
-
});
|
|
22181
|
-
var formatSessionOneLines = (result) => {
|
|
22182
|
-
if (result.appPath === null) {
|
|
22183
|
-
return [
|
|
22184
|
-
"",
|
|
22185
|
-
"Session #1: could not create your first app automatically.",
|
|
22186
|
-
" Run: npx vybekiit create app --web",
|
|
22187
|
-
' Then open that folder in Claude Code and say: "Set up my app."',
|
|
22188
|
-
""
|
|
22189
|
-
];
|
|
22190
|
-
}
|
|
22191
|
-
const lines = [
|
|
22192
|
-
"",
|
|
22193
|
-
result.created ? `\u2705 Your first web app is ready at ${result.appPath}` : `\u2705 Using your app at ${result.appPath}`
|
|
22194
|
-
];
|
|
22195
|
-
if (result.depsInstalled) {
|
|
22196
|
-
lines.push(" \u2022 Dependencies installed");
|
|
22197
|
-
} else {
|
|
22198
|
-
lines.push(" \u2022 Dependencies still need install \u2014 in that folder run: pnpm install");
|
|
22199
|
-
}
|
|
22200
|
-
if (result.packagesBuilt) {
|
|
22201
|
-
lines.push(" \u2022 Kit packages built for local preview");
|
|
22202
|
-
} else if (result.depsInstalled) {
|
|
22203
|
-
lines.push(" \u2022 Kit packages still need a build \u2014 in that folder run: pnpm build:packages");
|
|
22204
|
-
}
|
|
22205
|
-
if (result.devStarted) {
|
|
22206
|
-
lines.push(" \u2022 Preview starting at http://localhost:3000");
|
|
22207
|
-
} else if (result.depsInstalled && result.packagesBuilt) {
|
|
22208
|
-
lines.push(" \u2022 Preview not started \u2014 in that folder run: pnpm dev");
|
|
22209
|
-
}
|
|
22210
|
-
if (result.claudeOpened) {
|
|
22211
|
-
lines.push(' \u2022 Claude Code opening with: "Set up my app."');
|
|
22212
|
-
} else {
|
|
22213
|
-
lines.push(' \u2022 Open Claude Code in that folder and say: "Set up my app."');
|
|
22214
|
-
lines.push(` cd ${result.appPath} && claude "Set up my app."`);
|
|
22215
|
-
}
|
|
22216
|
-
lines.push(
|
|
22217
|
-
"",
|
|
22218
|
-
"Report mode is built in \u2014 if something looks wrong, press Option+Shift+R",
|
|
22219
|
-
"(Alt+Shift+R on Windows), click it, and tell Claude what is off.",
|
|
22220
|
-
""
|
|
22221
|
-
);
|
|
22222
|
-
return lines;
|
|
22223
|
-
};
|
|
22224
|
-
var runSessionOne = async (deps = defaultDeps3()) => {
|
|
22225
|
-
const appPath = resolveFirstAppPath(deps);
|
|
22226
|
-
const exists3 = await deps.pathExists(appPath);
|
|
22227
|
-
const empty = exists3 ? await deps.isEmptyDir(appPath) : true;
|
|
22228
|
-
let created = false;
|
|
22229
|
-
if (exists3 && !empty) {
|
|
22230
|
-
const looksLikeKit = await deps.pathExists(join52(appPath, "templates", "web"));
|
|
22231
|
-
if (!looksLikeKit) {
|
|
22232
|
-
const failed = {
|
|
22233
|
-
appPath: null,
|
|
22234
|
-
created: false,
|
|
22235
|
-
depsInstalled: false,
|
|
22236
|
-
packagesBuilt: false,
|
|
22237
|
-
devStarted: false,
|
|
22238
|
-
claudeOpened: false
|
|
22239
|
-
};
|
|
22240
|
-
return {
|
|
22241
|
-
...failed,
|
|
22242
|
-
lines: [
|
|
22243
|
-
"",
|
|
22244
|
-
`Session #1: ${appPath} already exists and is not a VybeKiit app.`,
|
|
22245
|
-
" Pick a free folder and run: npx vybekiit create app --web ~/my-app",
|
|
22246
|
-
" Or set VYBEKIIT_FIRST_APP_DIR and re-run install once.",
|
|
22247
|
-
""
|
|
22248
|
-
]
|
|
22249
|
-
};
|
|
22250
|
-
}
|
|
22251
|
-
} else {
|
|
22252
|
-
process23.stdout.write(`
|
|
22253
|
-
Creating your first web app at ${appPath}\u2026
|
|
22254
|
-
`);
|
|
22255
|
-
const code = await deps.createApp(["--web", appPath]);
|
|
22256
|
-
if (code !== 0) {
|
|
22257
|
-
const failed = {
|
|
22258
|
-
appPath: null,
|
|
22259
|
-
created: false,
|
|
22260
|
-
depsInstalled: false,
|
|
22261
|
-
packagesBuilt: false,
|
|
22262
|
-
devStarted: false,
|
|
22263
|
-
claudeOpened: false
|
|
22264
|
-
};
|
|
22265
|
-
return { ...failed, lines: formatSessionOneLines(failed) };
|
|
22266
|
-
}
|
|
22267
|
-
created = true;
|
|
22268
|
-
}
|
|
22269
|
-
const pnpm = await deps.resolvePnpm();
|
|
22270
|
-
if (pnpm === null) {
|
|
22271
|
-
const partial = {
|
|
22272
|
-
appPath,
|
|
22273
|
-
created,
|
|
22274
|
-
depsInstalled: false,
|
|
22275
|
-
packagesBuilt: false,
|
|
22276
|
-
devStarted: false,
|
|
22277
|
-
claudeOpened: false
|
|
22278
|
-
};
|
|
22279
|
-
const claudeOpened2 = await deps.openClaude(appPath, SESSION_ONE_SEED_PROMPT);
|
|
22280
|
-
return {
|
|
22281
|
-
...partial,
|
|
22282
|
-
claudeOpened: claudeOpened2,
|
|
22283
|
-
lines: formatSessionOneLines({ ...partial, claudeOpened: claudeOpened2 })
|
|
22284
|
-
};
|
|
22285
|
-
}
|
|
22286
|
-
const [pnpmBin, ...pnpmPrefix] = pnpm;
|
|
22287
|
-
process23.stdout.write("\nInstalling dependencies (this can take a few minutes)\u2026\n");
|
|
22288
|
-
const install = await deps.runCommand(appPath, pnpmBin, [...pnpmPrefix, "install"]);
|
|
22289
|
-
const depsInstalled = install.code === 0;
|
|
22290
|
-
let packagesBuilt = false;
|
|
22291
|
-
if (depsInstalled) {
|
|
22292
|
-
process23.stdout.write("\nBuilding kit packages for preview\u2026\n");
|
|
22293
|
-
const build = await deps.runCommand(appPath, pnpmBin, [...pnpmPrefix, "build:packages"]);
|
|
22294
|
-
packagesBuilt = build.code === 0;
|
|
22295
|
-
}
|
|
22296
|
-
let devStarted = false;
|
|
22297
|
-
if (depsInstalled && packagesBuilt) {
|
|
22298
|
-
devStarted = deps.startDetached(appPath, pnpmBin, [...pnpmPrefix, "dev"]);
|
|
22299
|
-
}
|
|
22300
|
-
const claudeOpened = await deps.openClaude(appPath, SESSION_ONE_SEED_PROMPT);
|
|
22301
|
-
const outcome = {
|
|
22302
|
-
appPath,
|
|
22303
|
-
created,
|
|
22304
|
-
depsInstalled,
|
|
22305
|
-
packagesBuilt,
|
|
22306
|
-
devStarted,
|
|
22307
|
-
claudeOpened
|
|
22308
|
-
};
|
|
22309
|
-
return { ...outcome, lines: formatSessionOneLines(outcome) };
|
|
22310
|
-
};
|
|
22311
|
-
|
|
22312
22607
|
// src/global/runGlobalInstall.ts
|
|
22313
22608
|
var formatGlobalInstallSummary = (summary) => {
|
|
22314
22609
|
const isUpdate = summary.previousVersion !== null && summary.previousVersion !== summary.version;
|
|
@@ -22379,7 +22674,7 @@ var runGlobalInstall = async (args, gate = checkEntitlement) => {
|
|
|
22379
22674
|
const entitlement = await gate();
|
|
22380
22675
|
if (!entitlement.entitled) {
|
|
22381
22676
|
for (const line of formatEntitlementBlock(entitlement)) {
|
|
22382
|
-
|
|
22677
|
+
process25.stderr.write(`${line}
|
|
22383
22678
|
`);
|
|
22384
22679
|
}
|
|
22385
22680
|
return 1;
|
|
@@ -22387,7 +22682,7 @@ var runGlobalInstall = async (args, gate = checkEntitlement) => {
|
|
|
22387
22682
|
const skipPrompt = args.includes("--yes") || args.includes("-y");
|
|
22388
22683
|
if (!skipPrompt) {
|
|
22389
22684
|
if (!isInteractive()) {
|
|
22390
|
-
|
|
22685
|
+
process25.stdout.write(
|
|
22391
22686
|
"Skipping global setup (non-interactive). Run `vybekiit global-install --yes` or `vybekiit update` to provision Claude Code globally.\n"
|
|
22392
22687
|
);
|
|
22393
22688
|
return 0;
|
|
@@ -22397,7 +22692,7 @@ var runGlobalInstall = async (args, gate = checkEntitlement) => {
|
|
|
22397
22692
|
initialValue: true
|
|
22398
22693
|
});
|
|
22399
22694
|
if (isCancel3(proceed) || proceed !== true) {
|
|
22400
|
-
|
|
22695
|
+
process25.stdout.write(
|
|
22401
22696
|
"Skipped global setup. You can run `vybekiit update` or `vybekiit global-install` anytime.\n"
|
|
22402
22697
|
);
|
|
22403
22698
|
return 0;
|
|
@@ -22410,7 +22705,7 @@ var runGlobalInstall = async (args, gate = checkEntitlement) => {
|
|
|
22410
22705
|
const skills = await installGlobalSkills(paths);
|
|
22411
22706
|
const mcp = await installGlobalMcp({
|
|
22412
22707
|
exec: makeExec("claude"),
|
|
22413
|
-
env:
|
|
22708
|
+
env: process25.env,
|
|
22414
22709
|
forceRefresh: isRerun
|
|
22415
22710
|
});
|
|
22416
22711
|
const awareness = await installAwareness(paths);
|
|
@@ -22432,11 +22727,11 @@ var runGlobalInstall = async (args, gate = checkEntitlement) => {
|
|
|
22432
22727
|
previousVersion: previous?.version ?? null
|
|
22433
22728
|
};
|
|
22434
22729
|
for (const line of formatGlobalInstallSummary(summary)) {
|
|
22435
|
-
|
|
22730
|
+
process25.stdout.write(`${line}
|
|
22436
22731
|
`);
|
|
22437
22732
|
}
|
|
22438
22733
|
if (!isGloballyInstalled(postStatus)) {
|
|
22439
|
-
|
|
22734
|
+
process25.stderr.write(
|
|
22440
22735
|
"VybeKiit global install incomplete: expected managed skills + /vybekiit + CLAUDE.md block.\n"
|
|
22441
22736
|
);
|
|
22442
22737
|
return 1;
|
|
@@ -22446,7 +22741,7 @@ var runGlobalInstall = async (args, gate = checkEntitlement) => {
|
|
|
22446
22741
|
if (isFirstInstall && !shouldSkipSessionOne(args)) {
|
|
22447
22742
|
const sessionOne = await runSessionOne();
|
|
22448
22743
|
for (const line of sessionOne.lines) {
|
|
22449
|
-
|
|
22744
|
+
process25.stdout.write(`${line}
|
|
22450
22745
|
`);
|
|
22451
22746
|
}
|
|
22452
22747
|
if (sessionOne.appPath !== null) {
|
|
@@ -22460,10 +22755,10 @@ var runGlobalInstall = async (args, gate = checkEntitlement) => {
|
|
|
22460
22755
|
};
|
|
22461
22756
|
|
|
22462
22757
|
// src/ui/welcomeBanner.ts
|
|
22463
|
-
import
|
|
22758
|
+
import process27 from "process";
|
|
22464
22759
|
|
|
22465
22760
|
// src/ui/ansiShimmer.ts
|
|
22466
|
-
import
|
|
22761
|
+
import process26 from "process";
|
|
22467
22762
|
var RESET = "\x1B[0m";
|
|
22468
22763
|
var GRADIENT_START = [34, 211, 238];
|
|
22469
22764
|
var GRADIENT_END = [167, 139, 250];
|
|
@@ -22475,7 +22770,7 @@ var colorAt = (t) => rgb(
|
|
|
22475
22770
|
lerp(GRADIENT_START[1], GRADIENT_END[1], t),
|
|
22476
22771
|
lerp(GRADIENT_START[2], GRADIENT_END[2], t)
|
|
22477
22772
|
);
|
|
22478
|
-
var supportsColor = (env =
|
|
22773
|
+
var supportsColor = (env = process26.env, isTTY = Boolean(process26.stdout.isTTY)) => {
|
|
22479
22774
|
if (env.NO_COLOR !== void 0 && env.NO_COLOR !== "") {
|
|
22480
22775
|
return false;
|
|
22481
22776
|
}
|
|
@@ -22506,8 +22801,8 @@ var applyShimmerSweep = (lines, frame, options) => {
|
|
|
22506
22801
|
});
|
|
22507
22802
|
};
|
|
22508
22803
|
var DIM = "\x1B[2m";
|
|
22509
|
-
var sleep = (ms) => new Promise((
|
|
22510
|
-
setTimeout(
|
|
22804
|
+
var sleep = (ms) => new Promise((resolve14) => {
|
|
22805
|
+
setTimeout(resolve14, ms);
|
|
22511
22806
|
});
|
|
22512
22807
|
|
|
22513
22808
|
// src/ui/welcomeBanner.ts
|
|
@@ -22537,13 +22832,13 @@ var writeBlock = (write, lines) => {
|
|
|
22537
22832
|
}
|
|
22538
22833
|
};
|
|
22539
22834
|
var playWelcomeBanner = async (options = {}) => {
|
|
22540
|
-
const write = options.write === void 0 ? (text2) =>
|
|
22835
|
+
const write = options.write === void 0 ? (text2) => process27.stdout.write(text2) : options.write;
|
|
22541
22836
|
const sleepFn = options.sleep === void 0 ? sleep : options.sleep;
|
|
22542
22837
|
const frames = options.frames === void 0 ? DEFAULT_FRAMES : options.frames;
|
|
22543
22838
|
const frameDelayMs = options.frameDelayMs === void 0 ? DEFAULT_FRAME_DELAY_MS : options.frameDelayMs;
|
|
22544
22839
|
const art = [...WELCOME_ART];
|
|
22545
22840
|
const useColor = !options.forcePlain && supportsColor();
|
|
22546
|
-
const animate = useColor && Boolean(
|
|
22841
|
+
const animate = useColor && Boolean(process27.stdout.isTTY) && frames > 0;
|
|
22547
22842
|
if (!animate) {
|
|
22548
22843
|
writeBlock(write, art);
|
|
22549
22844
|
writeln(write, "");
|
|
@@ -22619,15 +22914,15 @@ var runSetup = async () => {
|
|
|
22619
22914
|
await playWelcomeBanner();
|
|
22620
22915
|
const code = await runDoctor();
|
|
22621
22916
|
await runGlobalInstall(["--yes"]);
|
|
22622
|
-
const
|
|
22917
|
+
const access18 = checkAccess();
|
|
22623
22918
|
const installState = await readInstallState(resolveGlobalPaths().configDir);
|
|
22624
|
-
|
|
22919
|
+
process28.stdout.write("\n");
|
|
22625
22920
|
for (const line of formatSetupNextStep({
|
|
22626
22921
|
doctorExitCode: code,
|
|
22627
|
-
gateReason:
|
|
22922
|
+
gateReason: access18.reason,
|
|
22628
22923
|
...installState?.firstAppPath === void 0 ? {} : { firstAppPath: installState.firstAppPath }
|
|
22629
22924
|
})) {
|
|
22630
|
-
|
|
22925
|
+
process28.stdout.write(`${line}
|
|
22631
22926
|
`);
|
|
22632
22927
|
}
|
|
22633
22928
|
return code;
|
|
@@ -22635,20 +22930,20 @@ var runSetup = async () => {
|
|
|
22635
22930
|
|
|
22636
22931
|
// src/commands/syncAgentLayer.ts
|
|
22637
22932
|
import { execFile as execFile7 } from "child_process";
|
|
22638
|
-
import { access as
|
|
22639
|
-
import { join as
|
|
22640
|
-
import
|
|
22933
|
+
import { access as access17, cp as cp6, readFile as readFile24, writeFile as writeFile17 } from "fs/promises";
|
|
22934
|
+
import { join as join54 } from "path";
|
|
22935
|
+
import process29 from "process";
|
|
22641
22936
|
import { promisify as promisify6 } from "util";
|
|
22642
22937
|
var execFileAsync6 = promisify6(execFile7);
|
|
22643
|
-
var
|
|
22938
|
+
var defaultDeps5 = {
|
|
22644
22939
|
resolve: resolveTemplatesSource,
|
|
22645
22940
|
copy: cp6,
|
|
22646
22941
|
runSkillsUpdate: async (cwd) => {
|
|
22647
|
-
await execFileAsync6("npx", ["skills", "update", "-y"], { cwd, env:
|
|
22942
|
+
await execFileAsync6("npx", ["skills", "update", "-y"], { cwd, env: process29.env });
|
|
22648
22943
|
},
|
|
22649
22944
|
pathExists: async (path) => {
|
|
22650
22945
|
try {
|
|
22651
|
-
await
|
|
22946
|
+
await access17(path);
|
|
22652
22947
|
return true;
|
|
22653
22948
|
} catch {
|
|
22654
22949
|
return false;
|
|
@@ -22667,7 +22962,7 @@ var resolveSyncTemplate = async (explicit, cwd) => {
|
|
|
22667
22962
|
var listMirrorAgentPaths = async (mirrorRoot, pathExists9) => {
|
|
22668
22963
|
const entries = await Promise.all(
|
|
22669
22964
|
AGENT_LAYER_PATHS.map(async (path) => {
|
|
22670
|
-
if (await pathExists9(
|
|
22965
|
+
if (await pathExists9(join54(mirrorRoot, path))) {
|
|
22671
22966
|
return path;
|
|
22672
22967
|
}
|
|
22673
22968
|
return null;
|
|
@@ -22677,28 +22972,28 @@ var listMirrorAgentPaths = async (mirrorRoot, pathExists9) => {
|
|
|
22677
22972
|
};
|
|
22678
22973
|
var copyAgentLayerPath = async (options) => {
|
|
22679
22974
|
const { mirrorRoot, cwd, path, copy, pathExists: pathExists9 } = options;
|
|
22680
|
-
const src =
|
|
22681
|
-
const dest =
|
|
22975
|
+
const src = join54(mirrorRoot, path);
|
|
22976
|
+
const dest = join54(cwd, path);
|
|
22682
22977
|
if (path !== ".vybekiit") {
|
|
22683
22978
|
await copy(src, dest, { recursive: true, force: true });
|
|
22684
22979
|
return;
|
|
22685
22980
|
}
|
|
22686
|
-
const { readdir:
|
|
22981
|
+
const { readdir: readdir13, stat: stat4, mkdir: mkdir15 } = await import("fs/promises");
|
|
22687
22982
|
const walk = async (rel) => {
|
|
22688
22983
|
const relNorm = rel.split("\\").join("/");
|
|
22689
22984
|
if (isAgentLayerExtensionPath(relNorm)) {
|
|
22690
22985
|
return;
|
|
22691
22986
|
}
|
|
22692
|
-
const srcPath =
|
|
22693
|
-
const destPath =
|
|
22987
|
+
const srcPath = join54(mirrorRoot, relNorm);
|
|
22988
|
+
const destPath = join54(cwd, relNorm);
|
|
22694
22989
|
if (!await pathExists9(srcPath)) {
|
|
22695
22990
|
return;
|
|
22696
22991
|
}
|
|
22697
22992
|
const info = await stat4(srcPath);
|
|
22698
22993
|
if (info.isDirectory()) {
|
|
22699
22994
|
await mkdir15(destPath, { recursive: true });
|
|
22700
|
-
const entries = await
|
|
22701
|
-
await Promise.all(entries.map((entry) => walk(
|
|
22995
|
+
const entries = await readdir13(srcPath);
|
|
22996
|
+
await Promise.all(entries.map((entry) => walk(join54(relNorm, entry))));
|
|
22702
22997
|
return;
|
|
22703
22998
|
}
|
|
22704
22999
|
await copy(srcPath, destPath, { force: true });
|
|
@@ -22722,7 +23017,7 @@ var readGoalIndexBeforeSync = async (pathsToSync, cwd, deps) => {
|
|
|
22722
23017
|
if (!pathsToSync.includes(".vybekiit")) {
|
|
22723
23018
|
return;
|
|
22724
23019
|
}
|
|
22725
|
-
const goalIndexPath =
|
|
23020
|
+
const goalIndexPath = join54(cwd, ".vybekiit/agent/goal-index.md");
|
|
22726
23021
|
if (!await deps.pathExists(goalIndexPath)) {
|
|
22727
23022
|
return;
|
|
22728
23023
|
}
|
|
@@ -22732,7 +23027,7 @@ var mergeGoalIndexAfterSync = async (cwd, goalIndexBefore) => {
|
|
|
22732
23027
|
if (goalIndexBefore === void 0) {
|
|
22733
23028
|
return;
|
|
22734
23029
|
}
|
|
22735
|
-
const goalIndexPath =
|
|
23030
|
+
const goalIndexPath = join54(cwd, ".vybekiit/agent/goal-index.md");
|
|
22736
23031
|
const synced = await readFile24(goalIndexPath, "utf8");
|
|
22737
23032
|
const merged = mergeGoalIndexOnSync(synced, goalIndexBefore);
|
|
22738
23033
|
if (merged !== synced) {
|
|
@@ -22747,14 +23042,14 @@ var refreshGeneratedInstructionSections = async (cwd, template, deps) => {
|
|
|
22747
23042
|
const rendered = applyAgentLayerSections(fileContents, { template });
|
|
22748
23043
|
const writes = Object.entries(rendered).map(async ([file, content]) => {
|
|
22749
23044
|
if (fileContents[file] !== void 0 && content !== fileContents[file]) {
|
|
22750
|
-
await writeFile17(
|
|
23045
|
+
await writeFile17(join54(cwd, file), content, "utf8");
|
|
22751
23046
|
}
|
|
22752
23047
|
});
|
|
22753
23048
|
await Promise.all(writes);
|
|
22754
23049
|
return true;
|
|
22755
23050
|
};
|
|
22756
23051
|
var refreshPlatformInstructionFiles = async (cwd, deps) => {
|
|
22757
|
-
if (!await deps.pathExists(
|
|
23052
|
+
if (!await deps.pathExists(join54(cwd, "skills-lock.json"))) {
|
|
22758
23053
|
return "missing-lock";
|
|
22759
23054
|
}
|
|
22760
23055
|
try {
|
|
@@ -22764,7 +23059,7 @@ var refreshPlatformInstructionFiles = async (cwd, deps) => {
|
|
|
22764
23059
|
return "failed";
|
|
22765
23060
|
}
|
|
22766
23061
|
};
|
|
22767
|
-
var runSyncAgentLayer = async (args, cwd =
|
|
23062
|
+
var runSyncAgentLayer = async (args, cwd = process29.cwd(), deps = defaultDeps5) => {
|
|
22768
23063
|
const [explicit] = args;
|
|
22769
23064
|
const template = await resolveSyncTemplate(explicit, cwd);
|
|
22770
23065
|
if (template === null) {
|
|
@@ -22783,7 +23078,7 @@ var runSyncAgentLayer = async (args, cwd = process28.cwd(), deps = defaultDeps4)
|
|
|
22783
23078
|
});
|
|
22784
23079
|
const { cleanup: resolvedCleanup, source } = resolved;
|
|
22785
23080
|
cleanup = resolvedCleanup;
|
|
22786
|
-
const mirrorRoot =
|
|
23081
|
+
const mirrorRoot = join54(source, template);
|
|
22787
23082
|
const mirrorPaths = await listMirrorAgentPaths(mirrorRoot, deps.pathExists);
|
|
22788
23083
|
const plan = planAgentLayerSync(mirrorPaths);
|
|
22789
23084
|
const lines = [formatAgentLayerSyncSummary(plan)];
|
|
@@ -22819,7 +23114,7 @@ var runSyncAgentLayer = async (args, cwd = process28.cwd(), deps = defaultDeps4)
|
|
|
22819
23114
|
};
|
|
22820
23115
|
|
|
22821
23116
|
// src/commands/updateKit.ts
|
|
22822
|
-
import
|
|
23117
|
+
import process30 from "process";
|
|
22823
23118
|
import { Effect as Effect31 } from "effect";
|
|
22824
23119
|
var runUpdateKit = async (args = []) => {
|
|
22825
23120
|
const apply = args.includes("--apply");
|
|
@@ -22847,7 +23142,7 @@ var runUpdateKit = async (args = []) => {
|
|
|
22847
23142
|
var runUpdateKitCommand = async (args) => {
|
|
22848
23143
|
const result = await runUpdateKit(args);
|
|
22849
23144
|
for (const line of result.lines) {
|
|
22850
|
-
|
|
23145
|
+
process30.stdout.write(`${line}
|
|
22851
23146
|
`);
|
|
22852
23147
|
}
|
|
22853
23148
|
return result.exitCode;
|
|
@@ -22855,7 +23150,7 @@ var runUpdateKitCommand = async (args) => {
|
|
|
22855
23150
|
|
|
22856
23151
|
// src/doctor/ensureTool.ts
|
|
22857
23152
|
import { spawnSync as spawnSync9 } from "child_process";
|
|
22858
|
-
import
|
|
23153
|
+
import process31 from "process";
|
|
22859
23154
|
var toPlatform2 = (platform) => platform === "darwin" || platform === "win32" || platform === "linux" ? platform : null;
|
|
22860
23155
|
var succeeds3 = (command, args) => spawnSync9(command, [...args], { stdio: "ignore" }).status === 0;
|
|
22861
23156
|
var errorCode2 = (error) => error !== void 0 && "code" in error && typeof error.code === "string" ? error.code : void 0;
|
|
@@ -22878,9 +23173,9 @@ var ensureTool = (name, log = console) => {
|
|
|
22878
23173
|
if (tool === void 0) {
|
|
22879
23174
|
return { tool: name, known: false, installed: false, installedNow: false, authed: null };
|
|
22880
23175
|
}
|
|
22881
|
-
const platform = toPlatform2(
|
|
23176
|
+
const platform = toPlatform2(process31.platform);
|
|
22882
23177
|
if (!platform) {
|
|
22883
|
-
log.error(`[doctor] This operating system (${
|
|
23178
|
+
log.error(`[doctor] This operating system (${process31.platform}) isn't supported yet.`);
|
|
22884
23179
|
return { tool: name, known: true, installed: false, installedNow: false, authed: null };
|
|
22885
23180
|
}
|
|
22886
23181
|
const present = succeeds3(tool.name, tool.versionArgs);
|
|
@@ -22925,7 +23220,7 @@ var formatEnsureResult = (result) => {
|
|
|
22925
23220
|
|
|
22926
23221
|
// src/prompts/envWizard.ts
|
|
22927
23222
|
import { readFile as readFile25 } from "fs/promises";
|
|
22928
|
-
import { join as
|
|
23223
|
+
import { join as join55 } from "path";
|
|
22929
23224
|
import { cancel as cancel2, isCancel as isCancel4, text } from "@clack/prompts";
|
|
22930
23225
|
var ENV_KEY_PATTERN = /^[A-Z][A-Z0-9_]*$/;
|
|
22931
23226
|
var parseExampleEnvKeys = (raw) => raw.split("\n").reduce((keys, line) => {
|
|
@@ -22977,7 +23272,7 @@ ${nextLine}
|
|
|
22977
23272
|
`;
|
|
22978
23273
|
};
|
|
22979
23274
|
var runEnvWizard = async (cwd = process.cwd()) => {
|
|
22980
|
-
const examplePath =
|
|
23275
|
+
const examplePath = join55(cwd, ".env.example");
|
|
22981
23276
|
let raw;
|
|
22982
23277
|
try {
|
|
22983
23278
|
raw = await readFile25(examplePath, "utf8");
|
|
@@ -22986,7 +23281,7 @@ var runEnvWizard = async (cwd = process.cwd()) => {
|
|
|
22986
23281
|
return 1;
|
|
22987
23282
|
}
|
|
22988
23283
|
const keys = parseExampleEnvKeys(raw);
|
|
22989
|
-
const envPath =
|
|
23284
|
+
const envPath = join55(cwd, ".env");
|
|
22990
23285
|
let envContent = "";
|
|
22991
23286
|
try {
|
|
22992
23287
|
envContent = await readFile25(envPath, "utf8");
|
|
@@ -23061,7 +23356,7 @@ var HERE7 = dirname18(fileURLToPath9(import.meta.url));
|
|
|
23061
23356
|
var GATE_EXEMPT = /* @__PURE__ */ new Set(["doctor", "setup", "global-install", "update", "feedback"]);
|
|
23062
23357
|
var readVersion = async () => {
|
|
23063
23358
|
try {
|
|
23064
|
-
const raw = await readFile26(
|
|
23359
|
+
const raw = await readFile26(join56(HERE7, "..", "package.json"), "utf8");
|
|
23065
23360
|
const parsed = JSON.parse(raw);
|
|
23066
23361
|
if (parsed.version !== void 0 && parsed.version !== "") {
|
|
23067
23362
|
return parsed.version;
|
|
@@ -23086,7 +23381,7 @@ var commandArgs = (context) => {
|
|
|
23086
23381
|
};
|
|
23087
23382
|
var writeLines2 = (lines) => {
|
|
23088
23383
|
for (const line of lines) {
|
|
23089
|
-
|
|
23384
|
+
process32.stdout.write(`${line}
|
|
23090
23385
|
`);
|
|
23091
23386
|
}
|
|
23092
23387
|
};
|
|
@@ -23102,20 +23397,20 @@ var runDoctorEnsure = (toolName, json) => {
|
|
|
23102
23397
|
if (toolName === void 0 || toolName === "" || toolName.startsWith("--")) {
|
|
23103
23398
|
const message = "Usage: vybekiit doctor --ensure <tool> [--json]";
|
|
23104
23399
|
if (json) {
|
|
23105
|
-
|
|
23400
|
+
process32.stdout.write(`${JSON.stringify({ ok: false, error: message })}
|
|
23106
23401
|
`);
|
|
23107
23402
|
} else {
|
|
23108
|
-
|
|
23403
|
+
process32.stderr.write(`${message}
|
|
23109
23404
|
`);
|
|
23110
23405
|
}
|
|
23111
23406
|
return 1;
|
|
23112
23407
|
}
|
|
23113
23408
|
const result = ensureTool(toolName);
|
|
23114
23409
|
if (json) {
|
|
23115
|
-
|
|
23410
|
+
process32.stdout.write(`${JSON.stringify({ ok: result.installed, ...result })}
|
|
23116
23411
|
`);
|
|
23117
23412
|
} else {
|
|
23118
|
-
|
|
23413
|
+
process32.stdout.write(`${formatEnsureResult(result)}
|
|
23119
23414
|
`);
|
|
23120
23415
|
}
|
|
23121
23416
|
return result.installed ? 0 : 1;
|
|
@@ -23131,47 +23426,53 @@ var handleDoctorCommand = async (context) => {
|
|
|
23131
23426
|
var handleBackendCommand = async (context) => {
|
|
23132
23427
|
if (context.subcommand === "add-route") {
|
|
23133
23428
|
const result = await runBackendAddRoute([...context.rest]);
|
|
23134
|
-
|
|
23429
|
+
process32.stdout.write(`${result.message}
|
|
23135
23430
|
`);
|
|
23136
23431
|
return result.exitCode;
|
|
23137
23432
|
}
|
|
23138
23433
|
if (context.subcommand === "add-crud") {
|
|
23139
23434
|
const result = await runBackendAddCrud([...context.rest]);
|
|
23140
|
-
|
|
23435
|
+
process32.stdout.write(`${result.message}
|
|
23141
23436
|
`);
|
|
23142
23437
|
return result.exitCode;
|
|
23143
23438
|
}
|
|
23144
23439
|
if (context.subcommand === "add-upload") {
|
|
23145
23440
|
const result = await runBackendAddUpload();
|
|
23146
|
-
|
|
23441
|
+
process32.stdout.write(`${result.message}
|
|
23147
23442
|
`);
|
|
23148
23443
|
return result.exitCode;
|
|
23149
23444
|
}
|
|
23150
23445
|
if (context.subcommand === "gen-contract") {
|
|
23151
23446
|
const result = await runBackendGenContract();
|
|
23152
|
-
|
|
23447
|
+
process32.stdout.write(`${result.message}
|
|
23153
23448
|
`);
|
|
23154
23449
|
return result.exitCode;
|
|
23155
23450
|
}
|
|
23156
|
-
|
|
23451
|
+
process32.stderr.write(
|
|
23157
23452
|
"Unknown backend command. Try: backend add-route | add-crud | add-upload | gen-contract\n"
|
|
23158
23453
|
);
|
|
23159
23454
|
return 1;
|
|
23160
23455
|
};
|
|
23161
23456
|
var handleEnvCommand = async (context) => {
|
|
23162
23457
|
if (context.subcommand !== "wizard") {
|
|
23163
|
-
|
|
23458
|
+
process32.stderr.write("Unknown env command. Try: vybekiit env wizard\n");
|
|
23164
23459
|
return 1;
|
|
23165
23460
|
}
|
|
23166
23461
|
if (!isInteractive()) {
|
|
23167
|
-
|
|
23462
|
+
process32.stderr.write("env wizard requires an interactive terminal.\n");
|
|
23168
23463
|
return 1;
|
|
23169
23464
|
}
|
|
23170
23465
|
return await runEnvWizard();
|
|
23171
23466
|
};
|
|
23172
23467
|
var handleCreateCommand = async (context) => {
|
|
23468
|
+
const args = commandArgs(context);
|
|
23469
|
+
if (isUiLibraryCreateArgs(args)) {
|
|
23470
|
+
return await runCreateUiLibraryCommand(args);
|
|
23471
|
+
}
|
|
23173
23472
|
if (context.subcommand !== "app") {
|
|
23174
|
-
|
|
23473
|
+
process32.stderr.write(
|
|
23474
|
+
"Usage: vybekiit create app --web|--mobile|--extension [directory]\n or: vybekiit create --ui-library [directory]\n"
|
|
23475
|
+
);
|
|
23175
23476
|
return 1;
|
|
23176
23477
|
}
|
|
23177
23478
|
return await runCreateApp([...context.rest]);
|
|
@@ -23179,7 +23480,7 @@ var handleCreateCommand = async (context) => {
|
|
|
23179
23480
|
var wantsFullHelp = (argv) => argv.includes("--all") || argv.includes("-a");
|
|
23180
23481
|
var runMainMenuChoice = async (choice) => {
|
|
23181
23482
|
if (choice === "help-all") {
|
|
23182
|
-
|
|
23483
|
+
process32.stdout.write(`${CLI_HELP_ALL}
|
|
23183
23484
|
`);
|
|
23184
23485
|
return 0;
|
|
23185
23486
|
}
|
|
@@ -23206,23 +23507,23 @@ var handleAddCommand = async (context) => {
|
|
|
23206
23507
|
}
|
|
23207
23508
|
if (context.subcommand === "page-recipe") {
|
|
23208
23509
|
const result = await runAddPageRecipe([...context.rest]);
|
|
23209
|
-
|
|
23510
|
+
process32.stdout.write(`${result.json}
|
|
23210
23511
|
`);
|
|
23211
23512
|
return result.exitCode;
|
|
23212
23513
|
}
|
|
23213
23514
|
if (context.subcommand === "report-mode") {
|
|
23214
23515
|
const result = await runAddReportMode([...context.rest]);
|
|
23215
|
-
|
|
23516
|
+
process32.stdout.write(`${result.json}
|
|
23216
23517
|
`);
|
|
23217
23518
|
return result.exitCode;
|
|
23218
23519
|
}
|
|
23219
23520
|
if (context.subcommand === "preset") {
|
|
23220
23521
|
const result = await runApplyPreset([...context.rest]);
|
|
23221
|
-
|
|
23522
|
+
process32.stdout.write(`${result.json}
|
|
23222
23523
|
`);
|
|
23223
23524
|
return result.exitCode;
|
|
23224
23525
|
}
|
|
23225
|
-
|
|
23526
|
+
process32.stderr.write(
|
|
23226
23527
|
"Unknown add command. Try: vybekiit add page-recipe <id> | add report-mode | add preset <id> | add bridge\n"
|
|
23227
23528
|
);
|
|
23228
23529
|
return 1;
|
|
@@ -23251,96 +23552,96 @@ var COMMAND_HANDLERS = {
|
|
|
23251
23552
|
"render-agent-layer": async () => (await runRenderAgentLayer()).exitCode,
|
|
23252
23553
|
"check-goals": async (context) => {
|
|
23253
23554
|
const result = await runCheckGoals([...context.rest]);
|
|
23254
|
-
|
|
23555
|
+
process32.stdout.write(`${result.json}
|
|
23255
23556
|
`);
|
|
23256
23557
|
return result.exitCode;
|
|
23257
23558
|
},
|
|
23258
23559
|
"check-agent-layer": async (context) => {
|
|
23259
23560
|
const result = await runCheckAgentLayer([...context.rest]);
|
|
23260
|
-
|
|
23561
|
+
process32.stdout.write(`${result.json}
|
|
23261
23562
|
`);
|
|
23262
23563
|
return result.exitCode;
|
|
23263
23564
|
},
|
|
23264
23565
|
"plan-readiness": async (context) => {
|
|
23265
23566
|
const result = await runPlanReadiness([...context.rest]);
|
|
23266
|
-
|
|
23567
|
+
process32.stdout.write(`${result.json}
|
|
23267
23568
|
`);
|
|
23268
23569
|
return result.exitCode;
|
|
23269
23570
|
},
|
|
23270
23571
|
"plan-setup": async (context) => {
|
|
23271
23572
|
const result = await runPlanSetup([...context.rest]);
|
|
23272
|
-
|
|
23573
|
+
process32.stdout.write(`${result.output}
|
|
23273
23574
|
`);
|
|
23274
23575
|
return result.exitCode;
|
|
23275
23576
|
},
|
|
23276
23577
|
"plan-data-model": async (context) => {
|
|
23277
23578
|
const result = await runPlanDataModel([...context.rest]);
|
|
23278
|
-
|
|
23579
|
+
process32.stdout.write(`${result.json}
|
|
23279
23580
|
`);
|
|
23280
23581
|
return result.exitCode;
|
|
23281
23582
|
},
|
|
23282
23583
|
"apply-preset": async (context) => {
|
|
23283
23584
|
const result = await runApplyPreset(commandArgs(context));
|
|
23284
|
-
|
|
23585
|
+
process32.stdout.write(`${result.json}
|
|
23285
23586
|
`);
|
|
23286
23587
|
return result.exitCode;
|
|
23287
23588
|
},
|
|
23288
23589
|
"list-presets": () => {
|
|
23289
23590
|
const result = runListPresets();
|
|
23290
|
-
|
|
23591
|
+
process32.stdout.write(`${result.json}
|
|
23291
23592
|
`);
|
|
23292
23593
|
return result.exitCode;
|
|
23293
23594
|
},
|
|
23294
23595
|
"list-pieces": async (context) => {
|
|
23295
23596
|
const result = await runListPieces(commandArgs(context));
|
|
23296
|
-
|
|
23597
|
+
process32.stdout.write(`${result.json}
|
|
23297
23598
|
`);
|
|
23298
23599
|
return result.exitCode;
|
|
23299
23600
|
},
|
|
23300
23601
|
"list-page-recipes": async (context) => {
|
|
23301
23602
|
const result = await runListPageRecipes(commandArgs(context));
|
|
23302
|
-
|
|
23603
|
+
process32.stdout.write(`${result.json}
|
|
23303
23604
|
`);
|
|
23304
23605
|
return result.exitCode;
|
|
23305
23606
|
},
|
|
23306
23607
|
"verify-presets": async (context) => {
|
|
23307
23608
|
const result = await runVerifyPresets(commandArgs(context));
|
|
23308
|
-
|
|
23609
|
+
process32.stdout.write(`${result.json}
|
|
23309
23610
|
`);
|
|
23310
23611
|
return result.exitCode;
|
|
23311
23612
|
},
|
|
23312
23613
|
"lint-extension-skill": async (context) => {
|
|
23313
23614
|
const result = await runLintExtensionSkill([...context.rest]);
|
|
23314
|
-
|
|
23615
|
+
process32.stdout.write(`${result.json}
|
|
23315
23616
|
`);
|
|
23316
23617
|
return result.exitCode;
|
|
23317
23618
|
},
|
|
23318
23619
|
"doc-fallback": (context) => {
|
|
23319
23620
|
const result = runDocFallback([...context.rest]);
|
|
23320
|
-
|
|
23621
|
+
process32.stdout.write(`${result.json}
|
|
23321
23622
|
`);
|
|
23322
23623
|
return result.exitCode;
|
|
23323
23624
|
},
|
|
23324
23625
|
"live-work": async (context) => {
|
|
23325
23626
|
if (context.subcommand === "data") {
|
|
23326
23627
|
const result = await runLiveWorkData([...context.rest]);
|
|
23327
|
-
|
|
23628
|
+
process32.stdout.write(`${result.json}
|
|
23328
23629
|
`);
|
|
23329
23630
|
return result.exitCode;
|
|
23330
23631
|
}
|
|
23331
23632
|
if (context.subcommand === "host") {
|
|
23332
23633
|
const result = await runLiveWorkHost([...context.rest]);
|
|
23333
|
-
|
|
23634
|
+
process32.stdout.write(`${result.json}
|
|
23334
23635
|
`);
|
|
23335
23636
|
return result.exitCode;
|
|
23336
23637
|
}
|
|
23337
23638
|
if (context.subcommand === "payments") {
|
|
23338
23639
|
const result = await runLiveWorkPayments([...context.rest]);
|
|
23339
|
-
|
|
23640
|
+
process32.stdout.write(`${result.json}
|
|
23340
23641
|
`);
|
|
23341
23642
|
return result.exitCode;
|
|
23342
23643
|
}
|
|
23343
|
-
|
|
23644
|
+
process32.stderr.write(
|
|
23344
23645
|
"Usage: vybekiit live-work data|host|payments [--mode=demo|dogfood|buyer] [--vendor=\u2026] [--cwd=dir] [--no-pin] [--fresh]\n"
|
|
23345
23646
|
);
|
|
23346
23647
|
return 1;
|
|
@@ -23348,7 +23649,7 @@ var COMMAND_HANDLERS = {
|
|
|
23348
23649
|
dedup: async (context) => {
|
|
23349
23650
|
const result = await runDedup(commandArgs(context));
|
|
23350
23651
|
if (result.output !== "") {
|
|
23351
|
-
|
|
23652
|
+
process32.stdout.write(result.output);
|
|
23352
23653
|
}
|
|
23353
23654
|
return result.exitCode;
|
|
23354
23655
|
},
|
|
@@ -23356,11 +23657,11 @@ var COMMAND_HANDLERS = {
|
|
|
23356
23657
|
env: handleEnvCommand,
|
|
23357
23658
|
scaffold: async (context) => {
|
|
23358
23659
|
if (context.subcommand !== "backend") {
|
|
23359
|
-
|
|
23660
|
+
process32.stderr.write("Unknown scaffold command. Try: vybekiit scaffold backend\n");
|
|
23360
23661
|
return 1;
|
|
23361
23662
|
}
|
|
23362
|
-
const result = await runScaffoldBackend([...context.rest],
|
|
23363
|
-
|
|
23663
|
+
const result = await runScaffoldBackend([...context.rest], process32.cwd());
|
|
23664
|
+
process32.stdout.write(`${result.message}
|
|
23364
23665
|
`);
|
|
23365
23666
|
return result.exitCode;
|
|
23366
23667
|
},
|
|
@@ -23378,17 +23679,17 @@ var runCli = async (argv) => {
|
|
|
23378
23679
|
}
|
|
23379
23680
|
return await runMainMenuChoice(choice);
|
|
23380
23681
|
}
|
|
23381
|
-
|
|
23682
|
+
process32.stdout.write(`${CLI_HELP}
|
|
23382
23683
|
`);
|
|
23383
23684
|
return 0;
|
|
23384
23685
|
}
|
|
23385
23686
|
if (context.command === "help" || context.command === "--help" || context.command === "-h") {
|
|
23386
|
-
|
|
23687
|
+
process32.stdout.write(`${wantsFullHelp(argv) ? CLI_HELP_ALL : CLI_HELP}
|
|
23387
23688
|
`);
|
|
23388
23689
|
return 0;
|
|
23389
23690
|
}
|
|
23390
23691
|
if (context.command === "--version" || context.command === "-v") {
|
|
23391
|
-
|
|
23692
|
+
process32.stdout.write(`${await readVersion()}
|
|
23392
23693
|
`);
|
|
23393
23694
|
return 0;
|
|
23394
23695
|
}
|
|
@@ -23397,7 +23698,7 @@ var runCli = async (argv) => {
|
|
|
23397
23698
|
}
|
|
23398
23699
|
const handler = COMMAND_HANDLERS[context.command];
|
|
23399
23700
|
if (handler === void 0) {
|
|
23400
|
-
|
|
23701
|
+
process32.stderr.write(
|
|
23401
23702
|
`Unknown command: ${context.command}
|
|
23402
23703
|
Try: vybekiit or vybekiit --help
|
|
23403
23704
|
`
|
|
@@ -23409,9 +23710,9 @@ Try: vybekiit or vybekiit --help
|
|
|
23409
23710
|
|
|
23410
23711
|
// src/bin.ts
|
|
23411
23712
|
try {
|
|
23412
|
-
|
|
23713
|
+
process33.exit(await runCli(process33.argv.slice(2)));
|
|
23413
23714
|
} catch (error) {
|
|
23414
|
-
|
|
23715
|
+
process33.stderr.write(`vybekiit: ${caughtMessage(error)}
|
|
23415
23716
|
`);
|
|
23416
|
-
|
|
23717
|
+
process33.exit(1);
|
|
23417
23718
|
}
|