@agentprojectcontext/apx 1.65.3 → 1.66.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/package.json +1 -1
- package/src/core/config/index.js +1 -1
- package/src/core/engines/presets.js +102 -0
- package/src/host/daemon/api/engines.js +6 -0
- package/src/interfaces/cli/commands/setup.js +6 -3
- package/src/interfaces/web/dist/assets/{index-CFcs16SV.js → index-YmMRG--4.js} +134 -134
- package/src/interfaces/web/dist/assets/index-YmMRG--4.js.map +1 -0
- package/src/interfaces/web/dist/index.html +1 -1
- package/src/interfaces/web/src/components/settings/providers/typeStyles.ts +44 -25
- package/src/interfaces/web/src/lib/api/engines.ts +14 -0
- package/src/interfaces/web/src/main.tsx +5 -0
- package/src/interfaces/web/dist/assets/index-CFcs16SV.js.map +0 -1
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
<link rel="apple-touch-icon" href="/favicon/dark/apple-touch-icon.png" media="(prefers-color-scheme: dark)" />
|
|
19
19
|
<link rel="manifest" href="/favicon/white/site.webmanifest" media="(prefers-color-scheme: light)" />
|
|
20
20
|
<link rel="manifest" href="/favicon/dark/site.webmanifest" media="(prefers-color-scheme: dark)" />
|
|
21
|
-
<script type="module" crossorigin src="/assets/index-
|
|
21
|
+
<script type="module" crossorigin src="/assets/index-YmMRG--4.js"></script>
|
|
22
22
|
<link rel="stylesheet" crossorigin href="/assets/index-BuII-tAi.css">
|
|
23
23
|
</head>
|
|
24
24
|
<body class="bg-background text-foreground antialiased">
|
|
@@ -65,6 +65,11 @@ export const ENGINE_ICONS: Record<EngineType, LucideIcon> = {
|
|
|
65
65
|
// Sensible defaults per engine so the form auto-fills base_url, suggests
|
|
66
66
|
// models, and hints the api-key env var. base_url "" = adapter has a built-in
|
|
67
67
|
// default (e.g. Anthropic SDK).
|
|
68
|
+
//
|
|
69
|
+
// NOTE: the values below are only an OFFLINE FALLBACK. The source of truth is
|
|
70
|
+
// src/core/engines/presets.js, served by `GET /engines/presets`. Call
|
|
71
|
+
// `loadEnginePresets()` once at app boot to hydrate this object in place so the
|
|
72
|
+
// model lists stay in sync with the CLI wizard and never drift.
|
|
68
73
|
export interface EnginePreset {
|
|
69
74
|
base_url: string;
|
|
70
75
|
default_model: string;
|
|
@@ -73,34 +78,32 @@ export interface EnginePreset {
|
|
|
73
78
|
}
|
|
74
79
|
|
|
75
80
|
export const ENGINE_PRESETS: Record<EngineType, EnginePreset> = {
|
|
81
|
+
// Keep these in sync with src/core/engines/presets.js. They are the offline
|
|
82
|
+
// fallback only — loadEnginePresets() overrides them from the daemon at boot.
|
|
76
83
|
anthropic: {
|
|
77
84
|
base_url: "",
|
|
78
|
-
default_model: "claude-sonnet-
|
|
85
|
+
default_model: "claude-sonnet-5",
|
|
79
86
|
api_key_env: "ANTHROPIC_API_KEY",
|
|
80
87
|
known_models: [
|
|
81
|
-
"claude-opus-4
|
|
82
|
-
"claude-
|
|
83
|
-
"claude-
|
|
84
|
-
"claude-
|
|
85
|
-
"claude-sonnet-4.5",
|
|
86
|
-
"claude-haiku-4.5",
|
|
88
|
+
"claude-opus-4-8",
|
|
89
|
+
"claude-sonnet-5",
|
|
90
|
+
"claude-haiku-4-5",
|
|
91
|
+
"claude-fable-5",
|
|
87
92
|
],
|
|
88
93
|
},
|
|
89
94
|
openai: {
|
|
90
95
|
base_url: "https://api.openai.com/v1",
|
|
91
|
-
default_model: "gpt-
|
|
96
|
+
default_model: "gpt-5.4-mini",
|
|
92
97
|
api_key_env: "OPENAI_API_KEY",
|
|
93
|
-
known_models: ["gpt-
|
|
98
|
+
known_models: ["gpt-5.5", "gpt-5.4-mini", "gpt-5.4-nano", "gpt-5.1", "gpt-4.1-mini"],
|
|
94
99
|
},
|
|
95
100
|
gemini: {
|
|
96
101
|
base_url: "https://generativelanguage.googleapis.com/v1beta/openai",
|
|
97
102
|
default_model: "gemini-2.5-flash",
|
|
98
103
|
api_key_env: "GEMINI_API_KEY",
|
|
99
104
|
known_models: [
|
|
100
|
-
"gemini-3.5-pro",
|
|
101
105
|
"gemini-3.5-flash",
|
|
102
|
-
"gemini-3.1-pro",
|
|
103
|
-
"gemini-3.1-flash",
|
|
106
|
+
"gemini-3.1-pro-preview",
|
|
104
107
|
"gemini-2.5-pro",
|
|
105
108
|
"gemini-2.5-flash",
|
|
106
109
|
"gemini-2.5-flash-lite",
|
|
@@ -108,17 +111,14 @@ export const ENGINE_PRESETS: Record<EngineType, EnginePreset> = {
|
|
|
108
111
|
},
|
|
109
112
|
groq: {
|
|
110
113
|
base_url: "https://api.groq.com/openai/v1",
|
|
111
|
-
default_model: "
|
|
114
|
+
default_model: "openai/gpt-oss-20b",
|
|
112
115
|
api_key_env: "GROQ_API_KEY",
|
|
113
116
|
known_models: [
|
|
114
|
-
"llama-3.3-70b-versatile",
|
|
115
|
-
"llama-3.1-8b-instant",
|
|
116
|
-
"meta-llama/llama-4-scout-17b-16e-instruct",
|
|
117
117
|
"openai/gpt-oss-120b",
|
|
118
118
|
"openai/gpt-oss-20b",
|
|
119
|
+
"qwen/qwen3.6-27b",
|
|
119
120
|
"groq/compound",
|
|
120
121
|
"groq/compound-mini",
|
|
121
|
-
"qwen/qwen3-32b",
|
|
122
122
|
"whisper-large-v3-turbo",
|
|
123
123
|
],
|
|
124
124
|
},
|
|
@@ -130,12 +130,9 @@ export const ENGINE_PRESETS: Record<EngineType, EnginePreset> = {
|
|
|
130
130
|
known_models: [
|
|
131
131
|
"openrouter/auto",
|
|
132
132
|
"openrouter/free",
|
|
133
|
-
"
|
|
134
|
-
"
|
|
135
|
-
"google/gemini-2.
|
|
136
|
-
"qwen/qwen3-235b-a22b:free",
|
|
137
|
-
"anthropic/claude-sonnet-4.5",
|
|
138
|
-
"openai/gpt-4o-mini",
|
|
133
|
+
"anthropic/claude-sonnet-5",
|
|
134
|
+
"openai/gpt-5.4-mini",
|
|
135
|
+
"google/gemini-2.5-flash",
|
|
139
136
|
],
|
|
140
137
|
},
|
|
141
138
|
ollama: {
|
|
@@ -146,10 +143,32 @@ export const ENGINE_PRESETS: Record<EngineType, EnginePreset> = {
|
|
|
146
143
|
},
|
|
147
144
|
azure: {
|
|
148
145
|
base_url: "",
|
|
149
|
-
default_model: "
|
|
146
|
+
default_model: "",
|
|
150
147
|
api_key_env: "AZURE_OPENAI_API_KEY",
|
|
151
|
-
known_models: [
|
|
148
|
+
known_models: [],
|
|
152
149
|
},
|
|
153
150
|
mock: { base_url: "", default_model: "mock", api_key_env: "", known_models: ["mock"] },
|
|
154
151
|
custom: { base_url: "", default_model: "", api_key_env: "", known_models: [] },
|
|
155
152
|
};
|
|
153
|
+
|
|
154
|
+
// Hydrate ENGINE_PRESETS from the daemon's shared catalog (GET /engines/presets,
|
|
155
|
+
// backed by src/core/engines/presets.js). Mutates the object in place so every
|
|
156
|
+
// consumer that reads ENGINE_PRESETS[engine] lazily (form handlers, model
|
|
157
|
+
// dropdowns) picks up the fresh lists. Best-effort: on failure we keep the
|
|
158
|
+
// baked-in fallback above. Call once at app boot.
|
|
159
|
+
let presetsLoaded = false;
|
|
160
|
+
export async function loadEnginePresets(): Promise<void> {
|
|
161
|
+
if (presetsLoaded) return;
|
|
162
|
+
try {
|
|
163
|
+
const { Engines } = await import("../../../lib/api/engines");
|
|
164
|
+
const { presets } = await Engines.presets();
|
|
165
|
+
for (const [engine, preset] of Object.entries(presets || {})) {
|
|
166
|
+
if (engine in ENGINE_PRESETS && preset) {
|
|
167
|
+
Object.assign(ENGINE_PRESETS[engine as EngineType], preset);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
presetsLoaded = true;
|
|
171
|
+
} catch {
|
|
172
|
+
// Daemon unreachable or old build without the endpoint — keep the fallback.
|
|
173
|
+
}
|
|
174
|
+
}
|
|
@@ -8,8 +8,22 @@ export interface EngineModels {
|
|
|
8
8
|
error?: string;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
export interface EnginePreset {
|
|
12
|
+
base_url: string;
|
|
13
|
+
default_model: string;
|
|
14
|
+
api_key_env: string;
|
|
15
|
+
known_models: string[];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface EnginePresets {
|
|
19
|
+
presets: Record<string, EnginePreset>;
|
|
20
|
+
}
|
|
21
|
+
|
|
11
22
|
export const Engines = {
|
|
12
23
|
list: () => http.get<EngineSummary>("/engines"),
|
|
24
|
+
// Curated catalog (known models + defaults) shared with the CLI wizard. The
|
|
25
|
+
// source of truth is src/core/engines/presets.js.
|
|
26
|
+
presets: () => http.get<EnginePresets>("/engines/presets"),
|
|
13
27
|
// Live model catalog. api_key optional: falls back to the stored secret for
|
|
14
28
|
// the provider slug (so editing an existing provider works without retyping).
|
|
15
29
|
models: (body: { engine: string; slug?: string; base_url?: string; api_key?: string }) =>
|
|
@@ -4,6 +4,11 @@ import { BrowserRouter } from "react-router-dom";
|
|
|
4
4
|
import "./styles.css";
|
|
5
5
|
import { App } from "./App";
|
|
6
6
|
import { ThemeProvider } from "./hooks/useTheme";
|
|
7
|
+
import { loadEnginePresets } from "./components/settings/providers/typeStyles";
|
|
8
|
+
|
|
9
|
+
// Hydrate the shared model catalog (GET /engines/presets) in the background so
|
|
10
|
+
// provider forms show up-to-date model lists. Non-blocking: app renders anyway.
|
|
11
|
+
void loadEnginePresets();
|
|
7
12
|
|
|
8
13
|
ReactDOM.createRoot(document.getElementById("root")!).render(
|
|
9
14
|
<React.StrictMode>
|