@bybrawe/opencode-loop 0.5.38 → 0.6.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/CHANGELOG.md +10 -0
- package/README.md +30 -0
- package/examples/OPENCODE2-0.6.0.md +54 -0
- package/package.json +12 -9
- package/scripts/branch-hygiene.mjs +326 -0
- package/scripts/comprehensive-test.mjs +12 -6
- package/scripts/control-plane-until-test.mjs +39 -0
- package/scripts/goal-compaction-safety-test.mjs +68 -0
- package/scripts/goal-companion-test.mjs +1 -1
- package/scripts/host-adapter-contract-test.mjs +1 -0
- package/scripts/install-node.mjs +105 -60
- package/scripts/install-test.mjs +3 -3
- package/scripts/install-with-goals.mjs +17 -4
- package/scripts/job-workspace-test.mjs +11 -1
- package/scripts/loopd-test.mjs +74 -4
- package/scripts/loopd.mjs +153 -25
- package/scripts/native-cli-host-canary.mjs +118 -0
- package/scripts/native-cli-io-test.mjs +66 -0
- package/scripts/native-cli-test.mjs +130 -0
- package/scripts/native-coexistence-test.mjs +38 -0
- package/scripts/native-entry-test.mjs +77 -0
- package/scripts/native-guide-test.mjs +45 -0
- package/scripts/native-install-pair-test.mjs +73 -0
- package/scripts/native-install-test.mjs +107 -0
- package/scripts/native-lifecycle-test.mjs +100 -0
- package/scripts/native-plugin-lifetime-test.mjs +92 -0
- package/scripts/native-presets-test.mjs +227 -0
- package/scripts/native-process-tree-fixture.mjs +72 -0
- package/scripts/native-process-tree-test.mjs +40 -0
- package/scripts/native-release.mjs +121 -0
- package/scripts/native-session-location-test.mjs +86 -0
- package/scripts/native-shell-test.mjs +38 -0
- package/scripts/native-v2-test.mjs +262 -0
- package/scripts/opencode-host.mjs +47 -0
- package/scripts/opencode2-loop-canary.mjs +72 -4
- package/scripts/package-native-smoke.mjs +31 -0
- package/scripts/publish-workflow-test.mjs +60 -19
- package/scripts/pulse-check.mjs +246 -0
- package/scripts/session-status-test.mjs +12 -0
- package/src/index.js +87 -48
- package/src/native.js +3135 -0
- package/src/server.js +2164 -4560
- package/src/source/core/jobs.js +17 -0
- package/src/source/core/process.js +6 -4
- package/src/source/core/progress.js +58 -0
- package/src/source/legacy-v1.js +9 -3
- package/src/source/native.js +1 -0
- package/src/source/opencode/host.js +1 -0
- package/src/source/opencode/loop-commands.js +1 -27
- package/src/source/opencode/loop-registration.js +2 -12
- package/src/source/opencode/messages.js +1 -1
- package/src/source/opencode2/commands.js +9 -4
- package/src/source/opencode2/event-bridge.js +15 -3
- package/src/source/opencode2/events.js +20 -0
- package/src/source/opencode2/experimental.js +2 -0
- package/src/source/opencode2/native-companion.js +24 -0
- package/src/source/opencode2/native-plugin.js +153 -0
- package/src/source/opencode2/native-policy.js +106 -0
- package/src/source/opencode2/native-runtime.js +464 -0
- package/src/source/opencode2/native-shell.js +81 -0
- package/src/source/opencode2/prompt-runtime.js +2 -0
- package/src/source/opencode2/session-location.js +16 -0
- package/src/source/runtime/goal-steering.js +17 -3
- package/src/source/runtime/job-workspace.js +11 -2
- package/src/source/runtime/session-status.js +11 -1
- package/src/source/server.js +9 -1
- package/src/v1.js +1 -0
|
@@ -113,7 +113,17 @@ export function createSessionStatusRuntime(options = {}) {
|
|
|
113
113
|
|
|
114
114
|
async function canFinalizeActiveRun(directory, client, sessionID, active, options = {}) {
|
|
115
115
|
if (hasActiveToolCalls(sessionID) || hasBusyDescendant(sessionID)) return false
|
|
116
|
-
|
|
116
|
+
|
|
117
|
+
// OpenCode 1.x can emit transient session.idle boundaries between tool
|
|
118
|
+
// steps while the same assistant turn is still in progress. When the
|
|
119
|
+
// message API can prove that the current assistant message is incomplete,
|
|
120
|
+
// keep the Loop-owned run active instead of treating that transient idle
|
|
121
|
+
// as a completed turn. Preserve the historical fallback when message
|
|
122
|
+
// completion evidence is unavailable.
|
|
123
|
+
if (!options.requireIdle && !options.forceStale) {
|
|
124
|
+
const completion = await activeRunCompletionFromMessages(directory, client, sessionID, active)
|
|
125
|
+
return completion !== "incomplete"
|
|
126
|
+
}
|
|
117
127
|
|
|
118
128
|
const completion = options.forceStale
|
|
119
129
|
? await activeRunCompletionFromMessages(directory, client, sessionID, active)
|
package/src/source/server.js
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import OpenCodeLoopPlugin from "./v1.js"
|
|
2
1
|
import OpenCodeLoopV2ExperimentalPlugin from "./opencode2/experimental.js"
|
|
3
2
|
|
|
3
|
+
// Load the legacy runtime only when a V1 host invokes its server contract.
|
|
4
|
+
// A runtime URL prevents bundlers from inlining the legacy implementation.
|
|
5
|
+
// Both source and package entries have a sibling v1.js; the package shim
|
|
6
|
+
// delegates to the standalone V1 bundle, without initializing it on V2.
|
|
7
|
+
async function OpenCodeLoopPlugin(...args) {
|
|
8
|
+
const { default: legacy } = await import(new URL("./v1.js", import.meta.url).href)
|
|
9
|
+
return legacy(...args)
|
|
10
|
+
}
|
|
11
|
+
|
|
4
12
|
export const OPENCODE_LOOP_PLUGIN_ID = "@bybrawe/opencode-loop"
|
|
5
13
|
|
|
6
14
|
export const OpenCodeLoopPluginModule = Object.freeze({
|
package/src/v1.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./index.js"
|