@the-open-engine/zeroshot 6.17.0 → 6.19.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/cli/index.js +11 -14
- package/lib/agent-cli-provider/adapters/claude.d.ts +2 -2
- package/lib/agent-cli-provider/adapters/claude.d.ts.map +1 -1
- package/lib/agent-cli-provider/adapters/claude.js +30 -0
- package/lib/agent-cli-provider/adapters/claude.js.map +1 -1
- package/lib/agent-cli-provider/adapters/codex.d.ts +2 -2
- package/lib/agent-cli-provider/adapters/codex.d.ts.map +1 -1
- package/lib/agent-cli-provider/adapters/codex.js +37 -0
- package/lib/agent-cli-provider/adapters/codex.js.map +1 -1
- package/lib/agent-cli-provider/adapters/gemini.d.ts +2 -2
- package/lib/agent-cli-provider/adapters/gemini.d.ts.map +1 -1
- package/lib/agent-cli-provider/adapters/gemini.js +115 -4
- package/lib/agent-cli-provider/adapters/gemini.js.map +1 -1
- package/lib/agent-cli-provider/adapters/opencode.d.ts +2 -2
- package/lib/agent-cli-provider/adapters/opencode.d.ts.map +1 -1
- package/lib/agent-cli-provider/adapters/opencode.js +108 -0
- package/lib/agent-cli-provider/adapters/opencode.js.map +1 -1
- package/lib/agent-cli-provider/contract-options.d.ts.map +1 -1
- package/lib/agent-cli-provider/contract-options.js +12 -0
- package/lib/agent-cli-provider/contract-options.js.map +1 -1
- package/lib/agent-cli-provider/index.d.ts +2 -2
- package/lib/agent-cli-provider/index.d.ts.map +1 -1
- package/lib/agent-cli-provider/index.js +2 -1
- package/lib/agent-cli-provider/index.js.map +1 -1
- package/lib/agent-cli-provider/omp-release.d.ts +15 -0
- package/lib/agent-cli-provider/omp-release.d.ts.map +1 -0
- package/lib/agent-cli-provider/omp-release.js +50 -0
- package/lib/agent-cli-provider/omp-release.js.map +1 -0
- package/lib/agent-cli-provider/omp-rpc-protocol.d.ts +38 -0
- package/lib/agent-cli-provider/omp-rpc-protocol.d.ts.map +1 -0
- package/lib/agent-cli-provider/omp-rpc-protocol.js +267 -0
- package/lib/agent-cli-provider/omp-rpc-protocol.js.map +1 -0
- package/lib/agent-cli-provider/provider-registry.d.ts +35 -8
- package/lib/agent-cli-provider/provider-registry.d.ts.map +1 -1
- package/lib/agent-cli-provider/provider-registry.js +29 -1
- package/lib/agent-cli-provider/provider-registry.js.map +1 -1
- package/lib/agent-cli-provider/single-agent-runtime.d.ts.map +1 -1
- package/lib/agent-cli-provider/single-agent-runtime.js +36 -5
- package/lib/agent-cli-provider/single-agent-runtime.js.map +1 -1
- package/lib/agent-cli-provider/types.d.ts +30 -3
- package/lib/agent-cli-provider/types.d.ts.map +1 -1
- package/lib/agent-cli-provider/types.js.map +1 -1
- package/lib/cluster/errors.cjs +4 -1
- package/lib/cluster/errors.d.ts +2 -0
- package/lib/cluster/errors.mjs +2 -0
- package/lib/cluster/index.cjs +8 -1
- package/lib/cluster/index.d.ts +4 -1
- package/lib/cluster/index.mjs +4 -1
- package/lib/cluster/json-source.cjs +61 -0
- package/lib/cluster/json-source.d.ts +4 -0
- package/lib/cluster/json-source.mjs +55 -0
- package/lib/cluster/payload-value.cjs +76 -0
- package/lib/cluster/payload-value.d.ts +7 -0
- package/lib/cluster/payload-value.mjs +72 -0
- package/lib/cluster/validators.cjs +21 -0
- package/lib/cluster/validators.d.ts +4 -1
- package/lib/cluster/validators.mjs +19 -1
- package/lib/provider-names.js +10 -0
- package/lib/settings.js +6 -3
- package/lib/setup-plan.js +5 -5
- package/lib/start-cluster.js +3 -3
- package/package.json +2 -2
- package/src/agent/agent-lifecycle.js +4 -4
- package/src/agent/agent-task-executor.js +201 -416
- package/src/agent/output-extraction.js +39 -14
- package/src/agent/output-reformatter.js +154 -111
- package/src/agent/pr-verification.js +4 -1
- package/src/agent-cli-provider/adapters/claude.ts +39 -2
- package/src/agent-cli-provider/adapters/codex.ts +56 -2
- package/src/agent-cli-provider/adapters/gemini.ts +102 -6
- package/src/agent-cli-provider/adapters/opencode.ts +85 -2
- package/src/agent-cli-provider/contract-options.ts +16 -0
- package/src/agent-cli-provider/index.ts +4 -0
- package/src/agent-cli-provider/omp-release.ts +63 -0
- package/src/agent-cli-provider/omp-rpc-protocol.ts +396 -0
- package/src/agent-cli-provider/provider-registry.ts +52 -4
- package/src/agent-cli-provider/single-agent-runtime.ts +52 -5
- package/src/agent-cli-provider/types.ts +36 -2
- package/src/agent-wrapper.js +5 -5
- package/src/claude-task-runner.js +5 -3
- package/src/cluster/errors.ts +1 -0
- package/src/cluster/index.ts +4 -0
- package/src/cluster/json-source.ts +71 -0
- package/src/cluster/payload-value.ts +84 -0
- package/src/cluster/validators.ts +31 -2
- package/src/config-validator.js +3 -2
- package/src/isolation-manager.js +6 -2
- package/src/orchestrator.js +36 -16
- package/src/preflight.js +2 -1
- package/task-lib/attachable-watcher.js +1 -0
- package/task-lib/command-spec-cleanup.js +57 -11
- package/task-lib/commands/run.js +1 -0
- package/task-lib/provider-session-capture.js +8 -0
- package/task-lib/runner.js +9 -6
- package/task-lib/watcher.js +1 -0
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import * as fs from 'node:fs';
|
|
3
|
+
import * as os from 'node:os';
|
|
4
|
+
import * as path from 'node:path';
|
|
5
|
+
|
|
6
|
+
import { UnsupportedProviderCapabilityError } from '../errors';
|
|
1
7
|
import { appendJsonSchemaPrompt } from '../schema';
|
|
2
8
|
import {
|
|
3
9
|
getOrStringFromKeys,
|
|
@@ -16,7 +22,7 @@ import {
|
|
|
16
22
|
type ModelCatalogEntry,
|
|
17
23
|
type ModelLevel,
|
|
18
24
|
type OutputEvent,
|
|
19
|
-
type
|
|
25
|
+
type StructuredOutputRecoveryAdapter,
|
|
20
26
|
type ProviderParserState,
|
|
21
27
|
type ResolvedModelSpec,
|
|
22
28
|
type WarningMetadata,
|
|
@@ -52,6 +58,7 @@ function detectCliFeatures(helpText?: string | null): GeminiCliFeatures {
|
|
|
52
58
|
supportsAutoApprove: unknown ? true : /--yolo\b/.test(help),
|
|
53
59
|
supportsCwd: unknown ? true : /--cwd\b/.test(help),
|
|
54
60
|
supportsModel: unknown ? true : /\s-m\b/.test(help) || /--model\b/.test(help),
|
|
61
|
+
supportsAdminPolicy: !unknown && /--admin-policy\b/.test(help),
|
|
55
62
|
unknown,
|
|
56
63
|
};
|
|
57
64
|
}
|
|
@@ -109,6 +116,75 @@ function buildCommand(context: string, options: BuildProviderCommandOptions = {}
|
|
|
109
116
|
});
|
|
110
117
|
}
|
|
111
118
|
|
|
119
|
+
function standardAdminPolicyDirectory(): string {
|
|
120
|
+
if (process.platform === 'darwin') {
|
|
121
|
+
return '/Library/Application Support/GeminiCli/policies';
|
|
122
|
+
}
|
|
123
|
+
if (process.platform === 'win32') {
|
|
124
|
+
return path.join(process.env.ProgramData || 'C:\\ProgramData', 'gemini-cli', 'policies');
|
|
125
|
+
}
|
|
126
|
+
return '/etc/gemini-cli/policies';
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function assertSupplementalAdminPolicyEffective(): void {
|
|
130
|
+
const directory = standardAdminPolicyDirectory();
|
|
131
|
+
let entries: fs.Dirent[];
|
|
132
|
+
try {
|
|
133
|
+
entries = fs.readdirSync(directory, { withFileTypes: true });
|
|
134
|
+
} catch (error) {
|
|
135
|
+
if (isRecord(error) && error.code === 'ENOENT') return;
|
|
136
|
+
throw new UnsupportedProviderCapabilityError(
|
|
137
|
+
'gemini',
|
|
138
|
+
'structuredOutputRecovery',
|
|
139
|
+
`Gemini structured-output recovery cannot inspect the standard admin-policy directory ${directory}; refuse a supplemental policy that may be ignored.`
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
if (!entries.some((entry) => entry.isFile() && entry.name.endsWith('.toml'))) return;
|
|
143
|
+
throw new UnsupportedProviderCapabilityError(
|
|
144
|
+
'gemini',
|
|
145
|
+
'structuredOutputRecovery',
|
|
146
|
+
`Gemini ignores --admin-policy when ${directory} contains TOML policies. Remove the conflict or use an administrator-managed deny-all policy before retrying.`
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function writeRecoveryAdminPolicy(): string {
|
|
151
|
+
const directory = fs.mkdtempSync(path.join(os.tmpdir(), 'zeroshot-gemini-policy-'));
|
|
152
|
+
const policyPath = path.join(directory, `${randomUUID()}.toml`);
|
|
153
|
+
fs.writeFileSync(policyPath, '[[rule]]\ntoolName = "*"\ndecision = "deny"\npriority = 999\n', {
|
|
154
|
+
flag: 'wx',
|
|
155
|
+
mode: 0o600,
|
|
156
|
+
});
|
|
157
|
+
return policyPath;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function buildStructuredOutputRecoveryCommand(
|
|
161
|
+
context: string,
|
|
162
|
+
options: BuildProviderCommandOptions = {}
|
|
163
|
+
): CommandSpec {
|
|
164
|
+
if (optionFeatures(options).supportsAdminPolicy !== true) {
|
|
165
|
+
throw new UnsupportedProviderCapabilityError(
|
|
166
|
+
'gemini',
|
|
167
|
+
'structuredOutputRecovery',
|
|
168
|
+
'Gemini structured-output recovery requires CLI evidence for --admin-policy. Upgrade @google/gemini-cli before retrying.'
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
assertSupplementalAdminPolicyEffective();
|
|
172
|
+
const recoveryOptions = { ...options };
|
|
173
|
+
delete recoveryOptions.resumeSessionId;
|
|
174
|
+
delete recoveryOptions.continueSession;
|
|
175
|
+
const spec = buildCommand(context, { ...recoveryOptions, autoApprove: false });
|
|
176
|
+
const policyPath = writeRecoveryAdminPolicy();
|
|
177
|
+
return {
|
|
178
|
+
...spec,
|
|
179
|
+
args: ['--admin-policy', policyPath, ...spec.args],
|
|
180
|
+
cleanup: [...(spec.cleanup || []), policyPath],
|
|
181
|
+
cleanupMetadata: [
|
|
182
|
+
...spec.cleanupMetadata,
|
|
183
|
+
{ kind: 'temp-file', provider: 'gemini', path: policyPath, reason: 'admin-policy' },
|
|
184
|
+
],
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
|
|
112
188
|
function normalizeMessageContent(content: unknown): string {
|
|
113
189
|
if (typeof content === 'string') return content;
|
|
114
190
|
if (Array.isArray(content)) {
|
|
@@ -148,6 +224,11 @@ function parseToolUseEvent(
|
|
|
148
224
|
};
|
|
149
225
|
}
|
|
150
226
|
|
|
227
|
+
function geminiErrorMessage(event: Record<string, unknown>, fallback: string): string {
|
|
228
|
+
const error = isRecord(event.error) ? event.error : null;
|
|
229
|
+
return (error && getString(error, 'message')) || getString(event, 'message') || fallback;
|
|
230
|
+
}
|
|
231
|
+
|
|
151
232
|
function parseToolResultEvent(
|
|
152
233
|
event: Record<string, unknown>,
|
|
153
234
|
state: ProviderParserState
|
|
@@ -157,20 +238,32 @@ function parseToolResultEvent(
|
|
|
157
238
|
['tool_call_id', 'tool_id', 'id'],
|
|
158
239
|
state.lastToolId
|
|
159
240
|
);
|
|
241
|
+
const isError = getString(event, 'status') === 'error';
|
|
160
242
|
return {
|
|
161
243
|
type: 'tool_result',
|
|
162
244
|
toolId,
|
|
163
|
-
content: event.output ?? event
|
|
164
|
-
isError
|
|
245
|
+
content: event.output ?? (isError ? geminiErrorMessage(event, 'Tool failed') : ''),
|
|
246
|
+
isError,
|
|
165
247
|
};
|
|
166
248
|
}
|
|
167
249
|
|
|
168
250
|
function parseResultEvent(event: Record<string, unknown>): OutputEvent {
|
|
251
|
+
const success = getString(event, 'status') === 'success';
|
|
169
252
|
return {
|
|
170
253
|
type: 'result',
|
|
171
|
-
success
|
|
254
|
+
success,
|
|
172
255
|
result: event.result || '',
|
|
173
|
-
error:
|
|
256
|
+
error: success ? null : geminiErrorMessage(event, 'Result failed'),
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
function parseErrorEvent(event: Record<string, unknown>): OutputEvent | null {
|
|
261
|
+
if (getString(event, 'severity') !== 'error') return null;
|
|
262
|
+
return {
|
|
263
|
+
type: 'result',
|
|
264
|
+
success: false,
|
|
265
|
+
result: '',
|
|
266
|
+
error: getString(event, 'message') || 'Gemini CLI error',
|
|
174
267
|
};
|
|
175
268
|
}
|
|
176
269
|
|
|
@@ -189,6 +282,8 @@ function parseEvent(line: string, state: ProviderParserState): OutputEvent | nul
|
|
|
189
282
|
return parseToolResultEvent(event, state);
|
|
190
283
|
case 'result':
|
|
191
284
|
return parseResultEvent(event);
|
|
285
|
+
case 'error':
|
|
286
|
+
return parseErrorEvent(event);
|
|
192
287
|
default:
|
|
193
288
|
return null;
|
|
194
289
|
}
|
|
@@ -229,7 +324,7 @@ function classifyError(error: unknown): ErrorClassification {
|
|
|
229
324
|
);
|
|
230
325
|
}
|
|
231
326
|
|
|
232
|
-
export const geminiAdapter:
|
|
327
|
+
export const geminiAdapter: StructuredOutputRecoveryAdapter = {
|
|
233
328
|
id: 'gemini',
|
|
234
329
|
displayName: 'Gemini',
|
|
235
330
|
binary: 'gemini',
|
|
@@ -242,6 +337,7 @@ export const geminiAdapter: ProviderAdapter = {
|
|
|
242
337
|
defaultMinLevel: 'level1',
|
|
243
338
|
detectCliFeatures,
|
|
244
339
|
buildCommand,
|
|
340
|
+
buildStructuredOutputRecoveryCommand,
|
|
245
341
|
parseEvent,
|
|
246
342
|
createParserState: () => createParserState('gemini'),
|
|
247
343
|
resolveModelSpec,
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { contractError } from '../contract-errors';
|
|
2
|
+
import { randomUUID } from 'node:crypto';
|
|
3
|
+
import * as fs from 'node:fs';
|
|
4
|
+
import * as os from 'node:os';
|
|
5
|
+
import * as path from 'node:path';
|
|
2
6
|
import { UnsupportedProviderCapabilityError } from '../errors';
|
|
3
7
|
import { appendJsonSchemaPrompt } from '../schema';
|
|
4
8
|
import {
|
|
@@ -15,7 +19,7 @@ import {
|
|
|
15
19
|
type ErrorClassification,
|
|
16
20
|
type OpencodeCliFeatures,
|
|
17
21
|
type OutputEvent,
|
|
18
|
-
type
|
|
22
|
+
type StructuredOutputRecoveryAdapter,
|
|
19
23
|
type WarningMetadata,
|
|
20
24
|
} from '../types';
|
|
21
25
|
import {
|
|
@@ -49,7 +53,9 @@ function detectCliFeatures(
|
|
|
49
53
|
supportsCwd: unknown ? false : /--cwd\b/.test(help),
|
|
50
54
|
supportsAutoApprove: false,
|
|
51
55
|
supportsResume: !unknown && /--session\b/.test(help) && /--continue\b/.test(help),
|
|
56
|
+
supportsAgent: !unknown && /--agent\b/.test(help),
|
|
52
57
|
supportsWebSearch: isCliVersionAtLeast(versionText, '1.0.137'),
|
|
58
|
+
supportsRecoveryIsolation: isCliVersionAtLeast(versionText, '1.17.20'),
|
|
53
59
|
unknown,
|
|
54
60
|
};
|
|
55
61
|
}
|
|
@@ -162,6 +168,82 @@ function buildCommand(context: string, options: BuildProviderCommandOptions = {}
|
|
|
162
168
|
});
|
|
163
169
|
}
|
|
164
170
|
|
|
171
|
+
function buildStructuredOutputRecoveryCommand(
|
|
172
|
+
context: string,
|
|
173
|
+
options: BuildProviderCommandOptions = {}
|
|
174
|
+
): CommandSpec {
|
|
175
|
+
const features = optionFeatures(options);
|
|
176
|
+
if (features.supportsAgent !== true || features.supportsRecoveryIsolation !== true) {
|
|
177
|
+
throw new UnsupportedProviderCapabilityError(
|
|
178
|
+
'opencode',
|
|
179
|
+
'structuredOutputRecovery',
|
|
180
|
+
'OpenCode structured-output recovery requires CLI evidence for --agent and isolation controls available in OpenCode >= 1.17.20. Upgrade OpenCode before retrying.'
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
const agentName = `zeroshot-output-reformatter-${randomUUID()}`;
|
|
184
|
+
const profile = {
|
|
185
|
+
description: 'Convert supplied text to schema-valid JSON without external actions',
|
|
186
|
+
mode: 'primary',
|
|
187
|
+
permission: { '*': 'deny' },
|
|
188
|
+
tools: { '*': false },
|
|
189
|
+
};
|
|
190
|
+
const recoveryOptions = { ...options };
|
|
191
|
+
delete recoveryOptions.resumeSessionId;
|
|
192
|
+
delete recoveryOptions.continueSession;
|
|
193
|
+
const isolatedConfigHome = fs.mkdtempSync(path.join(os.tmpdir(), 'zeroshot-opencode-config-'));
|
|
194
|
+
|
|
195
|
+
try {
|
|
196
|
+
const spec = buildCommand(context, {
|
|
197
|
+
...recoveryOptions,
|
|
198
|
+
agentName,
|
|
199
|
+
autoApprove: false,
|
|
200
|
+
webSearch: false,
|
|
201
|
+
});
|
|
202
|
+
const restrictedConfig = {
|
|
203
|
+
default_agent: agentName,
|
|
204
|
+
permission: { '*': 'deny' },
|
|
205
|
+
tools: { '*': false },
|
|
206
|
+
agent: { [agentName]: profile },
|
|
207
|
+
mode: { [agentName]: profile },
|
|
208
|
+
mcp: {},
|
|
209
|
+
instructions: [],
|
|
210
|
+
plugin: [],
|
|
211
|
+
command: {},
|
|
212
|
+
};
|
|
213
|
+
return {
|
|
214
|
+
...spec,
|
|
215
|
+
env: {
|
|
216
|
+
...spec.env,
|
|
217
|
+
ZEROSHOT_OPENCODE_AGENT: agentName,
|
|
218
|
+
XDG_CONFIG_HOME: isolatedConfigHome,
|
|
219
|
+
OPENCODE_DB: ':memory:',
|
|
220
|
+
OPENCODE_CONFIG: '',
|
|
221
|
+
OPENCODE_CONFIG_DIR: isolatedConfigHome,
|
|
222
|
+
OPENCODE_CONFIG_CONTENT: JSON.stringify(restrictedConfig),
|
|
223
|
+
OPENCODE_PERMISSION: JSON.stringify({ '*': 'deny' }),
|
|
224
|
+
OPENCODE_DISABLE_PROJECT_CONFIG: '1',
|
|
225
|
+
OPENCODE_PURE: '1',
|
|
226
|
+
OPENCODE_DISABLE_DEFAULT_PLUGINS: '1',
|
|
227
|
+
OPENCODE_DISABLE_EXTERNAL_SKILLS: '1',
|
|
228
|
+
OPENCODE_DISABLE_CLAUDE_CODE: '1',
|
|
229
|
+
},
|
|
230
|
+
cleanup: [...(spec.cleanup || []), isolatedConfigHome],
|
|
231
|
+
cleanupMetadata: [
|
|
232
|
+
...(spec.cleanupMetadata || []),
|
|
233
|
+
{
|
|
234
|
+
kind: 'temp-directory',
|
|
235
|
+
provider: 'opencode',
|
|
236
|
+
path: isolatedConfigHome,
|
|
237
|
+
reason: 'isolated-config',
|
|
238
|
+
},
|
|
239
|
+
],
|
|
240
|
+
};
|
|
241
|
+
} catch (error) {
|
|
242
|
+
fs.rmSync(isolatedConfigHome, { recursive: true, force: true });
|
|
243
|
+
throw error;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
165
247
|
function parseToolPart(part: Record<string, unknown>): OutputEvent | null {
|
|
166
248
|
const state = getRecord(part, 'state') ?? {};
|
|
167
249
|
const status = getString(state, 'status');
|
|
@@ -262,7 +344,7 @@ function classifyError(error: unknown): ErrorClassification {
|
|
|
262
344
|
return classifyBaseProviderError(error, [], []);
|
|
263
345
|
}
|
|
264
346
|
|
|
265
|
-
export const opencodeAdapter:
|
|
347
|
+
export const opencodeAdapter: StructuredOutputRecoveryAdapter = {
|
|
266
348
|
id: 'opencode',
|
|
267
349
|
displayName: 'Opencode',
|
|
268
350
|
binary: 'opencode',
|
|
@@ -281,6 +363,7 @@ export const opencodeAdapter: ProviderAdapter = {
|
|
|
281
363
|
defaultMinLevel: 'level1',
|
|
282
364
|
detectCliFeatures,
|
|
283
365
|
buildCommand,
|
|
366
|
+
buildStructuredOutputRecoveryCommand,
|
|
284
367
|
extractSessionId,
|
|
285
368
|
parseEvent,
|
|
286
369
|
createParserState: () => createParserState('opencode'),
|
|
@@ -24,6 +24,9 @@ const CLI_FEATURE_FIELDS = [
|
|
|
24
24
|
'supportsModel',
|
|
25
25
|
'supportsEffort',
|
|
26
26
|
'supportsSettings',
|
|
27
|
+
'supportsTools',
|
|
28
|
+
'supportsStrictMcpConfig',
|
|
29
|
+
'supportsNoSessionPersistence',
|
|
27
30
|
'supportsJson',
|
|
28
31
|
'supportsOutputSchema',
|
|
29
32
|
'supportsDir',
|
|
@@ -31,8 +34,16 @@ const CLI_FEATURE_FIELDS = [
|
|
|
31
34
|
'supportsConfigOverride',
|
|
32
35
|
'supportsSkipGitRepoCheck',
|
|
33
36
|
'supportsVariant',
|
|
37
|
+
'supportsSandbox',
|
|
38
|
+
'supportsEphemeral',
|
|
39
|
+
'supportsIgnoreUserConfig',
|
|
40
|
+
'supportsIgnoreRules',
|
|
41
|
+
'supportsStrictConfig',
|
|
34
42
|
'supportsJsonMode',
|
|
43
|
+
'supportsAdminPolicy',
|
|
35
44
|
'supportsNoSession',
|
|
45
|
+
'supportsAgent',
|
|
46
|
+
'supportsRecoveryIsolation',
|
|
36
47
|
'supportsNoExtensions',
|
|
37
48
|
'supportsNoSkills',
|
|
38
49
|
'supportsNoPromptTemplates',
|
|
@@ -229,6 +240,11 @@ function normalizeBuildOptions(value: Record<string, unknown>): BuildProviderCom
|
|
|
229
240
|
'strictSchema',
|
|
230
241
|
optionalBooleanValue(value.strictSchema, 'options.strictSchema')
|
|
231
242
|
);
|
|
243
|
+
addDefined(
|
|
244
|
+
result,
|
|
245
|
+
'structuredOutputRecovery',
|
|
246
|
+
optionalBooleanValue(value.structuredOutputRecovery, 'options.structuredOutputRecovery')
|
|
247
|
+
);
|
|
232
248
|
addDefined(
|
|
233
249
|
result,
|
|
234
250
|
'gateway',
|
|
@@ -53,6 +53,7 @@ export {
|
|
|
53
53
|
providerRegistry,
|
|
54
54
|
resolveProviderCommand,
|
|
55
55
|
supportsProviderCapability,
|
|
56
|
+
supportsProviderOutputReformatting,
|
|
56
57
|
} from './provider-registry';
|
|
57
58
|
|
|
58
59
|
export type {
|
|
@@ -93,6 +94,9 @@ export type {
|
|
|
93
94
|
ProviderCliFeatures,
|
|
94
95
|
ProviderId,
|
|
95
96
|
ProviderRegistryEntry,
|
|
97
|
+
StructuredOutputRecoveryAdapter,
|
|
98
|
+
StructuredOutputProviderRegistryEntry,
|
|
99
|
+
UnstructuredOutputProviderRegistryEntry,
|
|
96
100
|
RedactionMetadata,
|
|
97
101
|
ReasoningEffort,
|
|
98
102
|
ResolvedGatewayBuildOptions,
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export const OMP_SUPPORTED_VERSION = '17.2.1' as const;
|
|
2
|
+
export const OMP_PACKAGE_NAME = '@oh-my-pi/pi-coding-agent' as const;
|
|
3
|
+
export const OMP_BINARY_NAME = 'omp' as const;
|
|
4
|
+
export const OMP_INSTALL_COMMAND =
|
|
5
|
+
`npm install -g --ignore-scripts ${OMP_PACKAGE_NAME}@${OMP_SUPPORTED_VERSION}` as const;
|
|
6
|
+
export const OMP_RELEASE_DOWNLOAD_BASE_URL =
|
|
7
|
+
`https://github.com/can1357/oh-my-pi/releases/download/v${OMP_SUPPORTED_VERSION}` as const;
|
|
8
|
+
|
|
9
|
+
export type OmpReleasePlatform =
|
|
10
|
+
| 'darwin-arm64'
|
|
11
|
+
| 'darwin-x64'
|
|
12
|
+
| 'linux-arm64'
|
|
13
|
+
| 'linux-musl-arm64'
|
|
14
|
+
| 'linux-musl-x64'
|
|
15
|
+
| 'linux-x64';
|
|
16
|
+
|
|
17
|
+
export interface OmpReleaseAsset {
|
|
18
|
+
readonly name: string;
|
|
19
|
+
readonly platform: OmpReleasePlatform;
|
|
20
|
+
readonly sha256: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Verified via `gh api repos/can1357/oh-my-pi/releases/tags/v17.2.1`. Windows is excluded (Unix-only).
|
|
24
|
+
export const OMP_RELEASE_ASSETS: readonly OmpReleaseAsset[] = [
|
|
25
|
+
{
|
|
26
|
+
name: 'omp-darwin-arm64',
|
|
27
|
+
platform: 'darwin-arm64',
|
|
28
|
+
sha256: 'b75eddb19ba9ec401fee5ecb35b3ceb5ddc48708e98b5a113136df5d65f2bed8',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'omp-darwin-x64',
|
|
32
|
+
platform: 'darwin-x64',
|
|
33
|
+
sha256: 'd23c197d93243122ef9a35a247bdd85075c4c1356dd1fa4a080faaa2dae4b905',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'omp-linux-arm64',
|
|
37
|
+
platform: 'linux-arm64',
|
|
38
|
+
sha256: 'd34883744bb54476f7268aad4b561ea9b1cd826f201d044b337c5a96713fa83d',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'omp-linux-musl-arm64',
|
|
42
|
+
platform: 'linux-musl-arm64',
|
|
43
|
+
sha256: '3babfe15664f32fcc03dc91d92a10341baf6e65b9868351de21c5aa3218e139d',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'omp-linux-musl-x64',
|
|
47
|
+
platform: 'linux-musl-x64',
|
|
48
|
+
sha256: '8f05f7eed2940b11c29d7aaf0e641b100c014db5bfbee00afa5dd4929ad5dd6a',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'omp-linux-x64',
|
|
52
|
+
platform: 'linux-x64',
|
|
53
|
+
sha256: 'ac0285a571aa79c58d59482561a3871befe7333dba3a3bdc2e90682653ee33b2',
|
|
54
|
+
},
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
export function findOmpReleaseAsset(platform: string): OmpReleaseAsset | undefined {
|
|
58
|
+
return OMP_RELEASE_ASSETS.find((asset) => asset.platform === platform);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function ompReleaseAssetDownloadUrl(asset: OmpReleaseAsset): string {
|
|
62
|
+
return `${OMP_RELEASE_DOWNLOAD_BASE_URL}/${asset.name}`;
|
|
63
|
+
}
|