oh-my-opencode 3.1.7 → 3.1.8
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/dist/cli/index.js
CHANGED
|
@@ -8089,7 +8089,7 @@ var import_picocolors2 = __toESM(require_picocolors(), 1);
|
|
|
8089
8089
|
// package.json
|
|
8090
8090
|
var package_default = {
|
|
8091
8091
|
name: "oh-my-opencode",
|
|
8092
|
-
version: "3.1.
|
|
8092
|
+
version: "3.1.8",
|
|
8093
8093
|
description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
8094
8094
|
main: "dist/index.js",
|
|
8095
8095
|
types: "dist/index.d.ts",
|
|
@@ -8163,13 +8163,13 @@ var package_default = {
|
|
|
8163
8163
|
typescript: "^5.7.3"
|
|
8164
8164
|
},
|
|
8165
8165
|
optionalDependencies: {
|
|
8166
|
-
"oh-my-opencode-darwin-arm64": "3.1.
|
|
8167
|
-
"oh-my-opencode-darwin-x64": "3.1.
|
|
8168
|
-
"oh-my-opencode-linux-arm64": "3.1.
|
|
8169
|
-
"oh-my-opencode-linux-arm64-musl": "3.1.
|
|
8170
|
-
"oh-my-opencode-linux-x64": "3.1.
|
|
8171
|
-
"oh-my-opencode-linux-x64-musl": "3.1.
|
|
8172
|
-
"oh-my-opencode-windows-x64": "3.1.
|
|
8166
|
+
"oh-my-opencode-darwin-arm64": "3.1.8",
|
|
8167
|
+
"oh-my-opencode-darwin-x64": "3.1.8",
|
|
8168
|
+
"oh-my-opencode-linux-arm64": "3.1.8",
|
|
8169
|
+
"oh-my-opencode-linux-arm64-musl": "3.1.8",
|
|
8170
|
+
"oh-my-opencode-linux-x64": "3.1.8",
|
|
8171
|
+
"oh-my-opencode-linux-x64-musl": "3.1.8",
|
|
8172
|
+
"oh-my-opencode-windows-x64": "3.1.8"
|
|
8173
8173
|
},
|
|
8174
8174
|
trustedDependencies: [
|
|
8175
8175
|
"@ast-grep/cli",
|
|
@@ -10141,7 +10141,8 @@ function createEventState() {
|
|
|
10141
10141
|
lastError: null,
|
|
10142
10142
|
lastOutput: "",
|
|
10143
10143
|
lastPartText: "",
|
|
10144
|
-
currentTool: null
|
|
10144
|
+
currentTool: null,
|
|
10145
|
+
hasReceivedMeaningfulWork: false
|
|
10145
10146
|
};
|
|
10146
10147
|
}
|
|
10147
10148
|
async function processEvents(ctx, stream, state) {
|
|
@@ -10172,7 +10173,7 @@ function logEventVerbose(ctx, payload) {
|
|
|
10172
10173
|
const info = props?.info;
|
|
10173
10174
|
const sessionID = props?.sessionID ?? info?.sessionID;
|
|
10174
10175
|
const isMainSession = sessionID === ctx.sessionID;
|
|
10175
|
-
const sessionTag = isMainSession ? import_picocolors4.default.green("[MAIN]") : import_picocolors4.default.yellow(`[${String(sessionID).slice(0, 8)}]`);
|
|
10176
|
+
const sessionTag = isMainSession ? import_picocolors4.default.green("[MAIN]") : sessionID ? import_picocolors4.default.yellow(`[${String(sessionID).slice(0, 8)}]`) : import_picocolors4.default.dim("[system]");
|
|
10176
10177
|
switch (payload.type) {
|
|
10177
10178
|
case "session.idle":
|
|
10178
10179
|
case "session.status": {
|
|
@@ -10186,15 +10187,19 @@ function logEventVerbose(ctx, payload) {
|
|
|
10186
10187
|
if (part?.type === "tool-invocation") {
|
|
10187
10188
|
const toolPart = part;
|
|
10188
10189
|
console.error(import_picocolors4.default.dim(`${sessionTag} message.part (tool): ${toolPart.toolName} [${toolPart.state}]`));
|
|
10190
|
+
} else if (part?.type === "text" && part.text) {
|
|
10191
|
+
const preview = part.text.slice(0, 80).replace(/\n/g, "\\n");
|
|
10192
|
+
console.error(import_picocolors4.default.dim(`${sessionTag} message.part (text): "${preview}${part.text.length > 80 ? "..." : ""}"`));
|
|
10189
10193
|
}
|
|
10190
10194
|
break;
|
|
10191
10195
|
}
|
|
10192
10196
|
case "message.updated": {
|
|
10193
10197
|
const msgProps = props;
|
|
10194
10198
|
const role = msgProps?.info?.role ?? "unknown";
|
|
10195
|
-
const
|
|
10196
|
-
const
|
|
10197
|
-
|
|
10199
|
+
const model = msgProps?.info?.modelID;
|
|
10200
|
+
const agent = msgProps?.info?.agent;
|
|
10201
|
+
const details = [role, agent, model].filter(Boolean).join(", ");
|
|
10202
|
+
console.error(import_picocolors4.default.dim(`${sessionTag} message.updated (${details})`));
|
|
10198
10203
|
break;
|
|
10199
10204
|
}
|
|
10200
10205
|
case "tool.execute": {
|
|
@@ -10265,6 +10270,7 @@ function handleMessagePartUpdated(ctx, payload, state) {
|
|
|
10265
10270
|
const newText = part.text.slice(state.lastPartText.length);
|
|
10266
10271
|
if (newText) {
|
|
10267
10272
|
process.stdout.write(newText);
|
|
10273
|
+
state.hasReceivedMeaningfulWork = true;
|
|
10268
10274
|
}
|
|
10269
10275
|
state.lastPartText = part.text;
|
|
10270
10276
|
}
|
|
@@ -10277,16 +10283,7 @@ function handleMessageUpdated(ctx, payload, state) {
|
|
|
10277
10283
|
return;
|
|
10278
10284
|
if (props?.info?.role !== "assistant")
|
|
10279
10285
|
return;
|
|
10280
|
-
|
|
10281
|
-
if (!content || content === state.lastOutput)
|
|
10282
|
-
return;
|
|
10283
|
-
if (state.lastPartText.length === 0) {
|
|
10284
|
-
const newContent = content.slice(state.lastOutput.length);
|
|
10285
|
-
if (newContent) {
|
|
10286
|
-
process.stdout.write(newContent);
|
|
10287
|
-
}
|
|
10288
|
-
}
|
|
10289
|
-
state.lastOutput = content;
|
|
10286
|
+
state.hasReceivedMeaningfulWork = true;
|
|
10290
10287
|
}
|
|
10291
10288
|
function handleToolExecute(ctx, payload, state) {
|
|
10292
10289
|
if (payload.type !== "tool.execute")
|
|
@@ -10309,6 +10306,7 @@ function handleToolExecute(ctx, payload, state) {
|
|
|
10309
10306
|
inputPreview = ` ${import_picocolors4.default.dim(String(input.query).slice(0, 40))}`;
|
|
10310
10307
|
}
|
|
10311
10308
|
}
|
|
10309
|
+
state.hasReceivedMeaningfulWork = true;
|
|
10312
10310
|
process.stdout.write(`
|
|
10313
10311
|
${import_picocolors4.default.cyan(">")} ${import_picocolors4.default.bold(toolName)}${inputPreview}
|
|
10314
10312
|
`);
|
|
@@ -10445,6 +10443,9 @@ Session ended with error: ${eventState.lastError}`));
|
|
|
10445
10443
|
cleanup();
|
|
10446
10444
|
process.exit(1);
|
|
10447
10445
|
}
|
|
10446
|
+
if (!eventState.hasReceivedMeaningfulWork) {
|
|
10447
|
+
continue;
|
|
10448
|
+
}
|
|
10448
10449
|
const shouldExit = await checkCompletionConditions(ctx);
|
|
10449
10450
|
if (shouldExit) {
|
|
10450
10451
|
console.log(import_picocolors5.default.green(`
|
package/dist/cli/run/events.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export interface EventState {
|
|
|
7
7
|
lastOutput: string;
|
|
8
8
|
lastPartText: string;
|
|
9
9
|
currentTool: string | null;
|
|
10
|
+
/** Set to true when the main session has produced meaningful work (text, tool call, or tool result) */
|
|
11
|
+
hasReceivedMeaningfulWork: boolean;
|
|
10
12
|
}
|
|
11
13
|
export declare function createEventState(): EventState;
|
|
12
14
|
export declare function processEvents(ctx: RunContext, stream: AsyncIterable<unknown>, state: EventState): Promise<void>;
|
package/dist/cli/run/types.d.ts
CHANGED
|
@@ -10,6 +10,10 @@ interface SessionCreatedEvent {
|
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
+
export interface TmuxUtilDeps {
|
|
14
|
+
isInsideTmux: () => boolean;
|
|
15
|
+
getCurrentPaneId: () => string | undefined;
|
|
16
|
+
}
|
|
13
17
|
/**
|
|
14
18
|
* State-first Tmux Session Manager
|
|
15
19
|
*
|
|
@@ -30,7 +34,8 @@ export declare class TmuxSessionManager {
|
|
|
30
34
|
private sessions;
|
|
31
35
|
private pendingSessions;
|
|
32
36
|
private pollInterval?;
|
|
33
|
-
|
|
37
|
+
private deps;
|
|
38
|
+
constructor(ctx: PluginInput, tmuxConfig: TmuxConfig, deps?: TmuxUtilDeps);
|
|
34
39
|
private isEnabled;
|
|
35
40
|
private getCapacityConfig;
|
|
36
41
|
private getSessionMappings;
|
package/dist/index.js
CHANGED
|
@@ -47912,7 +47912,7 @@ To continue this session: session_id="${args.session_id}"`;
|
|
|
47912
47912
|
}
|
|
47913
47913
|
} else {
|
|
47914
47914
|
const resolution = resolveModelWithFallback({
|
|
47915
|
-
userModel: userCategories?.[args.category]?.model ?? sisyphusJuniorModel,
|
|
47915
|
+
userModel: userCategories?.[args.category]?.model ?? resolved.model ?? sisyphusJuniorModel,
|
|
47916
47916
|
fallbackChain: requirement.fallbackChain,
|
|
47917
47917
|
availableModels,
|
|
47918
47918
|
systemDefaultModel
|
|
@@ -54773,6 +54773,10 @@ async function executeActions(actions, ctx) {
|
|
|
54773
54773
|
}
|
|
54774
54774
|
|
|
54775
54775
|
// src/features/tmux-subagent/manager.ts
|
|
54776
|
+
var defaultTmuxDeps = {
|
|
54777
|
+
isInsideTmux,
|
|
54778
|
+
getCurrentPaneId
|
|
54779
|
+
};
|
|
54776
54780
|
var SESSION_TIMEOUT_MS2 = 10 * 60 * 1000;
|
|
54777
54781
|
|
|
54778
54782
|
class TmuxSessionManager {
|
|
@@ -54783,12 +54787,14 @@ class TmuxSessionManager {
|
|
|
54783
54787
|
sessions = new Map;
|
|
54784
54788
|
pendingSessions = new Set;
|
|
54785
54789
|
pollInterval;
|
|
54786
|
-
|
|
54790
|
+
deps;
|
|
54791
|
+
constructor(ctx, tmuxConfig, deps = defaultTmuxDeps) {
|
|
54787
54792
|
this.client = ctx.client;
|
|
54788
54793
|
this.tmuxConfig = tmuxConfig;
|
|
54794
|
+
this.deps = deps;
|
|
54789
54795
|
const defaultPort = process.env.OPENCODE_PORT ?? "4096";
|
|
54790
54796
|
this.serverUrl = ctx.serverUrl?.toString() ?? `http://localhost:${defaultPort}`;
|
|
54791
|
-
this.sourcePaneId = getCurrentPaneId();
|
|
54797
|
+
this.sourcePaneId = deps.getCurrentPaneId();
|
|
54792
54798
|
log("[tmux-session-manager] initialized", {
|
|
54793
54799
|
configEnabled: this.tmuxConfig.enabled,
|
|
54794
54800
|
tmuxConfig: this.tmuxConfig,
|
|
@@ -54797,7 +54803,7 @@ class TmuxSessionManager {
|
|
|
54797
54803
|
});
|
|
54798
54804
|
}
|
|
54799
54805
|
isEnabled() {
|
|
54800
|
-
return this.tmuxConfig.enabled && isInsideTmux();
|
|
54806
|
+
return this.tmuxConfig.enabled && this.deps.isInsideTmux();
|
|
54801
54807
|
}
|
|
54802
54808
|
getCapacityConfig() {
|
|
54803
54809
|
return {
|
|
@@ -54842,7 +54848,7 @@ class TmuxSessionManager {
|
|
|
54842
54848
|
log("[tmux-session-manager] onSessionCreated called", {
|
|
54843
54849
|
enabled,
|
|
54844
54850
|
tmuxConfigEnabled: this.tmuxConfig.enabled,
|
|
54845
|
-
isInsideTmux: isInsideTmux(),
|
|
54851
|
+
isInsideTmux: this.deps.isInsideTmux(),
|
|
54846
54852
|
eventType: event.type,
|
|
54847
54853
|
infoId: event.properties?.info?.id,
|
|
54848
54854
|
infoParentID: event.properties?.info?.parentID
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oh-my-opencode",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.8",
|
|
4
4
|
"description": "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -74,13 +74,13 @@
|
|
|
74
74
|
"typescript": "^5.7.3"
|
|
75
75
|
},
|
|
76
76
|
"optionalDependencies": {
|
|
77
|
-
"oh-my-opencode-darwin-arm64": "3.1.
|
|
78
|
-
"oh-my-opencode-darwin-x64": "3.1.
|
|
79
|
-
"oh-my-opencode-linux-arm64": "3.1.
|
|
80
|
-
"oh-my-opencode-linux-arm64-musl": "3.1.
|
|
81
|
-
"oh-my-opencode-linux-x64": "3.1.
|
|
82
|
-
"oh-my-opencode-linux-x64-musl": "3.1.
|
|
83
|
-
"oh-my-opencode-windows-x64": "3.1.
|
|
77
|
+
"oh-my-opencode-darwin-arm64": "3.1.8",
|
|
78
|
+
"oh-my-opencode-darwin-x64": "3.1.8",
|
|
79
|
+
"oh-my-opencode-linux-arm64": "3.1.8",
|
|
80
|
+
"oh-my-opencode-linux-arm64-musl": "3.1.8",
|
|
81
|
+
"oh-my-opencode-linux-x64": "3.1.8",
|
|
82
|
+
"oh-my-opencode-linux-x64-musl": "3.1.8",
|
|
83
|
+
"oh-my-opencode-windows-x64": "3.1.8"
|
|
84
84
|
},
|
|
85
85
|
"trustedDependencies": [
|
|
86
86
|
"@ast-grep/cli",
|