@omacode/micromanager 0.0.0-stage → 1.0.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/LICENSE +201 -0
- package/README.md +30 -2
- package/THIRD_PARTY.md +100 -0
- package/decider/.python-version +1 -0
- package/decider/README.md +35 -0
- package/decider/decider/__init__.py +1 -0
- package/decider/decider/server.py +327 -0
- package/decider/pyproject.toml +34 -0
- package/decider/uv.lock +1255 -0
- package/dist/agenda.js +51 -0
- package/dist/agents.js +58 -0
- package/dist/artifact/handoff.js +281 -0
- package/dist/ask.js +200 -0
- package/dist/backends.js +219 -0
- package/dist/backlog.js +414 -0
- package/dist/bench.js +427 -0
- package/dist/board.js +1 -0
- package/dist/brief.js +202 -0
- package/dist/browser.js +679 -0
- package/dist/budget.js +61 -0
- package/dist/catalog.js +187 -0
- package/dist/checkchange.js +145 -0
- package/dist/checkpoint.js +94 -0
- package/dist/cli.js +764 -0
- package/dist/comfy-gate.js +258 -0
- package/dist/compact.js +142 -0
- package/dist/config.js +344 -0
- package/dist/context/capture.js +1 -0
- package/dist/context/digest.js +1 -0
- package/dist/context/embed.js +1 -0
- package/dist/context/index.js +2 -0
- package/dist/context/ledger.js +1 -0
- package/dist/context/manager.js +1 -0
- package/dist/context/memory.js +1 -0
- package/dist/context/policy.js +1 -0
- package/dist/context/prices.js +1 -0
- package/dist/context/recall.js +1 -0
- package/dist/context/rules.js +1 -0
- package/dist/context/search.js +1 -0
- package/dist/context/status.js +1 -0
- package/dist/context/store.js +1 -0
- package/dist/context/summary.js +1 -0
- package/dist/context/tokens.js +1 -0
- package/dist/context/tools.js +1 -0
- package/dist/continuation.js +184 -0
- package/dist/contract.js +294 -0
- package/dist/contractround.js +178 -0
- package/dist/control.js +1 -0
- package/dist/creative-tools.js +237 -0
- package/dist/dataset.js +175 -0
- package/dist/decide.js +676 -0
- package/dist/decider.js +171 -0
- package/dist/design-shell.js +448 -0
- package/dist/design.js +1410 -0
- package/dist/desktop.js +44 -0
- package/dist/egress.js +156 -0
- package/dist/eval.js +60 -0
- package/dist/evolver.js +302 -0
- package/dist/features.js +193 -0
- package/dist/followups.js +32 -0
- package/dist/forms.js +195 -0
- package/dist/gate.js +108 -0
- package/dist/gatebox.js +46 -0
- package/dist/grants.js +189 -0
- package/dist/graph.js +65 -0
- package/dist/guard/index.js +1 -0
- package/dist/guard/wire.js +1 -0
- package/dist/helpers.js +85 -0
- package/dist/hooks.js +158 -0
- package/dist/image-models.js +117 -0
- package/dist/integration.js +3 -0
- package/dist/journal.js +1 -0
- package/dist/look.js +363 -0
- package/dist/memory.js +1 -0
- package/dist/mode.js +97 -0
- package/dist/native.js +3348 -0
- package/dist/nogit.js +259 -0
- package/dist/outcomes.js +148 -0
- package/dist/permission.js +35 -0
- package/dist/pick.js +89 -0
- package/dist/pipelines.js +262 -0
- package/dist/plan.js +641 -0
- package/dist/plandoc.js +211 -0
- package/dist/plugin.js +4736 -0
- package/dist/policy.js +58 -0
- package/dist/pools.js +1 -0
- package/dist/preview.js +274 -0
- package/dist/profile.js +165 -0
- package/dist/progress.js +1 -0
- package/dist/promote.js +313 -0
- package/dist/redact.js +1 -0
- package/dist/registry.js +179 -0
- package/dist/riskscore.js +126 -0
- package/dist/roles.js +1 -0
- package/dist/routing.js +1 -0
- package/dist/runner.js +1892 -0
- package/dist/sandbox.js +3 -0
- package/dist/sandboxgate.js +90 -0
- package/dist/scheduler.js +170 -0
- package/dist/services-main.js +131 -0
- package/dist/services.js +265 -0
- package/dist/session.js +241 -0
- package/dist/setup.js +423 -0
- package/dist/shell/decide.js +1 -0
- package/dist/shell/index.js +2 -0
- package/dist/shell/sandbox.js +1 -0
- package/dist/shell/wire.js +1 -0
- package/dist/skills.js +103 -0
- package/dist/state.js +1 -0
- package/dist/store.js +1 -0
- package/dist/switcher.js +1 -0
- package/dist/synth.js +418 -0
- package/dist/tools.js +477 -0
- package/dist/trials.js +223 -0
- package/dist/usage.js +1 -0
- package/dist/wait.js +167 -0
- package/dist/watchdog.js +476 -0
- package/dist/web-guidance.js +43 -0
- package/dist/which.js +20 -0
- package/dist/worktree/git.js +545 -0
- package/dist/writeguard.js +311 -0
- package/evolver/mm_evolve/__init__.py +1 -0
- package/evolver/mm_evolve/entry.py +3 -0
- package/evolver/mm_evolve/evaluator.py +119 -0
- package/evolver/mm_evolve/llm.py +76 -0
- package/evolver/mm_evolve/run.py +89 -0
- package/evolver/mm_evolve/spec.py +62 -0
- package/evolver/pyproject.toml +21 -0
- package/evolver/uv.lock +772 -0
- package/package.json +74 -4
- package/skills/THIRD_PARTY.md +58 -0
- package/skills/code-review/SKILL.md +46 -0
- package/skills/deck/SKILL.md +98 -0
- package/skills/deliberate/SKILL.md +39 -0
- package/skills/design/SKILL.md +150 -0
- package/skills/diagnosing-bugs/SKILL.md +75 -0
- package/skills/image/SKILL.md +66 -0
- package/skills/orchestrator/SKILL.md +107 -0
- package/skills/receiving-code-review/SKILL.md +36 -0
- package/skills/research/SKILL.md +18 -0
- package/skills/tdd/SKILL.md +56 -0
- package/skills/tdd/mocking.md +59 -0
- package/skills/tdd/tests.md +77 -0
- package/skills/verification-before-completion/SKILL.md +50 -0
- package/skills/video/SKILL.md +97 -0
- package/skills/web/SKILL.md +60 -0
package/dist/config.js
ADDED
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
// ~/.config/opencode/omacode.jsonc (or its old name, core/paths.ts): optional overrides of the routing (JSON with // comments).
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { DEFAULT_FLOORS } from "./decide.js";
|
|
4
|
+
import { validatePolicies } from "./policy.js";
|
|
5
|
+
import { DEFAULT_REGISTRY, mergeRegistry } from "./registry.js";
|
|
6
|
+
import { DEFAULT_ROUTING } from "./routing.js";
|
|
7
|
+
import { ROLES } from "./roles.js";
|
|
8
|
+
import { DEFAULT_GRACE, DEFAULT_PICK, DEFAULT_TRIALS, MAX_TRIALS } from "./trials.js";
|
|
9
|
+
import { DEFAULT_REDACT, parseRedact } from "@omacode/core/redact-config";
|
|
10
|
+
import { stripComments } from "@omacode/core/jsonc";
|
|
11
|
+
import { configFilePath } from "@omacode/core/paths";
|
|
12
|
+
import { embeddingModel, serviceUrl } from "@omacode/core/services";
|
|
13
|
+
export { DEFAULT_REDACT, parseRedact, stripComments };
|
|
14
|
+
// omacode.jsonc, or an old name while the user has only that (core/paths.ts LEGACY_CONFIG_FILES).
|
|
15
|
+
export function configPath() {
|
|
16
|
+
return configFilePath();
|
|
17
|
+
}
|
|
18
|
+
import { liveRouting, loadPicks, loadRouting, NO_PICKS, parsePicks, parseRouting, picksPath, savePicks, } from "@omacode/state/picks";
|
|
19
|
+
export { liveRouting, loadPicks, loadRouting, NO_PICKS, parsePicks, parseRouting, picksPath, savePicks };
|
|
20
|
+
export function parseFloors(text) {
|
|
21
|
+
const raw = JSON.parse(stripComments(text)).floors ?? {};
|
|
22
|
+
const floors = { ...DEFAULT_FLOORS };
|
|
23
|
+
for (const [key, value] of Object.entries(raw)) {
|
|
24
|
+
if (!(key in DEFAULT_FLOORS))
|
|
25
|
+
throw new Error(`unknown floor ${JSON.stringify(key)}`);
|
|
26
|
+
const max = key === "risk" ? 2 : 1;
|
|
27
|
+
if (typeof value !== "number" || value < 0 || value > max)
|
|
28
|
+
throw new Error(`floors.${key} must be a number from 0 to ${max}`);
|
|
29
|
+
floors[key] = value;
|
|
30
|
+
}
|
|
31
|
+
return floors;
|
|
32
|
+
}
|
|
33
|
+
// "decider.floors": whether the conservative floors in src/decide.ts apply to every node ("default", the only honest
|
|
34
|
+
// state until the A2b gate passes) or a node that passed the bench may use its measured pair ("calibrated"). It is not
|
|
35
|
+
// a mode: the mode stays "local" or "cloud", and nothing here can send a question to the cloud.
|
|
36
|
+
export function parseFloorsMode(text) {
|
|
37
|
+
const raw = JSON.parse(stripComments(text));
|
|
38
|
+
const value = raw.decider?.floors;
|
|
39
|
+
if (value === undefined)
|
|
40
|
+
return "default";
|
|
41
|
+
if (value !== "default" && value !== "calibrated")
|
|
42
|
+
throw new Error('decider.floors must be "default" or "calibrated"');
|
|
43
|
+
return value;
|
|
44
|
+
}
|
|
45
|
+
// "decisions": the global policy per decision key, e.g. { "N6.pipeline": "fixed:P1", "N5": "ask" } (design.md §22).
|
|
46
|
+
export function parseDecisions(text) {
|
|
47
|
+
const raw = JSON.parse(stripComments(text)).decisions ?? {};
|
|
48
|
+
if (typeof raw !== "object" || raw === null || Array.isArray(raw))
|
|
49
|
+
throw new Error("decisions must be an object");
|
|
50
|
+
const errors = validatePolicies(raw);
|
|
51
|
+
if (errors.length > 0)
|
|
52
|
+
throw new Error(errors.join("; "));
|
|
53
|
+
return raw;
|
|
54
|
+
}
|
|
55
|
+
// "registry": models to add or change by id, e.g. [{ "id": "llamaswap/mimo", "disabled": true }] (design.md §19).
|
|
56
|
+
export function parseRegistry(text) {
|
|
57
|
+
const raw = JSON.parse(stripComments(text)).registry ?? [];
|
|
58
|
+
if (!Array.isArray(raw) || !raw.every((e) => typeof e === "object" && e !== null && typeof e.id === "string" && e.id.includes("/"))) {
|
|
59
|
+
throw new Error('registry must be a list of objects with an "id" like "provider/model"');
|
|
60
|
+
}
|
|
61
|
+
return mergeRegistry(DEFAULT_REGISTRY, raw);
|
|
62
|
+
}
|
|
63
|
+
// "notify": desktop notifications when a job needs the user or ends ("jobs", the default), also per task ("tasks"),
|
|
64
|
+
// or never ("off"). Updates in the micromanager's session come either way.
|
|
65
|
+
export function parseNotify(text) {
|
|
66
|
+
const raw = JSON.parse(stripComments(text)).notify ?? "jobs";
|
|
67
|
+
if (raw !== "jobs" && raw !== "tasks" && raw !== "off")
|
|
68
|
+
throw new Error('notify must be "jobs", "tasks" or "off"');
|
|
69
|
+
return raw;
|
|
70
|
+
}
|
|
71
|
+
export function parseUnsandboxed(text) {
|
|
72
|
+
const raw = JSON.parse(stripComments(text)).unsandboxed ?? "ask";
|
|
73
|
+
if (raw !== "ask" && raw !== "never" && raw !== "allow")
|
|
74
|
+
throw new Error('unsandboxed must be "ask", "never" or "allow"');
|
|
75
|
+
return raw;
|
|
76
|
+
}
|
|
77
|
+
// No limits unless the config sets them (the user's choice, 2026-10-05: a job cut at a limit wastes its work).
|
|
78
|
+
export const DEFAULT_BUDGET = {};
|
|
79
|
+
const CEILINGS = { tokens: 50_000_000, requests: 5000, cost: 1000 };
|
|
80
|
+
export function parseBudget(text) {
|
|
81
|
+
const raw = JSON.parse(stripComments(text)).budget;
|
|
82
|
+
if (raw === undefined)
|
|
83
|
+
return DEFAULT_BUDGET;
|
|
84
|
+
if (typeof raw !== "object" || raw === null || Array.isArray(raw))
|
|
85
|
+
throw new Error("budget must be an object");
|
|
86
|
+
const out = { ...DEFAULT_BUDGET };
|
|
87
|
+
for (const [key, value] of Object.entries(raw)) {
|
|
88
|
+
if (!(key in CEILINGS))
|
|
89
|
+
throw new Error(`unknown budget ${JSON.stringify(key)}`);
|
|
90
|
+
if (typeof value !== "number" || value <= 0)
|
|
91
|
+
throw new Error(`budget.${key} must be a positive number`);
|
|
92
|
+
out[key] = Math.min(value, CEILINGS[key]);
|
|
93
|
+
}
|
|
94
|
+
return out;
|
|
95
|
+
}
|
|
96
|
+
// "checkTimeout": how long one check of a task may run, in seconds (default 300). A check that hangs must not hold
|
|
97
|
+
// the job's gate for ever, and a long build needs more than the default. The job may lower or raise it for itself
|
|
98
|
+
// (src/state.ts Job.checkTimeoutMs); the default stays 300 s.
|
|
99
|
+
export const DEFAULT_CHECK_TIMEOUT_MS = 300_000;
|
|
100
|
+
const CHECK_TIMEOUT_CEILING_MS = 3_600_000;
|
|
101
|
+
export function parseCheckTimeout(text) {
|
|
102
|
+
const raw = JSON.parse(stripComments(text)).checkTimeout;
|
|
103
|
+
if (raw === undefined)
|
|
104
|
+
return DEFAULT_CHECK_TIMEOUT_MS;
|
|
105
|
+
if (typeof raw !== "number" || !Number.isFinite(raw) || raw <= 0)
|
|
106
|
+
throw new Error("checkTimeout must be a number of seconds above 0");
|
|
107
|
+
return Math.min(Math.round(raw * 1000), CHECK_TIMEOUT_CEILING_MS);
|
|
108
|
+
}
|
|
109
|
+
// "parallel": tasks of one job at the same time (default 3, at most 6); 1 runs them one after another.
|
|
110
|
+
// "perModel": sessions of one cloud model at the same time (default 2, at most 4); a local model serves one.
|
|
111
|
+
export function parseParallel(text) {
|
|
112
|
+
const raw = JSON.parse(stripComments(text));
|
|
113
|
+
const int = (v, name, def, max) => {
|
|
114
|
+
if (v === undefined)
|
|
115
|
+
return def;
|
|
116
|
+
if (typeof v !== "number" || !Number.isInteger(v) || v < 1)
|
|
117
|
+
throw new Error(`${name} must be a whole number from 1`);
|
|
118
|
+
return Math.min(v, max);
|
|
119
|
+
};
|
|
120
|
+
return { parallel: int(raw.parallel, "parallel", 3, 6), perModel: int(raw.perModel, "perModel", 2, 4) };
|
|
121
|
+
}
|
|
122
|
+
// "trials": attempts a hard writer task runs as at once, each on another model (default 1: one worker, then a retry;
|
|
123
|
+
// set 2-4 for a trial; src/trials.ts).
|
|
124
|
+
export function parseTrials(text) {
|
|
125
|
+
const raw = JSON.parse(stripComments(text)).trials;
|
|
126
|
+
if (raw === undefined)
|
|
127
|
+
return DEFAULT_TRIALS;
|
|
128
|
+
if (typeof raw !== "number" || !Number.isInteger(raw) || raw < 1)
|
|
129
|
+
throw new Error("trials must be a whole number from 1");
|
|
130
|
+
return Math.min(raw, MAX_TRIALS);
|
|
131
|
+
}
|
|
132
|
+
// "trialDeadline": minutes a trial decided by score (an attempt measured against a fitness contract, src/contract.ts)
|
|
133
|
+
// waits after its first passing attempt for the others; then the best of the passed ones is merged. Default 20.
|
|
134
|
+
export function parseTrialDeadline(text) {
|
|
135
|
+
const raw = JSON.parse(stripComments(text)).trialDeadline;
|
|
136
|
+
if (raw === undefined)
|
|
137
|
+
return 20;
|
|
138
|
+
if (typeof raw !== "number" || !(raw > 0))
|
|
139
|
+
throw new Error("trialDeadline must be a number of minutes above 0");
|
|
140
|
+
return raw;
|
|
141
|
+
}
|
|
142
|
+
// "trialPick": who decides a trial, by agent ("designer") or role id ("visual"), "*" for the rest: "first", "best" or
|
|
143
|
+
// "user" (src/trials.ts; a contract always decides by score). Keys not named keep their default.
|
|
144
|
+
export function parseTrialPick(text) {
|
|
145
|
+
const raw = JSON.parse(stripComments(text)).trialPick;
|
|
146
|
+
const out = { ...DEFAULT_PICK };
|
|
147
|
+
if (raw === undefined)
|
|
148
|
+
return out;
|
|
149
|
+
const shape = 'trialPick must be { "<agent or *>": "first" | "best" | "user" }';
|
|
150
|
+
if (typeof raw !== "object" || raw === null || Array.isArray(raw))
|
|
151
|
+
throw new Error(shape);
|
|
152
|
+
for (const [k, v] of Object.entries(raw)) {
|
|
153
|
+
if (v !== "first" && v !== "best" && v !== "user")
|
|
154
|
+
throw new Error(shape);
|
|
155
|
+
const role = k === "*" ? undefined : ROLES.find((r) => r.agent === k || r.id === k);
|
|
156
|
+
if (k !== "*" && !role)
|
|
157
|
+
throw new Error(`trialPick: unknown agent ${JSON.stringify(k)}`);
|
|
158
|
+
out[role?.id ?? "*"] = v;
|
|
159
|
+
}
|
|
160
|
+
return out;
|
|
161
|
+
}
|
|
162
|
+
// "trialGrace": the grace window of a "best" trial: the others get factor x the first passing attempt's time, at least
|
|
163
|
+
// minMinutes and at most maxMinutes. Default 0.5, 2 and 10.
|
|
164
|
+
export function parseTrialGrace(text) {
|
|
165
|
+
const raw = JSON.parse(stripComments(text)).trialGrace;
|
|
166
|
+
if (raw === undefined)
|
|
167
|
+
return DEFAULT_GRACE;
|
|
168
|
+
const shape = 'trialGrace must be { "factor": 0.., "minMinutes": 0.., "maxMinutes": 0.. }';
|
|
169
|
+
if (typeof raw !== "object" || raw === null)
|
|
170
|
+
throw new Error(shape);
|
|
171
|
+
const g = raw;
|
|
172
|
+
for (const v of [g.factor, g.minMinutes, g.maxMinutes])
|
|
173
|
+
if (v !== undefined && (typeof v !== "number" || v < 0))
|
|
174
|
+
throw new Error(shape);
|
|
175
|
+
const minutes = (v, d) => (v === undefined ? d : v * 60_000);
|
|
176
|
+
return { factor: g.factor ?? DEFAULT_GRACE.factor, minMs: minutes(g.minMinutes, DEFAULT_GRACE.minMs), maxMs: minutes(g.maxMinutes, DEFAULT_GRACE.maxMs) };
|
|
177
|
+
}
|
|
178
|
+
// "decider": { "mode": "local" | "cloud" }. "local" is the mode from day one (D21): every decision stays on this
|
|
179
|
+
// machine. "cloud" may send a decision to the cloud decision client — after deterministic redaction and, without a
|
|
180
|
+
// local NER, a preview and confirmation (D13). There is no hybrid (D11); a missing backend is a state, not a mode.
|
|
181
|
+
//
|
|
182
|
+
// The key before A2 was "cloudOnly": true becomes mode "cloud" and false (or an absent key) becomes "local". The true
|
|
183
|
+
// case is reported, because an old file must not become cloud mode silently; the lines come back from loadSettings and
|
|
184
|
+
// plugin.setup logs each one (src/plugin.ts), where the memory migration reports too.
|
|
185
|
+
export function parseMode(text, migrations = []) {
|
|
186
|
+
const raw = JSON.parse(stripComments(text));
|
|
187
|
+
if (raw.decider !== undefined && (typeof raw.decider !== "object" || raw.decider === null || Array.isArray(raw.decider))) {
|
|
188
|
+
throw new Error('decider must be an object, e.g. { "mode": "local" }');
|
|
189
|
+
}
|
|
190
|
+
const decider = raw.decider;
|
|
191
|
+
if (decider?.mode !== undefined) {
|
|
192
|
+
if (raw.cloudOnly !== undefined)
|
|
193
|
+
throw new Error('use "decider": { "mode": … } or the old "cloudOnly", not both');
|
|
194
|
+
if (decider.mode !== "local" && decider.mode !== "cloud")
|
|
195
|
+
throw new Error('decider.mode must be "local" or "cloud"');
|
|
196
|
+
return decider.mode;
|
|
197
|
+
}
|
|
198
|
+
if (raw.cloudOnly === undefined)
|
|
199
|
+
return "local";
|
|
200
|
+
if (typeof raw.cloudOnly !== "boolean")
|
|
201
|
+
throw new Error("cloudOnly must be true or false");
|
|
202
|
+
if (!raw.cloudOnly)
|
|
203
|
+
return "local";
|
|
204
|
+
migrations.push('config: "cloudOnly": true is now "decider": { "mode": "cloud" } — "cloudOnly" was removed in A2 (D11 gave the decider two modes, and cloudOnly is not one), so this file names the mode it meant; write "mode": "local" to keep everything on this machine');
|
|
205
|
+
return "cloud";
|
|
206
|
+
}
|
|
207
|
+
// "githubBacklog": the GitHub repositories ("owner/name") whose issues labelled micromanager are part of the backlog
|
|
208
|
+
// (src/backlog.ts, design.md §25 P7). Off for every other project: an issue is published content, so each repository is
|
|
209
|
+
// opted in by name. Reading them is free; an issue is only ever created after the user says so in a form.
|
|
210
|
+
export function parseGithubBacklog(text) {
|
|
211
|
+
const raw = JSON.parse(stripComments(text)).githubBacklog ?? [];
|
|
212
|
+
if (!Array.isArray(raw) || raw.some((r) => typeof r !== "string" || !/^[\w.-]+\/[\w.-]+$/.test(r)))
|
|
213
|
+
throw new Error('githubBacklog must be a list of repositories, e.g. ["owner/name"]');
|
|
214
|
+
return raw.map((r) => r.toLowerCase());
|
|
215
|
+
}
|
|
216
|
+
// "evolver": { "maxEvalSeconds": 600 }: the longest full measurement for which the plugin still offers the evolver
|
|
217
|
+
// (src/evolver.ts). Long ones are what a multi-step algorithm takes; a quick stage in the contract keeps them affordable.
|
|
218
|
+
export function parseEvolver(text) {
|
|
219
|
+
const raw = JSON.parse(stripComments(text)).evolver?.maxEvalSeconds;
|
|
220
|
+
if (raw === undefined)
|
|
221
|
+
return 600;
|
|
222
|
+
if (typeof raw !== "number" || !(raw > 0))
|
|
223
|
+
throw new Error("evolver.maxEvalSeconds must be a number of seconds above 0");
|
|
224
|
+
return raw;
|
|
225
|
+
}
|
|
226
|
+
// "allowOutside": absolute paths (or path prefixes) a worker may reach even where src/decide.ts refuses, e.g.
|
|
227
|
+
// ["/home/u/.config/omarchy"]. Empty by default: the user's list is the only thing that lifts those rules, and it lifts
|
|
228
|
+
// nothing until they write it. A wrong entry here is a widened rule, so the value is checked, not cast: a list of
|
|
229
|
+
// non-empty strings, each of which resolves to an absolute path. `~` is left to src/decide.ts to expand, so what the
|
|
230
|
+
// user wrote is what they can see in the journal.
|
|
231
|
+
export function parseAllowOutside(text) {
|
|
232
|
+
const raw = JSON.parse(stripComments(text)).allowOutside ?? [];
|
|
233
|
+
if (!Array.isArray(raw))
|
|
234
|
+
throw new Error('allowOutside must be a list of absolute paths, e.g. ["/home/u/.config/omarchy"]');
|
|
235
|
+
const out = [];
|
|
236
|
+
for (const entry of raw) {
|
|
237
|
+
if (typeof entry !== "string" || entry.trim() === "") {
|
|
238
|
+
throw new Error(`allowOutside must be a list of absolute paths; ${JSON.stringify(entry)} is not one`);
|
|
239
|
+
}
|
|
240
|
+
const path = entry.trim();
|
|
241
|
+
// A relative entry is a silent no-op or, worse, a guess at the cwd of whatever asked; say so instead.
|
|
242
|
+
if (!path.startsWith("/") && path !== "~" && !path.startsWith("~/")) {
|
|
243
|
+
throw new Error(`allowOutside entries must be absolute paths (or start with ~), got ${JSON.stringify(entry)}`);
|
|
244
|
+
}
|
|
245
|
+
// The entry is kept as written (src/decide.ts normalises it when it matches), so the journal shows the user their
|
|
246
|
+
// own words. A repeated entry is dropped: a list that lists the same path twice says nothing a list says once.
|
|
247
|
+
if (!out.includes(path))
|
|
248
|
+
out.push(path);
|
|
249
|
+
}
|
|
250
|
+
return out;
|
|
251
|
+
}
|
|
252
|
+
// "sandbox": run worker commands in the sandbox (src/shell/sandbox.ts; default true). "env": names of variables worker
|
|
253
|
+
// commands keep beyond the allowlist ("DATABASE_URL", or "MYAPP_*"). "network": domains worker commands may reach
|
|
254
|
+
// beyond the package registries ("api.example.com", "*.example.com", "host:8443"). Both lists are the user's standing
|
|
255
|
+
// grants for every job; a single job's grants come from request_env / request_network.
|
|
256
|
+
export function parseSandbox(text) {
|
|
257
|
+
const raw = JSON.parse(stripComments(text));
|
|
258
|
+
const sandbox = raw.sandbox ?? true;
|
|
259
|
+
if (typeof sandbox !== "boolean")
|
|
260
|
+
throw new Error("sandbox must be true or false");
|
|
261
|
+
const list = (value, name, ok, example) => {
|
|
262
|
+
if (value === undefined)
|
|
263
|
+
return [];
|
|
264
|
+
if (!Array.isArray(value) || !value.every((v) => typeof v === "string" && ok.test(v)))
|
|
265
|
+
throw new Error(`${name} must be a list like ${example}`);
|
|
266
|
+
return [...new Set(value)];
|
|
267
|
+
};
|
|
268
|
+
return {
|
|
269
|
+
sandbox,
|
|
270
|
+
env: list(raw.env, "env", /^[A-Za-z_][A-Za-z0-9_]*\*?$/, '["DATABASE_URL", "MYAPP_*"]'),
|
|
271
|
+
network: list(raw.network, "network", /^(\*\.)?[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(:\d{1,5})?$/, '["api.example.com", "*.example.com"]'),
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
export const DEFAULT_MEMORY = { enabled: true, embedding: { url: serviceUrl("embedding"), model: embeddingModel() ?? "qwen3-embedding-4b" } };
|
|
275
|
+
export function parseMemory(text) {
|
|
276
|
+
const raw = JSON.parse(stripComments(text)).memory;
|
|
277
|
+
if (raw === undefined)
|
|
278
|
+
return DEFAULT_MEMORY;
|
|
279
|
+
if (typeof raw === "boolean")
|
|
280
|
+
return { ...DEFAULT_MEMORY, enabled: raw };
|
|
281
|
+
if (typeof raw !== "object" || raw === null)
|
|
282
|
+
throw new Error('memory must be true, false or { "embedding": { "url": …, "model": … } | false }');
|
|
283
|
+
const m = raw;
|
|
284
|
+
if (m.enabled !== undefined && typeof m.enabled !== "boolean")
|
|
285
|
+
throw new Error("memory.enabled must be true or false");
|
|
286
|
+
let embedding = DEFAULT_MEMORY.embedding;
|
|
287
|
+
if (m.embedding === false)
|
|
288
|
+
embedding = false;
|
|
289
|
+
else if (m.embedding !== undefined) {
|
|
290
|
+
const e = m.embedding;
|
|
291
|
+
if (typeof e !== "object" || e === null || (e.url !== undefined && typeof e.url !== "string") || (e.model !== undefined && typeof e.model !== "string"))
|
|
292
|
+
throw new Error('memory.embedding must be { "url": "http://…", "model": "qwen3-embedding-4b" } or false');
|
|
293
|
+
embedding = { url: String(e.url ?? DEFAULT_MEMORY.embedding.url), model: String(e.model ?? DEFAULT_MEMORY.embedding.model) };
|
|
294
|
+
}
|
|
295
|
+
return { enabled: m.enabled ?? true, embedding };
|
|
296
|
+
}
|
|
297
|
+
// With mode "cloud", local models stay in the registry (they show up in the journal's ranking) but are never routed to.
|
|
298
|
+
export function cloudRegistry(registry) {
|
|
299
|
+
return registry.map((m) => (m.location === "local" ? { ...m, disabled: true } : m));
|
|
300
|
+
}
|
|
301
|
+
// The settings a config file that is missing or broken falls back to. One place, so the two returns below cannot drift
|
|
302
|
+
// apart and a setting added here is never left out of the error path.
|
|
303
|
+
const DEFAULTS = {
|
|
304
|
+
mode: "local",
|
|
305
|
+
migrations: [],
|
|
306
|
+
parallel: 3,
|
|
307
|
+
perModel: 2,
|
|
308
|
+
trials: DEFAULT_TRIALS,
|
|
309
|
+
trialDeadline: 20,
|
|
310
|
+
budget: DEFAULT_BUDGET,
|
|
311
|
+
checkTimeoutMs: DEFAULT_CHECK_TIMEOUT_MS,
|
|
312
|
+
notify: "jobs",
|
|
313
|
+
unsandboxed: "ask",
|
|
314
|
+
routing: DEFAULT_ROUTING,
|
|
315
|
+
floors: DEFAULT_FLOORS,
|
|
316
|
+
deciderFloors: "default",
|
|
317
|
+
decisions: {},
|
|
318
|
+
allowOutside: [],
|
|
319
|
+
githubBacklog: [],
|
|
320
|
+
evolverMaxEvalSeconds: 600,
|
|
321
|
+
sandbox: true,
|
|
322
|
+
env: [],
|
|
323
|
+
network: [],
|
|
324
|
+
memory: DEFAULT_MEMORY,
|
|
325
|
+
redact: DEFAULT_REDACT,
|
|
326
|
+
trialPick: DEFAULT_PICK,
|
|
327
|
+
trialGrace: DEFAULT_GRACE,
|
|
328
|
+
};
|
|
329
|
+
export function loadSettings(path = configPath()) {
|
|
330
|
+
let text;
|
|
331
|
+
try {
|
|
332
|
+
text = readFileSync(path, "utf8");
|
|
333
|
+
}
|
|
334
|
+
catch {
|
|
335
|
+
return { ...DEFAULTS, registry: DEFAULT_REGISTRY }; // no file: the defaults
|
|
336
|
+
}
|
|
337
|
+
try {
|
|
338
|
+
const migrations = [];
|
|
339
|
+
return { ...DEFAULTS, mode: parseMode(text, migrations), ...parseParallel(text), trials: parseTrials(text), trialDeadline: parseTrialDeadline(text), budget: parseBudget(text), checkTimeoutMs: parseCheckTimeout(text), notify: parseNotify(text), unsandboxed: parseUnsandboxed(text), routing: parseRouting(text), floors: parseFloors(text), deciderFloors: parseFloorsMode(text), decisions: parseDecisions(text), registry: parseRegistry(text), allowOutside: parseAllowOutside(text), githubBacklog: parseGithubBacklog(text), evolverMaxEvalSeconds: parseEvolver(text), ...parseSandbox(text), memory: parseMemory(text), redact: parseRedact(text), trialPick: parseTrialPick(text), trialGrace: parseTrialGrace(text), migrations };
|
|
340
|
+
}
|
|
341
|
+
catch (err) {
|
|
342
|
+
return { ...DEFAULTS, registry: DEFAULT_REGISTRY, error: `${path}: ${String(err)}` };
|
|
343
|
+
}
|
|
344
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@omacode/context/capture";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@omacode/context/digest";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@omacode/context/embed";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@omacode/context/ledger";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@omacode/context/manager";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@omacode/context/memory";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@omacode/context/policy";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@omacode/context/prices";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@omacode/context/recall";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@omacode/context/rules";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@omacode/context/search";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@omacode/context/status";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@omacode/context/store";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@omacode/context/summary";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@omacode/context/tokens";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@omacode/context/tools";
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
// The continuation of a planned job on native workers (run_job, omo-hybrid): which tasks the micromanager starts next.
|
|
2
|
+
//
|
|
3
|
+
// A planned job used to run on the runner, which made its worker sessions itself: they were not children of the
|
|
4
|
+
// micromanager (opencode 2.0.18 drops parentID on a plugin's session.create), so the user could not find them in the
|
|
5
|
+
// TUI (2026-10-19). Now the micromanager starts each planned task with the subagent tool, as it does its own tasks, and
|
|
6
|
+
// the code keeps the plan: after every worker's end it says which tasks are ready, until the job is done or stuck.
|
|
7
|
+
// That is the todo continuation of Sisyphus, driven by the job file rather than by the model's memory.
|
|
8
|
+
import { HEADER } from "./hooks.js";
|
|
9
|
+
import { jobBranch } from "./integration.js";
|
|
10
|
+
import { roleById } from "./roles.js";
|
|
11
|
+
import { allDone, isDone, parallelSafe, settled, startable } from "./state.js";
|
|
12
|
+
export { settled, startable };
|
|
13
|
+
const LIVE = new Set(["running", "gating", "fixing", "reviewing"]);
|
|
14
|
+
const OPEN = new Set(["pending", "ready", "planned"]);
|
|
15
|
+
const HALTED = new Set(["paused", "stopped", "done", "failed"]);
|
|
16
|
+
// The line of a subagent prompt that starts a planned task; native.ts parses it back (parseDelegation).
|
|
17
|
+
export const plannedLine = (task, job) => `Task: ${task} · ${job}`;
|
|
18
|
+
// Whether a task's work is in: it is merged, or the task that does it over is (in this job, or in another one the
|
|
19
|
+
// caller can look up: "job-…/T17").
|
|
20
|
+
function call(job, task) {
|
|
21
|
+
const agent = roleById(task.role)?.agent ?? task.role;
|
|
22
|
+
return `- agent ${agent}, description "${task.id} ${task.title}", prompt "${plannedLine(task.id, job.id)}"`;
|
|
23
|
+
}
|
|
24
|
+
// Two tasks cannot run at once when they both declare write scopes that overlap. `parallelSafe` says "safe" for a task
|
|
25
|
+
// without files (a reader), so the conflict check first requires both to be writers.
|
|
26
|
+
const overlapsFiles = (a, b) => a.files.length > 0 && b.files.length > 0 && !parallelSafe(a, b);
|
|
27
|
+
// The ready tasks that can start now, up to `limit` slots: in priority order, skip any that share a declared file with a
|
|
28
|
+
// task already running (`live`) or with one already picked for this batch. Parallel work stays file-disjoint.
|
|
29
|
+
export function selectDisjointBatch(ready, live, limit) {
|
|
30
|
+
const picked = [];
|
|
31
|
+
const blocks = (t, others) => others.some((o) => overlapsFiles(t, o));
|
|
32
|
+
for (const task of ready) {
|
|
33
|
+
if (picked.length >= limit)
|
|
34
|
+
break;
|
|
35
|
+
if (blocks(task, live) || blocks(task, picked))
|
|
36
|
+
continue;
|
|
37
|
+
picked.push(task);
|
|
38
|
+
}
|
|
39
|
+
return picked;
|
|
40
|
+
}
|
|
41
|
+
// What the micromanager does next for a planned job on native workers, or for its session's own job when it wrote
|
|
42
|
+
// todos (the todo tool); undefined while workers run and nothing new can start, for a job the runner runs, and for a
|
|
43
|
+
// paused or stopped one. A session's own job only hears which todos can start: it is "done" whenever the micromanager
|
|
44
|
+
// has nothing more in mind, which is not news.
|
|
45
|
+
// `allow` narrows the plan: a task it excludes is invisible to this step, neither started nor counted (A1-T11: a plan
|
|
46
|
+
// job that runs reader-only names no investigator). Callers that pass none see every task, as before.
|
|
47
|
+
export function nextStep(job, parallel, allow = () => true) {
|
|
48
|
+
if (!(job.native || job.rolling) || HALTED.has(job.phase))
|
|
49
|
+
return undefined;
|
|
50
|
+
const tasks = job.tasks.filter(allow);
|
|
51
|
+
const live = tasks.filter((t) => LIVE.has(t.status));
|
|
52
|
+
const candidates = startable({ ...job, tasks });
|
|
53
|
+
const ready = parallel > 0 ? selectDisjointBatch(candidates, live, Math.max(0, parallel - live.length)) : candidates.slice(0, Math.max(0, parallel - live.length));
|
|
54
|
+
if (ready.length) {
|
|
55
|
+
return {
|
|
56
|
+
kind: "start",
|
|
57
|
+
tasks: ready,
|
|
58
|
+
text: [
|
|
59
|
+
`${HEADER} job ${job.id}: start ${ready.length === 1 ? "this task" : "these tasks"} of your ${job.rolling ? "todo list" : "plan"} now, in one message, with the subagent tool (background = true):`,
|
|
60
|
+
...ready.map((t) => call(job, t)),
|
|
61
|
+
`The plugin gives each worker its task, files, checks and acceptance points from the ${job.rolling ? "todo" : "plan"}; add to a prompt only what it does not say, below that line. Do not wait for them: the next tasks follow in a note like this one when they end.`,
|
|
62
|
+
live.length ? `Still running: ${live.map((t) => t.id).join(", ")}.` : "",
|
|
63
|
+
].filter(Boolean).join("\n"),
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
if (live.length || !job.native)
|
|
67
|
+
return undefined;
|
|
68
|
+
// A cancelled task is out of the plan, unless an open task still needs it.
|
|
69
|
+
const needed = new Set(tasks.filter((t) => OPEN.has(t.status)).flatMap((t) => t.dependsOn));
|
|
70
|
+
const left = tasks.filter((t) => !isDone(t) && !t.undone && (t.status !== "cancelled" || needed.has(t.id)));
|
|
71
|
+
if (!left.length) {
|
|
72
|
+
const merged = tasks.filter((t) => isDone(t)).length;
|
|
73
|
+
return {
|
|
74
|
+
kind: "done",
|
|
75
|
+
text: `${HEADER} job ${job.id}: the plan is through, ${merged} of ${tasks.length} tasks merged on ${job.integrationBranch ?? jobBranch(job.id)}${merged < tasks.length ? " (the rest were cancelled)" : ""}. Tell the user briefly what changed; merge_job brings it into their checkout once they say so.`,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
const stopped = left.filter((t) => !OPEN.has(t.status));
|
|
79
|
+
const waiting = left.filter((t) => OPEN.has(t.status));
|
|
80
|
+
return {
|
|
81
|
+
kind: "stuck",
|
|
82
|
+
text: [
|
|
83
|
+
`${HEADER} job ${job.id} cannot go on by itself:`,
|
|
84
|
+
...stopped.map((t) => `- ${t.id} ${t.title}: ${t.status}${t.escalation ? ` (${t.escalation.detail.slice(0, 200)})` : t.summary ? ` (${t.summary.slice(0, 200)})` : ""}${t.session ? `, session ${t.session}` : ""}`),
|
|
85
|
+
waiting.length ? `Waiting on those: ${waiting.map((t) => `${t.id} (after ${t.dependsOn.join(", ")})`).join("; ")}.` : "",
|
|
86
|
+
`For each stopped task: continue its worker with the subagent tool and its sessionID when its change is worth keeping, start it again with a prompt "${plannedLine("T…", job.id)}", or ask the user. A task that is not needed any more: stop_task.`,
|
|
87
|
+
].filter(Boolean).join("\n"),
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
export function autoStep(job, running, parallel, last = {}) {
|
|
91
|
+
if (running > 0)
|
|
92
|
+
return undefined;
|
|
93
|
+
const ended = (t) => LIVE.has(t.status) && t.stages.at(-1)?.stage === "end";
|
|
94
|
+
const open = job.tasks.filter((t) => OPEN.has(t.status));
|
|
95
|
+
const stopped = job.tasks.filter((t) => ended(t) || ["escalated", "blocked"].includes(t.status)).filter((t) => !t.replacedBy);
|
|
96
|
+
const ready = startable(job);
|
|
97
|
+
if (!open.length && !stopped.length) {
|
|
98
|
+
return { kind: "done", text: `${HEADER} auto-continue: every todo of job ${job.id} is done. Give the user the final summary: what changed, and that merge_job brings it into their checkout once they say so.` };
|
|
99
|
+
}
|
|
100
|
+
const askUser = "Ask the user with the question tool how to go on (a form; their answer comes back to you).";
|
|
101
|
+
const list = (tasks) => tasks.map((t) => `${t.id} ${t.title} (${t.status}${ended(t) ? ", its worker ended unfinished" : ""})`).join("; ");
|
|
102
|
+
if (!ready.length) {
|
|
103
|
+
return { kind: "pause", pause: "waits for you", text: `${HEADER} auto-continue: job ${job.id} cannot go on by itself. ${stopped.length ? `Stopped or failed: ${list(stopped)}. ` : ""}${open.length ? `Waiting on those: ${open.map((t) => `${t.id} (after ${t.dependsOn.join(", ")})`).join("; ")}. ` : ""}${askUser}` };
|
|
104
|
+
}
|
|
105
|
+
const seen = `${job.tasks.filter(isDone).length}:${job.tasks.filter((t) => t.stages.some((s) => s.stage === "delegate")).length}`;
|
|
106
|
+
const wakes = seen === last.seen ? (last.wakes ?? 0) + 1 : 0;
|
|
107
|
+
if (wakes >= 2) {
|
|
108
|
+
return { kind: "pause", pause: "no progress", text: `${HEADER} auto-continue paused: two wakes in a row started no todo of job ${job.id} and finished none, though ${ready.map((t) => t.id).join(", ")} can start. ${askUser}` };
|
|
109
|
+
}
|
|
110
|
+
const now = selectDisjointBatch(ready, job.tasks.filter((t) => LIVE.has(t.status)), parallel ? ready.length : 1);
|
|
111
|
+
// Every ready todo shares a declared file with a live worker; wait for it to finish rather than pausing.
|
|
112
|
+
if (now.length === 0)
|
|
113
|
+
return undefined;
|
|
114
|
+
return {
|
|
115
|
+
kind: "wake",
|
|
116
|
+
seen,
|
|
117
|
+
wakes,
|
|
118
|
+
text: [
|
|
119
|
+
`${HEADER} auto-continue: job ${job.id} goes on. Start ${now.length > 1 ? "these todos now, in one message" : "this todo now"}, with the subagent tool (background = true):`,
|
|
120
|
+
...now.map((t) => call(job, t)),
|
|
121
|
+
stopped.length ? `Also stopped: ${list(stopped)}: continue a worker with its sessionID when its change is worth keeping, or write a todo that replaces it.` : "",
|
|
122
|
+
"Ask the user only what only they can decide, with the question tool.",
|
|
123
|
+
].filter(Boolean).join("\n"),
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
// The optional post-green pass: after every task of a job is done and at least one writer merged, append one more task
|
|
127
|
+
// that inspects the merged files for concrete waste. It runs only when the job asked for it (the `optimize` option, or a
|
|
128
|
+
// plan task flagged `optimize`), only once (`job.optimized`), and never on a plan-only or planning-less job. The writer
|
|
129
|
+
// that runs it may find nothing and call finish_task with no edits; a failed or no-gain optimization is dropped, not a
|
|
130
|
+
// blocker.
|
|
131
|
+
export function ensurePostGreenTask(job, optimizeEnabled) {
|
|
132
|
+
if (!(optimizeEnabled || job.tasks.some((t) => t.optimize && !t.postGreen)))
|
|
133
|
+
return undefined;
|
|
134
|
+
if (job.optimized)
|
|
135
|
+
return undefined;
|
|
136
|
+
if (job.isolation === "plan" || job.isolation === "none")
|
|
137
|
+
return undefined;
|
|
138
|
+
if (!(job.tasks.length > 0 && allDone(job)))
|
|
139
|
+
return undefined;
|
|
140
|
+
const mergedWriters = job.tasks.filter((t) => !t.postGreen && t.status === "merged");
|
|
141
|
+
if (mergedWriters.length === 0)
|
|
142
|
+
return undefined;
|
|
143
|
+
// The files to look at: every merged writer when the job asked for it, else only the ones the plan flagged `optimize`.
|
|
144
|
+
const scope = optimizeEnabled ? mergedWriters : mergedWriters.filter((t) => t.optimize);
|
|
145
|
+
// One repository per pass: when the writers span more than one, keep the dominant (most common) repo, ties to the first.
|
|
146
|
+
const counts = new Map();
|
|
147
|
+
for (const t of scope) {
|
|
148
|
+
const key = t.repo ?? "";
|
|
149
|
+
counts.set(key, (counts.get(key) ?? 0) + 1);
|
|
150
|
+
}
|
|
151
|
+
const dominant = counts.size === 0 ? "" : [...counts.entries()].sort((a, b) => b[1] - a[1])[0][0];
|
|
152
|
+
const repo = dominant === "" ? undefined : dominant;
|
|
153
|
+
const files = [...new Set(scope.filter((t) => (t.repo ?? "") === dominant).flatMap((t) => t.files))];
|
|
154
|
+
job.optimized = true;
|
|
155
|
+
if (files.length === 0)
|
|
156
|
+
return undefined;
|
|
157
|
+
let id = "T-opt";
|
|
158
|
+
for (let n = 2; job.tasks.some((t) => t.id === id); n += 1)
|
|
159
|
+
id = `T-opt-${n}`;
|
|
160
|
+
const wave = Math.max(0, ...job.tasks.map((t) => t.wave)) + 1;
|
|
161
|
+
const acceptance = [...new Set(mergedWriters.flatMap((t) => t.acceptance))];
|
|
162
|
+
const task = {
|
|
163
|
+
id,
|
|
164
|
+
title: "Post-green code optimization pass",
|
|
165
|
+
description: "Inspect the newly merged changes in the listed files. Eliminate concrete waste — redundant passes, O(n^2) scans, unnecessary allocations or serialization, N+1 I/O, or dead code — without changing external behavior or public signatures. Run all checks. If the code is already clean and tight, make no file edits and call finish_task immediately.",
|
|
166
|
+
role: "code",
|
|
167
|
+
acceptance: acceptance.length ? acceptance : job.acceptance.map((a) => a.id),
|
|
168
|
+
dependsOn: mergedWriters.map((t) => t.id),
|
|
169
|
+
files,
|
|
170
|
+
wave,
|
|
171
|
+
status: "ready",
|
|
172
|
+
attempts: 0,
|
|
173
|
+
stages: [],
|
|
174
|
+
signatures: [],
|
|
175
|
+
priority: 3,
|
|
176
|
+
origin: "plan",
|
|
177
|
+
tier: "medium",
|
|
178
|
+
...(repo ? { repo } : {}),
|
|
179
|
+
optimize: true,
|
|
180
|
+
postGreen: true,
|
|
181
|
+
};
|
|
182
|
+
job.tasks.push(task);
|
|
183
|
+
return task;
|
|
184
|
+
}
|