@sorenllm/opencode-forge 0.9.0 → 0.9.1

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.
Files changed (2) hide show
  1. package/dist/index.js +17 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -13419,6 +13419,9 @@ function createJobManager(opts = {}) {
13419
13419
  if (job.notify && job.wakeState === "none" && !job.terminalEvidence) {
13420
13420
  job.wakeState = "queued";
13421
13421
  job.wakeQueuedAt = now();
13422
+ try {
13423
+ opts.onWakeQueued?.(job);
13424
+ } catch {}
13422
13425
  }
13423
13426
  if (job.terminalEvidence) {
13424
13427
  jobs.delete(job.id);
@@ -15603,8 +15606,15 @@ function jobLedgerSink(entry) {
15603
15606
  `);
15604
15607
  } catch {}
15605
15608
  }
15606
- var jobManager = createJobManager({ sink: jobLedgerSink });
15609
+ var jobManager = createJobManager({
15610
+ sink: jobLedgerSink,
15611
+ onWakeQueued: (job) => {
15612
+ if (idleJobSessions.has(job.ownerSession))
15613
+ deliverJobWakes(job.ownerSession);
15614
+ }
15615
+ });
15607
15616
  var jobClient = null;
15617
+ var idleJobSessions = new Set;
15608
15618
  function jobWakeText(job) {
15609
15619
  return [
15610
15620
  `[forge:job-complete] Background job ${job.id} finished (${job.state}${job.exitCode !== null ? `, exit ${job.exitCode}` : ""}).`,
@@ -16946,8 +16956,11 @@ var server = async (input, options) => {
16946
16956
  if (forgeDisabled)
16947
16957
  return;
16948
16958
  const raw = input2;
16949
- if (typeof raw.sessionID === "string" && raw.sessionID && typeof raw.agent === "string" && raw.agent) {
16950
- sessionAgents.set(raw.sessionID, raw.agent);
16959
+ if (typeof raw.sessionID === "string" && raw.sessionID) {
16960
+ idleJobSessions.delete(raw.sessionID);
16961
+ if (typeof raw.agent === "string" && raw.agent) {
16962
+ sessionAgents.set(raw.sessionID, raw.agent);
16963
+ }
16951
16964
  }
16952
16965
  },
16953
16966
  "chat.params": async (input2, output) => {
@@ -17033,6 +17046,7 @@ var server = async (input, options) => {
17033
17046
  const sessionID = event.properties.sessionID;
17034
17047
  if (typeof sessionID === "string" && sessionID) {
17035
17048
  goalProbe(`idle event session=${sessionID}`);
17049
+ idleJobSessions.add(sessionID);
17036
17050
  scheduleIdleContinuation(client, sessionID);
17037
17051
  deliverJobWakes(sessionID);
17038
17052
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sorenllm/opencode-forge",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "Single general-purpose forge agent for opencode: static worker subagents defined in forge.json (pinned model + thoughtLevel pair, or an Auto worker inheriting the parent model; dispatched through the native task tool — TUI-visible), a plan harness (file-backed plans with approve/close confirmation gates and a hard draft write-ban), a goal harness (autonomous, host-verified objectives), a /crew orchestration command (declared-plan waves with an evidence-checked close gate), a job supervisor (forge_shell with exit-bound completion, idle/success early return, background jobs with poll/log/kill/handoff), and a builtin-shell hang watchdog.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",