@jini-ai/agent-runtime 0.4.11 → 0.4.12
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 +4 -0
- package/dist/acp-model-probe.d.ts +2 -20
- package/dist/agent-protocol/acp/json.js +46 -37
- package/dist/agent-protocol/acp/models.js +91 -73
- package/dist/agent-protocol/acp/rpc.d.ts +3 -2
- package/dist/agent-protocol/acp/rpc.js +3 -2
- package/dist/agent-protocol/acp/session-params.d.ts +1 -1
- package/dist/agent-protocol/acp/session-params.js +33 -30
- package/dist/agent-protocol/acp/session.d.ts +3 -1
- package/dist/agent-protocol/acp/session.js +62 -24
- package/dist/agent-protocol/acp/updates.js +49 -35
- package/dist/agent-protocol/pi-rpc/session.js +3 -1
- package/dist/anthropic-live-models.d.ts +12 -4
- package/dist/anthropic-live-models.js +0 -0
- package/dist/auth.js +84 -91
- package/dist/claude-code-models.d.ts +6 -5
- package/dist/claude-code-models.js +19 -12
- package/dist/claude-segment-usage.d.ts +3 -3
- package/dist/claude-segment-usage.js +63 -29
- package/dist/claude-stream.js +12 -5
- package/dist/copilot-stream.js +42 -50
- package/dist/defs/aider.js +3 -4
- package/dist/defs/amr.js +52 -61
- package/dist/defs/antigravity.d.ts +6 -5
- package/dist/defs/antigravity.js +48 -34
- package/dist/defs/auggie.d.ts +1 -1
- package/dist/defs/claude-compatible-args.d.ts +19 -0
- package/dist/defs/claude-compatible-args.js +42 -0
- package/dist/defs/claude.d.ts +7 -2
- package/dist/defs/claude.js +96 -85
- package/dist/defs/cline.d.ts +1 -1
- package/dist/defs/codebuddy.d.ts +1 -1
- package/dist/defs/codebuddy.js +29 -46
- package/dist/defs/codex.d.ts +15 -3
- package/dist/defs/codex.js +143 -108
- package/dist/defs/cursor-agent.d.ts +9 -7
- package/dist/defs/cursor-agent.js +53 -51
- package/dist/defs/devin.d.ts +1 -1
- package/dist/defs/goose.d.ts +1 -1
- package/dist/defs/hermes.d.ts +1 -1
- package/dist/defs/kilo.d.ts +1 -1
- package/dist/defs/kimi.d.ts +1 -1
- package/dist/defs/kiro.d.ts +1 -1
- package/dist/defs/opencode.d.ts +5 -4
- package/dist/defs/opencode.js +26 -32
- package/dist/defs/pi.d.ts +6 -5
- package/dist/defs/pi.js +24 -26
- package/dist/defs/qoder.d.ts +4 -3
- package/dist/defs/qoder.js +25 -25
- package/dist/defs/reasonix.d.ts +1 -1
- package/dist/defs/shared.d.ts +12 -3
- package/dist/defs/shared.js +19 -13
- package/dist/defs/trae-cli.d.ts +1 -1
- package/dist/defs/vibe.d.ts +1 -1
- package/dist/detection.d.ts +13 -20
- package/dist/detection.js +129 -111
- package/dist/env.js +56 -41
- package/dist/executables.js +103 -114
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/json-event-stream.js +611 -527
- package/dist/launch.js +44 -37
- package/dist/model-discovery-adapters.d.ts +17 -0
- package/dist/model-discovery-adapters.js +223 -164
- package/dist/model-discovery-config.js +107 -87
- package/dist/model-discovery-sdk.d.ts +16 -2
- package/dist/model-discovery-sdk.js +4 -3
- package/dist/model-discovery-shared.d.ts +14 -0
- package/dist/model-discovery-shared.js +50 -15
- package/dist/model-discovery-types.d.ts +2 -0
- package/dist/model-discovery.js +219 -117
- package/dist/models.d.ts +14 -1
- package/dist/models.js +75 -19
- package/dist/native-tool-policy.d.ts +29 -0
- package/dist/native-tool-policy.js +36 -0
- package/dist/opencode-log.js +46 -30
- package/dist/paths.d.ts +2 -0
- package/dist/paths.js +3 -3
- package/dist/providers/aihubmix.js +13 -18
- package/dist/providers/anthropic-messages.d.ts +7 -0
- package/dist/providers/anthropic-messages.js +45 -21
- package/dist/providers/azure-chat.d.ts +5 -0
- package/dist/providers/azure-chat.js +13 -5
- package/dist/providers/connection-guard.d.ts +2 -45
- package/dist/providers/connection-guard.js +11 -10
- package/dist/providers/connection-test.d.ts +4 -0
- package/dist/providers/connection-test.js +127 -110
- package/dist/providers/elevenlabs.js +4 -1
- package/dist/providers/google-messages.d.ts +4 -0
- package/dist/providers/google-messages.js +48 -23
- package/dist/providers/google-schema.js +17 -23
- package/dist/providers/model-catalog.js +160 -145
- package/dist/providers/oauth-callback-server.js +37 -34
- package/dist/providers/oauth-credentials.js +23 -23
- package/dist/providers/oauth-tokens.js +16 -24
- package/dist/providers/openai-chat.d.ts +42 -0
- package/dist/providers/openai-chat.js +80 -10
- package/dist/providers/operation-schema.d.ts +25 -0
- package/dist/providers/operation-schema.js +226 -0
- package/dist/providers/response-text.d.ts +10 -0
- package/dist/providers/response-text.js +23 -0
- package/dist/providers/tool-turn-types.d.ts +35 -9
- package/dist/providers/tool-turn.d.ts +7 -0
- package/dist/providers/tool-turn.js +113 -32
- package/dist/qoder-stream.js +93 -80
- package/dist/registry.d.ts +45 -0
- package/dist/registry.js +39 -0
- package/dist/runtime-state.d.ts +1 -1
- package/dist/types.d.ts +43 -1
- package/package.json +16 -7
package/dist/defs/pi.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { RuntimeBuildOptions, RuntimeModelOption } from '../types.js';
|
|
1
2
|
export declare const piAgentDef: {
|
|
2
3
|
id: string;
|
|
3
4
|
name: string;
|
|
@@ -7,19 +8,19 @@ export declare const piAgentDef: {
|
|
|
7
8
|
fetchModels: ({ resolvedBin, env }: {
|
|
8
9
|
resolvedBin: string;
|
|
9
10
|
env: import("../types.js").RuntimeEnv;
|
|
10
|
-
}) => Promise<
|
|
11
|
-
fallbackModels:
|
|
11
|
+
}) => Promise<RuntimeModelOption[] | null>;
|
|
12
|
+
fallbackModels: RuntimeModelOption[];
|
|
12
13
|
fallbackModelsAssertedAt: string;
|
|
13
14
|
reasoningOptions: {
|
|
14
15
|
id: string;
|
|
15
16
|
label: string;
|
|
16
17
|
}[];
|
|
17
|
-
buildArgs: (
|
|
18
|
+
buildArgs: (_input: {
|
|
18
19
|
prompt: string;
|
|
19
20
|
imagePaths: string[];
|
|
20
|
-
}, { extraAllowedDirs, options
|
|
21
|
+
}, { extraAllowedDirs, options }?: {
|
|
21
22
|
extraAllowedDirs?: string[];
|
|
22
|
-
options?:
|
|
23
|
+
options?: RuntimeBuildOptions;
|
|
23
24
|
runtimeContext?: import("../types.js").RuntimeContext;
|
|
24
25
|
} | undefined) => string[];
|
|
25
26
|
promptViaStdin: true;
|
package/dist/defs/pi.js
CHANGED
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
import { createAgentModelDiscovery } from '../model-discovery-native.js';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { DEFAULT_MODEL_OPTION, execAgentFile, parsePiModels } from './shared.js';
|
|
4
|
+
function modelArgs({ options }) {
|
|
5
|
+
// pi --model accepts patterns ("sonnet", "anthropic/claude-sonnet-4-5",
|
|
6
|
+
// "openai/gpt-5:high") so we pass the value through as-is.
|
|
7
|
+
return options.model && options.model !== 'default' ? ['--model', options.model] : [];
|
|
8
|
+
}
|
|
9
|
+
function thinkingArgs({ options }) {
|
|
10
|
+
return options.reasoning && options.reasoning !== 'default' ? ['--thinking', options.reasoning] : [];
|
|
11
|
+
}
|
|
12
|
+
// extraAllowedDirs carries skill seed and design-system directories
|
|
13
|
+
// that live outside the project cwd. pi doesn't have an --add-dir
|
|
14
|
+
// sandbox flag (it uses OS cwd), so we use --append-system-prompt to
|
|
15
|
+
// hint that these directories exist. The agent can then use its Read
|
|
16
|
+
// tool to access files inside them. Without this, pi runs inside the
|
|
17
|
+
// project cwd and has no way to discover or reach skill/design-system
|
|
18
|
+
// assets that live elsewhere.
|
|
19
|
+
function dirHintArgs({ extraAllowedDirs }) {
|
|
20
|
+
return (extraAllowedDirs || [])
|
|
21
|
+
.filter((d) => typeof d === 'string' && path.isAbsolute(d))
|
|
22
|
+
.flatMap((d) => ['--append-system-prompt', d]);
|
|
23
|
+
}
|
|
4
24
|
export const piAgentDef = {
|
|
5
25
|
...createAgentModelDiscovery('pi', { fallbackModels: () => piAgentDef.fallbackModels }),
|
|
6
26
|
id: 'pi',
|
|
@@ -22,9 +42,7 @@ export const piAgentDef = {
|
|
|
22
42
|
maxBuffer: 8 * 1024 * 1024,
|
|
23
43
|
} });
|
|
24
44
|
const parsed = parsePiModels({ stdout: stdout || stderr });
|
|
25
|
-
|
|
26
|
-
return null;
|
|
27
|
-
return parsed;
|
|
45
|
+
return parsed?.length ? parsed : null;
|
|
28
46
|
}
|
|
29
47
|
catch {
|
|
30
48
|
return null;
|
|
@@ -65,34 +83,14 @@ export const piAgentDef = {
|
|
|
65
83
|
// pi's RPC mode drives the entire conversation over stdio JSON-RPC.
|
|
66
84
|
// The daemon sends a `prompt` command and pi streams back typed events.
|
|
67
85
|
// No prompt in argv — avoids ENAMETOOLONG and keeps the protocol clean.
|
|
68
|
-
buildArgs: (
|
|
69
|
-
const args = ['--mode', 'rpc'];
|
|
70
|
-
if (options.model && options.model !== 'default') {
|
|
71
|
-
// pi --model accepts patterns ("sonnet", "anthropic/claude-sonnet-4-5",
|
|
72
|
-
// "openai/gpt-5:high") so we pass the value through as-is.
|
|
73
|
-
args.push('--model', options.model);
|
|
74
|
-
}
|
|
75
|
-
if (options.reasoning && options.reasoning !== 'default') {
|
|
76
|
-
args.push('--thinking', options.reasoning);
|
|
77
|
-
}
|
|
86
|
+
buildArgs: (_input, { extraAllowedDirs, options = {} } = {}) => {
|
|
78
87
|
// pi supports --append-system-prompt for cwd and extra context. It's repeatable (pi merges
|
|
79
88
|
// every occurrence), which is what lets this def push its own dir-hint values here AND the
|
|
80
89
|
// caller's `systemPromptDelivery: 'append-flag'` overlay (declared below, dispatched
|
|
81
90
|
// centrally by `@jini-ai/daemon`'s `resolveSystemPromptOverlayDelivery`) push a separate
|
|
82
91
|
// occurrence carrying the overlay text — the two never collide or need to be merged by hand.
|
|
83
|
-
//
|
|
84
|
-
|
|
85
|
-
// that live outside the project cwd. pi doesn't have an --add-dir
|
|
86
|
-
// sandbox flag (it uses OS cwd), so we use --append-system-prompt to
|
|
87
|
-
// hint that these directories exist. The agent can then use its Read
|
|
88
|
-
// tool to access files inside them. Without this, pi runs inside the
|
|
89
|
-
// project cwd and has no way to discover or reach skill/design-system
|
|
90
|
-
// assets that live elsewhere.
|
|
91
|
-
const dirs = (extraAllowedDirs || []).filter((d) => typeof d === 'string' && path.isAbsolute(d));
|
|
92
|
-
for (const d of dirs) {
|
|
93
|
-
args.push('--append-system-prompt', d);
|
|
94
|
-
}
|
|
95
|
-
return args;
|
|
92
|
+
// Dir-hint rationale: see `dirHintArgs`.
|
|
93
|
+
return ['--mode', 'rpc', ...modelArgs({ options }), ...thinkingArgs({ options }), ...dirHintArgs({ extraAllowedDirs })];
|
|
96
94
|
},
|
|
97
95
|
// Prompt is sent via RPC `prompt` command on stdin, not as a CLI arg.
|
|
98
96
|
promptViaStdin: true,
|
package/dist/defs/qoder.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
+
import type { RuntimeBuildOptions, RuntimeContext } from '../types.js';
|
|
1
2
|
export declare const qoderAgentDef: {
|
|
2
3
|
id: string;
|
|
3
4
|
name: string;
|
|
4
5
|
bin: string;
|
|
5
6
|
versionArgs: string[];
|
|
6
7
|
fallbackModels: import("../types.js").RuntimeModelOption[];
|
|
7
|
-
buildArgs: ({
|
|
8
|
+
buildArgs: ({ imagePaths }: {
|
|
8
9
|
prompt: string;
|
|
9
10
|
imagePaths: string[];
|
|
10
11
|
}, { extraAllowedDirs, options, runtimeContext }?: {
|
|
11
12
|
extraAllowedDirs?: string[];
|
|
12
|
-
options?:
|
|
13
|
-
runtimeContext?:
|
|
13
|
+
options?: RuntimeBuildOptions;
|
|
14
|
+
runtimeContext?: RuntimeContext;
|
|
14
15
|
} | undefined) => string[];
|
|
15
16
|
promptViaStdin: true;
|
|
16
17
|
streamFormat: string;
|
package/dist/defs/qoder.js
CHANGED
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
import { createAgentModelDiscovery } from '../model-discovery-native.js';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { DEFAULT_MODEL_OPTION } from './shared.js';
|
|
4
|
+
/** Approval, workspace and model argv, in that order. */
|
|
5
|
+
function qoderRunArgs({ options, runtimeContext }) {
|
|
6
|
+
const args = [];
|
|
7
|
+
// See `RuntimeBuildOptions.permissionMode`'s doc: bypass is the default (unchanged
|
|
8
|
+
// behavior) unless a caller explicitly opts into a restricted run.
|
|
9
|
+
if (options.permissionMode !== 'restricted')
|
|
10
|
+
args.push('--yolo');
|
|
11
|
+
if (runtimeContext.cwd)
|
|
12
|
+
args.push('-w', runtimeContext.cwd);
|
|
13
|
+
if (options.model && options.model !== 'default')
|
|
14
|
+
args.push('--model', options.model);
|
|
15
|
+
return args;
|
|
16
|
+
}
|
|
17
|
+
/** Only absolute string paths are forwarded; a nullish list (loosely-typed caller) yields none. */
|
|
18
|
+
function absolutePaths(paths) {
|
|
19
|
+
return (paths ?? []).filter((entry) => typeof entry === 'string' && path.isAbsolute(entry));
|
|
20
|
+
}
|
|
4
21
|
export const qoderAgentDef = {
|
|
5
22
|
// UNVERIFIED live integration locally; source/category and limits are documented in model-discovery-adapters.ts.
|
|
6
23
|
...createAgentModelDiscovery('qoder', { fallbackModels: () => qoderAgentDef.fallbackModels }),
|
|
@@ -25,31 +42,14 @@ export const qoderAgentDef = {
|
|
|
25
42
|
// QODER_PERSONAL_ACCESS_TOKEN for automation. Do not add that token to
|
|
26
43
|
// static adapter env; unlike Gemini's workspace trust flag it is a user
|
|
27
44
|
// secret and already flows through the inherited process environment.
|
|
28
|
-
buildArgs: ({
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
]
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if (options.permissionMode !== 'restricted') {
|
|
37
|
-
args.push('--yolo');
|
|
38
|
-
}
|
|
39
|
-
if (runtimeContext.cwd) {
|
|
40
|
-
args.push('-w', runtimeContext.cwd);
|
|
41
|
-
}
|
|
42
|
-
if (options.model && options.model !== 'default') {
|
|
43
|
-
args.push('--model', options.model);
|
|
44
|
-
}
|
|
45
|
-
const dirs = (extraAllowedDirs || []).filter((d) => typeof d === 'string' && path.isAbsolute(d));
|
|
46
|
-
const attachments = (imagePaths || []).filter((p) => typeof p === 'string' && path.isAbsolute(p));
|
|
47
|
-
for (const d of dirs)
|
|
48
|
-
args.push('--add-dir', d);
|
|
49
|
-
for (const p of attachments)
|
|
50
|
-
args.push('--attachment', p);
|
|
51
|
-
return args;
|
|
52
|
-
},
|
|
45
|
+
buildArgs: ({ imagePaths }, { extraAllowedDirs = [], options = {}, runtimeContext = {} } = {}) => [
|
|
46
|
+
'-p',
|
|
47
|
+
'--output-format',
|
|
48
|
+
'stream-json',
|
|
49
|
+
...qoderRunArgs({ options, runtimeContext }),
|
|
50
|
+
...absolutePaths(extraAllowedDirs).flatMap((d) => ['--add-dir', d]),
|
|
51
|
+
...absolutePaths(imagePaths).flatMap((p) => ['--attachment', p]),
|
|
52
|
+
],
|
|
53
53
|
promptViaStdin: true,
|
|
54
54
|
streamFormat: 'qoder-stream-json',
|
|
55
55
|
// Own dedicated `--attachment <path>` argv flag, built above — a real
|
package/dist/defs/reasonix.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare const reasonixAgentDef: {
|
|
|
8
8
|
resolvedBin: string;
|
|
9
9
|
env: import("../types.js").RuntimeEnv;
|
|
10
10
|
}, { acpModelProbe }?: {
|
|
11
|
-
acpModelProbe?: import("../
|
|
11
|
+
acpModelProbe?: import("../types.js").AcpModelProbe;
|
|
12
12
|
} | undefined) => Promise<import("../types.js").RuntimeModelOption[]>;
|
|
13
13
|
buildArgs: () => string[];
|
|
14
14
|
streamFormat: string;
|
package/dist/defs/shared.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export { detectAcpModels, parsePiModels, execAgentFile, DEFAULT_MODEL_OPTION };
|
|
|
28
28
|
* headless daemon child has no TTY to answer it, leaving the MCP connection pending indefinitely.
|
|
29
29
|
* Passing the staged file via --mcp-config makes it available without that prompt.
|
|
30
30
|
*
|
|
31
|
-
* `--strict-mcp-config`
|
|
31
|
+
* Unless a trusted host grants CLI parity, `--strict-mcp-config` makes the CLI load
|
|
32
32
|
* ONLY this config, closing the separate "spawned CLI inherits the interactive developer's own
|
|
33
33
|
* global/project MCP servers" leak. Both flags are documented for both current declarers
|
|
34
34
|
* (Claude Code's own CLI reference; CodeBuddy's CLI reference documents `--mcp-config
|
|
@@ -38,11 +38,20 @@ export { detectAcpModels, parsePiModels, execAgentFile, DEFAULT_MODEL_OPTION };
|
|
|
38
38
|
* @param runtimeContext - The def's own `buildArgs` `runtimeContext`. Only `mcpJsonPath` is read;
|
|
39
39
|
* it is present only when the caller is actually staging that file for this run (see
|
|
40
40
|
* `RuntimeContext.mcpJsonPath`'s own doc), so an unconfigured host gets `[]` and no argv change.
|
|
41
|
-
*
|
|
41
|
+
* Trusted bypass parity omits strict isolation so user MCP/Chrome settings remain available.
|
|
42
|
+
* Explicit --mcp-config still avoids a headless trust prompt. A locked run without a staged
|
|
43
|
+
* config gets --strict-mcp-config alone, exposing no auto-discovered MCP servers.
|
|
42
44
|
* @complexity O(1).
|
|
43
45
|
* @overallScore 100/100
|
|
44
46
|
*/
|
|
45
|
-
export declare function buildClaudeMcpConfigArgs(runtimeContext: RuntimeContext
|
|
47
|
+
export declare function buildClaudeMcpConfigArgs(runtimeContext: RuntimeContext, options?: {
|
|
48
|
+
cliParity?: boolean;
|
|
49
|
+
permissionMode?: string;
|
|
50
|
+
nativeToolAccess?: boolean;
|
|
51
|
+
nativeCapabilities?: {
|
|
52
|
+
userMcp?: boolean;
|
|
53
|
+
};
|
|
54
|
+
}): string[];
|
|
46
55
|
export declare function clampCodexReasoning(modelId: string | null | undefined, effort: string | null | undefined): string | null | undefined;
|
|
47
56
|
export declare function parseLineSeparatedModels({ stdout }: {
|
|
48
57
|
stdout: string;
|
package/dist/defs/shared.js
CHANGED
|
@@ -27,7 +27,7 @@ export { detectAcpModels, parsePiModels, execAgentFile, DEFAULT_MODEL_OPTION };
|
|
|
27
27
|
* headless daemon child has no TTY to answer it, leaving the MCP connection pending indefinitely.
|
|
28
28
|
* Passing the staged file via --mcp-config makes it available without that prompt.
|
|
29
29
|
*
|
|
30
|
-
* `--strict-mcp-config`
|
|
30
|
+
* Unless a trusted host grants CLI parity, `--strict-mcp-config` makes the CLI load
|
|
31
31
|
* ONLY this config, closing the separate "spawned CLI inherits the interactive developer's own
|
|
32
32
|
* global/project MCP servers" leak. Both flags are documented for both current declarers
|
|
33
33
|
* (Claude Code's own CLI reference; CodeBuddy's CLI reference documents `--mcp-config
|
|
@@ -37,28 +37,34 @@ export { detectAcpModels, parsePiModels, execAgentFile, DEFAULT_MODEL_OPTION };
|
|
|
37
37
|
* @param runtimeContext - The def's own `buildArgs` `runtimeContext`. Only `mcpJsonPath` is read;
|
|
38
38
|
* it is present only when the caller is actually staging that file for this run (see
|
|
39
39
|
* `RuntimeContext.mcpJsonPath`'s own doc), so an unconfigured host gets `[]` and no argv change.
|
|
40
|
-
*
|
|
40
|
+
* Trusted bypass parity omits strict isolation so user MCP/Chrome settings remain available.
|
|
41
|
+
* Explicit --mcp-config still avoids a headless trust prompt. A locked run without a staged
|
|
42
|
+
* config gets --strict-mcp-config alone, exposing no auto-discovered MCP servers.
|
|
41
43
|
* @complexity O(1).
|
|
42
44
|
* @overallScore 100/100
|
|
43
45
|
*/
|
|
44
|
-
export function buildClaudeMcpConfigArgs(runtimeContext) {
|
|
46
|
+
export function buildClaudeMcpConfigArgs(runtimeContext, options = {}) {
|
|
45
47
|
const mcpJsonPath = runtimeContext.mcpJsonPath;
|
|
48
|
+
const userMcpLocked = options.nativeToolAccess === false || options.nativeCapabilities?.userMcp === false;
|
|
46
49
|
if (typeof mcpJsonPath !== 'string' || mcpJsonPath.length === 0)
|
|
47
|
-
return [];
|
|
48
|
-
|
|
50
|
+
return userMcpLocked ? ['--strict-mcp-config'] : [];
|
|
51
|
+
// Explicit config still avoids headless trust prompts. Only a trusted bypass run inherits MCP.
|
|
52
|
+
const trustedBypass = Boolean(options.cliParity) && options.permissionMode === 'bypass' && !userMcpLocked;
|
|
53
|
+
return [...(trustedBypass ? [] : ['--strict-mcp-config']), '--mcp-config', mcpJsonPath];
|
|
54
|
+
}
|
|
55
|
+
/** Model-id prefixes of the late gpt-5.x family, which rejects `minimal` effort. */
|
|
56
|
+
const GPT5_LATE_FAMILY_PREFIXES = ['gpt-5.2', 'gpt-5.3', 'gpt-5.4', 'gpt-5.5'];
|
|
57
|
+
/** True for the empty/`default` id (the CLI's own default model) or a late gpt-5.x id. */
|
|
58
|
+
function isGpt5LateFamily(id) {
|
|
59
|
+
return id === '' || id === 'default' || GPT5_LATE_FAMILY_PREFIXES.some((prefix) => id.startsWith(prefix));
|
|
49
60
|
}
|
|
50
61
|
export function clampCodexReasoning(modelId, effort) {
|
|
51
62
|
if (!effort)
|
|
52
63
|
return effort;
|
|
53
64
|
const raw = String(modelId ?? '').trim();
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
id.startsWith('gpt-5.2') ||
|
|
58
|
-
id.startsWith('gpt-5.3') ||
|
|
59
|
-
id.startsWith('gpt-5.4') ||
|
|
60
|
-
id.startsWith('gpt-5.5');
|
|
61
|
-
if (isGpt5LateFamily && effort === 'minimal')
|
|
65
|
+
// Strip any provider prefix ("openai/gpt-5.2" -> "gpt-5.2"); a trailing "/" leaves "".
|
|
66
|
+
const id = raw.slice(raw.lastIndexOf('/') + 1);
|
|
67
|
+
if (isGpt5LateFamily(id) && effort === 'minimal')
|
|
62
68
|
return 'low';
|
|
63
69
|
if (id === 'gpt-5.1' && effort === 'xhigh')
|
|
64
70
|
return 'high';
|
package/dist/defs/trae-cli.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare const traeCliAgentDef: {
|
|
|
8
8
|
resolvedBin: string;
|
|
9
9
|
env: import("../types.js").RuntimeEnv;
|
|
10
10
|
}, { acpModelProbe }?: {
|
|
11
|
-
acpModelProbe?: import("../
|
|
11
|
+
acpModelProbe?: import("../types.js").AcpModelProbe;
|
|
12
12
|
} | undefined) => Promise<import("../types.js").RuntimeModelOption[]>;
|
|
13
13
|
fallbackModels: import("../types.js").RuntimeModelOption[];
|
|
14
14
|
buildArgs: ({ prompt: _prompt, imagePaths: _imagePaths }: {
|
package/dist/defs/vibe.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare const vibeAgentDef: {
|
|
|
7
7
|
resolvedBin: string;
|
|
8
8
|
env: import("../types.js").RuntimeEnv;
|
|
9
9
|
}, { acpModelProbe }?: {
|
|
10
|
-
acpModelProbe?: import("../
|
|
10
|
+
acpModelProbe?: import("../types.js").AcpModelProbe;
|
|
11
11
|
} | undefined) => Promise<import("../types.js").RuntimeModelOption[]>;
|
|
12
12
|
fallbackModels: import("../types.js").RuntimeModelOption[];
|
|
13
13
|
buildArgs: () => never[];
|
package/dist/detection.d.ts
CHANGED
|
@@ -2,12 +2,6 @@ import { type AgentRuntimeState } from './runtime-state.js';
|
|
|
2
2
|
import type { ModelDiscoveryContext, ModelDiscoveryDeps, ModelCatalogSnapshot, DefaultModelResolution } from './model-discovery-types.js';
|
|
3
3
|
import { type AmrProfileResolver } from './amr-profile-resolver.js';
|
|
4
4
|
import type { AgentDiagnostic, DetectedAgent, RuntimeAgentDef, RuntimeCapabilityMap, RuntimeModelSource, RuntimeModelOption } from './types.js';
|
|
5
|
-
type FetchedRuntimeModels = {
|
|
6
|
-
models: RuntimeModelOption[];
|
|
7
|
-
source: RuntimeModelSource;
|
|
8
|
-
catalog?: ModelCatalogSnapshot;
|
|
9
|
-
defaultModelResolution?: DefaultModelResolution;
|
|
10
|
-
};
|
|
11
5
|
/**
|
|
12
6
|
* Makes sure `agentCapabilities` holds this def's `--help`-probed flags before its `buildArgs` runs.
|
|
13
7
|
*
|
|
@@ -41,7 +35,12 @@ export declare function ensureAgentCapabilities({ def, launchPath, env }: {
|
|
|
41
35
|
}, optional: Record<string, never>) => Promise<RuntimeCapabilityMap>;
|
|
42
36
|
}): Promise<void>;
|
|
43
37
|
/** Result of {@link probeAgentModels}: the models to surface and where they came from. */
|
|
44
|
-
export type ProbedAgentModels =
|
|
38
|
+
export type ProbedAgentModels = {
|
|
39
|
+
models: RuntimeModelOption[];
|
|
40
|
+
source: RuntimeModelSource;
|
|
41
|
+
catalog?: ModelCatalogSnapshot;
|
|
42
|
+
defaultModelResolution?: DefaultModelResolution;
|
|
43
|
+
};
|
|
45
44
|
/**
|
|
46
45
|
* The model half of {@link detectAgents} for ONE def, without the `--version`/`--help`/auth probes:
|
|
47
46
|
* resolves the launch path, builds the same probe env, runs the def's `fetchModels`/`listModels`,
|
|
@@ -56,12 +55,13 @@ export type ProbedAgentModels = FetchedRuntimeModels;
|
|
|
56
55
|
*/
|
|
57
56
|
export declare function probeAgentModels({ def }: {
|
|
58
57
|
def: RuntimeAgentDef;
|
|
59
|
-
}, { configuredEnv, amrProfileResolver, context, deps, force, state, env }?: {
|
|
58
|
+
}, { configuredEnv, amrProfileResolver, context, version, deps, force, state, env }?: {
|
|
60
59
|
state?: AgentRuntimeState;
|
|
61
60
|
env?: NodeJS.ProcessEnv;
|
|
62
61
|
configuredEnv?: Record<string, string>;
|
|
63
62
|
amrProfileResolver?: AmrProfileResolver;
|
|
64
63
|
context?: ModelDiscoveryContext;
|
|
64
|
+
version?: string | null;
|
|
65
65
|
deps?: ModelDiscoveryDeps;
|
|
66
66
|
force?: boolean;
|
|
67
67
|
}): Promise<ProbedAgentModels>;
|
|
@@ -77,7 +77,8 @@ export interface AgentDetectionModelOptions {
|
|
|
77
77
|
amrProfileResolver: AmrProfileResolver;
|
|
78
78
|
}, options: AgentDetectionModelOptions) => Promise<DetectedAgent>;
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
/** Options accepted by {@link detectAgents} and {@link detectAgentsStream}. */
|
|
81
|
+
type DetectAgentsOptions = {
|
|
81
82
|
state?: AgentRuntimeState;
|
|
82
83
|
env?: NodeJS.ProcessEnv;
|
|
83
84
|
configuredEnvByAgent?: Record<string, Record<string, string>>;
|
|
@@ -86,7 +87,8 @@ export declare function detectAgents({}: {}, { configuredEnvByAgent, amrProfileR
|
|
|
86
87
|
modelDiscoveryDeps?: ModelDiscoveryDeps;
|
|
87
88
|
force?: boolean;
|
|
88
89
|
probeAgent?: AgentDetectionModelOptions['probeAgent'];
|
|
89
|
-
}
|
|
90
|
+
};
|
|
91
|
+
export declare function detectAgents({}: {}, optional?: DetectAgentsOptions): Promise<(Omit<RuntimeAgentDef, "discoverModels" | "resolveDefaultModel" | "buildArgs" | "listModels" | "fetchModels" | "deriveReasoningOptions" | "fallbackModels" | "fallbackModelsAssertedAt" | "helpArgs" | "capabilityFlags" | "fallbackBins" | "versionProbeTimeoutMs" | "maxPromptArgBytes" | "env" | "inactivityTimeoutMs" | "authProbe" | "needsAgentLogFile" | "stdoutPolicy" | "runtimeLock"> & {
|
|
90
92
|
models: RuntimeModelOption[];
|
|
91
93
|
modelsSource: RuntimeModelSource;
|
|
92
94
|
modelCatalog?: ModelCatalogSnapshot;
|
|
@@ -98,15 +100,6 @@ export declare function detectAgents({}: {}, { configuredEnvByAgent, amrProfileR
|
|
|
98
100
|
version?: string | null;
|
|
99
101
|
diagnostics?: AgentDiagnostic[];
|
|
100
102
|
})[]>;
|
|
101
|
-
export declare function detectAgentsStream({}: {},
|
|
102
|
-
state?: AgentRuntimeState;
|
|
103
|
-
env?: NodeJS.ProcessEnv;
|
|
104
|
-
configuredEnvByAgent?: Record<string, Record<string, string>>;
|
|
105
|
-
amrProfileResolver?: AmrProfileResolver;
|
|
106
|
-
modelContextByAgent?: Record<string, ModelDiscoveryContext>;
|
|
107
|
-
modelDiscoveryDeps?: ModelDiscoveryDeps;
|
|
108
|
-
force?: boolean;
|
|
109
|
-
probeAgent?: AgentDetectionModelOptions['probeAgent'];
|
|
110
|
-
}): AsyncGenerator<DetectedAgent>;
|
|
103
|
+
export declare function detectAgentsStream({}: {}, optional?: DetectAgentsOptions): AsyncGenerator<DetectedAgent>;
|
|
111
104
|
export {};
|
|
112
105
|
//# sourceMappingURL=detection.d.ts.map
|