eve-hub 0.6.29 → 0.6.31
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/CHANGELOG.md +12 -0
- package/host-sandbox.js +21 -3
- package/package.json +1 -1
- package/world.mjs +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# eve-hub
|
|
2
2
|
|
|
3
|
+
## 0.6.31
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- A bot's sandbox reads its session's git worktree from the file in HUB_SESSION_WORKTREE_DIR when it is set (a bot run by the Mac runner).
|
|
8
|
+
|
|
9
|
+
## 0.6.30
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- A schedule's session-limit request is approved by the hub itself, once per turn (a second hit in the same turn stops the run), so a schedule never waits on an Approve card nobody reads. A request the hub can't answer is shown like any other.
|
|
14
|
+
|
|
3
15
|
## 0.6.29
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/host-sandbox.js
CHANGED
|
@@ -28,16 +28,16 @@ export function hostEnvironment(options) {
|
|
|
28
28
|
return { root };
|
|
29
29
|
},
|
|
30
30
|
async start(ctx, _open, artifact) {
|
|
31
|
-
const worktree = await sessionWorktree(ctx.session.id);
|
|
32
31
|
const rootSessionId = ctx.session.parent?.rootSessionId;
|
|
32
|
+
const worktree = await sessionWorktree(ctx.session.id, rootSessionId);
|
|
33
33
|
const state = { ...(worktree ? { root: worktree.path, worktree } : { root: artifact.root }), version: 1, ...(rootSessionId ? { rootSessionId } : {}) };
|
|
34
34
|
return { handle: hostHandle(state, ctx.session.id), state };
|
|
35
35
|
},
|
|
36
36
|
async resume(ctx, _artifact, state) {
|
|
37
37
|
// Asked again: the registry restores a worktree whose directory went
|
|
38
38
|
// missing. A session that started on the shared checkout stays there.
|
|
39
|
-
const worktree = state.worktree ? ((await sessionWorktree(ctx.session.id)) ?? state.worktree) : undefined;
|
|
40
39
|
const rootSessionId = state.rootSessionId ?? ctx.session.parent?.rootSessionId;
|
|
40
|
+
const worktree = state.worktree ? ((await sessionWorktree(ctx.session.id, rootSessionId)) ?? state.worktree) : undefined;
|
|
41
41
|
const next = { ...(worktree ? { ...state, root: worktree.path, worktree } : state), ...(rootSessionId ? { rootSessionId } : {}) };
|
|
42
42
|
if (!worktree)
|
|
43
43
|
await mkdir(next.root, { recursive: true }); // never fake a missing worktree with an empty dir
|
|
@@ -59,7 +59,25 @@ export const HostSandbox = defineSandboxProvider({
|
|
|
59
59
|
// checkout stays there. Any other failure: the shared checkout.
|
|
60
60
|
class WorkspaceUnavailable extends Error {
|
|
61
61
|
}
|
|
62
|
-
|
|
62
|
+
// HUB_SESSION_WORKTREE_DIR (the Mac runner sets it): the runner writes
|
|
63
|
+
// <dir>/<sessionId>.json before it delivers to the session, so there is nothing
|
|
64
|
+
// to ask or wait for. An `agent` copy has no file of its own and uses its root session's.
|
|
65
|
+
async function sessionWorktree(sessionId, rootSessionId) {
|
|
66
|
+
const dir = process.env.HUB_SESSION_WORKTREE_DIR;
|
|
67
|
+
if (dir) {
|
|
68
|
+
for (const id of [sessionId, rootSessionId]) {
|
|
69
|
+
if (!id)
|
|
70
|
+
continue;
|
|
71
|
+
try {
|
|
72
|
+
return JSON.parse(await readFile(join(dir, `${id}.json`), "utf8"));
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
if (error.code !== "ENOENT")
|
|
76
|
+
throw error;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return undefined;
|
|
80
|
+
}
|
|
63
81
|
if (process.env.HUB_SESSION_WORKTREES !== "1")
|
|
64
82
|
return undefined;
|
|
65
83
|
const deadline = Date.now() + 15_000;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eve-hub",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.31",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Bot-side code shared by every hub agent: registry tools, the roster hook, the eve channel, the host sandbox and browser, and model helpers.",
|
|
6
6
|
"type": "module",
|
package/world.mjs
CHANGED
|
@@ -503,6 +503,9 @@ var DEFAULT_SUBAGENT_CAP = Object.freeze({
|
|
|
503
503
|
models: Object.freeze(["anthropic/claude-fable-5.1"])
|
|
504
504
|
});
|
|
505
505
|
|
|
506
|
+
// ../../hosted-hub/src/store/roster.ts
|
|
507
|
+
var onLocal = (bot) => `EXISTS (SELECT 1 FROM bots WHERE name = ${bot} AND runs_on = 'local')`;
|
|
508
|
+
|
|
506
509
|
// ../../hosted-hub/src/store/schema.ts
|
|
507
510
|
var OPEN_TURN_STATUSES = "('streaming','cancelling')";
|
|
508
511
|
|
|
@@ -584,10 +587,11 @@ var APP_READS = [
|
|
|
584
587
|
];
|
|
585
588
|
|
|
586
589
|
// ../../hosted-hub/src/store/requests.ts
|
|
590
|
+
var SCHEDULE_LIMIT = `r.kind = 'session-limit' AND r.thread_id LIKE 'sch-%' AND NOT ${onLocal("r.bot")} AND r.sweep_gave_up_at IS NULL`;
|
|
587
591
|
var PENDING_REQUESTS_READ = s(`SELECT r.id, r.session_id, r.thread_id, r.bot, r.kind, r.prompt, r.options, r.allow_freeform, r.tool_name, r.submitted_at, r.created_at,
|
|
588
592
|
(SELECT d.message_id FROM turn_deliveries td JOIN deliveries d ON d.id = td.delivery_id WHERE td.turn_id = r.turn_id ORDER BY d.rowid DESC LIMIT 1) AS message_id
|
|
589
593
|
FROM input_requests r JOIN sessions s ON s.id = r.session_id
|
|
590
|
-
WHERE r.status = 'pending' AND s.ended_at IS NULL ORDER BY r.created_at`);
|
|
594
|
+
WHERE r.status = 'pending' AND s.ended_at IS NULL AND NOT (${SCHEDULE_LIMIT}) ORDER BY r.created_at`);
|
|
591
595
|
|
|
592
596
|
// ../../hosted-hub/src/store/workspace-state.ts
|
|
593
597
|
var LIVE_TURNS_READ = s(`SELECT thread_id,bot,started_at,reply_text,activity FROM turns WHERE status IN ${OPEN_TURN_STATUSES} ORDER BY started_at`);
|