@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.
Files changed (179) hide show
  1. package/dist/agents/authenticated-model-catalog.js +27 -0
  2. package/dist/agents/current-model-catalog.js +30 -10
  3. package/dist/agents/model-catalog-normalized.js +1 -0
  4. package/dist/agents/model-catalog-source.js +4 -4
  5. package/dist/agents/model-forward-compat.js +19 -1
  6. package/dist/agents/model-metadata.js +37 -8
  7. package/dist/agents/pi-embedded-runner/agent-messages.js +15 -0
  8. package/dist/agents/pi-embedded-runner/compact.js +2 -1
  9. package/dist/agents/pi-embedded-runner/extra-params.js +25 -0
  10. package/dist/agents/pi-embedded-runner/model.js +2 -7
  11. package/dist/agents/pi-embedded-runner/run/attempt.js +4 -5
  12. package/dist/agents/pi-embedded-runner/utils.js +1 -1
  13. package/dist/brand.js +1 -1
  14. package/dist/build-info.json +3 -3
  15. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  16. package/dist/cli/program/register.agent.js +17 -0
  17. package/dist/cli/providers-cli.js +3 -2
  18. package/dist/commands/agents.commands.models.js +63 -0
  19. package/dist/commands/agents.js +1 -0
  20. package/dist/commands/auth-choice.apply.api-providers.js +3 -8
  21. package/dist/commands/auth-choice.apply.openai.js +13 -7
  22. package/dist/commands/auth-choice.model-check.js +1 -2
  23. package/dist/commands/configure.gateway-auth.js +14 -16
  24. package/dist/commands/model-picker.js +25 -7
  25. package/dist/commands/models/list.registry.js +13 -18
  26. package/dist/commands/onboard-auth.config-core.js +1 -1
  27. package/dist/commands/onboard-auth.config-litellm.js +21 -21
  28. package/dist/commands/onboard-auth.credentials.js +0 -1
  29. package/dist/commands/onboard-auth.js +0 -1
  30. package/dist/commands/openai-codex-model-default.js +26 -4
  31. package/dist/config/defaults.js +1 -1
  32. package/dist/config/zod-schema.agent-defaults.js +4 -2
  33. package/dist/config/zod-schema.agent-runtime.js +4 -2
  34. package/dist/config/zod-schema.core.js +4 -2
  35. package/dist/control-ui/assets/{app-WIDYwhr-.js → app-D2RaTXoV.js} +1788 -1755
  36. package/dist/control-ui/assets/chat-model-ref-BZFblCeY.js +2 -0
  37. package/dist/control-ui/assets/{index-K3ysLeTN.js → index-D2nC6I-9.js} +3 -3
  38. package/dist/control-ui/assets/{providers-rQMhp1fb.js → providers-CyjiG5Jw.js} +4 -4
  39. package/dist/control-ui/index.html +1 -1
  40. package/dist/control-ui/version.json +1 -0
  41. package/dist/cron/isolated-agent/run.js +9 -3
  42. package/dist/cron/normalize.js +10 -0
  43. package/dist/gateway/control-ui.js +2 -0
  44. package/dist/gateway/protocol/schema/agents-models-skills.js +6 -2
  45. package/dist/gateway/protocol/schema/cron.js +7 -0
  46. package/dist/gateway/server-methods/models.js +8 -9
  47. package/dist/gateway/server-model-catalog.js +3 -0
  48. package/dist/infra/update-runner.js +31 -3
  49. package/dist/light-update-status.js +10 -10
  50. package/dist/memory/inventory.js +19 -2
  51. package/dist/plugin-sdk/{accounts-BZrfqJmO.js → accounts-CeRNo5Ae.js} +1 -1
  52. package/dist/plugin-sdk/{actions-7_zTh8zC.js → actions-OMRHtXPj.js} +2 -2
  53. package/dist/plugin-sdk/{active-listener-D8NVRD8J.js → active-listener-BlIkS3iR.js} +1 -1
  54. package/dist/plugin-sdk/{audio-preflight-BrVWUkoP.js → audio-preflight-B2n3a2Tj.js} +26 -26
  55. package/dist/plugin-sdk/{audit-2iRlVyQF.js → audit-Ppg6dR_b.js} +1 -1
  56. package/dist/plugin-sdk/{channel-access-BCf1rJsn.js → channel-access-af8dWWRv.js} +1 -1
  57. package/dist/plugin-sdk/{channel-access-configure-B-Z51Qsd.js → channel-access-configure-B6IAGlE0.js} +1 -1
  58. package/dist/plugin-sdk/channel-plugin-common.d.ts +3 -3
  59. package/dist/plugin-sdk/channel-plugin-common.js +4 -4
  60. package/dist/plugin-sdk/{chunk-BREC9ijl.js → chunk-CD76Byie.js} +1 -1
  61. package/dist/plugin-sdk/{chunk-items-BLRCltGL.js → chunk-items-Bu19zrYH.js} +1 -1
  62. package/dist/plugin-sdk/command-status.d.ts +2 -2
  63. package/dist/plugin-sdk/command-status.js +26 -26
  64. package/dist/plugin-sdk/{commands-registry-D3-bFLsz.js → commands-registry-DgS55tNj.js} +2 -2
  65. package/dist/plugin-sdk/{common-BlqMqEqn.js → common-CWvfeiX0.js} +1 -1
  66. package/dist/plugin-sdk/{config-442EDe7Z.js → config-CYDETqcF.js} +130 -134
  67. package/dist/plugin-sdk/{config-schema-DV0zctd2.js → config-schema-CQ4EVcQG.js} +164 -78
  68. package/dist/plugin-sdk/device-pair.d.ts +1 -1
  69. package/dist/plugin-sdk/discord.d.ts +5 -5
  70. package/dist/plugin-sdk/discord.js +19 -19
  71. package/dist/plugin-sdk/{group-mentions-DLOOve8d.d.ts → group-mentions-BxDgHCgj.d.ts} +1 -1
  72. package/dist/plugin-sdk/{handle-action-pNaP87Dr.js → handle-action-B75UVKxF.js} +13 -13
  73. package/dist/plugin-sdk/{helpers-B994qqVW.js → helpers-BuEwju6y.js} +1 -1
  74. package/dist/plugin-sdk/{image-ops-Doq8nZQw.js → image-ops-C66HPeAZ.js} +1 -1
  75. package/dist/plugin-sdk/index.d.ts +8 -8
  76. package/dist/plugin-sdk/index.js +28 -28
  77. package/dist/plugin-sdk/{login-CK2zTIJA.js → login-Amr2DpKU.js} +3 -3
  78. package/dist/plugin-sdk/{login-qr-u8Mn1mCp.js → login-qr-DMQNEi9m.js} +3 -3
  79. package/dist/plugin-sdk/{manager-CeJNf2bH.js → manager-Bvpq49BI.js} +2 -2
  80. package/dist/plugin-sdk/{markdown-tables-DeZztrY6.js → markdown-tables-DmQ7oXOm.js} +1 -1
  81. package/dist/plugin-sdk/{media-CgUAEfhs.js → media-ByLQbEwJ.js} +2 -2
  82. package/dist/plugin-sdk/{monitor-CEtMJuFX.js → monitor-K_u6daGa.js} +30 -30
  83. package/dist/plugin-sdk/{monitor-D-APtCpn.js → monitor-S_7LrvSj.js} +31 -31
  84. package/dist/plugin-sdk/{openresponses-http-g1Iz0xB2.js → openresponses-http-BrDJUZXR.js} +26 -26
  85. package/dist/plugin-sdk/{optional-runtime-dependency-D0BdXz1C.js → optional-runtime-dependency-CbYjAC2b.js} +1 -1
  86. package/dist/plugin-sdk/{outbound-DXGuFrdx.js → outbound-BuDafBBI.js} +6 -6
  87. package/dist/plugin-sdk/{outbound-attachment-oxhGO33g.js → outbound-attachment-DmZmUqFP.js} +2 -2
  88. package/dist/plugin-sdk/{pairing-message-D3WPVg_j.d.ts → pairing-message-D0-UWGFJ.d.ts} +2 -2
  89. package/dist/plugin-sdk/{pairing-message-C29ixrvn.js → pairing-message-e4D4eBDA.js} +1 -1
  90. package/dist/plugin-sdk/{pairing-store-1kcsOWRs.js → pairing-store-T3IGoGZg.js} +2 -2
  91. package/dist/plugin-sdk/{pi-model-discovery-l-xqaEd0.js → pi-model-discovery-DvAG_Png.js} +1 -1
  92. package/dist/plugin-sdk/{pi-model-discovery-runtime-CibV8F8G.js → pi-model-discovery-runtime-NjkUgjIf.js} +2 -2
  93. package/dist/plugin-sdk/provider-web-search-config-contract.d.ts +2 -2
  94. package/dist/plugin-sdk/{pw-ai-9qEBW5-k.js → pw-ai-D7eW43DL.js} +3 -3
  95. package/dist/plugin-sdk/{replies-BX3L8fX7.js → replies-BMIPmEoP.js} +2 -2
  96. package/dist/plugin-sdk/{resolve-outbound-target-D0AK10E7.js → resolve-outbound-target-CXCqUUPV.js} +1 -1
  97. package/dist/plugin-sdk/{resolve-route-UO6XLYH3.js → resolve-route-DJN-SUSt.js} +1 -1
  98. package/dist/plugin-sdk/{retry-policy-C5N8JiHL.js → retry-policy-CY1qY6d7.js} +1 -1
  99. package/dist/plugin-sdk/{runtime-Dnzwux3G.js → runtime-CgOkQe0w.js} +3 -3
  100. package/dist/plugin-sdk/{runtime-dependency-BDDpVKBO.js → runtime-dependency-DvdRNMvs.js} +2 -2
  101. package/dist/plugin-sdk/sat-runtime.d.ts +3 -3
  102. package/dist/plugin-sdk/sat-runtime.js +5 -5
  103. package/dist/plugin-sdk/{send-bcKv8F5E.js → send-2ITqny2W.js} +8 -8
  104. package/dist/plugin-sdk/{send-DGEgo_6f.js → send-BAz22RZr.js} +5 -5
  105. package/dist/plugin-sdk/{send-DcsYRH2f.js → send-BG3RWyil.js} +7 -7
  106. package/dist/plugin-sdk/{send-D5rgCP1r.js → send-Cr-dj6S-.js} +6 -6
  107. package/dist/plugin-sdk/{send-B4XLsTL0.js → send-eTxqFFsw.js} +6 -6
  108. package/dist/plugin-sdk/{session-BoGNOlwv.js → session-C8nJmmVE.js} +2 -2
  109. package/dist/plugin-sdk/{skill-commands-Be8s4TGQ.js → skill-commands-Rm5by9S8.js} +2 -2
  110. package/dist/plugin-sdk/{slack-actions-TNnAXiUx.js → slack-actions-BNIALJTA.js} +11 -11
  111. package/dist/plugin-sdk/{slack-74qForpW.js → slack-xvIVvyEM.js} +38 -38
  112. package/dist/plugin-sdk/slack.d.ts +5 -5
  113. package/dist/plugin-sdk/slack.js +9 -9
  114. package/dist/plugin-sdk/{sticker-cache-CrYayLff.js → sticker-cache-D3oDiu2u.js} +3 -3
  115. package/dist/plugin-sdk/{tables-Ch4js2qy.js → tables-DS5L7lCA.js} +1 -1
  116. package/dist/plugin-sdk/{targets-BGfRUJPE.js → targets-D6lUomJc.js} +1 -1
  117. package/dist/plugin-sdk/{telegram-actions-BGy4AEvF.js → telegram-actions-MSFkDn0m.js} +29 -29
  118. package/dist/plugin-sdk/telegram.d.ts +5 -5
  119. package/dist/plugin-sdk/telegram.js +8 -8
  120. package/dist/plugin-sdk/{thread-bindings.lifecycle-_uQ2EF17.js → thread-bindings.lifecycle-Ry6Vcgw3.js} +3 -3
  121. package/dist/plugin-sdk/{thread-bindings.state-DUg0s_1X.js → thread-bindings.state-C0stmvNk.js} +2 -2
  122. package/dist/plugin-sdk/{tmp-fased-dir-BrbXGSkl.d.ts → tmp-fased-dir-D91GExk4.d.ts} +2 -2
  123. package/dist/plugin-sdk/{types-CBCtqtMn.d.ts → types-BzadOItY.d.ts} +1 -1
  124. package/dist/plugin-sdk/{types-DlKIHIqA.d.ts → types-DKvBJHfH.d.ts} +16 -6
  125. package/dist/plugin-sdk/{types-BJdDoTQF.d.ts → types-DVTIpopt.d.ts} +2 -2
  126. package/dist/plugin-sdk/{types.plugin-CvUiB3Kh.d.ts → types.plugin-BiHPaDTF.d.ts} +2 -1
  127. package/dist/plugin-sdk/{wallet-status-M6aK3abH.js → wallet-status-f0HagNeO.js} +31 -13
  128. package/dist/plugin-sdk/{web-r1KFR44s.js → web-DRNJxHXA.js} +31 -31
  129. package/dist/plugin-sdk/{whatsapp-actions-CID_tqAX.js → whatsapp-actions-BDXZF2R5.js} +13 -13
  130. package/dist/plugin-sdk/{whatsapp-heartbeat-Bk-aZVMa.js → whatsapp-heartbeat-CKgmwCGr.js} +2 -2
  131. package/dist/plugin-sdk/whatsapp.d.ts +5 -5
  132. package/dist/plugin-sdk/whatsapp.js +12 -12
  133. package/dist/plugin-sdk/{wsl-C_STtED7.js → wsl-Biw7Mj39.js} +3 -3
  134. package/dist/providers/huggingface-models.js +0 -30
  135. package/dist/providers/litellm-models.js +1 -1
  136. package/dist/providers/opencode-zen-shared.js +0 -1
  137. package/dist/providers/refresh.js +221 -62
  138. package/dist/providers/registry.js +31 -7
  139. package/dist/providers/runtime-model-catalog.js +181 -0
  140. package/dist/providers/vercel-ai-gateway-models.js +0 -35
  141. package/dist/shared/model-thinking.js +44 -2
  142. package/dist/wizard/onboarding.js +24 -6
  143. package/extensions/acpx/package.json +1 -1
  144. package/extensions/bluebubbles/package.json +1 -1
  145. package/extensions/copilot-proxy/package.json +1 -1
  146. package/extensions/diagnostics-otel/package.json +1 -1
  147. package/extensions/fased-federation/package.json +1 -1
  148. package/extensions/google-gemini-cli-auth/package.json +1 -1
  149. package/extensions/imessage/package.json +1 -1
  150. package/extensions/irc/package.json +1 -1
  151. package/extensions/line/package.json +1 -1
  152. package/extensions/llm-task/package.json +1 -1
  153. package/extensions/lobster/package.json +1 -1
  154. package/extensions/matrix/CHANGELOG.md +12 -0
  155. package/extensions/matrix/package.json +1 -1
  156. package/extensions/mattermost/package.json +1 -1
  157. package/extensions/memory-core/package.json +2 -2
  158. package/extensions/memory-lancedb/package.json +1 -1
  159. package/extensions/minimax-portal-auth/package.json +1 -1
  160. package/extensions/msteams/CHANGELOG.md +12 -0
  161. package/extensions/msteams/package.json +1 -1
  162. package/extensions/nextcloud-talk/package.json +1 -1
  163. package/extensions/nostr/CHANGELOG.md +12 -0
  164. package/extensions/nostr/package.json +1 -1
  165. package/extensions/open-prose/package.json +1 -1
  166. package/extensions/sat-mining/package.json +1 -1
  167. package/extensions/signal/package.json +1 -1
  168. package/extensions/synology-chat/package.json +1 -1
  169. package/extensions/tlon/package.json +1 -1
  170. package/extensions/twitch/CHANGELOG.md +12 -0
  171. package/extensions/twitch/package.json +1 -1
  172. package/extensions/voice-call/CHANGELOG.md +12 -0
  173. package/extensions/voice-call/package.json +1 -1
  174. package/extensions/zalo/CHANGELOG.md +12 -0
  175. package/extensions/zalo/package.json +1 -1
  176. package/extensions/zalouser/CHANGELOG.md +12 -0
  177. package/extensions/zalouser/package.json +1 -1
  178. package/package.json +1 -1
  179. package/dist/control-ui/assets/chat-model-ref-NT82zapt.js +0 -2
