@clipboard-health/groundcrew 2.3.6 → 3.0.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/README.md +124 -18
- package/clearance-allow-hosts +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +19 -14
- package/dist/commands/doctor.d.ts +2 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +9 -4
- package/dist/commands/ticketCheck.d.ts +22 -0
- package/dist/commands/ticketCheck.d.ts.map +1 -0
- package/dist/commands/ticketCheck.js +23 -0
- package/dist/commands/ticketDoctor.d.ts +168 -20
- package/dist/commands/ticketDoctor.d.ts.map +1 -1
- package/dist/commands/ticketDoctor.js +766 -133
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/lib/config.d.ts +2 -14
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +0 -13
- package/dist/lib/launchCommand.d.ts +5 -0
- package/dist/lib/launchCommand.d.ts.map +1 -1
- package/dist/lib/launchCommand.js +8 -3
- package/dist/lib/util.d.ts +18 -0
- package/dist/lib/util.d.ts.map +1 -1
- package/dist/lib/util.js +30 -0
- package/dist/lib/worktrees.d.ts +16 -0
- package/dist/lib/worktrees.d.ts.map +1 -1
- package/dist/lib/worktrees.js +5 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -7,5 +7,6 @@ export type { Config, ModelDefinition, ResolvedConfig } from "./lib/config.ts";
|
|
|
7
7
|
export { loadConfig } from "./lib/config.ts";
|
|
8
8
|
export { fetchBlockersForTicket, fetchInProgressIssueCount, fetchRawLinearIssue, fetchResolvedIssue, resolveModelFor, resolveRepositoryFor, type ModelResolution, type RawLinearIssue, type RepositoryResolution, } from "./lib/boardSource.ts";
|
|
9
9
|
export { getUsageByModel, type UsageByModel } from "./lib/usage.ts";
|
|
10
|
-
export {
|
|
10
|
+
export type { TicketCheck } from "./commands/ticketCheck.ts";
|
|
11
|
+
export { ticketDoctor, type TicketDoctorDependencies, type TicketDoctorResult, type TicketDoctorVerdict, } from "./commands/ticketDoctor.ts";
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,KAAK,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAChG,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,KAAK,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,KAAK,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAC1F,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,oBAAoB,EACpB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,oBAAoB,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EACL,YAAY,EACZ,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,KAAK,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAChG,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,KAAK,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,KAAK,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAC1F,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,oBAAoB,EACpB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,oBAAoB,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACpE,YAAY,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACL,YAAY,EACZ,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,GACzB,MAAM,4BAA4B,CAAC"}
|
package/dist/lib/config.d.ts
CHANGED
|
@@ -44,7 +44,8 @@ export interface SandboxDefinition {
|
|
|
44
44
|
kits?: string[];
|
|
45
45
|
/**
|
|
46
46
|
* Setup command run **inside** the sandbox before the agent exec.
|
|
47
|
-
* Defaults to
|
|
47
|
+
* Defaults to the shared `.groundcrew/setup.sh --deps-only` convention
|
|
48
|
+
* (see `launchCommand.ts`) when omitted.
|
|
48
49
|
*/
|
|
49
50
|
setupCommand?: string;
|
|
50
51
|
}
|
|
@@ -85,19 +86,6 @@ interface DisabledUserModelDefinition {
|
|
|
85
86
|
disabled: true;
|
|
86
87
|
}
|
|
87
88
|
type UserModelDefinition = EnabledUserModelDefinition | DisabledUserModelDefinition;
|
|
88
|
-
/**
|
|
89
|
-
* Setup command run inside sibling worktrees on the host. The host is
|
|
90
|
-
* assumed to already have the right Node and npm versions.
|
|
91
|
-
*/
|
|
92
|
-
export declare const DEFAULT_HOST_SETUP_COMMAND = "if [ -x .claude/setup.sh ]; then ./.claude/setup.sh --deps-only; elif [ -f .claude/setup.sh ] && command -v bash >/dev/null 2>&1; then bash .claude/setup.sh --deps-only; else npm clean-install; fi";
|
|
93
|
-
/**
|
|
94
|
-
* Setup command run inside an sdx (Docker Sandboxes) sandbox before the
|
|
95
|
-
* agent process exec. Independent of the host setup — sandboxes typically
|
|
96
|
-
* lack Node tooling on first start, so we keep the recipe scoped to the
|
|
97
|
-
* common case of an npm-managed repo while still letting per-model
|
|
98
|
-
* `sandbox.setupCommand` override it for languages outside that path.
|
|
99
|
-
*/
|
|
100
|
-
export declare const DEFAULT_SANDBOX_SETUP_COMMAND = "if [ -x .claude/setup.sh ]; then ./.claude/setup.sh --deps-only; elif [ -f .claude/setup.sh ] && command -v bash >/dev/null 2>&1; then bash .claude/setup.sh --deps-only; else npm clean-install; fi";
|
|
101
89
|
/**
|
|
102
90
|
* Loose user-facing shape — what a `config.ts` file declares.
|
|
103
91
|
* Fields with defaults are optional; only `linear.projectSlug` and the
|
package/dist/lib/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,eAAe,QAAQ,CAAC;AAErC;;;;;;GAMG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAE5D,eAAO,MAAM,uBAAuB,EAAE,SAAS,oBAAoB,EAIzD,CAAC;AAEX;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,KAAK,GAAG,MAAM,CAAC;AAEvD;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,MAAM,CAAC;AAEtD,eAAO,MAAM,qBAAqB,EAAE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EAAE,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,EACtC,IAAI,EAAE,MAAM,GACX,OAAO,CAKT;AAoPD,wBAAsB,UAAU,IAAI,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CA8BpE"}
|
package/dist/lib/config.js
CHANGED
|
@@ -23,19 +23,6 @@ export const LOCAL_RUNNER_SETTINGS = [
|
|
|
23
23
|
"sdx",
|
|
24
24
|
"none",
|
|
25
25
|
];
|
|
26
|
-
/**
|
|
27
|
-
* Setup command run inside sibling worktrees on the host. The host is
|
|
28
|
-
* assumed to already have the right Node and npm versions.
|
|
29
|
-
*/
|
|
30
|
-
export const DEFAULT_HOST_SETUP_COMMAND = "if [ -x .claude/setup.sh ]; then ./.claude/setup.sh --deps-only; elif [ -f .claude/setup.sh ] && command -v bash >/dev/null 2>&1; then bash .claude/setup.sh --deps-only; else npm clean-install; fi";
|
|
31
|
-
/**
|
|
32
|
-
* Setup command run inside an sdx (Docker Sandboxes) sandbox before the
|
|
33
|
-
* agent process exec. Independent of the host setup — sandboxes typically
|
|
34
|
-
* lack Node tooling on first start, so we keep the recipe scoped to the
|
|
35
|
-
* common case of an npm-managed repo while still letting per-model
|
|
36
|
-
* `sandbox.setupCommand` override it for languages outside that path.
|
|
37
|
-
*/
|
|
38
|
-
export const DEFAULT_SANDBOX_SETUP_COMMAND = "if [ -x .claude/setup.sh ]; then ./.claude/setup.sh --deps-only; elif [ -f .claude/setup.sh ] && command -v bash >/dev/null 2>&1; then bash .claude/setup.sh --deps-only; else npm clean-install; fi";
|
|
39
26
|
const DEFAULT_STATUSES = {
|
|
40
27
|
todo: "Todo",
|
|
41
28
|
inProgress: "In Progress",
|
|
@@ -11,6 +11,11 @@ export { shellSingleQuote } from "./shell.ts";
|
|
|
11
11
|
* exercise the catch branch.
|
|
12
12
|
*/
|
|
13
13
|
export declare function resolveSafehouseClearancePath(baseUrl?: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Per-repo setup hook: if `.groundcrew/setup.sh` exists, run it with
|
|
16
|
+
* `--deps-only`; otherwise no-op.
|
|
17
|
+
*/
|
|
18
|
+
export declare const SETUP_COMMAND = "[ -f .groundcrew/setup.sh ] && bash .groundcrew/setup.sh --deps-only";
|
|
14
19
|
interface LaunchCommandArguments {
|
|
15
20
|
definition: ModelDefinition;
|
|
16
21
|
promptFile: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launchCommand.d.ts","sourceRoot":"","sources":["../../src/lib/launchCommand.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"launchCommand.d.ts","sourceRoot":"","sources":["../../src/lib/launchCommand.ts"],"names":[],"mappings":"AAGA,OAAO,EAAsB,KAAK,WAAW,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAGzF,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;;;;GASG;AACH,wBAAgB,6BAA6B,CAAC,OAAO,GAAE,MAAwB,GAAG,MAAM,CAcvF;AAID;;;GAGG;AACH,eAAO,MAAM,aAAa,yEAAyE,CAAC;AAiCpG,UAAU,sBAAsB;IAC9B,UAAU,EAAE,eAAe,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC;;;;OAIG;IACH,MAAM,EAAE,WAAW,CAAC;IACpB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,sBAAsB,GAAG,MAAM,CAK7E"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
2
|
import { dirname, resolve } from "node:path";
|
|
3
|
-
import { BUILD_SECRET_NAMES
|
|
3
|
+
import { BUILD_SECRET_NAMES } from "./config.js";
|
|
4
4
|
import { shellSingleQuote } from "./shell.js";
|
|
5
5
|
export { shellSingleQuote } from "./shell.js";
|
|
6
6
|
/**
|
|
@@ -25,6 +25,11 @@ export function resolveSafehouseClearancePath(baseUrl = import.meta.url) {
|
|
|
25
25
|
return resolve(dirname(clearancePackageJson), "safehouse", "safehouse-clearance");
|
|
26
26
|
}
|
|
27
27
|
const SAFEHOUSE_CLEARANCE_WRAPPER_PATH = resolveSafehouseClearancePath();
|
|
28
|
+
/**
|
|
29
|
+
* Per-repo setup hook: if `.groundcrew/setup.sh` exists, run it with
|
|
30
|
+
* `--deps-only`; otherwise no-op.
|
|
31
|
+
*/
|
|
32
|
+
export const SETUP_COMMAND = "[ -f .groundcrew/setup.sh ] && bash .groundcrew/setup.sh --deps-only";
|
|
28
33
|
function renderAgentCommand(arguments_) {
|
|
29
34
|
return arguments_.agentCmd
|
|
30
35
|
.replaceAll("{{worktree}}", shellSingleQuote(arguments_.worktreeDir))
|
|
@@ -78,7 +83,7 @@ function buildHostLaunchCommand(arguments_) {
|
|
|
78
83
|
if (arguments_.secretsFile !== undefined) {
|
|
79
84
|
lines.push(sourceSecretsLine(arguments_.secretsFile));
|
|
80
85
|
}
|
|
81
|
-
lines.push(setupWithStatusReporting(
|
|
86
|
+
lines.push(setupWithStatusReporting(SETUP_COMMAND));
|
|
82
87
|
if (arguments_.secretsFile !== undefined) {
|
|
83
88
|
lines.push(unsetSecretsLine());
|
|
84
89
|
}
|
|
@@ -116,7 +121,7 @@ function buildSdxLaunchCommand(arguments_) {
|
|
|
116
121
|
worktreeDir: arguments_.worktreeDir,
|
|
117
122
|
sandboxName: arguments_.sandboxName,
|
|
118
123
|
});
|
|
119
|
-
const setupCommand = arguments_.definition.sandbox.setupCommand ??
|
|
124
|
+
const setupCommand = arguments_.definition.sandbox.setupCommand ?? SETUP_COMMAND;
|
|
120
125
|
const innerParts = [setupWithStatusReporting(setupCommand)];
|
|
121
126
|
if (arguments_.secretsFile !== undefined) {
|
|
122
127
|
innerParts.push(unsetSecretsLine());
|
package/dist/lib/util.d.ts
CHANGED
|
@@ -16,6 +16,24 @@ export interface ResolvedLinearApiKey {
|
|
|
16
16
|
}
|
|
17
17
|
export declare function resolveLinearApiKey(): ResolvedLinearApiKey | undefined;
|
|
18
18
|
export declare function getLinearClient(): LinearClient;
|
|
19
|
+
/**
|
|
20
|
+
* Returns a zero-arg getter that lazily constructs (and caches) a Linear
|
|
21
|
+
* client on first call. Used by CLI entry points that may not need the
|
|
22
|
+
* client at all (e.g. `--no-linear`), so we avoid blowing up on a missing
|
|
23
|
+
* API key when no Linear call is actually made. The factory is taken as a
|
|
24
|
+
* parameter (rather than calling `getLinearClient` directly) so callers can
|
|
25
|
+
* pass their own module-level import of `getLinearClient` — that binding
|
|
26
|
+
* respects `vi.mock` intercepts, whereas an intra-module reference would
|
|
27
|
+
* not.
|
|
28
|
+
*/
|
|
29
|
+
export declare function lazyLinearClient(factory: () => LinearClient): () => LinearClient;
|
|
30
|
+
/**
|
|
31
|
+
* Reads the value that follows `--ticket` at `argv[index + 1]`. Throws a
|
|
32
|
+
* uniform "ticket id is required" error if the value is missing, empty, or
|
|
33
|
+
* looks like another flag (starts with `-`). Centralizes the validation so
|
|
34
|
+
* each subcommand's arg parser stays DRY.
|
|
35
|
+
*/
|
|
36
|
+
export declare function readTicketArgument(argv: string[], index: number, command: string): string;
|
|
19
37
|
export declare function errorMessage(error: unknown): string;
|
|
20
38
|
export {};
|
|
21
39
|
//# sourceMappingURL=util.d.ts.map
|
package/dist/lib/util.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/lib/util.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,wBAAsB,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAoB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K,EAAE,OAAO,GAAG,MAAM,CAcnD"}
|
package/dist/lib/util.js
CHANGED
|
@@ -104,6 +104,36 @@ export function getLinearClient() {
|
|
|
104
104
|
}
|
|
105
105
|
return new LinearClient({ apiKey: resolved.value });
|
|
106
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* Returns a zero-arg getter that lazily constructs (and caches) a Linear
|
|
109
|
+
* client on first call. Used by CLI entry points that may not need the
|
|
110
|
+
* client at all (e.g. `--no-linear`), so we avoid blowing up on a missing
|
|
111
|
+
* API key when no Linear call is actually made. The factory is taken as a
|
|
112
|
+
* parameter (rather than calling `getLinearClient` directly) so callers can
|
|
113
|
+
* pass their own module-level import of `getLinearClient` — that binding
|
|
114
|
+
* respects `vi.mock` intercepts, whereas an intra-module reference would
|
|
115
|
+
* not.
|
|
116
|
+
*/
|
|
117
|
+
export function lazyLinearClient(factory) {
|
|
118
|
+
let client;
|
|
119
|
+
return () => {
|
|
120
|
+
client ??= factory();
|
|
121
|
+
return client;
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Reads the value that follows `--ticket` at `argv[index + 1]`. Throws a
|
|
126
|
+
* uniform "ticket id is required" error if the value is missing, empty, or
|
|
127
|
+
* looks like another flag (starts with `-`). Centralizes the validation so
|
|
128
|
+
* each subcommand's arg parser stays DRY.
|
|
129
|
+
*/
|
|
130
|
+
export function readTicketArgument(argv, index, command) {
|
|
131
|
+
const value = argv[index + 1];
|
|
132
|
+
if (value === undefined || value.length === 0 || value.startsWith("-")) {
|
|
133
|
+
throw new Error(`crew ${command} --ticket: ticket id is required`);
|
|
134
|
+
}
|
|
135
|
+
return value;
|
|
136
|
+
}
|
|
107
137
|
export function errorMessage(error) {
|
|
108
138
|
if (error instanceof Error) {
|
|
109
139
|
return error.message;
|
package/dist/lib/worktrees.d.ts
CHANGED
|
@@ -28,6 +28,16 @@ export interface WorktreeSpec {
|
|
|
28
28
|
repository: string;
|
|
29
29
|
ticket: string;
|
|
30
30
|
}
|
|
31
|
+
declare function branchNameForTicket(ticket: string): string;
|
|
32
|
+
export type WorktreeDirtiness = {
|
|
33
|
+
kind: "dirty";
|
|
34
|
+
modified: number;
|
|
35
|
+
untracked: number;
|
|
36
|
+
} | {
|
|
37
|
+
kind: "clean";
|
|
38
|
+
} | {
|
|
39
|
+
kind: "unknown";
|
|
40
|
+
};
|
|
31
41
|
declare function list(config: ResolvedConfig): WorktreeEntry[];
|
|
32
42
|
declare function findByTicket(config: ResolvedConfig, ticket: string): WorktreeEntry[];
|
|
33
43
|
declare function create(config: ResolvedConfig, spec: WorktreeSpec, signal?: AbortSignal): Promise<WorktreeEntry>;
|
|
@@ -54,12 +64,18 @@ declare function teardown(config: ResolvedConfig, entries: readonly WorktreeEntr
|
|
|
54
64
|
force?: boolean;
|
|
55
65
|
signal?: AbortSignal;
|
|
56
66
|
}): Promise<TeardownResult>;
|
|
67
|
+
declare function probeWorkingTree(input: {
|
|
68
|
+
worktreeDir: string;
|
|
69
|
+
signal?: AbortSignal;
|
|
70
|
+
}): Promise<WorktreeDirtiness>;
|
|
57
71
|
export declare const worktrees: {
|
|
58
72
|
create: typeof create;
|
|
59
73
|
list: typeof list;
|
|
60
74
|
findByTicket: typeof findByTicket;
|
|
61
75
|
remove: typeof remove;
|
|
62
76
|
teardown: typeof teardown;
|
|
77
|
+
branchNameForTicket: typeof branchNameForTicket;
|
|
78
|
+
probeWorkingTree: typeof probeWorkingTree;
|
|
63
79
|
};
|
|
64
80
|
export {};
|
|
65
81
|
//# sourceMappingURL=worktrees.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worktrees.d.ts","sourceRoot":"","sources":["../../src/lib/worktrees.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,EAAE,KAAK,cAAc,EAAc,MAAM,iBAAiB,CAAC;AAIlE,MAAM,MAAM,YAAY,G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AAQ,CACrB,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,SAAS,aAAa,EAAE,EACjC,OAAO,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,WAAW,CAAA;CAAE,GAClD,OAAO,CAAC,cAAc,CAAC,CAkDzB;AAED,iBAAe,gBAAgB,CAAC,KAAK,EAAE;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAE7B;AAED,eAAO,MAAM,SAAS;;;;;;;;CAQrB,CAAC"}
|
package/dist/lib/worktrees.js
CHANGED
|
@@ -336,10 +336,15 @@ async function teardown(config, entries, options) {
|
|
|
336
336
|
}
|
|
337
337
|
return result;
|
|
338
338
|
}
|
|
339
|
+
async function probeWorkingTree(input) {
|
|
340
|
+
return await probeWorktreeDirtiness(input.worktreeDir, input.signal);
|
|
341
|
+
}
|
|
339
342
|
export const worktrees = {
|
|
340
343
|
create,
|
|
341
344
|
list,
|
|
342
345
|
findByTicket,
|
|
343
346
|
remove,
|
|
344
347
|
teardown,
|
|
348
|
+
branchNameForTicket,
|
|
349
|
+
probeWorkingTree,
|
|
345
350
|
};
|
package/package.json
CHANGED