@glrs-dev/cli 0.0.1 → 0.1.1
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/CHANGELOG.md +50 -0
- package/README.md +14 -15
- package/dist/chunk-3RG5ZIWI.js +10 -0
- package/dist/chunk-6RHN2EDH.js +93 -0
- package/dist/chunk-DEODG2LC.js +55 -0
- package/dist/chunk-FSAGM22T.js +17 -0
- package/dist/chunk-GQBZREK5.js +136 -0
- package/dist/chunk-HWMRY35D.js +139 -0
- package/dist/chunk-LMRDQ4GW.js +129 -0
- package/dist/chunk-NLPX2KOF.js +149 -0
- package/dist/chunk-P7PRH4I3.js +177 -0
- package/dist/chunk-VCN7RNLU.js +60 -0
- package/dist/chunk-VJFNIKQJ.js +120 -0
- package/dist/chunk-W37UX3U2.js +35 -0
- package/dist/chunk-YBCA3IP6.js +25 -0
- package/dist/chunk-YGNDPKIW.js +99 -0
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +89 -36
- package/dist/commands/cleanup.d.ts +19 -0
- package/dist/commands/cleanup.js +11 -0
- package/dist/commands/create.d.ts +17 -0
- package/dist/commands/create.js +12 -0
- package/dist/commands/delete.d.ts +17 -0
- package/dist/commands/delete.js +12 -0
- package/dist/commands/go.d.ts +4 -0
- package/dist/commands/go.js +11 -0
- package/dist/commands/list.d.ts +15 -0
- package/dist/commands/list.js +12 -0
- package/dist/commands/switch.d.ts +11 -0
- package/dist/commands/switch.js +12 -0
- package/dist/commands/types.d.ts +10 -0
- package/dist/commands/types.js +0 -0
- package/dist/index.d.ts +16 -19
- package/dist/index.js +4 -1
- package/dist/lib/config.d.ts +14 -0
- package/dist/lib/config.js +14 -0
- package/dist/lib/fmt.d.ts +12 -0
- package/dist/lib/fmt.js +25 -0
- package/dist/lib/git.d.ts +26 -0
- package/dist/lib/git.js +25 -0
- package/dist/lib/registry.d.ts +14 -0
- package/dist/lib/registry.js +13 -0
- package/dist/lib/select.d.ts +21 -0
- package/dist/lib/select.js +10 -0
- package/dist/lib/worktree.d.ts +35 -0
- package/dist/lib/worktree.js +17 -0
- package/dist/vendor/harness-opencode/dist/agents/prompts/agents-md-writer.md +89 -0
- package/dist/vendor/harness-opencode/dist/agents/prompts/architecture-advisor.md +46 -0
- package/dist/vendor/harness-opencode/dist/agents/prompts/build.md +93 -0
- package/dist/vendor/harness-opencode/dist/agents/prompts/code-searcher.md +54 -0
- package/dist/vendor/harness-opencode/dist/agents/prompts/docs-maintainer.md +128 -0
- package/dist/vendor/harness-opencode/dist/agents/prompts/gap-analyzer.md +44 -0
- package/dist/vendor/harness-opencode/dist/agents/prompts/lib-reader.md +39 -0
- package/dist/vendor/harness-opencode/dist/agents/prompts/pilot-builder.md +107 -0
- package/dist/vendor/harness-opencode/dist/agents/prompts/pilot-planner.md +153 -0
- package/dist/vendor/harness-opencode/dist/agents/prompts/plan-reviewer.md +49 -0
- package/dist/vendor/harness-opencode/dist/agents/prompts/plan.md +144 -0
- package/dist/vendor/harness-opencode/dist/agents/prompts/prime.md +374 -0
- package/dist/vendor/harness-opencode/dist/agents/prompts/qa-reviewer.md +68 -0
- package/dist/vendor/harness-opencode/dist/agents/prompts/qa-thorough.md +63 -0
- package/dist/vendor/harness-opencode/dist/agents/prompts/research.md +138 -0
- package/dist/vendor/harness-opencode/dist/agents/shared/index.ts +26 -0
- package/dist/vendor/harness-opencode/dist/agents/shared/workflow-mechanics.md +32 -0
- package/dist/vendor/harness-opencode/dist/bin/memory-mcp-launcher.sh +145 -0
- package/dist/vendor/harness-opencode/dist/bin/plan-check.sh +255 -0
- package/dist/vendor/harness-opencode/dist/chunk-VJUETC6A.js +205 -0
- package/dist/vendor/harness-opencode/dist/chunk-VVMP6QWS.js +731 -0
- package/dist/vendor/harness-opencode/dist/chunk-XCZ3NOXR.js +703 -0
- package/dist/vendor/harness-opencode/dist/cli.d.ts +1 -0
- package/dist/vendor/harness-opencode/dist/cli.js +5096 -0
- package/dist/vendor/harness-opencode/dist/commands/prompts/autopilot.md +96 -0
- package/dist/vendor/harness-opencode/dist/commands/prompts/costs.md +94 -0
- package/dist/vendor/harness-opencode/dist/commands/prompts/fresh.md +382 -0
- package/dist/vendor/harness-opencode/dist/commands/prompts/init-deep.md +196 -0
- package/dist/vendor/harness-opencode/dist/commands/prompts/research.md +27 -0
- package/dist/vendor/harness-opencode/dist/commands/prompts/review.md +96 -0
- package/dist/vendor/harness-opencode/dist/commands/prompts/ship.md +104 -0
- package/dist/vendor/harness-opencode/dist/index.d.ts +21 -0
- package/dist/vendor/harness-opencode/dist/index.js +2092 -0
- package/dist/vendor/harness-opencode/dist/install-4EYR56OR.js +9 -0
- package/dist/vendor/harness-opencode/dist/skills/agent-estimation/SKILL.md +159 -0
- package/dist/vendor/harness-opencode/dist/skills/paths.ts +18 -0
- package/dist/vendor/harness-opencode/dist/skills/pilot-planning/SKILL.md +49 -0
- package/dist/vendor/harness-opencode/dist/skills/pilot-planning/rules/dag-shape.md +47 -0
- package/dist/vendor/harness-opencode/dist/skills/pilot-planning/rules/decomposition.md +36 -0
- package/dist/vendor/harness-opencode/dist/skills/pilot-planning/rules/first-principles.md +29 -0
- package/dist/vendor/harness-opencode/dist/skills/pilot-planning/rules/milestones.md +57 -0
- package/dist/vendor/harness-opencode/dist/skills/pilot-planning/rules/self-review.md +46 -0
- package/dist/vendor/harness-opencode/dist/skills/pilot-planning/rules/task-context.md +47 -0
- package/dist/vendor/harness-opencode/dist/skills/pilot-planning/rules/touches-scope.md +47 -0
- package/dist/vendor/harness-opencode/dist/skills/pilot-planning/rules/verify-design.md +53 -0
- package/dist/vendor/harness-opencode/dist/skills/research/SKILL.md +350 -0
- package/dist/vendor/harness-opencode/dist/skills/research-auto/SKILL.md +283 -0
- package/dist/vendor/harness-opencode/dist/skills/research-local/SKILL.md +268 -0
- package/dist/vendor/harness-opencode/dist/skills/research-web/SKILL.md +119 -0
- package/dist/vendor/harness-opencode/dist/skills/review-plan/SKILL.md +32 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-composition-patterns/AGENTS.md +946 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-composition-patterns/README.md +60 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-composition-patterns/SKILL.md +89 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-composition-patterns/rules/architecture-avoid-boolean-props.md +100 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-composition-patterns/rules/architecture-compound-components.md +112 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-composition-patterns/rules/patterns-children-over-render-props.md +87 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-composition-patterns/rules/patterns-explicit-variants.md +100 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-composition-patterns/rules/react19-no-forwardref.md +42 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-composition-patterns/rules/state-context-interface.md +191 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-composition-patterns/rules/state-decouple-implementation.md +113 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-composition-patterns/rules/state-lift-state.md +125 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/AGENTS.md +2975 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/README.md +123 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/SKILL.md +137 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/advanced-init-once.md +42 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/advanced-use-latest.md +39 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/async-api-routes.md +38 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/async-defer-await.md +80 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/async-dependencies.md +51 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/async-parallel.md +28 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +59 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/bundle-conditional.md +31 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/bundle-preload.md +50 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/client-event-listeners.md +74 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +71 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +48 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/client-swr-dedup.md +56 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +107 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/js-cache-function-results.md +80 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/js-cache-property-access.md +28 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/js-cache-storage.md +70 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/js-combine-iterations.md +32 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/js-early-exit.md +50 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/js-index-maps.md +37 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/js-length-check-first.md +49 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/js-min-max-loop.md +82 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rendering-activity.md +26 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md +75 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rerender-dependencies.md +45 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rerender-derived-state.md +29 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rerender-memo.md +44 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rerender-transitions.md +40 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/server-auth-actions.md +96 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/server-cache-lru.md +41 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/server-cache-react.md +76 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/server-dedup-props.md +65 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/server-hoist-static-io.md +142 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +83 -0
- package/dist/vendor/harness-opencode/dist/skills/vercel-react-best-practices/rules/server-serialization.md +38 -0
- package/dist/vendor/harness-opencode/dist/skills/web-design-guidelines/SKILL.md +39 -0
- package/dist/vendor/harness-opencode/package.json +11 -0
- package/package.json +20 -15
- package/LICENSE +0 -21
- package/dist/chunk-TU23AE2F.js +0 -69
package/dist/cli.js
CHANGED
|
@@ -1,32 +1,79 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
2
|
import {
|
|
3
3
|
HELP_TEXT,
|
|
4
4
|
SUBCOMMANDS,
|
|
5
|
+
WORKTREE_HELP_TEXT,
|
|
5
6
|
resolveSubcommand
|
|
6
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-YGNDPKIW.js";
|
|
8
|
+
import {
|
|
9
|
+
cleanup
|
|
10
|
+
} from "./chunk-HWMRY35D.js";
|
|
11
|
+
import {
|
|
12
|
+
create
|
|
13
|
+
} from "./chunk-GQBZREK5.js";
|
|
14
|
+
import "./chunk-VJFNIKQJ.js";
|
|
15
|
+
import {
|
|
16
|
+
del
|
|
17
|
+
} from "./chunk-NLPX2KOF.js";
|
|
18
|
+
import "./chunk-W37UX3U2.js";
|
|
19
|
+
import {
|
|
20
|
+
list
|
|
21
|
+
} from "./chunk-6RHN2EDH.js";
|
|
22
|
+
import {
|
|
23
|
+
switchCmd
|
|
24
|
+
} from "./chunk-FSAGM22T.js";
|
|
25
|
+
import {
|
|
26
|
+
go
|
|
27
|
+
} from "./chunk-DEODG2LC.js";
|
|
28
|
+
import "./chunk-P7PRH4I3.js";
|
|
29
|
+
import "./chunk-LMRDQ4GW.js";
|
|
30
|
+
import "./chunk-VCN7RNLU.js";
|
|
31
|
+
import "./chunk-YBCA3IP6.js";
|
|
32
|
+
import "./chunk-3RG5ZIWI.js";
|
|
7
33
|
|
|
8
34
|
// src/cli.ts
|
|
9
35
|
import { spawn } from "child_process";
|
|
36
|
+
import * as path from "path";
|
|
37
|
+
import { subcommands, run, binary } from "cmd-ts";
|
|
10
38
|
var args = process.argv.slice(2);
|
|
11
39
|
if (args.length === 0 || args[0] === "--help" || args[0] === "-h" || args[0] === "help") {
|
|
12
40
|
process.stdout.write(HELP_TEXT);
|
|
13
41
|
process.exit(0);
|
|
14
42
|
}
|
|
15
43
|
if (args[0] === "--version" || args[0] === "-V") {
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const pkgPath = resolve(
|
|
20
|
-
dirname(fileURLToPath(import.meta.url)),
|
|
21
|
-
"..",
|
|
22
|
-
"package.json"
|
|
23
|
-
);
|
|
24
|
-
const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
|
|
44
|
+
const __dirname = path.dirname(import.meta.url.replace("file://", ""));
|
|
45
|
+
const pkgPath = path.join(__dirname, "..", "package.json");
|
|
46
|
+
const pkg = await Bun.file(pkgPath).json();
|
|
25
47
|
process.stdout.write(`glrs ${pkg.version}
|
|
26
48
|
`);
|
|
27
49
|
process.exit(0);
|
|
28
50
|
}
|
|
29
51
|
var sub = args[0];
|
|
52
|
+
if (sub === "wt" || sub === "worktree") {
|
|
53
|
+
const wtArgs = args.slice(1);
|
|
54
|
+
if (wtArgs.length === 0 || wtArgs[0] === "--help" || wtArgs[0] === "-h") {
|
|
55
|
+
if (wtArgs.length === 0 && process.stdin.isTTY) {
|
|
56
|
+
await go();
|
|
57
|
+
process.exit(0);
|
|
58
|
+
}
|
|
59
|
+
process.stdout.write(WORKTREE_HELP_TEXT);
|
|
60
|
+
process.exit(0);
|
|
61
|
+
}
|
|
62
|
+
const wt = subcommands({
|
|
63
|
+
name: "wt",
|
|
64
|
+
description: "Worktree management \u2014 create, list, and clean up git worktrees",
|
|
65
|
+
cmds: {
|
|
66
|
+
new: create,
|
|
67
|
+
list,
|
|
68
|
+
switch: switchCmd,
|
|
69
|
+
delete: del,
|
|
70
|
+
cleanup
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
const wtBinary = binary(wt);
|
|
74
|
+
await run(wtBinary, ["wt", ...wtArgs]);
|
|
75
|
+
process.exit(0);
|
|
76
|
+
}
|
|
30
77
|
if (!SUBCOMMANDS.includes(sub)) {
|
|
31
78
|
process.stderr.write(
|
|
32
79
|
`[glrs] Unknown subcommand '${sub}'. Run 'glrs --help' for usage.
|
|
@@ -34,31 +81,37 @@ if (!SUBCOMMANDS.includes(sub)) {
|
|
|
34
81
|
);
|
|
35
82
|
process.exit(2);
|
|
36
83
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
84
|
+
if (sub === "oc") {
|
|
85
|
+
let resolved;
|
|
86
|
+
try {
|
|
87
|
+
resolved = resolveSubcommand(sub);
|
|
88
|
+
} catch (err) {
|
|
89
|
+
process.stderr.write(`${err.message}
|
|
90
|
+
`);
|
|
91
|
+
process.exit(1);
|
|
92
|
+
}
|
|
93
|
+
const forward = args.slice(1);
|
|
94
|
+
const spawnArgs = [...resolved.preArgs, ...forward];
|
|
95
|
+
const spawnEnv = { ...process.env, GLRS_CLI_DISPATCHED: "1" };
|
|
96
|
+
const child = spawn(resolved.executable, spawnArgs, {
|
|
97
|
+
stdio: "inherit",
|
|
98
|
+
windowsHide: false,
|
|
99
|
+
env: spawnEnv
|
|
100
|
+
});
|
|
101
|
+
child.on("error", (err) => {
|
|
102
|
+
process.stderr.write(`[glrs] Failed to spawn '${sub}': ${err.message}
|
|
103
|
+
`);
|
|
104
|
+
process.exit(127);
|
|
105
|
+
});
|
|
106
|
+
child.on("exit", (code, signal) => {
|
|
107
|
+
if (signal) {
|
|
108
|
+
process.kill(process.pid, signal);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
process.exit(code ?? 0);
|
|
112
|
+
});
|
|
113
|
+
} else {
|
|
114
|
+
process.stderr.write(`[glrs] Internal error: unhandled subcommand '${sub}'
|
|
42
115
|
`);
|
|
43
116
|
process.exit(1);
|
|
44
117
|
}
|
|
45
|
-
var forward = args.slice(1);
|
|
46
|
-
var spawnArgs = [...resolved.preArgs, ...forward];
|
|
47
|
-
var spawnEnv = { ...process.env, GLRS_CLI_DISPATCHED: "1" };
|
|
48
|
-
var child = spawn(resolved.executable, spawnArgs, {
|
|
49
|
-
stdio: "inherit",
|
|
50
|
-
windowsHide: false,
|
|
51
|
-
env: spawnEnv
|
|
52
|
-
});
|
|
53
|
-
child.on("error", (err) => {
|
|
54
|
-
process.stderr.write(`[glrs] Failed to spawn '${sub}': ${err.message}
|
|
55
|
-
`);
|
|
56
|
-
process.exit(127);
|
|
57
|
-
});
|
|
58
|
-
child.on("exit", (code, signal) => {
|
|
59
|
-
if (signal) {
|
|
60
|
-
process.kill(process.pid, signal);
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
process.exit(code ?? 0);
|
|
64
|
-
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as cmd_ts_dist_cjs_runner_js from 'cmd-ts/dist/cjs/runner.js';
|
|
2
|
+
import * as cmd_ts_dist_cjs_helpdoc_js from 'cmd-ts/dist/cjs/helpdoc.js';
|
|
3
|
+
import * as cmd_ts_dist_cjs_argparser_js from 'cmd-ts/dist/cjs/argparser.js';
|
|
4
|
+
|
|
5
|
+
declare const cleanup: Partial<cmd_ts_dist_cjs_argparser_js.Register> & {
|
|
6
|
+
parse(context: cmd_ts_dist_cjs_argparser_js.ParseContext): Promise<cmd_ts_dist_cjs_argparser_js.ParsingResult<{
|
|
7
|
+
base: string | undefined;
|
|
8
|
+
dryRun: boolean;
|
|
9
|
+
yes: boolean;
|
|
10
|
+
}>>;
|
|
11
|
+
} & cmd_ts_dist_cjs_helpdoc_js.PrintHelp & cmd_ts_dist_cjs_helpdoc_js.ProvidesHelp & cmd_ts_dist_cjs_helpdoc_js.Named & Partial<cmd_ts_dist_cjs_helpdoc_js.Versioned> & cmd_ts_dist_cjs_argparser_js.Register & cmd_ts_dist_cjs_runner_js.Handling<{
|
|
12
|
+
base: string | undefined;
|
|
13
|
+
dryRun: boolean;
|
|
14
|
+
yes: boolean;
|
|
15
|
+
}, Promise<void>> & {
|
|
16
|
+
run(context: cmd_ts_dist_cjs_argparser_js.ParseContext): Promise<cmd_ts_dist_cjs_argparser_js.ParsingResult<Promise<void>>>;
|
|
17
|
+
} & Partial<cmd_ts_dist_cjs_helpdoc_js.Versioned & cmd_ts_dist_cjs_helpdoc_js.Descriptive & cmd_ts_dist_cjs_helpdoc_js.Aliased>;
|
|
18
|
+
|
|
19
|
+
export { cleanup };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as cmd_ts_dist_cjs_runner_js from 'cmd-ts/dist/cjs/runner.js';
|
|
2
|
+
import * as cmd_ts_dist_cjs_helpdoc_js from 'cmd-ts/dist/cjs/helpdoc.js';
|
|
3
|
+
import * as cmd_ts_dist_cjs_argparser_js from 'cmd-ts/dist/cjs/argparser.js';
|
|
4
|
+
|
|
5
|
+
declare const create: Partial<cmd_ts_dist_cjs_argparser_js.Register> & {
|
|
6
|
+
parse(context: cmd_ts_dist_cjs_argparser_js.ParseContext): Promise<cmd_ts_dist_cjs_argparser_js.ParsingResult<{
|
|
7
|
+
repo: string | undefined;
|
|
8
|
+
from: string | undefined;
|
|
9
|
+
}>>;
|
|
10
|
+
} & cmd_ts_dist_cjs_helpdoc_js.PrintHelp & cmd_ts_dist_cjs_helpdoc_js.ProvidesHelp & cmd_ts_dist_cjs_helpdoc_js.Named & Partial<cmd_ts_dist_cjs_helpdoc_js.Versioned> & cmd_ts_dist_cjs_argparser_js.Register & cmd_ts_dist_cjs_runner_js.Handling<{
|
|
11
|
+
repo: string | undefined;
|
|
12
|
+
from: string | undefined;
|
|
13
|
+
}, void> & {
|
|
14
|
+
run(context: cmd_ts_dist_cjs_argparser_js.ParseContext): Promise<cmd_ts_dist_cjs_argparser_js.ParsingResult<void>>;
|
|
15
|
+
} & Partial<cmd_ts_dist_cjs_helpdoc_js.Versioned & cmd_ts_dist_cjs_helpdoc_js.Descriptive & cmd_ts_dist_cjs_helpdoc_js.Aliased>;
|
|
16
|
+
|
|
17
|
+
export { create };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
create
|
|
3
|
+
} from "../chunk-GQBZREK5.js";
|
|
4
|
+
import "../chunk-VJFNIKQJ.js";
|
|
5
|
+
import "../chunk-W37UX3U2.js";
|
|
6
|
+
import "../chunk-LMRDQ4GW.js";
|
|
7
|
+
import "../chunk-VCN7RNLU.js";
|
|
8
|
+
import "../chunk-YBCA3IP6.js";
|
|
9
|
+
import "../chunk-3RG5ZIWI.js";
|
|
10
|
+
export {
|
|
11
|
+
create
|
|
12
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as cmd_ts_dist_cjs_runner_js from 'cmd-ts/dist/cjs/runner.js';
|
|
2
|
+
import * as cmd_ts_dist_cjs_helpdoc_js from 'cmd-ts/dist/cjs/helpdoc.js';
|
|
3
|
+
import * as cmd_ts_dist_cjs_argparser_js from 'cmd-ts/dist/cjs/argparser.js';
|
|
4
|
+
|
|
5
|
+
declare const del: Partial<cmd_ts_dist_cjs_argparser_js.Register> & {
|
|
6
|
+
parse(context: cmd_ts_dist_cjs_argparser_js.ParseContext): Promise<cmd_ts_dist_cjs_argparser_js.ParsingResult<{
|
|
7
|
+
name: string | undefined;
|
|
8
|
+
force: boolean;
|
|
9
|
+
}>>;
|
|
10
|
+
} & cmd_ts_dist_cjs_helpdoc_js.PrintHelp & cmd_ts_dist_cjs_helpdoc_js.ProvidesHelp & cmd_ts_dist_cjs_helpdoc_js.Named & Partial<cmd_ts_dist_cjs_helpdoc_js.Versioned> & cmd_ts_dist_cjs_argparser_js.Register & cmd_ts_dist_cjs_runner_js.Handling<{
|
|
11
|
+
name: string | undefined;
|
|
12
|
+
force: boolean;
|
|
13
|
+
}, Promise<void>> & {
|
|
14
|
+
run(context: cmd_ts_dist_cjs_argparser_js.ParseContext): Promise<cmd_ts_dist_cjs_argparser_js.ParsingResult<Promise<void>>>;
|
|
15
|
+
} & Partial<cmd_ts_dist_cjs_helpdoc_js.Versioned & cmd_ts_dist_cjs_helpdoc_js.Descriptive & cmd_ts_dist_cjs_helpdoc_js.Aliased>;
|
|
16
|
+
|
|
17
|
+
export { del };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
del
|
|
3
|
+
} from "../chunk-NLPX2KOF.js";
|
|
4
|
+
import "../chunk-W37UX3U2.js";
|
|
5
|
+
import "../chunk-P7PRH4I3.js";
|
|
6
|
+
import "../chunk-LMRDQ4GW.js";
|
|
7
|
+
import "../chunk-VCN7RNLU.js";
|
|
8
|
+
import "../chunk-YBCA3IP6.js";
|
|
9
|
+
import "../chunk-3RG5ZIWI.js";
|
|
10
|
+
export {
|
|
11
|
+
del
|
|
12
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as cmd_ts_dist_cjs_runner_js from 'cmd-ts/dist/cjs/runner.js';
|
|
2
|
+
import * as cmd_ts_dist_cjs_helpdoc_js from 'cmd-ts/dist/cjs/helpdoc.js';
|
|
3
|
+
import * as cmd_ts_dist_cjs_argparser_js from 'cmd-ts/dist/cjs/argparser.js';
|
|
4
|
+
|
|
5
|
+
declare const list: Partial<cmd_ts_dist_cjs_argparser_js.Register> & {
|
|
6
|
+
parse(context: cmd_ts_dist_cjs_argparser_js.ParseContext): Promise<cmd_ts_dist_cjs_argparser_js.ParsingResult<{
|
|
7
|
+
interactive: boolean;
|
|
8
|
+
}>>;
|
|
9
|
+
} & cmd_ts_dist_cjs_helpdoc_js.PrintHelp & cmd_ts_dist_cjs_helpdoc_js.ProvidesHelp & cmd_ts_dist_cjs_helpdoc_js.Named & Partial<cmd_ts_dist_cjs_helpdoc_js.Versioned> & cmd_ts_dist_cjs_argparser_js.Register & cmd_ts_dist_cjs_runner_js.Handling<{
|
|
10
|
+
interactive: boolean;
|
|
11
|
+
}, Promise<void>> & {
|
|
12
|
+
run(context: cmd_ts_dist_cjs_argparser_js.ParseContext): Promise<cmd_ts_dist_cjs_argparser_js.ParsingResult<Promise<void>>>;
|
|
13
|
+
} & Partial<cmd_ts_dist_cjs_helpdoc_js.Versioned & cmd_ts_dist_cjs_helpdoc_js.Descriptive & cmd_ts_dist_cjs_helpdoc_js.Aliased>;
|
|
14
|
+
|
|
15
|
+
export { list };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
list
|
|
3
|
+
} from "../chunk-6RHN2EDH.js";
|
|
4
|
+
import "../chunk-DEODG2LC.js";
|
|
5
|
+
import "../chunk-P7PRH4I3.js";
|
|
6
|
+
import "../chunk-LMRDQ4GW.js";
|
|
7
|
+
import "../chunk-VCN7RNLU.js";
|
|
8
|
+
import "../chunk-YBCA3IP6.js";
|
|
9
|
+
import "../chunk-3RG5ZIWI.js";
|
|
10
|
+
export {
|
|
11
|
+
list
|
|
12
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as cmd_ts_dist_cjs_runner_js from 'cmd-ts/dist/cjs/runner.js';
|
|
2
|
+
import * as cmd_ts_dist_cjs_helpdoc_js from 'cmd-ts/dist/cjs/helpdoc.js';
|
|
3
|
+
import * as cmd_ts_dist_cjs_argparser_js from 'cmd-ts/dist/cjs/argparser.js';
|
|
4
|
+
|
|
5
|
+
declare const switchCmd: Partial<cmd_ts_dist_cjs_argparser_js.Register> & {
|
|
6
|
+
parse(context: cmd_ts_dist_cjs_argparser_js.ParseContext): Promise<cmd_ts_dist_cjs_argparser_js.ParsingResult<{}>>;
|
|
7
|
+
} & cmd_ts_dist_cjs_helpdoc_js.PrintHelp & cmd_ts_dist_cjs_helpdoc_js.ProvidesHelp & cmd_ts_dist_cjs_helpdoc_js.Named & Partial<cmd_ts_dist_cjs_helpdoc_js.Versioned> & cmd_ts_dist_cjs_argparser_js.Register & cmd_ts_dist_cjs_runner_js.Handling<{}, Promise<void>> & {
|
|
8
|
+
run(context: cmd_ts_dist_cjs_argparser_js.ParseContext): Promise<cmd_ts_dist_cjs_argparser_js.ParsingResult<Promise<void>>>;
|
|
9
|
+
} & Partial<cmd_ts_dist_cjs_helpdoc_js.Versioned & cmd_ts_dist_cjs_helpdoc_js.Descriptive & cmd_ts_dist_cjs_helpdoc_js.Aliased>;
|
|
10
|
+
|
|
11
|
+
export { switchCmd };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
switchCmd
|
|
3
|
+
} from "../chunk-FSAGM22T.js";
|
|
4
|
+
import "../chunk-DEODG2LC.js";
|
|
5
|
+
import "../chunk-P7PRH4I3.js";
|
|
6
|
+
import "../chunk-LMRDQ4GW.js";
|
|
7
|
+
import "../chunk-VCN7RNLU.js";
|
|
8
|
+
import "../chunk-YBCA3IP6.js";
|
|
9
|
+
import "../chunk-3RG5ZIWI.js";
|
|
10
|
+
export {
|
|
11
|
+
switchCmd
|
|
12
|
+
};
|
|
File without changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,33 +1,30 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @glrs-dev/cli — unified
|
|
2
|
+
* @glrs-dev/cli — unified CLI for the glrs ecosystem.
|
|
3
3
|
*
|
|
4
|
-
* Provides a single `glrs` binary with
|
|
5
|
-
* dispatches to the underlying tool:
|
|
4
|
+
* Provides a single `glrs` binary with subcommands:
|
|
6
5
|
*
|
|
7
|
-
* glrs oc <args> → harness-opencode
|
|
8
|
-
* glrs
|
|
9
|
-
* glrs assume <args> → gs-assume <args>
|
|
6
|
+
* glrs oc <args> → harness-opencode (vendored)
|
|
7
|
+
* glrs wt <args> → worktree management commands
|
|
10
8
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
9
|
+
* The harness-opencode code is VENDORED into this package's
|
|
10
|
+
* dist/vendor/harness-opencode/ at build time — users install one
|
|
11
|
+
* package (@glrs-dev/cli) and get both surfaces.
|
|
14
12
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* TS shim middle-layer — one fewer process startup and zero
|
|
20
|
-
* double-node-startup latency for interactive credential lookups.
|
|
13
|
+
* Runtime: Bun. The CLI spawns harness-opencode with `bun` explicitly rather
|
|
14
|
+
* than `process.execPath`, because harness-opencode uses bun-native APIs
|
|
15
|
+
* (`bun:sqlite`) that Node cannot load. If `bun` isn't on PATH, dispatch
|
|
16
|
+
* fails with a friendly install hint.
|
|
21
17
|
*/
|
|
22
|
-
type Subcommand = "oc" | "
|
|
18
|
+
type Subcommand = "oc" | "wt";
|
|
23
19
|
interface ResolvedBin {
|
|
24
|
-
/** The executable to invoke
|
|
20
|
+
/** The executable to invoke. For Bun-based bins, this is always "bun". */
|
|
25
21
|
executable: string;
|
|
26
22
|
/** Arguments to prepend before user-supplied argv (e.g. the JS file path). */
|
|
27
23
|
preArgs: string[];
|
|
28
24
|
}
|
|
29
25
|
declare function resolveSubcommand(sub: Subcommand): ResolvedBin;
|
|
30
26
|
declare const SUBCOMMANDS: Subcommand[];
|
|
31
|
-
declare const HELP_TEXT = "glrs \u2014 unified CLI for the @glrs-dev ecosystem\n\nUSAGE\n glrs <subcommand> [args...]\n\nSUBCOMMANDS\n oc
|
|
27
|
+
declare const HELP_TEXT = "glrs \u2014 unified CLI for the @glrs-dev ecosystem\n\nUSAGE\n glrs <subcommand> [args...]\n\nSUBCOMMANDS\n oc OpenCode agent harness (install, pilot, etc.)\n wt Worktree management (create, list, switch, delete, cleanup)\n\nRun 'glrs <subcommand> --help' for per-command help.\n\nEXAMPLES\n glrs oc install\n glrs wt new\n glrs wt list\n glrs wt switch\n\nREQUIREMENTS\n Bun >= 1.2.0 on PATH (install: https://bun.sh)\n\nDOCS https://glrs.dev\nISSUES https://github.com/iceglober/glrs/issues\n";
|
|
28
|
+
declare const WORKTREE_HELP_TEXT = "glrs wt \u2014 worktree management\n\nUSAGE\n glrs wt <command> [args...]\n\nCOMMANDS\n new Create a new worktree (auto-named from origin/default)\n list, ls List all worktrees across repos\n switch, sw Interactively select and switch to a worktree\n delete, rm Remove worktrees (interactive or by name)\n cleanup Delete merged/stale worktrees\n\nEXAMPLES\n glrs wt new # Create worktree in current repo\n glrs wt new myrepo # Create worktree for named repo\n glrs wt list # Show all worktrees\n glrs wt list -i # Interactive picker\n glrs wt switch # Interactive switcher\n glrs wt delete my-branch # Delete specific worktree\n glrs wt cleanup # Clean up merged worktrees\n\nWorktrees are stored in ~/.glorious/worktrees/<repo>/<name>/\n";
|
|
32
29
|
|
|
33
|
-
export { HELP_TEXT, type ResolvedBin, SUBCOMMANDS, type Subcommand, resolveSubcommand };
|
|
30
|
+
export { HELP_TEXT, type ResolvedBin, SUBCOMMANDS, type Subcommand, WORKTREE_HELP_TEXT, resolveSubcommand };
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
HELP_TEXT,
|
|
3
3
|
SUBCOMMANDS,
|
|
4
|
+
WORKTREE_HELP_TEXT,
|
|
4
5
|
resolveSubcommand
|
|
5
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YGNDPKIW.js";
|
|
7
|
+
import "./chunk-3RG5ZIWI.js";
|
|
6
8
|
export {
|
|
7
9
|
HELP_TEXT,
|
|
8
10
|
SUBCOMMANDS,
|
|
11
|
+
WORKTREE_HELP_TEXT,
|
|
9
12
|
resolveSubcommand
|
|
10
13
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare function isProtected(branch: string): boolean;
|
|
2
|
+
/** Repo name derived from the git root directory. */
|
|
3
|
+
declare function repoName(): string;
|
|
4
|
+
/** Root directory for all worktrees of a given repo. */
|
|
5
|
+
declare function worktreesRoot(repo: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* Resolve where a worktree should live.
|
|
8
|
+
*
|
|
9
|
+
* Default: ~/.glorious/worktrees/<repo>/<name>
|
|
10
|
+
* If GLORIOUS_DIR is set: $GLORIOUS_DIR/<repo>/<name>
|
|
11
|
+
*/
|
|
12
|
+
declare function worktreePath(name: string, repo?: string): string;
|
|
13
|
+
|
|
14
|
+
export { isProtected, repoName, worktreePath, worktreesRoot };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare const bold: (s: string) => string;
|
|
2
|
+
declare const dim: (s: string) => string;
|
|
3
|
+
declare const red: (s: string) => string;
|
|
4
|
+
declare const green: (s: string) => string;
|
|
5
|
+
declare const yellow: (s: string) => string;
|
|
6
|
+
declare const cyan: (s: string) => string;
|
|
7
|
+
declare const ok: (msg: string) => void;
|
|
8
|
+
declare const okErr: (msg: string) => void;
|
|
9
|
+
declare const info: (msg: string) => void;
|
|
10
|
+
declare const warn: (msg: string) => void;
|
|
11
|
+
|
|
12
|
+
export { bold, cyan, dim, green, info, ok, okErr, red, warn, yellow };
|
package/dist/lib/fmt.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
bold,
|
|
3
|
+
cyan,
|
|
4
|
+
dim,
|
|
5
|
+
green,
|
|
6
|
+
info,
|
|
7
|
+
ok,
|
|
8
|
+
okErr,
|
|
9
|
+
red,
|
|
10
|
+
warn,
|
|
11
|
+
yellow
|
|
12
|
+
} from "../chunk-YBCA3IP6.js";
|
|
13
|
+
import "../chunk-3RG5ZIWI.js";
|
|
14
|
+
export {
|
|
15
|
+
bold,
|
|
16
|
+
cyan,
|
|
17
|
+
dim,
|
|
18
|
+
green,
|
|
19
|
+
info,
|
|
20
|
+
ok,
|
|
21
|
+
okErr,
|
|
22
|
+
red,
|
|
23
|
+
warn,
|
|
24
|
+
yellow
|
|
25
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Run a git command and return trimmed stdout. Throws on failure. */
|
|
2
|
+
declare function git(...args: string[]): string;
|
|
3
|
+
/** Run a git command, returning null on failure instead of throwing. */
|
|
4
|
+
declare function gitSafe(...args: string[]): string | null;
|
|
5
|
+
/** Run a git command inside a specific directory. */
|
|
6
|
+
declare function gitIn(cwd: string, ...args: string[]): string;
|
|
7
|
+
declare function gitInSafe(cwd: string, ...args: string[]): string | null;
|
|
8
|
+
/** Spawn an interactive shell in a directory. Returns when the shell exits. */
|
|
9
|
+
declare function spawnShell(cwd: string): void;
|
|
10
|
+
/** Get the root of the main worktree (resolves through linked worktrees). */
|
|
11
|
+
declare function gitRoot(): string;
|
|
12
|
+
/** Detect the default branch (main/master) for the current repo. */
|
|
13
|
+
declare function defaultBranch(): string;
|
|
14
|
+
/** Detect the default branch (main/master) for a specific repo path. */
|
|
15
|
+
declare function defaultBranchIn(repoPath: string): string;
|
|
16
|
+
interface WorktreeEntry {
|
|
17
|
+
path: string;
|
|
18
|
+
commit: string;
|
|
19
|
+
branch: string | null;
|
|
20
|
+
}
|
|
21
|
+
/** Current checked-out branch in a worktree, or null if detached/unavailable. */
|
|
22
|
+
declare function currentBranchIn(wtPath: string): string | null;
|
|
23
|
+
/** Parse `git worktree list --porcelain` output into structured entries. */
|
|
24
|
+
declare function listWorktrees(): WorktreeEntry[];
|
|
25
|
+
|
|
26
|
+
export { type WorktreeEntry, currentBranchIn, defaultBranch, defaultBranchIn, git, gitIn, gitInSafe, gitRoot, gitSafe, listWorktrees, spawnShell };
|
package/dist/lib/git.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
currentBranchIn,
|
|
3
|
+
defaultBranch,
|
|
4
|
+
defaultBranchIn,
|
|
5
|
+
git,
|
|
6
|
+
gitIn,
|
|
7
|
+
gitInSafe,
|
|
8
|
+
gitRoot,
|
|
9
|
+
gitSafe,
|
|
10
|
+
listWorktrees,
|
|
11
|
+
spawnShell
|
|
12
|
+
} from "../chunk-LMRDQ4GW.js";
|
|
13
|
+
import "../chunk-3RG5ZIWI.js";
|
|
14
|
+
export {
|
|
15
|
+
currentBranchIn,
|
|
16
|
+
defaultBranch,
|
|
17
|
+
defaultBranchIn,
|
|
18
|
+
git,
|
|
19
|
+
gitIn,
|
|
20
|
+
gitInSafe,
|
|
21
|
+
gitRoot,
|
|
22
|
+
gitSafe,
|
|
23
|
+
listWorktrees,
|
|
24
|
+
spawnShell
|
|
25
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface RegistryEntry {
|
|
2
|
+
repo: string;
|
|
3
|
+
repoPath: string;
|
|
4
|
+
wtPath: string;
|
|
5
|
+
branch: string;
|
|
6
|
+
createdAt: string;
|
|
7
|
+
}
|
|
8
|
+
/** Load registry, pruning entries whose worktree paths no longer exist. */
|
|
9
|
+
declare function loadRegistry(): RegistryEntry[];
|
|
10
|
+
declare function saveRegistry(entries: RegistryEntry[]): void;
|
|
11
|
+
declare function registerWorktree(entry: RegistryEntry): void;
|
|
12
|
+
declare function unregisterWorktree(wtPath: string): void;
|
|
13
|
+
|
|
14
|
+
export { type RegistryEntry, loadRegistry, registerWorktree, saveRegistry, unregisterWorktree };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
interface Choice<T> {
|
|
2
|
+
label: string;
|
|
3
|
+
value: T;
|
|
4
|
+
hint?: string;
|
|
5
|
+
}
|
|
6
|
+
interface Group<T> {
|
|
7
|
+
title: string;
|
|
8
|
+
choices: Choice<T>[];
|
|
9
|
+
}
|
|
10
|
+
/** Interactive single-select picker with groups. Returns null on cancel. */
|
|
11
|
+
declare function select<T>(opts: {
|
|
12
|
+
message: string;
|
|
13
|
+
groups: Group<T>[];
|
|
14
|
+
}): Promise<T | null>;
|
|
15
|
+
/** Interactive multi-select picker with groups. Returns empty array on cancel. */
|
|
16
|
+
declare function multiSelect<T>(opts: {
|
|
17
|
+
message: string;
|
|
18
|
+
groups: Group<T>[];
|
|
19
|
+
}): Promise<T[]>;
|
|
20
|
+
|
|
21
|
+
export { type Choice, type Group, multiSelect, select };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
interface CreateOptions {
|
|
2
|
+
/** Branch/worktree slug. Auto-generated if omitted. */
|
|
3
|
+
name?: string;
|
|
4
|
+
/** Base branch to fork from. Defaults to the remote default branch. */
|
|
5
|
+
from?: string;
|
|
6
|
+
/** Absolute path to the source repo (for creating from outside one). */
|
|
7
|
+
repoPath?: string;
|
|
8
|
+
/** Override the repo name used for storage. Defaults to basename(repoPath). */
|
|
9
|
+
repo?: string;
|
|
10
|
+
}
|
|
11
|
+
interface CreateResult {
|
|
12
|
+
wtPath: string;
|
|
13
|
+
name: string;
|
|
14
|
+
base: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Generate a short, ordered slug: wt-YYMMDD-HHMMSS-xxx
|
|
18
|
+
* The trailing 3-char suffix prevents collisions when invoked
|
|
19
|
+
* in rapid succession (e.g. scripted).
|
|
20
|
+
*/
|
|
21
|
+
declare function autoName(now?: Date, suffix?: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Refuse to create a worktree from a linked worktree. Nested worktrees break
|
|
24
|
+
* path resolution (storage lands under `<worktree>/<name>/` instead of
|
|
25
|
+
* `<repo>/<name>/`) and leave stale branch metadata attached to the wrong
|
|
26
|
+
* clone. `git rev-parse --git-common-dir` returns an absolute path outside
|
|
27
|
+
* `srcRepo` whenever srcRepo is itself a linked worktree.
|
|
28
|
+
*/
|
|
29
|
+
declare function assertPrimaryClone(srcRepo: string): void;
|
|
30
|
+
/** Create a worktree with a new branch. Does NOT spawn a shell. */
|
|
31
|
+
declare function createWorktree(opts?: CreateOptions): CreateResult;
|
|
32
|
+
/** Create a worktree or return the existing path if it already exists. */
|
|
33
|
+
declare function ensureWorktree(name: string, from?: string): string;
|
|
34
|
+
|
|
35
|
+
export { type CreateOptions, type CreateResult, assertPrimaryClone, autoName, createWorktree, ensureWorktree };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
assertPrimaryClone,
|
|
3
|
+
autoName,
|
|
4
|
+
createWorktree,
|
|
5
|
+
ensureWorktree
|
|
6
|
+
} from "../chunk-VJFNIKQJ.js";
|
|
7
|
+
import "../chunk-W37UX3U2.js";
|
|
8
|
+
import "../chunk-LMRDQ4GW.js";
|
|
9
|
+
import "../chunk-VCN7RNLU.js";
|
|
10
|
+
import "../chunk-YBCA3IP6.js";
|
|
11
|
+
import "../chunk-3RG5ZIWI.js";
|
|
12
|
+
export {
|
|
13
|
+
assertPrimaryClone,
|
|
14
|
+
autoName,
|
|
15
|
+
createWorktree,
|
|
16
|
+
ensureWorktree
|
|
17
|
+
};
|