zidane 7.1.3 → 7.1.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/{acp-B5UfEhMd.js → acp-DbYGzaVK.js} +2 -2
- package/dist/{acp-B5UfEhMd.js.map → acp-DbYGzaVK.js.map} +1 -1
- package/dist/acp-cli.js +4 -4
- package/dist/acp.d.ts +1 -1
- package/dist/acp.js +1 -1
- package/dist/{agent-_xxElOgH.js → agent-BlGt76qk.js} +4 -53
- package/dist/agent-BlGt76qk.js.map +1 -0
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +1 -1
- package/dist/{anthropic-DPPs3wjJ.js → anthropic-BQdAnY-w.js} +2 -2
- package/dist/{anthropic-DPPs3wjJ.js.map → anthropic-BQdAnY-w.js.map} +1 -1
- package/dist/{approvals-u2T19Dc-.js → approvals-BznYVVGD.js} +137 -42
- package/dist/{approvals-u2T19Dc-.js.map → approvals-BznYVVGD.js.map} +1 -1
- package/dist/{auth-HRKkOErn.js → auth-DvMdkpGD.js} +245 -82
- package/dist/{auth-HRKkOErn.js.map → auth-DvMdkpGD.js.map} +1 -1
- package/dist/chat/pure.d.ts +4 -4
- package/dist/chat/pure.js +3 -3
- package/dist/chat.d.ts +6 -6
- package/dist/chat.js +6 -6
- package/dist/contexts/daytona.d.ts +1 -1
- package/dist/contexts/e2b.d.ts +1 -1
- package/dist/{context-segments-BrEsRhA0.js → cred-keys-BbbBr4q3.js} +104 -2
- package/dist/cred-keys-BbbBr4q3.js.map +1 -0
- package/dist/daemon-cli.js +2 -1
- package/dist/daemon-cli.js.map +1 -1
- package/dist/eval.d.ts +1 -1
- package/dist/extensions.d.ts +1 -1
- package/dist/extensions.js +1 -1
- package/dist/headless.d.ts +1 -1
- package/dist/headless.js +1 -1
- package/dist/{index-D3TTaaQ5.d.ts → index-D9ntsW7o.d.ts} +20 -198
- package/dist/index-D9ntsW7o.d.ts.map +1 -0
- package/dist/{index-DZhrTn-v.d.ts → index-Dw8ruU-j.d.ts} +37 -9
- package/dist/index-Dw8ruU-j.d.ts.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/dist/{ipc-ChQeueur.js → ipc-CNrpBs9P.js} +2 -2
- package/dist/{ipc-ChQeueur.js.map → ipc-CNrpBs9P.js.map} +1 -1
- package/dist/ipc.d.ts +28 -6
- package/dist/ipc.d.ts.map +1 -1
- package/dist/ipc.js +4 -4
- package/dist/mcp.d.ts +1 -1
- package/dist/{oauth-B6F43fti.js → oauth-DxHO17JE.js} +10 -8
- package/dist/{oauth-B6F43fti.js.map → oauth-DxHO17JE.js.map} +1 -1
- package/dist/output/stream-json.d.ts +1 -1
- package/dist/output/terminal.d.ts +1 -1
- package/dist/plugins.d.ts +1 -1
- package/dist/presets.d.ts +1 -1
- package/dist/presets.js +1 -1
- package/dist/providers/anthropic.d.ts +1 -1
- package/dist/providers/anthropic.js +1 -1
- package/dist/providers/arcee.d.ts +1 -1
- package/dist/providers/baseten.d.ts +1 -1
- package/dist/providers/cerebras.d.ts +1 -1
- package/dist/providers/local.d.ts +1 -1
- package/dist/providers/openai-compat.d.ts +1 -1
- package/dist/providers/openai.d.ts +1 -1
- package/dist/providers/openai.js +1 -1
- package/dist/providers/openrouter.d.ts +1 -1
- package/dist/providers/xai.d.ts +1 -1
- package/dist/providers/xai.js +1 -1
- package/dist/{providers-DP9kwXYo.js → providers-BVhnFyiY.js} +2 -2
- package/dist/{providers-DP9kwXYo.js.map → providers-BVhnFyiY.js.map} +1 -1
- package/dist/providers.d.ts +1 -1
- package/dist/providers.js +3 -3
- package/dist/restate.d.ts +1 -1
- package/dist/restate.js +1 -1
- package/dist/session/sqlite.d.ts +1 -1
- package/dist/session.d.ts +1 -1
- package/dist/{server-CTUpOdh3.js → shell-path-3tZ2lyQ2.js} +95 -9
- package/dist/shell-path-3tZ2lyQ2.js.map +1 -0
- package/dist/skills.d.ts +1 -1
- package/dist/{tool-formatters-C5s88MUd.d.ts → tool-formatters-CJoSmRjH.d.ts} +83 -3
- package/dist/tool-formatters-CJoSmRjH.d.ts.map +1 -0
- package/dist/tools/fetch-url.d.ts +1 -1
- package/dist/tools/web-search.d.ts +1 -1
- package/dist/tools.d.ts +1 -1
- package/dist/tools.js +1 -1
- package/dist/{transcript-anchors-DxofXw_y.d.ts → transcript-anchors-nWzUc3WT.d.ts} +201 -3
- package/dist/transcript-anchors-nWzUc3WT.d.ts.map +1 -0
- package/dist/tui.d.ts +20 -6
- package/dist/tui.d.ts.map +1 -1
- package/dist/tui.js +388 -58
- package/dist/tui.js.map +1 -1
- package/dist/{turn-operations-BaQnxzhr.d.ts → turn-operations-GRw5vbtr.d.ts} +34 -4
- package/dist/{turn-operations-BaQnxzhr.d.ts.map → turn-operations-GRw5vbtr.d.ts.map} +1 -1
- package/dist/{turn-operations-6JDu2ewy.js → turn-operations-JynC5ODZ.js} +31 -3
- package/dist/{turn-operations-6JDu2ewy.js.map → turn-operations-JynC5ODZ.js.map} +1 -1
- package/dist/types.d.ts +1 -1
- package/docs/CHAT.md +10 -0
- package/docs/TUI.md +1 -1
- package/package.json +1 -1
- package/dist/agent-_xxElOgH.js.map +0 -1
- package/dist/context-segments-BrEsRhA0.js.map +0 -1
- package/dist/index-D3TTaaQ5.d.ts.map +0 -1
- package/dist/index-DZhrTn-v.d.ts.map +0 -1
- package/dist/server-CTUpOdh3.js.map +0 -1
- package/dist/tool-formatters-C5s88MUd.d.ts.map +0 -1
- package/dist/transcript-anchors-DxofXw_y.d.ts.map +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { n as __require } from "./rolldown-runtime-BhDjJH2R.js";
|
|
2
2
|
import { n as THINKING_LEVELS, u as toolResultToText } from "./types-CWgENVLY.js";
|
|
3
|
-
import {
|
|
3
|
+
import { u as oauthAccountLabel } from "./cred-keys-BbbBr4q3.js";
|
|
4
|
+
import { A as buildPostCompactAttachments, Bt as multiEdit, D as resolvePersistDir, E as resolveMcpWarningsDir, Et as waitTask, Gn as renderArtifactRow, It as shell, Jt as edit, Kt as grep, Ln as artifactKindLabel, M as selectFilesFromSession, Ot as createSpawnTool, P as compactConversation, Pt as shellKill, Rt as readFile$1, S as migrateSessionArtifactDirs, Sn as createDebugLog, Wt as listFiles, Xn as effectiveContextWindow, Xt as artifacts_default, Yn as OUTPUT_RESERVE_TOKENS, Z as EMPTY_EXTENSION_REGISTRY, bt as composePresets, cn as mergeKeybindings, dn as readKeybindingsRaw, dt as composeExtensionPreset, f as applyCompactSummaryCutoff, fn as resolveExtensionKeybindings, g as unwrapCallTool, in as formatBindingForDisplay, k as resolveTasksDir, kt as isSpawnTool, lt as buildExtensionPreset, mt as filterRegistryPlugins, q as summaryToTurn, qt as glob, t as createAgent, wt as writeFile$1, xt as definePreset } from "./agent-BlGt76qk.js";
|
|
4
5
|
import { F as parseCommandInvocation, M as commandBlocksToContent, P as executeCommand, c as SKILL_EDIT_METADATA_KEY, g as readSkillEditMarker, j as commandBlockToEvent, l as ZIDANE_EXTENSION_SKILL_NAME, m as extensionDirForCwd, s as EXTENSION_EDIT_METADATA_KEY, u as ZIDANE_SKILL_EDIT_SKILL_NAME, v as withZidaneExtensionSkill, w as generateStructuredData, y as withZidaneSkillEditSkill } from "./src-CkNQKFKr.js";
|
|
5
6
|
import { a as formatDuration, c as previewLine, i as fmtTokens, l as shortId, s as formatTaskSummary, t as ageString } from "./format-BF745pLL.js";
|
|
6
7
|
import { a as DEFAULT_UNREADABLE_DIRS, c as resolveUnreadableDirs, l as resolveWritableRoots, o as isolationAvailability, r as createProcessContext, s as parseAllowWriteSetting, u as resolveWritableRootsAsync } from "./contexts-CRE9pw07.js";
|
|
@@ -15,11 +16,12 @@ import { l as withExtensionSession, o as loadSession, t as createSession } from
|
|
|
15
16
|
import { n as flattenTurns, r as formatTokenUsage } from "./stats-DAKBEKjc.js";
|
|
16
17
|
import { i as installCacheBreakLogger } from "./cache-telemetry-ehVdWsg2.js";
|
|
17
18
|
import { i as findActiveTriggers, n as collectReferences, o as mergeSuggestions, t as applyInsert } from "./completion-core-BRo86R_L.js";
|
|
18
|
-
import { h as sanitizeProviderDiagnosticMetadata, n as THINKING_BINDING_SETTING_ENV } from "./anthropic-
|
|
19
|
+
import { h as sanitizeProviderDiagnosticMetadata, n as THINKING_BINDING_SETTING_ENV } from "./anthropic-BQdAnY-w.js";
|
|
20
|
+
import { s as resolveOAuthApiKey } from "./oauth-DxHO17JE.js";
|
|
19
21
|
import { r as fetchUrl } from "./fetch-url-ma-5_p0p.js";
|
|
20
22
|
import { webSearch } from "./tools/web-search.js";
|
|
21
|
-
import {
|
|
22
|
-
import { T as
|
|
23
|
+
import { B as cacheBreakNoticeText, Bt as isMainSession, Cn as resolveApprovalForPayload, Et as promptTurnRefs, Ft as ORCHESTRATED_BY_KEY, Ht as parseSessionEventXml, Lt as SESSION_ROLE_KEY, N as chunkMarkdownForRender, Nt as MAIN_PLAYBOOK_FRAGMENT, On as chatReferenceTokensFromText, Pt as MAIN_SESSION_TITLE, Q as filterChainFallbacks, Rt as WORKER_REPORT_FRAGMENT, Sn as parseEditOutcomesFromResult, Tn as stripEditOutcomesAnnotation, Ut as renderProjectsBriefing, Vt as orchestratedBy, Wt as renderSessionEventXml, an as hasRunReceipt, hn as previewEditPayload, it as restoreChainFallbacks, m as ownerOf, nn as formatRunReceiptLine, on as runReceiptFromRun, pn as extractEditPayload, q as buildRunModel, qt as sessionEventLabel, u as capTranscriptEvents, wn as rewriteMultiEditHeader, xn as mergeApprovalAndBodyOutcomes, yn as buildEditOutcomesAnnotation, z as cacheBreakChip, zt as artifactsFromTurns } from "./turn-operations-JynC5ODZ.js";
|
|
24
|
+
import { T as modelsForDescriptor, b as getContextWindow, g as anthropicDescriptor, h as BUILTIN_PROVIDERS, i as readCredentials, k as restoreModelOptions, n as applyApiKeyEnv, p as storedCredentialsOf, r as credentialsPath, t as detectAuth, v as credKeyOf, w as modelSupportsReasoning, y as enabledModelOptions } from "./auth-DvMdkpGD.js";
|
|
23
25
|
import { basename, delimiter, dirname, isAbsolute, join, posix, relative, resolve, sep } from "node:path";
|
|
24
26
|
import { Buffer } from "node:buffer";
|
|
25
27
|
import { chmodSync, closeSync, cpSync, createReadStream, createWriteStream, existsSync, mkdirSync, mkdtempSync, openSync, readFileSync, readSync, readdirSync, realpathSync, renameSync, rmSync, statSync, watch, writeFileSync } from "node:fs";
|
|
@@ -14854,6 +14856,8 @@ function formatPathForCwd(projectRelativePath, projectRoot, cwd) {
|
|
|
14854
14856
|
const FETCH_TIMEOUT_MS = 15e3;
|
|
14855
14857
|
/** How long a snapshot stays fresh. Usage windows move in minutes, not seconds. */
|
|
14856
14858
|
const USAGE_CACHE_TTL_MS = 6e4;
|
|
14859
|
+
/** TTL after a failed probe kept the previous good snapshot: retry soon, not in a minute. */
|
|
14860
|
+
const USAGE_RETRY_TTL_MS = 1e4;
|
|
14857
14861
|
/**
|
|
14858
14862
|
* Credential-file key to probe. Keyed by credential key rather than provider
|
|
14859
14863
|
* key so a custom descriptor reusing a builtin credential slot
|
|
@@ -14880,12 +14884,12 @@ function usageSourceFor(descriptor) {
|
|
|
14880
14884
|
function providerUsageSupported(descriptor) {
|
|
14881
14885
|
return usageSourceFor(descriptor) !== null;
|
|
14882
14886
|
}
|
|
14883
|
-
/** Keyed by credential
|
|
14887
|
+
/** Keyed by credential slot + token: two descriptors sharing tokens share a snapshot. */
|
|
14884
14888
|
const cache = /* @__PURE__ */ new Map();
|
|
14885
14889
|
/** In-flight probes, so a footer read and a panel open share one request. */
|
|
14886
14890
|
const inFlight = /* @__PURE__ */ new Map();
|
|
14887
14891
|
/**
|
|
14888
|
-
* Newest probe issued per
|
|
14892
|
+
* Newest probe issued per cache key, as a monotonic ticket. `refresh`
|
|
14889
14893
|
* skips both maps above, so two probes for one key can be outstanding at once
|
|
14890
14894
|
* (panel refresh while the footer's post-run refresh is still in flight); only
|
|
14891
14895
|
* the newest may write the cache, or a slow older probe would pin stale
|
|
@@ -14916,47 +14920,122 @@ function usageChecksOptedOut(env = process.env) {
|
|
|
14916
14920
|
return false;
|
|
14917
14921
|
}
|
|
14918
14922
|
/**
|
|
14919
|
-
* Usage for one provider
|
|
14920
|
-
*
|
|
14921
|
-
*
|
|
14922
|
-
*
|
|
14923
|
+
* Usage for one provider, probed with the credential requests use — or, when
|
|
14924
|
+
* that one is not the kind the probe needs (an API key in use, OAuth accounts
|
|
14925
|
+
* parked beside it), the first stored one that is. What the footer shows.
|
|
14926
|
+
*
|
|
14927
|
+
* `null` means there is nothing to show: the provider has no usage surface,
|
|
14928
|
+
* no credential of the kind its probe needs (file or, for API keys, env), or
|
|
14929
|
+
* the environment opted out (see {@link usageChecksOptedOut}).
|
|
14923
14930
|
*
|
|
14924
14931
|
* Never rejects. Transport and parse failures land in the snapshot.
|
|
14925
14932
|
*/
|
|
14926
14933
|
async function fetchProviderUsage(dataDir, descriptor, opts = {}) {
|
|
14927
14934
|
const source = usageSourceFor(descriptor);
|
|
14928
14935
|
if (!source || usageChecksOptedOut()) return null;
|
|
14929
|
-
const
|
|
14930
|
-
|
|
14931
|
-
|
|
14932
|
-
|
|
14933
|
-
|
|
14934
|
-
|
|
14935
|
-
|
|
14936
|
-
|
|
14936
|
+
const [preferred] = resolveUsageCredentials(dataDir, descriptor, source);
|
|
14937
|
+
if (!preferred) return null;
|
|
14938
|
+
return probeRenewed(dataDir, source, descriptor, preferred, opts);
|
|
14939
|
+
}
|
|
14940
|
+
/**
|
|
14941
|
+
* Usage for EVERY credential of a provider the probe can use — one snapshot
|
|
14942
|
+
* per stored OAuth account, the active one first. What the panel renders.
|
|
14943
|
+
* Empty under the same conditions {@link fetchProviderUsage} returns `null`.
|
|
14944
|
+
*/
|
|
14945
|
+
async function fetchProviderUsageAccounts(dataDir, descriptor, opts = {}) {
|
|
14946
|
+
const source = usageSourceFor(descriptor);
|
|
14947
|
+
if (!source || usageChecksOptedOut()) return [];
|
|
14948
|
+
const credentials = resolveUsageCredentials(dataDir, descriptor, source);
|
|
14949
|
+
return Promise.all(credentials.map((c) => probeRenewed(dataDir, source, descriptor, c, opts)));
|
|
14950
|
+
}
|
|
14951
|
+
/**
|
|
14952
|
+
* {@link probeCached}, after renewing an expired OAuth token in its slot.
|
|
14953
|
+
* Stays synchronous up to the request when no renewal is needed, so callers
|
|
14954
|
+
* that start two probes back to back still see both requests issued at once.
|
|
14955
|
+
*/
|
|
14956
|
+
function probeRenewed(dataDir, source, descriptor, credential, opts) {
|
|
14957
|
+
if (!needsRenewal(credential.cred)) return probeCached(source, descriptor, credential, opts);
|
|
14958
|
+
return renewExpired(dataDir, descriptor, credential).then((renewed) => "status" in renewed ? stampIdentity(renewed, descriptor, credential) : probeCached(source, descriptor, renewed, opts));
|
|
14959
|
+
}
|
|
14960
|
+
/**
|
|
14961
|
+
* An expired OAuth token that carries a refresh token. One without cannot be
|
|
14962
|
+
* renewed and reports `token expired` from the probe itself.
|
|
14963
|
+
*/
|
|
14964
|
+
function needsRenewal(cred) {
|
|
14965
|
+
return cred.kind === "oauth" && typeof cred.expires === "number" && cred.expires <= Date.now() && !!cred.refresh;
|
|
14966
|
+
}
|
|
14967
|
+
/**
|
|
14968
|
+
* Rotate an expired OAuth token through the run path's refresh helper, keyed
|
|
14969
|
+
* to this credential's own slot, and hand back the credential as now stored.
|
|
14970
|
+
* A failed refresh becomes an `unauthorized` snapshot.
|
|
14971
|
+
*/
|
|
14972
|
+
async function renewExpired(dataDir, descriptor, credential) {
|
|
14973
|
+
try {
|
|
14974
|
+
await resolveOAuthApiKey({
|
|
14975
|
+
provider: descriptor.key,
|
|
14976
|
+
providerId: credKeyOf(descriptor),
|
|
14977
|
+
credentialKey: credential.key,
|
|
14978
|
+
credentialsPath: credentialsPath(dataDir),
|
|
14979
|
+
missingError: "not signed in",
|
|
14980
|
+
refreshError: (reason) => reason
|
|
14981
|
+
});
|
|
14982
|
+
} catch {
|
|
14983
|
+
return snapshot({
|
|
14984
|
+
providerKey: descriptor.key,
|
|
14985
|
+
label: descriptor.label
|
|
14986
|
+
}, {
|
|
14987
|
+
status: "unauthorized",
|
|
14988
|
+
error: "refresh failed"
|
|
14989
|
+
});
|
|
14990
|
+
}
|
|
14991
|
+
const stored = readCredentials(dataDir)[credential.key];
|
|
14992
|
+
return stored?.kind === "oauth" ? {
|
|
14993
|
+
...credential,
|
|
14994
|
+
cred: stored
|
|
14995
|
+
} : credential;
|
|
14996
|
+
}
|
|
14997
|
+
/** Probe one credential through the cache / in-flight coalescing. */
|
|
14998
|
+
function probeCached(source, descriptor, credential, opts) {
|
|
14999
|
+
const cacheKey = `${credential.key}\0${credential.cred.kind === "oauth" ? credential.cred.access : credential.cred.value}`;
|
|
15000
|
+
const identify = (snapshot) => stampIdentity(snapshot, descriptor, credential);
|
|
14937
15001
|
if (!opts.refresh) {
|
|
14938
|
-
const cached = cache.get(
|
|
14939
|
-
if (cached && cached.expiresAt > Date.now()) return identify(cached.snapshot);
|
|
14940
|
-
const pending = inFlight.get(
|
|
15002
|
+
const cached = cache.get(cacheKey);
|
|
15003
|
+
if (cached && cached.expiresAt > Date.now()) return Promise.resolve(identify(cached.snapshot));
|
|
15004
|
+
const pending = inFlight.get(cacheKey);
|
|
14941
15005
|
if (pending) return pending.then(identify);
|
|
14942
15006
|
}
|
|
14943
15007
|
const ticket = ++probeTicket;
|
|
14944
|
-
latestProbe.set(
|
|
14945
|
-
const
|
|
14946
|
-
|
|
14947
|
-
|
|
15008
|
+
latestProbe.set(cacheKey, ticket);
|
|
15009
|
+
const previous = cache.get(cacheKey)?.snapshot;
|
|
15010
|
+
const probe = runProbe(source, descriptor, credential.cred).then((fresh) => {
|
|
15011
|
+
const keepPrevious = fresh.status === "unavailable" && previous?.status === "ok";
|
|
15012
|
+
const snapshot = keepPrevious ? previous : fresh;
|
|
15013
|
+
if (latestProbe.get(cacheKey) === ticket) cache.set(cacheKey, {
|
|
15014
|
+
expiresAt: Date.now() + (keepPrevious ? USAGE_RETRY_TTL_MS : USAGE_CACHE_TTL_MS),
|
|
14948
15015
|
snapshot
|
|
14949
15016
|
});
|
|
14950
15017
|
return snapshot;
|
|
14951
15018
|
}).finally(() => {
|
|
14952
|
-
if (inFlight.get(
|
|
15019
|
+
if (inFlight.get(cacheKey) === probe) inFlight.delete(cacheKey);
|
|
14953
15020
|
});
|
|
14954
|
-
inFlight.set(
|
|
15021
|
+
inFlight.set(cacheKey, probe);
|
|
14955
15022
|
return probe.then(identify);
|
|
14956
15023
|
}
|
|
15024
|
+
/** Name the provider, slot, and account a snapshot belongs to. */
|
|
15025
|
+
function stampIdentity(snapshot, descriptor, credential) {
|
|
15026
|
+
return {
|
|
15027
|
+
...snapshot,
|
|
15028
|
+
providerKey: descriptor.key,
|
|
15029
|
+
label: descriptor.label,
|
|
15030
|
+
credentialKey: credential.key,
|
|
15031
|
+
account: credential.cred.kind === "oauth" ? oauthAccountLabel(credential.cred) : null,
|
|
15032
|
+
activeCredential: credential.active
|
|
15033
|
+
};
|
|
15034
|
+
}
|
|
14957
15035
|
/**
|
|
14958
|
-
*
|
|
14959
|
-
* authenticated in a way
|
|
15036
|
+
* Every credential a probe can authenticate with, active slot first, then in
|
|
15037
|
+
* storage order. Empty when the provider isn't authenticated in a way the
|
|
15038
|
+
* probe can use.
|
|
14960
15039
|
*
|
|
14961
15040
|
* An API key is taken from the environment when the file has none: `detectAuth`
|
|
14962
15041
|
* marks a provider available on a shell-set `envKey` alone, and the launcher
|
|
@@ -14965,26 +15044,35 @@ async function fetchProviderUsage(dataDir, descriptor, opts = {}) {
|
|
|
14965
15044
|
* telling them they aren't signed in. OAuth tokens have no env equivalent, so
|
|
14966
15045
|
* those probes stay file-only.
|
|
14967
15046
|
*/
|
|
14968
|
-
function
|
|
15047
|
+
function resolveUsageCredentials(dataDir, descriptor, source) {
|
|
14969
15048
|
const kind = SOURCE_CRED_KIND[source];
|
|
14970
|
-
const
|
|
14971
|
-
|
|
15049
|
+
const credKey = credKeyOf(descriptor);
|
|
15050
|
+
const stored = storedCredentialsOf(readCredentials(dataDir), credKey).filter((s) => s.credential.kind === kind && (s.credential.kind !== "apikey" || s.credential.value)).map((s) => ({
|
|
15051
|
+
key: s.key,
|
|
15052
|
+
cred: s.credential,
|
|
15053
|
+
active: s.active
|
|
15054
|
+
}));
|
|
15055
|
+
if (stored.length > 0) return stored;
|
|
14972
15056
|
if (kind === "apikey" && descriptor.envKey) {
|
|
14973
15057
|
const fromEnv = process.env[descriptor.envKey];
|
|
14974
|
-
if (fromEnv) return {
|
|
14975
|
-
|
|
14976
|
-
|
|
14977
|
-
|
|
15058
|
+
if (fromEnv) return [{
|
|
15059
|
+
key: credKey,
|
|
15060
|
+
cred: {
|
|
15061
|
+
kind: "apikey",
|
|
15062
|
+
value: fromEnv
|
|
15063
|
+
},
|
|
15064
|
+
active: true
|
|
15065
|
+
}];
|
|
14978
15066
|
}
|
|
14979
|
-
return
|
|
15067
|
+
return [];
|
|
14980
15068
|
}
|
|
14981
15069
|
/**
|
|
14982
15070
|
* Usage for every registered provider that has both a usage surface and a
|
|
14983
|
-
* usable credential, in registry order
|
|
15071
|
+
* usable credential, in registry order, every account included.
|
|
14984
15072
|
*/
|
|
14985
15073
|
async function fetchAllProviderUsage(dataDir, registry, opts = {}) {
|
|
14986
15074
|
const candidates = Object.values(registry).filter(providerUsageSupported);
|
|
14987
|
-
return (await Promise.all(candidates.map((descriptor) =>
|
|
15075
|
+
return (await Promise.all(candidates.map((descriptor) => fetchProviderUsageAccounts(dataDir, descriptor, opts)))).flat();
|
|
14988
15076
|
}
|
|
14989
15077
|
async function runProbe(source, descriptor, cred) {
|
|
14990
15078
|
const base = {
|
|
@@ -15002,10 +15090,17 @@ async function runProbe(source, descriptor, cred) {
|
|
|
15002
15090
|
return snapshot(base, { error: err instanceof Error ? err.message : "request failed" });
|
|
15003
15091
|
}
|
|
15004
15092
|
}
|
|
15005
|
-
/**
|
|
15093
|
+
/**
|
|
15094
|
+
* Snapshot factory. Defaults to `unavailable` so failure paths stay one-liners.
|
|
15095
|
+
* The credential identity fields are placeholders here; `probeCached` stamps
|
|
15096
|
+
* the real ones on every return path.
|
|
15097
|
+
*/
|
|
15006
15098
|
function snapshot(base, partial = {}) {
|
|
15007
15099
|
return {
|
|
15008
15100
|
...base,
|
|
15101
|
+
credentialKey: base.providerKey,
|
|
15102
|
+
account: null,
|
|
15103
|
+
activeCredential: true,
|
|
15009
15104
|
status: "unavailable",
|
|
15010
15105
|
plan: null,
|
|
15011
15106
|
windows: [],
|
|
@@ -17217,6 +17312,6 @@ function createApprovalHub(options) {
|
|
|
17217
17312
|
};
|
|
17218
17313
|
}
|
|
17219
17314
|
//#endregion
|
|
17220
|
-
export {
|
|
17315
|
+
export { runOAuthLogin as $, dedupMcpServersByName as $n, getArchivedTodosForRun as $r, discoverProjectPlugins as $t, useSafeModeQueue as A, lastContextSizeFromTurns as Ai, CATPPUCCIN_MACCHIATO as An, chatAutoCompactBehavior as Ar, serializeInteractionResponse as At, USAGE_CACHE_TTL_MS as B, toolCallPreview as Bi, resolveConfig as Bn, DEFAULT_PERSIST_EXCLUDE_TOOLS as Br, resolveCwdPath as Bt, resolveSessionExportTarget as C, createChatTurnsReadTool as Ci, resolveChipColor as Cn, compareSemver as Cr, buildResumedToolResultsTurn as Ct, scopeCwd as D, deriveSessionTitle as Di, GRUVBOX_LIGHT as Dn, performInPlaceSelfUpdate as Dr, isModelInteraction as Dt, resolveSessionCwd as E, createStateStore as Ei, GRUVBOX_DARK as En, parseSemver as Er, isInteractionTool as Et, matchesSafelistEntry as F, saveState as Fi, DiscoveryProvider as Fn, renderAgentsMdBlock as Fr, toTodosSnapshot as Ft, providerUsageSupported as G, useCompletion as Gn, DEFAULT_MAX_TODO_ITEMS as Gr, modelChainMetadata as Gt, fetchAllProviderUsage as H, updateToolEventOutcomes as Hi, ARTIFACTS_COMPLETION_PROVIDER_ID as Hn, accentColor as Hr, createBuiltinCommands as Ht, projectsFilePath as I, serverToolResultSummary as Ii, useDiscovery as In, BUILD_AGENT as Ir, installProviderDiagnosticHook as It, formatPathForCwd as J, importFromClaudeCode as Jn, TODOWRITE_TOOL as Jr, createFileMcpCredentialStore as Jt, usageChecksOptedOut as K, countClaudeSessionFiles as Kn, TODOREAD_TOOL as Kr, sessionModelFallbacks as Kt, readProjects as L, stripSpawnTokensLine as Li, useDiscoveryOptional as Ln, BUILTIN_AGENTS as Lr, createInteractionHub as Lt, addToSafelist as M, loadState as Mi, parseEditorCommand as Mn, groupArtifacts as Mr, useInteractionsQueue as Mt, getSafelist as N, marginTopFor as Ni, quoteForShell as Nn, summarizeArtifactCounts as Nr, STALE_RUN_MARKER_MS as Nt, SafeModeProvider as O, eventsFromTurns as Oi, CATPPUCCIN_FRAPPE as On, performSelfUpdate as Or, makeRequestInteraction as Ot, isOnSafelist as P, noticeTurnContent as Pi, createDiscoverySlot as Pn, discoverAgentsMd as Pr, createChatHost as Pt, oauthUsesManualCodePaste as Q, buildMcpServers as Qn, createTodoTools as Qr, buildPluginContributions as Qt, suggestSafelistEntries as R, sumRunCosts as Ri, ConfigProvider as Rn, DEFAULT_AGENT_ID as Rr, extractEditPayloadForGate as Rt, renderSession as S, chatReferenceTokensForPrompt as Si, DEFAULT_THEME as Sn, checkTarballAvailable as Sr, PRESENT_PLAN_TOOL as St, folderlessCwd as T, compactSummaryEvent as Ti, VAPORWAVE_THEME as Tn, detectPackageManager as Tr, createInteractionTools as Tt, fetchProviderUsage as U, usageByModel as Ui, createArtifactsCompletionProvider as Un, resolveAgentId as Ur, applyThinkingBindingSetting as Ut, clearProviderUsageCache as V, toolResultText as Vi, resolveStoragePaths as Vn, PLAN_AGENT as Vr, serializePreview as Vt, fetchProviderUsageAccounts as W, scoreArtifacts as Wn, singleAgentRegistry as Wr, createMainSession as Wt, normalizeRedirectPaste as X, removeMcpServer as Xn, TODO_WRITE_COUNTS_METADATA_KEY as Xr, patchMcpCredential as Xt, fetchOAuthRedirect as Y, mcpsWritePath as Yn, TODO_STATUS_GLYPHS as Yr, mcpCredentialsPath as Yt, redirectUriFromAuthUrl as Z, upsertMcpServer as Zn, applyTodosSnapshot as Zr, runEndNotice as Zt, buildSpawnEndEvent as _, SUBAGENT_GUIDANCE as _i, SettingsProvider as _n, useRestartRequired as _r, reduceMcpAuth as _t, renderActiveTodoAnchor as a, selectActiveTodos as ai, clipHintsToWidth as an, bootProfileEnabled as ar, saveMcpToolsCache as at, defaultSkillScanPaths as b, buildPlanSystem as bi, useSettings as bn, findInstalledCompanion as br, HOST_INTERACTION_ID_PREFIX as bt, useSelectStyle as c, useActiveTodos as ci, buildHints as cn, buildRestartHint as cr, useMcpToolToggleMap as ct, useTheme as d, DOING_TASKS_DOCTRINE as di, useEnabledToggleSet as dn, runUpdateCommand as dr, indexOfServerRow as dt, getTodosForRun as ei, parsePluginScanPathEnv as en, defaultMcpsConfigPaths as er, supportsOAuth as et, discoverSystemMd as f, IDENTITY_PREFIX as fi, DEFAULT_SETTINGS as fn, UPDATE_APPLIED_MARKER as fr, parentServerName as ft, useStreamBuffer as g, PLAN_MODE_DOCTRINE_NO_PROMPTS as gi, SETTINGS_TOGGLES as gn, updateAppliedMarkerPath as gr, getMcpAuthStatus as gt, userSystemMdPath as h, PLAN_MODE_DOCTRINE as hi, SETTINGS_INPUTS as hn, readUpdateAppliedMarker as hr, useMcpAuthState as ht, createActiveTodoAnchorHooks as i, sanitizeTodoItems as ii, EMPTY_HINTS as in, tryRevealPath as ir, refreshMcpToolsCatalog as it, IMPLICITLY_SAFE_TOOLS as j, listSessionMeta as ji, CATPPUCCIN_MOCHA as jn, chatWindowBehavior as jr, useInteractionsActions as jt, useSafeModeActions as k, getSessionMeta as ki, CATPPUCCIN_LATTE as kn, resolvePlatformPackage as kr, pendingInteractionsFromTurns as kt, useSurfaces as l, ACTIONS_WITH_CARE_DOCTRINE as li, shortChord as ln, buildUpdateHint as lr, useMcpToolToggleSet as lt, userScopeOverridesLoad as m, INTERACTION_GUIDANCE_NO_PROMPTS as mi, SETTINGS_CHOICES as mn, probeInstalledVersion as mr, useMcpAuthDispatch as mt, createMemoryApprovalsStore as n, pickActiveRunId as ni, EditOutcomeLedger as nn, parseMcpsFile as nr, loadMcpToolsCache as nt, ThemeProvider as o, setTodosForRun as oi, hintsLength as on, bootTick as or, subscribeMcpToolsCache as ot, renderSystemMdSeed as p, INTERACTION_GUIDANCE as pi, SETTINGS_CATEGORIES as pn, hasUpdateAppliedMarker as pr, McpAuthProvider as pt, usageSourceFor as q, hasClaudeCodeSetup as qn, TODOS_METADATA_KEY as qr, resolveSandboxFromSettings as qt, computeTurnAnchors as r, pruneTodosByRun as ri, runCompaction as rn, tryOpenBrowser as rr, mcpToolsCachePath as rt, useColors as s, todoProgressLabel as si, truncateTrailing as sn, upgradeInstalledPackages as sr, buildToolToggle as st, createApprovalHub as t, isTodoTool as ti, attachMcpWarnLog as tn, discoverProjectMcps as tr, clearMcpToolsCache as tt, useSyntaxStyles as u, COMMUNICATION_DOCTRINE as ui, listProjectFiles as un, useUpdateCheck as ur, buildVisibleMcpRows as ut, buildSpawnStartEvent as v, TOKEN_DISCIPLINE_DOCTRINE as vi, clampFps as vn, watchInstalledVersion as vr, ASK_USER_TOOL as vt, writeSessionExport as w, DEFAULT_SESSION_TITLE as wi, resolveTheme as wn, detectLibc as wr, createAutomaticInteractionResponse as wt, discoverProjectSkills as x, envSection as xi, BUILTIN_THEMES as xn, checkForUpdate as xr, InteractionsProvider as xt, buildSkillsConfig as y, buildBuildSystem as yi, enforceSettingsInvariants as yn, writeUpdateAppliedMarker as yr, AUTOMATIC_INTERACTION_INSTRUCTION as yt, writeProjects as z, titleFromTurns as zi, useConfig as zn, DEFAULT_BUDGET_EXCLUDE_TOOLS as zr, readFileSafe as zt };
|
|
17221
17316
|
|
|
17222
|
-
//# sourceMappingURL=approvals-
|
|
17317
|
+
//# sourceMappingURL=approvals-BznYVVGD.js.map
|