oh-my-opencode 3.1.4 → 3.1.5
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/agents/metis.d.ts +1 -1
- package/dist/agents/prometheus-prompt.d.ts +1 -1
- package/dist/cli/index.js +24 -22
- package/dist/features/opencode-skill-loader/types.d.ts +1 -1
- package/dist/index.js +521 -234
- package/dist/shared/agent-variant.d.ts +4 -0
- package/dist/shared/ollama-ndjson-parser.d.ts +108 -0
- package/dist/shared/opencode-version.d.ts +8 -0
- package/dist/shared/system-directive.d.ts +14 -0
- package/dist/shared/system-directive.test.d.ts +1 -0
- package/package.json +8 -8
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { OhMyOpenCodeConfig } from "../config";
|
|
2
2
|
export declare function resolveAgentVariant(config: OhMyOpenCodeConfig, agentName?: string): string | undefined;
|
|
3
|
+
export declare function resolveVariantForModel(config: OhMyOpenCodeConfig, agentName: string, currentModel: {
|
|
4
|
+
providerID: string;
|
|
5
|
+
modelID: string;
|
|
6
|
+
}): string | undefined;
|
|
3
7
|
export declare function applyAgentVariant(config: OhMyOpenCodeConfig, agentName: string | undefined, message: {
|
|
4
8
|
variant?: string;
|
|
5
9
|
}): void;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ollama NDJSON Parser
|
|
3
|
+
*
|
|
4
|
+
* Parses newline-delimited JSON (NDJSON) responses from Ollama API.
|
|
5
|
+
*
|
|
6
|
+
* @module ollama-ndjson-parser
|
|
7
|
+
* @see https://github.com/code-yeongyu/oh-my-opencode/issues/1124
|
|
8
|
+
* @see https://github.com/ollama/ollama/blob/main/docs/api.md
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Ollama message structure
|
|
12
|
+
*/
|
|
13
|
+
export interface OllamaMessage {
|
|
14
|
+
tool_calls?: Array<{
|
|
15
|
+
function: {
|
|
16
|
+
name: string;
|
|
17
|
+
arguments: Record<string, unknown>;
|
|
18
|
+
};
|
|
19
|
+
}>;
|
|
20
|
+
content?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Ollama NDJSON line structure
|
|
24
|
+
*/
|
|
25
|
+
export interface OllamaNDJSONLine {
|
|
26
|
+
message?: OllamaMessage;
|
|
27
|
+
done: boolean;
|
|
28
|
+
total_duration?: number;
|
|
29
|
+
load_duration?: number;
|
|
30
|
+
prompt_eval_count?: number;
|
|
31
|
+
prompt_eval_duration?: number;
|
|
32
|
+
eval_count?: number;
|
|
33
|
+
eval_duration?: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Merged Ollama response
|
|
37
|
+
*/
|
|
38
|
+
export interface OllamaMergedResponse {
|
|
39
|
+
message: OllamaMessage;
|
|
40
|
+
done: boolean;
|
|
41
|
+
stats?: {
|
|
42
|
+
total_duration?: number;
|
|
43
|
+
load_duration?: number;
|
|
44
|
+
prompt_eval_count?: number;
|
|
45
|
+
prompt_eval_duration?: number;
|
|
46
|
+
eval_count?: number;
|
|
47
|
+
eval_duration?: number;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Parse Ollama streaming NDJSON response into a single merged object.
|
|
52
|
+
*
|
|
53
|
+
* Ollama returns streaming responses as newline-delimited JSON (NDJSON):
|
|
54
|
+
* ```
|
|
55
|
+
* {"message":{"tool_calls":[...]}, "done":false}
|
|
56
|
+
* {"message":{"content":""}, "done":true}
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* This function:
|
|
60
|
+
* 1. Splits the response by newlines
|
|
61
|
+
* 2. Parses each line as JSON
|
|
62
|
+
* 3. Merges tool_calls and content from all lines
|
|
63
|
+
* 4. Returns a single merged response
|
|
64
|
+
*
|
|
65
|
+
* @param response - Raw NDJSON response string from Ollama API
|
|
66
|
+
* @returns Merged response with all tool_calls and content combined
|
|
67
|
+
* @throws {Error} If no valid JSON lines are found
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```typescript
|
|
71
|
+
* const ndjsonResponse = `
|
|
72
|
+
* {"message":{"tool_calls":[{"function":{"name":"read","arguments":{"filePath":"README.md"}}}]}, "done":false}
|
|
73
|
+
* {"message":{"content":""}, "done":true}
|
|
74
|
+
* `;
|
|
75
|
+
*
|
|
76
|
+
* const merged = parseOllamaStreamResponse(ndjsonResponse);
|
|
77
|
+
* // Result:
|
|
78
|
+
* // {
|
|
79
|
+
* // message: {
|
|
80
|
+
* // tool_calls: [{ function: { name: "read", arguments: { filePath: "README.md" } } }],
|
|
81
|
+
* // content: ""
|
|
82
|
+
* // },
|
|
83
|
+
* // done: true
|
|
84
|
+
* // }
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
export declare function parseOllamaStreamResponse(response: string): OllamaMergedResponse;
|
|
88
|
+
/**
|
|
89
|
+
* Check if a response string is NDJSON format.
|
|
90
|
+
*
|
|
91
|
+
* NDJSON is identified by:
|
|
92
|
+
* - Multiple lines
|
|
93
|
+
* - Each line is valid JSON
|
|
94
|
+
* - At least one line has "done" field
|
|
95
|
+
*
|
|
96
|
+
* @param response - Response string to check
|
|
97
|
+
* @returns true if response appears to be NDJSON
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```typescript
|
|
101
|
+
* const ndjson = '{"done":false}\n{"done":true}';
|
|
102
|
+
* const singleJson = '{"done":true}';
|
|
103
|
+
*
|
|
104
|
+
* isNDJSONResponse(ndjson); // true
|
|
105
|
+
* isNDJSONResponse(singleJson); // false
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
export declare function isNDJSONResponse(response: string): boolean;
|
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
* This plugin only supports OpenCode 1.1.1+ which uses the permission system.
|
|
4
4
|
*/
|
|
5
5
|
export declare const MINIMUM_OPENCODE_VERSION = "1.1.1";
|
|
6
|
+
/**
|
|
7
|
+
* OpenCode version that introduced native AGENTS.md injection.
|
|
8
|
+
* PR #10678 merged on Jan 26, 2026 - OpenCode now dynamically resolves
|
|
9
|
+
* AGENTS.md files from subdirectories as the agent explores them.
|
|
10
|
+
* When this version is detected, the directory-agents-injector hook
|
|
11
|
+
* is auto-disabled to prevent duplicate AGENTS.md loading.
|
|
12
|
+
*/
|
|
13
|
+
export declare const OPENCODE_NATIVE_AGENTS_INJECTION_VERSION = "1.1.37";
|
|
6
14
|
export declare function parseVersion(version: string): number[];
|
|
7
15
|
export declare function compareVersions(a: string, b: string): -1 | 0 | 1;
|
|
8
16
|
export declare function isVersionGte(a: string, b: string): boolean;
|
|
@@ -18,6 +18,20 @@ export declare function createSystemDirective(type: string): string;
|
|
|
18
18
|
* @returns true if the message is a system directive
|
|
19
19
|
*/
|
|
20
20
|
export declare function isSystemDirective(text: string): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Checks if a message contains system-generated content that should be excluded
|
|
23
|
+
* from keyword detection and mode triggering.
|
|
24
|
+
* @param text - The message text to check
|
|
25
|
+
* @returns true if the message contains system-reminder tags
|
|
26
|
+
*/
|
|
27
|
+
export declare function hasSystemReminder(text: string): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Removes system-reminder tag content from text.
|
|
30
|
+
* This prevents automated system messages from triggering mode keywords.
|
|
31
|
+
* @param text - The message text to clean
|
|
32
|
+
* @returns text with system-reminder content removed
|
|
33
|
+
*/
|
|
34
|
+
export declare function removeSystemReminders(text: string): string;
|
|
21
35
|
export declare const SystemDirectiveTypes: {
|
|
22
36
|
readonly TODO_CONTINUATION: "TODO CONTINUATION";
|
|
23
37
|
readonly RALPH_LOOP: "RALPH LOOP";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oh-my-opencode",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.5",
|
|
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",
|
|
@@ -73,13 +73,13 @@
|
|
|
73
73
|
"typescript": "^5.7.3"
|
|
74
74
|
},
|
|
75
75
|
"optionalDependencies": {
|
|
76
|
-
"oh-my-opencode-darwin-arm64": "3.1.
|
|
77
|
-
"oh-my-opencode-darwin-x64": "3.1.
|
|
78
|
-
"oh-my-opencode-linux-arm64": "3.1.
|
|
79
|
-
"oh-my-opencode-linux-arm64-musl": "3.1.
|
|
80
|
-
"oh-my-opencode-linux-x64": "3.1.
|
|
81
|
-
"oh-my-opencode-linux-x64-musl": "3.1.
|
|
82
|
-
"oh-my-opencode-windows-x64": "3.1.
|
|
76
|
+
"oh-my-opencode-darwin-arm64": "3.1.5",
|
|
77
|
+
"oh-my-opencode-darwin-x64": "3.1.5",
|
|
78
|
+
"oh-my-opencode-linux-arm64": "3.1.5",
|
|
79
|
+
"oh-my-opencode-linux-arm64-musl": "3.1.5",
|
|
80
|
+
"oh-my-opencode-linux-x64": "3.1.5",
|
|
81
|
+
"oh-my-opencode-linux-x64-musl": "3.1.5",
|
|
82
|
+
"oh-my-opencode-windows-x64": "3.1.5"
|
|
83
83
|
},
|
|
84
84
|
"trustedDependencies": [
|
|
85
85
|
"@ast-grep/cli",
|