ghostrail 0.18.0 → 0.20.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 +29 -0
- package/dist/agent/claude-code.d.ts +18 -1
- package/dist/agent/claude-code.d.ts.map +1 -1
- package/dist/agent/claude-code.js +36 -4
- package/dist/agent/claude-code.js.map +1 -1
- package/dist/backend/attach.d.ts +49 -0
- package/dist/backend/attach.d.ts.map +1 -0
- package/dist/backend/attach.js +66 -0
- package/dist/backend/attach.js.map +1 -0
- package/dist/backend/container.d.ts.map +1 -1
- package/dist/backend/container.js +20 -30
- package/dist/backend/container.js.map +1 -1
- package/dist/backend/local-worktree.d.ts.map +1 -1
- package/dist/backend/local-worktree.js +6 -4
- package/dist/backend/local-worktree.js.map +1 -1
- package/dist/board/page.d.ts.map +1 -1
- package/dist/board/page.js +39 -2
- package/dist/board/page.js.map +1 -1
- package/dist/cli/commands.d.ts +12 -7
- package/dist/cli/commands.d.ts.map +1 -1
- package/dist/cli/commands.js +261 -43
- package/dist/cli/commands.js.map +1 -1
- package/dist/commands/help.d.ts.map +1 -1
- package/dist/commands/help.js +5 -3
- package/dist/commands/help.js.map +1 -1
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/load.js +20 -3
- package/dist/config/load.js.map +1 -1
- package/dist/config/schema.d.ts +57 -0
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +19 -0
- package/dist/config/schema.js.map +1 -1
- package/dist/dashboard/index.d.ts +3 -2
- package/dist/dashboard/index.d.ts.map +1 -1
- package/dist/dashboard/index.js +3 -2
- package/dist/dashboard/index.js.map +1 -1
- package/dist/dashboard/page.d.ts.map +1 -1
- package/dist/dashboard/page.js +72 -4
- package/dist/dashboard/page.js.map +1 -1
- package/dist/dashboard/review-page.d.ts +14 -0
- package/dist/dashboard/review-page.d.ts.map +1 -0
- package/dist/dashboard/review-page.js +256 -0
- package/dist/dashboard/review-page.js.map +1 -0
- package/dist/dashboard/routes.d.ts +18 -0
- package/dist/dashboard/routes.d.ts.map +1 -1
- package/dist/dashboard/routes.js +24 -0
- package/dist/dashboard/routes.js.map +1 -1
- package/dist/dashboard/server.d.ts +19 -0
- package/dist/dashboard/server.d.ts.map +1 -1
- package/dist/dashboard/server.js +71 -1
- package/dist/dashboard/server.js.map +1 -1
- package/dist/doctor/checks.d.ts +21 -0
- package/dist/doctor/checks.d.ts.map +1 -1
- package/dist/doctor/checks.js +44 -0
- package/dist/doctor/checks.js.map +1 -1
- package/dist/doctor/probes.d.ts +15 -0
- package/dist/doctor/probes.d.ts.map +1 -1
- package/dist/doctor/probes.js +33 -0
- package/dist/doctor/probes.js.map +1 -1
- package/dist/doctor/run.d.ts +2 -1
- package/dist/doctor/run.d.ts.map +1 -1
- package/dist/doctor/run.js +25 -2
- package/dist/doctor/run.js.map +1 -1
- package/dist/factory/build.d.ts +6 -0
- package/dist/factory/build.d.ts.map +1 -1
- package/dist/factory/build.js +17 -5
- package/dist/factory/build.js.map +1 -1
- package/dist/global/tempdir.d.ts +19 -0
- package/dist/global/tempdir.d.ts.map +1 -0
- package/dist/global/tempdir.js +47 -0
- package/dist/global/tempdir.js.map +1 -0
- package/dist/init/greenroom.d.ts +18 -0
- package/dist/init/greenroom.d.ts.map +1 -0
- package/dist/init/greenroom.js +24 -0
- package/dist/init/greenroom.js.map +1 -0
- package/dist/loop/engine.d.ts +9 -0
- package/dist/loop/engine.d.ts.map +1 -1
- package/dist/loop/engine.js +114 -7
- package/dist/loop/engine.js.map +1 -1
- package/dist/loop/index.d.ts +1 -0
- package/dist/loop/index.d.ts.map +1 -1
- package/dist/loop/index.js +1 -0
- package/dist/loop/index.js.map +1 -1
- package/dist/loop/ports.d.ts +7 -0
- package/dist/loop/ports.d.ts.map +1 -1
- package/dist/loop/record.d.ts +6 -1
- package/dist/loop/record.d.ts.map +1 -1
- package/dist/loop/retry.d.ts +50 -0
- package/dist/loop/retry.d.ts.map +1 -0
- package/dist/loop/retry.js +77 -0
- package/dist/loop/retry.js.map +1 -0
- package/dist/loop/schedule.d.ts +33 -0
- package/dist/loop/schedule.d.ts.map +1 -0
- package/dist/loop/schedule.js +28 -0
- package/dist/loop/schedule.js.map +1 -0
- package/dist/respond/authors.d.ts +38 -0
- package/dist/respond/authors.d.ts.map +1 -0
- package/dist/respond/authors.js +50 -0
- package/dist/respond/authors.js.map +1 -0
- package/dist/respond/merge.d.ts.map +1 -1
- package/dist/respond/merge.js +25 -19
- package/dist/respond/merge.js.map +1 -1
- package/dist/respond/respond.d.ts +7 -0
- package/dist/respond/respond.d.ts.map +1 -1
- package/dist/respond/respond.js +36 -16
- package/dist/respond/respond.js.map +1 -1
- package/dist/respond/run-id.d.ts +17 -0
- package/dist/respond/run-id.d.ts.map +1 -0
- package/dist/respond/run-id.js +23 -0
- package/dist/respond/run-id.js.map +1 -0
- package/dist/respond/run-row.d.ts +24 -0
- package/dist/respond/run-row.d.ts.map +1 -0
- package/dist/respond/run-row.js +28 -0
- package/dist/respond/run-row.js.map +1 -0
- package/dist/store/events.d.ts +30 -0
- package/dist/store/events.d.ts.map +1 -1
- package/dist/store/events.js +29 -7
- package/dist/store/events.js.map +1 -1
- package/dist/store/index.d.ts +1 -1
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/index.js.map +1 -1
- package/dist/triage/engine.d.ts +14 -0
- package/dist/triage/engine.d.ts.map +1 -1
- package/dist/triage/engine.js +73 -3
- package/dist/triage/engine.js.map +1 -1
- package/package.json +1 -1
- package/templates/code/ghostrail.toml +4 -0
- package/templates/content/ghostrail.toml +4 -0
package/README.md
CHANGED
|
@@ -166,6 +166,24 @@ Enables `ghostrail respond`. Omit the whole section to leave it disabled.
|
|
|
166
166
|
| Key | Type | Values | Default | Required |
|
|
167
167
|
| --- | --- | --- | --- | --- |
|
|
168
168
|
| `prompt` | string | path to a prompt file, relative to the config | none | yes, if `[respond]` is present |
|
|
169
|
+
| `ignore_authors` | array of strings | comment authors respond never acts on | `[]` | no |
|
|
170
|
+
| `every` | string | duration, or `"off"` | `"5m"` | no |
|
|
171
|
+
|
|
172
|
+
Respond skips a comment when it carries ghostrail's hidden marker (so it never
|
|
173
|
+
answers itself) or when its author is on the ignore list. The list it actually
|
|
174
|
+
uses is the union of three things:
|
|
175
|
+
|
|
176
|
+
1. Built-in defaults for the source kind. A `linear` source ignores `linear`,
|
|
177
|
+
because the Linear GitHub integration posts a linkback comment on every
|
|
178
|
+
factory PR whose body is the issue's own description. Left unfiltered, that
|
|
179
|
+
reads as fresh human feedback and the agent is handed the issue description
|
|
180
|
+
as a review, once per open PR.
|
|
181
|
+
2. `ignore_authors` here.
|
|
182
|
+
3. The `GHOSTRAIL_SELF_LOGINS` environment variable, comma-separated.
|
|
183
|
+
|
|
184
|
+
Matching is case-insensitive. The union only ever adds, so nothing can
|
|
185
|
+
un-ignore a built-in default. `ghostrail doctor` warns when open factory PRs
|
|
186
|
+
carry comments from an author that is neither you nor ghostrail.
|
|
169
187
|
|
|
170
188
|
### `[triage]` (optional)
|
|
171
189
|
|
|
@@ -175,6 +193,14 @@ Required by `ghostrail triage`; without it, that command has nothing to run.
|
|
|
175
193
|
| --- | --- | --- | --- | --- |
|
|
176
194
|
| `prompt` | string | path to a prompt file, relative to the config | none | yes, if `[triage]` is present |
|
|
177
195
|
| `eligible` | inline table | same shape as [`[source.eligible]`](#sourceeligible) | `{ labels: [] }` | no |
|
|
196
|
+
| `every` | string | duration, or `"off"` | `"30m"` | no |
|
|
197
|
+
|
|
198
|
+
`every` is how often `ghostrail watch` runs the pass. `watch` ticks the fix
|
|
199
|
+
queue on its own `--interval` and runs respond and triage on theirs, in one
|
|
200
|
+
loop, one pass at a time (they share the global lock, so running them at once
|
|
201
|
+
would just make them skip each other). Set `every = "off"` to leave a pass out
|
|
202
|
+
of the watch loop while keeping the command usable by hand. A section that is
|
|
203
|
+
absent entirely is never scheduled.
|
|
178
204
|
|
|
179
205
|
### A complete example
|
|
180
206
|
|
|
@@ -225,10 +251,13 @@ artifacts = ["style-guide"] # optional: shared references staged into every
|
|
|
225
251
|
|
|
226
252
|
[respond] # optional: enables `ghostrail respond`
|
|
227
253
|
prompt = "prompts/respond.md"
|
|
254
|
+
ignore_authors = ["linear"] # comment authors respond never acts on
|
|
255
|
+
every = "5m" # how often `watch` runs it; "off" to exclude it
|
|
228
256
|
|
|
229
257
|
[triage] # optional: required by `ghostrail triage`
|
|
230
258
|
prompt = "prompts/triage.md"
|
|
231
259
|
eligible = { state = "Todo", label = "triage", assignee = "unassigned" }
|
|
260
|
+
every = "30m" # how often `watch` runs it; "off" to exclude it
|
|
232
261
|
```
|
|
233
262
|
|
|
234
263
|
## Credentials
|
|
@@ -35,13 +35,30 @@ export declare function buildClaudeArgs(options: ClaudeArgsOptions): string[];
|
|
|
35
35
|
*/
|
|
36
36
|
export declare class ClaudeCodeAgent implements Agent {
|
|
37
37
|
private readonly profileDir?;
|
|
38
|
+
private readonly promptSourceDir?;
|
|
38
39
|
/**
|
|
39
40
|
* @param profileDir Optional ghostrail Claude profile. When set, the run uses
|
|
40
41
|
* it as Claude's config home (via `HOME`/`CLAUDE_CONFIG_DIR`) and its
|
|
41
42
|
* settings.json, so factory runs get the pinned skills/CLAUDE.md and never the
|
|
42
43
|
* user's interactive config.
|
|
44
|
+
* @param promptSourceDir Host directory to read the prompt file from, instead
|
|
45
|
+
* of the provisioned workspace. Set only when the config actually in use was
|
|
46
|
+
* found outside the repo (a greenroom directory): none of the backends carry
|
|
47
|
+
* untracked host files into a fresh worktree/clone, so a prompt that is never
|
|
48
|
+
* committed to the repo has to be read from the host directly. Left undefined
|
|
49
|
+
* for the default case, which reads the prompt from the workspace exactly as
|
|
50
|
+
* before.
|
|
43
51
|
*/
|
|
44
|
-
constructor(profileDir?: string | undefined);
|
|
52
|
+
constructor(profileDir?: string | undefined, promptSourceDir?: string | undefined);
|
|
45
53
|
run(context: AgentContext): Promise<AgentOutcome>;
|
|
54
|
+
/**
|
|
55
|
+
* Read the prompt template. From the host, under `promptSourceDir`, when one
|
|
56
|
+
* is set (a greenroom directory); otherwise from the provisioned workspace,
|
|
57
|
+
* exactly as ever. Never falls back from one to the other: a greenroom
|
|
58
|
+
* directory that cannot supply the prompt is a configuration error, not a
|
|
59
|
+
* reason to go looking for it somewhere the run's own branch might disagree
|
|
60
|
+
* with.
|
|
61
|
+
*/
|
|
62
|
+
private readPrompt;
|
|
46
63
|
}
|
|
47
64
|
//# sourceMappingURL=claude-code.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../src/agent/claude-code.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../src/agent/claude-code.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,YAAY,EAAc,MAAM,kBAAkB,CAAC;AAKtF,+EAA+E;AAC/E,eAAO,MAAM,WAAW,2BAA2B,CAAC;AAEpD,MAAM,WAAW,iBAAiB;IAChC,4EAA4E;IAC5E,MAAM,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,8EAA8E;IAC9E,MAAM,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,aAAa,CAAC;IAC/C,sDAAsD;IACtD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oCAAoC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,EAAE,CAwBpE;AAYD;;;;;;GAMG;AACH,qBAAa,eAAgB,YAAW,KAAK;IAezC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC;IAC5B,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC;IAfnC;;;;;;;;;;;;OAYG;gBAEgB,UAAU,CAAC,EAAE,MAAM,YAAA,EACnB,eAAe,CAAC,EAAE,MAAM,YAAA;IAGrC,GAAG,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;IA4EvD;;;;;;;OAOG;YACW,UAAU;CAczB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { readFile as readHostFile } from "node:fs/promises";
|
|
1
2
|
import { join } from "node:path";
|
|
2
3
|
import { costFromJson, describeAgentFailure, describeSilentRun, spokenReason } from "./failure.js";
|
|
3
4
|
import { renderPrompt } from "./prompt.js";
|
|
@@ -49,14 +50,23 @@ async function readFile(backend, workspace, path) {
|
|
|
49
50
|
*/
|
|
50
51
|
export class ClaudeCodeAgent {
|
|
51
52
|
profileDir;
|
|
53
|
+
promptSourceDir;
|
|
52
54
|
/**
|
|
53
55
|
* @param profileDir Optional ghostrail Claude profile. When set, the run uses
|
|
54
56
|
* it as Claude's config home (via `HOME`/`CLAUDE_CONFIG_DIR`) and its
|
|
55
57
|
* settings.json, so factory runs get the pinned skills/CLAUDE.md and never the
|
|
56
58
|
* user's interactive config.
|
|
59
|
+
* @param promptSourceDir Host directory to read the prompt file from, instead
|
|
60
|
+
* of the provisioned workspace. Set only when the config actually in use was
|
|
61
|
+
* found outside the repo (a greenroom directory): none of the backends carry
|
|
62
|
+
* untracked host files into a fresh worktree/clone, so a prompt that is never
|
|
63
|
+
* committed to the repo has to be read from the host directly. Left undefined
|
|
64
|
+
* for the default case, which reads the prompt from the workspace exactly as
|
|
65
|
+
* before.
|
|
57
66
|
*/
|
|
58
|
-
constructor(profileDir) {
|
|
67
|
+
constructor(profileDir, promptSourceDir) {
|
|
59
68
|
this.profileDir = profileDir;
|
|
69
|
+
this.promptSourceDir = promptSourceDir;
|
|
60
70
|
}
|
|
61
71
|
async run(context) {
|
|
62
72
|
const { backend, workspace, item, agent, guardrails } = context;
|
|
@@ -67,9 +77,12 @@ export class ClaudeCodeAgent {
|
|
|
67
77
|
// path; on an isolating backend it would point at nothing, which is why a
|
|
68
78
|
// backend that stages a profile must report where it put it.
|
|
69
79
|
const profileDir = workspace.profilePath ?? this.profileDir;
|
|
70
|
-
const template = await
|
|
80
|
+
const template = await this.readPrompt(backend, workspace, agent.prompt);
|
|
71
81
|
if (template === undefined) {
|
|
72
|
-
|
|
82
|
+
const from = this.promptSourceDir === undefined
|
|
83
|
+
? agent.prompt
|
|
84
|
+
: join(this.promptSourceDir, agent.prompt);
|
|
85
|
+
return { status: "failed", error: `could not read prompt file: ${from}` };
|
|
73
86
|
}
|
|
74
87
|
const args = buildClaudeArgs({
|
|
75
88
|
prompt: renderPrompt(template, item),
|
|
@@ -95,7 +108,7 @@ export class ClaudeCodeAgent {
|
|
|
95
108
|
// which the caller charges as an assumption rather than as free.
|
|
96
109
|
const spend = withSpend(costFromJson(run.stdout));
|
|
97
110
|
if (run.timedOut) {
|
|
98
|
-
return { ...spend, status: "failed", error: "agent timed out" };
|
|
111
|
+
return { ...spend, status: "failed", error: "agent timed out", transient: true };
|
|
99
112
|
}
|
|
100
113
|
const raw = await readFile(backend, workspace, RESULT_PATH);
|
|
101
114
|
if (raw !== undefined && raw.trim().length > 0) {
|
|
@@ -125,6 +138,25 @@ export class ClaudeCodeAgent {
|
|
|
125
138
|
// what the agent said so the two can be told apart after the fact.
|
|
126
139
|
return { ...spend, status: "noop", reason: describeSilentRun(run.stdout, run.stderr) };
|
|
127
140
|
}
|
|
141
|
+
/**
|
|
142
|
+
* Read the prompt template. From the host, under `promptSourceDir`, when one
|
|
143
|
+
* is set (a greenroom directory); otherwise from the provisioned workspace,
|
|
144
|
+
* exactly as ever. Never falls back from one to the other: a greenroom
|
|
145
|
+
* directory that cannot supply the prompt is a configuration error, not a
|
|
146
|
+
* reason to go looking for it somewhere the run's own branch might disagree
|
|
147
|
+
* with.
|
|
148
|
+
*/
|
|
149
|
+
async readPrompt(backend, workspace, promptPath) {
|
|
150
|
+
if (this.promptSourceDir === undefined) {
|
|
151
|
+
return readFile(backend, workspace, promptPath);
|
|
152
|
+
}
|
|
153
|
+
try {
|
|
154
|
+
return await readHostFile(join(this.promptSourceDir, promptPath), "utf8");
|
|
155
|
+
}
|
|
156
|
+
catch {
|
|
157
|
+
return undefined;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
128
160
|
}
|
|
129
161
|
/** An optional cost as a spreadable object, so absent stays absent. */
|
|
130
162
|
function withSpend(costUsd) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-code.js","sourceRoot":"","sources":["../../src/agent/claude-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAIjC,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACnG,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,+EAA+E;AAC/E,MAAM,CAAC,MAAM,WAAW,GAAG,wBAAwB,CAAC;AAqBpD;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,OAA0B;IACxD,MAAM,IAAI,GAAG;QACX,IAAI;QACJ,OAAO,CAAC,MAAM;QACd,iBAAiB;QACjB,OAAO,CAAC,YAAY,IAAI,MAAM;QAC9B,mBAAmB;QACnB,OAAO,CAAC,cAAc,IAAI,aAAa;QACvC,WAAW;QACX,OAAO,CAAC,MAAM;KACf,CAAC;IACF,IAAI,OAAO,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;QACvC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAChD,CAAC;IACD,IAAI,OAAO,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpC,IA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,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { ExecResult } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Checking out an existing branch in a fresh clone.
|
|
4
|
+
*
|
|
5
|
+
* `git clone <local-path>` copies the source's `refs/heads/*` and nothing else:
|
|
6
|
+
* a branch the source knows only as `refs/remotes/origin/<branch>` is simply
|
|
7
|
+
* absent from the clone, so `git checkout <branch>` fails with "pathspec ...
|
|
8
|
+
* did not match any file(s) known to git". That is every factory PR branch on
|
|
9
|
+
* a machine that did not open it, which is the common case as soon as more
|
|
10
|
+
* than one clone or machine is involved (TJ-1675).
|
|
11
|
+
*
|
|
12
|
+
* The fix is to fetch the branch from the real remote before checking it out,
|
|
13
|
+
* rather than hoping a local ref survived the clone. Pure arg builders here so
|
|
14
|
+
* the sequence is testable without a repo, a network, or a container.
|
|
15
|
+
*/
|
|
16
|
+
/** Read the origin URL of the repo being cloned from. */
|
|
17
|
+
export declare function originUrlArgs(repoPath: string): string[];
|
|
18
|
+
/** Point a clone's `origin` at `url`. */
|
|
19
|
+
export declare function setOriginArgs(dir: string, url: string): string[];
|
|
20
|
+
/**
|
|
21
|
+
* Fetch one branch from `origin` into `FETCH_HEAD`.
|
|
22
|
+
*
|
|
23
|
+
* A single named branch rather than a full fetch: the pass needs exactly one,
|
|
24
|
+
* and a factory repo can carry hundreds of stale branches.
|
|
25
|
+
*/
|
|
26
|
+
export declare function fetchBranchArgs(dir: string, branch: string): string[];
|
|
27
|
+
/**
|
|
28
|
+
* Check out the branch just fetched. `-B` from `FETCH_HEAD` rather than a bare
|
|
29
|
+
* checkout, so it works whether or not a local ref of that name survived the
|
|
30
|
+
* clone, and so the working tree matches the remote rather than a stale local
|
|
31
|
+
* copy of it.
|
|
32
|
+
*/
|
|
33
|
+
export declare function checkoutFetchedArgs(dir: string, branch: string): string[];
|
|
34
|
+
/** Check out an existing local branch, the fallback when no remote has it. */
|
|
35
|
+
export declare function checkoutLocalArgs(dir: string, branch: string): string[];
|
|
36
|
+
/**
|
|
37
|
+
* Check out an existing branch in a fresh clone: fetch it from `origin` first,
|
|
38
|
+
* because a clone of a local path carries only that path's local heads, so a
|
|
39
|
+
* branch it knows only as `origin/<branch>` is absent here (TJ-1675).
|
|
40
|
+
*
|
|
41
|
+
* Falls back to a plain checkout when the fetch fails, which covers an offline
|
|
42
|
+
* host and a repo whose origin is unreachable or absent: if a local ref did
|
|
43
|
+
* survive the clone, that still works, and if it did not, the checkout's own
|
|
44
|
+
* error is the one worth reporting.
|
|
45
|
+
*/
|
|
46
|
+
export declare function attachToBranch(dir: string, branch: string): Promise<ExecResult>;
|
|
47
|
+
/** Create `branch` off `baseBranch`, for `mode: "create"`. */
|
|
48
|
+
export declare function checkoutNewArgs(dir: string, branch: string, baseBranch: string): string[];
|
|
49
|
+
//# sourceMappingURL=attach.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attach.d.ts","sourceRoot":"","sources":["../../src/backend/attach.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C;;;;;;;;;;;;;GAaG;AAEH,yDAAyD;AACzD,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAExD;AAED,yCAAyC;AACzC,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAEhE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAErE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAEzE;AAED,8EAA8E;AAC9E,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAEvE;AAED;;;;;;;;;GASG;AACH,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAKrF;AAED,8DAA8D;AAC9D,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAEzF"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { spawnCollect } from "./proc.js";
|
|
2
|
+
/**
|
|
3
|
+
* Checking out an existing branch in a fresh clone.
|
|
4
|
+
*
|
|
5
|
+
* `git clone <local-path>` copies the source's `refs/heads/*` and nothing else:
|
|
6
|
+
* a branch the source knows only as `refs/remotes/origin/<branch>` is simply
|
|
7
|
+
* absent from the clone, so `git checkout <branch>` fails with "pathspec ...
|
|
8
|
+
* did not match any file(s) known to git". That is every factory PR branch on
|
|
9
|
+
* a machine that did not open it, which is the common case as soon as more
|
|
10
|
+
* than one clone or machine is involved (TJ-1675).
|
|
11
|
+
*
|
|
12
|
+
* The fix is to fetch the branch from the real remote before checking it out,
|
|
13
|
+
* rather than hoping a local ref survived the clone. Pure arg builders here so
|
|
14
|
+
* the sequence is testable without a repo, a network, or a container.
|
|
15
|
+
*/
|
|
16
|
+
/** Read the origin URL of the repo being cloned from. */
|
|
17
|
+
export function originUrlArgs(repoPath) {
|
|
18
|
+
return ["git", "-C", repoPath, "remote", "get-url", "origin"];
|
|
19
|
+
}
|
|
20
|
+
/** Point a clone's `origin` at `url`. */
|
|
21
|
+
export function setOriginArgs(dir, url) {
|
|
22
|
+
return ["git", "-C", dir, "remote", "set-url", "origin", url];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Fetch one branch from `origin` into `FETCH_HEAD`.
|
|
26
|
+
*
|
|
27
|
+
* A single named branch rather than a full fetch: the pass needs exactly one,
|
|
28
|
+
* and a factory repo can carry hundreds of stale branches.
|
|
29
|
+
*/
|
|
30
|
+
export function fetchBranchArgs(dir, branch) {
|
|
31
|
+
return ["git", "-C", dir, "fetch", "--quiet", "origin", branch];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Check out the branch just fetched. `-B` from `FETCH_HEAD` rather than a bare
|
|
35
|
+
* checkout, so it works whether or not a local ref of that name survived the
|
|
36
|
+
* clone, and so the working tree matches the remote rather than a stale local
|
|
37
|
+
* copy of it.
|
|
38
|
+
*/
|
|
39
|
+
export function checkoutFetchedArgs(dir, branch) {
|
|
40
|
+
return ["git", "-C", dir, "checkout", "-B", branch, "FETCH_HEAD"];
|
|
41
|
+
}
|
|
42
|
+
/** Check out an existing local branch, the fallback when no remote has it. */
|
|
43
|
+
export function checkoutLocalArgs(dir, branch) {
|
|
44
|
+
return ["git", "-C", dir, "checkout", branch];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Check out an existing branch in a fresh clone: fetch it from `origin` first,
|
|
48
|
+
* because a clone of a local path carries only that path's local heads, so a
|
|
49
|
+
* branch it knows only as `origin/<branch>` is absent here (TJ-1675).
|
|
50
|
+
*
|
|
51
|
+
* Falls back to a plain checkout when the fetch fails, which covers an offline
|
|
52
|
+
* host and a repo whose origin is unreachable or absent: if a local ref did
|
|
53
|
+
* survive the clone, that still works, and if it did not, the checkout's own
|
|
54
|
+
* error is the one worth reporting.
|
|
55
|
+
*/
|
|
56
|
+
export async function attachToBranch(dir, branch) {
|
|
57
|
+
const fetched = await spawnCollect(fetchBranchArgs(dir, branch));
|
|
58
|
+
return fetched.exitCode === 0
|
|
59
|
+
? await spawnCollect(checkoutFetchedArgs(dir, branch))
|
|
60
|
+
: await spawnCollect(checkoutLocalArgs(dir, branch));
|
|
61
|
+
}
|
|
62
|
+
/** Create `branch` off `baseBranch`, for `mode: "create"`. */
|
|
63
|
+
export function checkoutNewArgs(dir, branch, baseBranch) {
|
|
64
|
+
return ["git", "-C", dir, "checkout", "-B", branch, baseBranch];
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=attach.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attach.js","sourceRoot":"","sources":["../../src/backend/attach.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGzC;;;;;;;;;;;;;GAaG;AAEH,yDAAyD;AACzD,MAAM,UAAU,aAAa,CAAC,QAAgB;IAC5C,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AAChE,CAAC;AAED,yCAAyC;AACzC,MAAM,UAAU,aAAa,CAAC,GAAW,EAAE,GAAW;IACpD,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC;AAChE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,GAAW,EAAE,MAAc;IACzD,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAClE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAW,EAAE,MAAc;IAC7D,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;AACpE,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,iBAAiB,CAAC,GAAW,EAAE,MAAc;IAC3D,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;AAChD,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,GAAW,EAAE,MAAc;IAC9D,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,eAAe,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;IACjE,OAAO,OAAO,CAAC,QAAQ,KAAK,CAAC;QAC3B,CAAC,CAAC,MAAM,YAAY,CAAC,mBAAmB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QACtD,CAAC,CAAC,MAAM,YAAY,CAAC,iBAAiB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;AACzD,CAAC;AAED,8DAA8D;AAC9D,MAAM,UAAU,eAAe,CAAC,GAAW,EAAE,MAAc,EAAE,UAAkB;IAC7E,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../src/backend/container.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../src/backend/container.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EACV,OAAO,EACP,WAAW,EACX,UAAU,EACV,OAAO,EACP,aAAa,EACb,SAAS,EACV,MAAM,YAAY,CAAC;AAQpB;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,uEAAuE;IACvE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CAC1C;AAED,qBAAa,gBAAiB,YAAW,OAAO;IAC9C,QAAQ,CAAC,IAAI,eAAQ;IACrB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAoB;IAC/C,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAqC;gBAE7C,OAAO,GAAE,uBAA4B;IAKjD,wEAAwE;IACxE,OAAO,CAAC,YAAY;IASpB,yDAAyD;IACzD,OAAO,CAAC,gBAAgB;IAMxB,uDAAuD;WAC1C,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAKtC,SAAS,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,SAAS,CAAC;IAqIxD,IAAI,CACF,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,UAAU,CAAC;IAKtB,MAAM,CACJ,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,KAAK,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,EAC9B,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,UAAU,CAAC;IAShB,QAAQ,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;CAGpD"}
|
|
@@ -3,6 +3,7 @@ import { mkdir, rm } from "node:fs/promises";
|
|
|
3
3
|
import { tmpdir } from "node:os";
|
|
4
4
|
import { join } from "node:path";
|
|
5
5
|
import process from "node:process";
|
|
6
|
+
import { attachToBranch, checkoutNewArgs, originUrlArgs, setOriginArgs } from "./attach.js";
|
|
6
7
|
import { CONTAINER_GIT_IDENTITY, CONTAINER_PROFILE_DIR, CONTAINER_WORKDIR, DEFAULT_CONTAINER_IMAGE, dockerCpArgs, dockerExecArgs, dockerRmArgs, dockerRunArgs, } from "./docker.js";
|
|
7
8
|
import { CLONE_TOKEN_ENV, cloneCredentialArgs } from "./git-credentials.js";
|
|
8
9
|
import { spawnCollect } from "./proc.js";
|
|
@@ -53,42 +54,31 @@ export class ContainerBackend {
|
|
|
53
54
|
const clone = await spawnCollect(["git", ...credArgs, "clone", "--quiet", spec.repoPath, hostClone], cloneOpts);
|
|
54
55
|
if (clone.exitCode !== 0)
|
|
55
56
|
throw new Error(`git clone failed: ${clone.stderr.trim()}`);
|
|
56
|
-
//
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
//
|
|
64
|
-
//
|
|
65
|
-
|
|
66
|
-
// origin over instead; the image's gh credential helper authenticates it
|
|
67
|
-
// from the forwarded token. When `repoPath` is already a URL this `git -C`
|
|
68
|
-
// fails and the clone's origin is left exactly as it is.
|
|
69
|
-
const sourceOrigin = await spawnCollect([
|
|
70
|
-
"git",
|
|
71
|
-
"-C",
|
|
72
|
-
spec.repoPath,
|
|
73
|
-
"remote",
|
|
74
|
-
"get-url",
|
|
75
|
-
"origin",
|
|
76
|
-
]);
|
|
57
|
+
// Repoint `origin` before the checkout, not after: attach mode fetches
|
|
58
|
+
// the branch from it, and cloning from a local path leaves origin on that
|
|
59
|
+
// path, which has the branch only as a remote-tracking ref (if at all).
|
|
60
|
+
//
|
|
61
|
+
// It has to happen regardless, because that path does not exist inside
|
|
62
|
+
// the container, so the publish step's push would die with "does not
|
|
63
|
+
// appear to be a git repository". The image's gh credential helper
|
|
64
|
+
// authenticates the real URL from the forwarded token. When `repoPath` is
|
|
65
|
+
// already a URL this `git -C` fails and origin is left exactly as it is.
|
|
66
|
+
const sourceOrigin = await spawnCollect(originUrlArgs(spec.repoPath));
|
|
77
67
|
const originUrl = sourceOrigin.exitCode === 0 ? sourceOrigin.stdout.trim() : "";
|
|
78
68
|
if (originUrl !== "" && originUrl !== spec.repoPath) {
|
|
79
|
-
const setUrl = await spawnCollect(
|
|
80
|
-
"git",
|
|
81
|
-
"-C",
|
|
82
|
-
hostClone,
|
|
83
|
-
"remote",
|
|
84
|
-
"set-url",
|
|
85
|
-
"origin",
|
|
86
|
-
originUrl,
|
|
87
|
-
]);
|
|
69
|
+
const setUrl = await spawnCollect(setOriginArgs(hostClone, originUrl));
|
|
88
70
|
if (setUrl.exitCode !== 0) {
|
|
89
71
|
throw new Error(`git remote set-url origin failed: ${setUrl.stderr.trim()}`);
|
|
90
72
|
}
|
|
91
73
|
}
|
|
74
|
+
// "create" makes a new branch off the base; "attach" checks out one that
|
|
75
|
+
// already exists, which means fetching it (see ./attach.ts for why a bare
|
|
76
|
+
// checkout is not enough).
|
|
77
|
+
const branch = spec.mode === "attach"
|
|
78
|
+
? await attachToBranch(hostClone, spec.branch)
|
|
79
|
+
: await spawnCollect(checkoutNewArgs(hostClone, spec.branch, spec.baseBranch));
|
|
80
|
+
if (branch.exitCode !== 0)
|
|
81
|
+
throw new Error(`git checkout failed: ${branch.stderr.trim()}`);
|
|
92
82
|
const run = await docker(dockerRunArgs(name, image));
|
|
93
83
|
if (run.exitCode !== 0)
|
|
94
84
|
throw new Error(`docker run failed: ${run.stderr.trim()}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container.js","sourceRoot":"","sources":["../../src/backend/container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EACjB,uBAAuB,EACvB,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,aAAa,GACd,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAUzC,MAAM,IAAI,GAAG,WAAW,CAAC;AAEzB,KAAK,UAAU,MAAM,CAAC,IAAuB,EAAE,SAAkB;IAC/D,OAAO,YAAY,CAAC,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,EAAE,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC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AAE;QAEzB,MAAM,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;QAC5C,OAAO,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IAC9E,CAAC;IAED,MAAM,CACJ,SAAoB,EACpB,OAA0B,EAC1B,KAA8B,EAC9B,UAAuB,EAAE;QAEzB,MAAM,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;QAC5C,MAAM,IAAI,GAAG,cAAc,CAAC,SAAS,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;QAC1D,OAAO,YAAY,CAAC,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,EAAE;YACvC,KAAK;YACL,GAAG,CAAC,OAAO,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC;SAC7E,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,SAAoB;QACjC,MAAM,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5C,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-worktree.d.ts","sourceRoot":"","sources":["../../src/backend/local-worktree.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"local-worktree.d.ts","sourceRoot":"","sources":["../../src/backend/local-worktree.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,OAAO,EACP,WAAW,EACX,UAAU,EACV,OAAO,EACP,aAAa,EACb,SAAS,EACV,MAAM,YAAY,CAAC;AAIpB;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GACzB,MAAM,EAAE,CAIV;AAED;;;;GAIG;AACH,qBAAa,oBAAqB,YAAW,OAAO;IAClD,QAAQ,CAAC,IAAI,oBAAQ;IACrB,4EAA4E;IAC5E,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA6B;IAEvD,SAAS,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,SAAS,CAAC;IA6DxD,IAAI,CACF,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,UAAU,CAAC;IAItB,MAAM,CACJ,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,KAAK,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,EAC9B,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,UAAU,CAAC;IAIhB,QAAQ,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAUnD,OAAO,CAAC,WAAW;CAIpB"}
|
|
@@ -3,6 +3,7 @@ import { mkdir, rm } from "node:fs/promises";
|
|
|
3
3
|
import { tmpdir } from "node:os";
|
|
4
4
|
import { join } from "node:path";
|
|
5
5
|
import process from "node:process";
|
|
6
|
+
import { attachToBranch, checkoutNewArgs } from "./attach.js";
|
|
6
7
|
import { CLONE_TOKEN_ENV, cloneCredentialArgs } from "./git-credentials.js";
|
|
7
8
|
import { spawnCollect } from "./proc.js";
|
|
8
9
|
const KIND = "local-worktree";
|
|
@@ -59,10 +60,11 @@ export class LocalWorktreeBackend {
|
|
|
59
60
|
if (clone.exitCode !== 0) {
|
|
60
61
|
throw new Error(`local-clone provision failed: ${clone.stderr.trim() || clone.stdout.trim()}`);
|
|
61
62
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
// Attach fetches the branch rather than assuming a local ref survived the
|
|
64
|
+
// clone; see ./attach.ts and TJ-1675.
|
|
65
|
+
const checkout = spec.mode === "attach"
|
|
66
|
+
? await attachToBranch(dir, spec.branch)
|
|
67
|
+
: await spawnCollect(checkoutNewArgs(dir, spec.branch, spec.baseBranch));
|
|
66
68
|
if (checkout.exitCode !== 0) {
|
|
67
69
|
await rm(dir, { recursive: true, force: true });
|
|
68
70
|
throw new Error(`local-clone checkout failed: ${checkout.stderr.trim()}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-worktree.js","sourceRoot":"","sources":["../../src/backend/local-worktree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAUzC,MAAM,IAAI,GAAG,gBAAgB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,eAAe,CAC7B,GAAW,EACX,MAAc,EACd,UAAkB,EAClB,IAA0B;IAE1B,OAAO,IAAI,KAAK,QAAQ;QACtB,CAAC,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC;QAClC,CAAC,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC;AACzD,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAO,oBAAoB;IACtB,IAAI,GAAG,IAAI,CAAC;IACrB,4EAA4E;IA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-
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../src/board/page.ts"],"names":[],"mappings":"AAEA,kFAAkF;AAClF,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../src/board/page.ts"],"names":[],"mappings":"AAEA,kFAAkF;AAClF,eAAO,MAAM,SAAS,QAkTd,CAAC"}
|
package/dist/board/page.js
CHANGED
|
@@ -16,7 +16,9 @@ export const PAGE_HTML = `<!doctype html>
|
|
|
16
16
|
table { border-collapse: collapse; width: 100%; }
|
|
17
17
|
th, td { text-align: left; padding: .4rem .6rem; border-bottom: 1px solid #8883; }
|
|
18
18
|
.state { font-weight: 600; }
|
|
19
|
-
.
|
|
19
|
+
.hist-entry { margin: 6px 0 0 0; padding-left: 8px; border-left: 2px solid #ddd; }
|
|
20
|
+
.row-err { font-size: 12px; color: #b3261e; margin-top: 2px; overflow-wrap: anywhere; }
|
|
21
|
+
.done, .merged, .responded { color: #2a9d3a; } .failed { color: #d33; } .blocked, .abandoned { color: #d90; }
|
|
20
22
|
.noop, .skipped, .closed { opacity: .6; } .muted { opacity: .6; }
|
|
21
23
|
a { color: inherit; }
|
|
22
24
|
.twirl {
|
|
@@ -98,6 +100,27 @@ function prStatusHtml(status) {
|
|
|
98
100
|
return parts.join("");
|
|
99
101
|
}
|
|
100
102
|
|
|
103
|
+
/**
|
|
104
|
+
* What earlier passes said, once a later one has superseded them. The row's own
|
|
105
|
+
* Error and Comment above are always the latest pass's; this is the record of
|
|
106
|
+
* the ones before it, so a comment posted on the PR two passes ago is still
|
|
107
|
+
* readable here (TJ-1676).
|
|
108
|
+
*/
|
|
109
|
+
function outcomeHistoryHtml(row) {
|
|
110
|
+
const all = row.outcomes || [];
|
|
111
|
+
if (all.length < 2) return "";
|
|
112
|
+
const earlier = all.slice(0, -1).reverse();
|
|
113
|
+
const items = earlier.map((o) => {
|
|
114
|
+
const said = o.error || o.summary || "";
|
|
115
|
+
return "<div class=hist-entry>" +
|
|
116
|
+
"<span class='state " + esc(o.state) + "'>" + esc(o.state) + "</span> " +
|
|
117
|
+
"<span class=muted>" + esc(fmtWhen(o.ts)) + "</span>" +
|
|
118
|
+
(said ? "<pre>" + esc(said) + "</pre>" : "") +
|
|
119
|
+
"</div>";
|
|
120
|
+
}).join("");
|
|
121
|
+
return "<div><b>Earlier passes</b>" + items + "</div>";
|
|
122
|
+
}
|
|
123
|
+
|
|
101
124
|
function detailBodyHtml(row) {
|
|
102
125
|
const parts = [];
|
|
103
126
|
const itemLabel = esc(row.itemId || "");
|
|
@@ -113,6 +136,7 @@ function detailBodyHtml(row) {
|
|
|
113
136
|
parts.push("<div><b>Gate</b>" + gateStepsHtml(row.gate) + "</div>");
|
|
114
137
|
if (row.error) parts.push("<div><b>Error</b><pre class=failed>" + esc(row.error) + "</pre></div>");
|
|
115
138
|
if (row.summary) parts.push("<div><b>Comment</b><pre>" + esc(row.summary) + "</pre></div>");
|
|
139
|
+
parts.push(outcomeHistoryHtml(row));
|
|
116
140
|
if (row.prUrl) {
|
|
117
141
|
parts.push("<div><b>PR</b> " + link(row.prUrl, esc(row.prUrl)) + "</div>");
|
|
118
142
|
}
|
|
@@ -190,13 +214,26 @@ function toggle(runId) {
|
|
|
190
214
|
if (expanded.has(runId)) paintDetail(runId);
|
|
191
215
|
}
|
|
192
216
|
|
|
217
|
+
/**
|
|
218
|
+
* A failed row's reason, on the summary line. It used to live only in the
|
|
219
|
+
* detail panel, so a row read "failed" with nothing to say why and the reason
|
|
220
|
+
* was one click away on a page nobody thinks to click (TJ-1676). Truncated
|
|
221
|
+
* here, in full on hover.
|
|
222
|
+
*/
|
|
223
|
+
function errLine(r) {
|
|
224
|
+
if (!r.error) return "";
|
|
225
|
+
const oneLine = String(r.error).replace(/\\s+/g, " ").trim();
|
|
226
|
+
const short = oneLine.length > 120 ? oneLine.slice(0, 119) + "…" : oneLine;
|
|
227
|
+
return "<div class='row-err' title='" + esc(oneLine) + "'>" + esc(short) + "</div>";
|
|
228
|
+
}
|
|
229
|
+
|
|
193
230
|
function rowHtml(r) {
|
|
194
231
|
const isOpen = expanded.has(r.runId);
|
|
195
232
|
const gate = (r.gate || []).map((s) => (s.exitCode === 0 ? "✓" : "✗")).join("");
|
|
196
233
|
const pr = r.prUrl ? link(r.prUrl, "#" + esc(r.prNumber)) : "";
|
|
197
234
|
const when = fmtWhen(r.startedAt);
|
|
198
235
|
const itemLabel = esc(r.title || r.itemId || "");
|
|
199
|
-
const item = r.url ? link(r.url, itemLabel) : itemLabel;
|
|
236
|
+
const item = (r.url ? link(r.url, itemLabel) : itemLabel) + errLine(r);
|
|
200
237
|
const state = esc(mainLineState(r));
|
|
201
238
|
const main = "<tr class=run-row>" +
|
|
202
239
|
"<td><button class='twirl" + (isOpen ? " open" : "") + "' data-run-id='" + esc(r.runId) + "'>▶</button></td>" +
|
package/dist/board/page.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../src/board/page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,kFAAkF;AAClF,MAAM,CAAC,MAAM,SAAS,GAAG
|
|
1
|
+
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../src/board/page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,kFAAkF;AAClF,MAAM,CAAC,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAgMH,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAkH/C,CAAC"}
|
package/dist/cli/commands.d.ts
CHANGED
|
@@ -32,7 +32,6 @@ interface WatchFlags {
|
|
|
32
32
|
* and an optional `--max-ticks <n>`. Returns undefined for a malformed interval.
|
|
33
33
|
*/
|
|
34
34
|
export declare function parseWatchFlags(argv: readonly string[]): WatchFlags | undefined;
|
|
35
|
-
/** `ghostrail watch`: run ticks on an interval until interrupted (no cron needed). */
|
|
36
35
|
export declare function cmdWatch(argv: readonly string[], streams: CommandStreams, env?: CommandEnv, cwd?: string): Promise<number>;
|
|
37
36
|
/** `ghostrail triage`: decompose large issues in the triage queue into sub-issues. */
|
|
38
37
|
export declare function cmdTriage(argv: readonly string[], streams: CommandStreams, env?: CommandEnv, cwd?: string): Promise<number>;
|
|
@@ -87,12 +86,18 @@ export declare function cmdStatus(argv: readonly string[], streams: CommandStrea
|
|
|
87
86
|
/** The quickstart templates bundled with the package. */
|
|
88
87
|
export declare const TEMPLATES: readonly ["code", "content"];
|
|
89
88
|
/**
|
|
90
|
-
* `ghostrail init <template> [--repo <path>] [--force|--diff|--update]`:
|
|
91
|
-
* `ghostrail.toml` and `prompts/` from a quickstart template. Safe for
|
|
92
|
-
* an existing repo: existing files are left untouched (skipped)
|
|
93
|
-
* is given. `--diff` reports drift instead of writing
|
|
94
|
-
* takes the template changes this repo never edited while
|
|
95
|
-
* customized file is missing
|
|
89
|
+
* `ghostrail init <template> [--repo <path>] [--force|--diff|--update|--greenroom [<path>]] [--register]`:
|
|
90
|
+
* scaffold `ghostrail.toml` and `prompts/` from a quickstart template. Safe for
|
|
91
|
+
* a fresh OR an existing repo: existing files are left untouched (skipped)
|
|
92
|
+
* unless `--force` is given. `--diff` reports drift instead of writing
|
|
93
|
+
* anything, `--update` takes the template changes this repo never edited while
|
|
94
|
+
* naming what a customized file is missing, and `--greenroom` scaffolds into a
|
|
95
|
+
* directory outside the repo instead of into it (see
|
|
96
|
+
* specs/greenroom-compatibility.spec.md), converting an existing plain `init`
|
|
97
|
+
* in place when the repo already has one.
|
|
98
|
+
*
|
|
99
|
+
* Registration is skipped, not just the write, when the target looks like a
|
|
100
|
+
* temp directory (TJ-1654); `--register` registers it anyway.
|
|
96
101
|
*/
|
|
97
102
|
export declare function cmdInit(argv: readonly string[], streams: CommandStreams, cwd?: string, env?: CommandEnv): Promise<number>;
|
|
98
103
|
interface SkillFlags {
|