zidane 5.0.4 → 5.0.5
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/chat.d.ts +58 -1
- package/dist/chat.d.ts.map +1 -1
- package/dist/chat.js +2 -2
- package/dist/tui.d.ts +13 -15
- package/dist/tui.d.ts.map +1 -1
- package/dist/tui.js +407 -126
- package/dist/tui.js.map +1 -1
- package/dist/{turn-operations-BF3hMNgo.js → turn-operations-DZ3TrljX.js} +75 -2
- package/dist/turn-operations-DZ3TrljX.js.map +1 -0
- package/package.json +1 -1
- package/dist/turn-operations-BF3hMNgo.js.map +0 -1
|
@@ -2620,6 +2620,79 @@ function buildMcpServers(opts) {
|
|
|
2620
2620
|
return opts.discovered.filter((d) => allow.has(d.config.name)).map((d) => d.config);
|
|
2621
2621
|
}
|
|
2622
2622
|
//#endregion
|
|
2623
|
+
//#region src/chat/model-catalog.ts
|
|
2624
|
+
/**
|
|
2625
|
+
* Build the unified catalog from a list of available providers.
|
|
2626
|
+
*
|
|
2627
|
+
* Provider order is preserved (callers typically pass the picker order
|
|
2628
|
+
* — alphabetical, auth-detection order, etc.); model order inside each
|
|
2629
|
+
* provider matches whatever `modelsFor` returns. The current selection
|
|
2630
|
+
* (when set) is bubbled to the top of its provider's section so it
|
|
2631
|
+
* shows first without disturbing relative ordering elsewhere.
|
|
2632
|
+
*
|
|
2633
|
+
* `modelsFor` is injected (not imported from `./providers`) so the same
|
|
2634
|
+
* helper works with hosts that supply their own model resolver via
|
|
2635
|
+
* `ResolvedConfig.modelsFor`.
|
|
2636
|
+
*/
|
|
2637
|
+
function buildModelCatalog(opts) {
|
|
2638
|
+
const entries = [];
|
|
2639
|
+
for (const provider of opts.providers) {
|
|
2640
|
+
const models = opts.modelsFor(provider.key);
|
|
2641
|
+
if (models.length === 0) continue;
|
|
2642
|
+
let ordered = models;
|
|
2643
|
+
if (opts.current?.providerKey === provider.key) {
|
|
2644
|
+
const idx = models.findIndex((m) => m.id === opts.current?.modelId);
|
|
2645
|
+
if (idx > 0) {
|
|
2646
|
+
const next = models.slice();
|
|
2647
|
+
const [active] = next.splice(idx, 1);
|
|
2648
|
+
next.unshift(active);
|
|
2649
|
+
ordered = next;
|
|
2650
|
+
}
|
|
2651
|
+
}
|
|
2652
|
+
for (const model of ordered) entries.push({
|
|
2653
|
+
providerKey: provider.key,
|
|
2654
|
+
providerLabel: provider.label,
|
|
2655
|
+
model,
|
|
2656
|
+
searchCorpus: buildSearchCorpus(provider, model)
|
|
2657
|
+
});
|
|
2658
|
+
}
|
|
2659
|
+
return entries;
|
|
2660
|
+
}
|
|
2661
|
+
/**
|
|
2662
|
+
* Filter `catalog` by a user query. Empty / whitespace-only queries
|
|
2663
|
+
* pass everything through unchanged (`O(1)` short-circuit). Multi-term
|
|
2664
|
+
* queries (space-separated) require EVERY term to appear somewhere in
|
|
2665
|
+
* the entry's search corpus — so `"claude opus"` matches `claude-opus-4`
|
|
2666
|
+
* regardless of how the words are interleaved with provider names.
|
|
2667
|
+
*
|
|
2668
|
+
* Match is case-insensitive (the corpus is pre-lowercased; the query
|
|
2669
|
+
* is lowercased once per call).
|
|
2670
|
+
*/
|
|
2671
|
+
function filterModelCatalog(catalog, query) {
|
|
2672
|
+
const trimmed = query.trim().toLowerCase();
|
|
2673
|
+
if (!trimmed) return catalog.slice();
|
|
2674
|
+
const terms = trimmed.split(/\s+/);
|
|
2675
|
+
return catalog.filter((entry) => terms.every((t) => entry.searchCorpus.includes(t)));
|
|
2676
|
+
}
|
|
2677
|
+
/**
|
|
2678
|
+
* Find a catalog entry's index by its `{providerKey, modelId}` tuple.
|
|
2679
|
+
* Returns `-1` when not present. Useful when re-rendering the picker
|
|
2680
|
+
* (a query just narrowed the list, where did the selection land?).
|
|
2681
|
+
*/
|
|
2682
|
+
function indexOfEntry(catalog, target) {
|
|
2683
|
+
if (!target) return -1;
|
|
2684
|
+
return catalog.findIndex((e) => e.providerKey === target.providerKey && e.model.id === target.modelId);
|
|
2685
|
+
}
|
|
2686
|
+
function buildSearchCorpus(provider, model) {
|
|
2687
|
+
return [
|
|
2688
|
+
provider.key,
|
|
2689
|
+
provider.label,
|
|
2690
|
+
model.id,
|
|
2691
|
+
model.name ?? "",
|
|
2692
|
+
model.provider ?? ""
|
|
2693
|
+
].join(" ").toLowerCase();
|
|
2694
|
+
}
|
|
2695
|
+
//#endregion
|
|
2623
2696
|
//#region src/chat/oauth.ts
|
|
2624
2697
|
function supportsOAuth(descriptor) {
|
|
2625
2698
|
return descriptor.oauthProvider !== void 0;
|
|
@@ -3601,6 +3674,6 @@ function countNeighbors(turnIds, turnId) {
|
|
|
3601
3674
|
};
|
|
3602
3675
|
}
|
|
3603
3676
|
//#endregion
|
|
3604
|
-
export {
|
|
3677
|
+
export { SETTINGS_TOGGLES as $, modelsForDescriptor as $t, readProjects as A, FILES_TRIGGER as At, defaultMcpsConfigPaths as B, credentialsPath as Bt, useSafeModeQueue as C, titleFromTurns as Ct, isOnSafelist as D, SKILLS_TRIGGER as Dt, getSafelist as E, findGitRoot$1 as Et, supportsOAuth as F, findActiveTrigger as Ft, ageString as G, writeCredentials as Gt, parseMcpsFile as H, readProviderCredential as Ht, buildModelCatalog as I, mergeReferences as It, shortId as J, cerebrasDescriptor as Jt, compactPath as K, BUILTIN_PROVIDERS as Kt, filterModelCatalog as L, useCompletion as Lt, writeProjects as M, uniqueFilesFromReferences as Mt, splitPromptSegments as N, applyInsert as Nt, matchesSafelistEntry as O, createSkillsCompletionProvider as Ot, runOAuthLogin as P, collectReferences as Pt, SETTINGS_CHOICES as Q, modelSupportsReasoning as Qt, indexOfEntry as R, detectAuth as Rt, useSafeModeActions as S, stripSpawnTokensLine as St, addToSafelist as T, toolResultText as Tt, cleanTitle as U, removeProviderCredential as Ut, discoverProjectMcps as V, readCredentials as Vt, generateSessionTitle as W, setProviderCredential as Wt, useEnabledToggleSet as X, getContextWindow as Xt, listProjectFiles as Y, credKeyOf as Yt, DEFAULT_SETTINGS as Z, getModelInfo as Zt, discoverProjectSkills as _, lastContextSizeFromTurns as _t, ThemeProvider as a, DEFAULT_AGENT_ID as an, resolveTheme as at, writeSessionExport as b, saveState as bt, useSurfaces as c, singleAgentRegistry as cn, CATPPUCCIN_LATTE as ct, finalizeStreamingMarkdown as d, ConfigProvider as dt, openaiDescriptor as en, SettingsProvider as et, finalizeStreamingMarkdownForOwner as f, useConfig as ft, defaultSkillScanPaths as g, eventsFromTurns as gt, buildSkillsConfig as h, deriveSessionTitle as ht, turnAsText as i, BUILTIN_AGENTS as in, resolveChipColor as it, suggestSafelistEntry as j, createFilesCompletionProvider as jt, projectsFilePath as k, uniqueSkillNamesFromReferences as kt, useSyntaxStyles as l, CATPPUCCIN_MACCHIATO as lt, useStreamBuffer as m, createStateStore as mt, deleteTurnSafely as n, piIdOf as nn, BUILTIN_THEMES as nt, useColors as o, PLAN_AGENT as on, VAPORWAVE_THEME as ot, turnContextSize as p, resolveConfig as pt, fmtTokens as q, anthropicDescriptor as qt, truncateTurnsAt as r, BUILD_AGENT as rn, DEFAULT_THEME as rt, useSelectStyle as s, resolveAgentId as sn, CATPPUCCIN_FRAPPE as st, countNeighbors as t, openrouterDescriptor as tn, useSettings as tt, useTheme as u, CATPPUCCIN_MOCHA as ut, renderSession as v, listSessionMeta as vt, IMPLICITLY_SAFE_TOOLS as w, toolCallPreview as wt, SafeModeProvider as x, selectableTurnIds as xt, resolveSessionExportTarget as y, loadState as yt, buildMcpServers as z, applyApiKeyEnv as zt };
|
|
3605
3678
|
|
|
3606
|
-
//# sourceMappingURL=turn-operations-
|
|
3679
|
+
//# sourceMappingURL=turn-operations-DZ3TrljX.js.map
|