ghostrail 0.7.5 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/result.d.ts +2 -1
- package/dist/agent/result.d.ts.map +1 -1
- package/dist/agent/result.js +7 -1
- package/dist/agent/result.js.map +1 -1
- package/dist/cli/commands.d.ts +26 -3
- package/dist/cli/commands.d.ts.map +1 -1
- package/dist/cli/commands.js +426 -7
- package/dist/cli/commands.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +9 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/help.d.ts.map +1 -1
- package/dist/commands/help.js +39 -1
- package/dist/commands/help.js.map +1 -1
- package/dist/global/index.d.ts +1 -0
- package/dist/global/index.d.ts.map +1 -1
- package/dist/global/index.js +1 -0
- package/dist/global/index.js.map +1 -1
- package/dist/global/registry.d.ts +63 -0
- package/dist/global/registry.d.ts.map +1 -0
- package/dist/global/registry.js +120 -0
- package/dist/global/registry.js.map +1 -0
- package/dist/global/store.d.ts +10 -0
- package/dist/global/store.d.ts.map +1 -1
- package/dist/global/store.js +25 -1
- package/dist/global/store.js.map +1 -1
- package/dist/init/drift.d.ts +68 -0
- package/dist/init/drift.d.ts.map +1 -0
- package/dist/init/drift.js +103 -0
- package/dist/init/drift.js.map +1 -0
- package/dist/loop/engine.d.ts.map +1 -1
- package/dist/loop/engine.js +11 -4
- package/dist/loop/engine.js.map +1 -1
- package/dist/loop/ports.d.ts +19 -1
- package/dist/loop/ports.d.ts.map +1 -1
- package/dist/publish/githost.d.ts +9 -3
- package/dist/publish/githost.d.ts.map +1 -1
- package/dist/publish/githost.js +18 -4
- package/dist/publish/githost.js.map +1 -1
- package/dist/publish/github-publisher.d.ts +2 -2
- package/dist/publish/github-publisher.d.ts.map +1 -1
- package/dist/publish/github-publisher.js +3 -3
- package/dist/publish/github-publisher.js.map +1 -1
- package/dist/service/index.d.ts +3 -0
- package/dist/service/index.d.ts.map +1 -0
- package/dist/service/index.js +3 -0
- package/dist/service/index.js.map +1 -0
- package/dist/service/manager.d.ts +69 -0
- package/dist/service/manager.d.ts.map +1 -0
- package/dist/service/manager.js +107 -0
- package/dist/service/manager.js.map +1 -0
- package/dist/service/unit.d.ts +60 -0
- package/dist/service/unit.d.ts.map +1 -0
- package/dist/service/unit.js +111 -0
- package/dist/service/unit.js.map +1 -0
- package/package.json +1 -1
- package/skill/ghostrail/SKILL.md +62 -16
- package/templates/code-local/prompts/resolve-issue.md +15 -1
- package/templates/content-loop/prompts/draft.md +1 -1
package/dist/global/store.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { readFile, readdir } from "node:fs/promises";
|
|
1
|
+
import { mkdir, readFile, readdir, writeFile } from "node:fs/promises";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
+
import { REGISTRY_FILE, parseRegistry, renderRegistry } from "./registry.js";
|
|
3
4
|
/**
|
|
4
5
|
* Resolve the global ghostrail config directory that holds account-level
|
|
5
6
|
* settings and shared artifacts across all factory instances:
|
|
@@ -49,6 +50,29 @@ export class GlobalStore {
|
|
|
49
50
|
return [];
|
|
50
51
|
}
|
|
51
52
|
}
|
|
53
|
+
registryPath() {
|
|
54
|
+
return join(this.dir, REGISTRY_FILE);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The registered ghostrails. `undefined` means the file exists but could not
|
|
58
|
+
* be trusted, which is deliberately different from `[]` (nothing registered
|
|
59
|
+
* yet): a caller must be able to tell "broken" from "empty" so it can say so.
|
|
60
|
+
*/
|
|
61
|
+
async readRegistry() {
|
|
62
|
+
let raw;
|
|
63
|
+
try {
|
|
64
|
+
raw = await readFile(this.registryPath(), "utf8");
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
return [];
|
|
68
|
+
}
|
|
69
|
+
return parseRegistry(raw);
|
|
70
|
+
}
|
|
71
|
+
/** Write the registry, creating the global dir if this is the first entry. */
|
|
72
|
+
async writeRegistry(entries) {
|
|
73
|
+
await mkdir(this.dir, { recursive: true });
|
|
74
|
+
await writeFile(this.registryPath(), renderRegistry(entries), "utf8");
|
|
75
|
+
}
|
|
52
76
|
/** An artifact's contents by name (with or without `.md`), or undefined. */
|
|
53
77
|
async readArtifact(name) {
|
|
54
78
|
for (const candidate of new Set([name, artifactFileName(name)])) {
|
package/dist/global/store.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/global/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/global/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAkB,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAO7F;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAc,EAAE,OAAe;IAC9D,IAAI,GAAG,CAAC,cAAc,KAAK,SAAS,IAAI,GAAG,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC,cAAc,CAAC;IACjG,MAAM,IAAI,GACR,GAAG,CAAC,eAAe,KAAK,SAAS,IAAI,GAAG,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC;QACjE,CAAC,CAAC,GAAG,CAAC,eAAe;QACrB,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC/B,OAAO,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;AACjC,CAAC;AAED,yDAAyD;AACzD,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,OAAO,IAAI,CAAC,QAAQ,CAAC,KAA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E,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3C,MAAM,SAAS,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC;IACxE,CAAC;IAED,4EAA4E;IAC5E,KAAK,CAAC,YAAY,CAAC,IAAY;QAC7B,KAAK,MAAM,SAAS,IAAI,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;YAChE,IAAI,CAAC;gBACH,OAAO,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,WAAW,EAAE,SAAS,CAAC,EAAE,MAAM,CAAC,CAAC;YACxE,CAAC;YAAC,MAAM,CAAC;gBACP,yBAAyB;YAC3B,CAAC;QACH,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a customized scaffolded file is missing relative to the template it came
|
|
3
|
+
* from. The manifest records a hash per file, not the text, so a three-way
|
|
4
|
+
* merge is impossible for repos that already exist. What is possible, and what
|
|
5
|
+
* every hand port has actually consisted of, is naming the two things a
|
|
6
|
+
* template gains that a prompt must mention to work: a placeholder the renderer
|
|
7
|
+
* substitutes, and a field the result parser reads.
|
|
8
|
+
*/
|
|
9
|
+
/** Placeholders and result-document fields a file is missing. */
|
|
10
|
+
export interface Signals {
|
|
11
|
+
/** `{{name}}` placeholders the template renders and this file never mentions. */
|
|
12
|
+
placeholders: string[];
|
|
13
|
+
/** Result-document keys the template documents and this file does not. */
|
|
14
|
+
fields: string[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Every distinct `{{name}}` in the text, sorted and deduplicated. The array is
|
|
18
|
+
* fresh on every call, so a caller may keep or mutate it freely.
|
|
19
|
+
*
|
|
20
|
+
* Case is preserved and significant: `{{ID}}` and `{{id}}` are two entries and
|
|
21
|
+
* both are extracted. This is a syntactic scan, so a template writing `{{ID}}`
|
|
22
|
+
* yields `ID` even though the renderer would not substitute it. That is a bug
|
|
23
|
+
* in the template, and hiding it helps nobody.
|
|
24
|
+
*/
|
|
25
|
+
export declare function extractPlaceholders(text: string): string[];
|
|
26
|
+
/**
|
|
27
|
+
* Every distinct JSON key named on a line that also mentions `"status"`.
|
|
28
|
+
*
|
|
29
|
+
* Scoping to those lines is what keeps prose elsewhere in a prompt from
|
|
30
|
+
* contributing a field. `status` itself is excluded: it is the discriminator,
|
|
31
|
+
* present in every example, and never the thing a repo is missing.
|
|
32
|
+
*/
|
|
33
|
+
export declare function extractResultFields(text: string): string[];
|
|
34
|
+
/**
|
|
35
|
+
* What `template` has and `current` lacks. The difference runs one way only: a
|
|
36
|
+
* repo carrying extra placeholders or fields is ahead or simply different, not
|
|
37
|
+
* drifting behind, and `--update` has nothing to say about that.
|
|
38
|
+
*/
|
|
39
|
+
export declare function missingSignals(current: string, template: string): Signals;
|
|
40
|
+
/** True when there is nothing for a human to place. */
|
|
41
|
+
export declare function isClean(signals: Signals): boolean;
|
|
42
|
+
/** The prompt roles a config can name, in report order. */
|
|
43
|
+
export type PromptRole = "agent" | "respond" | "triage";
|
|
44
|
+
/** Prompt paths a config names, by role. A role the config omits is absent. */
|
|
45
|
+
export type PromptPaths = Partial<Record<PromptRole, string>>;
|
|
46
|
+
/**
|
|
47
|
+
* Pair a template file with the repo file that plays the same part.
|
|
48
|
+
*
|
|
49
|
+
* The template's own config says which of its files fills each prompt role; the
|
|
50
|
+
* repo's config says where that role lives in the repo. Pairing by role rather
|
|
51
|
+
* than by path is the whole point: a repo that relocated its prompts (as
|
|
52
|
+
* testbotpro did, to `ghostrail/prompts/`) was invisible to a path-based
|
|
53
|
+
* comparison, which reported every real prompt as missing and named three files
|
|
54
|
+
* that do not exist.
|
|
55
|
+
*
|
|
56
|
+
* Two absences need opposite answers, which is why `repoPrompts` is nullable:
|
|
57
|
+
*
|
|
58
|
+
* - `undefined` means the repo's config could not be read or parsed. Nothing is
|
|
59
|
+
* known about where anything lives, so fall back to the template's own path.
|
|
60
|
+
* Treating it as "no roles configured" would skip every prompt in the repo and
|
|
61
|
+
* report nothing at all, which is worse than guessing.
|
|
62
|
+
* - A present object with the role missing means the config was read and simply
|
|
63
|
+
* does not enable that stage. There is nothing to compare, so skip it.
|
|
64
|
+
*
|
|
65
|
+
* Anything that is not a template prompt keeps its own relative path.
|
|
66
|
+
*/
|
|
67
|
+
export declare function repoPathFor(templateRel: string, templatePrompts: PromptPaths, repoPrompts: PromptPaths | undefined): string | undefined;
|
|
68
|
+
//# sourceMappingURL=drift.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drift.d.ts","sourceRoot":"","sources":["../../src/init/drift.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,iEAAiE;AACjE,MAAM,WAAW,OAAO;IACtB,iFAAiF;IACjF,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,0EAA0E;IAC1E,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAiBD;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAI1D;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAU1D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAOzE;AAED,uDAAuD;AACvD,wBAAgB,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAEjD;AAED,2DAA2D;AAC3D,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAC;AAExD,+EAA+E;AAC/E,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,WAAW,CACzB,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,WAAW,EAC5B,WAAW,EAAE,WAAW,GAAG,SAAS,GACnC,MAAM,GAAG,SAAS,CAOpB"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a customized scaffolded file is missing relative to the template it came
|
|
3
|
+
* from. The manifest records a hash per file, not the text, so a three-way
|
|
4
|
+
* merge is impossible for repos that already exist. What is possible, and what
|
|
5
|
+
* every hand port has actually consisted of, is naming the two things a
|
|
6
|
+
* template gains that a prompt must mention to work: a placeholder the renderer
|
|
7
|
+
* substitutes, and a field the result parser reads.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* `{{name}}`, with no inner spaces. The renderer substitutes exactly this
|
|
11
|
+
* shape, so `{{ id }}` is deliberately not a match: reporting it would send
|
|
12
|
+
* someone chasing a placeholder that never fires.
|
|
13
|
+
*/
|
|
14
|
+
const PLACEHOLDER = /\{\{([A-Za-z0-9_]+)\}\}/g;
|
|
15
|
+
/** A JSON key. Applied only to lines that also mention `"status"`. */
|
|
16
|
+
const JSON_KEY = /"([A-Za-z0-9_]+)"\s*:/g;
|
|
17
|
+
/** Sorted, deduplicated. A set with a stable order, so output never churns. */
|
|
18
|
+
function sortedSet(values) {
|
|
19
|
+
return [...new Set(values)].sort();
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Every distinct `{{name}}` in the text, sorted and deduplicated. The array is
|
|
23
|
+
* fresh on every call, so a caller may keep or mutate it freely.
|
|
24
|
+
*
|
|
25
|
+
* Case is preserved and significant: `{{ID}}` and `{{id}}` are two entries and
|
|
26
|
+
* both are extracted. This is a syntactic scan, so a template writing `{{ID}}`
|
|
27
|
+
* yields `ID` even though the renderer would not substitute it. That is a bug
|
|
28
|
+
* in the template, and hiding it helps nobody.
|
|
29
|
+
*/
|
|
30
|
+
export function extractPlaceholders(text) {
|
|
31
|
+
const names = [];
|
|
32
|
+
for (const match of text.matchAll(PLACEHOLDER))
|
|
33
|
+
names.push(match[1]);
|
|
34
|
+
return sortedSet(names);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Every distinct JSON key named on a line that also mentions `"status"`.
|
|
38
|
+
*
|
|
39
|
+
* Scoping to those lines is what keeps prose elsewhere in a prompt from
|
|
40
|
+
* contributing a field. `status` itself is excluded: it is the discriminator,
|
|
41
|
+
* present in every example, and never the thing a repo is missing.
|
|
42
|
+
*/
|
|
43
|
+
export function extractResultFields(text) {
|
|
44
|
+
const fields = [];
|
|
45
|
+
for (const line of text.split("\n")) {
|
|
46
|
+
if (!line.includes('"status"'))
|
|
47
|
+
continue;
|
|
48
|
+
for (const match of line.matchAll(JSON_KEY)) {
|
|
49
|
+
const key = match[1];
|
|
50
|
+
if (key !== "status")
|
|
51
|
+
fields.push(key);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return sortedSet(fields);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* What `template` has and `current` lacks. The difference runs one way only: a
|
|
58
|
+
* repo carrying extra placeholders or fields is ahead or simply different, not
|
|
59
|
+
* drifting behind, and `--update` has nothing to say about that.
|
|
60
|
+
*/
|
|
61
|
+
export function missingSignals(current, template) {
|
|
62
|
+
const has = (values) => new Set(values);
|
|
63
|
+
const mine = { p: has(extractPlaceholders(current)), f: has(extractResultFields(current)) };
|
|
64
|
+
return {
|
|
65
|
+
placeholders: extractPlaceholders(template).filter((name) => !mine.p.has(name)),
|
|
66
|
+
fields: extractResultFields(template).filter((name) => !mine.f.has(name)),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/** True when there is nothing for a human to place. */
|
|
70
|
+
export function isClean(signals) {
|
|
71
|
+
return signals.placeholders.length === 0 && signals.fields.length === 0;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Pair a template file with the repo file that plays the same part.
|
|
75
|
+
*
|
|
76
|
+
* The template's own config says which of its files fills each prompt role; the
|
|
77
|
+
* repo's config says where that role lives in the repo. Pairing by role rather
|
|
78
|
+
* than by path is the whole point: a repo that relocated its prompts (as
|
|
79
|
+
* testbotpro did, to `ghostrail/prompts/`) was invisible to a path-based
|
|
80
|
+
* comparison, which reported every real prompt as missing and named three files
|
|
81
|
+
* that do not exist.
|
|
82
|
+
*
|
|
83
|
+
* Two absences need opposite answers, which is why `repoPrompts` is nullable:
|
|
84
|
+
*
|
|
85
|
+
* - `undefined` means the repo's config could not be read or parsed. Nothing is
|
|
86
|
+
* known about where anything lives, so fall back to the template's own path.
|
|
87
|
+
* Treating it as "no roles configured" would skip every prompt in the repo and
|
|
88
|
+
* report nothing at all, which is worse than guessing.
|
|
89
|
+
* - A present object with the role missing means the config was read and simply
|
|
90
|
+
* does not enable that stage. There is nothing to compare, so skip it.
|
|
91
|
+
*
|
|
92
|
+
* Anything that is not a template prompt keeps its own relative path.
|
|
93
|
+
*/
|
|
94
|
+
export function repoPathFor(templateRel, templatePrompts, repoPrompts) {
|
|
95
|
+
const roles = ["agent", "respond", "triage"];
|
|
96
|
+
for (const role of roles) {
|
|
97
|
+
if (templatePrompts[role] !== templateRel)
|
|
98
|
+
continue;
|
|
99
|
+
return repoPrompts === undefined ? templateRel : repoPrompts[role];
|
|
100
|
+
}
|
|
101
|
+
return templateRel;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=drift.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drift.js","sourceRoot":"","sources":["../../src/init/drift.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAUH;;;;GAIG;AACH,MAAM,WAAW,GAAG,0BAA0B,CAAC;AAE/C,sEAAsE;AACtE,MAAM,QAAQ,GAAG,wBAAwB,CAAC;AAE1C,+EAA+E;AAC/E,SAAS,SAAS,CAAC,MAAwB;IACzC,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC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AAO,KAAK,EACV,KAAK,EAEL,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,SAAS,
|
|
1
|
+
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/loop/engine.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAa,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAY,MAAM,oBAAoB,CAAC;AAG9D,OAAO,KAAK,EACV,KAAK,EAEL,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,SAAS,EAET,MAAM,EAEP,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAa,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzD,qDAAqD;AACrD,MAAM,WAAW,QAAQ;IACvB,8EAA8E;IAC9E,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;IACX,SAAS,EAAE,SAAS,CAAC;IACrB,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,6EAA6E;IAC7E,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,4EAA4E;IAC5E,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAqDD;;;;;;;;;;;;GAYG;AACH,wBAAsB,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC,CA4B1F"}
|
package/dist/loop/engine.js
CHANGED
|
@@ -199,10 +199,17 @@ async function route(deps, config, item, workspace, outcome, logger) {
|
|
|
199
199
|
await deps.source.reset(item);
|
|
200
200
|
return { itemId: item.id, state: "failed", error: outcome.error };
|
|
201
201
|
case "done":
|
|
202
|
-
return routeDone(deps, config, item, workspace, outcome.summary, outcome
|
|
202
|
+
return routeDone(deps, config, item, workspace, outcome.summary, prContent(outcome), logger);
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
|
-
|
|
205
|
+
/** The optional PR parts of a done outcome, dropping the fields the agent omitted. */
|
|
206
|
+
function prContent(outcome) {
|
|
207
|
+
return {
|
|
208
|
+
...(outcome.type === undefined ? {} : { commitType: outcome.type }),
|
|
209
|
+
...(outcome.testPlan === undefined ? {} : { testPlan: outcome.testPlan }),
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
async function routeDone(deps, config, item, workspace, summary, content, logger) {
|
|
206
213
|
if (config.gate.commands.length > 0) {
|
|
207
214
|
const gate = await deps.gate.run({
|
|
208
215
|
backend: deps.backend,
|
|
@@ -221,14 +228,14 @@ async function routeDone(deps, config, item, workspace, summary, type, logger) {
|
|
|
221
228
|
if (!config.output.openPr) {
|
|
222
229
|
return { itemId: item.id, state: "done", summary, gate };
|
|
223
230
|
}
|
|
224
|
-
const pr = await deps.publisher.openPullRequest(item, workspace, summary,
|
|
231
|
+
const pr = await deps.publisher.openPullRequest(item, workspace, summary, content);
|
|
225
232
|
logger.info(`${item.id}: opened ${pr.url}`);
|
|
226
233
|
return { itemId: item.id, state: "done", summary, gate, prUrl: pr.url };
|
|
227
234
|
}
|
|
228
235
|
if (!config.output.openPr) {
|
|
229
236
|
return { itemId: item.id, state: "done", summary };
|
|
230
237
|
}
|
|
231
|
-
const pr = await deps.publisher.openPullRequest(item, workspace, summary,
|
|
238
|
+
const pr = await deps.publisher.openPullRequest(item, workspace, summary, content);
|
|
232
239
|
logger.info(`${item.id}: opened ${pr.url}`);
|
|
233
240
|
return { itemId: item.id, state: "done", summary, prUrl: pr.url };
|
|
234
241
|
}
|
package/dist/loop/engine.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.js","sourceRoot":"","sources":["../../src/loop/engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"engine.js","sourceRoot":"","sources":["../../src/loop/engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAiCtD,MAAM,UAAU,GAAW,EAAE,IAAI,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,CAAC;AAE9D,0EAA0E;AAC1E,KAAK,UAAU,SAAS,CAAC,IAA2B,EAAE,KAAe;IACnE,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO;IAC/B,IAAI,CAAC;QACH,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;IAAC,MAAM,CAAC;QACP,2BAA2B;IAC7B,CAAC;AACH,CAAC;AAED,iFAAiF;AACjF,KAAK,UAAU,YAAY,CACzB,IAA2B,EAC3B,KAAa,EACb,MAAiB;IAEjB,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO;IAC/B,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACtB,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,EAAE,KAAK,IAAI,EAAE,EAAE,CAAC;QAC5C,MAAM,SAAS,CAAC,IAAI,EAAE,EAAE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AAG,EAAE,CAAC,CAAC;IAC5C,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC;AACpE,CAAC"}
|
package/dist/loop/ports.d.ts
CHANGED
|
@@ -75,6 +75,13 @@ export type AgentOutcome = {
|
|
|
75
75
|
summary: string;
|
|
76
76
|
/** Conventional-commit type the agent chose (feat/fix/docs/...); sets the commit + PR title. */
|
|
77
77
|
type?: string;
|
|
78
|
+
/**
|
|
79
|
+
* How a reviewer checks this change by hand. Absent when the agent did
|
|
80
|
+
* not offer one, which is the norm for a repo whose scaffolded prompt
|
|
81
|
+
* predates the field; the PR body then omits the section rather than
|
|
82
|
+
* heading an empty one.
|
|
83
|
+
*/
|
|
84
|
+
testPlan?: string;
|
|
78
85
|
} | {
|
|
79
86
|
status: "blocked";
|
|
80
87
|
questions: string;
|
|
@@ -128,10 +135,21 @@ export interface PullRequest {
|
|
|
128
135
|
number: number;
|
|
129
136
|
url: string;
|
|
130
137
|
}
|
|
138
|
+
/**
|
|
139
|
+
* The optional narrative parts of a factory pull request. These arrived as two
|
|
140
|
+
* bare trailing strings, which is exactly the shape a caller transposes, so
|
|
141
|
+
* they travel together and named.
|
|
142
|
+
*/
|
|
143
|
+
export interface PullRequestContent {
|
|
144
|
+
/** Conventional-commit type; sets the commit and PR title. Falls back to the publisher's default. */
|
|
145
|
+
commitType?: string;
|
|
146
|
+
/** How a reviewer checks the change by hand. Omitted from the body when absent. */
|
|
147
|
+
testPlan?: string;
|
|
148
|
+
}
|
|
131
149
|
/** Opens the pull request for a green run. Never merges. */
|
|
132
150
|
export interface Publisher {
|
|
133
151
|
/** Open a PR for a green run. `commitType` overrides the default conventional-commit type. */
|
|
134
|
-
openPullRequest(item: WorkItem, workspace: Workspace, summary: string,
|
|
152
|
+
openPullRequest(item: WorkItem, workspace: Workspace, summary: string, content?: PullRequestContent): Promise<PullRequest>;
|
|
135
153
|
}
|
|
136
154
|
/** A single-holder lock (the `flock` analog) so only one run executes at a time. */
|
|
137
155
|
export interface Lock {
|
package/dist/loop/ports.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ports.d.ts","sourceRoot":"","sources":["../../src/loop/ports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEnE;;;;;;GAMG;AAEH,2CAA2C;AAC3C,MAAM,WAAW,QAAQ;IACvB,yCAAyC;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,mEAAmE;AACnE,MAAM,WAAW,OAAO;IACtB,0BAA0B;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,4DAA4D;AAC5D,MAAM,WAAW,MAAM;IACrB,kEAAkE;IAClE,YAAY,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IACpC;;;OAGG;IACH,KAAK,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACxC,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrD,2EAA2E;IAC3E,YAAY,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IACjD,0EAA0E;IAC1E,eAAe,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,mEA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B,kCAAkC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,0EAA0E;AAC1E,MAAM,WAAW,IAAI;IACnB,GAAG,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CAChD;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,qGAAqG;IACrG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mFAAmF;IACnF,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,4DAA4D;AAC5D,MAAM,WAAW,SAAS;IACxB,8FAA8F;IAC9F,eAAe,CACb,IAAI,EAAE,QAAQ,EACd,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,WAAW,CAAC,CAAC;CACzB;AAED,oFAAoF;AACpF,MAAM,WAAW,IAAI;IACnB,6DAA6D;IAC7D,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B;AAED,mEAAmE;AACnE,MAAM,WAAW,MAAM;IACrB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B"}
|
|
@@ -81,8 +81,14 @@ export declare function parsePrUrl(stdout: string): PrRef;
|
|
|
81
81
|
*/
|
|
82
82
|
export declare function commitMessage(id: string, title: string, type?: string): string;
|
|
83
83
|
/**
|
|
84
|
-
* Build the PR body: the agent's summary
|
|
85
|
-
*
|
|
84
|
+
* Build the PR body: the agent's summary under a heading, an optional test plan
|
|
85
|
+
* under its own, a ruled-off footer linking the tracker item, and the hidden
|
|
86
|
+
* ghostrail marker so the respond pass can recognize its own PRs.
|
|
87
|
+
*
|
|
88
|
+
* The summary is trimmed and otherwise passed through byte for byte. Agents
|
|
89
|
+
* write it as one long paragraph and it is tempting to reflow, but guessing at
|
|
90
|
+
* paragraph breaks would corrupt code fences and lists. Structure comes from
|
|
91
|
+
* the headings around it; the prose itself is the prompt's job.
|
|
86
92
|
*/
|
|
87
|
-
export declare function prBody(item: WorkItem, summary: string): string;
|
|
93
|
+
export declare function prBody(item: WorkItem, summary: string, testPlan?: string): string;
|
|
88
94
|
//# sourceMappingURL=githost.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"githost.d.ts","sourceRoot":"","sources":["../../src/publish/githost.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,4FAA4F;AAC5F,eAAO,MAAM,gBAAgB,uBAAuB,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,WAAW,eAAe,CAAC;AAExC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,IAAI,MAAM,EAAE,EAAE,CAK5C;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAOxD;AAED,MAAM,WAAW,MAAM;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,wDAAwD;IACxD,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,KAAK;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb;AAED,wCAAwC;AACxC,MAAM,WAAW,MAAM;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,yBAA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AM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,SAAQ,GAAG,MAAM,CAE7E;AAED;;;;;;;;;GASG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAejF"}
|
package/dist/publish/githost.js
CHANGED
|
@@ -62,11 +62,25 @@ export function commitMessage(id, title, type = "fix") {
|
|
|
62
62
|
return `${type}: ${title} (${id})`;
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
|
-
* Build the PR body: the agent's summary
|
|
66
|
-
*
|
|
65
|
+
* Build the PR body: the agent's summary under a heading, an optional test plan
|
|
66
|
+
* under its own, a ruled-off footer linking the tracker item, and the hidden
|
|
67
|
+
* ghostrail marker so the respond pass can recognize its own PRs.
|
|
68
|
+
*
|
|
69
|
+
* The summary is trimmed and otherwise passed through byte for byte. Agents
|
|
70
|
+
* write it as one long paragraph and it is tempting to reflow, but guessing at
|
|
71
|
+
* paragraph breaks would corrupt code fences and lists. Structure comes from
|
|
72
|
+
* the headings around it; the prose itself is the prompt's job.
|
|
67
73
|
*/
|
|
68
|
-
export function prBody(item, summary) {
|
|
69
|
-
const lines = [
|
|
74
|
+
export function prBody(item, summary, testPlan) {
|
|
75
|
+
const lines = ["## What changed", "", summary.trim()];
|
|
76
|
+
// Only when there is one: a heading over nothing is worse than no heading.
|
|
77
|
+
const plan = testPlan?.trim();
|
|
78
|
+
if (plan !== undefined && plan.length > 0) {
|
|
79
|
+
lines.push("", "## How to test", "", plan);
|
|
80
|
+
}
|
|
81
|
+
// The rule separates ghostrail's own text from the agent's. Running them
|
|
82
|
+
// together is a good part of what made the old body hard to scan.
|
|
83
|
+
lines.push("", "---", "", `Factory run for ${item.id}.`);
|
|
70
84
|
if (item.url !== undefined && item.url.length > 0)
|
|
71
85
|
lines.push(item.url);
|
|
72
86
|
lines.push("", GHOSTRAIL_MARKER);
|
|
@@ -1 +1 @@
|
|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E,IAAI,GAAG,KAAK;IACnE,OAAO,GAAG,IAAI,KAAK,KAAK,KAAK,EAAE,GAAG,CAAC;AACrC,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,MAAM,CAAC,IAAc,EAAE,OAAe,EAAE,QAAiB;IACvE,MAAM,KAAK,GAAG,CAAC,iBAAiB,EAAE,EAAE,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IAEtD,2EAA2E;IAC3E,MAAM,IAAI,GAAG,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1C,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,gBAAgB,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED,yEAAyE;IACzE,kEAAkE;IAClE,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,mBAAmB,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;IACzD,IAAI,IAAI,CAAC,GAAG,KAAK,SAAS,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACxE,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,gBAAgB,CAAC,CAAC;IACjC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Backend, Workspace } from "../backend/types.js";
|
|
2
|
-
import type { Publisher, PullRequest, WorkItem } from "../loop/ports.js";
|
|
2
|
+
import type { Publisher, PullRequest, PullRequestContent, WorkItem } from "../loop/ports.js";
|
|
3
3
|
import type { GitHost } from "./githost.js";
|
|
4
4
|
export interface PublisherOptions {
|
|
5
5
|
baseBranch: string;
|
|
@@ -24,7 +24,7 @@ export declare class GitHubPublisher implements Publisher {
|
|
|
24
24
|
private readonly commitType;
|
|
25
25
|
private readonly draft;
|
|
26
26
|
constructor(backend: Backend, host: GitHost, options: PublisherOptions);
|
|
27
|
-
openPullRequest(item: WorkItem, workspace: Workspace, summary: string,
|
|
27
|
+
openPullRequest(item: WorkItem, workspace: Workspace, summary: string, content?: PullRequestContent): Promise<PullRequest>;
|
|
28
28
|
/**
|
|
29
29
|
* Push the branch, recovering from the one rejection a factory retry causes
|
|
30
30
|
* on its own.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-publisher.d.ts","sourceRoot":"","sources":["../../src/publish/github-publisher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"github-publisher.d.ts","sourceRoot":"","sources":["../../src/publish/github-publisher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC7F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAG5C,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,kEAAkE;IAClE,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,6EAA6E;IAC7E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wDAAwD;IACxD,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;;GAKG;AACH,qBAAa,eAAgB,YAAW,SAAS;IAC/C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;IAClC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAU;IAC/B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoB;IAC3C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAU;gBAEpB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,gBAAgB;IAShE,eAAe,CACnB,IAAI,EAAE,QAAQ,EACd,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,WAAW,CAAC;IA2BvB;;;;;;;;;;;;;;;;;;;;;OAqBG;YACW,IAAI;YAsBJ,GAAG;CAQlB"}
|
|
@@ -20,8 +20,8 @@ export class GitHubPublisher {
|
|
|
20
20
|
this.commitType = options.commitType ?? "fix";
|
|
21
21
|
this.draft = options.draft ?? false;
|
|
22
22
|
}
|
|
23
|
-
async openPullRequest(item, workspace, summary,
|
|
24
|
-
const type = commitType ?? this.commitType;
|
|
23
|
+
async openPullRequest(item, workspace, summary, content = {}) {
|
|
24
|
+
const type = content.commitType ?? this.commitType;
|
|
25
25
|
for (const args of gitStageAllArgs())
|
|
26
26
|
await this.git(workspace, args);
|
|
27
27
|
const commit = await this.backend.exec(workspace, [
|
|
@@ -38,7 +38,7 @@ export class GitHubPublisher {
|
|
|
38
38
|
baseBranch: this.baseBranch,
|
|
39
39
|
headBranch: workspace.branch,
|
|
40
40
|
title: commitMessage(item.id, item.title, type),
|
|
41
|
-
body: prBody(item, summary),
|
|
41
|
+
body: prBody(item, summary, content.testPlan),
|
|
42
42
|
labels: this.labels,
|
|
43
43
|
draft: this.draft,
|
|
44
44
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-publisher.js","sourceRoot":"","sources":["../../src/publish/github-publisher.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,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;IACnF,CAAC;IAEO,KAAK,CAAC,GAAG,CAAC,SAAoB,EAAE,IAAuB;QAC7D,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;QACpE,IAAI,MAAM,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CACb,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAChF,CAAC;QACJ,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { type InstallOutcome, type ManagerKind, type ServiceManager, detectManager, disableAndStop, enableAndStart, installUnit, reload, removeUnit, systemdManager, systemdUnitDir, unitStates, } from "./manager.js";
|
|
2
|
+
export { type UnitSpec, parseUnitStates, renderSystemdUnit, stopTimeoutSeconds, unitName, } from "./unit.js";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/service/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,aAAa,EACb,cAAc,EACd,cAAc,EACd,WAAW,EACX,MAAM,EACN,UAAU,EACV,cAAc,EACd,cAAc,EACd,UAAU,GACX,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,KAAK,QAAQ,EACb,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,QAAQ,GACT,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { detectManager, disableAndStop, enableAndStart, installUnit, reload, removeUnit, systemdManager, systemdUnitDir, unitStates, } from "./manager.js";
|
|
2
|
+
export { parseUnitStates, renderSystemdUnit, stopTimeoutSeconds, unitName, } from "./unit.js";
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/service/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,aAAa,EACb,cAAc,EACd,cAAc,EACd,WAAW,EACX,MAAM,EACN,UAAU,EACV,cAAc,EACd,cAAc,EACd,UAAU,GACX,MAAM,cAAc,CAAC;AACtB,OAAO,EAEL,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,QAAQ,GACT,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { type UnitSpec } from "./unit.js";
|
|
2
|
+
/**
|
|
3
|
+
* Talking to the platform's user service manager. Detection is deliberate:
|
|
4
|
+
* "no service manager" and "a service manager this does not support yet" are
|
|
5
|
+
* different answers and deserve different messages.
|
|
6
|
+
*/
|
|
7
|
+
export type ManagerKind = "systemd" | "launchd" | "none";
|
|
8
|
+
/** Which manager this platform offers, whether or not it is supported. */
|
|
9
|
+
export declare function detectManager(): Promise<ManagerKind>;
|
|
10
|
+
/** Where systemd looks for this user's units. */
|
|
11
|
+
export declare function systemdUnitDir(env?: NodeJS.ProcessEnv): string;
|
|
12
|
+
/** What `install` did with one unit, so the caller can report it honestly. */
|
|
13
|
+
export type InstallOutcome = "written" | "unchanged" | "hand-edited";
|
|
14
|
+
/**
|
|
15
|
+
* Write a unit unless it is already right, or has been edited.
|
|
16
|
+
*
|
|
17
|
+
* An edited unit is never overwritten. Same instinct as `init --update`: a
|
|
18
|
+
* customization is deliberate until proven otherwise, and silently reverting
|
|
19
|
+
* one is the kind of thing that makes a tool untrustworthy.
|
|
20
|
+
*/
|
|
21
|
+
export declare function installUnit(spec: UnitSpec, env?: NodeJS.ProcessEnv): Promise<{
|
|
22
|
+
outcome: InstallOutcome;
|
|
23
|
+
unit: string;
|
|
24
|
+
file: string;
|
|
25
|
+
}>;
|
|
26
|
+
/** Reload the manager so a newly written unit is visible. */
|
|
27
|
+
export declare function reload(): Promise<void>;
|
|
28
|
+
/** Enable and start a unit. Returns an error message, or undefined on success. */
|
|
29
|
+
export declare function enableAndStart(unit: string): Promise<string | undefined>;
|
|
30
|
+
/**
|
|
31
|
+
* Stop and disable a unit.
|
|
32
|
+
*
|
|
33
|
+
* This can genuinely take minutes: an in-flight tick is not interrupted, so the
|
|
34
|
+
* manager waits out the current agent run. Callers should say so before this
|
|
35
|
+
* starts rather than letting it look hung.
|
|
36
|
+
*/
|
|
37
|
+
export declare function disableAndStop(unit: string): Promise<string | undefined>;
|
|
38
|
+
/** Remove a unit file. Absent is success: the goal is that it is not there. */
|
|
39
|
+
export declare function removeUnit(unit: string, env?: NodeJS.ProcessEnv): Promise<void>;
|
|
40
|
+
/** Active state per unit, for the units asked about. */
|
|
41
|
+
export declare function unitStates(units: readonly string[]): Promise<Map<string, string>>;
|
|
42
|
+
/**
|
|
43
|
+
* The service manager, behind a seam.
|
|
44
|
+
*
|
|
45
|
+
* This is injectable for one blunt reason: without it, a test that calls
|
|
46
|
+
* `ghostrail start` installs and enables real user services on the developer's
|
|
47
|
+
* machine. That is not hypothetical. Writing these tests did exactly that,
|
|
48
|
+
* leaving four enabled units crash-looping against deleted temp directories,
|
|
49
|
+
* because the default unit directory falls back to the real `~/.config` and
|
|
50
|
+
* `systemctl enable --now` does what it is told.
|
|
51
|
+
*
|
|
52
|
+
* A command must be drivable without touching the machine it runs on.
|
|
53
|
+
*/
|
|
54
|
+
export interface ServiceManager {
|
|
55
|
+
kind(): Promise<ManagerKind>;
|
|
56
|
+
install(spec: UnitSpec): Promise<{
|
|
57
|
+
outcome: InstallOutcome;
|
|
58
|
+
unit: string;
|
|
59
|
+
file: string;
|
|
60
|
+
}>;
|
|
61
|
+
/** Enable and start. Returns an error message, or undefined on success. */
|
|
62
|
+
enable(unit: string): Promise<string | undefined>;
|
|
63
|
+
/** Stop and disable. Returns an error message, or undefined on success. */
|
|
64
|
+
disable(unit: string): Promise<string | undefined>;
|
|
65
|
+
states(units: readonly string[]): Promise<Map<string, string>>;
|
|
66
|
+
}
|
|
67
|
+
/** The real one: systemd through `systemctl --user`. */
|
|
68
|
+
export declare function systemdManager(env?: NodeJS.ProcessEnv): ServiceManager;
|
|
69
|
+
//# sourceMappingURL=manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/service/manager.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,QAAQ,EAAgD,MAAM,WAAW,CAAC;AAExF;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;AAEzD,0EAA0E;AAC1E,wBAAsB,aAAa,IAAI,OAAO,CAAC,WAAW,CAAC,CAU1D;AAED,iDAAiD;AACjD,wBAAgB,cAAc,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAG3E;AAED,8EAA8E;AAC9E,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,WAAW,GAAG,aAAa,CAAC;AAErE;;;;;;GAMG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,QAAQ,EACd,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,OAAO,CAAC;IAAE,OAAO,EAAE,cAAc,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAkBlE;AAQD,6DAA6D;AAC7D,wBAAsB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAE5C;AAED,kFAAkF;AAClF,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAG9E;AAED;;;;;;GAMG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS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