@bluewombat/conductor 0.9.0 → 0.10.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/SPECS.md +54 -20
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/run/delivery.d.ts +114 -0
- package/dist/run/delivery.d.ts.map +1 -0
- package/dist/run/delivery.js +278 -0
- package/dist/run/delivery.js.map +1 -0
- package/dist/run/open-conductor.d.ts +51 -30
- package/dist/run/open-conductor.d.ts.map +1 -1
- package/dist/run/open-conductor.js +286 -247
- package/dist/run/open-conductor.js.map +1 -1
- package/dist/run/results.d.ts +17 -0
- package/dist/run/results.d.ts.map +1 -0
- package/dist/run/results.js +2 -0
- package/dist/run/results.js.map +1 -0
- package/dist/run/subject.d.ts +12 -0
- package/dist/run/subject.d.ts.map +1 -0
- package/dist/run/subject.js +33 -0
- package/dist/run/subject.js.map +1 -0
- package/dist/transformers/port.d.ts +47 -6
- package/dist/transformers/port.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { CommandResult, WorkLedger } from "@bluewombat/work-ledger";
|
|
2
2
|
import type { AuthorityPort, TransformerPort } from "../transformers/port.js";
|
|
3
|
-
|
|
3
|
+
import type { ProjectRunResult } from "./results.js";
|
|
4
|
+
export type { ConductorRefusalCode, ProjectRunResult } from "./results.js";
|
|
5
|
+
export { foldMessageOf, subjectOf } from "./subject.js";
|
|
4
6
|
/** Prepare a Ticket workspace after Isolation — install deps, and so on. */
|
|
5
7
|
export type WarmOutcome = "warmed" | "failed" | "interrupted" | "invalid-invocation";
|
|
6
8
|
export type WarmPort = {
|
|
@@ -11,20 +13,18 @@ export type WarmPort = {
|
|
|
11
13
|
outcome: WarmOutcome;
|
|
12
14
|
}>;
|
|
13
15
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} | {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
outcome: "refused";
|
|
27
|
-
code: ConductorRefusalCode;
|
|
16
|
+
/**
|
|
17
|
+
* Bring the shared copy of the work line up to what the Authority holds, for
|
|
18
|
+
* the line `target` names. Conductor asks right before it reads the copy, so a
|
|
19
|
+
* ticket always starts from, and aligns with, the line as it is now.
|
|
20
|
+
*/
|
|
21
|
+
export type LinePort = {
|
|
22
|
+
refresh(target: string): Promise<{
|
|
23
|
+
ok: true;
|
|
24
|
+
} | {
|
|
25
|
+
ok: false;
|
|
26
|
+
detail?: string;
|
|
27
|
+
}>;
|
|
28
28
|
};
|
|
29
29
|
export type OpenConductorOptions = {
|
|
30
30
|
ledger: WorkLedger;
|
|
@@ -32,6 +32,18 @@ export type OpenConductorOptions = {
|
|
|
32
32
|
workLineStable: string;
|
|
33
33
|
workspaceRoot: string;
|
|
34
34
|
transformerDurationMs?: number;
|
|
35
|
+
/**
|
|
36
|
+
* How many Tickets of a Project may be active at once. Default 1.
|
|
37
|
+
*
|
|
38
|
+
* Above 1 the Project needs an Authority: a Ticket folded straight into the
|
|
39
|
+
* work line would move it under the others with nobody to send them back.
|
|
40
|
+
*/
|
|
41
|
+
maxParallel?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Keeps the shared copy of the work line current. Absent: it is whatever its
|
|
44
|
+
* owner left, as before.
|
|
45
|
+
*/
|
|
46
|
+
line?: LinePort;
|
|
35
47
|
/**
|
|
36
48
|
* The outside judge of a Submission. Absent: an assembled ticket is folded
|
|
37
49
|
* into the work line directly, with nobody else asked.
|
|
@@ -44,17 +56,24 @@ export type OpenConductorOptions = {
|
|
|
44
56
|
/**
|
|
45
57
|
* Whether a local judge decides if the assembled ticket meets the
|
|
46
58
|
* intention, before any Submission exists — or, without an Authority,
|
|
47
|
-
* before the final fold. Absent or `false`: `
|
|
59
|
+
* before the final fold. Absent or `false`: `validate` is not
|
|
48
60
|
* declared, and `integrating` goes straight to offer (or the local judge on
|
|
49
61
|
* `produce: false`).
|
|
50
62
|
*/
|
|
51
|
-
|
|
63
|
+
validate?: boolean;
|
|
52
64
|
/**
|
|
53
|
-
* Whether
|
|
65
|
+
* Whether the tests of a Task are written before its code. Then a pass of its
|
|
66
|
+
* own runs in the Ticket's workspace first, and what it wrote is committed as a
|
|
67
|
+
* checkpoint, so the producer's work is what comes after it. Absent or `false`:
|
|
68
|
+
* the producer makes the code and the tests together, as before.
|
|
69
|
+
*/
|
|
70
|
+
tests?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Whether a fix is declared. A validate refusal with nothing to
|
|
54
73
|
* repair it escalates on the spot rather than spending the budget on a round
|
|
55
74
|
* that can only repeat the same refusal.
|
|
56
75
|
*/
|
|
57
|
-
|
|
76
|
+
fixDeclared?: boolean;
|
|
58
77
|
/**
|
|
59
78
|
* Told at the moments a pass changes what an outsider would want to know:
|
|
60
79
|
* the work is submitted. Awaited,
|
|
@@ -83,6 +102,19 @@ export type Conductor = {
|
|
|
83
102
|
pause(): void;
|
|
84
103
|
resume(): void;
|
|
85
104
|
runProject(project: string): Promise<ProjectRunResult>;
|
|
105
|
+
/**
|
|
106
|
+
* Take the next Ticket of the Project that may start, within its parallel
|
|
107
|
+
* limit. Nothing is run. Absent when none may: the Project is full, or
|
|
108
|
+
* nothing is ready or unblocked.
|
|
109
|
+
*/
|
|
110
|
+
claimNext(project: string): Promise<{
|
|
111
|
+
key: string;
|
|
112
|
+
} | undefined>;
|
|
113
|
+
/**
|
|
114
|
+
* Drive one Ticket the Project already holds, as far as it goes. Unlike
|
|
115
|
+
* `runProject` it neither claims nor reconciles, so several can run at once.
|
|
116
|
+
*/
|
|
117
|
+
runTicket(key: string): Promise<ProjectRunResult>;
|
|
86
118
|
cancel(key: string): Promise<CommandResult>;
|
|
87
119
|
/**
|
|
88
120
|
* Drop a held unit without waiting for the bail clock.
|
|
@@ -90,16 +122,5 @@ export type Conductor = {
|
|
|
90
122
|
*/
|
|
91
123
|
release(key: string): Promise<CommandResult>;
|
|
92
124
|
};
|
|
93
|
-
/**
|
|
94
|
-
* A fold's subject out of prose. Text written the way a commit is — a headline,
|
|
95
|
-
* a blank line, the rest — gives its headline. Otherwise the first sentence,
|
|
96
|
-
* cut at a word when even that runs past what one line of history shows. A
|
|
97
|
-
* subject is not markdown, so the backticks prose uses for names come off; and
|
|
98
|
-
* it ends on a word, not on an ellipsis — the whole text follows in the body
|
|
99
|
-
* for whoever wants it.
|
|
100
|
-
*/
|
|
101
|
-
export declare function subjectOf(text: string): string;
|
|
102
|
-
/** Subject line, then the whole text when the subject did not carry it all. */
|
|
103
|
-
export declare function foldMessageOf(text: string): string;
|
|
104
125
|
export declare function openConductor(options: OpenConductorOptions): Conductor;
|
|
105
126
|
//# sourceMappingURL=open-conductor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open-conductor.d.ts","sourceRoot":"","sources":["../../src/run/open-conductor.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,aAAa,EAGb,UAAU,EACX,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"open-conductor.d.ts","sourceRoot":"","sources":["../../src/run/open-conductor.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,aAAa,EAGb,UAAU,EACX,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,aAAa,EAAkB,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAS9F,OAAO,KAAK,EAAwB,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAG3E,YAAY,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAKxD,4EAA4E;AAC5E,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,QAAQ,GAAG,a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