@phamvuhoang/otto-core 0.1.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 +53 -0
- package/dist/branch.d.ts +61 -0
- package/dist/branch.d.ts.map +1 -0
- package/dist/branch.js +215 -0
- package/dist/branch.js.map +1 -0
- package/dist/cli-help.d.ts +68 -0
- package/dist/cli-help.d.ts.map +1 -0
- package/dist/cli-help.js +365 -0
- package/dist/cli-help.js.map +1 -0
- package/dist/detach.d.ts +36 -0
- package/dist/detach.d.ts.map +1 -0
- package/dist/detach.js +52 -0
- package/dist/detach.js.map +1 -0
- package/dist/gh-main.d.ts +5 -0
- package/dist/gh-main.d.ts.map +1 -0
- package/dist/gh-main.js +16 -0
- package/dist/gh-main.js.map +1 -0
- package/dist/git.d.ts +14 -0
- package/dist/git.d.ts.map +1 -0
- package/dist/git.js +50 -0
- package/dist/git.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/keepalive.d.ts +24 -0
- package/dist/keepalive.d.ts.map +1 -0
- package/dist/keepalive.js +138 -0
- package/dist/keepalive.js.map +1 -0
- package/dist/loop.d.ts +42 -0
- package/dist/loop.d.ts.map +1 -0
- package/dist/loop.js +238 -0
- package/dist/loop.js.map +1 -0
- package/dist/main.d.ts +5 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +16 -0
- package/dist/main.js.map +1 -0
- package/dist/notify.d.ts +28 -0
- package/dist/notify.d.ts.map +1 -0
- package/dist/notify.js +119 -0
- package/dist/notify.js.map +1 -0
- package/dist/pacing.d.ts +8 -0
- package/dist/pacing.d.ts.map +1 -0
- package/dist/pacing.js +33 -0
- package/dist/pacing.js.map +1 -0
- package/dist/panel.d.ts +24 -0
- package/dist/panel.d.ts.map +1 -0
- package/dist/panel.js +202 -0
- package/dist/panel.js.map +1 -0
- package/dist/rate-limit.d.ts +16 -0
- package/dist/rate-limit.d.ts.map +1 -0
- package/dist/rate-limit.js +35 -0
- package/dist/rate-limit.js.map +1 -0
- package/dist/render.d.ts +8 -0
- package/dist/render.d.ts.map +1 -0
- package/dist/render.js +130 -0
- package/dist/render.js.map +1 -0
- package/dist/retry.d.ts +17 -0
- package/dist/retry.d.ts.map +1 -0
- package/dist/retry.js +34 -0
- package/dist/retry.js.map +1 -0
- package/dist/run-bin.d.ts +35 -0
- package/dist/run-bin.d.ts.map +1 -0
- package/dist/run-bin.js +241 -0
- package/dist/run-bin.js.map +1 -0
- package/dist/runner.d.ts +55 -0
- package/dist/runner.d.ts.map +1 -0
- package/dist/runner.js +297 -0
- package/dist/runner.js.map +1 -0
- package/dist/stage-exec.d.ts +16 -0
- package/dist/stage-exec.d.ts.map +1 -0
- package/dist/stage-exec.js +35 -0
- package/dist/stage-exec.js.map +1 -0
- package/dist/stages.d.ts +38 -0
- package/dist/stages.d.ts.map +1 -0
- package/dist/stages.js +38 -0
- package/dist/stages.js.map +1 -0
- package/dist/state.d.ts +25 -0
- package/dist/state.d.ts.map +1 -0
- package/dist/state.js +30 -0
- package/dist/state.js.map +1 -0
- package/dist/stream-render.d.ts +68 -0
- package/dist/stream-render.d.ts.map +1 -0
- package/dist/stream-render.js +162 -0
- package/dist/stream-render.js.map +1 -0
- package/dist/watch.d.ts +22 -0
- package/dist/watch.d.ts.map +1 -0
- package/dist/watch.js +93 -0
- package/dist/watch.js.map +1 -0
- package/package.json +67 -0
- package/templates/afk.md +21 -0
- package/templates/apply-review.md +71 -0
- package/templates/ghafk-issue.md +29 -0
- package/templates/ghafk.md +29 -0
- package/templates/ghprompt-workflow.md +83 -0
- package/templates/ghprompt.md +39 -0
- package/templates/prompt.md +97 -0
- package/templates/review-lens.md +41 -0
- package/templates/review-synth.md +29 -0
- package/templates/review-verify.md +52 -0
- package/templates/review.md +62 -0
- package/templates/superpowers.md +70 -0
- package/templates/verify.md +74 -0
package/dist/cli-help.js
ADDED
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { DEFAULT_MAX_RETRIES } from "./retry.js";
|
|
5
|
+
/** Parse a duration: bare integer = seconds; suffix s/m/h supported. Throws on invalid. */
|
|
6
|
+
export function parseDurationMs(raw) {
|
|
7
|
+
const m = raw.trim().match(/^(\d+)(s|m|h)?$/);
|
|
8
|
+
if (!m) {
|
|
9
|
+
throw new Error(`--max-wait must be seconds or a duration like 90m / 6h, got: ${JSON.stringify(raw)}`);
|
|
10
|
+
}
|
|
11
|
+
const n = Number.parseInt(m[1], 10);
|
|
12
|
+
const unit = m[2] ?? "s";
|
|
13
|
+
const factor = unit === "h" ? 3600_000 : unit === "m" ? 60_000 : 1000;
|
|
14
|
+
return n * factor;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Normalize a user-supplied issue reference to a positive integer.
|
|
18
|
+
* Accepts: `42`, `#42`, `owner/repo#42`, and GitHub issue URLs
|
|
19
|
+
* (`https://github.com/owner/repo/issues/42[#anchor]`). A repo component is
|
|
20
|
+
* ignored — only the number is used (gh resolves the repo from the workspace).
|
|
21
|
+
* Throws on anything that is not a positive integer.
|
|
22
|
+
*
|
|
23
|
+
* SECURITY: the returned integer is the ONLY part of the ref that may reach a
|
|
24
|
+
* shell (via the OTTO_ISSUE env var read by a static template command). Never
|
|
25
|
+
* pass the raw ref to a shell. See render.ts security invariant.
|
|
26
|
+
*/
|
|
27
|
+
export function parseIssueRef(raw) {
|
|
28
|
+
const s = raw.trim();
|
|
29
|
+
let token = s;
|
|
30
|
+
const urlMatch = s.match(/\/issues\/(\d+)(?:[#?].*)?$/);
|
|
31
|
+
if (urlMatch) {
|
|
32
|
+
token = urlMatch[1];
|
|
33
|
+
}
|
|
34
|
+
else if (s.includes("#")) {
|
|
35
|
+
token = s.slice(s.lastIndexOf("#") + 1);
|
|
36
|
+
}
|
|
37
|
+
if (!/^[1-9]\d*$/.test(token)) {
|
|
38
|
+
throw new Error(`--issue must be a positive issue number, #N, owner/repo#N, or a GitHub issue URL, got: ${JSON.stringify(raw)}`);
|
|
39
|
+
}
|
|
40
|
+
const n = Number.parseInt(token, 10);
|
|
41
|
+
if (!Number.isSafeInteger(n)) {
|
|
42
|
+
throw new Error(`--issue number is too large, got: ${JSON.stringify(raw)}`);
|
|
43
|
+
}
|
|
44
|
+
return n;
|
|
45
|
+
}
|
|
46
|
+
export function parseFlags(argv) {
|
|
47
|
+
let help = false;
|
|
48
|
+
let version = false;
|
|
49
|
+
let printConfig = false;
|
|
50
|
+
let noKeepAlive = false;
|
|
51
|
+
let maxRetries;
|
|
52
|
+
let expectingMaxRetries = false;
|
|
53
|
+
let detach = false;
|
|
54
|
+
let log;
|
|
55
|
+
let expectingLog = false;
|
|
56
|
+
let notify = false;
|
|
57
|
+
let budget;
|
|
58
|
+
let expectingBudget = false;
|
|
59
|
+
let cooldownMs;
|
|
60
|
+
let expectingCooldown = false;
|
|
61
|
+
let reviewPanel = false;
|
|
62
|
+
let watch = false;
|
|
63
|
+
let watchIntervalSec;
|
|
64
|
+
let expectingWatchInterval = false;
|
|
65
|
+
let issue;
|
|
66
|
+
let expectingIssue = false;
|
|
67
|
+
let maxWaitMs;
|
|
68
|
+
let expectingMaxWait = false;
|
|
69
|
+
let fresh = false;
|
|
70
|
+
let verify = false;
|
|
71
|
+
let applyReview;
|
|
72
|
+
let expectingApplyReview = false;
|
|
73
|
+
let branch;
|
|
74
|
+
let expectingBranch = false;
|
|
75
|
+
let branchPrefix;
|
|
76
|
+
let expectingBranchPrefix = false;
|
|
77
|
+
const rest = [];
|
|
78
|
+
for (const a of argv) {
|
|
79
|
+
if (expectingMaxRetries) {
|
|
80
|
+
if (!/^\d+$/.test(a)) {
|
|
81
|
+
throw new Error(`--max-retries must be a non-negative integer, got: ${JSON.stringify(a)}`);
|
|
82
|
+
}
|
|
83
|
+
maxRetries = Number.parseInt(a, 10);
|
|
84
|
+
expectingMaxRetries = false;
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
if (expectingLog) {
|
|
88
|
+
log = a;
|
|
89
|
+
expectingLog = false;
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
if (expectingBudget) {
|
|
93
|
+
const n = Number(a);
|
|
94
|
+
if (!Number.isFinite(n) || n <= 0) {
|
|
95
|
+
throw new Error(`--budget must be a positive number, got: ${JSON.stringify(a)}`);
|
|
96
|
+
}
|
|
97
|
+
budget = n;
|
|
98
|
+
expectingBudget = false;
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
if (expectingCooldown) {
|
|
102
|
+
if (!/^\d+$/.test(a)) {
|
|
103
|
+
throw new Error(`--cooldown must be a non-negative integer (ms), got: ${JSON.stringify(a)}`);
|
|
104
|
+
}
|
|
105
|
+
cooldownMs = Number.parseInt(a, 10);
|
|
106
|
+
expectingCooldown = false;
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
if (expectingWatchInterval) {
|
|
110
|
+
if (!/^\d+$/.test(a) || Number.parseInt(a, 10) <= 0) {
|
|
111
|
+
throw new Error(`--watch-interval must be a positive integer (seconds), got: ${JSON.stringify(a)}`);
|
|
112
|
+
}
|
|
113
|
+
watchIntervalSec = Number.parseInt(a, 10);
|
|
114
|
+
expectingWatchInterval = false;
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
if (expectingIssue) {
|
|
118
|
+
issue = parseIssueRef(a);
|
|
119
|
+
expectingIssue = false;
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
if (expectingMaxWait) {
|
|
123
|
+
maxWaitMs = parseDurationMs(a);
|
|
124
|
+
expectingMaxWait = false;
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
if (expectingApplyReview) {
|
|
128
|
+
applyReview = a;
|
|
129
|
+
expectingApplyReview = false;
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
if (expectingBranch) {
|
|
133
|
+
if (a !== "current" && a !== "branch" && a !== "worktree") {
|
|
134
|
+
throw new Error(`--branch must be one of current|branch|worktree, got: ${JSON.stringify(a)}`);
|
|
135
|
+
}
|
|
136
|
+
branch = a;
|
|
137
|
+
expectingBranch = false;
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
if (expectingBranchPrefix) {
|
|
141
|
+
branchPrefix = a;
|
|
142
|
+
expectingBranchPrefix = false;
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
if (a === "-h" || a === "--help")
|
|
146
|
+
help = true;
|
|
147
|
+
else if (a === "-V" || a === "--version")
|
|
148
|
+
version = true;
|
|
149
|
+
else if (a === "--print-config")
|
|
150
|
+
printConfig = true;
|
|
151
|
+
else if (a === "--no-keep-alive")
|
|
152
|
+
noKeepAlive = true;
|
|
153
|
+
else if (a === "--max-retries")
|
|
154
|
+
expectingMaxRetries = true;
|
|
155
|
+
else if (a === "--detach")
|
|
156
|
+
detach = true;
|
|
157
|
+
else if (a === "--log")
|
|
158
|
+
expectingLog = true;
|
|
159
|
+
else if (a === "--notify")
|
|
160
|
+
notify = true;
|
|
161
|
+
else if (a === "--budget")
|
|
162
|
+
expectingBudget = true;
|
|
163
|
+
else if (a === "--cooldown")
|
|
164
|
+
expectingCooldown = true;
|
|
165
|
+
else if (a === "--review-panel")
|
|
166
|
+
reviewPanel = true;
|
|
167
|
+
else if (a === "--watch")
|
|
168
|
+
watch = true;
|
|
169
|
+
else if (a === "--watch-interval")
|
|
170
|
+
expectingWatchInterval = true;
|
|
171
|
+
else if (a === "--issue")
|
|
172
|
+
expectingIssue = true;
|
|
173
|
+
else if (a === "--max-wait")
|
|
174
|
+
expectingMaxWait = true;
|
|
175
|
+
else if (a === "--fresh")
|
|
176
|
+
fresh = true;
|
|
177
|
+
else if (a === "--verify")
|
|
178
|
+
verify = true;
|
|
179
|
+
else if (a === "--apply-review")
|
|
180
|
+
expectingApplyReview = true;
|
|
181
|
+
else if (a === "--branch")
|
|
182
|
+
expectingBranch = true;
|
|
183
|
+
else if (a === "--branch-prefix")
|
|
184
|
+
expectingBranchPrefix = true;
|
|
185
|
+
else
|
|
186
|
+
rest.push(a);
|
|
187
|
+
}
|
|
188
|
+
if (expectingMaxRetries) {
|
|
189
|
+
throw new Error("--max-retries requires a value");
|
|
190
|
+
}
|
|
191
|
+
if (expectingLog) {
|
|
192
|
+
throw new Error("--log requires a value");
|
|
193
|
+
}
|
|
194
|
+
if (expectingBudget) {
|
|
195
|
+
throw new Error("--budget requires a value");
|
|
196
|
+
}
|
|
197
|
+
if (expectingCooldown) {
|
|
198
|
+
throw new Error("--cooldown requires a value");
|
|
199
|
+
}
|
|
200
|
+
if (expectingWatchInterval) {
|
|
201
|
+
throw new Error("--watch-interval requires a value");
|
|
202
|
+
}
|
|
203
|
+
if (expectingIssue) {
|
|
204
|
+
throw new Error("--issue requires a value");
|
|
205
|
+
}
|
|
206
|
+
if (expectingMaxWait) {
|
|
207
|
+
throw new Error("--max-wait requires a value");
|
|
208
|
+
}
|
|
209
|
+
if (expectingApplyReview) {
|
|
210
|
+
throw new Error("--apply-review requires a value");
|
|
211
|
+
}
|
|
212
|
+
if (expectingBranch) {
|
|
213
|
+
throw new Error("--branch requires a value");
|
|
214
|
+
}
|
|
215
|
+
if (expectingBranchPrefix) {
|
|
216
|
+
throw new Error("--branch-prefix requires a value");
|
|
217
|
+
}
|
|
218
|
+
if (log !== undefined && !detach) {
|
|
219
|
+
throw new Error("--log is only meaningful with --detach");
|
|
220
|
+
}
|
|
221
|
+
return {
|
|
222
|
+
help,
|
|
223
|
+
version,
|
|
224
|
+
printConfig,
|
|
225
|
+
noKeepAlive,
|
|
226
|
+
maxRetries,
|
|
227
|
+
detach,
|
|
228
|
+
log,
|
|
229
|
+
notify,
|
|
230
|
+
budget,
|
|
231
|
+
cooldownMs,
|
|
232
|
+
reviewPanel,
|
|
233
|
+
watch,
|
|
234
|
+
watchIntervalSec,
|
|
235
|
+
issue,
|
|
236
|
+
maxWaitMs,
|
|
237
|
+
fresh,
|
|
238
|
+
verify,
|
|
239
|
+
applyReview,
|
|
240
|
+
branch,
|
|
241
|
+
branchPrefix,
|
|
242
|
+
rest,
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Resolve the @phamvuhoang/otto-core version by reading the package.json that
|
|
247
|
+
* sits two levels up from the compiled cli-help.js (packages/core/dist/ →
|
|
248
|
+
* packages/core/package.json). Returns "?" if unreadable so version reporting
|
|
249
|
+
* never crashes the bin.
|
|
250
|
+
*/
|
|
251
|
+
export function readCoreVersion() {
|
|
252
|
+
try {
|
|
253
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
254
|
+
const pkgPath = join(here, "..", "package.json");
|
|
255
|
+
const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
|
|
256
|
+
return pkg.version ?? "?";
|
|
257
|
+
}
|
|
258
|
+
catch {
|
|
259
|
+
return "?";
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
export function printVersion(bin, cliVersion) {
|
|
263
|
+
const core = readCoreVersion();
|
|
264
|
+
const cli = cliVersion ?? "?";
|
|
265
|
+
process.stdout.write(`${bin} ${cli} (core ${core})\n`);
|
|
266
|
+
}
|
|
267
|
+
export function printHelp(bin, usage, description) {
|
|
268
|
+
process.stdout.write(`${bin} — ${description}
|
|
269
|
+
|
|
270
|
+
Usage:
|
|
271
|
+
${bin} ${usage}
|
|
272
|
+
${bin} --help | -h
|
|
273
|
+
${bin} --version | -V
|
|
274
|
+
${bin} --print-config [args...]
|
|
275
|
+
|
|
276
|
+
Flags:
|
|
277
|
+
-h, --help show this help and exit
|
|
278
|
+
-V, --version print bin + core version and exit
|
|
279
|
+
--print-config resolve workspace / runner / sandbox config, print, and exit
|
|
280
|
+
--no-keep-alive skip OS wake-lock acquisition (default: acquire system-sleep inhibitor for loop lifetime)
|
|
281
|
+
--max-retries <N> per-stage retry budget on transient failure (default: 3; 0 disables retries)
|
|
282
|
+
--detach fork the loop into a background process, print pid + log path, and exit (parent returns 0)
|
|
283
|
+
--log <path> override the detached log path (default: <workspace>/.otto-tmp/logs/detached-<parent-pid>.log; requires --detach)
|
|
284
|
+
--notify emit OS notification + terminal bell on loop completion or unrecoverable failure (default: off)
|
|
285
|
+
--budget <usd> stop the loop when cumulative stage cost reaches this USD ceiling (default: off)
|
|
286
|
+
--cooldown <ms> wait this many milliseconds between iterations; adaptive backoff doubles on throttle (default: 0)
|
|
287
|
+
--review-panel replace the single reviewer stage with correctness/security/tests lens reviewers + one synth commit (default: off)
|
|
288
|
+
--branch <mode> where Otto commits: current (default) | branch (new branch) | worktree (isolated checkout)
|
|
289
|
+
--branch-prefix <p> branch name prefix for branch/worktree modes (default: otto/)
|
|
290
|
+
--watch poll for labelled GitHub issues and run the loop whenever work is found (ghafk-only; default: off)
|
|
291
|
+
--watch-interval <sec> seconds between polls in watch mode (default: 300)
|
|
292
|
+
--issue <ref> target a single GitHub issue (number, #N, owner/repo#N, or issue URL); loop exits when it is done (ghafk-only; default: off)
|
|
293
|
+
--max-wait <dur> cap the wait when rate-limited before halting (e.g. 90m, 6h; default 6h)
|
|
294
|
+
--fresh ignore any saved resume state and start from iteration 1
|
|
295
|
+
--verify read-only: reconcile the plan against git, run the suites, write a report; make no commits (otto-afk)
|
|
296
|
+
--apply-review <doc> fix the actionable findings of a code-review document; track follow-ups (otto-afk)
|
|
297
|
+
|
|
298
|
+
Environment variables:
|
|
299
|
+
OTTO_WORKSPACE host dir Claude runs against (default: cwd)
|
|
300
|
+
OTTO_RUNNER "sandbox" (default) runs claude in the native OS sandbox with
|
|
301
|
+
writes confined to the workspace; "host" runs claude unsandboxed
|
|
302
|
+
(bare while-loop — only safe in a throwaway tree).
|
|
303
|
+
OTTO_SANDBOX_NET comma-separated domain allowlist for sandbox network egress.
|
|
304
|
+
Unset = unrestricted (filesystem is the blast-radius control).
|
|
305
|
+
OTTO_MODEL pin the claude model ("--model <value>" pass-through). Unset =
|
|
306
|
+
claude CLI default. The claude CLI validates the value.
|
|
307
|
+
OTTO_RESULT_GRACE_MS post-result grace timer ms (default 30000; 0 disables).
|
|
308
|
+
OTTO_REVIEW_LENSES comma-separated lens list for --review-panel (default: correctness,security,tests).
|
|
309
|
+
OTTO_WATCH_LABEL issue label to poll for in watch mode (default: "otto").
|
|
310
|
+
OTTO_MAX_WAIT default rate-limit wait cap (seconds or 90m/6h; default 6h).
|
|
311
|
+
OTTO_BRANCH default branch strategy (current|branch|worktree) when --branch is absent.
|
|
312
|
+
OTTO_BRANCH_PREFIX default branch-name prefix (default: "otto/").
|
|
313
|
+
`);
|
|
314
|
+
}
|
|
315
|
+
export function printConfig(bin, workspaceDir, packageDir, opts = {}) {
|
|
316
|
+
const { cliVersion, noKeepAlive = false, maxRetries = DEFAULT_MAX_RETRIES, detach = false, detachLogPath, notify = false, budget, cooldownMs, reviewLenses = [], watch = false, watchIntervalSec, issue, maxWaitMs, mode, branchStrategy, branchPrefix, } = opts;
|
|
317
|
+
const core = readCoreVersion();
|
|
318
|
+
const cli = cliVersion ?? "?";
|
|
319
|
+
const runner = process.env.OTTO_RUNNER?.trim() === "host" ? "host" : "sandbox";
|
|
320
|
+
const rawNet = process.env.OTTO_SANDBOX_NET?.trim();
|
|
321
|
+
const netStatus = runner === "host"
|
|
322
|
+
? "n/a (host runner)"
|
|
323
|
+
: rawNet
|
|
324
|
+
? `restricted to: ${rawNet}`
|
|
325
|
+
: "unrestricted (filesystem-only sandbox)";
|
|
326
|
+
const keepAliveStatus = noKeepAlive ? "off" : "on (system sleep only)";
|
|
327
|
+
const detachStatus = detach && detachLogPath ? `on (log: ${detachLogPath})` : "off";
|
|
328
|
+
const notifyStatus = notify ? "on" : "off";
|
|
329
|
+
const rawModel = process.env.OTTO_MODEL;
|
|
330
|
+
const modelStatus = rawModel && rawModel.trim() !== ""
|
|
331
|
+
? `${rawModel.trim()} (OTTO_MODEL)`
|
|
332
|
+
: "claude CLI default (OTTO_MODEL unset)";
|
|
333
|
+
const budgetStatus = budget != null ? `$${budget.toFixed(2)}` : "off";
|
|
334
|
+
const cooldownStatus = cooldownMs ? `${cooldownMs}ms` : "off";
|
|
335
|
+
const reviewStatus = reviewLenses.length
|
|
336
|
+
? `panel: ${reviewLenses.join(", ")}`
|
|
337
|
+
: "single reviewer";
|
|
338
|
+
const watchLabel = process.env.OTTO_WATCH_LABEL?.trim() || "otto";
|
|
339
|
+
const watchStatus = watch
|
|
340
|
+
? `on (every ${watchIntervalSec ?? 300}s, label "${watchLabel}")`
|
|
341
|
+
: "off";
|
|
342
|
+
const issueStatus = issue != null ? `#${issue}` : "off";
|
|
343
|
+
const branchStatus = `${branchStrategy ?? "current"} (prefix "${branchPrefix ?? "otto/"}")`;
|
|
344
|
+
process.stdout.write(`[${bin}] resolved config
|
|
345
|
+
version ${bin} ${cli} (core ${core})
|
|
346
|
+
mode ${mode ?? "afk"}
|
|
347
|
+
OTTO_WORKSPACE ${workspaceDir}${process.env.OTTO_WORKSPACE ? "" : " (default: cwd)"}
|
|
348
|
+
packageDir ${packageDir}
|
|
349
|
+
OTTO_RUNNER ${runner}${process.env.OTTO_RUNNER ? "" : " (default)"}
|
|
350
|
+
sandbox network ${netStatus}
|
|
351
|
+
model ${modelStatus}
|
|
352
|
+
keep-alive ${keepAliveStatus}
|
|
353
|
+
max-retries ${maxRetries}
|
|
354
|
+
detach ${detachStatus}
|
|
355
|
+
notify ${notifyStatus}
|
|
356
|
+
budget ${budgetStatus}
|
|
357
|
+
cooldown ${cooldownStatus}
|
|
358
|
+
max-wait ${maxWaitMs != null ? `${Math.round(maxWaitMs / 60000)}m` : "6h (default)"}
|
|
359
|
+
review ${reviewStatus}
|
|
360
|
+
branch ${branchStatus}
|
|
361
|
+
watch ${watchStatus}
|
|
362
|
+
issue ${issueStatus}
|
|
363
|
+
`);
|
|
364
|
+
}
|
|
365
|
+
//# sourceMappingURL=cli-help.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,IAAI,OAAO,IAAI,CAAC;IAE5F,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG;0BACJ,GAAG,IAAI,GAAG,UAAU,IAAI;0BACxB,IAAI,IAAI,KAAK;yBACd,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,kBAAkB;0BAClE,UAAU;yBACX,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa;0BACpD,SAAS;0BACT,WAAW;0BACX,eAAe;0BACf,UAAU;0BACV,YAAY;0BACZ,YAAY;0BACZ,YAAY;0BACZ,cAAc;0BACd,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,cAAc;0BACxE,YAAY;0BACZ,YAAY;0BACZ,WAAW;0BACX,WAAW;CACpC,CAAC,CAAC;AACH,CAAC"}
|
package/dist/detach.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type ChildProcess } from "node:child_process";
|
|
2
|
+
export type DetachedChild = Pick<ChildProcess, "pid" | "unref">;
|
|
3
|
+
export type DetachSpawner = (command: string, args: readonly string[], options: {
|
|
4
|
+
detached: boolean;
|
|
5
|
+
stdio: readonly ["ignore", number, number];
|
|
6
|
+
windowsHide: boolean;
|
|
7
|
+
}) => DetachedChild;
|
|
8
|
+
export type DetachOptions = {
|
|
9
|
+
/** Absolute path to the log file. stdout + stderr of the child are appended here. */
|
|
10
|
+
logPath: string;
|
|
11
|
+
/** The full original argv (from process.argv.slice(2)). --detach and --log are stripped before re-spawn. */
|
|
12
|
+
argv: string[];
|
|
13
|
+
/** Path to the bin script the child should run (typically process.argv[1]). */
|
|
14
|
+
binEntry: string;
|
|
15
|
+
execPath?: string;
|
|
16
|
+
spawnFn?: DetachSpawner;
|
|
17
|
+
openFd?: (path: string) => number;
|
|
18
|
+
ensureDir?: (path: string) => void;
|
|
19
|
+
stderr?: {
|
|
20
|
+
write: (s: string) => void;
|
|
21
|
+
};
|
|
22
|
+
exit?: (code?: number) => never;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Strip `--detach` and `--log <value>` from an argv array so the re-spawned
|
|
26
|
+
* child does not fork again and does not re-interpret the log target.
|
|
27
|
+
*/
|
|
28
|
+
export declare function stripDetachFlags(argv: readonly string[]): string[];
|
|
29
|
+
/**
|
|
30
|
+
* Fork the current bin into the background, redirect its stdio to `logPath`,
|
|
31
|
+
* print `detached pid <pid>, log <path>` on stderr, and exit the parent with
|
|
32
|
+
* code 0. The re-spawned child receives the original argv minus --detach /
|
|
33
|
+
* --log so it cannot fork again.
|
|
34
|
+
*/
|
|
35
|
+
export declare function detachAndExit(opts: DetachOptions): never;
|
|
36
|
+
//# sourceMappingURL=detach.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detach.d.ts","sourceRoot":"","sources":["../src/detach.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAI9D,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,YAAY,EAAE,KAAK,GAAG,OAAO,CAAC,CAAC;AAEhE,MAAM,MAAM,aAAa,GAAG,CAC1B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,OAAO,EAAE;IACP,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C,WAAW,EAAE,OAAO,CAAC;CACtB,KACE,aAAa,CAAC;AAEnB,MAAM,MAAM,aAAa,GAAG;IAC1B,qFAAqF;IACrF,OAAO,EAAE,MAAM,CAAC;IAChB,4GAA4G;IAC5G,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,+EAA+E;IAC/E,QAAQ,EAAE,MAAM,CAAC;IAEjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAClC,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,CAAC;IACxC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,KAAK,CAAC;CACjC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAYlE;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,aAAa,GAAG,KAAK,CA8BxD"}
|
package/dist/detach.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { mkdirSync, openSync } from "node:fs";
|
|
3
|
+
import { dirname } from "node:path";
|
|
4
|
+
/**
|
|
5
|
+
* Strip `--detach` and `--log <value>` from an argv array so the re-spawned
|
|
6
|
+
* child does not fork again and does not re-interpret the log target.
|
|
7
|
+
*/
|
|
8
|
+
export function stripDetachFlags(argv) {
|
|
9
|
+
const out = [];
|
|
10
|
+
for (let i = 0; i < argv.length; i++) {
|
|
11
|
+
const a = argv[i];
|
|
12
|
+
if (a === "--detach")
|
|
13
|
+
continue;
|
|
14
|
+
if (a === "--log") {
|
|
15
|
+
i++; // also skip the value
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
out.push(a);
|
|
19
|
+
}
|
|
20
|
+
return out;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Fork the current bin into the background, redirect its stdio to `logPath`,
|
|
24
|
+
* print `detached pid <pid>, log <path>` on stderr, and exit the parent with
|
|
25
|
+
* code 0. The re-spawned child receives the original argv minus --detach /
|
|
26
|
+
* --log so it cannot fork again.
|
|
27
|
+
*/
|
|
28
|
+
export function detachAndExit(opts) {
|
|
29
|
+
const execPath = opts.execPath ?? process.execPath;
|
|
30
|
+
const spawnFn = opts.spawnFn ??
|
|
31
|
+
((cmd, args, options) => spawn(cmd, args, {
|
|
32
|
+
detached: options.detached,
|
|
33
|
+
stdio: options.stdio,
|
|
34
|
+
windowsHide: options.windowsHide,
|
|
35
|
+
}));
|
|
36
|
+
const openFd = opts.openFd ?? ((p) => openSync(p, "a"));
|
|
37
|
+
const ensureDir = opts.ensureDir ?? ((p) => mkdirSync(p, { recursive: true }));
|
|
38
|
+
const stderr = opts.stderr ?? process.stderr;
|
|
39
|
+
const exit = opts.exit ?? ((code) => process.exit(code));
|
|
40
|
+
ensureDir(dirname(opts.logPath));
|
|
41
|
+
const logFd = openFd(opts.logPath);
|
|
42
|
+
const childArgv = stripDetachFlags(opts.argv);
|
|
43
|
+
const child = spawnFn(execPath, [opts.binEntry, ...childArgv], {
|
|
44
|
+
detached: true,
|
|
45
|
+
stdio: ["ignore", logFd, logFd],
|
|
46
|
+
windowsHide: true,
|
|
47
|
+
});
|
|
48
|
+
child.unref();
|
|
49
|
+
stderr.write(`detached pid ${child.pid}, log ${opts.logPath}\n`);
|
|
50
|
+
exit(0);
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=detach.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detach.js","sourceRoot":"","sources":["../src/detach.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAqB,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA8BpC;;;GAGG;AACH,MAAM,UAAU,gBAAg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,IAAI,GACR,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAE9C,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IACjC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAEnC,MAAM,SAAS,GAAG,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9C,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,SAAS,CAAC,EAAE;QAC7D,QAAQ,EAAE,IAAI;QACd,KAAK,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,CAAU;QACxC,WAAW,EAAE,IAAI;KAClB,CAAC,CAAC;IAEH,KAAK,CAAC,KAAK,EAAE,CAAC;IACd,MAAM,CAAC,KAAK,CAAC,gBAAgB,KAAK,CAAC,GAAG,SAAS,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC;IACjE,IAAI,CAAC,CAAC,CAAC,CAAC;AACV,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gh-main.d.ts","sourceRoot":"","sources":["../src/gh-main.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,eAAe,GAAG;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtD,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,MAAM,EAAE,EACd,IAAI,GAAE,eAAoB,GACzB,OAAO,CAAC,IAAI,CAAC,CAYf"}
|
package/dist/gh-main.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { runBin } from "./run-bin.js";
|
|
2
|
+
import { STAGES } from "./stages.js";
|
|
3
|
+
export async function runGhAfk(argv, opts = {}) {
|
|
4
|
+
await runBin(argv, {
|
|
5
|
+
bin: "otto-ghafk",
|
|
6
|
+
usage: "<iterations>",
|
|
7
|
+
desc: "GitHub-issue-driven Claude Code AFK loop",
|
|
8
|
+
stages: [STAGES.ghafkImplementer, STAGES.reviewer],
|
|
9
|
+
takesInputArg: false,
|
|
10
|
+
cliVersion: opts.cliVersion,
|
|
11
|
+
supportsWatch: true,
|
|
12
|
+
issueStage: STAGES.ghafkIssueImplementer,
|
|
13
|
+
mode: "ghafk",
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=gh-main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gh-main.js","sourceRoot":"","sources":["../src/gh-main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAIrC,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,IAAc,EACd,OAAwB,EAAE;IAE1B,MAAM,MAAM,CAAC,IAAI,EAAE;QACjB,GAAG,EAAE,YAAY;QACjB,KAAK,EAAE,cAAc;QACrB,IAAI,EAAE,0CAA0C;QAChD,MAAM,EAAE,CAAC,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,QAAQ,CAAC;QAClD,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,aAAa,EAAE,IAAI;QACnB,UAAU,EAAE,MAAM,CAAC,qBAAqB;QACxC,IAAI,EAAE,OAAO;KACd,CAAC,CAAC;AACL,CAAC"}
|
package/dist/git.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run git with literal args (no shell — args never interpolate runtime data).
|
|
3
|
+
* Returns trimmed stdout, or null on any non-zero exit / missing repo.
|
|
4
|
+
*/
|
|
5
|
+
export declare function git(args: string[], cwd: string): string | null;
|
|
6
|
+
/** True if `cwd` is inside a git work tree. */
|
|
7
|
+
export declare function isGitRepo(cwd: string): boolean;
|
|
8
|
+
/** True if any TRACKED file has uncommitted changes (untracked files ignored). */
|
|
9
|
+
export declare function hasUncommittedTrackedChanges(cwd: string): boolean;
|
|
10
|
+
/** True if `relPath` is gitignored in `cwd`. */
|
|
11
|
+
export declare function isPathIgnored(cwd: string, relPath: string): boolean;
|
|
12
|
+
/** True if a local branch/ref named `name` already exists. */
|
|
13
|
+
export declare function refExists(cwd: string, name: string): boolean;
|
|
14
|
+
//# sourceMappingURL=git.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAU9D;AAED,+CAA+C;AAC/C,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE9C;AAED,kFAAkF;AAClF,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAGjE;AAED,gDAAgD;AAChD,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAUnE;AAED,8DAA8D;AAC9D,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAW5D"}
|
package/dist/git.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { execFileSync } from "node:child_process";
|
|
2
|
+
/**
|
|
3
|
+
* Run git with literal args (no shell — args never interpolate runtime data).
|
|
4
|
+
* Returns trimmed stdout, or null on any non-zero exit / missing repo.
|
|
5
|
+
*/
|
|
6
|
+
export function git(args, cwd) {
|
|
7
|
+
try {
|
|
8
|
+
return execFileSync("git", args, {
|
|
9
|
+
cwd,
|
|
10
|
+
encoding: "utf8",
|
|
11
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
12
|
+
}).trim();
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/** True if `cwd` is inside a git work tree. */
|
|
19
|
+
export function isGitRepo(cwd) {
|
|
20
|
+
return git(["rev-parse", "--is-inside-work-tree"], cwd) === "true";
|
|
21
|
+
}
|
|
22
|
+
/** True if any TRACKED file has uncommitted changes (untracked files ignored). */
|
|
23
|
+
export function hasUncommittedTrackedChanges(cwd) {
|
|
24
|
+
const s = git(["status", "--porcelain", "--untracked-files=no"], cwd);
|
|
25
|
+
return s != null && s !== "";
|
|
26
|
+
}
|
|
27
|
+
/** True if `relPath` is gitignored in `cwd`. */
|
|
28
|
+
export function isPathIgnored(cwd, relPath) {
|
|
29
|
+
try {
|
|
30
|
+
execFileSync("git", ["check-ignore", "-q", relPath], {
|
|
31
|
+
cwd,
|
|
32
|
+
stdio: "ignore",
|
|
33
|
+
});
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/** True if a local branch/ref named `name` already exists. */
|
|
41
|
+
export function refExists(cwd, name) {
|
|
42
|
+
try {
|
|
43
|
+
execFileSync("git", ["rev-parse", "--verify", "--quiet", `refs/heads/${name}`], { cwd, stdio: "ignore" });
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=git.js.map
|
package/dist/git.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;;GAGG;AACH,MAAM,UAAU,GAAG,CAAC,IAAc,EAAE,GAAW;IAC7C,IAAI,CAAC;QACH,OAAO,YA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AO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { runAfk } from "./main.js";
|
|
2
|
+
export { runGhAfk } from "./gh-main.js";
|
|
3
|
+
export { runLoop, type LoopOptions, type LoopOutcome } from "./loop.js";
|
|
4
|
+
export { STAGES, type Stage } from "./stages.js";
|
|
5
|
+
export { renderTemplate, type RenderOptions, type RenderVars, } from "./render.js";
|
|
6
|
+
export { runStage, type StageResult } from "./runner.js";
|
|
7
|
+
export { runWatch, type RunWatchOptions } from "./watch.js";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EACL,cAAc,EACd,KAAK,aAAa,EAClB,KAAK,UAAU,GAChB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,QAAQ,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { runAfk } from "./main.js";
|
|
2
|
+
export { runGhAfk } from "./gh-main.js";
|
|
3
|
+
export { runLoop } from "./loop.js";
|
|
4
|
+
export { STAGES } from "./stages.js";
|
|
5
|
+
export { renderTemplate, } from "./render.js";
|
|
6
|
+
export { runStage } from "./runner.js";
|
|
7
|
+
export { runWatch } from "./watch.js";
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,OAAO,EAAsC,MAAM,WAAW,CAAC;AACxE,OAAO,EAAE,MAAM,EAAc,MAAM,aAAa,CAAC;AACjD,OAAO,EACL,cAAc,GAGf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,QAAQ,EAAoB,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAwB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type ChildProcess } from "node:child_process";
|
|
2
|
+
export type SpawnedChild = Pick<ChildProcess, "kill" | "on" | "pid">;
|
|
3
|
+
export type Spawner = (command: string, args: readonly string[], options: {
|
|
4
|
+
detached?: boolean;
|
|
5
|
+
stdio?: "ignore";
|
|
6
|
+
}) => SpawnedChild;
|
|
7
|
+
export type AcquireOptions = {
|
|
8
|
+
reason?: string;
|
|
9
|
+
spawner?: Spawner;
|
|
10
|
+
platform?: NodeJS.Platform;
|
|
11
|
+
parentPid?: number;
|
|
12
|
+
wslHint?: () => boolean;
|
|
13
|
+
warn?: (msg: string) => void;
|
|
14
|
+
};
|
|
15
|
+
export type Releaser = {
|
|
16
|
+
release: () => void;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Acquire an OS wake-lock for the lifetime of the returned Releaser. Platform
|
|
20
|
+
* dispatch is per-OS; missing utilities degrade to a no-op (warning emitted
|
|
21
|
+
* once) so the loop never crashes on a stripped image.
|
|
22
|
+
*/
|
|
23
|
+
export declare function acquire(opts?: AcquireOptions): Releaser;
|
|
24
|
+
//# sourceMappingURL=keepalive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keepalive.d.ts","sourceRoot":"","sources":["../src/keepalive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAG9D,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,GAAG,KAAK,CAAC,CAAC;AAErE,MAAM,MAAM,OAAO,GAAG,CACpB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,OAAO,EAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,QAAQ,CAAA;CAAE,KAC9C,YAAY,CAAC;AAElB,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC;IACxB,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAqEF;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,GAAE,cAAmB,GAAG,QAAQ,CA2E3D"}
|