@turri-dev/cli 0.1.6-next.336dd6e → 0.1.7-next.8f13f3a
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/.pi/themes/turri-dark.json +1 -1
- package/README.md +2 -4
- package/assets/jellyfish/dark-00.png +0 -0
- package/assets/jellyfish/dark-01.png +0 -0
- package/assets/jellyfish/dark-02.png +0 -0
- package/assets/jellyfish/dark-03.png +0 -0
- package/assets/jellyfish/dark-04.png +0 -0
- package/assets/jellyfish/dark-05.png +0 -0
- package/assets/jellyfish/dark-06.png +0 -0
- package/assets/jellyfish/dark-07.png +0 -0
- package/assets/jellyfish/dark-08.png +0 -0
- package/assets/jellyfish/dark-09.png +0 -0
- package/assets/jellyfish/dark-10.png +0 -0
- package/assets/jellyfish/dark-11.png +0 -0
- package/assets/jellyfish/dark-12.png +0 -0
- package/assets/jellyfish/dark-13.png +0 -0
- package/assets/jellyfish/dark-14.png +0 -0
- package/assets/jellyfish/dark-15.png +0 -0
- package/assets/jellyfish/dark-16.png +0 -0
- package/assets/jellyfish/dark-17.png +0 -0
- package/assets/jellyfish/dark-18.png +0 -0
- package/assets/jellyfish/dark-19.png +0 -0
- package/assets/jellyfish/dark-20.png +0 -0
- package/assets/jellyfish/dark-21.png +0 -0
- package/assets/jellyfish/dark-22.png +0 -0
- package/assets/jellyfish/dark-23.png +0 -0
- package/assets/jellyfish/dark-24.png +0 -0
- package/assets/jellyfish/dark-25.png +0 -0
- package/assets/jellyfish/dark-26.png +0 -0
- package/assets/jellyfish/dark-27.png +0 -0
- package/assets/jellyfish/dark-28.png +0 -0
- package/assets/jellyfish/dark-29.png +0 -0
- package/assets/jellyfish/dark-30.png +0 -0
- package/assets/jellyfish/dark-31.png +0 -0
- package/assets/jellyfish/dark-32.png +0 -0
- package/assets/jellyfish/dark-33.png +0 -0
- package/assets/jellyfish/dark-34.png +0 -0
- package/assets/jellyfish/dark-35.png +0 -0
- package/assets/jellyfish/dark-36.png +0 -0
- package/assets/jellyfish/dark-37.png +0 -0
- package/assets/jellyfish/dark-38.png +0 -0
- package/assets/jellyfish/dark-39.png +0 -0
- package/assets/jellyfish/dark-40.png +0 -0
- package/assets/jellyfish/light-00.png +0 -0
- package/assets/jellyfish/light-01.png +0 -0
- package/assets/jellyfish/light-02.png +0 -0
- package/assets/jellyfish/light-03.png +0 -0
- package/assets/jellyfish/light-04.png +0 -0
- package/assets/jellyfish/light-05.png +0 -0
- package/assets/jellyfish/light-06.png +0 -0
- package/assets/jellyfish/light-07.png +0 -0
- package/assets/jellyfish/light-08.png +0 -0
- package/assets/jellyfish/light-09.png +0 -0
- package/assets/jellyfish/light-10.png +0 -0
- package/assets/jellyfish/light-11.png +0 -0
- package/assets/jellyfish/light-12.png +0 -0
- package/assets/jellyfish/light-13.png +0 -0
- package/assets/jellyfish/light-14.png +0 -0
- package/assets/jellyfish/light-15.png +0 -0
- package/assets/jellyfish/light-16.png +0 -0
- package/assets/jellyfish/light-17.png +0 -0
- package/assets/jellyfish/light-18.png +0 -0
- package/assets/jellyfish/light-19.png +0 -0
- package/assets/jellyfish/light-20.png +0 -0
- package/assets/jellyfish/light-21.png +0 -0
- package/assets/jellyfish/light-22.png +0 -0
- package/assets/jellyfish/light-23.png +0 -0
- package/assets/jellyfish/light-24.png +0 -0
- package/assets/jellyfish/light-25.png +0 -0
- package/assets/jellyfish/light-26.png +0 -0
- package/assets/jellyfish/light-27.png +0 -0
- package/assets/jellyfish/light-28.png +0 -0
- package/assets/jellyfish/light-29.png +0 -0
- package/assets/jellyfish/light-30.png +0 -0
- package/assets/jellyfish/light-31.png +0 -0
- package/assets/jellyfish/light-32.png +0 -0
- package/assets/jellyfish/light-33.png +0 -0
- package/assets/jellyfish/light-34.png +0 -0
- package/assets/jellyfish/light-35.png +0 -0
- package/assets/jellyfish/light-36.png +0 -0
- package/assets/jellyfish/light-37.png +0 -0
- package/assets/jellyfish/light-38.png +0 -0
- package/assets/jellyfish/light-39.png +0 -0
- package/assets/jellyfish/light-40.png +0 -0
- package/dist/ask.d.ts +83 -0
- package/dist/brand.d.ts +13 -0
- package/dist/btw.d.ts +67 -0
- package/dist/chat-models.d.ts +22 -0
- package/dist/chat-skills.d.ts +17 -0
- package/dist/cli-options.d.ts +25 -0
- package/dist/cli.d.ts +9 -0
- package/dist/cli.js +7 -1
- package/dist/config-command.d.ts +26 -0
- package/dist/config-edit.d.ts +69 -0
- package/dist/config.d.ts +321 -0
- package/dist/conform-cli.d.ts +1 -0
- package/dist/cultivate-cli.d.ts +1 -0
- package/dist/drift-cli.d.ts +1 -0
- package/dist/environment.d.ts +39 -0
- package/dist/environment.js +26 -0
- package/dist/extension.d.ts +147 -0
- package/dist/extension.js +49 -18
- package/dist/genome.d.ts +62 -0
- package/dist/graph.d.ts +52 -0
- package/dist/host.d.ts +21 -0
- package/dist/host.js +25 -0
- package/dist/identity.d.ts +2 -0
- package/dist/init-config.d.ts +106 -0
- package/dist/jellyfish.d.ts +35 -0
- package/dist/jellyfish.js +230 -97
- package/dist/judge.d.ts +25 -0
- package/dist/lineage-cli.d.ts +1 -0
- package/dist/loop-cli.d.ts +34 -0
- package/dist/loop-tools.d.ts +80 -0
- package/dist/mature-tools.d.ts +53 -0
- package/dist/model-check.d.ts +42 -0
- package/dist/module-report.d.ts +9 -0
- package/dist/pi-launch.d.ts +1 -0
- package/dist/pi.d.ts +246 -0
- package/dist/picture-row.d.ts +10 -0
- package/dist/plain/check.d.ts +23 -0
- package/dist/plain/concepts.d.ts +11 -0
- package/dist/plain/errors.d.ts +22 -0
- package/dist/plain/files.d.ts +12 -0
- package/dist/plain/highlight.d.ts +42 -0
- package/dist/plain/index.d.ts +15 -0
- package/dist/plain/liquid.d.ts +22 -0
- package/dist/plain/markdown.d.ts +74 -0
- package/dist/plain/parser.d.ts +87 -0
- package/dist/plain/spec.d.ts +90 -0
- package/dist/plain/stdlib.d.ts +14 -0
- package/dist/question-dialog.d.ts +51 -0
- package/dist/questioning.d.ts +55 -0
- package/dist/quiet.d.ts +34 -0
- package/dist/regenerate/activity.d.ts +207 -0
- package/dist/regenerate/agent-env.d.ts +44 -0
- package/dist/regenerate/agent-shell.d.ts +49 -0
- package/dist/regenerate/arbiter.d.ts +68 -0
- package/dist/regenerate/audit.d.ts +69 -0
- package/dist/regenerate/cases.d.ts +9 -0
- package/dist/regenerate/change-view.d.ts +18 -0
- package/dist/regenerate/choose-conformance.d.ts +32 -0
- package/dist/regenerate/chunk-plan.d.ts +164 -0
- package/dist/regenerate/codebase.d.ts +21 -0
- package/dist/regenerate/command-check.d.ts +40 -0
- package/dist/regenerate/compaction.d.ts +13 -0
- package/dist/regenerate/confine.d.ts +62 -0
- package/dist/regenerate/conform.d.ts +63 -0
- package/dist/regenerate/conformance-agents.d.ts +405 -0
- package/dist/regenerate/conformance.d.ts +189 -0
- package/dist/regenerate/conversation-writes.d.ts +10 -0
- package/dist/regenerate/credentials.d.ts +18 -0
- package/dist/regenerate/debug-log.d.ts +54 -0
- package/dist/regenerate/debugger.d.ts +31 -0
- package/dist/regenerate/delivery.d.ts +6 -0
- package/dist/regenerate/diagnose-job.d.ts +2 -0
- package/dist/regenerate/diagnose.d.ts +46 -0
- package/dist/regenerate/diff-view.d.ts +61 -0
- package/dist/regenerate/drift.d.ts +84 -0
- package/dist/regenerate/engine.d.ts +52 -0
- package/dist/regenerate/environment-error.d.ts +136 -0
- package/dist/regenerate/job-log.d.ts +28 -0
- package/dist/regenerate/job-panel.d.ts +122 -0
- package/dist/regenerate/jobs-tree.d.ts +71 -0
- package/dist/regenerate/jobs.d.ts +186 -0
- package/dist/regenerate/lanes.d.ts +16 -0
- package/dist/regenerate/lineage.d.ts +95 -0
- package/dist/regenerate/list-arguments.d.ts +21 -0
- package/dist/regenerate/loop.d.ts +392 -0
- package/dist/regenerate/masking.d.ts +19 -0
- package/dist/regenerate/notes.d.ts +159 -0
- package/dist/regenerate/os-sandbox.d.ts +89 -0
- package/dist/regenerate/panel-dock.d.ts +23 -0
- package/dist/regenerate/paths.d.ts +92 -0
- package/dist/regenerate/plain-palette.d.ts +34 -0
- package/dist/regenerate/prompt.d.ts +192 -0
- package/dist/regenerate/records.d.ts +88 -0
- package/dist/regenerate/regenerate.d.ts +108 -0
- package/dist/regenerate/regression.d.ts +58 -0
- package/dist/regenerate/release.d.ts +123 -0
- package/dist/regenerate/requires.d.ts +96 -0
- package/dist/regenerate/resources.d.ts +53 -0
- package/dist/regenerate/self-check.d.ts +29 -0
- package/dist/regenerate/services.d.ts +28 -0
- package/dist/regenerate/shell.d.ts +91 -0
- package/dist/regenerate/side-panel.d.ts +57 -0
- package/dist/regenerate/spec-map-view.d.ts +139 -0
- package/dist/regenerate/spec-map.d.ts +138 -0
- package/dist/regenerate/spec-steps.d.ts +137 -0
- package/dist/regenerate/state.d.ts +20 -0
- package/dist/regenerate/steer.d.ts +34 -0
- package/dist/regenerate/steering.d.ts +56 -0
- package/dist/regenerate/stop-report.d.ts +43 -0
- package/dist/regenerate/submit-work.d.ts +42 -0
- package/dist/regenerate/test-kinds.d.ts +42 -0
- package/dist/regenerate/test-scripts.d.ts +221 -0
- package/dist/regenerate/testing.d.ts +141 -0
- package/dist/regenerate/transcript-view.d.ts +21 -0
- package/dist/regenerate/unit-gate.d.ts +27 -0
- package/dist/regenerate/unit-review.d.ts +152 -0
- package/dist/regenerate/web.d.ts +61 -0
- package/dist/regenerate/workspace.d.ts +12 -0
- package/dist/regenerate-cli.d.ts +1 -0
- package/dist/release-agent.d.ts +26 -0
- package/dist/release-cli.d.ts +1 -0
- package/dist/release-tools.d.ts +38 -0
- package/dist/resume-line.d.ts +2 -0
- package/dist/review/live.d.ts +72 -0
- package/dist/rules.d.ts +20 -0
- package/dist/run-report.d.ts +88 -0
- package/dist/screen-padding.d.ts +28 -0
- package/dist/self-invocation.d.ts +25 -0
- package/dist/setup.d.ts +43 -0
- package/dist/skill-progress.d.ts +46 -0
- package/dist/skill.d.ts +98 -0
- package/dist/skills.d.ts +30 -0
- package/dist/spec-diff-cli.d.ts +1 -0
- package/dist/spec-tools.d.ts +36 -0
- package/dist/stack.d.ts +58 -0
- package/dist/stacks.d.ts +12 -0
- package/dist/stdlib.d.ts +27 -0
- package/dist/terminal-images.d.ts +2 -0
- package/dist/tools.d.ts +101 -0
- package/dist/validate-cli.d.ts +1 -0
- package/docs/README.md +2 -0
- package/docs/hosting.md +52 -0
- package/docs/images/turri-banner.gif +0 -0
- package/docs/installation.md +1 -1
- package/docs/theming.md +8 -6
- package/docs/using.md +1 -1
- package/package.json +8 -1
- package/docs/images/turri-banner.png +0 -0
- package/docs/images/turri-screenshot.png +0 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { type AgentTally, type BuildingSpec, type SpecConflict, type TranscriptEntry, type UsageReport } from "./activity.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Background jobs for conversation mode.
|
|
4
|
+
*
|
|
5
|
+
* Rendering a functionality takes minutes, and a tool's `execute` blocks the agent loop
|
|
6
|
+
* for as long as it runs - which means the person cannot say anything until it finishes.
|
|
7
|
+
* A job starts the work detached and hands back an id immediately, so the conversation
|
|
8
|
+
* carries on while the agents work.
|
|
9
|
+
*/
|
|
10
|
+
export type JobStatus = "queued" | "running" | "succeeded" | "failed" | "stopped";
|
|
11
|
+
export interface Job {
|
|
12
|
+
id: string;
|
|
13
|
+
kind: string;
|
|
14
|
+
/** One line describing what was asked for. */
|
|
15
|
+
summary: string;
|
|
16
|
+
/** The module it works in, for a job that regenerates one: what a finished job is listed as. */
|
|
17
|
+
module?: string;
|
|
18
|
+
/** Its number among its module's pulses, from 1 - as regen numbers them. */
|
|
19
|
+
pulse?: number;
|
|
20
|
+
/** What it regenerates, in a few words: its plan's title. */
|
|
21
|
+
title?: string;
|
|
22
|
+
/** The spec change a render spec diff job renders, as its diff. Shown while it waits and runs. */
|
|
23
|
+
diff?: string;
|
|
24
|
+
/** Where its diff's lines are in the .plain files - their files and line numbers there - when they could be placed. */
|
|
25
|
+
diffWhere?: import("./diff-view.ts").DiffWhere;
|
|
26
|
+
/** For a conformance job: the render job it is the conformance of. */
|
|
27
|
+
follows?: string;
|
|
28
|
+
/** A note on it, for the person: why it did not run, or what became of it. */
|
|
29
|
+
note?: string;
|
|
30
|
+
/** "provider/model-id" its agents run on, when known. */
|
|
31
|
+
model?: string;
|
|
32
|
+
/** The stack it is built with - its config.turri.<stack>.yaml over config.turri.yaml - as chosen when it was queued. */
|
|
33
|
+
stack?: string;
|
|
34
|
+
status: JobStatus;
|
|
35
|
+
/** Monotonic start order. Two jobs can share a millisecond, so ordering uses this. */
|
|
36
|
+
sequence: number;
|
|
37
|
+
queuedAt: number;
|
|
38
|
+
/** When the work itself began - after any wait in the queue. */
|
|
39
|
+
startedAt: number;
|
|
40
|
+
/** A row of the work loop's, not a pulse: its module's work being planned into pulses now, since then. */
|
|
41
|
+
planning?: {
|
|
42
|
+
since: number;
|
|
43
|
+
};
|
|
44
|
+
/** While queued: the jobs it is waiting for. */
|
|
45
|
+
waitingOn: string[];
|
|
46
|
+
finishedAt?: number;
|
|
47
|
+
/** Tail of the streamed output, bounded so a long run cannot get longer without limit. */
|
|
48
|
+
tail: string;
|
|
49
|
+
/** The stage the work is at, as the work itself last reported it. */
|
|
50
|
+
stage?: string;
|
|
51
|
+
/** The functional spec it is building now, when it builds one. */
|
|
52
|
+
building?: BuildingSpec;
|
|
53
|
+
/** The most recent things the agents did, newest last. */
|
|
54
|
+
activity: string[];
|
|
55
|
+
/** What is happening right now, and since when. */
|
|
56
|
+
now?: {
|
|
57
|
+
label: string;
|
|
58
|
+
since: number;
|
|
59
|
+
};
|
|
60
|
+
/** Every model response its agents have had, added up. */
|
|
61
|
+
usage: UsageReport;
|
|
62
|
+
/**
|
|
63
|
+
* Queued again as another job - the one it names - to come after jobs added ahead of it: it never ran, and is not
|
|
64
|
+
* announced or listed as a job of its own.
|
|
65
|
+
*/
|
|
66
|
+
replacedBy?: string;
|
|
67
|
+
/** Each of its agents: turns, compactions and what it cost - a row per agent, in the order they first worked. */
|
|
68
|
+
agents: AgentTally[];
|
|
69
|
+
/** The whole conversation of its agents, oldest dropped first past a size limit. */
|
|
70
|
+
transcript: TranscriptEntry[];
|
|
71
|
+
/** It failed, and failed again when retried - or a job ahead of it did: the queue behind it fails too. */
|
|
72
|
+
failedForGood?: boolean;
|
|
73
|
+
/** Its whole transcript, on disk: `.turri/jobs/` in the project. */
|
|
74
|
+
logFile?: string;
|
|
75
|
+
/** Why it failed for good, and what to do, as the diagnosis found. */
|
|
76
|
+
diagnosis?: string;
|
|
77
|
+
/** It stopped because the environment lacks something: what the person is told. */
|
|
78
|
+
environment?: string;
|
|
79
|
+
/** What to tell the agent when it asks how the job went. */
|
|
80
|
+
report?: string;
|
|
81
|
+
/** The spec contradicts itself, as its conformance run found: for the person to decide. */
|
|
82
|
+
specConflict?: SpecConflict;
|
|
83
|
+
/** What to tell the person when it lands, if shorter than the report. */
|
|
84
|
+
announce?: string;
|
|
85
|
+
error?: string;
|
|
86
|
+
details?: unknown;
|
|
87
|
+
}
|
|
88
|
+
export interface JobOutcome {
|
|
89
|
+
report: string;
|
|
90
|
+
/**
|
|
91
|
+
* What the person is shown when the job lands. The report is written for the agent and
|
|
92
|
+
* can carry detail it needs and the person does not; omitted, the report is shown.
|
|
93
|
+
*/
|
|
94
|
+
announce?: string;
|
|
95
|
+
details?: unknown;
|
|
96
|
+
}
|
|
97
|
+
export interface StartJobInput {
|
|
98
|
+
kind: string;
|
|
99
|
+
summary: string;
|
|
100
|
+
/** The module it works in, for a job that regenerates one. */
|
|
101
|
+
module?: string;
|
|
102
|
+
/** Its number among its module's pulses, from 1. */
|
|
103
|
+
pulse?: number;
|
|
104
|
+
/** What it regenerates, in a few words. */
|
|
105
|
+
title?: string;
|
|
106
|
+
/** For a render spec diff job: the diff, to show in the panel and the transcript. */
|
|
107
|
+
diff?: string;
|
|
108
|
+
/** "provider/model-id" its agents run on, to show where the job is shown. */
|
|
109
|
+
model?: string;
|
|
110
|
+
/** For a conformance job: the render it is the conformance of. */
|
|
111
|
+
follows?: string;
|
|
112
|
+
/**
|
|
113
|
+
* What the job writes, e.g. a module's directory. Two jobs sharing a lane never run at
|
|
114
|
+
* the same time: the later one queues until the earlier one settles, whatever started
|
|
115
|
+
* them. Jobs with no lanes in common run side by side.
|
|
116
|
+
*/
|
|
117
|
+
lanes?: string[];
|
|
118
|
+
/** The command that runs the work again - `turri regenerate <the spec>` - for a message that stops it. */
|
|
119
|
+
rerun?: string;
|
|
120
|
+
run: (onDelta: (delta: string) => void) => Promise<JobOutcome>;
|
|
121
|
+
}
|
|
122
|
+
export interface JobRegistry {
|
|
123
|
+
start(input: StartJobInput): Job;
|
|
124
|
+
/** How many jobs may run at once from now on - undefined for no limit. Raised, jobs waiting for a slot start. */
|
|
125
|
+
setMaxRunning(count: number | undefined): void;
|
|
126
|
+
/**
|
|
127
|
+
* Stop a job. A queued one never starts; a running one has its agent's turn aborted and
|
|
128
|
+
* ends as stopped. Returns the job, or undefined when there is no such job or it has
|
|
129
|
+
* already finished.
|
|
130
|
+
*/
|
|
131
|
+
stop(id: string, reason?: string): Job | undefined;
|
|
132
|
+
get(id: string): Job | undefined;
|
|
133
|
+
list(): Job[];
|
|
134
|
+
/** Something shown with the jobs changed, though no job did - a plan begun or made: what shows them redraws. */
|
|
135
|
+
notify?(): void;
|
|
136
|
+
/** Resolves when the job settles. Used by callers that asked to wait. */
|
|
137
|
+
wait(id: string): Promise<Job>;
|
|
138
|
+
}
|
|
139
|
+
/** What a stopped job says when the person stopped it. */
|
|
140
|
+
export declare const STOPPED_ON_REQUEST = "Stopped on request.";
|
|
141
|
+
export declare function createJobRegistry(options?: {
|
|
142
|
+
onFinish?: (job: Job) => void;
|
|
143
|
+
/** A job started, moved to another stage, or did something. */
|
|
144
|
+
onChange?: (job: Job) => void;
|
|
145
|
+
/** Something shown with the jobs changed, no job with it - see `notify`. */
|
|
146
|
+
onNotify?: () => void;
|
|
147
|
+
tailChars?: number;
|
|
148
|
+
/**
|
|
149
|
+
* How many times a job that fails - its work throws, or reports it did not pass - is run again.
|
|
150
|
+
* Given, a job that fails that many times more fails for good: it is diagnosed, and every job
|
|
151
|
+
* queued behind it fails without running. Not given, a failure is reported and the queue goes on.
|
|
152
|
+
*/
|
|
153
|
+
retries?: number;
|
|
154
|
+
/** Why a job failed for good, and what to do: for the person, with both failures. */
|
|
155
|
+
diagnose?: (job: Job, failures: string[], jobLog?: string) => Promise<string | undefined>;
|
|
156
|
+
/**
|
|
157
|
+
* How many jobs may run at once. Jobs whose lanes are free still wait for a slot past it - each
|
|
158
|
+
* module's jobs build and test on this machine, and ten modules at once would ask for more than it
|
|
159
|
+
* has. Not given: no limit.
|
|
160
|
+
*/
|
|
161
|
+
maxRunning?: number;
|
|
162
|
+
}): JobRegistry;
|
|
163
|
+
export declare function formatDuration(job: Job): string;
|
|
164
|
+
/** "42s", "3m 12s", "1h 5m": how long something has run. */
|
|
165
|
+
export declare function formatElapsed(ms: number): string;
|
|
166
|
+
/**
|
|
167
|
+
* What a pulse is called wherever it is shown in a line: its module, kind and number - `shorty · regenerate pulse 3`,
|
|
168
|
+
* `shorty · conformance pulse 6` - never what it regenerates, which is the agents' words and long. A job of no module,
|
|
169
|
+
* what was asked for.
|
|
170
|
+
*/
|
|
171
|
+
export declare function pulseName(job: Job): string;
|
|
172
|
+
/** What the agent is told when it checks on a job. */
|
|
173
|
+
export declare function describeJob(job: Job): string;
|
|
174
|
+
/**
|
|
175
|
+
* Whether a tool should block rather than hand back a job id.
|
|
176
|
+
*
|
|
177
|
+
* Background only makes sense where the session outlives the turn. In print, json and rpc
|
|
178
|
+
* modes the process ends as soon as the answer is written, taking any detached work with
|
|
179
|
+
* it, so those wait unless told otherwise.
|
|
180
|
+
*/
|
|
181
|
+
export declare function shouldWait(mode: string, wait: boolean | undefined): boolean;
|
|
182
|
+
/**
|
|
183
|
+
* How many jobs run at once when nothing says: half this machine's cores, at least one and at most four - a pulse's
|
|
184
|
+
* builds and tests run here, beside the person's own work.
|
|
185
|
+
*/
|
|
186
|
+
export declare function defaultParallelJobs(cores?: number): number;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a job on this spec may write, as lanes for the job registry.
|
|
3
|
+
*
|
|
4
|
+
* A module's directory holds its code and its conformance tests, and building a module can
|
|
5
|
+
* build everything it requires first - so the lanes are every module in the requires chain.
|
|
6
|
+
* That is more than a single functionality touches, and deliberately so: two jobs that
|
|
7
|
+
* might write the same directory wait for each other, and a wait costs minutes where a
|
|
8
|
+
* collision costs the build.
|
|
9
|
+
*
|
|
10
|
+
* The module's own folder is a lane whatever the spec says at the moment it is read. A spec with
|
|
11
|
+
* no functional specs yet - the scaffold a new project starts with - or one that does not parse
|
|
12
|
+
* names no chain, and a job queued then must still wait for, and be waited for by, every other
|
|
13
|
+
* job on that module: two that claimed different lanes for the same folder ran side by side and
|
|
14
|
+
* wrote over each other.
|
|
15
|
+
*/
|
|
16
|
+
export declare function moduleLanes(plainFile: string, buildRoot?: string): string[];
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version history for each module's generated code and tests.
|
|
3
|
+
*
|
|
4
|
+
* A module folder - `plain_modules/<module>`, holding `code/` and `tests/` - is a git
|
|
5
|
+
* repository whose git directory is `.plaingit` rather than `.git`. Everything git does
|
|
6
|
+
* works as usual; the name is what keeps it from being an embedded repository inside the
|
|
7
|
+
* project's own, so the generated code stays plain files to the outer repo. Only the harness
|
|
8
|
+
* writes it: the agents' fences cover `code/` and `tests/`, and `.plaingit` sits beside them.
|
|
9
|
+
*
|
|
10
|
+
* A commit is made after every step that changes the module - a render, a regeneration, a
|
|
11
|
+
* conformance run, a regression repair, a spec change, a start from the module below - with
|
|
12
|
+
* a message saying what it was. History is a record of the work, never a gate on it: a git
|
|
13
|
+
* failure is swallowed, not raised.
|
|
14
|
+
*/
|
|
15
|
+
export declare const HISTORY_DIR = ".plaingit";
|
|
16
|
+
/** The module folder a build or tests directory belongs to. */
|
|
17
|
+
export declare function moduleDirOf(dir: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Commit whatever the step changed in the module folder that `dir` - its build or its tests
|
|
20
|
+
* directory - belongs to. Nothing changed, nothing is committed. Returns the commit, if any.
|
|
21
|
+
*/
|
|
22
|
+
export declare function recordHistory(dir: string, subject: string, body?: string): string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* The notes the harness writes once a pulse has ended, committed - or the next pulse, putting the module back to its last
|
|
25
|
+
* commit, would take them away. Into the pulse's own commit when it landed one - `landedSince` (ms), when it started - so
|
|
26
|
+
* the history keeps a commit a pulse; a commit of their own otherwise - a pulse rolled back leaves its line, and nothing
|
|
27
|
+
* else.
|
|
28
|
+
*/
|
|
29
|
+
export declare function commitNotes(dir: string, file: string, subject: string, landedSince?: number): void;
|
|
30
|
+
export declare function resetToLastCommit(dir: string): string[];
|
|
31
|
+
/**
|
|
32
|
+
* Where a unit of work started: each module folder it writes, at the commit it was at. A unit
|
|
33
|
+
* either lands whole - committed, its tree recorded - or is undone whole (`abandonWork`), so the
|
|
34
|
+
* code, its tests and the tree they were built from never disagree.
|
|
35
|
+
*/
|
|
36
|
+
export interface WorkStart {
|
|
37
|
+
modules: Array<{
|
|
38
|
+
moduleDir: string;
|
|
39
|
+
commit: string;
|
|
40
|
+
}>;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The start of every unit of work that writes a module's code or tests: each module folder it
|
|
44
|
+
* writes back at its last commit - saying so when that undid anything - and that commit kept, to
|
|
45
|
+
* go back to if the work fails. A module with no commit yet is given one first, so there always
|
|
46
|
+
* is one.
|
|
47
|
+
*/
|
|
48
|
+
export declare function startWork(dirs: string[], moduleName: string): WorkStart;
|
|
49
|
+
/**
|
|
50
|
+
* Where work already under way is now, to go back to if what comes next fails - without
|
|
51
|
+
* putting anything back first: what is uncommitted belongs to the work that is under way.
|
|
52
|
+
*/
|
|
53
|
+
export declare function markWork(dirs: string[]): WorkStart;
|
|
54
|
+
/**
|
|
55
|
+
* Undo a unit of work that failed: every module folder it wrote back at the commit it started
|
|
56
|
+
* from - its changes, the files it added and any commit it made since, gone. What history does
|
|
57
|
+
* not track stays: installed dependencies, caches.
|
|
58
|
+
*/
|
|
59
|
+
export declare function abandonWork(start: WorkStart | undefined, moduleName: string, why: string): void;
|
|
60
|
+
/**
|
|
61
|
+
* A file of a module as its last commit has it - `file` relative to `dir`, its build or its tests
|
|
62
|
+
* folder - or undefined when there is no history, no commit, or the file is not in it.
|
|
63
|
+
*/
|
|
64
|
+
export declare function committedText(dir: string, file: string): string | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Commit these paths of a module, and nothing else of it - removed, added or changed. Whatever else is in the folder,
|
|
67
|
+
* uncommitted - what an interrupted job left - stays as it is, for the next unit of work to put back. Returns the commit.
|
|
68
|
+
*/
|
|
69
|
+
export declare function commitPaths(moduleDir: string, paths: string[], subject: string): string | undefined;
|
|
70
|
+
/** Bring a history's exclude list up to the one it is made with now. */
|
|
71
|
+
export declare function refreshExcludes(moduleDir: string): void;
|
|
72
|
+
/** The current commit of a module's history, if it has one. */
|
|
73
|
+
export declare function head(dir: string): string | undefined;
|
|
74
|
+
/** The module's history, newest first, one line per commit. */
|
|
75
|
+
export declare function historyLog(dir: string, limit?: number): string;
|
|
76
|
+
/** One commit in full: its message and what it changed. */
|
|
77
|
+
export declare function historyShow(dir: string, commit: string): string;
|
|
78
|
+
/**
|
|
79
|
+
* What the work under way changed in `dir` - the code folder, or the tests folder - since the module's last
|
|
80
|
+
* commit: a unified diff of every file changed, and every new file whole. Every unit of work starts from that
|
|
81
|
+
* commit, so this is exactly what its agents wrote. Lockfiles and the harness's own files are left out. Empty when
|
|
82
|
+
* there is no history, or nothing changed.
|
|
83
|
+
*/
|
|
84
|
+
export declare function workDiff(dir: string): string;
|
|
85
|
+
/**
|
|
86
|
+
* The work in `dir` as it is now - the code folder, or the tests folder - as a git tree, without a commit and without
|
|
87
|
+
* touching the module's index: what a review saw, so the next review is shown only what changed since. Undefined
|
|
88
|
+
* when there is no history.
|
|
89
|
+
*/
|
|
90
|
+
export declare function workSnapshot(dir: string): string | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* What changed in `dir` since a snapshot of it (`workSnapshot`): a unified diff of every file changed, added or
|
|
93
|
+
* removed since, as `workDiff` shows the whole work. Empty when nothing changed, or there is no history.
|
|
94
|
+
*/
|
|
95
|
+
export declare function diffSinceSnapshot(dir: string, snapshot: string): string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ToolDefinition } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
/**
|
|
3
|
+
* A tool argument that is a list of objects - submit_exploration's `interfaces` and `plan`, a reviewer's `problems` - is
|
|
4
|
+
* the shape a small model gets wrong most: it sends the list as JSON text, each entry as JSON text, or writes it inside
|
|
5
|
+
* another argument's text as `</tests_reach_it><plan>[...]</plan>`. The validator's answer - "plan.0: must be object" -
|
|
6
|
+
* does not say what it wants, and the model makes the same call again until its turn is stopped.
|
|
7
|
+
*
|
|
8
|
+
* So before the arguments are checked, what plainly means the list is taken as the list; and what cannot be is refused
|
|
9
|
+
* with what is wanted, in words and with an example. For every tool an agent is given (createExecutor), in one place.
|
|
10
|
+
*/
|
|
11
|
+
interface Schema {
|
|
12
|
+
type?: string;
|
|
13
|
+
properties?: Record<string, Schema>;
|
|
14
|
+
items?: Schema;
|
|
15
|
+
required?: string[];
|
|
16
|
+
}
|
|
17
|
+
/** The arguments with their lists made lists where they plainly are; refused, saying what is wanted, where they are not. */
|
|
18
|
+
export declare function prepareListArguments(toolName: string, schema: Schema, raw: unknown): unknown;
|
|
19
|
+
/** The tools, each that takes a list of objects preparing its arguments so before they are checked. */
|
|
20
|
+
export declare function withListArguments(tools: ToolDefinition[]): ToolDefinition[];
|
|
21
|
+
export {};
|