vibeman 0.0.17 → 0.0.18
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/api.js +241 -74
- package/dist/commit.txt +1 -1
- package/dist/ui/assets/{index-dZUCDdRl.js → index-B-8CajaA.js} +1 -1
- package/dist/ui/assets/{index-DVUZnv4I.js → index-B1FSfHLI.js} +1 -1
- package/dist/ui/assets/{index-B9j1Z7xH.js → index-B92ZPtji.js} +1 -1
- package/dist/ui/assets/{index-DxYZT2Q7.js → index-BTczj1rc.js} +1 -1
- package/dist/ui/assets/{index-h0c542Uj.js → index-BkKHUQw9.js} +1 -1
- package/dist/ui/assets/{index-CHaxebS-.js → index-BoxXumAe.js} +1 -1
- package/dist/ui/assets/{index-DWOryZN1.js → index-BvKWFrTc.js} +1 -1
- package/dist/ui/assets/{index-RO6e7ud2.js → index-CC4BSgs2.js} +1 -1
- package/dist/ui/assets/{index-BMvqb2S0.js → index-Cd7yEUOm.js} +1 -1
- package/dist/ui/assets/{index-BjP484xW.js → index-Csir9ls6.js} +1 -1
- package/dist/ui/assets/{index-BaTjy202.js → index-CtYo0drE.js} +1 -1
- package/dist/ui/assets/{index-BGSXwEof.js → index-Cxa7P1xU.js} +174 -172
- package/dist/ui/assets/{index-DJPvnRwe.js → index-D6wz33v1.js} +1 -1
- package/dist/ui/assets/{index-CgR7ieU_.js → index-Dd7O0n3u.js} +1 -1
- package/dist/ui/assets/{index-JyRtNGro.js → index-DfOxbKSr.js} +1 -1
- package/dist/ui/assets/{index-Dl7WFkDL.js → index-Di4kXroA.js} +1 -1
- package/dist/ui/assets/{index-DhCgwoTQ.js → index-JAx5oYb8.js} +1 -1
- package/dist/ui/assets/{index-B1LpYbIL.css → index-JuAf608w.css} +1 -1
- package/dist/ui/assets/{index-CgPm7uHs.js → index-N65elFFW.js} +1 -1
- package/dist/ui/assets/{index-CmRfv-pq.js → index-UepgO9mJ.js} +1 -1
- package/dist/ui/assets/{index-qhLd2sra.js → index-WhRFAD-g.js} +1 -1
- package/dist/ui/assets/{index-Bf-sg7t1.js → index-cqRipg1U.js} +1 -1
- package/dist/ui/assets/{index-B0WvXt0J.js → index-r2QifZLg.js} +1 -1
- package/dist/ui/assets/{index-CM8fvy_3.js → index-xQKZm7F-.js} +1 -1
- package/dist/ui/index.html +6 -2
- package/package.json +1 -1
package/dist/api.js
CHANGED
|
@@ -105357,7 +105357,7 @@ var init_workflows = __esm(() => {
|
|
|
105357
105357
|
|
|
105358
105358
|
// ../api/src/server/routes/tasks.ts
|
|
105359
105359
|
import { normalize as normalize9, resolve as resolve16, join as join5, relative as relative5, sep as sep2 } from "node:path";
|
|
105360
|
-
import { writeFile as writeFile3, mkdir as mkdir3 } from "node:fs/promises";
|
|
105360
|
+
import { readFile as readFile5, writeFile as writeFile3, mkdir as mkdir3, rm as rm2 } from "node:fs/promises";
|
|
105361
105361
|
function normalizeFrontmatterTags(value) {
|
|
105362
105362
|
if (Array.isArray(value)) {
|
|
105363
105363
|
return value.map((tag) => String(tag).trim()).filter(Boolean);
|
|
@@ -105404,6 +105404,117 @@ function runBelongsToTask(payload, plan, explicitTaskId) {
|
|
|
105404
105404
|
return true;
|
|
105405
105405
|
return false;
|
|
105406
105406
|
}
|
|
105407
|
+
function buildTaskDeleteCommitMessage(taskId, taskTitle) {
|
|
105408
|
+
const normalizedId = taskId.trim();
|
|
105409
|
+
const normalizedTitle = taskTitle?.trim() ?? "";
|
|
105410
|
+
const raw2 = `task: ${normalizedId} ${normalizedTitle} deleted`.replace(/\s+/g, " ").trim();
|
|
105411
|
+
return raw2 || `task: ${normalizedId} deleted`;
|
|
105412
|
+
}
|
|
105413
|
+
async function deleteTaskFileWithCommit(args) {
|
|
105414
|
+
for (const file2 of args.deletedFiles) {
|
|
105415
|
+
await rm2(resolve16(args.rootPath, file2.path), { force: true });
|
|
105416
|
+
}
|
|
105417
|
+
if (!args.commitDirect) {
|
|
105418
|
+
return { commit: null };
|
|
105419
|
+
}
|
|
105420
|
+
try {
|
|
105421
|
+
const commit = await args.git.commit(args.commitMessage, {
|
|
105422
|
+
paths: args.deletedFiles.map((file2) => file2.path)
|
|
105423
|
+
});
|
|
105424
|
+
return { commit };
|
|
105425
|
+
} catch (error48) {
|
|
105426
|
+
try {
|
|
105427
|
+
await Promise.all(args.deletedFiles.map((file2) => writeFile3(resolve16(args.rootPath, file2.path), file2.content)));
|
|
105428
|
+
} catch (restoreError) {
|
|
105429
|
+
const restoreMessage = restoreError instanceof Error ? restoreError.message : "Unknown restore error";
|
|
105430
|
+
const originalMessage = error48 instanceof Error ? error48.message : "Unknown commit error";
|
|
105431
|
+
throw new Error(`Unable to commit task delete (${originalMessage}). The task file could not be restored (${restoreMessage}).`);
|
|
105432
|
+
}
|
|
105433
|
+
throw error48;
|
|
105434
|
+
}
|
|
105435
|
+
}
|
|
105436
|
+
async function collectRestorableTaskDeleteFiles(args) {
|
|
105437
|
+
const deletedFiles = [
|
|
105438
|
+
{ path: args.taskPath, content: args.taskContent }
|
|
105439
|
+
];
|
|
105440
|
+
const assetPaths = collectTaskAssetPaths(args.taskContent);
|
|
105441
|
+
for (const assetPath of assetPaths) {
|
|
105442
|
+
try {
|
|
105443
|
+
deletedFiles.push({
|
|
105444
|
+
path: assetPath,
|
|
105445
|
+
content: await readFile5(resolve16(args.rootPath, assetPath))
|
|
105446
|
+
});
|
|
105447
|
+
} catch (error48) {
|
|
105448
|
+
if (error48 instanceof Error && error48.code === "ENOENT") {
|
|
105449
|
+
continue;
|
|
105450
|
+
}
|
|
105451
|
+
throw error48;
|
|
105452
|
+
}
|
|
105453
|
+
}
|
|
105454
|
+
return deletedFiles;
|
|
105455
|
+
}
|
|
105456
|
+
async function cleanupTaskGitArtifacts(rootPath, plan) {
|
|
105457
|
+
const git = createGitService(rootPath);
|
|
105458
|
+
const worktrees = await git.listWorktrees();
|
|
105459
|
+
const normalizedTarget = normalize9(plan.worktreePath);
|
|
105460
|
+
const rootPathNormalized = normalize9(resolve16(rootPath));
|
|
105461
|
+
const matchingWorktrees = worktrees.filter((worktree) => {
|
|
105462
|
+
const resolvedPath = normalize9(resolve16(rootPath, worktree.path));
|
|
105463
|
+
return resolvedPath === normalizedTarget || worktree.branch === plan.branchName;
|
|
105464
|
+
});
|
|
105465
|
+
for (const worktree of matchingWorktrees) {
|
|
105466
|
+
const resolvedPath = normalize9(resolve16(rootPath, worktree.path));
|
|
105467
|
+
const relativePath = relative5(rootPathNormalized, resolvedPath);
|
|
105468
|
+
const isWithinRoot2 = relativePath === "" || !relativePath.startsWith("..") && !relativePath.startsWith(`..${sep2}`);
|
|
105469
|
+
if (isWithinRoot2) {
|
|
105470
|
+
continue;
|
|
105471
|
+
}
|
|
105472
|
+
await git.removeWorktree(worktree.path, { force: true });
|
|
105473
|
+
}
|
|
105474
|
+
await git.pruneWorktrees();
|
|
105475
|
+
const hasBranch = await git.branchExists(plan.branchName);
|
|
105476
|
+
if (!hasBranch) {
|
|
105477
|
+
return;
|
|
105478
|
+
}
|
|
105479
|
+
const currentBranch = await git.getCurrentBranch();
|
|
105480
|
+
if (currentBranch === plan.branchName) {
|
|
105481
|
+
const localBranches = await git.listLocalBranches();
|
|
105482
|
+
const fallbackCandidates = [await git.getDefaultBranch(), "main", "master", ...localBranches];
|
|
105483
|
+
const fallbackBranch = fallbackCandidates.find((branch) => branch && branch !== plan.branchName && localBranches.includes(branch)) ?? "";
|
|
105484
|
+
if (!fallbackBranch) {
|
|
105485
|
+
throw new Error(`Cannot delete branch "${plan.branchName}" because it is currently checked out.`);
|
|
105486
|
+
}
|
|
105487
|
+
await git.checkoutBranch(fallbackBranch);
|
|
105488
|
+
}
|
|
105489
|
+
await git.removeBranch(plan.branchName, { force: true });
|
|
105490
|
+
}
|
|
105491
|
+
async function cleanupTaskWorkflowRuns(args) {
|
|
105492
|
+
let deletedRuns = 0;
|
|
105493
|
+
let cancelledRuns = 0;
|
|
105494
|
+
const runs = await args.db.workflowRun.findMany({
|
|
105495
|
+
where: { deletedAt: null },
|
|
105496
|
+
select: { id: true, status: true, runPayload: true }
|
|
105497
|
+
});
|
|
105498
|
+
const relatedRuns = runs.filter((run2) => runBelongsToTask(run2.runPayload ?? null, args.plan, args.explicitTaskId));
|
|
105499
|
+
const workflowService = createWorkflowService({ db: args.db, root: args.rootPath });
|
|
105500
|
+
const cancellableRuns = relatedRuns.filter((run2) => {
|
|
105501
|
+
const status = String(run2.status).toLowerCase();
|
|
105502
|
+
return status === "running" || status === "pending" || status === "paused";
|
|
105503
|
+
});
|
|
105504
|
+
for (const run2 of cancellableRuns) {
|
|
105505
|
+
await workflowService.cancelRun(run2.id, args.cancelReason);
|
|
105506
|
+
cancelledRuns += 1;
|
|
105507
|
+
}
|
|
105508
|
+
const runIds = relatedRuns.map((run2) => run2.id);
|
|
105509
|
+
if (runIds.length > 0) {
|
|
105510
|
+
const result = await args.db.workflowRun.updateMany({
|
|
105511
|
+
where: { id: { in: runIds } },
|
|
105512
|
+
data: { deletedAt: new Date }
|
|
105513
|
+
});
|
|
105514
|
+
deletedRuns = result.count;
|
|
105515
|
+
}
|
|
105516
|
+
return { deletedRuns, cancelledRuns };
|
|
105517
|
+
}
|
|
105407
105518
|
function parseTaskFile(filename, content) {
|
|
105408
105519
|
const parsed = import_gray_matter2.default(content);
|
|
105409
105520
|
const frontmatter = { ...parsed.data };
|
|
@@ -105449,6 +105560,7 @@ var init_tasks2 = __esm(() => {
|
|
|
105449
105560
|
init_log();
|
|
105450
105561
|
init_task_markdown();
|
|
105451
105562
|
init_task_id();
|
|
105563
|
+
init_task_commit_paths();
|
|
105452
105564
|
init_tasks();
|
|
105453
105565
|
init_workflows();
|
|
105454
105566
|
init_trpc();
|
|
@@ -105804,44 +105916,8 @@ var init_tasks2 = __esm(() => {
|
|
|
105804
105916
|
cause: error48 instanceof Error ? error48 : undefined
|
|
105805
105917
|
});
|
|
105806
105918
|
}
|
|
105807
|
-
const git = createGitService(ctx.root);
|
|
105808
105919
|
try {
|
|
105809
|
-
|
|
105810
|
-
const normalizedTarget = normalize9(plan.worktreePath);
|
|
105811
|
-
const rootPath = normalize9(resolve16(ctx.root));
|
|
105812
|
-
const matchingWorktrees = worktrees.filter((worktree) => {
|
|
105813
|
-
const resolvedPath = normalize9(resolve16(ctx.root, worktree.path));
|
|
105814
|
-
return resolvedPath === normalizedTarget || worktree.branch === plan.branchName;
|
|
105815
|
-
});
|
|
105816
|
-
for (const worktree of matchingWorktrees) {
|
|
105817
|
-
const resolvedPath = normalize9(resolve16(ctx.root, worktree.path));
|
|
105818
|
-
const relativePath = relative5(rootPath, resolvedPath);
|
|
105819
|
-
const isWithinRoot2 = relativePath === "" || !relativePath.startsWith("..") && !relativePath.startsWith(`..${sep2}`);
|
|
105820
|
-
if (isWithinRoot2) {
|
|
105821
|
-
continue;
|
|
105822
|
-
}
|
|
105823
|
-
await git.removeWorktree(worktree.path, { force: true });
|
|
105824
|
-
}
|
|
105825
|
-
await git.pruneWorktrees();
|
|
105826
|
-
const hasBranch = await git.branchExists(plan.branchName);
|
|
105827
|
-
if (hasBranch) {
|
|
105828
|
-
const currentBranch = await git.getCurrentBranch();
|
|
105829
|
-
if (currentBranch === plan.branchName) {
|
|
105830
|
-
const localBranches = await git.listLocalBranches();
|
|
105831
|
-
const fallbackCandidates = [
|
|
105832
|
-
await git.getDefaultBranch(),
|
|
105833
|
-
"main",
|
|
105834
|
-
"master",
|
|
105835
|
-
...localBranches
|
|
105836
|
-
];
|
|
105837
|
-
const fallbackBranch = fallbackCandidates.find((branch) => branch && branch !== plan.branchName && localBranches.includes(branch)) ?? "";
|
|
105838
|
-
if (!fallbackBranch) {
|
|
105839
|
-
throw new Error(`Cannot delete branch "${plan.branchName}" because it is currently checked out.`);
|
|
105840
|
-
}
|
|
105841
|
-
await git.checkoutBranch(fallbackBranch);
|
|
105842
|
-
}
|
|
105843
|
-
await git.removeBranch(plan.branchName, { force: true });
|
|
105844
|
-
}
|
|
105920
|
+
await cleanupTaskGitArtifacts(ctx.root, plan);
|
|
105845
105921
|
} catch (error48) {
|
|
105846
105922
|
const message = error48 instanceof Error ? error48.message : "Unable to reset git worktree and branch";
|
|
105847
105923
|
throw new TRPCError({
|
|
@@ -105853,28 +105929,13 @@ var init_tasks2 = __esm(() => {
|
|
|
105853
105929
|
let deletedRuns = 0;
|
|
105854
105930
|
let cancelledRuns = 0;
|
|
105855
105931
|
try {
|
|
105856
|
-
|
|
105857
|
-
|
|
105858
|
-
|
|
105859
|
-
|
|
105860
|
-
|
|
105861
|
-
|
|
105862
|
-
|
|
105863
|
-
const status = String(run2.status).toLowerCase();
|
|
105864
|
-
return status === "running" || status === "pending" || status === "paused";
|
|
105865
|
-
});
|
|
105866
|
-
for (const run2 of cancellableRuns) {
|
|
105867
|
-
await workflowService.cancelRun(run2.id, "Cancelled by task reset");
|
|
105868
|
-
cancelledRuns += 1;
|
|
105869
|
-
}
|
|
105870
|
-
const runIds = relatedRuns.map((run2) => run2.id);
|
|
105871
|
-
if (runIds.length > 0) {
|
|
105872
|
-
const result = await ctx.db.workflowRun.updateMany({
|
|
105873
|
-
where: { id: { in: runIds } },
|
|
105874
|
-
data: { deletedAt: new Date }
|
|
105875
|
-
});
|
|
105876
|
-
deletedRuns = result.count;
|
|
105877
|
-
}
|
|
105932
|
+
({ deletedRuns, cancelledRuns } = await cleanupTaskWorkflowRuns({
|
|
105933
|
+
db: ctx.db,
|
|
105934
|
+
rootPath: ctx.root,
|
|
105935
|
+
plan,
|
|
105936
|
+
explicitTaskId: input.taskId,
|
|
105937
|
+
cancelReason: "Cancelled by task reset"
|
|
105938
|
+
}));
|
|
105878
105939
|
} catch (error48) {
|
|
105879
105940
|
const message = error48 instanceof Error ? error48.message : "Unable to reset workflow runs and states for task";
|
|
105880
105941
|
throw new TRPCError({
|
|
@@ -105892,6 +105953,112 @@ var init_tasks2 = __esm(() => {
|
|
|
105892
105953
|
deletedRuns
|
|
105893
105954
|
});
|
|
105894
105955
|
}),
|
|
105956
|
+
delete: dbProcedure.input(exports_external.object({
|
|
105957
|
+
filename: exports_external.string().min(1),
|
|
105958
|
+
taskId: exports_external.string().min(1).optional(),
|
|
105959
|
+
commitDirect: exports_external.boolean().optional(),
|
|
105960
|
+
commitMessage: exports_external.string().min(1).optional()
|
|
105961
|
+
})).mutation(async ({ ctx, input }) => {
|
|
105962
|
+
const taskPath = join5(".vibeman/tasks", input.filename);
|
|
105963
|
+
let plan;
|
|
105964
|
+
let taskTitle;
|
|
105965
|
+
let existingContent = "";
|
|
105966
|
+
try {
|
|
105967
|
+
plan = buildTaskExecutionPlan(ctx.root, taskPath);
|
|
105968
|
+
existingContent = await readFileContent(ctx.root, taskPath);
|
|
105969
|
+
const parsed = import_gray_matter2.default(existingContent);
|
|
105970
|
+
taskTitle = typeof parsed.data.title === "string" ? parsed.data.title : undefined;
|
|
105971
|
+
} catch (error48) {
|
|
105972
|
+
const message = error48 instanceof Error ? error48.message : "Unable to prepare task delete plan";
|
|
105973
|
+
throw new TRPCError({
|
|
105974
|
+
code: "BAD_REQUEST",
|
|
105975
|
+
message,
|
|
105976
|
+
cause: error48 instanceof Error ? error48 : undefined
|
|
105977
|
+
});
|
|
105978
|
+
}
|
|
105979
|
+
let deletedFiles;
|
|
105980
|
+
try {
|
|
105981
|
+
deletedFiles = await collectRestorableTaskDeleteFiles({
|
|
105982
|
+
rootPath: ctx.root,
|
|
105983
|
+
taskPath,
|
|
105984
|
+
taskContent: existingContent
|
|
105985
|
+
});
|
|
105986
|
+
} catch (error48) {
|
|
105987
|
+
const message = error48 instanceof Error ? error48.message : "Unable to prepare task attachments for delete";
|
|
105988
|
+
throw new TRPCError({
|
|
105989
|
+
code: "BAD_REQUEST",
|
|
105990
|
+
message,
|
|
105991
|
+
cause: error48 instanceof Error ? error48 : undefined
|
|
105992
|
+
});
|
|
105993
|
+
}
|
|
105994
|
+
const commitDirect = input.commitDirect ?? true;
|
|
105995
|
+
let commitResult = null;
|
|
105996
|
+
const git = createGitService(ctx.root);
|
|
105997
|
+
if (commitDirect) {
|
|
105998
|
+
try {
|
|
105999
|
+
({ commit: commitResult } = await deleteTaskFileWithCommit({
|
|
106000
|
+
rootPath: ctx.root,
|
|
106001
|
+
deletedFiles,
|
|
106002
|
+
commitDirect,
|
|
106003
|
+
commitMessage: input.commitMessage?.trim() || buildTaskDeleteCommitMessage(plan.taskId, taskTitle),
|
|
106004
|
+
git
|
|
106005
|
+
}));
|
|
106006
|
+
} catch (error48) {
|
|
106007
|
+
const message = error48 instanceof Error ? error48.message : "Unable to commit task delete";
|
|
106008
|
+
throw new TRPCError({
|
|
106009
|
+
code: "BAD_REQUEST",
|
|
106010
|
+
message,
|
|
106011
|
+
cause: error48 instanceof Error ? error48 : undefined
|
|
106012
|
+
});
|
|
106013
|
+
}
|
|
106014
|
+
} else {
|
|
106015
|
+
try {
|
|
106016
|
+
({ commit: commitResult } = await deleteTaskFileWithCommit({
|
|
106017
|
+
rootPath: ctx.root,
|
|
106018
|
+
deletedFiles,
|
|
106019
|
+
commitDirect,
|
|
106020
|
+
commitMessage: "",
|
|
106021
|
+
git
|
|
106022
|
+
}));
|
|
106023
|
+
} catch (error48) {
|
|
106024
|
+
const message = error48 instanceof Error ? error48.message : "Unable to delete task file";
|
|
106025
|
+
throw new TRPCError({
|
|
106026
|
+
code: "INTERNAL_SERVER_ERROR",
|
|
106027
|
+
message,
|
|
106028
|
+
cause: error48 instanceof Error ? error48 : undefined
|
|
106029
|
+
});
|
|
106030
|
+
}
|
|
106031
|
+
}
|
|
106032
|
+
let deletedRuns = 0;
|
|
106033
|
+
let cancelledRuns = 0;
|
|
106034
|
+
const cleanupWarnings = [];
|
|
106035
|
+
try {
|
|
106036
|
+
await cleanupTaskGitArtifacts(ctx.root, plan);
|
|
106037
|
+
} catch (error48) {
|
|
106038
|
+
cleanupWarnings.push(error48 instanceof Error ? error48.message : "Unable to delete task worktree and branch");
|
|
106039
|
+
}
|
|
106040
|
+
try {
|
|
106041
|
+
({ deletedRuns, cancelledRuns } = await cleanupTaskWorkflowRuns({
|
|
106042
|
+
db: ctx.db,
|
|
106043
|
+
rootPath: ctx.root,
|
|
106044
|
+
plan,
|
|
106045
|
+
explicitTaskId: input.taskId,
|
|
106046
|
+
cancelReason: "Cancelled by task delete"
|
|
106047
|
+
}));
|
|
106048
|
+
} catch (error48) {
|
|
106049
|
+
cleanupWarnings.push(error48 instanceof Error ? error48.message : "Unable to delete workflow runs and states for task");
|
|
106050
|
+
}
|
|
106051
|
+
return createResponse(ctx, {
|
|
106052
|
+
taskPath: plan.taskPath,
|
|
106053
|
+
taskName: plan.taskName,
|
|
106054
|
+
branch: plan.branchName,
|
|
106055
|
+
worktree: plan.worktreePath,
|
|
106056
|
+
cancelledRuns,
|
|
106057
|
+
deletedRuns,
|
|
106058
|
+
commit: commitResult,
|
|
106059
|
+
cleanupWarnings
|
|
106060
|
+
});
|
|
106061
|
+
}),
|
|
105895
106062
|
setup: dbProcedure.input(exports_external.object({ filename: exports_external.string().min(1) })).mutation(async ({ ctx, input }) => {
|
|
105896
106063
|
const taskPath = join5(".vibeman/tasks", input.filename);
|
|
105897
106064
|
let plan;
|
|
@@ -105969,7 +106136,7 @@ function classifyMergeReadiness(input) {
|
|
|
105969
106136
|
|
|
105970
106137
|
// ../api/src/server/routes/workflows.ts
|
|
105971
106138
|
import { normalize as normalize10, relative as relative6, resolve as resolve17 } from "node:path";
|
|
105972
|
-
import { readFile as
|
|
106139
|
+
import { readFile as readFile6, writeFile as writeFile4 } from "node:fs/promises";
|
|
105973
106140
|
import { execFile as execFile4 } from "node:child_process";
|
|
105974
106141
|
import { promisify } from "node:util";
|
|
105975
106142
|
function workflowRecency(workflow) {
|
|
@@ -106395,7 +106562,7 @@ function resolvePathWithinRoot(rootPath, pathInput) {
|
|
|
106395
106562
|
}
|
|
106396
106563
|
async function markTaskFrontmatterDone(rootPath, taskPath) {
|
|
106397
106564
|
const filePath = resolvePathWithinRoot(rootPath, taskPath);
|
|
106398
|
-
const raw2 = await
|
|
106565
|
+
const raw2 = await readFile6(filePath, "utf8");
|
|
106399
106566
|
const match = raw2.match(/^---\n([\s\S]*?)\n---\n?/);
|
|
106400
106567
|
if (!match) {
|
|
106401
106568
|
return false;
|
|
@@ -108011,7 +108178,7 @@ var init_remote_access = __esm(() => {
|
|
|
108011
108178
|
// ../api/src/server/routes/system.ts
|
|
108012
108179
|
import { execFile as execFile5, spawn as spawn7 } from "node:child_process";
|
|
108013
108180
|
import { resolve as resolve18, relative as relative7, sep as sep3, join as join6, extname } from "node:path";
|
|
108014
|
-
import { access as access3, mkdtemp, readFile as
|
|
108181
|
+
import { access as access3, mkdtemp, readFile as readFile7, rm as rm3 } from "node:fs/promises";
|
|
108015
108182
|
import { homedir as homedir2, tmpdir as tmpdir2 } from "node:os";
|
|
108016
108183
|
import { promisify as promisify2 } from "node:util";
|
|
108017
108184
|
function isWithin2(rootPath, targetPath) {
|
|
@@ -108103,10 +108270,10 @@ async function convertIcnsToPngDataUrl(iconPath) {
|
|
|
108103
108270
|
const pngPath = join6(tempDir, "icon.png");
|
|
108104
108271
|
try {
|
|
108105
108272
|
await execFileAsync2("sips", ["-s", "format", "png", iconPath, "--out", pngPath]);
|
|
108106
|
-
const pngBuffer = await
|
|
108273
|
+
const pngBuffer = await readFile7(pngPath);
|
|
108107
108274
|
return toDataUrl(pngBuffer, ".png");
|
|
108108
108275
|
} finally {
|
|
108109
|
-
await
|
|
108276
|
+
await rm3(tempDir, { recursive: true, force: true });
|
|
108110
108277
|
}
|
|
108111
108278
|
}
|
|
108112
108279
|
async function readAppIconDataUrl(appPath) {
|
|
@@ -108131,7 +108298,7 @@ async function readAppIconDataUrl(appPath) {
|
|
|
108131
108298
|
const iconPath = join6(appPath, "Contents", "Resources", iconFileName);
|
|
108132
108299
|
await access3(iconPath);
|
|
108133
108300
|
const extension = extname(iconPath).toLowerCase();
|
|
108134
|
-
const dataUrl = extension === ".icns" ? await convertIcnsToPngDataUrl(iconPath) : toDataUrl(await
|
|
108301
|
+
const dataUrl = extension === ".icns" ? await convertIcnsToPngDataUrl(iconPath) : toDataUrl(await readFile7(iconPath), extension);
|
|
108135
108302
|
appIconCache.set(appPath, dataUrl);
|
|
108136
108303
|
return dataUrl;
|
|
108137
108304
|
} catch {
|
|
@@ -113781,7 +113948,7 @@ var init_feedback2 = __esm(() => {
|
|
|
113781
113948
|
});
|
|
113782
113949
|
|
|
113783
113950
|
// ../api/src/server/routes/onboarding.ts
|
|
113784
|
-
import { readFile as
|
|
113951
|
+
import { readFile as readFile8, readdir as readdir4, rename as rename2, rm as rm4, mkdir as mkdir6, writeFile as writeFile7 } from "node:fs/promises";
|
|
113785
113952
|
import { basename as basename2, join as join8, resolve as resolve21 } from "node:path";
|
|
113786
113953
|
import { spawn as spawn8 } from "node:child_process";
|
|
113787
113954
|
function buildInitialOnboardingState(nowIso) {
|
|
@@ -113913,7 +114080,7 @@ function buildTemplateWorkspace(root) {
|
|
|
113913
114080
|
async function patchGeneratedPackageName(root, desiredName) {
|
|
113914
114081
|
const packageJsonPath = resolve21(root, "package.json");
|
|
113915
114082
|
try {
|
|
113916
|
-
const raw2 = await
|
|
114083
|
+
const raw2 = await readFile8(packageJsonPath, "utf8");
|
|
113917
114084
|
const pkg = JSON.parse(raw2);
|
|
113918
114085
|
const currentName = typeof pkg.name === "string" ? pkg.name.trim() : "";
|
|
113919
114086
|
if (currentName.length === 0 || currentName.includes("vibeman-init-tmp")) {
|
|
@@ -113932,7 +114099,7 @@ async function patchGeneratedT3ImportAlias(root, desiredAlias) {
|
|
|
113932
114099
|
}
|
|
113933
114100
|
const tsconfigPath = resolve21(root, "tsconfig.json");
|
|
113934
114101
|
try {
|
|
113935
|
-
const raw2 = await
|
|
114102
|
+
const raw2 = await readFile8(tsconfigPath, "utf8");
|
|
113936
114103
|
const config2 = JSON.parse(raw2);
|
|
113937
114104
|
const paths = config2.compilerOptions?.paths;
|
|
113938
114105
|
const current = paths?.["~/*"];
|
|
@@ -114134,7 +114301,7 @@ var init_onboarding = __esm(() => {
|
|
|
114134
114301
|
let packageName = null;
|
|
114135
114302
|
let packageDescription = null;
|
|
114136
114303
|
try {
|
|
114137
|
-
const raw2 = await
|
|
114304
|
+
const raw2 = await readFile8(resolve21(ctx.root, "package.json"), "utf8");
|
|
114138
114305
|
const pkg = JSON.parse(raw2);
|
|
114139
114306
|
if (typeof pkg.name === "string" && pkg.name.trim()) {
|
|
114140
114307
|
packageName = pkg.name.trim();
|
|
@@ -114164,7 +114331,7 @@ var init_onboarding = __esm(() => {
|
|
|
114164
114331
|
} catch {}
|
|
114165
114332
|
if (hasPackageJson) {
|
|
114166
114333
|
try {
|
|
114167
|
-
const raw2 = await
|
|
114334
|
+
const raw2 = await readFile8(resolve21(ctx.root, "package.json"), "utf8");
|
|
114168
114335
|
const pkg = JSON.parse(raw2);
|
|
114169
114336
|
const all = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
114170
114337
|
if (all["next"] && all["@trpc/server"])
|
|
@@ -114204,13 +114371,13 @@ var init_onboarding = __esm(() => {
|
|
|
114204
114371
|
const scaffoldPath = shouldRunInTmpDir ? resolve21(tmpPath, workspace.projectDirName) : resolve21(ctx.root, workspace.scaffoldDir);
|
|
114205
114372
|
const command = buildTemplateInitCommand(input, commandTargetDir);
|
|
114206
114373
|
try {
|
|
114207
|
-
await
|
|
114374
|
+
await rm4(tmpPath, { recursive: true, force: true });
|
|
114208
114375
|
} catch {}
|
|
114209
114376
|
await mkdir6(tmpPath, { recursive: true });
|
|
114210
114377
|
const result = await runShellCommand(command, commandCwd);
|
|
114211
114378
|
if (!result.success) {
|
|
114212
114379
|
try {
|
|
114213
|
-
await
|
|
114380
|
+
await rm4(tmpPath, { recursive: true, force: true });
|
|
114214
114381
|
} catch {}
|
|
114215
114382
|
const detail = (result.stderr || result.stdout).trim().slice(-2000);
|
|
114216
114383
|
throw new TRPCError({
|
|
@@ -114241,7 +114408,7 @@ ${detail}`
|
|
|
114241
114408
|
throw new TRPCError({ code: "INTERNAL_SERVER_ERROR", message: msg });
|
|
114242
114409
|
} finally {
|
|
114243
114410
|
try {
|
|
114244
|
-
await
|
|
114411
|
+
await rm4(tmpPath, { recursive: true, force: true });
|
|
114245
114412
|
} catch {}
|
|
114246
114413
|
}
|
|
114247
114414
|
return createResponse(ctx, {
|
package/dist/commit.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
4d46e83
|