@@ -0,0 +1,181 @@
1
+ import { buildModelCatalogMergeKey } from "../agents/model-catalog-normalized.js";
2
+ import { deriveModelMetadata } from "../agents/model-metadata.js";
3
+ import { buildProviderRefreshEnvFromCredentials, fetchProviderRefreshSnapshotForRoutes } from "./refresh.js";
4
+ import { createHash } from "node:crypto";
5
+
6
+ //#region src/providers/runtime-model-catalog.ts
7
+ const DISCOVERY_TTL_MS = 5 * 6e4;
8
+ let cache = null;
9
+ function interactiveRuntimeProviders(store) {
10
+ const credentialTypesByProvider = new Map();
11
+ for (const credential of Object.values(store.profiles ?? {})) {
12
+ const provider = credential.provider.trim().toLowerCase();
13
+ if (!provider) {
14
+ continue;
15
+ }
16
+ const types = credentialTypesByProvider.get(provider) ?? new Set();
17
+ types.add(credential.type);
18
+ credentialTypesByProvider.set(provider, types);
19
+ }
20
+ return new Set([...credentialTypesByProvider.entries()].flatMap(([provider, types]) => !types.has("api_key") && (types.has("oauth") || types.has("token")) ? [provider] : []));
21
+ }
22
+ function resetRuntimeProviderModelCatalogCache() {
23
+ cache = null;
24
+ }
25
+ function discoveryKey(params) {
26
+ const routes = [...params.routes].map((route) => route.trim().toLowerCase()).toSorted();
27
+ const endpoints = routes.map((route) => {
28
+ const provider = params.cfg.models?.providers?.[route];
29
+ return [
30
+ route,
31
+ provider?.baseUrl ?? "",
32
+ provider?.api ?? ""
33
+ ];
34
+ });
35
+ const credentialIdentity = createHash("sha256").update(JSON.stringify(params.store.profiles ?? {})).digest("hex");
36
+ return JSON.stringify({
37
+ endpoints,
38
+ credentialIdentity
39
+ });
40
+ }
41
+ async function loadSnapshot(params) {
42
+ const key = discoveryKey(params);
43
+ const now = Date.now();
44
+ if (cache?.key === key && cache.expiresAt > now) {
45
+ return await cache.value;
46
+ }
47
+ const value = fetchProviderRefreshSnapshotForRoutes({
48
+ routes: params.routes,
49
+ env: buildProviderRefreshEnvFromCredentials({
50
+ env: process.env,
51
+ authStores: [params.store],
52
+ modelProviders: params.cfg.models?.providers
53
+ })
54
+ });
55
+ cache = {
56
+ key,
57
+ expiresAt: now + DISCOVERY_TTL_MS,
58
+ value
59
+ };
60
+ try {
61
+ return await value;
62
+ } catch (error) {
63
+ if (cache?.value === value) {
64
+ cache = null;
65
+ }
66
+ throw error;
67
+ }
68
+ }
69
+ function snapshotCapabilities(model) {
70
+ return {
71
+ ...model.tools !== undefined ? { tools: model.tools } : {},
72
+ ...model.json !== undefined ? { json: model.json } : {},
73
+ ...model.audio !== undefined ? { audio: model.audio } : {},
74
+ ...model.video !== undefined ? { video: model.video } : {},
75
+ ...model.speech !== undefined ? { speech: model.speech } : {},
76
+ ...model.thinkingLevels?.length ? { thinkingLevels: model.thinkingLevels } : {},
77
+ ...model.defaultThinkingLevel ? { defaultThinkingLevel: model.defaultThinkingLevel } : {},
78
+ ...model.thinkingMode ? { thinkingMode: model.thinkingMode } : {},
79
+ ...model.reasoningBudgetSupported !== undefined ? { reasoningBudgetSupported: model.reasoningBudgetSupported } : {}
80
+ };
81
+ }
82
+ function snapshotHasCapabilityMetadata(model) {
83
+ return model.input !== undefined || model.reasoning !== undefined || model.tools !== undefined || model.json !== undefined || model.audio !== undefined || model.video !== undefined || model.speech !== undefined || model.thinkingLevels !== undefined || model.defaultThinkingLevel !== undefined || model.thinkingMode !== undefined || model.reasoningBudgetSupported !== undefined || model.contextWindow !== undefined || model.maxTokens !== undefined;
84
+ }
85
+ function snapshotRoutes(snapshot) {
86
+ const routes = new Map();
87
+ for (const provider of Object.values(snapshot.providers ?? {})) {
88
+ for (const [route, values] of Object.entries(provider.routes ?? {})) {
89
+ routes.set(route.trim().toLowerCase(), values.flatMap((value) => typeof value === "string" ? [{ id: value }] : value?.id?.trim() ? [value] : []));
90
+ }
91
+ }
92
+ return routes;
93
+ }
94
+ function mergeDiscoveredRoute(params) {
95
+ const baseByKey = new Map(params.catalog.map((model) => [buildModelCatalogMergeKey(model.provider, model.id), model]));
96
+ const providerConfig = params.cfg.models?.providers?.[params.route];
97
+ return params.discovered.map((model) => {
98
+ const base = baseByKey.get(buildModelCatalogMergeKey(params.route, model.id));
99
+ const capabilities = snapshotCapabilities(model);
100
+ const entry = {
101
+ id: model.id,
102
+ name: base?.name ?? model.id,
103
+ provider: params.route,
104
+ ...model.contextWindow ?? base?.contextWindow ? { contextWindow: model.contextWindow ?? base?.contextWindow } : {},
105
+ ...model.maxTokens ?? base?.maxTokens ? { maxTokens: model.maxTokens ?? base?.maxTokens } : {},
106
+ ...model.reasoning ?? base?.reasoning ? { reasoning: model.reasoning ?? base?.reasoning } : {},
107
+ input: model.input ?? base?.input ?? ["text"],
108
+ ...base?.baseUrl ?? providerConfig?.baseUrl ? { baseUrl: base?.baseUrl ?? providerConfig?.baseUrl } : {},
109
+ ...base?.api ?? providerConfig?.api ? { api: base?.api ?? providerConfig?.api } : {},
110
+ ...Object.keys(capabilities).length > 0 ? { capabilities } : {},
111
+ catalogSource: "provider-api"
112
+ };
113
+ return {
114
+ ...entry,
115
+ metadata: {
116
+ ...deriveModelMetadata({
117
+ model: entry,
118
+ cfg: params.cfg,
119
+ providerConfig,
120
+ ...snapshotHasCapabilityMetadata(model) ? {
121
+ capabilitySource: "provider-api",
122
+ capabilityRetrievedAt: params.retrievedAt
123
+ } : {}
124
+ }),
125
+ retrievedAt: params.retrievedAt
126
+ }
127
+ };
128
+ });
129
+ }
130
+ async function applyRuntimeProviderModelDiscovery(params) {
131
+ const requestedRoutes = new Set([...params.routes].map((route) => route.trim().toLowerCase()).filter(Boolean));
132
+ if (requestedRoutes.size === 0) {
133
+ return [];
134
+ }
135
+ const runtimeProviders = interactiveRuntimeProviders(params.store);
136
+ const providerApiRoutes = [...requestedRoutes].filter((route) => !runtimeProviders.has(route));
137
+ if (providerApiRoutes.length === 0) {
138
+ return params.catalog;
139
+ }
140
+ let snapshot;
141
+ try {
142
+ snapshot = await loadSnapshot({
143
+ ...params,
144
+ routes: providerApiRoutes
145
+ });
146
+ } catch {
147
+ return params.catalog.filter((model) => !providerApiRoutes.includes(model.provider.trim().toLowerCase()));
148
+ }
149
+ const discoveredRoutes = snapshotRoutes(snapshot);
150
+ const retrievedAt = new Date().toISOString();
151
+ const authoritativeRoutes = new Set([...discoveredRoutes.keys()].filter((route) => requestedRoutes.has(route)));
152
+ const retained = params.catalog.filter((model) => !providerApiRoutes.includes(model.provider.trim().toLowerCase()));
153
+ const discovered = [...authoritativeRoutes].flatMap((route) => mergeDiscoveredRoute({
154
+ route,
155
+ discovered: discoveredRoutes.get(route) ?? [],
156
+ catalog: params.catalog,
157
+ cfg: params.cfg,
158
+ retrievedAt
159
+ }));
160
+ return [...retained, ...discovered].toSorted((left, right) => left.provider.localeCompare(right.provider) || (left.metadata?.recommendationRank ?? Number.MAX_SAFE_INTEGER) - (right.metadata?.recommendationRank ?? Number.MAX_SAFE_INTEGER) || left.name.localeCompare(right.name));
161
+ }
162
+ function filterCatalogToAuthoritativeAvailability(catalog, store) {
163
+ const runtimeProviders = store ? interactiveRuntimeProviders(store) : new Set();
164
+ const byProvider = new Map();
165
+ for (const model of catalog) {
166
+ const provider = model.provider.trim().toLowerCase();
167
+ byProvider.set(provider, [...byProvider.get(provider) ?? [], model]);
168
+ }
169
+ return [...byProvider.entries()].flatMap(([provider, models]) => {
170
+ if (models.some((model) => model.catalogSource === "provider-api")) {
171
+ return models.filter((model) => model.catalogSource === "provider-api");
172
+ }
173
+ if (runtimeProviders.has(provider)) {
174
+ return models.filter((model) => model.catalogSource === "runtime");
175
+ }
176
+ return models;
177
+ });
178
+ }
179
+
180
+ //#endregion
181
+ export { applyRuntimeProviderModelDiscovery, filterCatalogToAuthoritativeAvailability, resetRuntimeProviderModelCatalogCache };
@@ -131,19 +131,6 @@ const VERCEL_AI_GATEWAY_MODEL_CATALOG = [
131
131
  "implicit-caching"
132
132
  ]
