@getpaseo/server 0.1.104-beta.2 → 0.1.104-beta.3
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/server/server/agent/create-agent/create.d.ts +1 -1
- package/dist/server/server/agent/create-agent/create.js +4 -4
- package/dist/server/server/agent/providers/claude/agent.js +3 -2
- package/dist/server/server/agent/providers/claude/feature-definitions.js +2 -14
- package/dist/server/server/agent/providers/claude/model-manifest.d.ts +90 -0
- package/dist/server/server/agent/providers/claude/model-manifest.js +205 -0
- package/dist/server/server/agent/providers/claude/models.js +4 -141
- package/dist/server/server/agent/tools/paseo-tools.d.ts +4 -1
- package/dist/server/server/agent/tools/paseo-tools.js +73 -4
- package/dist/server/server/bootstrap.js +37 -3
- package/dist/server/server/browser-tools/broker.d.ts +16 -5
- package/dist/server/server/browser-tools/broker.js +220 -22
- package/dist/server/server/browser-tools/tools.js +195 -36
- package/dist/server/server/session.d.ts +3 -10
- package/dist/server/server/session.js +10 -121
- package/dist/server/server/websocket-server.d.ts +3 -1
- package/dist/server/server/websocket-server.js +18 -5
- package/dist/server/server/workspace-auto-name.d.ts +55 -0
- package/dist/server/server/workspace-auto-name.js +128 -0
- package/dist/server/server/worktree-session.d.ts +1 -1
- package/dist/server/server/worktree-session.js +1 -1
- package/dist/server/web-ui/_expo/static/js/web/{desktop-attachment-bridge-d9e471546cbc685a5f1a44f54114fc48.js → desktop-attachment-bridge-95a8163efd836849dd3f83730f1e84f4.js} +1 -1
- package/dist/server/web-ui/_expo/static/js/web/{desktop-attachment-bridge-d9e471546cbc685a5f1a44f54114fc48.js.br → desktop-attachment-bridge-95a8163efd836849dd3f83730f1e84f4.js.br} +0 -0
- package/dist/server/web-ui/_expo/static/js/web/desktop-attachment-bridge-95a8163efd836849dd3f83730f1e84f4.js.gz +0 -0
- package/dist/server/web-ui/_expo/static/js/web/{desktop-attachment-store-30526c06e214c5937e98bf1e5244cc22.js → desktop-attachment-store-9b3937a7b33a31908fa313b18c15daf6.js} +1 -1
- package/dist/server/web-ui/_expo/static/js/web/desktop-attachment-store-9b3937a7b33a31908fa313b18c15daf6.js.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/desktop-attachment-store-9b3937a7b33a31908fa313b18c15daf6.js.gz +0 -0
- package/dist/server/web-ui/_expo/static/js/web/{index-9f718c794c8b2995afa4a8f14218e814.js → index-690d9fe101525c0a632093e00322c944.js} +1056 -1055
- package/dist/server/web-ui/_expo/static/js/web/index-690d9fe101525c0a632093e00322c944.js.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/index-690d9fe101525c0a632093e00322c944.js.gz +0 -0
- package/dist/server/web-ui/_expo/static/js/web/{indexeddb-attachment-store-aa960ad0ab4cef263d0d7664e12f5b65.js → indexeddb-attachment-store-ee4a35a8c1da1c737256427f2fe19c35.js} +1 -1
- package/dist/server/web-ui/_expo/static/js/web/indexeddb-attachment-store-ee4a35a8c1da1c737256427f2fe19c35.js.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/indexeddb-attachment-store-ee4a35a8c1da1c737256427f2fe19c35.js.gz +0 -0
- package/dist/server/web-ui/_expo/static/js/web/{native-file-attachment-store-7837a7115a8a584b7d7231cfa2eae2cf.js → native-file-attachment-store-c4aebe23af349f0f64f418e755c84c00.js} +3 -3
- package/dist/server/web-ui/_expo/static/js/web/native-file-attachment-store-c4aebe23af349f0f64f418e755c84c00.js.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/native-file-attachment-store-c4aebe23af349f0f64f418e755c84c00.js.gz +0 -0
- package/dist/server/web-ui/index.html +1 -1
- package/dist/server/web-ui/index.html.br +0 -0
- package/dist/server/web-ui/index.html.gz +0 -0
- package/package.json +5 -5
- package/dist/server/web-ui/_expo/static/js/web/desktop-attachment-bridge-d9e471546cbc685a5f1a44f54114fc48.js.gz +0 -0
- package/dist/server/web-ui/_expo/static/js/web/desktop-attachment-store-30526c06e214c5937e98bf1e5244cc22.js.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/desktop-attachment-store-30526c06e214c5937e98bf1e5244cc22.js.gz +0 -0
- package/dist/server/web-ui/_expo/static/js/web/index-9f718c794c8b2995afa4a8f14218e814.js.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/index-9f718c794c8b2995afa4a8f14218e814.js.gz +0 -0
- package/dist/server/web-ui/_expo/static/js/web/indexeddb-attachment-store-aa960ad0ab4cef263d0d7664e12f5b65.js.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/indexeddb-attachment-store-aa960ad0ab4cef263d0d7664e12f5b65.js.gz +0 -0
- package/dist/server/web-ui/_expo/static/js/web/native-file-attachment-store-7837a7115a8a584b7d7231cfa2eae2cf.js.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/native-file-attachment-store-7837a7115a8a584b7d7231cfa2eae2cf.js.gz +0 -0
|
@@ -20,7 +20,7 @@ interface CreateAgentCommandDependencies {
|
|
|
20
20
|
terminalManager?: TerminalManager | null;
|
|
21
21
|
providerSnapshotManager: ProviderSnapshotManager;
|
|
22
22
|
createPaseoWorktree?: CreatePaseoWorktreeWorkflowFn;
|
|
23
|
-
ensureWorkspaceForCreate?: (cwd: string) => Promise<string>;
|
|
23
|
+
ensureWorkspaceForCreate?: (cwd: string, firstAgentContext?: FirstAgentContext) => Promise<string>;
|
|
24
24
|
}
|
|
25
25
|
export interface CreateAgentFromSessionInput {
|
|
26
26
|
kind: "session";
|
|
@@ -98,7 +98,7 @@ async function resolveMcpCreateAgent(dependencies, input) {
|
|
|
98
98
|
? createdWorkspaceId
|
|
99
99
|
: (input.workspaceId ??
|
|
100
100
|
parentAgent?.workspaceId ??
|
|
101
|
-
(await ensureWorkspaceForMcpCreate(dependencies, resolvedCwd)));
|
|
101
|
+
(await ensureWorkspaceForMcpCreate(dependencies, resolvedCwd, input.initialPrompt)));
|
|
102
102
|
const { modeId: resolvedMode, featureValues: resolvedFeatures } = await dependencies.providerSnapshotManager.resolveCreateConfig({
|
|
103
103
|
cwd: resolvedCwd,
|
|
104
104
|
provider,
|
|
@@ -136,11 +136,11 @@ async function resolveMcpCreateAgent(dependencies, input) {
|
|
|
136
136
|
promptFailure: "log",
|
|
137
137
|
};
|
|
138
138
|
}
|
|
139
|
-
async function ensureWorkspaceForMcpCreate(dependencies, cwd) {
|
|
139
|
+
async function ensureWorkspaceForMcpCreate(dependencies, cwd, initialPrompt) {
|
|
140
140
|
if (!dependencies.ensureWorkspaceForCreate) {
|
|
141
141
|
return undefined;
|
|
142
142
|
}
|
|
143
|
-
return dependencies.ensureWorkspaceForCreate(cwd);
|
|
143
|
+
return dependencies.ensureWorkspaceForCreate(cwd, { prompt: initialPrompt });
|
|
144
144
|
}
|
|
145
145
|
async function sendInitialPrompt(dependencies, resolved, snapshot) {
|
|
146
146
|
try {
|
|
@@ -228,7 +228,7 @@ async function resolveMcpCwd(params) {
|
|
|
228
228
|
refName: worktree.refName,
|
|
229
229
|
action: worktree.action,
|
|
230
230
|
githubPrNumber: worktree.githubPrNumber,
|
|
231
|
-
|
|
231
|
+
firstAgentContext: { prompt: params.initialPrompt },
|
|
232
232
|
runSetup: false,
|
|
233
233
|
paseoHome: dependencies.paseoHome,
|
|
234
234
|
worktreesRoot: dependencies.worktreesRoot,
|
|
@@ -6,6 +6,7 @@ import path from "node:path";
|
|
|
6
6
|
import { mapClaudeCanceledToolCall, mapClaudeCompletedToolCall, mapClaudeFailedToolCall, mapClaudeRunningToolCall, } from "./tool-call-mapper.js";
|
|
7
7
|
import { mapTaskNotificationSystemRecordToToolCall, mapTaskNotificationUserContentToToolCall, } from "./task-notification-tool-call.js";
|
|
8
8
|
import { findClaudeModel, getClaudeModelsWithSettings, normalizeClaudeRuntimeModelId, } from "./models.js";
|
|
9
|
+
import { CLAUDE_ULTRACODE_THINKING_OPTION_ID } from "./model-manifest.js";
|
|
9
10
|
import { parsePartialJsonObject } from "./partial-json.js";
|
|
10
11
|
import { ClaudeSidechainTracker } from "./sidechain-tracker.js";
|
|
11
12
|
import { buildClaudeFeatures, claudeModelSupportsFastMode } from "./feature-definitions.js";
|
|
@@ -232,7 +233,7 @@ function isClaudeThinkingEffort(value) {
|
|
|
232
233
|
value === "max");
|
|
233
234
|
}
|
|
234
235
|
function isClaudeThinkingOption(value) {
|
|
235
|
-
return value ===
|
|
236
|
+
return value === CLAUDE_ULTRACODE_THINKING_OPTION_ID || isClaudeThinkingEffort(value);
|
|
236
237
|
}
|
|
237
238
|
const MAX_RECENT_STDERR_CHARS = 4000;
|
|
238
239
|
const STDERR_FLUSH_WAIT_MS = 150;
|
|
@@ -2307,7 +2308,7 @@ class ClaudeAgentSession {
|
|
|
2307
2308
|
const thinkingOptionId = this.config.thinkingOptionId && this.config.thinkingOptionId !== "default"
|
|
2308
2309
|
? this.config.thinkingOptionId
|
|
2309
2310
|
: undefined;
|
|
2310
|
-
if (thinkingOptionId ===
|
|
2311
|
+
if (thinkingOptionId === CLAUDE_ULTRACODE_THINKING_OPTION_ID) {
|
|
2311
2312
|
return { thinking: { type: "adaptive" }, effort: "xhigh", ultracode: true };
|
|
2312
2313
|
}
|
|
2313
2314
|
if (thinkingOptionId && isClaudeThinkingEffort(thinkingOptionId)) {
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
"claude-opus-4-8",
|
|
3
|
-
"claude-opus-4-7",
|
|
4
|
-
"claude-opus-4-6",
|
|
5
|
-
];
|
|
1
|
+
import { claudeManifestModelSupportsFastMode } from "./model-manifest.js";
|
|
6
2
|
export const CLAUDE_FAST_MODE_FEATURE = {
|
|
7
3
|
type: "toggle",
|
|
8
4
|
id: "fast_mode",
|
|
@@ -11,16 +7,8 @@ export const CLAUDE_FAST_MODE_FEATURE = {
|
|
|
11
7
|
tooltip: "Toggle fast mode",
|
|
12
8
|
icon: "zap",
|
|
13
9
|
};
|
|
14
|
-
function normalizeClaudeModelId(modelId) {
|
|
15
|
-
const normalized = typeof modelId === "string" ? modelId.trim() : "";
|
|
16
|
-
return normalized.length > 0 ? normalized : null;
|
|
17
|
-
}
|
|
18
10
|
export function claudeModelSupportsFastMode(modelId) {
|
|
19
|
-
|
|
20
|
-
if (!normalizedModelId) {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
return CLAUDE_FAST_MODE_SUPPORTED_MODEL_PREFIXES.some((prefix) => normalizedModelId === prefix || normalizedModelId.startsWith(`${prefix}[`));
|
|
11
|
+
return claudeManifestModelSupportsFastMode(modelId);
|
|
24
12
|
}
|
|
25
13
|
export function buildClaudeFeatures(input) {
|
|
26
14
|
if (!claudeModelSupportsFastMode(input.modelId)) {
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { AgentModelDefinition } from "../../agent-sdk-types.js";
|
|
2
|
+
export declare const CLAUDE_ULTRACODE_THINKING_OPTION_ID = "ultracode";
|
|
3
|
+
export declare const CLAUDE_MODEL_MANIFEST: readonly [{
|
|
4
|
+
readonly id: "claude-fable-5";
|
|
5
|
+
readonly label: "Fable 5";
|
|
6
|
+
readonly description: "Fable 5 · Most powerful model";
|
|
7
|
+
readonly contextWindowMaxTokens: 1000000;
|
|
8
|
+
readonly effortLevels: readonly ["low", "medium", "high", "xhigh", "max"];
|
|
9
|
+
}, {
|
|
10
|
+
readonly id: "claude-opus-4-8[1m]";
|
|
11
|
+
readonly label: "Opus 4.8 1M";
|
|
12
|
+
readonly description: "Opus 4.8 with 1M context window";
|
|
13
|
+
readonly contextWindowMaxTokens: 1000000;
|
|
14
|
+
readonly effortLevels: readonly ["low", "medium", "high", "xhigh", "max"];
|
|
15
|
+
readonly supportsFastMode: true;
|
|
16
|
+
}, {
|
|
17
|
+
readonly id: "claude-opus-4-8";
|
|
18
|
+
readonly label: "Opus 4.8";
|
|
19
|
+
readonly description: "Opus 4.8 · Latest release";
|
|
20
|
+
readonly isDefault: true;
|
|
21
|
+
readonly contextWindowMaxTokens: 200000;
|
|
22
|
+
readonly effortLevels: readonly ["low", "medium", "high", "xhigh", "max"];
|
|
23
|
+
readonly supportsFastMode: true;
|
|
24
|
+
}, {
|
|
25
|
+
readonly id: "claude-sonnet-5";
|
|
26
|
+
readonly label: "Sonnet 5";
|
|
27
|
+
readonly description: "Sonnet 5 · Best for everyday tasks";
|
|
28
|
+
readonly contextWindowMaxTokens: 1000000;
|
|
29
|
+
readonly effortLevels: readonly ["low", "medium", "high", "xhigh", "max"];
|
|
30
|
+
}, {
|
|
31
|
+
readonly id: "claude-opus-4-7[1m]";
|
|
32
|
+
readonly label: "Opus 4.7 1M";
|
|
33
|
+
readonly description: "Opus 4.7 with 1M context window";
|
|
34
|
+
readonly contextWindowMaxTokens: 1000000;
|
|
35
|
+
readonly effortLevels: readonly ["low", "medium", "high", "xhigh", "max"];
|
|
36
|
+
readonly supportsFastMode: true;
|
|
37
|
+
}, {
|
|
38
|
+
readonly id: "claude-opus-4-7";
|
|
39
|
+
readonly label: "Opus 4.7";
|
|
40
|
+
readonly description: "Opus 4.7 · Previous release";
|
|
41
|
+
readonly contextWindowMaxTokens: 200000;
|
|
42
|
+
readonly effortLevels: readonly ["low", "medium", "high", "xhigh", "max"];
|
|
43
|
+
readonly supportsFastMode: true;
|
|
44
|
+
}, {
|
|
45
|
+
readonly id: "claude-opus-4-6[1m]";
|
|
46
|
+
readonly label: "Opus 4.6 1M";
|
|
47
|
+
readonly description: "Opus 4.6 with 1M context window";
|
|
48
|
+
readonly contextWindowMaxTokens: 1000000;
|
|
49
|
+
readonly effortLevels: readonly ["low", "medium", "high", "max"];
|
|
50
|
+
readonly supportsFastMode: true;
|
|
51
|
+
}, {
|
|
52
|
+
readonly id: "claude-opus-4-6";
|
|
53
|
+
readonly label: "Opus 4.6";
|
|
54
|
+
readonly description: "Opus 4.6 · Most capable for complex work";
|
|
55
|
+
readonly contextWindowMaxTokens: 200000;
|
|
56
|
+
readonly effortLevels: readonly ["low", "medium", "high", "max"];
|
|
57
|
+
readonly supportsFastMode: true;
|
|
58
|
+
}, {
|
|
59
|
+
readonly id: "claude-sonnet-4-6[1m]";
|
|
60
|
+
readonly label: "Sonnet 4.6 1M";
|
|
61
|
+
readonly description: "Sonnet 4.6 with 1M context window";
|
|
62
|
+
readonly contextWindowMaxTokens: 1000000;
|
|
63
|
+
readonly effortLevels: readonly ["low", "medium", "high", "max"];
|
|
64
|
+
}, {
|
|
65
|
+
readonly id: "claude-sonnet-4-6";
|
|
66
|
+
readonly label: "Sonnet 4.6";
|
|
67
|
+
readonly description: "Sonnet 4.6 · Best for everyday tasks";
|
|
68
|
+
readonly contextWindowMaxTokens: 200000;
|
|
69
|
+
readonly effortLevels: readonly ["low", "medium", "high", "max"];
|
|
70
|
+
}, {
|
|
71
|
+
readonly id: "claude-haiku-4-5";
|
|
72
|
+
readonly label: "Haiku 4.5";
|
|
73
|
+
readonly description: "Haiku 4.5 · Fastest for quick answers";
|
|
74
|
+
readonly contextWindowMaxTokens: 200000;
|
|
75
|
+
}];
|
|
76
|
+
export declare function getClaudeManifestModels(): AgentModelDefinition[];
|
|
77
|
+
export declare function isClaudeManifestModelId(modelId: string): boolean;
|
|
78
|
+
export declare function claudeManifestModelSupportsFastMode(modelId: string | null | undefined): boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Normalize first-party Claude model IDs for manifest capability checks. Provider-prefixed
|
|
81
|
+
* runtime IDs intentionally use normalizeClaudeRuntimeModelId instead.
|
|
82
|
+
*/
|
|
83
|
+
export declare function normalizeClaudeManifestModelId(value: string | null | undefined): string | null;
|
|
84
|
+
/**
|
|
85
|
+
* Normalize a Claude Code runtime/config model string to a known manifest ID.
|
|
86
|
+
* Runtime metadata may include provider prefixes such as Bedrock model IDs; feature
|
|
87
|
+
* gates should use normalizeClaudeManifestModelId instead.
|
|
88
|
+
*/
|
|
89
|
+
export declare function normalizeClaudeRuntimeModelId(value: string | null | undefined): string | null;
|
|
90
|
+
//# sourceMappingURL=model-manifest.d.ts.map
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
const CLAUDE_EFFORT_LEVELS = {
|
|
2
|
+
standard: ["low", "medium", "high", "max"],
|
|
3
|
+
xhigh: ["low", "medium", "high", "xhigh", "max"],
|
|
4
|
+
};
|
|
5
|
+
const CLAUDE_EFFORT_LABELS = {
|
|
6
|
+
low: "Low",
|
|
7
|
+
medium: "Medium",
|
|
8
|
+
high: "High",
|
|
9
|
+
xhigh: "Extra High",
|
|
10
|
+
max: "Max",
|
|
11
|
+
};
|
|
12
|
+
export const CLAUDE_ULTRACODE_THINKING_OPTION_ID = "ultracode";
|
|
13
|
+
export const CLAUDE_MODEL_MANIFEST = [
|
|
14
|
+
{
|
|
15
|
+
id: "claude-fable-5",
|
|
16
|
+
label: "Fable 5",
|
|
17
|
+
description: "Fable 5 · Most powerful model",
|
|
18
|
+
contextWindowMaxTokens: 1000000,
|
|
19
|
+
effortLevels: CLAUDE_EFFORT_LEVELS.xhigh,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: "claude-opus-4-8[1m]",
|
|
23
|
+
label: "Opus 4.8 1M",
|
|
24
|
+
description: "Opus 4.8 with 1M context window",
|
|
25
|
+
contextWindowMaxTokens: 1000000,
|
|
26
|
+
effortLevels: CLAUDE_EFFORT_LEVELS.xhigh,
|
|
27
|
+
supportsFastMode: true,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: "claude-opus-4-8",
|
|
31
|
+
label: "Opus 4.8",
|
|
32
|
+
description: "Opus 4.8 · Latest release",
|
|
33
|
+
isDefault: true,
|
|
34
|
+
contextWindowMaxTokens: 200000,
|
|
35
|
+
effortLevels: CLAUDE_EFFORT_LEVELS.xhigh,
|
|
36
|
+
supportsFastMode: true,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: "claude-sonnet-5",
|
|
40
|
+
label: "Sonnet 5",
|
|
41
|
+
description: "Sonnet 5 · Best for everyday tasks",
|
|
42
|
+
contextWindowMaxTokens: 1000000,
|
|
43
|
+
effortLevels: CLAUDE_EFFORT_LEVELS.xhigh,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: "claude-opus-4-7[1m]",
|
|
47
|
+
label: "Opus 4.7 1M",
|
|
48
|
+
description: "Opus 4.7 with 1M context window",
|
|
49
|
+
contextWindowMaxTokens: 1000000,
|
|
50
|
+
effortLevels: CLAUDE_EFFORT_LEVELS.xhigh,
|
|
51
|
+
supportsFastMode: true,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: "claude-opus-4-7",
|
|
55
|
+
label: "Opus 4.7",
|
|
56
|
+
description: "Opus 4.7 · Previous release",
|
|
57
|
+
contextWindowMaxTokens: 200000,
|
|
58
|
+
effortLevels: CLAUDE_EFFORT_LEVELS.xhigh,
|
|
59
|
+
supportsFastMode: true,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
id: "claude-opus-4-6[1m]",
|
|
63
|
+
label: "Opus 4.6 1M",
|
|
64
|
+
description: "Opus 4.6 with 1M context window",
|
|
65
|
+
contextWindowMaxTokens: 1000000,
|
|
66
|
+
effortLevels: CLAUDE_EFFORT_LEVELS.standard,
|
|
67
|
+
supportsFastMode: true,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
id: "claude-opus-4-6",
|
|
71
|
+
label: "Opus 4.6",
|
|
72
|
+
description: "Opus 4.6 · Most capable for complex work",
|
|
73
|
+
contextWindowMaxTokens: 200000,
|
|
74
|
+
effortLevels: CLAUDE_EFFORT_LEVELS.standard,
|
|
75
|
+
supportsFastMode: true,
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
id: "claude-sonnet-4-6[1m]",
|
|
79
|
+
label: "Sonnet 4.6 1M",
|
|
80
|
+
description: "Sonnet 4.6 with 1M context window",
|
|
81
|
+
contextWindowMaxTokens: 1000000,
|
|
82
|
+
effortLevels: CLAUDE_EFFORT_LEVELS.standard,
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
id: "claude-sonnet-4-6",
|
|
86
|
+
label: "Sonnet 4.6",
|
|
87
|
+
description: "Sonnet 4.6 · Best for everyday tasks",
|
|
88
|
+
contextWindowMaxTokens: 200000,
|
|
89
|
+
effortLevels: CLAUDE_EFFORT_LEVELS.standard,
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
id: "claude-haiku-4-5",
|
|
93
|
+
label: "Haiku 4.5",
|
|
94
|
+
description: "Haiku 4.5 · Fastest for quick answers",
|
|
95
|
+
contextWindowMaxTokens: 200000,
|
|
96
|
+
},
|
|
97
|
+
];
|
|
98
|
+
function buildThinkingOptions(effortLevels) {
|
|
99
|
+
if (!effortLevels) {
|
|
100
|
+
return undefined;
|
|
101
|
+
}
|
|
102
|
+
const options = effortLevels.map((id) => ({
|
|
103
|
+
id,
|
|
104
|
+
label: CLAUDE_EFFORT_LABELS[id],
|
|
105
|
+
}));
|
|
106
|
+
if (effortLevels.includes("xhigh")) {
|
|
107
|
+
options.push({ id: CLAUDE_ULTRACODE_THINKING_OPTION_ID, label: "Ultra Code" });
|
|
108
|
+
}
|
|
109
|
+
return options;
|
|
110
|
+
}
|
|
111
|
+
export function getClaudeManifestModels() {
|
|
112
|
+
return CLAUDE_MODEL_MANIFEST.map((model) => {
|
|
113
|
+
const thinkingOptions = buildThinkingOptions("effortLevels" in model ? model.effortLevels : undefined);
|
|
114
|
+
return {
|
|
115
|
+
provider: "claude",
|
|
116
|
+
id: model.id,
|
|
117
|
+
label: model.label,
|
|
118
|
+
description: model.description,
|
|
119
|
+
...("isDefault" in model && model.isDefault ? { isDefault: true } : {}),
|
|
120
|
+
...(model.contextWindowMaxTokens !== undefined
|
|
121
|
+
? { contextWindowMaxTokens: model.contextWindowMaxTokens }
|
|
122
|
+
: {}),
|
|
123
|
+
...(thinkingOptions ? { thinkingOptions } : {}),
|
|
124
|
+
};
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
export function isClaudeManifestModelId(modelId) {
|
|
128
|
+
return CLAUDE_MODEL_MANIFEST.some((model) => model.id === modelId);
|
|
129
|
+
}
|
|
130
|
+
export function claudeManifestModelSupportsFastMode(modelId) {
|
|
131
|
+
const normalizedModelId = normalizeClaudeManifestModelId(modelId);
|
|
132
|
+
if (!normalizedModelId) {
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
return CLAUDE_MODEL_MANIFEST.some((model) => model.id === normalizedModelId &&
|
|
136
|
+
"supportsFastMode" in model &&
|
|
137
|
+
model.supportsFastMode === true);
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Normalize first-party Claude model IDs for manifest capability checks. Provider-prefixed
|
|
141
|
+
* runtime IDs intentionally use normalizeClaudeRuntimeModelId instead.
|
|
142
|
+
*/
|
|
143
|
+
export function normalizeClaudeManifestModelId(value) {
|
|
144
|
+
const trimmed = typeof value === "string" ? value.trim() : "";
|
|
145
|
+
if (!trimmed) {
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
if (isClaudeManifestModelId(trimmed)) {
|
|
149
|
+
return trimmed;
|
|
150
|
+
}
|
|
151
|
+
const singleSegmentMatch = trimmed.match(/^(?:claude[-_ ])?(fable|opus|sonnet|haiku)[-_ ]+(\d+)(\[1m\])?(?:[-_ ]+\d{8})?$/i);
|
|
152
|
+
if (singleSegmentMatch) {
|
|
153
|
+
return normalizeSingleSegmentClaudeModelId(singleSegmentMatch[1], singleSegmentMatch[2], trimmed.toLowerCase().includes("[1m]"));
|
|
154
|
+
}
|
|
155
|
+
const runtimeMatch = trimmed.match(/^(?:claude[-_ ])?(opus|sonnet|haiku)[-_ ]+(\d+)[-.](\d+)(\[1m\])?(?:[-_ ]+\d{8})?$/i);
|
|
156
|
+
if (!runtimeMatch) {
|
|
157
|
+
return null;
|
|
158
|
+
}
|
|
159
|
+
return normalizeMajorMinorClaudeModelId(runtimeMatch[1], runtimeMatch[2], runtimeMatch[3], Boolean(runtimeMatch[4]));
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Normalize a Claude Code runtime/config model string to a known manifest ID.
|
|
163
|
+
* Runtime metadata may include provider prefixes such as Bedrock model IDs; feature
|
|
164
|
+
* gates should use normalizeClaudeManifestModelId instead.
|
|
165
|
+
*/
|
|
166
|
+
export function normalizeClaudeRuntimeModelId(value) {
|
|
167
|
+
const normalizedManifestModelId = normalizeClaudeManifestModelId(value);
|
|
168
|
+
if (normalizedManifestModelId) {
|
|
169
|
+
return normalizedManifestModelId;
|
|
170
|
+
}
|
|
171
|
+
const trimmed = typeof value === "string" ? value.trim() : "";
|
|
172
|
+
if (!trimmed) {
|
|
173
|
+
return null;
|
|
174
|
+
}
|
|
175
|
+
const singleSegmentMatch = trimmed.match(/claude[-_ ](fable|opus|sonnet|haiku)[-_ ]+(\d+)(\[1m\])?/i);
|
|
176
|
+
if (singleSegmentMatch) {
|
|
177
|
+
const normalizedModelId = normalizeSingleSegmentClaudeModelId(singleSegmentMatch[1], singleSegmentMatch[2], Boolean(singleSegmentMatch[3]));
|
|
178
|
+
if (normalizedModelId) {
|
|
179
|
+
return normalizedModelId;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
const runtimeMatch = trimmed.match(/claude[-_ ](opus|sonnet|haiku)[-_ ]+(\d+)[-.](\d+)(\[1m\])?/i);
|
|
183
|
+
if (!runtimeMatch) {
|
|
184
|
+
return null;
|
|
185
|
+
}
|
|
186
|
+
return normalizeMajorMinorClaudeModelId(runtimeMatch[1], runtimeMatch[2], runtimeMatch[3], Boolean(runtimeMatch[4]));
|
|
187
|
+
}
|
|
188
|
+
function normalizeSingleSegmentClaudeModelId(familyValue, major, hasOneMillionContext) {
|
|
189
|
+
const family = familyValue.toLowerCase();
|
|
190
|
+
const suffix = hasOneMillionContext ? "[1m]" : "";
|
|
191
|
+
const candidates = [`claude-${family}-${major}${suffix}`, `claude-${family}-${major}`];
|
|
192
|
+
for (const candidate of candidates) {
|
|
193
|
+
if (isClaudeManifestModelId(candidate)) {
|
|
194
|
+
return candidate;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
return null;
|
|
198
|
+
}
|
|
199
|
+
function normalizeMajorMinorClaudeModelId(familyValue, major, minor, hasOneMillionContext) {
|
|
200
|
+
const family = familyValue.toLowerCase();
|
|
201
|
+
const suffix = hasOneMillionContext ? "[1m]" : "";
|
|
202
|
+
const candidate = `claude-${family}-${major}-${minor}${suffix}`;
|
|
203
|
+
return isClaudeManifestModelId(candidate) ? candidate : null;
|
|
204
|
+
}
|
|
205
|
+
//# sourceMappingURL=model-manifest.js.map
|
|
@@ -1,113 +1,7 @@
|
|
|
1
1
|
import * as fs from "node:fs/promises";
|
|
2
2
|
import * as os from "node:os";
|
|
3
3
|
import * as path from "node:path";
|
|
4
|
-
|
|
5
|
-
{ id: "low", label: "Low" },
|
|
6
|
-
{ id: "medium", label: "Medium" },
|
|
7
|
-
{ id: "high", label: "High" },
|
|
8
|
-
{ id: "max", label: "Max" },
|
|
9
|
-
];
|
|
10
|
-
const CLAUDE_EXTENDED_THINKING_OPTIONS = [
|
|
11
|
-
{ id: "low", label: "Low" },
|
|
12
|
-
{ id: "medium", label: "Medium" },
|
|
13
|
-
{ id: "high", label: "High" },
|
|
14
|
-
{ id: "xhigh", label: "Extra High" },
|
|
15
|
-
{ id: "max", label: "Max" },
|
|
16
|
-
];
|
|
17
|
-
const CLAUDE_ULTRACODE_THINKING_OPTIONS = [
|
|
18
|
-
...CLAUDE_EXTENDED_THINKING_OPTIONS,
|
|
19
|
-
{ id: "ultracode", label: "Ultracode" },
|
|
20
|
-
];
|
|
21
|
-
const CLAUDE_MODELS = [
|
|
22
|
-
{
|
|
23
|
-
provider: "claude",
|
|
24
|
-
id: "claude-fable-5",
|
|
25
|
-
label: "Fable 5",
|
|
26
|
-
description: "Fable 5 · Most powerful model",
|
|
27
|
-
contextWindowMaxTokens: 1000000,
|
|
28
|
-
thinkingOptions: [...CLAUDE_ULTRACODE_THINKING_OPTIONS],
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
provider: "claude",
|
|
32
|
-
id: "claude-opus-4-8[1m]",
|
|
33
|
-
label: "Opus 4.8 1M",
|
|
34
|
-
description: "Opus 4.8 with 1M context window",
|
|
35
|
-
contextWindowMaxTokens: 1000000,
|
|
36
|
-
thinkingOptions: [...CLAUDE_ULTRACODE_THINKING_OPTIONS],
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
provider: "claude",
|
|
40
|
-
id: "claude-opus-4-8",
|
|
41
|
-
label: "Opus 4.8",
|
|
42
|
-
description: "Opus 4.8 · Latest release",
|
|
43
|
-
isDefault: true,
|
|
44
|
-
contextWindowMaxTokens: 200000,
|
|
45
|
-
thinkingOptions: [...CLAUDE_ULTRACODE_THINKING_OPTIONS],
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
provider: "claude",
|
|
49
|
-
id: "claude-sonnet-5",
|
|
50
|
-
label: "Sonnet 5",
|
|
51
|
-
description: "Sonnet 5 · Best for everyday tasks",
|
|
52
|
-
contextWindowMaxTokens: 1000000,
|
|
53
|
-
thinkingOptions: [...CLAUDE_EXTENDED_THINKING_OPTIONS],
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
provider: "claude",
|
|
57
|
-
id: "claude-opus-4-7[1m]",
|
|
58
|
-
label: "Opus 4.7 1M",
|
|
59
|
-
description: "Opus 4.7 with 1M context window",
|
|
60
|
-
contextWindowMaxTokens: 1000000,
|
|
61
|
-
thinkingOptions: [...CLAUDE_EXTENDED_THINKING_OPTIONS],
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
provider: "claude",
|
|
65
|
-
id: "claude-opus-4-7",
|
|
66
|
-
label: "Opus 4.7",
|
|
67
|
-
description: "Opus 4.7 · Previous release",
|
|
68
|
-
contextWindowMaxTokens: 200000,
|
|
69
|
-
thinkingOptions: [...CLAUDE_EXTENDED_THINKING_OPTIONS],
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
provider: "claude",
|
|
73
|
-
id: "claude-opus-4-6[1m]",
|
|
74
|
-
label: "Opus 4.6 1M",
|
|
75
|
-
description: "Opus 4.6 with 1M context window",
|
|
76
|
-
contextWindowMaxTokens: 1000000,
|
|
77
|
-
thinkingOptions: [...CLAUDE_THINKING_OPTIONS],
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
provider: "claude",
|
|
81
|
-
id: "claude-opus-4-6",
|
|
82
|
-
label: "Opus 4.6",
|
|
83
|
-
description: "Opus 4.6 · Most capable for complex work",
|
|
84
|
-
contextWindowMaxTokens: 200000,
|
|
85
|
-
thinkingOptions: [...CLAUDE_THINKING_OPTIONS],
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
provider: "claude",
|
|
89
|
-
id: "claude-sonnet-4-6[1m]",
|
|
90
|
-
label: "Sonnet 4.6 1M",
|
|
91
|
-
description: "Sonnet 4.6 with 1M context window",
|
|
92
|
-
contextWindowMaxTokens: 1000000,
|
|
93
|
-
thinkingOptions: [...CLAUDE_THINKING_OPTIONS],
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
provider: "claude",
|
|
97
|
-
id: "claude-sonnet-4-6",
|
|
98
|
-
label: "Sonnet 4.6",
|
|
99
|
-
description: "Sonnet 4.6 · Best for everyday tasks",
|
|
100
|
-
contextWindowMaxTokens: 200000,
|
|
101
|
-
thinkingOptions: [...CLAUDE_THINKING_OPTIONS],
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
provider: "claude",
|
|
105
|
-
id: "claude-haiku-4-5",
|
|
106
|
-
label: "Haiku 4.5",
|
|
107
|
-
description: "Haiku 4.5 · Fastest for quick answers",
|
|
108
|
-
contextWindowMaxTokens: 200000,
|
|
109
|
-
},
|
|
110
|
-
];
|
|
4
|
+
import { getClaudeManifestModels, normalizeClaudeRuntimeModelId as normalizeClaudeManifestRuntimeModelId, } from "./model-manifest.js";
|
|
111
5
|
const CLAUDE_SETTINGS_MODEL_ENV_KEYS = [
|
|
112
6
|
"ANTHROPIC_MODEL",
|
|
113
7
|
"ANTHROPIC_SMALL_FAST_MODEL",
|
|
@@ -116,14 +10,14 @@ const CLAUDE_SETTINGS_MODEL_ENV_KEYS = [
|
|
|
116
10
|
"ANTHROPIC_DEFAULT_HAIKU_MODEL",
|
|
117
11
|
];
|
|
118
12
|
export function getClaudeModels() {
|
|
119
|
-
return
|
|
13
|
+
return getClaudeManifestModels();
|
|
120
14
|
}
|
|
121
15
|
export function findClaudeModel(modelId) {
|
|
122
16
|
const normalizedModelId = normalizeClaudeRuntimeModelId(modelId);
|
|
123
17
|
if (!normalizedModelId) {
|
|
124
18
|
return undefined;
|
|
125
19
|
}
|
|
126
|
-
return
|
|
20
|
+
return getClaudeModels().find((model) => model.id === normalizedModelId);
|
|
127
21
|
}
|
|
128
22
|
export async function getClaudeModelsWithSettings(logger, configDir) {
|
|
129
23
|
const hardcodedModels = getClaudeModels();
|
|
@@ -198,37 +92,6 @@ function isRecord(value) {
|
|
|
198
92
|
* Handles the `[1m]` suffix that the SDK appends for 1M context sessions.
|
|
199
93
|
*/
|
|
200
94
|
export function normalizeClaudeRuntimeModelId(value) {
|
|
201
|
-
|
|
202
|
-
if (!trimmed) {
|
|
203
|
-
return null;
|
|
204
|
-
}
|
|
205
|
-
// Check for exact match first (handles claude-opus-4-6[1m] directly)
|
|
206
|
-
if (CLAUDE_MODELS.some((model) => model.id === trimmed)) {
|
|
207
|
-
return trimmed;
|
|
208
|
-
}
|
|
209
|
-
// Match single-segment major-version model names such as claude-fable-5
|
|
210
|
-
// and claude-sonnet-5, including dated runtime strings from the SDK.
|
|
211
|
-
const singleSegmentMatch = trimmed.match(/(?:claude-)?(fable|opus|sonnet|haiku)[-_ ]+(\d+)/i);
|
|
212
|
-
if (singleSegmentMatch) {
|
|
213
|
-
const family = singleSegmentMatch[1].toLowerCase();
|
|
214
|
-
const major = singleSegmentMatch[2];
|
|
215
|
-
const suffix = trimmed.toLowerCase().includes("[1m]") ? "[1m]" : "";
|
|
216
|
-
const candidates = [`claude-${family}-${major}${suffix}`, `claude-${family}-${major}`];
|
|
217
|
-
for (const candidate of candidates) {
|
|
218
|
-
if (CLAUDE_MODELS.some((model) => model.id === candidate)) {
|
|
219
|
-
return candidate;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
// Match: claude-{family}-{major}-{minor}[1m]? possibly followed by a date suffix
|
|
224
|
-
const runtimeMatch = trimmed.match(/(?:claude-)?(opus|sonnet|haiku)[-_ ]+(\d+)[-.](\d+)(\[1m\])?/i);
|
|
225
|
-
if (!runtimeMatch) {
|
|
226
|
-
return null;
|
|
227
|
-
}
|
|
228
|
-
const family = runtimeMatch[1].toLowerCase();
|
|
229
|
-
const major = runtimeMatch[2];
|
|
230
|
-
const minor = runtimeMatch[3];
|
|
231
|
-
const suffix = runtimeMatch[4] ?? "";
|
|
232
|
-
return `claude-${family}-${major}-${minor}${suffix}`;
|
|
95
|
+
return normalizeClaudeManifestRuntimeModelId(value);
|
|
233
96
|
}
|
|
234
97
|
//# sourceMappingURL=models.js.map
|
|
@@ -3,12 +3,14 @@ import type { AgentManager } from "../agent-manager.js";
|
|
|
3
3
|
import type { AgentStorage } from "../agent-storage.js";
|
|
4
4
|
import { type ArchiveDependencies } from "../../workspace-archive-service.js";
|
|
5
5
|
import type { VoiceCallerContext, VoiceSpeakHandler } from "../../voice-types.js";
|
|
6
|
+
import type { FirstAgentContext } from "../../messages.js";
|
|
6
7
|
import type { TerminalManager } from "../../../terminal/terminal-manager.js";
|
|
7
8
|
import type { CreatePaseoWorktreeWorkflowFn } from "../../worktree-session.js";
|
|
8
9
|
import type { ScheduleService } from "../../schedule/service.js";
|
|
9
10
|
import type { ProviderSnapshotManager } from "../provider-snapshot-manager.js";
|
|
10
11
|
import type { GitHubService } from "../../../services/github-service.js";
|
|
11
12
|
import type { WorkspaceGitService } from "../../workspace-git-service.js";
|
|
13
|
+
import type { WorkspaceRegistry } from "../../workspace-registry.js";
|
|
12
14
|
import type { BrowserToolsBroker } from "../../browser-tools/broker.js";
|
|
13
15
|
import type { PaseoToolCatalog } from "./types.js";
|
|
14
16
|
export interface PaseoToolHostDependencies {
|
|
@@ -24,10 +26,11 @@ export interface PaseoToolHostDependencies {
|
|
|
24
26
|
listActiveWorkspaces?: ArchiveDependencies["listActiveWorkspaces"];
|
|
25
27
|
archiveWorkspaceRecord?: ArchiveDependencies["archiveWorkspaceRecord"];
|
|
26
28
|
emitWorkspaceUpdatesForWorkspaceIds?: ArchiveDependencies["emitWorkspaceUpdatesForWorkspaceIds"];
|
|
29
|
+
workspaceRegistry?: Pick<WorkspaceRegistry, "get" | "upsert">;
|
|
27
30
|
markWorkspaceArchiving?: ArchiveDependencies["markWorkspaceArchiving"];
|
|
28
31
|
clearWorkspaceArchiving?: ArchiveDependencies["clearWorkspaceArchiving"];
|
|
29
32
|
createPaseoWorktree?: CreatePaseoWorktreeWorkflowFn;
|
|
30
|
-
ensureWorkspaceForCreate?: (cwd: string) => Promise<string>;
|
|
33
|
+
ensureWorkspaceForCreate?: (cwd: string, firstAgentContext?: FirstAgentContext) => Promise<string>;
|
|
31
34
|
browserToolsBroker?: BrowserToolsBroker | null;
|
|
32
35
|
paseoHome?: string;
|
|
33
36
|
worktreesRoot?: string;
|