@firefunc-agent/runner 0.9.7 → 0.9.34
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 +169 -10
- package/dist/activity.d.ts +1 -0
- package/dist/activity.js +1 -1
- package/dist/alive.d.ts +40 -0
- package/dist/alive.js +138 -0
- package/dist/api-fallback.d.ts +11 -0
- package/dist/api-fallback.js +80 -0
- package/dist/api.d.ts +186 -3
- package/dist/api.js +311 -6
- package/dist/ask/index.d.ts +20 -0
- package/dist/ask/index.js +64 -0
- package/dist/ask-first.d.ts +8 -0
- package/dist/brief-file.d.ts +15 -0
- package/dist/brief-file.js +36 -0
- package/dist/brief.d.ts +5 -0
- package/dist/brief.js +19 -3
- package/dist/build-caches.d.ts +7 -0
- package/dist/build-caches.js +63 -0
- package/dist/build-info.json +2 -2
- package/dist/checkpoint.d.ts +40 -0
- package/dist/checkpoint.js +98 -0
- package/dist/cli.js +184 -18
- package/dist/cloud-boot.d.ts +41 -0
- package/dist/cloud-boot.js +239 -0
- package/dist/command-activity.d.ts +23 -0
- package/dist/command-activity.js +89 -0
- package/dist/command-step.d.ts +58 -0
- package/dist/command-step.js +248 -0
- package/dist/config.d.ts +40 -0
- package/dist/config.js +23 -0
- package/dist/cut.d.ts +2 -1
- package/dist/cut.js +19 -5
- package/dist/daemon.js +375 -14
- package/dist/device-lease.d.ts +15 -0
- package/dist/device-lease.js +608 -0
- package/dist/editor/fs-server.d.ts +31 -0
- package/dist/editor/fs-server.js +159 -0
- package/dist/editor/relay-crypto.d.ts +68 -0
- package/dist/editor/relay-crypto.js +191 -0
- package/dist/editor/sessions.d.ts +50 -0
- package/dist/editor/sessions.js +279 -0
- package/dist/editor/worktree-of.d.ts +1 -0
- package/dist/editor/worktree-of.js +23 -0
- package/dist/editor/ws-client.d.ts +26 -0
- package/dist/editor/ws-client.js +227 -0
- package/dist/engine-account.d.ts +24 -0
- package/dist/engine-account.js +118 -0
- package/dist/engine-login.d.ts +12 -0
- package/dist/engine-login.js +88 -0
- package/dist/engine-models.d.ts +13 -0
- package/dist/engine-models.js +71 -0
- package/dist/engine-watch.d.ts +1 -0
- package/dist/engine-watch.js +22 -6
- package/dist/engines/antigravity.js +19 -4
- package/dist/engines/claude.js +15 -8
- package/dist/engines/codex.js +16 -2
- package/dist/engines/copilot.js +12 -0
- package/dist/engines/crush.d.ts +2 -0
- package/dist/engines/crush.js +58 -0
- package/dist/engines/cursor.js +12 -0
- package/dist/engines/gemini.js +14 -9
- package/dist/engines/index.d.ts +8 -0
- package/dist/engines/index.js +73 -1
- package/dist/engines/kilo.d.ts +2 -0
- package/dist/engines/kilo.js +63 -0
- package/dist/engines/opencode.d.ts +9 -0
- package/dist/engines/opencode.js +234 -0
- package/dist/engines/openhands.d.ts +10 -0
- package/dist/engines/openhands.js +271 -0
- package/dist/engines/pi.d.ts +10 -0
- package/dist/engines/pi.js +248 -0
- package/dist/engines/qwen.d.ts +8 -0
- package/dist/engines/qwen.js +153 -0
- package/dist/engines/sessions.d.ts +6 -0
- package/dist/engines/sessions.js +68 -0
- package/dist/engines/types.d.ts +3 -3
- package/dist/exec.d.ts +1 -0
- package/dist/exec.js +10 -4
- package/dist/firefunc/agents.d.ts +8 -1
- package/dist/firefunc/agents.js +53 -3
- package/dist/firefunc/auth.js +72 -19
- package/dist/firefunc/cli.js +25 -0
- package/dist/firefunc/client.d.ts +5 -1
- package/dist/firefunc/client.js +12 -2
- package/dist/firefunc/config.d.ts +11 -1
- package/dist/firefunc/config.js +6 -4
- package/dist/firefunc/io.d.ts +1 -0
- package/dist/firefunc/main.js +8 -1
- package/dist/firefunc/oauth-login.d.ts +23 -0
- package/dist/firefunc/oauth-login.js +304 -0
- package/dist/firefunc/tasks.d.ts +4 -0
- package/dist/firefunc/tasks.js +89 -2
- package/dist/fleet-words.d.ts +2 -0
- package/dist/fleet-words.js +7 -0
- package/dist/git-auth.d.ts +16 -0
- package/dist/git-auth.js +48 -2
- package/dist/held.d.ts +3 -0
- package/dist/job.d.ts +26 -3
- package/dist/job.js +1109 -132
- package/dist/keep-awake.d.ts +17 -0
- package/dist/keep-awake.js +90 -0
- package/dist/keep-local.d.ts +2 -1
- package/dist/keep-local.js +8 -3
- package/dist/limit.d.ts +10 -1
- package/dist/limit.js +264 -4
- package/dist/local-checks.d.ts +19 -0
- package/dist/local-checks.js +79 -0
- package/dist/locks.d.ts +21 -1
- package/dist/locks.js +279 -66
- package/dist/machine-commands.d.ts +21 -0
- package/dist/machine-commands.js +107 -0
- package/dist/machine-profile.d.ts +18 -0
- package/dist/machine-profile.js +69 -0
- package/dist/mcp-init.d.ts +2 -0
- package/dist/mcp-init.js +28 -0
- package/dist/mcp.d.ts +13 -1
- package/dist/mcp.js +23 -2
- package/dist/network.js +3 -2
- package/dist/orphans.d.ts +4 -0
- package/dist/orphans.js +96 -4
- package/dist/plan-phase/index.d.ts +11 -0
- package/dist/plan-phase/index.js +46 -0
- package/dist/pool.d.ts +1 -0
- package/dist/pool.js +29 -4
- package/dist/pr-title.d.ts +15 -0
- package/dist/pr-title.js +33 -0
- package/dist/recover.d.ts +3 -1
- package/dist/recover.js +27 -7
- package/dist/reference-files.d.ts +27 -0
- package/dist/reference-files.js +202 -0
- package/dist/release-draft.d.ts +79 -0
- package/dist/release-draft.js +301 -0
- package/dist/resources.d.ts +86 -0
- package/dist/resources.js +217 -0
- package/dist/restart-idle.d.ts +23 -0
- package/dist/restart-idle.js +67 -0
- package/dist/run-attachments.d.ts +84 -0
- package/dist/run-attachments.js +281 -0
- package/dist/run-stops.d.ts +15 -0
- package/dist/run-stops.js +90 -0
- package/dist/run-temp.d.ts +12 -0
- package/dist/run-temp.js +57 -0
- package/dist/secret-scan.d.ts +6 -1
- package/dist/secret-scan.js +33 -0
- package/dist/secret-values.d.ts +17 -0
- package/dist/secret-values.js +81 -0
- package/dist/self-upgrade.d.ts +36 -0
- package/dist/self-upgrade.js +78 -0
- package/dist/service.d.ts +7 -1
- package/dist/service.js +50 -7
- package/dist/sign-in.d.ts +41 -0
- package/dist/sign-in.js +239 -0
- package/dist/tool-call.d.ts +59 -0
- package/dist/tool-call.js +375 -0
- package/dist/trail/chain.d.ts +12 -0
- package/dist/trail/chain.js +89 -0
- package/dist/trail/deltas.d.ts +34 -0
- package/dist/trail/deltas.js +206 -0
- package/dist/trail/index.d.ts +27 -0
- package/dist/trail/index.js +128 -0
- package/dist/trail/keys.d.ts +14 -0
- package/dist/trail/keys.js +61 -0
- package/dist/trail/recorder.d.ts +118 -0
- package/dist/trail/recorder.js +697 -0
- package/dist/trail/rules.d.ts +30 -0
- package/dist/trail/rules.js +158 -0
- package/dist/trail/stream.d.ts +41 -0
- package/dist/trail/stream.js +86 -0
- package/dist/transport.d.ts +26 -0
- package/dist/transport.js +118 -0
- package/dist/work-dir.d.ts +11 -0
- package/dist/work-dir.js +69 -0
- package/dist/worktree-report.d.ts +10 -0
- package/dist/worktree-report.js +17 -0
- package/dist/worktrees.d.ts +16 -1
- package/dist/worktrees.js +62 -17
- package/package.json +4 -4
- package/skill/firefunc/SKILL.md +4 -3
package/dist/worktrees.js
CHANGED
|
@@ -1,27 +1,41 @@
|
|
|
1
1
|
import { rmSync } from 'node:fs';
|
|
2
2
|
import { tmpdir } from 'node:os';
|
|
3
|
-
import {
|
|
3
|
+
import { workRoots } from './work-dir.js';
|
|
4
|
+
import { basename } from 'node:path';
|
|
4
5
|
import { exec } from './exec.js';
|
|
5
|
-
import { killOrphans, reviewCopiesOf } from './orphans.js';
|
|
6
|
+
import { isAlive, killOrphans, reviewCopiesOf } from './orphans.js';
|
|
7
|
+
import { listHeld } from './held.js';
|
|
8
|
+
import { listKept } from './ask-first.js';
|
|
6
9
|
const RUNNER_WORKTREE_NAME = /^firefunc-[A-Za-z0-9]{6}$/;
|
|
7
|
-
function tempRoots() {
|
|
8
|
-
const t = tmpdir().replace(/\/+$/, '');
|
|
9
|
-
const out = new Set([t]);
|
|
10
|
-
if (t.startsWith('/private/'))
|
|
11
|
-
out.add(t.slice('/private'.length));
|
|
12
|
-
else if (t.startsWith('/var/'))
|
|
13
|
-
out.add(`/private${t}`);
|
|
14
|
-
out.add('/tmp');
|
|
15
|
-
out.add('/private/tmp');
|
|
16
|
-
return out;
|
|
17
|
-
}
|
|
18
10
|
export function canonicalPath(path) {
|
|
19
|
-
|
|
11
|
+
return canonicalPathOn(path, process.platform);
|
|
12
|
+
}
|
|
13
|
+
export function canonicalPathOn(path, platform) {
|
|
14
|
+
let clean = path;
|
|
15
|
+
if (platform === 'win32')
|
|
16
|
+
clean = clean.replace(/\\/g, '/').toLowerCase();
|
|
17
|
+
clean = clean.replace(/\/+$/, '');
|
|
20
18
|
return /^\/private\/(?:var|tmp)(?:\/|$)/.test(clean) ? clean.slice('/private'.length) : clean;
|
|
21
19
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
function tempRoots(platform, tmp, extra) {
|
|
21
|
+
return new Set([
|
|
22
|
+
canonicalPathOn(tmp, platform),
|
|
23
|
+
'/tmp',
|
|
24
|
+
...extra.map((d) => canonicalPathOn(d, platform)),
|
|
25
|
+
]);
|
|
26
|
+
}
|
|
27
|
+
export function isRunnerWorktree(path, opts = {}) {
|
|
28
|
+
const platform = opts.platform ?? process.platform;
|
|
29
|
+
const clean = canonicalPathOn(path, platform);
|
|
30
|
+
const cut = clean.lastIndexOf('/');
|
|
31
|
+
if (cut < 0)
|
|
32
|
+
return false;
|
|
33
|
+
const name = path
|
|
34
|
+
.replace(/[\\/]+$/, '')
|
|
35
|
+
.split(/[\\/]/)
|
|
36
|
+
.pop() ?? '';
|
|
37
|
+
return (RUNNER_WORKTREE_NAME.test(name) &&
|
|
38
|
+
tempRoots(platform, opts.tmp ?? tmpdir(), opts.roots ?? workRoots()).has(clean.slice(0, cut)));
|
|
25
39
|
}
|
|
26
40
|
export async function worktreesOf(checkout) {
|
|
27
41
|
const r = await exec('git', ['-C', checkout, 'worktree', 'list', '--porcelain'], {
|
|
@@ -50,6 +64,37 @@ export function staleHolder(stderr) {
|
|
|
50
64
|
const path = m?.[1];
|
|
51
65
|
return path && isRunnerWorktree(path) ? path : null;
|
|
52
66
|
}
|
|
67
|
+
export function branchHolderOf(runnerDir, worktree) {
|
|
68
|
+
const path = canonicalPath(worktree);
|
|
69
|
+
for (const r of listHeld(runnerDir)) {
|
|
70
|
+
if (!isAlive(r.pid))
|
|
71
|
+
continue;
|
|
72
|
+
const mine = [r.worktree, ...(r.scratch ?? [])].some((p) => p && canonicalPath(p) === path);
|
|
73
|
+
if (mine)
|
|
74
|
+
return { kind: 'live', runId: r.runId };
|
|
75
|
+
}
|
|
76
|
+
for (const k of listKept(runnerDir)) {
|
|
77
|
+
if (canonicalPath(k.worktree) === path) {
|
|
78
|
+
return { kind: 'kept', runId: k.runId, parked: !!k.park };
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
export function branchHeldSentence(branch, holder) {
|
|
84
|
+
return `git worktree add failed: ${heldWords(branch, holder)}`;
|
|
85
|
+
}
|
|
86
|
+
function heldWords(branch, holder) {
|
|
87
|
+
const which = holder.runId ? ` (run ${holder.runId.slice(0, 8)})` : '';
|
|
88
|
+
if (holder.kind === 'live') {
|
|
89
|
+
return (`another run on this machine${which} is still working on ${branch}, so this attempt could not start beside it. Nothing was changed. ` +
|
|
90
|
+
'Fix: wait for that run to finish, or stop it on its task page, then Re-run this task.');
|
|
91
|
+
}
|
|
92
|
+
return holder.parked
|
|
93
|
+
? `${branch} is held on this machine by a run waiting for a person's answer${which}, so this attempt could not start. Nothing was changed. ` +
|
|
94
|
+
'Fix: answer or stop that run on its task page, then Re-run this task.'
|
|
95
|
+
: `${branch} is held on this machine by a change kept for a person's approval${which}, so this attempt could not start. Nothing was changed. ` +
|
|
96
|
+
'Fix: approve, reject or ask for changes on that task, then Re-run this task.';
|
|
97
|
+
}
|
|
53
98
|
export async function removeRunnerWorktree(checkout, path, log) {
|
|
54
99
|
const copies = reviewCopiesOf(path);
|
|
55
100
|
await killOrphans({ roots: [path, ...copies], reviewCopiesOf: basename(path) }, { log }).catch(() => { });
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firefunc-agent/runner",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.34",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
|
-
"description": "FireFunc self-hosted runner — an always-on daemon that runs YOUR local coding agent (Claude Code, Codex, Gemini CLI, Cursor CLI) on work FireFunc routes to it, opens pull requests, and reports back. Your machine, your subscriptions.",
|
|
6
|
+
"description": "FireFunc self-hosted runner — an always-on daemon that runs YOUR local coding agent (Claude Code, Codex, Gemini CLI, Cursor CLI, Copilot CLI, Antigravity) on work FireFunc routes to it, opens pull requests, and reports back. Your machine, your subscriptions.",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"firefunc",
|
|
9
9
|
"runner",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
],
|
|
18
18
|
"license": "SEE LICENSE IN LICENSE",
|
|
19
19
|
"bin": {
|
|
20
|
-
"firefunc-runner": "
|
|
21
|
-
"firefunc": "
|
|
20
|
+
"firefunc-runner": "dist/cli.js",
|
|
21
|
+
"firefunc": "dist/firefunc/cli.js"
|
|
22
22
|
},
|
|
23
23
|
"files": [
|
|
24
24
|
"dist",
|
package/skill/firefunc/SKILL.md
CHANGED
|
@@ -23,9 +23,10 @@ with a composer link; the person opens it, reviews the agent and activates it.
|
|
|
23
23
|
in 0.9.1; if npm still installs an older one, those are not on npm yet.
|
|
24
24
|
Tell the person that, rather than retrying.
|
|
25
25
|
2. Check the sign-in: `firefunc whoami --json`.
|
|
26
|
-
- `not_signed_in`: ask the person to
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
- `not_signed_in`: ask the person to run `firefunc login` **in their own
|
|
27
|
+
terminal**. It opens FireFunc in their browser, where they pick the workspace
|
|
28
|
+
and press Allow (runner 0.9.26; on an older one it asks for a workspace key
|
|
29
|
+
from Settings → API keys, without showing it).
|
|
29
30
|
3. Read the `scopes` in that answer. `agents:read` lets you look,
|
|
30
31
|
`agents:write` lets you create and edit drafts, `tasks:write` starts tasks,
|
|
31
32
|
`tasks:read` reads them, `agents:activate` lets the key activate an agent,
|