133
133
  },
134
- {
135
- id: "google/gemini-3-flash-preview",
136
- contextWindow: 1e6,
137
- maxTokens: 65e3,
138
- tags: [
139
- "reasoning",
140
- "tool-use",
141
- "file-input",
142
- "vision",
143
- "web-search",
144
- "implicit-caching"
145
- ]
146
- },
147
134
  {
148
135
  id: "google/gemini-3.1-flash-lite",
149
136
  contextWindow: 1e6,
@@ -186,28 +173,6 @@ const VERCEL_AI_GATEWAY_MODEL_CATALOG = [
186
173
  "vision"
187
174
  ]
188
175
  },
189
- {
190
- id: "mistral/mistral-small-2603",
191
- contextWindow: 256e3,
192
- maxTokens: 256e3,
193
- tags: [
194
- "reasoning",
195
- "tool-use",
196
- "vision"
197
- ]
198
- },
199
- {
200
- id: "mistral/mistral-large-2512",
201
- contextWindow: 256e3,
202
- maxTokens: 256e3,
203
- tags: ["vision"]
204
- },
205
- {
206
- id: "mistral/devstral-2512",
207
- contextWindow: 256e3,
208
- maxTokens: 256e3,
209
- tags: ["tool-use"]
210
- },
211
176
  {
212
177
  id: "minimax/minimax-m2.7",
213
178
  contextWindow: 204800,
@@ -7,6 +7,14 @@ const BASE_THINKING_LEVELS = [
7
7
  "high"
8
8
  ];
9
9
  const XHIGH_THINKING_LEVELS = [...BASE_THINKING_LEVELS, "xhigh"];
10
+ const MAX_THINKING_LEVELS = [
11
+ "off",
12
+ "low",
13
+ "medium",
14
+ "high",
15
+ "xhigh",
16
+ "max"
17
+ ];
10
18
  const XHIGH_MODEL_REFS = [
11
19
  "openai/gpt-5.6",
12
20
  "openai/gpt-5.6-terra",
@@ -15,6 +23,9 @@ const XHIGH_MODEL_REFS = [
15
23
  "openai/gpt-5.4",
16
24
  "openai/gpt-5.4-mini",
17
25
  "openai/gpt-5.4-nano",
26
+ "openai-codex/gpt-5.6-sol",
27
+ "openai-codex/gpt-5.6-terra",
28
+ "openai-codex/gpt-5.6-luna",
18
29
  "openai-codex/gpt-5.5",
19
30
  "openai-codex/gpt-5.4",
20
31
  "openai-codex/gpt-5.4-mini",
@@ -26,6 +37,21 @@ const XHIGH_MODEL_REFS = [
26
37
  ];
27
38
  const XHIGH_MODEL_SET = new Set(XHIGH_MODEL_REFS.map((entry) => entry.toLowerCase()));
28
39
  const XHIGH_MODEL_IDS = new Set(XHIGH_MODEL_REFS.map((entry) => entry.split("/")[1]?.toLowerCase()).filter((entry) => Boolean(entry)));
40
+ const MAX_MODEL_REFS = new Set([
41
+ "openai/gpt-5.6",
42
+ "openai/gpt-5.6-sol",
43
+ "openai/gpt-5.6-terra",
44
+ "openai/gpt-5.6-luna",
45
+ "openai-codex/gpt-5.6-sol",
46
+ "openai-codex/gpt-5.6-terra",
47
+ "openai-codex/gpt-5.6-luna"
48
+ ].map((entry) => entry.toLowerCase()));
49
+ const MAX_MODEL_IDS = new Set([
50
+ "gpt-5.6",
51
+ "gpt-5.6-sol",
52
+ "gpt-5.6-terra",
53
+ "gpt-5.6-luna"
54
+ ]);
29
55
  function normalizeProviderId(provider) {
30
56
  if (!provider) {
31
57
  return "";
@@ -48,6 +74,9 @@ function normalizeThinkLevel(raw) {
48
74
  if (collapsed === "xhigh" || collapsed === "extrahigh") {
49
75
  return "xhigh";
50
76
  }
77
+ if (key === "max") {
78
+ return "max";
79
+ }
51
80
  if (key === "off") {
52
81
  return "off";
53
82
  }
@@ -85,8 +114,7 @@ function normalizeThinkLevel(raw) {
85
114
  "ultrathink",
86
115
  "think-hard",
87
116
  "thinkhardest",
88
- "highest",
89
- "max"
117
+ "highest"
90
118
  ].includes(key)) {
91
119
  return "high";
92
120
  }
@@ -95,6 +123,17 @@ function normalizeThinkLevel(raw) {
95
123
  }
96
124
  return undefined;
97
125
  }
126
+ function supportsMaxThinking(provider, model) {
127
+ const modelKey = model?.trim().toLowerCase();
128
+ if (!modelKey) {
129
+ return false;
130
+ }
131
+ const providerKey = provider?.trim().toLowerCase();
132
+ if (providerKey) {
133
+ return MAX_MODEL_REFS.has(`${providerKey}/${modelKey}`);
134
+ }
135
+ return MAX_MODEL_IDS.has(modelKey);
136
+ }
98
137
  function supportsXHighThinking(provider, model) {
99
138
  const modelKey = model?.trim().toLowerCase();
100
139
  if (!modelKey) {
@@ -120,6 +159,9 @@ function normalizeThinkingLevels(values) {
120
159
  return levels;
121
160
  }
122
161
  function listGenericThinkingLevels(provider, model) {
162
+ if (supportsMaxThinking(provider, model)) {
163
+ return [...MAX_THINKING_LEVELS];
164
+ }
123
165
  return supportsXHighThinking(provider, model) ? [...XHIGH_THINKING_LEVELS] : [...BASE_THINKING_LEVELS];
124
166
  }
125
167
  function isAnthropicAdaptiveModel(model) {
@@ -2,6 +2,7 @@ import { resolveGatewayPort } from "../config/paths.js";
2
2
  import { resolveUserPath } from "../utils.js";
3
3
  import { defaultRuntime } from "../runtime.js";
4
4
  import { formatCliCommand } from "../cli/command-format.js";
5
+ import { resolveFasedAgentAgentDir } from "../agents/agent-paths.js";
5
6
  import { ensureAuthProfileStore } from "../agents/auth-profiles/store.js";
6
7
  import { readConfigFileSnapshot, writeConfigFile } from "../config/io.js";
7
8
  import "../config/config.js";
@@ -12,9 +13,11 @@ import { DEFAULT_WORKSPACE, applyWizardMetadata, ensureWorkspaceAndSessions, han
12
13
  import { configureWalletForOnboarding, installSignerdBinary, migrateLocalSignerKeystoreToMaterialDir, resolveSignerdBinaryPath, restartLocalSocketSigner } from "./onboarding.wallet.js";
13
14
  import { collectWalletSignerDoctorReport, walletSetupCommand } from "../commands/wallet.js";
14
15
  import { promptAuthChoiceGrouped } from "../commands/auth-choice-prompt.js";
16
+ import { applyPrimaryModel, resolveAuthenticatedDefaultModel } from "../commands/model-picker.js";
15
17
  import { logConfigUpdated } from "../config/logging.js";
16
18
  import { applyAuthChoice } from "../commands/auth-choice.apply.js";
17
19
  import { warnIfModelConfigLooksOff } from "../commands/auth-choice.model-check.js";
20
+ import { resolvePreferredProviderForAuthChoice } from "../commands/auth-choice.preferred-provider.js";
18
21
  import "../commands/auth-choice.js";
19
22
  import { setupChannels } from "../commands/onboard-channels.js";
20
23
  import { applyOnboardingLocalWorkspaceConfig } from "../commands/onboard-config.js";
@@ -37,6 +40,25 @@ import { spawn, spawnSync } from "node:child_process";
37
40
  async function requireRiskAcknowledgement(params) {
38
41
  void params;
39
42
  }
43
+ async function applyOnboardingAuthChoice(params) {
44
+ const agentDir = resolveFasedAgentAgentDir();
45
+ const authResult = await applyAuthChoice({
46
+ authChoice: params.authChoice,
47
+ config: params.config,
48
+ prompter: params.prompter,
49
+ runtime: params.runtime,
50
+ setDefaultModel: false,
51
+ agentDir,
52
+ opts: params.opts
53
+ });
54
+ const preferredProvider = resolvePreferredProviderForAuthChoice(params.authChoice, { config: authResult.config });
55
+ const authenticatedDefault = await resolveAuthenticatedDefaultModel({
56
+ config: authResult.config,
57
+ agentDir,
58
+ preferredProvider
59
+ });
60
+ return authenticatedDefault ? applyPrimaryModel(authResult.config, authenticatedDefault) : authResult.config;
61
+ }
40
62
  async function confirmOnboardingRepair(params) {
41
63
  await params.prompter.note([
42
64
  "Repair is for bad auth/session state while keeping the instance configuration intact.",
@@ -791,18 +813,16 @@ async function runOnboardingWizard(opts, runtime = defaultRuntime, prompter) {
791
813
  nextConfig = customResult.config;
792
814
  await warnIfModelConfigLooksOff(nextConfig, prompter);
793
815
  } else if (authChoice && authChoice !== "skip") {
794
- const authResult = await applyAuthChoice({
816
+ nextConfig = await applyOnboardingAuthChoice({
795
817
  authChoice,
796
818
  config: nextConfig,
797
819
  prompter,
798
820
  runtime,
799
- setDefaultModel: true,
800
821
  opts: {
801
822
  tokenProvider: opts.tokenProvider,
802
823
  token: opts.authChoice === "apiKey" && opts.token ? opts.token : undefined
803
824
  }
804
825
  });
805
- nextConfig = authResult.config;
806
826
  await warnIfModelConfigLooksOff(nextConfig, prompter);
807
827
  }
808
828
  const gateway = await configureGatewayForOnboarding({
@@ -1554,15 +1574,13 @@ async function runOnboardingWizard(opts, runtime = defaultRuntime, prompter) {
1554
1574
  nextConfig = customResult.config;
1555
1575
  await warnIfModelConfigLooksOff(nextConfig, prompter);
1556
1576
  } else if (providerAuthChoice !== "skip") {
1557
- const authResult = await applyAuthChoice({
1577
+ nextConfig = await applyOnboardingAuthChoice({
1558
1578
  authChoice: providerAuthChoice,
1559
1579
  config: nextConfig,
1560
1580
  prompter,
1561
1581
  runtime,
1562
- setDefaultModel: true,
1563
1582
  opts: {}
1564
1583
  });
1565
- nextConfig = authResult.config;
1566
1584
  await warnIfModelConfigLooksOff(nextConfig, prompter);
1567
1585
  }
1568
1586
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fased/acpx",
3
- "version": "0.1.53",
3
+ "version": "0.1.55",
4
4
  "description": "FasedAgent ACP runtime backend via acpx",
5
5
  "type": "module",
6
6
  "dependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fased/bluebubbles",
3
- "version": "0.1.53",
3
+ "version": "0.1.55",
4
4
  "description": "FasedAgent BlueBubbles channel plugin",
5
5
  "type": "module",
6
6
  "fased": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fased/copilot-proxy",
3
- "version": "0.1.53",
3
+ "version": "0.1.55",
4
4
  "private": true,
5
5
  "description": "FasedAgent Copilot Proxy provider plugin",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fased/diagnostics-otel",
3
- "version": "0.1.53",
3
+ "version": "0.1.55",
4
4
  "description": "FasedAgent diagnostics OpenTelemetry exporter",
5
5
  "type": "module",
6
6
  "dependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fased/fased-federation",
3
- "version": "0.1.53",
3
+ "version": "0.1.55",
4
4
  "private": true,
5
5
  "description": "Fased federation adapter package scaffold (A2A + admission helpers)",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fased/google-gemini-cli-auth",
3
- "version": "0.1.53",
3
+ "version": "0.1.55",
4
4
  "private": true,
5
5
  "description": "FasedAgent Gemini CLI OAuth provider plugin",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fased/imessage",
3
- "version": "0.1.53",
3
+ "version": "0.1.55",
4
4
  "private": true,
5
5
  "description": "FasedAgent iMessage channel plugin",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fased/irc",
3
- "version": "0.1.53",
3
+ "version": "0.1.55",
4
4
  "description": "FasedAgent IRC channel plugin",
5
5
  "type": "module",
6
6
  "fased": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fased/line",
3
- "version": "0.1.53",
3
+ "version": "0.1.55",
4
4
  "private": true,
5
5
  "description": "FasedAgent LINE channel plugin",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fased/llm-task",
3
- "version": "0.1.53",
3
+ "version": "0.1.55",
4
4
  "private": true,
5
5
  "description": "FasedAgent JSON-only LLM task plugin",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fased/lobster",
3
- "version": "0.1.53",
3
+ "version": "0.1.55",
4
4
  "description": "Lobster workflow tool plugin (typed pipelines + resumable approvals)",
5
5
  "type": "module",
6
6
  "fased": {
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.55
4
+
5
+ ### Changes
6
+
7
+ - Version alignment with core FasedAgent release numbers.
8
+
9
+ ## 0.1.54
10
+
11
+ ### Changes
12
+
13
+ - Version alignment with core FasedAgent release numbers.
14
+
3
15
  ## 0.1.53
4
16
 
5
17
  ### Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fased/matrix",
3
- "version": "0.1.53",
3
+ "version": "0.1.55",
4
4
  "description": "FasedAgent Matrix channel plugin",
5
5
  "type": "module",
6
6
  "dependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fased/mattermost",
3
- "version": "0.1.53",
3
+ "version": "0.1.55",
4
4
  "description": "FasedAgent Mattermost channel plugin",
5
5
  "type": "module",
6
6
  "fased": {
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@fased/memory-core",
3
- "version": "0.1.53",
3
+ "version": "0.1.55",
4
4
  "private": true,
5
5
  "description": "FasedAgent core memory search plugin",
6
6
  "type": "module",
7
7
  "peerDependencies": {
8
- "@fased/fased": "^0.1.53"
8
+ "@fased/fased": "^0.1.55"
9
9
  },
10
10
  "fased": {
11
11
  "extensions": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fased/memory-lancedb",
3
- "version": "0.1.53",
3
+ "version": "0.1.55",
4
4
  "private": true,
5
5
  "description": "FasedAgent LanceDB-backed long-term memory plugin with auto-recall/capture",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fased/minimax-portal-auth",
3
- "version": "0.1.53",
3
+ "version": "0.1.55",
4
4
  "private": true,
5
5
  "description": "FasedAgent MiniMax Portal OAuth provider plugin",
6
6
  "type": "module",
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.55
4
+
5
+ ### Changes
6
+
7
+ - Version alignment with core FasedAgent release numbers.
8
+
9
+ ## 0.1.54
10
+
11
+ ### Changes
12
+
13
+ - Version alignment with core FasedAgent release numbers.
14
+
3
15
  ## 0.1.53
4
16
 
5
17
  ### Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fased/msteams",
3
- "version": "0.1.53",
3
+ "version": "0.1.55",
4
4
  "description": "FasedAgent Microsoft Teams channel plugin",
5
5
  "type": "module",
6
6
  "dependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fased/nextcloud-talk",
3
- "version": "0.1.53",
3
+ "version": "0.1.55",
4
4
  "description": "FasedAgent Nextcloud Talk channel plugin",
5
5
  "type": "module",
6
6
  "fased": {
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.55
4
+
5
+ ### Changes
6
+
7
+ - Version alignment with core FasedAgent release numbers.
8
+
9
+ ## 0.1.54
10
+
11
+ ### Changes
12
+
13
+ - Version alignment with core FasedAgent release numbers.
14
+
3
15
  ## 0.1.53
4
16
 
5
17
  ### Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fased/nostr",
3
- "version": "0.1.53",
3
+ "version": "0.1.55",
4
4
  "description": "FasedAgent Nostr channel plugin for NIP-04 encrypted DMs",
5
5
  "type": "module",
6
6
  "dependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fased/open-prose",
3
- "version": "0.1.53",
3
+ "version": "0.1.55",
4
4
  "private": true,
5
5
  "description": "OpenProse VM skill pack plugin (slash command + telemetry).",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fased/sat-mining",
3
- "version": "0.1.53",
3
+ "version": "0.1.55",
4
4
  "private": true,
5
5
  "description": "SAT mining plugin scaffold for FasedAgent",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fased/signal",
3
- "version": "0.1.53",
3
+ "version": "0.1.55",
4
4
  "private": true,
5
5
  "description": "FasedAgent Signal channel plugin",
6
6
  "type": "module",