@fased/fased 0.1.53 → 0.1.55
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/authenticated-model-catalog.js +27 -0
- package/dist/agents/current-model-catalog.js +30 -10
- package/dist/agents/model-catalog-normalized.js +1 -0
- package/dist/agents/model-catalog-source.js +4 -4
- package/dist/agents/model-forward-compat.js +19 -1
- package/dist/agents/model-metadata.js +37 -8
- package/dist/agents/pi-embedded-runner/agent-messages.js +15 -0
- package/dist/agents/pi-embedded-runner/compact.js +2 -1
- package/dist/agents/pi-embedded-runner/extra-params.js +25 -0
- package/dist/agents/pi-embedded-runner/model.js +2 -7
- package/dist/agents/pi-embedded-runner/run/attempt.js +4 -5
- package/dist/agents/pi-embedded-runner/utils.js +1 -1
- package/dist/brand.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/cli/program/register.agent.js +17 -0
- package/dist/cli/providers-cli.js +3 -2
- package/dist/commands/agents.commands.models.js +63 -0
- package/dist/commands/agents.js +1 -0
- package/dist/commands/auth-choice.apply.api-providers.js +3 -8
- package/dist/commands/auth-choice.apply.openai.js +13 -7
- package/dist/commands/auth-choice.model-check.js +1 -2
- package/dist/commands/configure.gateway-auth.js +14 -16
- package/dist/commands/model-picker.js +25 -7
- package/dist/commands/models/list.registry.js +13 -18
- package/dist/commands/onboard-auth.config-core.js +1 -1
- package/dist/commands/onboard-auth.config-litellm.js +21 -21
- package/dist/commands/onboard-auth.credentials.js +0 -1
- package/dist/commands/onboard-auth.js +0 -1
- package/dist/commands/openai-codex-model-default.js +26 -4
- package/dist/config/defaults.js +1 -1
- package/dist/config/zod-schema.agent-defaults.js +4 -2
- package/dist/config/zod-schema.agent-runtime.js +4 -2
- package/dist/config/zod-schema.core.js +4 -2
- package/dist/control-ui/assets/{app-WIDYwhr-.js → app-D2RaTXoV.js} +1788 -1755
- package/dist/control-ui/assets/chat-model-ref-BZFblCeY.js +2 -0
- package/dist/control-ui/assets/{index-K3ysLeTN.js → index-D2nC6I-9.js} +3 -3
- package/dist/control-ui/assets/{providers-rQMhp1fb.js → providers-CyjiG5Jw.js} +4 -4
- package/dist/control-ui/index.html +1 -1
- package/dist/control-ui/version.json +1 -0
- package/dist/cron/isolated-agent/run.js +9 -3
- package/dist/cron/normalize.js +10 -0
- package/dist/gateway/control-ui.js +2 -0
- package/dist/gateway/protocol/schema/agents-models-skills.js +6 -2
- package/dist/gateway/protocol/schema/cron.js +7 -0
- package/dist/gateway/server-methods/models.js +8 -9
- package/dist/gateway/server-model-catalog.js +3 -0
- package/dist/infra/update-runner.js +31 -3
- package/dist/light-update-status.js +10 -10
- package/dist/memory/inventory.js +19 -2
- package/dist/plugin-sdk/{accounts-BZrfqJmO.js → accounts-CeRNo5Ae.js} +1 -1
- package/dist/plugin-sdk/{actions-7_zTh8zC.js → actions-OMRHtXPj.js} +2 -2
- package/dist/plugin-sdk/{active-listener-D8NVRD8J.js → active-listener-BlIkS3iR.js} +1 -1
- package/dist/plugin-sdk/{audio-preflight-BrVWUkoP.js → audio-preflight-B2n3a2Tj.js} +26 -26
- package/dist/plugin-sdk/{audit-2iRlVyQF.js → audit-Ppg6dR_b.js} +1 -1
- package/dist/plugin-sdk/{channel-access-BCf1rJsn.js → channel-access-af8dWWRv.js} +1 -1
- package/dist/plugin-sdk/{channel-access-configure-B-Z51Qsd.js → channel-access-configure-B6IAGlE0.js} +1 -1
- package/dist/plugin-sdk/channel-plugin-common.d.ts +3 -3
- package/dist/plugin-sdk/channel-plugin-common.js +4 -4
- package/dist/plugin-sdk/{chunk-BREC9ijl.js → chunk-CD76Byie.js} +1 -1
- package/dist/plugin-sdk/{chunk-items-BLRCltGL.js → chunk-items-Bu19zrYH.js} +1 -1
- package/dist/plugin-sdk/command-status.d.ts +2 -2
- package/dist/plugin-sdk/command-status.js +26 -26
- package/dist/plugin-sdk/{commands-registry-D3-bFLsz.js → commands-registry-DgS55tNj.js} +2 -2
- package/dist/plugin-sdk/{common-BlqMqEqn.js → common-CWvfeiX0.js} +1 -1
- package/dist/plugin-sdk/{config-442EDe7Z.js → config-CYDETqcF.js} +130 -134
- package/dist/plugin-sdk/{config-schema-DV0zctd2.js → config-schema-CQ4EVcQG.js} +164 -78
- package/dist/plugin-sdk/device-pair.d.ts +1 -1
- package/dist/plugin-sdk/discord.d.ts +5 -5
- package/dist/plugin-sdk/discord.js +19 -19
- package/dist/plugin-sdk/{group-mentions-DLOOve8d.d.ts → group-mentions-BxDgHCgj.d.ts} +1 -1
- package/dist/plugin-sdk/{handle-action-pNaP87Dr.js → handle-action-B75UVKxF.js} +13 -13
- package/dist/plugin-sdk/{helpers-B994qqVW.js → helpers-BuEwju6y.js} +1 -1
- package/dist/plugin-sdk/{image-ops-Doq8nZQw.js → image-ops-C66HPeAZ.js} +1 -1
- package/dist/plugin-sdk/index.d.ts +8 -8
- package/dist/plugin-sdk/index.js +28 -28
- package/dist/plugin-sdk/{login-CK2zTIJA.js → login-Amr2DpKU.js} +3 -3
- package/dist/plugin-sdk/{login-qr-u8Mn1mCp.js → login-qr-DMQNEi9m.js} +3 -3
- package/dist/plugin-sdk/{manager-CeJNf2bH.js → manager-Bvpq49BI.js} +2 -2
- package/dist/plugin-sdk/{markdown-tables-DeZztrY6.js → markdown-tables-DmQ7oXOm.js} +1 -1
- package/dist/plugin-sdk/{media-CgUAEfhs.js → media-ByLQbEwJ.js} +2 -2
- package/dist/plugin-sdk/{monitor-CEtMJuFX.js → monitor-K_u6daGa.js} +30 -30
- package/dist/plugin-sdk/{monitor-D-APtCpn.js → monitor-S_7LrvSj.js} +31 -31
- package/dist/plugin-sdk/{openresponses-http-g1Iz0xB2.js → openresponses-http-BrDJUZXR.js} +26 -26
- package/dist/plugin-sdk/{optional-runtime-dependency-D0BdXz1C.js → optional-runtime-dependency-CbYjAC2b.js} +1 -1
- package/dist/plugin-sdk/{outbound-DXGuFrdx.js → outbound-BuDafBBI.js} +6 -6
- package/dist/plugin-sdk/{outbound-attachment-oxhGO33g.js → outbound-attachment-DmZmUqFP.js} +2 -2
- package/dist/plugin-sdk/{pairing-message-D3WPVg_j.d.ts → pairing-message-D0-UWGFJ.d.ts} +2 -2
- package/dist/plugin-sdk/{pairing-message-C29ixrvn.js → pairing-message-e4D4eBDA.js} +1 -1
- package/dist/plugin-sdk/{pairing-store-1kcsOWRs.js → pairing-store-T3IGoGZg.js} +2 -2
- package/dist/plugin-sdk/{pi-model-discovery-l-xqaEd0.js → pi-model-discovery-DvAG_Png.js} +1 -1
- package/dist/plugin-sdk/{pi-model-discovery-runtime-CibV8F8G.js → pi-model-discovery-runtime-NjkUgjIf.js} +2 -2
- package/dist/plugin-sdk/provider-web-search-config-contract.d.ts +2 -2
- package/dist/plugin-sdk/{pw-ai-9qEBW5-k.js → pw-ai-D7eW43DL.js} +3 -3
- package/dist/plugin-sdk/{replies-BX3L8fX7.js → replies-BMIPmEoP.js} +2 -2
- package/dist/plugin-sdk/{resolve-outbound-target-D0AK10E7.js → resolve-outbound-target-CXCqUUPV.js} +1 -1
- package/dist/plugin-sdk/{resolve-route-UO6XLYH3.js → resolve-route-DJN-SUSt.js} +1 -1
- package/dist/plugin-sdk/{retry-policy-C5N8JiHL.js → retry-policy-CY1qY6d7.js} +1 -1
- package/dist/plugin-sdk/{runtime-Dnzwux3G.js → runtime-CgOkQe0w.js} +3 -3
- package/dist/plugin-sdk/{runtime-dependency-BDDpVKBO.js → runtime-dependency-DvdRNMvs.js} +2 -2
- package/dist/plugin-sdk/sat-runtime.d.ts +3 -3
- package/dist/plugin-sdk/sat-runtime.js +5 -5
- package/dist/plugin-sdk/{send-bcKv8F5E.js → send-2ITqny2W.js} +8 -8
- package/dist/plugin-sdk/{send-DGEgo_6f.js → send-BAz22RZr.js} +5 -5
- package/dist/plugin-sdk/{send-DcsYRH2f.js → send-BG3RWyil.js} +7 -7
- package/dist/plugin-sdk/{send-D5rgCP1r.js → send-Cr-dj6S-.js} +6 -6
- package/dist/plugin-sdk/{send-B4XLsTL0.js → send-eTxqFFsw.js} +6 -6
- package/dist/plugin-sdk/{session-BoGNOlwv.js → session-C8nJmmVE.js} +2 -2
- package/dist/plugin-sdk/{skill-commands-Be8s4TGQ.js → skill-commands-Rm5by9S8.js} +2 -2
- package/dist/plugin-sdk/{slack-actions-TNnAXiUx.js → slack-actions-BNIALJTA.js} +11 -11
- package/dist/plugin-sdk/{slack-74qForpW.js → slack-xvIVvyEM.js} +38 -38
- package/dist/plugin-sdk/slack.d.ts +5 -5
- package/dist/plugin-sdk/slack.js +9 -9
- package/dist/plugin-sdk/{sticker-cache-CrYayLff.js → sticker-cache-D3oDiu2u.js} +3 -3
- package/dist/plugin-sdk/{tables-Ch4js2qy.js → tables-DS5L7lCA.js} +1 -1
- package/dist/plugin-sdk/{targets-BGfRUJPE.js → targets-D6lUomJc.js} +1 -1
- package/dist/plugin-sdk/{telegram-actions-BGy4AEvF.js → telegram-actions-MSFkDn0m.js} +29 -29
- package/dist/plugin-sdk/telegram.d.ts +5 -5
- package/dist/plugin-sdk/telegram.js +8 -8
- package/dist/plugin-sdk/{thread-bindings.lifecycle-_uQ2EF17.js → thread-bindings.lifecycle-Ry6Vcgw3.js} +3 -3
- package/dist/plugin-sdk/{thread-bindings.state-DUg0s_1X.js → thread-bindings.state-C0stmvNk.js} +2 -2
- package/dist/plugin-sdk/{tmp-fased-dir-BrbXGSkl.d.ts → tmp-fased-dir-D91GExk4.d.ts} +2 -2
- package/dist/plugin-sdk/{types-CBCtqtMn.d.ts → types-BzadOItY.d.ts} +1 -1
- package/dist/plugin-sdk/{types-DlKIHIqA.d.ts → types-DKvBJHfH.d.ts} +16 -6
- package/dist/plugin-sdk/{types-BJdDoTQF.d.ts → types-DVTIpopt.d.ts} +2 -2
- package/dist/plugin-sdk/{types.plugin-CvUiB3Kh.d.ts → types.plugin-BiHPaDTF.d.ts} +2 -1
- package/dist/plugin-sdk/{wallet-status-M6aK3abH.js → wallet-status-f0HagNeO.js} +31 -13
- package/dist/plugin-sdk/{web-r1KFR44s.js → web-DRNJxHXA.js} +31 -31
- package/dist/plugin-sdk/{whatsapp-actions-CID_tqAX.js → whatsapp-actions-BDXZF2R5.js} +13 -13
- package/dist/plugin-sdk/{whatsapp-heartbeat-Bk-aZVMa.js → whatsapp-heartbeat-CKgmwCGr.js} +2 -2
- package/dist/plugin-sdk/whatsapp.d.ts +5 -5
- package/dist/plugin-sdk/whatsapp.js +12 -12
- package/dist/plugin-sdk/{wsl-C_STtED7.js → wsl-Biw7Mj39.js} +3 -3
- package/dist/providers/huggingface-models.js +0 -30
- package/dist/providers/litellm-models.js +1 -1
- package/dist/providers/opencode-zen-shared.js +0 -1
- package/dist/providers/refresh.js +221 -62
- package/dist/providers/registry.js +31 -7
- package/dist/providers/runtime-model-catalog.js +181 -0
- package/dist/providers/vercel-ai-gateway-models.js +0 -35
- package/dist/shared/model-thinking.js +44 -2
- package/dist/wizard/onboarding.js +24 -6
- package/extensions/acpx/package.json +1 -1
- package/extensions/bluebubbles/package.json +1 -1
- package/extensions/copilot-proxy/package.json +1 -1
- package/extensions/diagnostics-otel/package.json +1 -1
- package/extensions/fased-federation/package.json +1 -1
- package/extensions/google-gemini-cli-auth/package.json +1 -1
- package/extensions/imessage/package.json +1 -1
- package/extensions/irc/package.json +1 -1
- package/extensions/line/package.json +1 -1
- package/extensions/llm-task/package.json +1 -1
- package/extensions/lobster/package.json +1 -1
- package/extensions/matrix/CHANGELOG.md +12 -0
- package/extensions/matrix/package.json +1 -1
- package/extensions/mattermost/package.json +1 -1
- package/extensions/memory-core/package.json +2 -2
- package/extensions/memory-lancedb/package.json +1 -1
- package/extensions/minimax-portal-auth/package.json +1 -1
- package/extensions/msteams/CHANGELOG.md +12 -0
- package/extensions/msteams/package.json +1 -1
- package/extensions/nextcloud-talk/package.json +1 -1
- package/extensions/nostr/CHANGELOG.md +12 -0
- package/extensions/nostr/package.json +1 -1
- package/extensions/open-prose/package.json +1 -1
- package/extensions/sat-mining/package.json +1 -1
- package/extensions/signal/package.json +1 -1
- package/extensions/synology-chat/package.json +1 -1
- package/extensions/tlon/package.json +1 -1
- package/extensions/twitch/CHANGELOG.md +12 -0
- package/extensions/twitch/package.json +1 -1
- package/extensions/voice-call/CHANGELOG.md +12 -0
- package/extensions/voice-call/package.json +1 -1
- package/extensions/zalo/CHANGELOG.md +12 -0
- package/extensions/zalo/package.json +1 -1
- package/extensions/zalouser/CHANGELOG.md +12 -0
- package/extensions/zalouser/package.json +1 -1
- package/package.json +1 -1
- package/dist/control-ui/assets/chat-model-ref-NT82zapt.js +0 -2
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { buildCredentialScopedAllowedModelSet } from "./model-catalog-access.js";
|
|
2
|
+
import { applyRuntimeProviderModelDiscovery, filterCatalogToAuthoritativeAvailability } from "../providers/runtime-model-catalog.js";
|
|
3
|
+
|
|
4
|
+
//#region src/agents/authenticated-model-catalog.ts
|
|
5
|
+
async function resolveAuthenticatedModelCatalog(params) {
|
|
6
|
+
const initialScope = buildCredentialScopedAllowedModelSet({
|
|
7
|
+
cfg: params.cfg,
|
|
8
|
+
catalog: params.catalog,
|
|
9
|
+
defaultProvider: params.defaultProvider,
|
|
10
|
+
store: params.store
|
|
11
|
+
});
|
|
12
|
+
const discoveredCatalog = filterCatalogToAuthoritativeAvailability(await applyRuntimeProviderModelDiscovery({
|
|
13
|
+
cfg: params.cfg,
|
|
14
|
+
store: params.store,
|
|
15
|
+
routes: initialScope.usableProviders,
|
|
16
|
+
catalog: initialScope.usableCatalog
|
|
17
|
+
}), params.store);
|
|
18
|
+
return buildCredentialScopedAllowedModelSet({
|
|
19
|
+
cfg: params.cfg,
|
|
20
|
+
catalog: discoveredCatalog,
|
|
21
|
+
defaultProvider: params.defaultProvider,
|
|
22
|
+
storedProviders: initialScope.usableProviders
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
export { resolveAuthenticatedModelCatalog };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { CLOUDFLARE_AI_GATEWAY_MODEL_CATALOG, buildCloudflareAiGatewayModelDefinition } from "../providers/cloudflare-ai-gateway-shared.js";
|
|
2
2
|
import { HUGGINGFACE_BASE_URL, HUGGINGFACE_MODEL_CATALOG, buildHuggingfaceModelDefinition } from "../providers/huggingface-models.js";
|
|
3
|
-
import { LITELLM_BASE_URL, LITELLM_MODEL_CATALOG, buildLitellmModelDefinition } from "../providers/litellm-models.js";
|
|
4
3
|
import { SYNTHETIC_BASE_URL, SYNTHETIC_MODEL_CATALOG, buildSyntheticModelDefinition } from "../providers/synthetic-models.js";
|
|
5
4
|
import { TOGETHER_BASE_URL, TOGETHER_MODEL_CATALOG, buildTogetherModelDefinition } from "../providers/together-models.js";
|
|
6
5
|
import { VENICE_BASE_URL, VENICE_MODEL_CATALOG, buildVeniceModelDefinition } from "../providers/venice-models.js";
|
|
@@ -147,6 +146,33 @@ const OPENAI_MODELS = [
|
|
|
147
146
|
})
|
|
148
147
|
];
|
|
149
148
|
const OPENAI_CODEX_MODELS = [
|
|
149
|
+
model({
|
|
150
|
+
id: "gpt-5.6-sol",
|
|
151
|
+
name: "GPT-5.6 Sol",
|
|
152
|
+
reasoning: true,
|
|
153
|
+
input: ["text", "image"],
|
|
154
|
+
contextWindow: 105e4,
|
|
155
|
+
maxTokens: 128e3,
|
|
156
|
+
api: "openai-codex-responses"
|
|
157
|
+
}),
|
|
158
|
+
model({
|
|
159
|
+
id: "gpt-5.6-terra",
|
|
160
|
+
name: "GPT-5.6 Terra",
|
|
161
|
+
reasoning: true,
|
|
162
|
+
input: ["text", "image"],
|
|
163
|
+
contextWindow: 105e4,
|
|
164
|
+
maxTokens: 128e3,
|
|
165
|
+
api: "openai-codex-responses"
|
|
166
|
+
}),
|
|
167
|
+
model({
|
|
168
|
+
id: "gpt-5.6-luna",
|
|
169
|
+
name: "GPT-5.6 Luna",
|
|
170
|
+
reasoning: true,
|
|
171
|
+
input: ["text", "image"],
|
|
172
|
+
contextWindow: 105e4,
|
|
173
|
+
maxTokens: 128e3,
|
|
174
|
+
api: "openai-codex-responses"
|
|
175
|
+
}),
|
|
150
176
|
model({
|
|
151
177
|
id: "gpt-5.5",
|
|
152
178
|
name: "GPT-5.5 Codex",
|
|
@@ -849,22 +875,16 @@ const CURRENT_MODEL_PROVIDER_CATALOG = {
|
|
|
849
875
|
models: CLOUDFLARE_AI_GATEWAY_MODEL_CATALOG.map((entry) => buildCloudflareAiGatewayModelDefinition({ id: entry.id }))
|
|
850
876
|
},
|
|
851
877
|
litellm: {
|
|
852
|
-
baseUrl:
|
|
878
|
+
baseUrl: "http://localhost:4000/v1",
|
|
853
879
|
api: "openai-completions",
|
|
854
880
|
request: { allowPrivateNetwork: true },
|
|
855
|
-
models:
|
|
881
|
+
models: []
|
|
856
882
|
},
|
|
857
883
|
vllm: {
|
|
858
884
|
baseUrl: "http://127.0.0.1:8000/v1",
|
|
859
885
|
api: "openai-completions",
|
|
860
886
|
request: { allowPrivateNetwork: true },
|
|
861
|
-
models: [
|
|
862
|
-
id: "local",
|
|
863
|
-
name: "Local model",
|
|
864
|
-
input: ["text", "image"],
|
|
865
|
-
contextWindow: 128e3,
|
|
866
|
-
maxTokens: 8192
|
|
867
|
-
})]
|
|
887
|
+
models: []
|
|
868
888
|
},
|
|
869
889
|
"github-copilot": {
|
|
870
890
|
baseUrl: "https://api.individual.githubcopilot.com",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isOpenAISignInCatalogModel, isStandardProviderCatalogEntry, listProviderBrandManifests } from "../providers/registry.js";
|
|
2
2
|
import { MODEL_APIS } from "../config/types.models.js";
|
|
3
3
|
import { buildModelCatalogMergeKey, mergeModelCatalogRowsByAuthority, normalizeModelCatalogModelId, normalizeModelCatalogProviderId, normalizeProviderCatalogRows } from "./model-catalog-normalized.js";
|
|
4
4
|
import { CURRENT_MODEL_PROVIDER_CATALOG, listCurrentModelCatalogRows } from "./current-model-catalog.js";
|
|
@@ -28,7 +28,7 @@ function isSupportedRuntimeCatalogModel(provider, id) {
|
|
|
28
28
|
if (provider !== "openai-codex") {
|
|
29
29
|
return true;
|
|
30
30
|
}
|
|
31
|
-
return
|
|
31
|
+
return isOpenAISignInCatalogModel(id);
|
|
32
32
|
}
|
|
33
33
|
function configuredProviderCatalogRows(cfg) {
|
|
34
34
|
return Object.entries(cfg.models?.providers ?? {}).flatMap(([provider, providerConfig]) => normalizeProviderCatalogRows({
|
|
@@ -112,9 +112,9 @@ function providerConfigForRow(cfg, row) {
|
|
|
112
112
|
return cfg.models?.providers?.[row.provider] ?? CURRENT_MODEL_PROVIDER_CATALOG[row.provider];
|
|
113
113
|
}
|
|
114
114
|
function buildFasedModelCatalogRows(params) {
|
|
115
|
+
const reviewedRows = [...listCurrentModelCatalogRows(), ...providerPluginCatalogRows(params.providerPluginProviders)].filter((row) => isSupportedRuntimeCatalogModel(row.provider, row.id));
|
|
115
116
|
const discoveredRows = mergeModelCatalogRowsByAuthority([
|
|
116
|
-
...
|
|
117
|
-
...providerPluginCatalogRows(params.providerPluginProviders),
|
|
117
|
+
...reviewedRows,
|
|
118
118
|
...runtimeCatalogRows({
|
|
119
119
|
models: params.runtimeModels ?? [],
|
|
120
120
|
onEntryError: params.onRuntimeEntryError
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DEFAULT_CONTEXT_TOKENS } from "./defaults.js";
|
|
2
|
+
import { cloneCurrentModelProvider } from "./current-model-catalog.js";
|
|
2
3
|
import { normalizeProviderId } from "./model-selection.js";
|
|
3
4
|
import { normalizeModelCompat } from "./model-compat.js";
|
|
4
5
|
|
|
@@ -68,6 +69,23 @@ function cloneFirstTemplateModel(params) {
|
|
|
68
69
|
}
|
|
69
70
|
return undefined;
|
|
70
71
|
}
|
|
72
|
+
function resolveCurrentOpenAIModel(provider, modelId) {
|
|
73
|
+
const normalizedProvider = normalizeProviderId(provider);
|
|
74
|
+
if (normalizedProvider !== "openai" && normalizedProvider !== "openai-codex") {
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
const trimmedModelId = modelId.trim();
|
|
78
|
+
const current = cloneCurrentModelProvider(normalizedProvider)?.models?.find((entry) => entry.id.toLowerCase() === trimmedModelId.toLowerCase());
|
|
79
|
+
if (!current) {
|
|
80
|
+
return undefined;
|
|
81
|
+
}
|
|
82
|
+
return normalizeModelCompat({
|
|
83
|
+
...current,
|
|
84
|
+
id: trimmedModelId,
|
|
85
|
+
provider: normalizedProvider,
|
|
86
|
+
baseUrl: normalizedProvider === "openai-codex" ? "https://chatgpt.com/backend-api" : "https://api.openai.com/v1"
|
|
87
|
+
});
|
|
88
|
+
}
|
|
71
89
|
function buildOpenAIResponsesPatch(params) {
|
|
72
90
|
return {
|
|
73
91
|
api: "openai-responses",
|
|
@@ -393,7 +411,7 @@ function resolveZaiGlm5ForwardCompatModel(provider, modelId, modelRegistry) {
|
|
|
393
411
|
});
|
|
394
412
|
}
|
|
395
413
|
function resolveForwardCompatModel(provider, modelId, modelRegistry) {
|
|
396
|
-
return resolveOpenAIGptForwardCompatModel(provider, modelId, modelRegistry) ?? resolveOpenAICodexForwardCompatModel(provider, modelId, modelRegistry) ?? resolveAnthropicOpus46ForwardCompatModel(provider, modelId, modelRegistry) ?? resolveAnthropicSonnet46ForwardCompatModel(provider, modelId, modelRegistry) ?? resolveZaiGlm5ForwardCompatModel(provider, modelId, modelRegistry) ?? resolveGoogleGeminiCli31ForwardCompatModel(provider, modelId, modelRegistry);
|
|
414
|
+
return resolveCurrentOpenAIModel(provider, modelId) ?? resolveOpenAIGptForwardCompatModel(provider, modelId, modelRegistry) ?? resolveOpenAICodexForwardCompatModel(provider, modelId, modelRegistry) ?? resolveAnthropicOpus46ForwardCompatModel(provider, modelId, modelRegistry) ?? resolveAnthropicSonnet46ForwardCompatModel(provider, modelId, modelRegistry) ?? resolveZaiGlm5ForwardCompatModel(provider, modelId, modelRegistry) ?? resolveGoogleGeminiCli31ForwardCompatModel(provider, modelId, modelRegistry);
|
|
397
415
|
}
|
|
398
416
|
|
|
399
417
|
//#endregion
|
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
import { resolveModelThinkingCapability } from "../shared/model-thinking.js";
|
|
2
|
-
import { lookupProviderManifestModelCapability } from "../providers/registry.js";
|
|
2
|
+
import { getProviderBrandManifestForRoute, lookupProviderManifestModelCapability, providerModelRecommendationRank } from "../providers/registry.js";
|
|
3
3
|
import { isPrivateNetworkBaseUrl } from "../utils/private-network-url.js";
|
|
4
4
|
import { lookupRefreshedModelCapability } from "../providers/refreshed-model-capabilities.js";
|
|
5
5
|
|
|
6
6
|
//#region src/agents/model-metadata.ts
|
|
7
|
+
function availabilitySourceForCatalogSource(source) {
|
|
8
|
+
switch (source) {
|
|
9
|
+
case "provider-api": return "provider-api";
|
|
10
|
+
case "runtime": return "runtime-catalog";
|
|
11
|
+
case "configured": return "configured";
|
|
12
|
+
case "provider-index": return "provider-plugin";
|
|
13
|
+
case "manifest": return "curated-recommendation";
|
|
14
|
+
case "current-preview":
|
|
15
|
+
default: return "reviewed-catalog";
|
|
16
|
+
}
|
|
17
|
+
}
|
|
7
18
|
const FEATURE_LABELS = {
|
|
8
19
|
text: "text",
|
|
9
20
|
vision: "vision",
|
|
@@ -32,8 +43,10 @@ const JSON_CAPABLE_APIS = new Set([
|
|
|
32
43
|
const LOCAL_DYNAMIC_PROVIDERS = new Set([
|
|
33
44
|
"ollama",
|
|
34
45
|
"lmstudio",
|
|
35
|
-
"vllm"
|
|
46
|
+
"vllm",
|
|
47
|
+
"litellm"
|
|
36
48
|
]);
|
|
49
|
+
const CURATED_CATALOG_REVIEWED_AT = "2026-07-12T00:00:00.000Z";
|
|
37
50
|
function resolveProviderConfig(cfg, provider) {
|
|
38
51
|
return cfg?.models?.providers?.[provider];
|
|
39
52
|
}
|
|
@@ -41,6 +54,14 @@ function resolveAuthMode(params) {
|
|
|
41
54
|
if (params.providerConfig?.auth) {
|
|
42
55
|
return params.providerConfig.auth;
|
|
43
56
|
}
|
|
57
|
+
const providerRoute = params.provider.trim().toLowerCase();
|
|
58
|
+
const method = getProviderBrandManifestForRoute(providerRoute)?.methods.find((entry) => entry.route.trim().toLowerCase() === providerRoute || entry.statusRoute?.trim().toLowerCase() === providerRoute || entry.configProviderId?.trim().toLowerCase() === providerRoute);
|
|
59
|
+
if (method?.kind === "oauth" || method?.kind === "device") {
|
|
60
|
+
return "oauth";
|
|
61
|
+
}
|
|
62
|
+
if (method?.kind === "token") {
|
|
63
|
+
return "token";
|
|
64
|
+
}
|
|
44
65
|
return "api-key";
|
|
45
66
|
}
|
|
46
67
|
function addFeature(features, feature, enabled) {
|
|
@@ -56,15 +77,16 @@ function deriveModelMetadata(params) {
|
|
|
56
77
|
const api = params.model.api ?? providerConfig?.api;
|
|
57
78
|
const refreshed = lookupRefreshedModelCapability(provider, modelId);
|
|
58
79
|
const manifestCapabilities = lookupProviderManifestModelCapability(provider, modelId);
|
|
59
|
-
const input =
|
|
80
|
+
const input = params.model.input ?? refreshed?.input ?? ["text"];
|
|
60
81
|
const capabilities = manifestCapabilities || params.model.capabilities || refreshed?.capabilities ? {
|
|
82
|
+
...refreshed?.capabilities,
|
|
61
83
|
...manifestCapabilities,
|
|
62
|
-
...params.model.capabilities
|
|
63
|
-
...refreshed?.capabilities
|
|
84
|
+
...params.model.capabilities
|
|
64
85
|
} : undefined;
|
|
65
|
-
const
|
|
66
|
-
const
|
|
67
|
-
const
|
|
86
|
+
const capabilitySource = params.capabilitySource ?? (params.model.capabilities ? params.model.catalogSource === "configured" ? "configured" : "runtime" : refreshed ? refreshed.source === "catalog" || refreshed.source === "provider-api" ? "provider-api" : "official-docs" : manifestCapabilities ? "official-docs" : api && !LOCAL_DYNAMIC_PROVIDERS.has(provider) ? "inferred" : "unknown");
|
|
87
|
+
const capabilityConfidence = capabilitySource === "provider-api" || capabilitySource === "official-docs" ? "verified" : capabilitySource === "runtime" || capabilitySource === "configured" ? "declared" : capabilitySource === "inferred" ? "inferred" : "unknown";
|
|
88
|
+
const shouldInferApiCapabilities = !LOCAL_DYNAMIC_PROVIDERS.has(provider);
|
|
89
|
+
const reasoning = params.model.reasoning ?? refreshed?.reasoning;
|
|
68
90
|
const thinking = resolveModelThinkingCapability({
|
|
69
91
|
provider,
|
|
70
92
|
model: modelId,
|
|
@@ -87,6 +109,7 @@ function deriveModelMetadata(params) {
|
|
|
87
109
|
label: params.model.name?.trim() || modelId,
|
|
88
110
|
contextWindow: typeof refreshed?.contextWindow === "number" && refreshed.contextWindow > 0 ? refreshed.contextWindow : typeof params.model.contextWindow === "number" && params.model.contextWindow > 0 ? params.model.contextWindow : undefined,
|
|
89
111
|
maxTokens: typeof refreshed?.maxTokens === "number" && refreshed.maxTokens > 0 ? refreshed.maxTokens : typeof params.model.maxTokens === "number" && params.model.maxTokens > 0 ? params.model.maxTokens : undefined,
|
|
112
|
+
...typeof api === "string" && api.trim() ? { apiRoute: api.trim() } : {},
|
|
90
113
|
features,
|
|
91
114
|
...thinking ? {
|
|
92
115
|
thinkingLevels: thinking.thinkingLevels,
|
|
@@ -96,6 +119,11 @@ function deriveModelMetadata(params) {
|
|
|
96
119
|
} : {},
|
|
97
120
|
streaming: capabilities?.streaming !== false,
|
|
98
121
|
capabilityConfidence,
|
|
122
|
+
capabilitySource,
|
|
123
|
+
...params.capabilityRetrievedAt ?? refreshed?.refreshedAt ?? (capabilitySource === "official-docs" ? CURATED_CATALOG_REVIEWED_AT : undefined) ? { capabilityRetrievedAt: params.capabilityRetrievedAt ?? refreshed?.refreshedAt ?? CURATED_CATALOG_REVIEWED_AT } : {},
|
|
124
|
+
retrievedAt: refreshed?.refreshedAt ?? CURATED_CATALOG_REVIEWED_AT,
|
|
125
|
+
availabilitySource: availabilitySourceForCatalogSource(params.model.catalogSource),
|
|
126
|
+
authRoute: provider,
|
|
99
127
|
authMode: resolveAuthMode({
|
|
100
128
|
provider,
|
|
101
129
|
providerConfig
|
|
@@ -103,6 +131,7 @@ function deriveModelMetadata(params) {
|
|
|
103
131
|
privateNetwork,
|
|
104
132
|
privateNetworkAllowed: privateNetwork ? providerConfig?.request?.allowPrivateNetwork === true : false,
|
|
105
133
|
...params.recommended ? { recommended: true } : {},
|
|
134
|
+
...providerModelRecommendationRank(provider, modelId) ? { recommendationRank: providerModelRecommendationRank(provider, modelId) } : {},
|
|
106
135
|
...params.default ? { default: true } : {}
|
|
107
136
|
};
|
|
108
137
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/agents/pi-embedded-runner/agent-messages.ts
|
|
2
|
+
function replaceAgentMessages(agent, messages) {
|
|
3
|
+
if (agent.state) {
|
|
4
|
+
agent.state.messages = messages;
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
if (typeof agent.replaceMessages === "function") {
|
|
8
|
+
agent.replaceMessages(messages);
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
throw new Error("Agent runtime does not expose mutable message state");
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { replaceAgentMessages };
|
|
@@ -38,6 +38,7 @@ import { applySkillEnvOverrides, applySkillEnvOverridesFromSnapshot } from "../s
|
|
|
38
38
|
import { loadWorkspaceSkillEntries, resolveSkillsPromptForRun } from "../skills/workspace.js";
|
|
39
39
|
import "../skills.js";
|
|
40
40
|
import { resolveTranscriptPolicy } from "../transcript-policy.js";
|
|
41
|
+
import { replaceAgentMessages } from "./agent-messages.js";
|
|
41
42
|
import { EMBEDDED_COMPACTION_TIMEOUT_MS, compactWithSafetyTimeout } from "./compaction-safety-timeout.js";
|
|
42
43
|
import { buildEmbeddedExtensionFactories } from "./extensions.js";
|
|
43
44
|
import { describeUnknownError, mapThinkingLevel } from "./utils.js";
|
|
@@ -467,7 +468,7 @@ async function compactEmbeddedPiSessionDirect(params) {
|
|
|
467
468
|
const truncated = limitHistoryTurns(validated, getDmHistoryLimitFromSessionKey(params.sessionKey, params.config));
|
|
468
469
|
const limited = transcriptPolicy.repairToolUseResultPairing ? sanitizeToolUseResultPairing(truncated) : truncated;
|
|
469
470
|
if (limited.length > 0) {
|
|
470
|
-
session.agent
|
|
471
|
+
replaceAgentMessages(session.agent, limited);
|
|
471
472
|
}
|
|
472
473
|
const hookRunner = getGlobalHookRunner();
|
|
473
474
|
const hookCtx = {
|
|
@@ -348,6 +348,30 @@ function createOpenAIResponsesContextManagementWrapper(baseStreamFn, extraParams
|
|
|
348
348
|
});
|
|
349
349
|
};
|
|
350
350
|
}
|
|
351
|
+
function createOpenAIReasoningEffortWrapper(baseStreamFn, reasoningEffort) {
|
|
352
|
+
const underlying = baseStreamFn ?? streamSimple;
|
|
353
|
+
return (model, context, options) => {
|
|
354
|
+
const supportsReasoningEffort = model.api === "openai-codex-responses" || model.api === "openai-responses" && model.provider === "openai" && (model.baseUrl === undefined || isDirectOpenAIBaseUrl(model.baseUrl));
|
|
355
|
+
if (!reasoningEffort || !supportsReasoningEffort) {
|
|
356
|
+
return underlying(model, context, options);
|
|
357
|
+
}
|
|
358
|
+
const originalOnPayload = options?.onPayload;
|
|
359
|
+
return underlying(model, context, {
|
|
360
|
+
...options,
|
|
361
|
+
onPayload: (payload) => {
|
|
362
|
+
if (payload && typeof payload === "object") {
|
|
363
|
+
const payloadObj = payload;
|
|
364
|
+
const reasoning = payloadObj.reasoning;
|
|
365
|
+
payloadObj.reasoning = {
|
|
366
|
+
...reasoning && typeof reasoning === "object" ? reasoning : {},
|
|
367
|
+
effort: reasoningEffort === "off" ? "none" : reasoningEffort
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
originalOnPayload?.(payload);
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
};
|
|
374
|
+
}
|
|
351
375
|
function createCodexDefaultTransportWrapper(baseStreamFn) {
|
|
352
376
|
const underlying = baseStreamFn ?? streamSimple;
|
|
353
377
|
return (model, context, options) => underlying(model, context, {
|
|
@@ -814,6 +838,7 @@ function applyExtraParamsToAgent(agent, cfg, provider, modelId, extraParamsOverr
|
|
|
814
838
|
}
|
|
815
839
|
agent.streamFn = createGoogleThinkingPayloadWrapper(agent.streamFn, thinkingLevel);
|
|
816
840
|
agent.streamFn = createOpenAIResponsesContextManagementWrapper(agent.streamFn, merged);
|
|
841
|
+
agent.streamFn = createOpenAIReasoningEffortWrapper(agent.streamFn, thinkingLevel);
|
|
817
842
|
}
|
|
818
843
|
|
|
819
844
|
//#endregion
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isOpenAISignInRuntimeModelSupported } from "../../providers/registry.js";
|
|
1
2
|
import { DEFAULT_CONTEXT_TOKENS } from "../defaults.js";
|
|
2
3
|
import { isPrivateNetworkBaseUrl } from "../../utils/private-network-url.js";
|
|
3
4
|
import { resolveFasedAgentAgentDir } from "../agent-paths.js";
|
|
@@ -10,12 +11,6 @@ import { attachModelProviderRequestTransport, sanitizeConfiguredModelProviderReq
|
|
|
10
11
|
|
|
11
12
|
//#region src/agents/pi-embedded-runner/model.ts
|
|
12
13
|
const OPENAI_CODEX_PROVIDER_ID = "openai-codex";
|
|
13
|
-
const OPENAI_CODEX_SUPPORTED_MODEL_IDS = new Set([
|
|
14
|
-
"gpt-5.5",
|
|
15
|
-
"gpt-5.4",
|
|
16
|
-
"gpt-5.4-mini",
|
|
17
|
-
"gpt-5.3-codex"
|
|
18
|
-
]);
|
|
19
14
|
function buildInlineProviderModels(providers) {
|
|
20
15
|
return Object.entries(providers).flatMap(([providerId, entry]) => {
|
|
21
16
|
const trimmed = providerId.trim();
|
|
@@ -59,7 +54,7 @@ function resolveModel(provider, modelId, agentDir, cfg) {
|
|
|
59
54
|
const modelRegistry = discoverModels(authStorage, resolvedAgentDir);
|
|
60
55
|
const normalizedProvider = normalizeProviderId(provider);
|
|
61
56
|
const runtimeModelId = modelId.trim();
|
|
62
|
-
if (normalizedProvider === OPENAI_CODEX_PROVIDER_ID && !
|
|
57
|
+
if (normalizedProvider === OPENAI_CODEX_PROVIDER_ID && !isOpenAISignInRuntimeModelSupported(runtimeModelId)) {
|
|
63
58
|
return {
|
|
64
59
|
error: `Unsupported OpenAI-Codex sign-in model: ${runtimeModelId}`,
|
|
65
60
|
authStorage,
|
|
@@ -42,6 +42,7 @@ import { applySkillEnvOverrides, applySkillEnvOverridesFromSnapshot } from "../.
|
|
|
42
42
|
import { loadWorkspaceSkillEntries, resolveSkillsPromptForRun } from "../../skills/workspace.js";
|
|
43
43
|
import "../../skills.js";
|
|
44
44
|
import { resolveTranscriptPolicy } from "../../transcript-policy.js";
|
|
45
|
+
import { replaceAgentMessages } from "../agent-messages.js";
|
|
45
46
|
import { appendCacheTtlTimestamp, shouldAppendCacheTtlTimestampAfterAttempt } from "../cache-ttl.js";
|
|
46
47
|
import { buildEmbeddedExtensionFactories } from "../extensions.js";
|
|
47
48
|
import { dropThinkingBlocks } from "../thinking.js";
|
|
@@ -79,7 +80,6 @@ import "../../pi-embedded-helpers.js";
|
|
|
79
80
|
import os from "node:os";
|
|
80
81
|
import fs from "node:fs/promises";
|
|
81
82
|
import { DefaultResourceLoader, SessionManager, createAgentSession } from "@mariozechner/pi-coding-agent";
|
|
82
|
-
import { streamSimple } from "@mariozechner/pi-ai/compat";
|
|
83
83
|
|
|
84
84
|
//#region src/agents/pi-embedded-runner/run/attempt.ts
|
|
85
85
|
function trimWhitespaceFromToolCallNamesInMessage(message) {
|
|
@@ -621,7 +621,6 @@ async function runEmbeddedAttempt(params) {
|
|
|
621
621
|
modelApi: params.model.api,
|
|
622
622
|
workspaceDir: params.workspaceDir
|
|
623
623
|
});
|
|
624
|
-
activeSession.agent.streamFn = streamSimple;
|
|
625
624
|
applyExtraParamsToAgent(activeSession.agent, params.config, params.provider, params.modelId, params.streamParams, params.thinkLevel, sessionAgentId);
|
|
626
625
|
if (cacheTrace) {
|
|
627
626
|
cacheTrace.recordStage("session:loaded", {
|
|
@@ -697,7 +696,7 @@ async function runEmbeddedAttempt(params) {
|
|
|
697
696
|
const limited = transcriptPolicy.repairToolUseResultPairing ? sanitizeToolUseResultPairing(truncated) : truncated;
|
|
698
697
|
cacheTrace?.recordStage("session:limited", { messages: limited });
|
|
699
698
|
if (params.omitPriorMessages || limited.length > 0) {
|
|
700
|
-
activeSession.agent
|
|
699
|
+
replaceAgentMessages(activeSession.agent, limited);
|
|
701
700
|
}
|
|
702
701
|
} catch (err) {
|
|
703
702
|
await flushPendingToolResultsAfterIdle({
|
|
@@ -887,13 +886,13 @@ async function runEmbeddedAttempt(params) {
|
|
|
887
886
|
sessionManager.resetLeaf();
|
|
888
887
|
}
|
|
889
888
|
const sessionContext = sessionManager.buildSessionContext();
|
|
890
|
-
activeSession.agent
|
|
889
|
+
replaceAgentMessages(activeSession.agent, sessionContext.messages);
|
|
891
890
|
log.warn(`Removed orphaned user message to prevent consecutive user turns. ` + `runId=${params.runId} sessionId=${params.sessionId}`);
|
|
892
891
|
}
|
|
893
892
|
try {
|
|
894
893
|
const didPruneImages = pruneProcessedHistoryImages(activeSession.messages);
|
|
895
894
|
if (didPruneImages) {
|
|
896
|
-
activeSession.agent
|
|
895
|
+
replaceAgentMessages(activeSession.agent, activeSession.messages);
|
|
897
896
|
}
|
|
898
897
|
const imageResult = await detectAndLoadPromptImages({
|
|
899
898
|
prompt: effectivePrompt,
|
package/dist/brand.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
const FASED_BRAND_NAME = "Fased";
|
|
3
3
|
const FASED_AGENT_NAME = "Fased Agent";
|
|
4
4
|
const FASED_CONTROL_NAME = "Fased Control";
|
|
5
|
-
const FASED_PRODUCT_VERSION = "0.1.
|
|
5
|
+
const FASED_PRODUCT_VERSION = "0.1.55";
|
|
6
6
|
const FASED_DISPLAY_VERSION = `v${FASED_PRODUCT_VERSION}`;
|
|
7
7
|
function formatFasedDisplayLine() {
|
|
8
8
|
return `${FASED_AGENT_NAME} ${FASED_DISPLAY_VERSION}`;
|
package/dist/build-info.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
c4a6e3e507ccfdd8b130a370232c38876b21dcd70184d986652833ecac14bd0a
|
|
@@ -13,6 +13,7 @@ import { agentsAddCommand } from "../../commands/agents.commands.add.js";
|
|
|
13
13
|
import { agentsDeleteCommand } from "../../commands/agents.commands.delete.js";
|
|
14
14
|
import { agentsSetIdentityCommand } from "../../commands/agents.commands.identity.js";
|
|
15
15
|
import { agentsListCommand } from "../../commands/agents.commands.list.js";
|
|
16
|
+
import { agentsModelsSetCommand } from "../../commands/agents.commands.models.js";
|
|
16
17
|
import "../../commands/agents.js";
|
|
17
18
|
|
|
18
19
|
//#region src/cli/program/register.agent.ts
|
|
@@ -53,6 +54,22 @@ ${theme.muted("Docs:")} ${formatDocsLink("/cli/agent", "docs.fased.ai/cli/agent"
|
|
|
53
54
|
}, defaultRuntime);
|
|
54
55
|
});
|
|
55
56
|
});
|
|
57
|
+
const agentModels = agents.command("models").description("Configure models for one Agent");
|
|
58
|
+
agentModels.command("set").description("Set the Agent primary, fallback, and task-role models").option("--agent <id>", "Agent id (defaults to the current default Agent)").option("--primary <provider/model>", "Primary model").option("--fallback <provider/model>", "Fallback model (repeatable)", collectOption).option("--cheap-check <provider/model>", "Cheap/check task model").option("--strong <provider/model>", "Strong task model").option("--escalation <provider/model>", "Escalation task model").option("--coding <provider/model>", "Coding task model").option("--summarizer <provider/model>", "Summarizer task model").option("--json", "Output JSON summary", false).action(async (opts) => {
|
|
59
|
+
await runCommandWithRuntime(defaultRuntime, async () => {
|
|
60
|
+
await agentsModelsSetCommand({
|
|
61
|
+
agent: opts.agent,
|
|
62
|
+
primary: opts.primary,
|
|
63
|
+
fallbacks: Array.isArray(opts.fallback) ? opts.fallback : undefined,
|
|
64
|
+
cheapCheck: opts.cheapCheck,
|
|
65
|
+
strong: opts.strong,
|
|
66
|
+
escalation: opts.escalation,
|
|
67
|
+
coding: opts.coding,
|
|
68
|
+
summarizer: opts.summarizer,
|
|
69
|
+
json: Boolean(opts.json)
|
|
70
|
+
}, defaultRuntime);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
56
73
|
agents.command("bind").description("Add routing bindings for an agent").option("--agent <id>", "Agent id (defaults to current default agent)").option("--bind <channel[:accountId]>", "Binding to add (repeatable). If omitted, accountId is resolved by channel defaults/hooks.", collectOption, []).option("--json", "Output JSON summary", false).action(async (opts) => {
|
|
57
74
|
await runCommandWithRuntime(defaultRuntime, async () => {
|
|
58
75
|
await agentsBindCommand({
|
|
@@ -5,8 +5,8 @@ import { loadAuthProfileStoreForRuntime } from "../agents/auth-profiles/store.js
|
|
|
5
5
|
import { loadConfig, writeConfigFile } from "../config/io.js";
|
|
6
6
|
import "../config/config.js";
|
|
7
7
|
import "../agents/auth-profiles.js";
|
|
8
|
-
import { createClackPrompter } from "../wizard/clack-prompter.js";
|
|
9
8
|
import { applyProviderRefreshToRegistrySource, buildProviderCapabilityOverridesSource, buildProviderRefreshEnvFromCredentials, buildProviderRefreshReport, buildProviderRegistryReviewPatch, fetchOfficialProviderRefreshSnapshot, loadProviderRefreshSnapshotFromFile } from "../providers/refresh.js";
|
|
9
|
+
import { createClackPrompter } from "../wizard/clack-prompter.js";
|
|
10
10
|
import path from "node:path";
|
|
11
11
|
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
12
12
|
|
|
@@ -284,7 +284,8 @@ async function applyRegistryRefresh(report) {
|
|
|
284
284
|
} catch {
|
|
285
285
|
existingCapabilities = "";
|
|
286
286
|
}
|
|
287
|
-
const
|
|
287
|
+
const normalizeCapabilityTimestamps = (source) => source.replace(/refreshedAt: "[^"]+",/g, "refreshedAt: \"<reviewed-at>\",");
|
|
288
|
+
const capabilitiesChanged = normalizeCapabilityTimestamps(capabilitiesSource) !== normalizeCapabilityTimestamps(existingCapabilities);
|
|
288
289
|
if (capabilitiesChanged) {
|
|
289
290
|
await writeFile(CAPABILITIES_PATH, capabilitiesSource, "utf8");
|
|
290
291
|
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { resolveAgentModelFallbackValues, resolveAgentModelPrimaryValue } from "../config/model-input.js";
|
|
2
|
+
import { defaultRuntime } from "../runtime.js";
|
|
3
|
+
import { normalizeAgentId } from "../routing/session-key.js";
|
|
4
|
+
import { listAgentEntries, resolveDefaultAgentId } from "../agents/agent-scope.js";
|
|
5
|
+
import { writeConfigFile } from "../config/io.js";
|
|
6
|
+
import "../config/config.js";
|
|
7
|
+
import { applyAgentConfig } from "./agents.config.js";
|
|
8
|
+
import { logConfigUpdated } from "../config/logging.js";
|
|
9
|
+
import { requireValidConfig } from "./agents.command-shared.js";
|
|
10
|
+
|
|
11
|
+
//#region src/commands/agents.commands.models.ts
|
|
12
|
+
function clean(value) {
|
|
13
|
+
const trimmed = value?.trim();
|
|
14
|
+
return trimmed || undefined;
|
|
15
|
+
}
|
|
16
|
+
async function agentsModelsSetCommand(opts, runtime = defaultRuntime) {
|
|
17
|
+
const cfg = await requireValidConfig(runtime);
|
|
18
|
+
if (!cfg) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const agentId = normalizeAgentId(clean(opts.agent) ?? resolveDefaultAgentId(cfg));
|
|
22
|
+
const current = listAgentEntries(cfg).find((entry) => normalizeAgentId(entry.id) === agentId);
|
|
23
|
+
const primary = clean(opts.primary) ?? resolveAgentModelPrimaryValue(current?.model);
|
|
24
|
+
const fallbacks = opts.fallbacks !== undefined ? [...new Set(opts.fallbacks.map((entry) => entry.trim()).filter(Boolean))] : resolveAgentModelFallbackValues(current?.model);
|
|
25
|
+
const taskModels = {
|
|
26
|
+
...current?.taskModels,
|
|
27
|
+
...opts.cheapCheck !== undefined ? { cheapCheck: clean(opts.cheapCheck) } : {},
|
|
28
|
+
...opts.strong !== undefined ? { strong: clean(opts.strong) } : {},
|
|
29
|
+
...opts.escalation !== undefined ? { escalation: clean(opts.escalation) } : {},
|
|
30
|
+
...opts.coding !== undefined ? { coding: clean(opts.coding) } : {},
|
|
31
|
+
...opts.summarizer !== undefined ? { summarizer: clean(opts.summarizer) } : {}
|
|
32
|
+
};
|
|
33
|
+
const normalizedTaskModels = Object.fromEntries(Object.entries(taskModels).filter((entry) => Boolean(entry[1])));
|
|
34
|
+
if (!primary && fallbacks.length === 0 && Object.keys(normalizedTaskModels).length === 0) {
|
|
35
|
+
runtime.error("Set at least one model with --primary, --fallback, or a task-role option.");
|
|
36
|
+
runtime.exit(1);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const model = primary ? fallbacks.length > 0 ? {
|
|
40
|
+
primary,
|
|
41
|
+
fallbacks
|
|
42
|
+
} : primary : { fallbacks };
|
|
43
|
+
const next = applyAgentConfig(cfg, {
|
|
44
|
+
agentId,
|
|
45
|
+
model,
|
|
46
|
+
taskModels: normalizedTaskModels,
|
|
47
|
+
activeModelProvider: null,
|
|
48
|
+
modelProviders: null
|
|
49
|
+
});
|
|
50
|
+
await writeConfigFile(next);
|
|
51
|
+
if (!opts.json) {
|
|
52
|
+
logConfigUpdated(runtime);
|
|
53
|
+
}
|
|
54
|
+
const payload = {
|
|
55
|
+
agentId,
|
|
56
|
+
model,
|
|
57
|
+
taskModels: normalizedTaskModels
|
|
58
|
+
};
|
|
59
|
+
runtime.log(opts.json ? JSON.stringify(payload, null, 2) : `Agent models updated: ${agentId}`);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
//#endregion
|
|
63
|
+
export { agentsModelsSetCommand };
|
package/dist/commands/agents.js
CHANGED
|
@@ -6,5 +6,6 @@ import { agentsAddCommand } from "./agents.commands.add.js";
|
|
|
6
6
|
import { agentsDeleteCommand } from "./agents.commands.delete.js";
|
|
7
7
|
import { agentsSetIdentityCommand } from "./agents.commands.identity.js";
|
|
8
8
|
import { agentsListCommand } from "./agents.commands.list.js";
|
|
9
|
+
import { agentsModelsSetCommand } from "./agents.commands.models.js";
|
|
9
10
|
|
|
10
11
|
export { agentsListCommand };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { CLOUDFLARE_AI_GATEWAY_DEFAULT_MODEL_REF } from "../providers/cloudflare-ai-gateway-shared.js";
|
|
2
|
-
import { LITELLM_DEFAULT_MODEL_REF } from "../providers/litellm-models.js";
|
|
3
2
|
import { SYNTHETIC_DEFAULT_MODEL_REF } from "../providers/synthetic-models.js";
|
|
4
3
|
import { TOGETHER_DEFAULT_MODEL_REF } from "../providers/together-models.js";
|
|
5
4
|
import { VENICE_DEFAULT_MODEL_REF } from "../providers/venice-models.js";
|
|
@@ -14,7 +13,7 @@ import { createAuthChoiceAgentModelNoter, createAuthChoiceDefaultModelApplier, c
|
|
|
14
13
|
import { KIMI_CODING_MODEL_REF, MISTRAL_DEFAULT_MODEL_REF, MOONSHOT_DEFAULT_MODEL_REF, QIANFAN_DEFAULT_MODEL_REF } from "./onboard-auth.models.js";
|
|
15
14
|
import { XIAOMI_DEFAULT_MODEL_REF, ZAI_DEFAULT_MODEL_REF, setChutesApiKey, setCloudflareAiGatewayConfig, setGeminiApiKey, setKimiCodingApiKey, setLitellmApiKey, setMistralApiKey, setMoonshotApiKey, setOpencodeZenApiKey, setQianfanApiKey, setQwenApiKey, setQwenCodingPlanApiKey, setSyntheticApiKey, setTogetherApiKey, setVeniceApiKey, setVercelAiGatewayApiKey, setXiaomiApiKey, setZaiApiKey } from "./onboard-auth.credentials.js";
|
|
16
15
|
import { applyCloudflareAiGatewayConfig, applyCloudflareAiGatewayProviderConfig, applyVercelAiGatewayConfig, applyVercelAiGatewayProviderConfig } from "./onboard-auth.config-gateways.js";
|
|
17
|
-
import {
|
|
16
|
+
import { applyLitellmProviderConfig } from "./onboard-auth.config-litellm.js";
|
|
18
17
|
import { applyAuthProfileConfig, applyChutesConfig, applyChutesProviderConfig, applyKimiCodeConfig, applyKimiCodeProviderConfig, applyMistralConfig, applyMistralProviderConfig, applyMoonshotConfig, applyMoonshotConfigCn, applyMoonshotProviderConfig, applyMoonshotProviderConfigCn, applyQianfanConfig, applyQianfanProviderConfig, applyQwenCodingPlanConfig, applyQwenCodingPlanProviderConfig, applyQwenConfig, applyQwenProviderConfig, applySyntheticConfig, applySyntheticProviderConfig, applyTogetherConfig, applyTogetherProviderConfig, applyVeniceConfig, applyVeniceProviderConfig, applyXiaomiConfig, applyXiaomiProviderConfig, applyZaiConfig, applyZaiProviderConfig } from "./onboard-auth.config-core.js";
|
|
19
18
|
import { applyOpencodeZenConfig, applyOpencodeZenProviderConfig } from "./onboard-auth.config-opencode.js";
|
|
20
19
|
import "./onboard-auth.js";
|
|
@@ -342,12 +341,8 @@ async function applyAuthChoiceApiProviders(params) {
|
|
|
342
341
|
mode: "api_key"
|
|
343
342
|
});
|
|
344
343
|
}
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
applyDefaultConfig: applyLitellmConfig,
|
|
348
|
-
applyProviderConfig: applyLitellmProviderConfig,
|
|
349
|
-
noteDefault: LITELLM_DEFAULT_MODEL_REF
|
|
350
|
-
});
|
|
344
|
+
nextConfig = applyLitellmProviderConfig(nextConfig);
|
|
345
|
+
await params.prompter.note("LiteLLM is connected. Choose a model returned by this proxy after discovery completes.", "LiteLLM model discovery");
|
|
351
346
|
return {
|
|
352
347
|
config: nextConfig,
|
|
353
348
|
agentModelOverride
|