@operad-io/dev 0.1.1 → 0.3.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/README.md +1 -1
- package/dev.schema.json +53 -31
- package/package.json +9 -6
- package/skills/git/SKILL.md +70 -0
- package/skills/setup/SKILL.md +74 -0
- package/src/access-grants.ts +59 -0
- package/src/actions.ts +81 -17
- package/src/announce.ts +134 -17
- package/src/chat.ts +586 -36
- package/src/check-host.ts +111 -0
- package/src/check-load.ts +67 -0
- package/src/check.ts +45 -22
- package/src/clock.ts +29 -0
- package/src/clone-chat.ts +32 -0
- package/src/commands.ts +103 -34
- package/src/create-actions.ts +210 -0
- package/src/flaky.ts +45 -29
- package/src/flow-compiler.ts +156 -69
- package/src/followups.ts +20 -22
- package/src/gate.ts +254 -88
- package/src/git-state.ts +155 -0
- package/src/git.ts +92 -4
- package/src/index.ts +52 -6
- package/src/integrate.ts +162 -62
- package/src/integration-queue.ts +23 -10
- package/src/lock.ts +101 -5
- package/src/mainclone.ts +61 -5
- package/src/model-error.ts +70 -0
- package/src/model.ts +61 -35
- package/src/notcode.ts +51 -15
- package/src/places.ts +2 -2
- package/src/prepare.ts +7 -2
- package/src/project-flows.ts +135 -4
- package/src/project-settings.ts +110 -3
- package/src/register-requests.ts +121 -0
- package/src/repository-key.ts +4 -0
- package/src/rerun.ts +23 -7
- package/src/retry.ts +2 -12
- package/src/rework.ts +8 -0
- package/src/schedule.ts +342 -93
- package/src/service.ts +241 -185
- package/src/settings.ts +409 -65
- package/src/setup-git.ts +366 -0
- package/src/standing.ts +23 -6
- package/src/step-edge.ts +22 -0
- package/src/steps.ts +945 -179
- package/src/throughput.ts +4 -21
- package/src/timeouts.ts +10 -2
- package/src/views.ts +325 -86
- package/src/waits.ts +59 -0
package/src/git-state.ts
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What git a folder has, computed each time and never stored: the user can run
|
|
3
|
+
* `git init`, install git or make a commit at any moment, so a stored answer
|
|
4
|
+
* would be stale on the next tick. Chat needs none of it; creating a task needs
|
|
5
|
+
* `ready`. The states and their use are in docs/research/2026-11-22-dev-without-git.md
|
|
6
|
+
* section 5.
|
|
7
|
+
*
|
|
8
|
+
* A folder git cannot judge (it refuses with dubious ownership, `.git` is
|
|
9
|
+
* unreadable, it prints nothing) is an error, `GitStateError`, never `no repository`.
|
|
10
|
+
*
|
|
11
|
+
* Not told apart: a bare repository and a folder inside a `.git` directory both
|
|
12
|
+
* have no work tree, so they read as `no repository`.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { realpathSync, statSync } from "node:fs";
|
|
16
|
+
import { findGit, realGitFinderHost, type GitFinderHost } from "@operad-io/engine/platform";
|
|
17
|
+
import { git, type GitOptions } from "./git.ts";
|
|
18
|
+
import { DevRefusal } from "./model.ts";
|
|
19
|
+
|
|
20
|
+
/** The user name and email git would write into a commit, as the configuration holds them. */
|
|
21
|
+
export interface GitIdentity {
|
|
22
|
+
/** `user.name`, or `undefined` when it is not set or empty. */
|
|
23
|
+
readonly name: string | undefined;
|
|
24
|
+
/** `user.email`, or `undefined` when it is not set or empty. */
|
|
25
|
+
readonly email: string | undefined;
|
|
26
|
+
/** True when both are set: a commit can be made. */
|
|
27
|
+
readonly set: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type GitState =
|
|
31
|
+
/** The git program is not installed (or, on macOS, only its stub is). */
|
|
32
|
+
| { readonly state: "no program" }
|
|
33
|
+
/** Git is there; the folder is in no work tree. */
|
|
34
|
+
| { readonly state: "no repository"; readonly identity: GitIdentity }
|
|
35
|
+
/** The folder is inside the work tree whose top is `root`. */
|
|
36
|
+
| { readonly state: "subfolder"; readonly root: string; readonly identity: GitIdentity }
|
|
37
|
+
/** The folder is a work tree root with no commit; `branch` is the unborn branch's name. */
|
|
38
|
+
| {
|
|
39
|
+
readonly state: "no commit";
|
|
40
|
+
readonly branch: string | undefined;
|
|
41
|
+
readonly identity: GitIdentity;
|
|
42
|
+
}
|
|
43
|
+
/** The folder is a work tree root with a commit; `branch` is undefined on a detached HEAD. */
|
|
44
|
+
| {
|
|
45
|
+
readonly state: "ready";
|
|
46
|
+
readonly branch: string | undefined;
|
|
47
|
+
readonly identity: GitIdentity;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export interface GitStateOptions {
|
|
51
|
+
/** The environment of every git run; the default is this process's. */
|
|
52
|
+
readonly env?: NodeJS.ProcessEnv;
|
|
53
|
+
/** The machine the git program is looked up on; a test injects one without git. */
|
|
54
|
+
readonly finder?: GitFinderHost;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** What git says when the folder is in no work tree (a bare repository has none either). */
|
|
58
|
+
const NO_REPOSITORY = /not a git repository|this operation must be run in a work tree/i;
|
|
59
|
+
|
|
60
|
+
/** Git could not say whether the folder is in a repository; `reason` is git's own message. */
|
|
61
|
+
export class GitStateError extends Error {
|
|
62
|
+
constructor(
|
|
63
|
+
readonly folder: string,
|
|
64
|
+
readonly reason: string,
|
|
65
|
+
) {
|
|
66
|
+
super(`git cannot tell what "${folder}" is: ${reason.length > 0 ? reason : "no detail"}`);
|
|
67
|
+
this.name = "GitStateError";
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function canonical(path: string): string {
|
|
72
|
+
try {
|
|
73
|
+
return realpathSync(path);
|
|
74
|
+
} catch {
|
|
75
|
+
return path;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function identityOf(folder: string, options: GitOptions): GitIdentity {
|
|
80
|
+
const read = (key: string): string | undefined => {
|
|
81
|
+
const result = git(folder, ["config", "--get", key], options);
|
|
82
|
+
return result.ok && result.out !== "" ? result.out : undefined;
|
|
83
|
+
};
|
|
84
|
+
const name = read("user.name");
|
|
85
|
+
const email = read("user.email");
|
|
86
|
+
return { name, email, set: name !== undefined && email !== undefined };
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** Test-only: the machine every state check looks for git on, when the caller gives none. */
|
|
90
|
+
export const gitStateTestHooks: { finder?: GitFinderHost | undefined } = {};
|
|
91
|
+
|
|
92
|
+
/** The state of `folder`, which must be an existing directory. */
|
|
93
|
+
export function gitStateOf(folder: string, stateOptions: GitStateOptions = {}): GitState {
|
|
94
|
+
if (statSync(folder, { throwIfNoEntry: false })?.isDirectory() !== true) {
|
|
95
|
+
throw new Error(`"${folder}" is not a folder`);
|
|
96
|
+
}
|
|
97
|
+
const env = stateOptions.env ?? { ...process.env };
|
|
98
|
+
const options: GitOptions = { env };
|
|
99
|
+
// The finder runs nothing that could open the macOS install dialog.
|
|
100
|
+
if (findGit(stateOptions.finder ?? gitStateTestHooks.finder ?? { ...realGitFinderHost(), env }) === undefined) return { state: "no program" };
|
|
101
|
+
const identity = identityOf(folder, options);
|
|
102
|
+
// Git's messages are forced to English for this one question, so the words
|
|
103
|
+
// that say "no repository" can be told from every other refusal.
|
|
104
|
+
const top = git(folder, ["rev-parse", "--show-toplevel"], {
|
|
105
|
+
env: { ...env, LC_ALL: "C", LANGUAGE: "" },
|
|
106
|
+
});
|
|
107
|
+
if (!top.ok) {
|
|
108
|
+
if (NO_REPOSITORY.test(top.err)) return { state: "no repository", identity };
|
|
109
|
+
// Dubious ownership, an unreadable .git, a git that prints nothing: the
|
|
110
|
+
// folder may well be a repository, so it is not taken for a plain folder.
|
|
111
|
+
throw new GitStateError(folder, top.err);
|
|
112
|
+
}
|
|
113
|
+
if (canonical(top.out) !== canonical(folder)) {
|
|
114
|
+
return { state: "subfolder", root: top.out, identity };
|
|
115
|
+
}
|
|
116
|
+
const branchResult = git(folder, ["symbolic-ref", "--short", "-q", "HEAD"], options);
|
|
117
|
+
const branch = branchResult.ok && branchResult.out !== "" ? branchResult.out : undefined;
|
|
118
|
+
const head = git(folder, ["rev-parse", "--verify", "-q", "HEAD^{commit}"], options);
|
|
119
|
+
return { state: head.ok ? "ready" : "no commit", branch, identity };
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Why a task cannot be created in `folder` now, in the line a person reads, or
|
|
123
|
+
// `undefined` when git is ready there. The bot turns the line into the person's
|
|
124
|
+
// language and starts the git setup; the line itself starts nothing.
|
|
125
|
+
export function taskRefusalOf(folder: string, stateOptions: GitStateOptions = {}): string | undefined {
|
|
126
|
+
const state = gitStateOf(folder, stateOptions);
|
|
127
|
+
switch (state.state) {
|
|
128
|
+
case "ready":
|
|
129
|
+
return undefined;
|
|
130
|
+
case "no program":
|
|
131
|
+
return "Creating a task needs git, and git is not installed on this machine. Ask the bot to help you install it.";
|
|
132
|
+
case "no repository":
|
|
133
|
+
return "This folder is not under git yet, and a task needs it. Ask the bot to set up git here: it will show you a list of the files first.";
|
|
134
|
+
case "no commit":
|
|
135
|
+
return "Git is set up here but has no commit yet, and a task needs one. Ask the bot to make the first commit: it will show you a list of the files first.";
|
|
136
|
+
case "subfolder":
|
|
137
|
+
return `This folder is inside the git repository at ${state.root}. Add ${state.root} as the project instead (operad dev repo add ${state.root}), or keep chatting here.`;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// The same line as `taskRefusalOf`, for a folder git cannot judge too.
|
|
142
|
+
export function taskGitRefusal(folder: string, stateOptions: GitStateOptions = {}): string | undefined {
|
|
143
|
+
try {
|
|
144
|
+
return taskRefusalOf(folder, stateOptions);
|
|
145
|
+
} catch (error) {
|
|
146
|
+
if (!(error instanceof GitStateError)) throw error;
|
|
147
|
+
return `Git cannot tell what this folder is, so a task cannot be created: ${error.reason}`;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// Throws a refusal when a task cannot be created in `folder`.
|
|
152
|
+
export function assertCanCreateTask(folder: string, stateOptions: GitStateOptions = {}): void {
|
|
153
|
+
const line = taskGitRefusal(folder, stateOptions);
|
|
154
|
+
if (line !== undefined) throw new DevRefusal(line);
|
|
155
|
+
}
|
package/src/git.ts
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
* before an empty answer is believed.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
import { findGit, GIT_NOT_INSTALLED, realGitFinderHost } from "@operad-io/engine/platform";
|
|
9
|
+
|
|
8
10
|
export interface GitResult {
|
|
9
11
|
readonly ok: boolean;
|
|
10
12
|
readonly out: string;
|
|
@@ -55,8 +57,10 @@ export function printsOnSuccess(args: readonly string[]): boolean {
|
|
|
55
57
|
const [command, sub] = args;
|
|
56
58
|
switch (command) {
|
|
57
59
|
case "rev-parse":
|
|
58
|
-
case "symbolic-ref":
|
|
59
60
|
return true;
|
|
61
|
+
case "symbolic-ref":
|
|
62
|
+
// The setting form (`symbolic-ref HEAD refs/heads/x`) prints nothing.
|
|
63
|
+
return !args.some((argument) => argument.startsWith("refs/"));
|
|
60
64
|
case "worktree":
|
|
61
65
|
return sub === "list";
|
|
62
66
|
case "merge-base":
|
|
@@ -75,8 +79,13 @@ export function printsOnSuccess(args: readonly string[]): boolean {
|
|
|
75
79
|
|
|
76
80
|
function runOnce(cwd: string, args: readonly string[], options: GitOptions): GitResult {
|
|
77
81
|
const started = Date.now();
|
|
82
|
+
const env = options.env ?? { ...process.env };
|
|
83
|
+
// The absolute path found now, not the word `git`: a PATH that changed after
|
|
84
|
+
// this process started is not seen by a spawn. Nothing is spawned without it.
|
|
85
|
+
const program = findGit({ ...realGitFinderHost(), env });
|
|
86
|
+
if (program === undefined) return { ok: false, out: "", err: GIT_NOT_INSTALLED };
|
|
78
87
|
const result = Bun.spawnSync({
|
|
79
|
-
cmd: [
|
|
88
|
+
cmd: [program, "-C", cwd, ...args],
|
|
80
89
|
stdin:
|
|
81
90
|
options.input === undefined
|
|
82
91
|
? "ignore"
|
|
@@ -85,8 +94,7 @@ function runOnce(cwd: string, args: readonly string[], options: GitOptions): Git
|
|
|
85
94
|
: options.input,
|
|
86
95
|
stdout: "pipe",
|
|
87
96
|
stderr: "pipe",
|
|
88
|
-
|
|
89
|
-
env: options.env ?? { ...process.env },
|
|
97
|
+
env,
|
|
90
98
|
timeout: options.timeoutMs ?? GIT_TIMEOUT_MS,
|
|
91
99
|
killSignal: "SIGKILL",
|
|
92
100
|
});
|
|
@@ -136,3 +144,83 @@ export function git(
|
|
|
136
144
|
}
|
|
137
145
|
return result;
|
|
138
146
|
}
|
|
147
|
+
|
|
148
|
+
/** The commit `ref` names, or undefined when it does not name one. */
|
|
149
|
+
export function commitOf(cwd: string, ref: string): string | undefined {
|
|
150
|
+
return revisionOf(cwd, `${ref}^{commit}`);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/** The tree `ref` names, or undefined when it does not name one. */
|
|
154
|
+
export function treeOf(cwd: string, ref: string): string | undefined {
|
|
155
|
+
return revisionOf(cwd, `${ref}^{tree}`);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* What `git rev-parse --verify --quiet` prints for `ref`, or undefined when the
|
|
160
|
+
* ref does not name an object.
|
|
161
|
+
*/
|
|
162
|
+
export function revisionOf(cwd: string, ref: string): string | undefined {
|
|
163
|
+
const result = git(cwd, ["rev-parse", "--verify", "--quiet", ref]);
|
|
164
|
+
return result.ok && result.out.length > 0 ? result.out : undefined;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/** The commit a work tree has checked out, or undefined when it has none. */
|
|
168
|
+
export function headOf(cwd: string): string | undefined {
|
|
169
|
+
const result = git(cwd, ["rev-parse", "HEAD"]);
|
|
170
|
+
return result.ok && result.out.length > 0 ? result.out : undefined;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/** True when `ancestor` is reachable from `descendant`. */
|
|
174
|
+
export function isAncestor(
|
|
175
|
+
cwd: string,
|
|
176
|
+
ancestor: string,
|
|
177
|
+
descendant: string,
|
|
178
|
+
): boolean {
|
|
179
|
+
return git(cwd, ["merge-base", "--is-ancestor", ancestor, descendant]).ok;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/** True when a local branch exists, or the branch on `remote` when one is named. */
|
|
183
|
+
export function branchExists(
|
|
184
|
+
cwd: string,
|
|
185
|
+
branch: string,
|
|
186
|
+
remote?: string,
|
|
187
|
+
): boolean {
|
|
188
|
+
const ref =
|
|
189
|
+
remote === undefined
|
|
190
|
+
? `refs/heads/${branch}`
|
|
191
|
+
: `refs/remotes/${remote}/${branch}`;
|
|
192
|
+
return git(cwd, ["show-ref", "--verify", "--quiet", ref]).ok;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// The two settings that name a repository's base branch.
|
|
196
|
+
export interface BaseSettings {
|
|
197
|
+
// Undefined when the repository has no remote.
|
|
198
|
+
readonly remote?: string | undefined;
|
|
199
|
+
readonly mainBranch: string;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// The name a task branch starts from and merges into: `<remote>/<main>`, or
|
|
203
|
+
// the local main branch when the repository has no remote.
|
|
204
|
+
export function baseName(settings: BaseSettings): string {
|
|
205
|
+
return settings.remote === undefined
|
|
206
|
+
? settings.mainBranch
|
|
207
|
+
: `${settings.remote}/${settings.mainBranch}`;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// The full ref of `baseName`.
|
|
211
|
+
export function baseRef(settings: BaseSettings): string {
|
|
212
|
+
return settings.remote === undefined
|
|
213
|
+
? `refs/heads/${settings.mainBranch}`
|
|
214
|
+
: `refs/remotes/${settings.remote}/${settings.mainBranch}`;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// Fetches the remote; a repository with no remote has nothing to fetch, which
|
|
218
|
+
// counts as a fetch that worked.
|
|
219
|
+
export function fetchRemote(
|
|
220
|
+
cwd: string,
|
|
221
|
+
settings: BaseSettings,
|
|
222
|
+
args: readonly string[] = ["--prune"],
|
|
223
|
+
): GitResult {
|
|
224
|
+
if (settings.remote === undefined) return { ok: true, out: "", err: "" };
|
|
225
|
+
return git(cwd, ["fetch", ...args, settings.remote]);
|
|
226
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
/** The dev plugin: repositories, plans, tasks and their commands and views. */
|
|
2
2
|
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
3
4
|
import pkg from "../package.json" with { type: "json" };
|
|
4
5
|
import { definePlugin } from "@operad-io/engine";
|
|
6
|
+
import { WORKTREE_EVENT } from "@operad-io/chat";
|
|
5
7
|
import { PLAN_FILTERS, REPO_FILTERS, TASK_FILTERS } from "./model.ts";
|
|
6
8
|
import devFlow from "../flows/dev.flow.ts";
|
|
7
9
|
import chatWorktreeFlow from "../flows/chat-worktree.flow.ts";
|
|
8
10
|
import { actions } from "./actions.ts";
|
|
11
|
+
import { accessAction } from "./access-grants.ts";
|
|
9
12
|
import { runAnnounce } from "./announce.ts";
|
|
10
13
|
import { checkDev } from "./check.ts";
|
|
11
|
-
import { chatActions, runChatWorktree } from "./chat.ts";
|
|
14
|
+
import { chatActions, runChatSettings, runChatWorktree } from "./chat.ts";
|
|
12
15
|
import { commands } from "./commands.ts";
|
|
16
|
+
import { creationActions } from "./create-actions.ts";
|
|
13
17
|
import { runRework, runReview, runReviewDue, runVerify, runWorkDue } from "./gate.ts";
|
|
14
18
|
import { runRetry, runRetryDue } from "./retry.ts";
|
|
15
19
|
import { runCleanup, runIntegrate } from "./integrate.ts";
|
|
16
20
|
import { runScheduler, taskWaitAnsweredAutomatically } from "./schedule.ts";
|
|
17
21
|
import { devStanding } from "./standing.ts";
|
|
22
|
+
import { registerRequested } from "./register-requests.ts";
|
|
18
23
|
import { migrateLegacyRepositories, resolveDevKey } from "./service.ts";
|
|
19
24
|
import { runReverify, runWork, runWorktree } from "./steps.ts";
|
|
20
25
|
import { STEP_TIMEOUT_SECS } from "./timeouts.ts";
|
|
@@ -27,6 +32,7 @@ export function createDevPlugin() {
|
|
|
27
32
|
name: "dev",
|
|
28
33
|
kind: "domain",
|
|
29
34
|
version: pkg.version,
|
|
35
|
+
listTitle: "Projects",
|
|
30
36
|
objects: [
|
|
31
37
|
{
|
|
32
38
|
name: "repo",
|
|
@@ -64,7 +70,7 @@ export function createDevPlugin() {
|
|
|
64
70
|
name: "work",
|
|
65
71
|
calls: ["pool/agent"],
|
|
66
72
|
timeoutSecs: STEP_TIMEOUT_SECS,
|
|
67
|
-
results: ["done", "nothing", "failed", "unavailable", "cancelled", "interrupted"],
|
|
73
|
+
results: ["done", "nothing", "failed", "unavailable", "cancelled", "interrupted", "waiting"],
|
|
68
74
|
run: runWork,
|
|
69
75
|
},
|
|
70
76
|
{
|
|
@@ -125,6 +131,7 @@ export function createDevPlugin() {
|
|
|
125
131
|
},
|
|
126
132
|
{
|
|
127
133
|
name: "integrate",
|
|
134
|
+
reachesOutside: true,
|
|
128
135
|
calls: ["shell/check", "shell/command"],
|
|
129
136
|
timeoutSecs: STEP_TIMEOUT_SECS,
|
|
130
137
|
results: ["merged", "conflict", "fail", "failed", "cancelled"],
|
|
@@ -138,9 +145,15 @@ export function createDevPlugin() {
|
|
|
138
145
|
},
|
|
139
146
|
{
|
|
140
147
|
name: "announce",
|
|
141
|
-
results: ["done", "interrupted", "cancelled"],
|
|
148
|
+
results: ["done", "waiting", "interrupted", "cancelled"],
|
|
142
149
|
run: runAnnounce,
|
|
143
150
|
},
|
|
151
|
+
{
|
|
152
|
+
// The skills and access of a repository chat, read at every reply.
|
|
153
|
+
name: "chat_settings",
|
|
154
|
+
results: ["done", "failed"],
|
|
155
|
+
run: runChatSettings,
|
|
156
|
+
},
|
|
144
157
|
{
|
|
145
158
|
// The worktree a chat asked for; git runs in the repository.
|
|
146
159
|
name: "chat_worktree",
|
|
@@ -153,12 +166,29 @@ export function createDevPlugin() {
|
|
|
153
166
|
properties: {
|
|
154
167
|
checks: {
|
|
155
168
|
type: "integer",
|
|
169
|
+
title: "Checks at once",
|
|
156
170
|
minimum: 1,
|
|
157
171
|
default: 2,
|
|
158
172
|
editable: true,
|
|
159
173
|
description:
|
|
160
174
|
"How many checks (a task's verify, and the checks before a merge) may run at the same time on this machine, across all repositories.",
|
|
161
175
|
},
|
|
176
|
+
testHost: {
|
|
177
|
+
type: "string",
|
|
178
|
+
title: "Test host",
|
|
179
|
+
minLength: 1,
|
|
180
|
+
editable: true,
|
|
181
|
+
description:
|
|
182
|
+
"The ssh destination, such as user@host, that gate, integration and rerun commands run on through remote-check.sh. Unset runs them here. An OPERAD_CHECK_HOST already in serve's own environment wins over this setting.",
|
|
183
|
+
},
|
|
184
|
+
testSlots: {
|
|
185
|
+
type: "integer",
|
|
186
|
+
title: "Test slots",
|
|
187
|
+
minimum: 1,
|
|
188
|
+
editable: true,
|
|
189
|
+
description:
|
|
190
|
+
"How many checks run at once on the test host. Unset lets remote-check.sh use its default of 1. An OPERAD_CHECK_SLOTS already in serve's own environment wins over this setting.",
|
|
191
|
+
},
|
|
162
192
|
},
|
|
163
193
|
additionalProperties: false,
|
|
164
194
|
},
|
|
@@ -177,15 +207,18 @@ export function createDevPlugin() {
|
|
|
177
207
|
// A chat of a repository asked for a worktree and a person said yes.
|
|
178
208
|
{
|
|
179
209
|
source: "operad",
|
|
180
|
-
type:
|
|
210
|
+
type: WORKTREE_EVENT,
|
|
181
211
|
start: { flow: "dev:chat-worktree" },
|
|
182
212
|
object: "$event.object",
|
|
183
213
|
mode: "auto",
|
|
184
214
|
},
|
|
185
215
|
],
|
|
186
|
-
actions: [...actions, ...chatActions],
|
|
216
|
+
actions: [...actions, accessAction, ...chatActions, ...creationActions],
|
|
187
217
|
commands,
|
|
188
|
-
onTick:
|
|
218
|
+
onTick: async (ctx) => {
|
|
219
|
+
await registerRequested(ctx);
|
|
220
|
+
await runScheduler(ctx);
|
|
221
|
+
},
|
|
189
222
|
standing: devStanding,
|
|
190
223
|
views: {
|
|
191
224
|
repo: repoViews,
|
|
@@ -199,16 +232,26 @@ export function createDevPlugin() {
|
|
|
199
232
|
check(ctx) {
|
|
200
233
|
return checkDev(ctx);
|
|
201
234
|
},
|
|
235
|
+
// Setup Dev (ADR 0030 D15): the guide a bot follows for what check reports missing.
|
|
236
|
+
guide: DEV_SETUP_GUIDE,
|
|
202
237
|
});
|
|
203
238
|
}
|
|
204
239
|
|
|
240
|
+
/** The `SKILL.md` Setup Dev gives a bot (ADR 0010 D7). */
|
|
241
|
+
export const DEV_SETUP_GUIDE = fileURLToPath(new URL("../skills/setup/SKILL.md", import.meta.url));
|
|
242
|
+
|
|
243
|
+
/** The `SKILL.md` a bot follows for the first task in a folder without git (ADR 0039 D8), through `bot setup-git`. */
|
|
244
|
+
export const DEV_GIT_GUIDE = fileURLToPath(new URL("../skills/git/SKILL.md", import.meta.url));
|
|
245
|
+
|
|
205
246
|
export default createDevPlugin();
|
|
206
247
|
|
|
207
248
|
export * from "./actions.ts";
|
|
208
249
|
export * from "./announce.ts";
|
|
209
250
|
export * from "./chat.ts";
|
|
210
251
|
export * from "./check.ts";
|
|
252
|
+
export * from "./check-host.ts";
|
|
211
253
|
export * from "./commands.ts";
|
|
254
|
+
export * from "./create-actions.ts";
|
|
212
255
|
export * from "./gate.ts";
|
|
213
256
|
export * from "./integrate.ts";
|
|
214
257
|
export * from "./model.ts";
|
|
@@ -216,6 +259,9 @@ export * from "./flow-compiler.ts";
|
|
|
216
259
|
export * from "./project-flows.ts";
|
|
217
260
|
export * from "./schedule.ts";
|
|
218
261
|
export * from "./service.ts";
|
|
262
|
+
export * from "./register-requests.ts";
|
|
263
|
+
export * from "./git-state.ts";
|
|
264
|
+
export * from "./setup-git.ts";
|
|
219
265
|
export * from "./places.ts";
|
|
220
266
|
export * from "./project-settings.ts";
|
|
221
267
|
export * from "./retry.ts";
|