@launchsecure/launch-kit 0.0.29 → 0.0.30
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/beacon/beacon.mjs +2759 -1246
- package/dist/beacon/beacon.mjs.map +1 -1
- package/dist/beacon/beacon.umd.js +710 -95
- package/dist/beacon/beacon.umd.js.map +1 -1
- package/dist/beacon/types/core.d.ts +14 -0
- package/dist/beacon/types/core.d.ts.map +1 -0
- package/dist/beacon/types/ctx.d.ts +14 -0
- package/dist/beacon/types/ctx.d.ts.map +1 -0
- package/dist/beacon/types/element.d.ts +16 -48
- package/dist/beacon/types/element.d.ts.map +1 -1
- package/dist/beacon/types/index.d.ts +5 -4
- package/dist/beacon/types/index.d.ts.map +1 -1
- package/dist/beacon/types/internal/annotation-cache.d.ts +10 -0
- package/dist/beacon/types/internal/annotation-cache.d.ts.map +1 -0
- package/dist/beacon/types/internal/element-capture.d.ts +19 -0
- package/dist/beacon/types/internal/element-capture.d.ts.map +1 -0
- package/dist/beacon/types/internal/event-buffer.d.ts +16 -0
- package/dist/beacon/types/internal/event-buffer.d.ts.map +1 -0
- package/dist/beacon/types/internal/framework-detect.d.ts +6 -0
- package/dist/beacon/types/internal/framework-detect.d.ts.map +1 -0
- package/dist/beacon/types/internal/markers.d.ts +17 -0
- package/dist/beacon/types/internal/markers.d.ts.map +1 -0
- package/dist/beacon/types/internal/monitor/capture-dom.d.ts +14 -0
- package/dist/beacon/types/internal/monitor/capture-dom.d.ts.map +1 -0
- package/dist/beacon/types/internal/monitor/capture-network.d.ts +12 -0
- package/dist/beacon/types/internal/monitor/capture-network.d.ts.map +1 -0
- package/dist/beacon/types/internal/monitor/overlay.d.ts +16 -0
- package/dist/beacon/types/internal/monitor/overlay.d.ts.map +1 -0
- package/dist/beacon/types/internal/monitor/session.d.ts +41 -0
- package/dist/beacon/types/internal/monitor/session.d.ts.map +1 -0
- package/dist/beacon/types/{monitor → internal/monitor}/transport.d.ts +3 -3
- package/dist/beacon/types/internal/monitor/transport.d.ts.map +1 -0
- package/dist/beacon/types/{monitor/types.d.ts → internal/monitor/wire.d.ts} +69 -27
- package/dist/beacon/types/internal/monitor/wire.d.ts.map +1 -0
- package/dist/beacon/types/{ui → internal}/pick-mode-overlay.d.ts +4 -5
- package/dist/beacon/types/internal/pick-mode-overlay.d.ts.map +1 -0
- package/dist/beacon/types/{capture → internal}/picker.d.ts +0 -1
- package/dist/beacon/types/internal/picker.d.ts.map +1 -0
- package/dist/beacon/types/{ui → internal}/pin-popover.d.ts +1 -1
- package/dist/beacon/types/internal/pin-popover.d.ts.map +1 -0
- package/dist/beacon/types/{capture → internal}/screenshot.d.ts +1 -0
- package/dist/beacon/types/internal/screenshot.d.ts.map +1 -0
- package/dist/beacon/types/internal/selector.d.ts.map +1 -0
- package/dist/beacon/types/plugins/domEle.d.ts +14 -0
- package/dist/beacon/types/plugins/domEle.d.ts.map +1 -0
- package/dist/beacon/types/plugins/domSS.d.ts +8 -0
- package/dist/beacon/types/plugins/domSS.d.ts.map +1 -0
- package/dist/beacon/types/plugins/errors.d.ts +3 -0
- package/dist/beacon/types/plugins/errors.d.ts.map +1 -0
- package/dist/beacon/types/plugins/index.d.ts +8 -0
- package/dist/beacon/types/plugins/index.d.ts.map +1 -0
- package/dist/beacon/types/plugins/liveMonitor.d.ts +14 -0
- package/dist/beacon/types/plugins/liveMonitor.d.ts.map +1 -0
- package/dist/beacon/types/plugins/metadata.d.ts +3 -0
- package/dist/beacon/types/plugins/metadata.d.ts.map +1 -0
- package/dist/beacon/types/registry.d.ts +33 -0
- package/dist/beacon/types/registry.d.ts.map +1 -0
- package/dist/beacon/types/styles.d.ts +8 -0
- package/dist/beacon/types/styles.d.ts.map +1 -0
- package/dist/beacon/types/transport.d.ts +3 -0
- package/dist/beacon/types/transport.d.ts.map +1 -0
- package/dist/beacon/types/types.d.ts +152 -68
- package/dist/beacon/types/types.d.ts.map +1 -1
- package/dist/beacon/types/ui/dialog.d.ts +53 -0
- package/dist/beacon/types/ui/dialog.d.ts.map +1 -0
- package/dist/beacon/types/ui/form.d.ts +7 -0
- package/dist/beacon/types/ui/form.d.ts.map +1 -0
- package/dist/beacon/types/ui/overlay.d.ts +6 -0
- package/dist/beacon/types/ui/overlay.d.ts.map +1 -0
- package/dist/deck-client/assets/{_baseUniq-W2JQDmje.js → _baseUniq-DCt2IMRR.js} +1 -1
- package/dist/deck-client/assets/{arc-DIBWAId9.js → arc-h-ifqmNR.js} +1 -1
- package/dist/deck-client/assets/{architectureDiagram-Q4EWVU46-CAIRMvJK.js → architectureDiagram-Q4EWVU46-C9dITSPv.js} +1 -1
- package/dist/deck-client/assets/{blockDiagram-DXYQGD6D-BeNaNiOi.js → blockDiagram-DXYQGD6D-BHuJT34t.js} +1 -1
- package/dist/deck-client/assets/{c4Diagram-AHTNJAMY-B9Ozi62h.js → c4Diagram-AHTNJAMY-CpvMGtDG.js} +1 -1
- package/dist/deck-client/assets/channel-2PZVMiXf.js +1 -0
- package/dist/deck-client/assets/{chunk-4BX2VUAB-D7AZ47dt.js → chunk-4BX2VUAB-B6md1VIm.js} +1 -1
- package/dist/deck-client/assets/{chunk-4TB4RGXK-DnVnNPcI.js → chunk-4TB4RGXK-BmEnX8ik.js} +1 -1
- package/dist/deck-client/assets/{chunk-55IACEB6-UKYs-YNd.js → chunk-55IACEB6-BZPUyZAZ.js} +1 -1
- package/dist/deck-client/assets/{chunk-EDXVE4YY-D43b-SKn.js → chunk-EDXVE4YY-BWwNUK-l.js} +1 -1
- package/dist/deck-client/assets/{chunk-FMBD7UC4-QzBAoyyW.js → chunk-FMBD7UC4-o7gSppGI.js} +1 -1
- package/dist/deck-client/assets/{chunk-OYMX7WX6-Cjif4r6W.js → chunk-OYMX7WX6-C4KoTL5p.js} +1 -1
- package/dist/deck-client/assets/{chunk-QZHKN3VN-CqLDirEI.js → chunk-QZHKN3VN-jkf68sDs.js} +1 -1
- package/dist/deck-client/assets/{chunk-YZCP3GAM-_FQvmMs4.js → chunk-YZCP3GAM-Cd4yBE7o.js} +1 -1
- package/dist/deck-client/assets/classDiagram-6PBFFD2Q-Bt8xBAof.js +1 -0
- package/dist/deck-client/assets/classDiagram-v2-HSJHXN6E-Bt8xBAof.js +1 -0
- package/dist/deck-client/assets/clone-BHQryoDl.js +1 -0
- package/dist/deck-client/assets/{cose-bilkent-S5V4N54A-rfrocesE.js → cose-bilkent-S5V4N54A-DeGFUgAV.js} +1 -1
- package/dist/deck-client/assets/{dagre-KV5264BT-Bv_7DJat.js → dagre-KV5264BT-ekcYJuUV.js} +1 -1
- package/dist/deck-client/assets/{diagram-5BDNPKRD-4F1414G5.js → diagram-5BDNPKRD-YHPk4rV2.js} +1 -1
- package/dist/deck-client/assets/{diagram-G4DWMVQ6-C4-Pszqm.js → diagram-G4DWMVQ6-DM-JCd_B.js} +1 -1
- package/dist/deck-client/assets/{diagram-MMDJMWI5-B647TIx9.js → diagram-MMDJMWI5-l5FK1ybk.js} +1 -1
- package/dist/deck-client/assets/{diagram-TYMM5635-BFAqpezd.js → diagram-TYMM5635-CIN4_1-j.js} +1 -1
- package/dist/deck-client/assets/{erDiagram-SMLLAGMA-BfBfrJOC.js → erDiagram-SMLLAGMA-MyinSkEl.js} +1 -1
- package/dist/deck-client/assets/{flowDiagram-DWJPFMVM-DX9YAYes.js → flowDiagram-DWJPFMVM-Dk8nn42x.js} +1 -1
- package/dist/deck-client/assets/{ganttDiagram-T4ZO3ILL-DCuiy7wF.js → ganttDiagram-T4ZO3ILL-BU1ihicu.js} +1 -1
- package/dist/deck-client/assets/{gitGraphDiagram-UUTBAWPF-CGp1IXUh.js → gitGraphDiagram-UUTBAWPF-BjsTL13C.js} +1 -1
- package/dist/deck-client/assets/{graph-B7g8aoxv.js → graph-DJmh-xi7.js} +1 -1
- package/dist/deck-client/assets/{index-Dg1r-WSN.js → index-KsShfCV-.js} +3 -3
- package/dist/deck-client/assets/{infoDiagram-42DDH7IO-L3fahMkF.js → infoDiagram-42DDH7IO-Dxvy_RB4.js} +1 -1
- package/dist/deck-client/assets/{ishikawaDiagram-UXIWVN3A-aS_EjWBZ.js → ishikawaDiagram-UXIWVN3A-DPOaNF1l.js} +1 -1
- package/dist/deck-client/assets/{journeyDiagram-VCZTEJTY-djTSQZF9.js → journeyDiagram-VCZTEJTY-DMew3K5c.js} +1 -1
- package/dist/deck-client/assets/{kanban-definition-6JOO6SKY-CcTHo4CM.js → kanban-definition-6JOO6SKY-csciJFuk.js} +1 -1
- package/dist/deck-client/assets/{layout-mEJiadb7.js → layout-Dg4yyms2.js} +1 -1
- package/dist/deck-client/assets/{linear-XgTKqyRu.js → linear-BA3zU6gq.js} +1 -1
- package/dist/deck-client/assets/{min-Ct9jZdpd.js → min-lz-Ird-p.js} +1 -1
- package/dist/deck-client/assets/{mindmap-definition-QFDTVHPH-BaFxCGNU.js → mindmap-definition-QFDTVHPH-CCEN8OQV.js} +1 -1
- package/dist/deck-client/assets/{pieDiagram-DEJITSTG-CIbYYjtw.js → pieDiagram-DEJITSTG-DM6n1HY7.js} +1 -1
- package/dist/deck-client/assets/{quadrantDiagram-34T5L4WZ-D9EtCOvh.js → quadrantDiagram-34T5L4WZ-_ULoR66n.js} +1 -1
- package/dist/deck-client/assets/{requirementDiagram-MS252O5E-xeni9eVG.js → requirementDiagram-MS252O5E-BuwJs7Tn.js} +1 -1
- package/dist/deck-client/assets/{sankeyDiagram-XADWPNL6-LYeknz9h.js → sankeyDiagram-XADWPNL6-BEsuzkW4.js} +1 -1
- package/dist/deck-client/assets/{sequenceDiagram-FGHM5R23-RDbsKFZf.js → sequenceDiagram-FGHM5R23-CP2H0YWf.js} +1 -1
- package/dist/deck-client/assets/{stateDiagram-FHFEXIEX-BH1Zjglk.js → stateDiagram-FHFEXIEX-B5Gw_NNL.js} +1 -1
- package/dist/deck-client/assets/stateDiagram-v2-QKLJ7IA2-4T4wMDXr.js +1 -0
- package/dist/deck-client/assets/{timeline-definition-GMOUNBTQ-IFXxKptt.js → timeline-definition-GMOUNBTQ-DsoYydQa.js} +1 -1
- package/dist/deck-client/assets/{vennDiagram-DHZGUBPP-D-sLkQs9.js → vennDiagram-DHZGUBPP-Dz8JT_ob.js} +1 -1
- package/dist/deck-client/assets/wardley-RL74JXVD-DGHQ_Ijv.js +162 -0
- package/dist/deck-client/assets/{wardleyDiagram-NUSXRM2D-BTjjuDU3.js → wardleyDiagram-NUSXRM2D-DN1LJMB1.js} +1 -1
- package/dist/deck-client/assets/{xychartDiagram-5P7HB3ND-AYbv92n-.js → xychartDiagram-5P7HB3ND-nb0oSfrQ.js} +1 -1
- package/dist/deck-client/index.html +1 -1
- package/dist/server/beacon-monitor-entry.js +548 -6
- package/dist/server/chart-serve.js +917 -248
- package/dist/server/cli.js +1368 -374
- package/dist/server/council-entry.js +0 -0
- package/dist/server/fb-wizard.js +0 -0
- package/dist/server/graph-mcp-entry.js +1326 -322
- package/dist/server/init-entry.js +16 -11
- package/dist/server/orbit-entry.js +135 -7
- package/dist/server/parse-worker-entry.js +918 -247
- package/package.json +22 -22
- package/scaffolds/ls-marketplace/plugins/kit/skills/beacon-array.md +107 -0
- package/scaffolds/ls-marketplace/plugins/kit/skills/beacon-clear.md +94 -0
- package/scaffolds/ls-marketplace/plugins/kit/skills/beacon-pulse.md +82 -0
- package/scaffolds/ls-marketplace/plugins/kit/skills/beacon-scan.md +66 -0
- package/scaffolds/ls-marketplace/plugins/kit/skills/blast-radius.md +101 -0
- package/scaffolds/ls-marketplace/plugins/kit/skills/brief.md +112 -0
- package/scaffolds/ls-marketplace/plugins/kit/skills/course.md +84 -0
- package/scaffolds/ls-marketplace/plugins/kit/skills/debug.md +92 -0
- package/scaffolds/ls-marketplace/plugins/kit/skills/deploy-check.md +160 -0
- package/scaffolds/ls-marketplace/plugins/kit/skills/diagram.md +134 -0
- package/scaffolds/ls-marketplace/plugins/kit/skills/orbit.md +87 -0
- package/scaffolds/ls-marketplace/plugins/kit/skills/prototype.md +90 -0
- package/scaffolds/ls-marketplace/plugins/kit/skills/recall.md +83 -0
- package/scaffolds/ls-marketplace/plugins/kit/{commands → skills}/show-mcp-status.md +4 -4
- package/scaffolds/ls-marketplace/plugins/kit/skills/wireframe.md +70 -0
- package/scaffolds/migrate-safety/scripts/migrate-with-backup.sh +0 -0
- package/scaffolds/recall-hook/scripts/ensure-recall.sh +0 -0
- package/scaffolds/statusline/statusline-mcp.sh +21 -9
- package/dist/beacon/types/capture/element.d.ts +0 -3
- package/dist/beacon/types/capture/element.d.ts.map +0 -1
- package/dist/beacon/types/capture/events.d.ts +0 -20
- package/dist/beacon/types/capture/events.d.ts.map +0 -1
- package/dist/beacon/types/capture/framework.d.ts +0 -3
- package/dist/beacon/types/capture/framework.d.ts.map +0 -1
- package/dist/beacon/types/capture/metadata.d.ts +0 -3
- package/dist/beacon/types/capture/metadata.d.ts.map +0 -1
- package/dist/beacon/types/capture/overlay.d.ts +0 -7
- package/dist/beacon/types/capture/overlay.d.ts.map +0 -1
- package/dist/beacon/types/capture/picker.d.ts.map +0 -1
- package/dist/beacon/types/capture/screenshot.d.ts.map +0 -1
- package/dist/beacon/types/capture/selector.d.ts.map +0 -1
- package/dist/beacon/types/monitor/dom.d.ts +0 -13
- package/dist/beacon/types/monitor/dom.d.ts.map +0 -1
- package/dist/beacon/types/monitor/index.d.ts +0 -19
- package/dist/beacon/types/monitor/index.d.ts.map +0 -1
- package/dist/beacon/types/monitor/network.d.ts +0 -12
- package/dist/beacon/types/monitor/network.d.ts.map +0 -1
- package/dist/beacon/types/monitor/transport.d.ts.map +0 -1
- package/dist/beacon/types/monitor/types.d.ts.map +0 -1
- package/dist/beacon/types/transport/submit.d.ts +0 -3
- package/dist/beacon/types/transport/submit.d.ts.map +0 -1
- package/dist/beacon/types/ui/button.d.ts +0 -2
- package/dist/beacon/types/ui/button.d.ts.map +0 -1
- package/dist/beacon/types/ui/drawer.d.ts +0 -33
- package/dist/beacon/types/ui/drawer.d.ts.map +0 -1
- package/dist/beacon/types/ui/icons.d.ts +0 -9
- package/dist/beacon/types/ui/icons.d.ts.map +0 -1
- package/dist/beacon/types/ui/monitor-panel.d.ts +0 -19
- package/dist/beacon/types/ui/monitor-panel.d.ts.map +0 -1
- package/dist/beacon/types/ui/pick-mode-overlay.d.ts.map +0 -1
- package/dist/beacon/types/ui/pin-popover.d.ts.map +0 -1
- package/dist/deck-client/assets/channel-CRdozqbp.js +0 -1
- package/dist/deck-client/assets/classDiagram-6PBFFD2Q-lIZMp57W.js +0 -1
- package/dist/deck-client/assets/classDiagram-v2-HSJHXN6E-lIZMp57W.js +0 -1
- package/dist/deck-client/assets/clone-BtWeSTyJ.js +0 -1
- package/dist/deck-client/assets/stateDiagram-v2-QKLJ7IA2-BrV78NDR.js +0 -1
- package/dist/deck-client/assets/wardley-RL74JXVD-C010F8l4.js +0 -162
- package/scaffolds/ls-marketplace/plugins/kit/commands/beacon-array.md +0 -92
- package/scaffolds/ls-marketplace/plugins/kit/commands/beacon-clear.md +0 -68
- package/scaffolds/ls-marketplace/plugins/kit/commands/beacon-pulse.md +0 -80
- package/scaffolds/ls-marketplace/plugins/kit/commands/beacon-scan.md +0 -62
- /package/dist/beacon/types/{capture → internal}/selector.d.ts +0 -0
|
@@ -317,26 +317,31 @@ var LAUNCH_KIT_TOOLS_GUIDE_STATIC_TAIL = `
|
|
|
317
317
|
Open this repo in Claude Code; on first open you'll be prompted to install
|
|
318
318
|
the "launch-secure" marketplace \u2014 accept to enable the commands above.
|
|
319
319
|
`;
|
|
320
|
-
function
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
}
|
|
320
|
+
function renderEntries(dir, kindLabel) {
|
|
321
|
+
if (!fs4.existsSync(dir)) return `
|
|
322
|
+
LS slash ${kindLabel}: (scaffold dir not bundled \u2014 this is a packaging bug)
|
|
323
|
+
`;
|
|
325
324
|
const files = fs4.readdirSync(dir).filter((f) => f.endsWith(".md")).sort();
|
|
326
|
-
if (files.length === 0) return
|
|
327
|
-
|
|
328
|
-
|
|
325
|
+
if (files.length === 0) return `
|
|
326
|
+
LS slash ${kindLabel}: (none defined)
|
|
327
|
+
`;
|
|
328
|
+
const names = files.map((file) => `/${PLUGIN_ID}:${file.replace(/\.md$/, "")}`);
|
|
329
|
+
const colWidth = Math.max(26, ...names.map((n) => n.length + 2));
|
|
330
|
+
const lines = files.map((file, i) => {
|
|
329
331
|
const text = fs4.readFileSync(path4.join(dir, file), "utf-8");
|
|
330
332
|
const fmMatch = text.match(/^---\r?\n([\s\S]*?)\r?\n---/);
|
|
331
333
|
const desc = fmMatch?.[1].match(/^description:\s*(.+)$/m)?.[1]?.trim() ?? "";
|
|
332
|
-
|
|
333
|
-
return ` ${padded} \u2014 ${desc}`;
|
|
334
|
+
return ` ${names[i].padEnd(colWidth)} \u2014 ${desc}`;
|
|
334
335
|
});
|
|
335
336
|
return `
|
|
336
|
-
LS slash
|
|
337
|
+
LS slash ${kindLabel} (run inside Claude Code in this project):
|
|
337
338
|
${lines.join("\n")}
|
|
338
339
|
`;
|
|
339
340
|
}
|
|
341
|
+
function renderLsCommandsSection() {
|
|
342
|
+
const base = path4.resolve(__dirname, "..", "..", "scaffolds", "ls-marketplace", "plugins", "kit");
|
|
343
|
+
return renderEntries(path4.join(base, "commands"), "commands") + renderEntries(path4.join(base, "skills"), "skills");
|
|
344
|
+
}
|
|
340
345
|
function getLaunchKitToolsGuide() {
|
|
341
346
|
return `${LAUNCH_KIT_TOOLS_GUIDE_STATIC_HEAD}${renderLsCommandsSection()}${LAUNCH_KIT_TOOLS_GUIDE_STATIC_TAIL}`;
|
|
342
347
|
}
|
|
@@ -41,6 +41,18 @@ function currentHeadRef(cwd) {
|
|
|
41
41
|
return "HEAD";
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
+
function isGitWorktreeTracked(path, projectRoot) {
|
|
45
|
+
try {
|
|
46
|
+
const out = (0, import_node_child_process.execFileSync)("git", ["worktree", "list", "--porcelain"], {
|
|
47
|
+
cwd: projectRoot,
|
|
48
|
+
encoding: "utf-8",
|
|
49
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
50
|
+
});
|
|
51
|
+
return out.split("\n").some((line) => line === `worktree ${path}`);
|
|
52
|
+
} catch {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
44
56
|
var import_node_child_process, import_node_fs, import_node_path, gitWorktreeAdapter;
|
|
45
57
|
var init_git_worktree = __esm({
|
|
46
58
|
"src/server/orbit/adapters/git-worktree.ts"() {
|
|
@@ -86,6 +98,9 @@ var init_git_worktree = __esm({
|
|
|
86
98
|
},
|
|
87
99
|
async remove(input) {
|
|
88
100
|
const { state, force, ctx } = input;
|
|
101
|
+
if (!isGitWorktreeTracked(state.path, ctx.projectRoot)) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
89
104
|
const args = ["worktree", "remove", state.path];
|
|
90
105
|
if (force) args.push("--force");
|
|
91
106
|
try {
|
|
@@ -1619,6 +1634,30 @@ async function create(opts) {
|
|
|
1619
1634
|
};
|
|
1620
1635
|
await registerWorktree(entry);
|
|
1621
1636
|
opts.logger.ok(`registered ${slug}`);
|
|
1637
|
+
try {
|
|
1638
|
+
opts.logger.step(`generate chart graph for worktree`);
|
|
1639
|
+
const chartEntry = (0, import_node_path7.join)(__dirname, "graph-mcp-entry.js");
|
|
1640
|
+
const result = (0, import_node_child_process8.spawnSync)(
|
|
1641
|
+
process.execPath,
|
|
1642
|
+
[chartEntry, "generate"],
|
|
1643
|
+
{
|
|
1644
|
+
cwd: worktreeState.path,
|
|
1645
|
+
stdio: "pipe",
|
|
1646
|
+
encoding: "utf-8",
|
|
1647
|
+
timeout: 6e4
|
|
1648
|
+
}
|
|
1649
|
+
);
|
|
1650
|
+
if (result.status === 0) {
|
|
1651
|
+
opts.logger.ok(`chart graph generated`);
|
|
1652
|
+
} else {
|
|
1653
|
+
const detail = (result.stderr || result.stdout || "").toString().trim().split("\n")[0]?.slice(0, 200) ?? "unknown";
|
|
1654
|
+
opts.logger.warn(
|
|
1655
|
+
`chart graph generation failed (${detail}). Re-run later with: launch-chart generate (from ${worktreeState.path})`
|
|
1656
|
+
);
|
|
1657
|
+
}
|
|
1658
|
+
} catch (e) {
|
|
1659
|
+
opts.logger.warn(`chart graph generation skipped: ${e.message}`);
|
|
1660
|
+
}
|
|
1622
1661
|
return {
|
|
1623
1662
|
slug,
|
|
1624
1663
|
branch: opts.branch,
|
|
@@ -1670,13 +1709,33 @@ async function drop(opts) {
|
|
|
1670
1709
|
if (result.backupPath) backups[ref.name] = result.backupPath;
|
|
1671
1710
|
freed[ref.name] = state.state;
|
|
1672
1711
|
}
|
|
1712
|
+
if ((0, import_node_fs10.existsSync)(entry.path)) {
|
|
1713
|
+
const blockers = findBlockingPids(entry.path);
|
|
1714
|
+
if (blockers.length > 0) {
|
|
1715
|
+
opts.logger.warn(`${blockers.length} process(es) holding files in worktree \u2014 terminating:`);
|
|
1716
|
+
for (const b of blockers) opts.logger.step(` pid ${b.pid} (${b.cmd})`);
|
|
1717
|
+
terminateProcesses(blockers.map((b) => b.pid), opts.logger);
|
|
1718
|
+
}
|
|
1719
|
+
}
|
|
1673
1720
|
const worktreeAdapter = getWorktreeAdapter(manifest.worktree.adapter);
|
|
1674
1721
|
opts.logger.step(`remove worktree via ${worktreeAdapter.id}`);
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1722
|
+
try {
|
|
1723
|
+
await worktreeAdapter.remove({
|
|
1724
|
+
state: { path: entry.path, branch: entry.branch },
|
|
1725
|
+
force: true,
|
|
1726
|
+
ctx
|
|
1727
|
+
});
|
|
1728
|
+
} catch (e) {
|
|
1729
|
+
opts.logger.warn(`worktree remove failed (continuing anyway): ${e.message}`);
|
|
1730
|
+
}
|
|
1731
|
+
if ((0, import_node_fs10.existsSync)(entry.path)) {
|
|
1732
|
+
opts.logger.step(`remove leftover dir at ${entry.path}`);
|
|
1733
|
+
try {
|
|
1734
|
+
(0, import_node_fs10.rmSync)(entry.path, { recursive: true, force: true });
|
|
1735
|
+
} catch (e) {
|
|
1736
|
+
opts.logger.warn(`leftover dir cleanup failed: ${e.message}`);
|
|
1737
|
+
}
|
|
1738
|
+
}
|
|
1680
1739
|
await deregisterWorktree(slug);
|
|
1681
1740
|
opts.logger.ok(`dropped ${slug}`);
|
|
1682
1741
|
return { slug, backups, freed };
|
|
@@ -1702,13 +1761,82 @@ function switchTo(opts) {
|
|
|
1702
1761
|
}
|
|
1703
1762
|
function doctor() {
|
|
1704
1763
|
const issues = [];
|
|
1764
|
+
const trackedByRoot = /* @__PURE__ */ new Map();
|
|
1765
|
+
const tracked = (projectRoot) => {
|
|
1766
|
+
let s = trackedByRoot.get(projectRoot);
|
|
1767
|
+
if (s) return s;
|
|
1768
|
+
s = /* @__PURE__ */ new Set();
|
|
1769
|
+
try {
|
|
1770
|
+
const out = (0, import_node_child_process8.execFileSync)("git", ["worktree", "list", "--porcelain"], {
|
|
1771
|
+
cwd: projectRoot,
|
|
1772
|
+
encoding: "utf-8",
|
|
1773
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
1774
|
+
});
|
|
1775
|
+
for (const line of out.split("\n")) {
|
|
1776
|
+
if (line.startsWith("worktree ")) s.add(line.slice("worktree ".length));
|
|
1777
|
+
}
|
|
1778
|
+
} catch {
|
|
1779
|
+
}
|
|
1780
|
+
trackedByRoot.set(projectRoot, s);
|
|
1781
|
+
return s;
|
|
1782
|
+
};
|
|
1705
1783
|
for (const w of listWorktrees()) {
|
|
1706
1784
|
if (!(0, import_node_fs10.existsSync)(w.path)) {
|
|
1707
1785
|
issues.push({ kind: "missing-worktree", slug: w.slug, detail: `path ${w.path} does not exist` });
|
|
1786
|
+
continue;
|
|
1787
|
+
}
|
|
1788
|
+
if (!tracked(w.projectRoot).has(w.path)) {
|
|
1789
|
+
issues.push({
|
|
1790
|
+
kind: "orphan-registration",
|
|
1791
|
+
slug: w.slug,
|
|
1792
|
+
detail: `${w.path} is in the orbit registry but not in \`git worktree list\` for ${w.projectRoot}. Run \`orbit drop ${w.branch}\` to reconcile.`
|
|
1793
|
+
});
|
|
1708
1794
|
}
|
|
1709
1795
|
}
|
|
1710
1796
|
return issues;
|
|
1711
1797
|
}
|
|
1798
|
+
function findBlockingPids(path) {
|
|
1799
|
+
let out;
|
|
1800
|
+
try {
|
|
1801
|
+
out = (0, import_node_child_process8.execFileSync)("lsof", ["-F", "pc", "+D", path], {
|
|
1802
|
+
encoding: "utf-8",
|
|
1803
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
1804
|
+
});
|
|
1805
|
+
} catch {
|
|
1806
|
+
return [];
|
|
1807
|
+
}
|
|
1808
|
+
const results = /* @__PURE__ */ new Map();
|
|
1809
|
+
let currentPid = 0;
|
|
1810
|
+
for (const line of out.split("\n")) {
|
|
1811
|
+
if (line.startsWith("p")) {
|
|
1812
|
+
currentPid = Number(line.slice(1));
|
|
1813
|
+
if (!Number.isFinite(currentPid) || currentPid === process.pid) currentPid = 0;
|
|
1814
|
+
} else if (line.startsWith("c") && currentPid && !results.has(currentPid)) {
|
|
1815
|
+
results.set(currentPid, line.slice(1));
|
|
1816
|
+
}
|
|
1817
|
+
}
|
|
1818
|
+
return [...results].map(([pid, cmd]) => ({ pid, cmd }));
|
|
1819
|
+
}
|
|
1820
|
+
function terminateProcesses(pids, logger) {
|
|
1821
|
+
for (const pid of pids) {
|
|
1822
|
+
try {
|
|
1823
|
+
process.kill(pid, "SIGTERM");
|
|
1824
|
+
} catch {
|
|
1825
|
+
}
|
|
1826
|
+
}
|
|
1827
|
+
const wakeUpAt = Date.now() + 750;
|
|
1828
|
+
while (Date.now() < wakeUpAt) {
|
|
1829
|
+
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 50);
|
|
1830
|
+
}
|
|
1831
|
+
for (const pid of pids) {
|
|
1832
|
+
try {
|
|
1833
|
+
process.kill(pid, 0);
|
|
1834
|
+
process.kill(pid, "SIGKILL");
|
|
1835
|
+
logger.warn(`pid ${pid} did not respond to SIGTERM \u2014 sent SIGKILL`);
|
|
1836
|
+
} catch {
|
|
1837
|
+
}
|
|
1838
|
+
}
|
|
1839
|
+
}
|
|
1712
1840
|
async function checkMergeable(opts) {
|
|
1713
1841
|
const start = Date.now();
|
|
1714
1842
|
const slug = slugify(opts.branch);
|
|
@@ -2139,7 +2267,7 @@ var init_orbit_mcp = __esm({
|
|
|
2139
2267
|
},
|
|
2140
2268
|
{
|
|
2141
2269
|
name: "orbit.drop",
|
|
2142
|
-
description: "Tear down an orbit: backup the database (default true), drop the database, remove the worktree, deregister. Returns { slug, backups, freed }.",
|
|
2270
|
+
description: "Tear down an orbit: backup the database (default true), drop the database, terminate any process holding files inside the worktree (chart/beacon MCPs, dev servers \u2014 via lsof+SIGTERM), remove the worktree, sweep any leftover on-disk dir, deregister. Idempotent: safe to retry on a partial state (e.g. git already removed the worktree but the registry still claims it). Returns { slug, backups, freed }.",
|
|
2143
2271
|
inputSchema: {
|
|
2144
2272
|
type: "object",
|
|
2145
2273
|
properties: {
|
|
@@ -2151,7 +2279,7 @@ var init_orbit_mcp = __esm({
|
|
|
2151
2279
|
},
|
|
2152
2280
|
{
|
|
2153
2281
|
name: "orbit.doctor",
|
|
2154
|
-
description: "Report inconsistencies in the registry:
|
|
2282
|
+
description: "Report inconsistencies in the registry. Detects: 'missing-worktree' (registered path doesn't exist on disk), 'orphan-registration' (path exists + registered, but git no longer tracks it \u2014 the partial-drop state). Returns an array of issues. Fix with `orbit drop <branch>` \u2014 drop is now idempotent and resolves both kinds.",
|
|
2155
2283
|
inputSchema: { type: "object", properties: {} }
|
|
2156
2284
|
},
|
|
2157
2285
|
{
|