zidane 9.1.9 → 9.1.13
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-Bha_yCgU.js → acp-Cz5mFUjB.js} +3 -3
- package/dist/{acp-Bha_yCgU.js.map → acp-Cz5mFUjB.js.map} +1 -1
- package/dist/acp-cli.js +4 -4
- package/dist/acp.js +1 -1
- package/dist/{auth-store-port-BvxVXx9g.js → auth-store-port-CDJa8Q8U.js} +2 -2
- package/dist/{auth-store-port-BvxVXx9g.js.map → auth-store-port-CDJa8Q8U.js.map} +1 -1
- package/dist/{auto-update-restart-CF3uPnr4.js → auto-update-restart-B4pU7Qgf.js} +10 -10
- package/dist/{auto-update-restart-CF3uPnr4.js.map → auto-update-restart-B4pU7Qgf.js.map} +1 -1
- package/dist/chat.js +9 -9
- package/dist/{cli-shared-C17TUz6H.js → cli-shared-BVtiiICW.js} +3 -3
- package/dist/{cli-shared-C17TUz6H.js.map → cli-shared-BVtiiICW.js.map} +1 -1
- package/dist/{credentials-BZP-MgtZ.js → credentials-axv5VvMR.js} +2 -2
- package/dist/{credentials-BZP-MgtZ.js.map → credentials-axv5VvMR.js.map} +1 -1
- package/dist/daemon-cli.js +2 -2
- package/dist/{discovery-Czp7bZZP.js → discovery-D7qVZWzq.js} +4 -4
- package/dist/{discovery-Czp7bZZP.js.map → discovery-D7qVZWzq.js.map} +1 -1
- package/dist/{engine-CDuOhwbt.js → engine-DjM5NPIf.js} +3 -3
- package/dist/{engine-CDuOhwbt.js.map → engine-DjM5NPIf.js.map} +1 -1
- package/dist/{executor-CoHqHsCp.js → executor-DlW7qAeN.js} +2 -2
- package/dist/{executor-CoHqHsCp.js.map → executor-DlW7qAeN.js.map} +1 -1
- package/dist/extensions/testing.js +2 -2
- package/dist/{extensions-BEaWxX4e.js → extensions-D7DeZNpn.js} +6 -6
- package/dist/{extensions-BEaWxX4e.js.map → extensions-D7DeZNpn.js.map} +1 -1
- package/dist/extensions.js +5 -5
- package/dist/{google-Bzt7uvy9.js → google-D1zjAViO.js} +2 -2
- package/dist/{google-Bzt7uvy9.js.map → google-D1zjAViO.js.map} +1 -1
- package/dist/{host-DkqB2P7L.js → host-Ds3RDlG5.js} +9 -9
- package/dist/{host-DkqB2P7L.js.map → host-Ds3RDlG5.js.map} +1 -1
- package/dist/{host-signals-Ca_oUeYl.js → host-signals-C8x5Yso0.js} +5 -5
- package/dist/{host-signals-Ca_oUeYl.js.map → host-signals-C8x5Yso0.js.map} +1 -1
- package/dist/{host-version-BwON7XSr.js → host-version-BGZumnpZ.js} +2 -2
- package/dist/{host-version-BwON7XSr.js.map → host-version-BGZumnpZ.js.map} +1 -1
- package/dist/index.js +5 -5
- package/dist/ipc/remote.js +3 -3
- package/dist/{ipc-Dlqz_xIe.js → ipc-DGfuNEfR.js} +4 -4
- package/dist/{ipc-Dlqz_xIe.js.map → ipc-DGfuNEfR.js.map} +1 -1
- package/dist/ipc.js +4 -4
- package/dist/{links-B5Dz7jku.js → links-D_1RhPh5.js} +8 -8
- package/dist/{links-B5Dz7jku.js.map → links-D_1RhPh5.js.map} +1 -1
- package/dist/{loaded-entry-BGN69Fns.js → loaded-entry-CLva6GQT.js} +2 -2
- package/dist/{loaded-entry-BGN69Fns.js.map → loaded-entry-CLva6GQT.js.map} +1 -1
- package/dist/{memory-ZWFqa7di.js → memory-CaFXUvQs.js} +15 -15
- package/dist/{memory-ZWFqa7di.js.map → memory-CaFXUvQs.js.map} +1 -1
- package/dist/{path-display-B3Jeqx9E.js → path-display-ZIWdFaTI.js} +3 -3
- package/dist/{path-display-B3Jeqx9E.js.map → path-display-ZIWdFaTI.js.map} +1 -1
- package/dist/providers/google.js +1 -1
- package/dist/{providers-ChifjOYS.js → providers-CsYrxuX1.js} +2 -2
- package/dist/{providers-ChifjOYS.js.map → providers-CsYrxuX1.js.map} +1 -1
- package/dist/providers.js +1 -1
- package/dist/{registry-mmAX5qBS.js → registry-BY45AOA-.js} +2 -2
- package/dist/{registry-mmAX5qBS.js.map → registry-BY45AOA-.js.map} +1 -1
- package/dist/{registry-TW3C94iD.js → registry-DTotchq6.js} +2 -2
- package/dist/{registry-TW3C94iD.js.map → registry-DTotchq6.js.map} +1 -1
- package/dist/{registry-CYEN4C4M.js → registry-Dl6261Xh.js} +2 -2
- package/dist/{registry-CYEN4C4M.js.map → registry-Dl6261Xh.js.map} +1 -1
- package/dist/{remote-hosts-Ctg9fwQY.js → remote-hosts-usqMiMbs.js} +4 -4
- package/dist/{remote-hosts-Ctg9fwQY.js.map → remote-hosts-usqMiMbs.js.map} +1 -1
- package/dist/{setting-DPim5iCP.js → setting-DzTMJIV3.js} +2 -2
- package/dist/{setting-DPim5iCP.js.map → setting-DzTMJIV3.js.map} +1 -1
- package/dist/{settings-keys-BIWy4T_0.js → settings-keys-DDrfnBHi.js} +2 -2
- package/dist/{settings-keys-BIWy4T_0.js.map → settings-keys-DDrfnBHi.js.map} +1 -1
- package/dist/{system-freeze-CEuTQzNu.js → system-freeze-CY4Hc9WX.js} +2 -2
- package/dist/{system-freeze-CEuTQzNu.js.map → system-freeze-CY4Hc9WX.js.map} +1 -1
- package/dist/tui.js +15 -15
- package/dist/{version-CU8ppdCQ.js → version-Bu3Nc8-U.js} +2 -2
- package/dist/{version-CU8ppdCQ.js.map → version-Bu3Nc8-U.js.map} +1 -1
- package/dist/{wire-GwOPpxJg.js → wire-BKcREhuL.js} +2 -2
- package/dist/{wire-GwOPpxJg.js.map → wire-BKcREhuL.js.map} +1 -1
- package/dist/{ws-CqlZkB4w.js → ws-DriNRyP-.js} +4 -4
- package/dist/{ws-CqlZkB4w.js.map → ws-DriNRyP-.js.map} +1 -1
- package/dist/{ws-client-Bn_asPwE.js → ws-client-PZdbO0fj.js} +2 -2
- package/dist/{ws-client-Bn_asPwE.js.map → ws-client-PZdbO0fj.js.map} +1 -1
- package/docs/RELEASE.md +1 -1
- package/package.json +1 -1
package/dist/acp-cli.js
CHANGED
|
@@ -6,14 +6,14 @@ import { t as anthropic } from "./anthropic-C7QHyMJm.js";
|
|
|
6
6
|
import { arcee } from "./providers/arcee.js";
|
|
7
7
|
import { baseten } from "./providers/baseten.js";
|
|
8
8
|
import { cerebras } from "./providers/cerebras.js";
|
|
9
|
-
import { i as google, o as googleVertex } from "./google-
|
|
9
|
+
import { i as google, o as googleVertex } from "./google-D1zjAViO.js";
|
|
10
10
|
import { r as openai } from "./openai-OxUGZ4q2.js";
|
|
11
11
|
import { r as openrouter } from "./openrouter-7EcfTAju.js";
|
|
12
12
|
import { t as xai } from "./xai-Cl_P3J-7.js";
|
|
13
13
|
import { neuralwatt } from "./providers/neuralwatt.js";
|
|
14
|
-
import { L as modelsForDescriptor, O as credKeyOf, T as BUILTIN_PROVIDERS, d as readCredentials, i as credentialsPath } from "./credentials-
|
|
15
|
-
import { _ as parseStartArgValues, g as buildStartLocalOptions, h as StartUsageError, i as withAcpDefaultTools, t as runAcpStdioServer, v as startLocalArgOptions, y as startProviderNames } from "./acp-
|
|
16
|
-
import { i as detectAuth, n as isRemoteSandboxContext, t as createCliExecution } from "./cli-shared-
|
|
14
|
+
import { L as modelsForDescriptor, O as credKeyOf, T as BUILTIN_PROVIDERS, d as readCredentials, i as credentialsPath } from "./credentials-axv5VvMR.js";
|
|
15
|
+
import { _ as parseStartArgValues, g as buildStartLocalOptions, h as StartUsageError, i as withAcpDefaultTools, t as runAcpStdioServer, v as startLocalArgOptions, y as startProviderNames } from "./acp-Cz5mFUjB.js";
|
|
16
|
+
import { i as detectAuth, n as isRemoteSandboxContext, t as createCliExecution } from "./cli-shared-BVtiiICW.js";
|
|
17
17
|
import { join, resolve } from "node:path";
|
|
18
18
|
import { existsSync } from "node:fs";
|
|
19
19
|
import { randomUUID } from "node:crypto";
|
package/dist/acp.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { n as JsonRpcRemoteError, r as createJsonRpcConnection } from "./json-rpc-G0rBfEar.js";
|
|
2
|
-
import { a as wrapToolsForAcpClient, c as sessionBlocksToAcp, d as CLIENT_TOOL_CALL_METHOD, f as CLIENT_TOOL_CANCEL_METHOD, i as withAcpDefaultTools, l as stopReasonFromRun, m as parseClientToolSpecs, n as AcpProtocolError, o as acpMcpServersToZidane, p as createClientDeclaredTools, r as createAcpServer, s as acpPromptToPromptParts, t as runAcpStdioServer, u as toolResultToAcpContent } from "./acp-
|
|
2
|
+
import { a as wrapToolsForAcpClient, c as sessionBlocksToAcp, d as CLIENT_TOOL_CALL_METHOD, f as CLIENT_TOOL_CANCEL_METHOD, i as withAcpDefaultTools, l as stopReasonFromRun, m as parseClientToolSpecs, n as AcpProtocolError, o as acpMcpServersToZidane, p as createClientDeclaredTools, r as createAcpServer, s as acpPromptToPromptParts, t as runAcpStdioServer, u as toolResultToAcpContent } from "./acp-Cz5mFUjB.js";
|
|
3
3
|
export { AcpProtocolError, CLIENT_TOOL_CALL_METHOD, CLIENT_TOOL_CANCEL_METHOD, JsonRpcRemoteError, acpMcpServersToZidane, acpPromptToPromptParts, createAcpServer, createClientDeclaredTools, createJsonRpcConnection, parseClientToolSpecs, runAcpStdioServer, sessionBlocksToAcp, stopReasonFromRun, toolResultToAcpContent, withAcpDefaultTools, wrapToolsForAcpClient };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as writeCredentialEntry, u as readCredentialEntry } from "./credentials-
|
|
1
|
+
import { C as writeCredentialEntry, u as readCredentialEntry } from "./credentials-axv5VvMR.js";
|
|
2
2
|
//#region src/extensions/integrations/auth-store-port.ts
|
|
3
3
|
/** Prefix of an integration's key in the credentials file. */
|
|
4
4
|
const INTEGRATION_CREDENTIAL_PREFIX = "integration:";
|
|
@@ -206,4 +206,4 @@ function connection(integrationId, methodId, connectedAt, account, label) {
|
|
|
206
206
|
//#endregion
|
|
207
207
|
export { integrationCredentialKey as i, createCredentialsAuthStore as n, fromEntries as r, DEFAULT_ACCOUNT as t };
|
|
208
208
|
|
|
209
|
-
//# sourceMappingURL=auth-store-port-
|
|
209
|
+
//# sourceMappingURL=auth-store-port-CDJa8Q8U.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-store-port-BvxVXx9g.js","names":[],"sources":["../src/extensions/integrations/auth-store-port.ts"],"sourcesContent":["/**\n * The credentials-file {@link AuthStorePort}: integrations live in the same\n * `<dataDir>/credentials.json` as provider sign-ins, each under its own\n * `integration:<id>` key, written with the file's lock, mode and atomic\n * write (`readCredentialEntry` / `writeCredentialEntry` in\n * `src/chat/credentials.ts`, the namespaced-entry API host tokens use).\n *\n * One entry per integration, holding every connection: the entry itself is\n * the default connection (so a reader by key, and an older build, sees it as\n * before), and the others ride in its `connections` list, each shaped like\n * an entry. `#`-qualified keys are provider slots and can't be used.\n *\n * On disk, OAuth connections are `kind: 'oauth'` entries (`access`,\n * `refresh`, `expires`, the same triple the provider refresh code reads)\n * and API keys and tokens are `kind: 'apikey'` entries. The connection\n * fields ride along: on an OAuth entry as an `integration` extra, on an API\n * key entry in `customFields` (strings only).\n *\n * A legacy provider sign-in (`IntegrationSpec.legacyCredentialKey`) is read\n * from its own key and, once adopted, marked with `integrationAdopted`; its\n * tokens stay for a downgrade.\n */\n\nimport type { ApiKeyCredential, OAuthCredential, ProviderCredential } from '../../chat/credentials'\nimport type { Connection, Credential } from '../api/sessions'\nimport type { AuthStorePort, LegacyGrant, StoredIntegration } from './store'\nimport { readCredentialEntry, writeCredentialEntry } from '../../chat/credentials'\n\n/** Prefix of an integration's key in the credentials file. */\nexport const INTEGRATION_CREDENTIAL_PREFIX = 'integration:'\n\n/** Field of an integration entry listing its non-default connections. */\nconst OTHERS_FIELD = 'connections'\n\n/** Field marking a legacy entry an integration adopted. */\nexport const LEGACY_ADOPTED_FIELD = 'integrationAdopted'\n\n/** Account of a connection whose integration names none. */\nexport const DEFAULT_ACCOUNT = 'default'\n\n/**\n * The credentials-file key of an integration.\n *\n * @param integrationId - The integration id.\n */\nexport function integrationCredentialKey(integrationId: string): string {\n return `${INTEGRATION_CREDENTIAL_PREFIX}${integrationId}`\n}\n\n/**\n * An {@link AuthStorePort} over `<dataDir>/credentials.json`.\n *\n * @param dataDir - Directory holding `credentials.json` (the host's `config.paths.dir`).\n */\nexport function createCredentialsAuthStore(dataDir: string): AuthStorePort {\n return {\n read: (id) => {\n const entry = readCredentialEntry(dataDir, integrationCredentialKey(id))\n return entry ? fromEntries(id, entry) : undefined\n },\n write: (id, value) => {\n writeCredentialEntry(dataDir, integrationCredentialKey(id), value?.length ? toEntries(value) : undefined)\n },\n readLegacy: (key) => {\n const entry = readCredentialEntry(dataDir, key)\n return entry ? legacyGrant(entry) : undefined\n },\n markLegacy: (key, integrationId) => {\n const entry = readCredentialEntry(dataDir, key)\n if (entry)\n writeCredentialEntry(dataDir, key, { ...entry, [LEGACY_ADOPTED_FIELD]: integrationId } as ProviderCredential)\n },\n }\n}\n\ninterface OAuthExtra {\n methodId: string\n account?: string\n label?: string\n connectedAt: number\n scopes?: readonly string[]\n extra?: Record<string, unknown>\n}\n\n/**\n * The credentials-file entry of an integration's connections: the default's\n * entry with the others under `connections`.\n *\n * @param value - The connections, the default first. Not empty.\n */\nexport function toEntries(value: readonly StoredIntegration[]): ProviderCredential {\n const [first, ...others] = value\n const entry = toEntry(first!)\n return others.length ? { ...entry, [OTHERS_FIELD]: others.map(toEntry) } as ProviderCredential : entry\n}\n\n/**\n * The connections an integration's entry holds, the default first;\n * `undefined` when it holds none this module wrote.\n *\n * @param integrationId - The integration the entry belongs to.\n * @param entry - The entry read from the file.\n */\nexport function fromEntries(integrationId: string, entry: ProviderCredential): StoredIntegration[] | undefined {\n const others = (entry as { [OTHERS_FIELD]?: unknown })[OTHERS_FIELD]\n const list = [entry, ...(Array.isArray(others) ? others : [])]\n .map(e => (e && typeof e === 'object' ? fromEntry(integrationId, e as ProviderCredential) : undefined))\n .filter((s): s is StoredIntegration => s !== undefined)\n // One connection per account: a hand-edited file could repeat one.\n const seen = new Set<string>()\n const unique = list.filter(s => !seen.has(s.connection.account) && !!seen.add(s.connection.account))\n return unique.length ? unique : undefined\n}\n\n/**\n * The credentials-file entry of one stored connection.\n *\n * @param value - The connection to store.\n */\nexport function toEntry(value: StoredIntegration): ProviderCredential {\n const { connection, credential } = value\n if (credential.type === 'oauth') {\n const integration: OAuthExtra = {\n methodId: connection.methodId,\n connectedAt: connection.connectedAt,\n account: connection.account,\n ...(connection.label !== undefined ? { label: connection.label } : {}),\n ...(credential.scopes ? { scopes: [...credential.scopes] } : {}),\n ...(credential.extra ? { extra: { ...credential.extra } } : {}),\n }\n const entry: OAuthCredential = {\n kind: 'oauth',\n access: credential.accessToken,\n ...(value.refreshToken !== undefined ? { refresh: value.refreshToken } : {}),\n ...(credential.expiresAt !== undefined ? { expires: credential.expiresAt } : {}),\n integration,\n }\n return entry\n }\n const customFields: Record<string, string> = {\n credentialType: credential.type,\n methodId: connection.methodId,\n connectedAt: String(connection.connectedAt),\n account: connection.account,\n }\n if (connection.label !== undefined)\n customFields.label = connection.label\n const entry: ApiKeyCredential = {\n kind: 'apikey',\n value: credential.type === 'apiKey' ? credential.key : credential.token,\n customFields,\n }\n return entry\n}\n\n/**\n * The stored connection a credentials-file entry holds. `undefined` for an\n * entry this module did not write.\n *\n * @param integrationId - The integration the entry belongs to.\n * @param entry - The entry read from the file.\n */\nexport function fromEntry(integrationId: string, entry: ProviderCredential): StoredIntegration | undefined {\n if (entry.kind === 'oauth') {\n const extra = entry.integration as Partial<OAuthExtra> | undefined\n if (!extra || typeof extra.methodId !== 'string' || typeof extra.connectedAt !== 'number' || typeof entry.access !== 'string')\n return undefined\n const credential: Credential = {\n type: 'oauth',\n accessToken: entry.access,\n ...(typeof entry.expires === 'number' ? { expiresAt: entry.expires } : {}),\n ...(Array.isArray(extra.scopes) ? { scopes: extra.scopes.filter((s): s is string => typeof s === 'string') } : {}),\n ...(extra.extra && typeof extra.extra === 'object' && !Array.isArray(extra.extra) ? { extra: extra.extra } : {}),\n }\n return {\n connection: connection(integrationId, extra.methodId, extra.connectedAt, extra.account, extra.label),\n credential,\n ...(typeof entry.refresh === 'string' && entry.refresh ? { refreshToken: entry.refresh } : {}),\n }\n }\n if (entry.kind !== 'apikey' || typeof entry.value !== 'string')\n return undefined\n const fields = entry.customFields ?? {}\n const connectedAt = Number(fields.connectedAt)\n if (typeof fields.methodId !== 'string' || !Number.isFinite(connectedAt))\n return undefined\n const credential: Credential = fields.credentialType === 'token'\n ? { type: 'token', token: entry.value }\n : { type: 'apiKey', key: entry.value }\n return { connection: connection(integrationId, fields.methodId, connectedAt, fields.account, fields.label), credential }\n}\n\n/**\n * The grant of a legacy provider entry, when it was not adopted yet.\n *\n * @param entry - The entry under the legacy key.\n */\nexport function legacyGrant(entry: ProviderCredential): LegacyGrant | undefined {\n const record = entry as unknown as Record<string, unknown>\n if (record[LEGACY_ADOPTED_FIELD] !== undefined)\n return undefined\n const text = (key: string): string | undefined => (typeof record[key] === 'string' && (record[key] as string).trim() ? (record[key] as string).trim() : undefined)\n const account = text('account') ?? text('email')\n const label = text('label') ?? text('email')\n const named = { ...(account ? { account } : {}), ...(label ? { label } : {}) }\n if (entry.kind === 'oauth') {\n if (typeof entry.access !== 'string' || !entry.access)\n return undefined\n const extra: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(entry)) {\n if (!['kind', 'access', 'refresh', 'expires', 'id', 'label', LEGACY_ADOPTED_FIELD].includes(key))\n extra[key] = value\n }\n return {\n credential: {\n type: 'oauth',\n accessToken: entry.access,\n ...(typeof entry.expires === 'number' ? { expiresAt: entry.expires } : {}),\n ...(Object.keys(extra).length ? { extra } : {}),\n },\n ...(typeof entry.refresh === 'string' && entry.refresh ? { refreshToken: entry.refresh } : {}),\n ...named,\n }\n }\n if (entry.kind === 'apikey' && typeof entry.value === 'string' && entry.value)\n return { credential: { type: 'apiKey', key: entry.value }, ...named }\n return undefined\n}\n\nfunction connection(integrationId: string, methodId: string, connectedAt: number, account: unknown, label: unknown): Connection {\n return {\n integrationId,\n methodId,\n account: typeof account === 'string' && account ? account : DEFAUL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Ja8Q8U.js","names":[],"sources":["../src/extensions/integrations/auth-store-port.ts"],"sourcesContent":["/**\n * The credentials-file {@link AuthStorePort}: integrations live in the same\n * `<dataDir>/credentials.json` as provider sign-ins, each under its own\n * `integration:<id>` key, written with the file's lock, mode and atomic\n * write (`readCredentialEntry` / `writeCredentialEntry` in\n * `src/chat/credentials.ts`, the namespaced-entry API host tokens use).\n *\n * One entry per integration, holding every connection: the entry itself is\n * the default connection (so a reader by key, and an older build, sees it as\n * before), and the others ride in its `connections` list, each shaped like\n * an entry. `#`-qualified keys are provider slots and can't be used.\n *\n * On disk, OAuth connections are `kind: 'oauth'` entries (`access`,\n * `refresh`, `expires`, the same triple the provider refresh code reads)\n * and API keys and tokens are `kind: 'apikey'` entries. The connection\n * fields ride along: on an OAuth entry as an `integration` extra, on an API\n * key entry in `customFields` (strings only).\n *\n * A legacy provider sign-in (`IntegrationSpec.legacyCredentialKey`) is read\n * from its own key and, once adopted, marked with `integrationAdopted`; its\n * tokens stay for a downgrade.\n */\n\nimport type { ApiKeyCredential, OAuthCredential, ProviderCredential } from '../../chat/credentials'\nimport type { Connection, Credential } from '../api/sessions'\nimport type { AuthStorePort, LegacyGrant, StoredIntegration } from './store'\nimport { readCredentialEntry, writeCredentialEntry } from '../../chat/credentials'\n\n/** Prefix of an integration's key in the credentials file. */\nexport const INTEGRATION_CREDENTIAL_PREFIX = 'integration:'\n\n/** Field of an integration entry listing its non-default connections. */\nconst OTHERS_FIELD = 'connections'\n\n/** Field marking a legacy entry an integration adopted. */\nexport const LEGACY_ADOPTED_FIELD = 'integrationAdopted'\n\n/** Account of a connection whose integration names none. */\nexport const DEFAULT_ACCOUNT = 'default'\n\n/**\n * The credentials-file key of an integration.\n *\n * @param integrationId - The integration id.\n */\nexport function integrationCredentialKey(integrationId: string): string {\n return `${INTEGRATION_CREDENTIAL_PREFIX}${integrationId}`\n}\n\n/**\n * An {@link AuthStorePort} over `<dataDir>/credentials.json`.\n *\n * @param dataDir - Directory holding `credentials.json` (the host's `config.paths.dir`).\n */\nexport function createCredentialsAuthStore(dataDir: string): AuthStorePort {\n return {\n read: (id) => {\n const entry = readCredentialEntry(dataDir, integrationCredentialKey(id))\n return entry ? fromEntries(id, entry) : undefined\n },\n write: (id, value) => {\n writeCredentialEntry(dataDir, integrationCredentialKey(id), value?.length ? toEntries(value) : undefined)\n },\n readLegacy: (key) => {\n const entry = readCredentialEntry(dataDir, key)\n return entry ? legacyGrant(entry) : undefined\n },\n markLegacy: (key, integrationId) => {\n const entry = readCredentialEntry(dataDir, key)\n if (entry)\n writeCredentialEntry(dataDir, key, { ...entry, [LEGACY_ADOPTED_FIELD]: integrationId } as ProviderCredential)\n },\n }\n}\n\ninterface OAuthExtra {\n methodId: string\n account?: string\n label?: string\n connectedAt: number\n scopes?: readonly string[]\n extra?: Record<string, unknown>\n}\n\n/**\n * The credentials-file entry of an integration's connections: the default's\n * entry with the others under `connections`.\n *\n * @param value - The connections, the default first. Not empty.\n */\nexport function toEntries(value: readonly StoredIntegration[]): ProviderCredential {\n const [first, ...others] = value\n const entry = toEntry(first!)\n return others.length ? { ...entry, [OTHERS_FIELD]: others.map(toEntry) } as ProviderCredential : entry\n}\n\n/**\n * The connections an integration's entry holds, the default first;\n * `undefined` when it holds none this module wrote.\n *\n * @param integrationId - The integration the entry belongs to.\n * @param entry - The entry read from the file.\n */\nexport function fromEntries(integrationId: string, entry: ProviderCredential): StoredIntegration[] | undefined {\n const others = (entry as { [OTHERS_FIELD]?: unknown })[OTHERS_FIELD]\n const list = [entry, ...(Array.isArray(others) ? others : [])]\n .map(e => (e && typeof e === 'object' ? fromEntry(integrationId, e as ProviderCredential) : undefined))\n .filter((s): s is StoredIntegration => s !== undefined)\n // One connection per account: a hand-edited file could repeat one.\n const seen = new Set<string>()\n const unique = list.filter(s => !seen.has(s.connection.account) && !!seen.add(s.connection.account))\n return unique.length ? unique : undefined\n}\n\n/**\n * The credentials-file entry of one stored connection.\n *\n * @param value - The connection to store.\n */\nexport function toEntry(value: StoredIntegration): ProviderCredential {\n const { connection, credential } = value\n if (credential.type === 'oauth') {\n const integration: OAuthExtra = {\n methodId: connection.methodId,\n connectedAt: connection.connectedAt,\n account: connection.account,\n ...(connection.label !== undefined ? { label: connection.label } : {}),\n ...(credential.scopes ? { scopes: [...credential.scopes] } : {}),\n ...(credential.extra ? { extra: { ...credential.extra } } : {}),\n }\n const entry: OAuthCredential = {\n kind: 'oauth',\n access: credential.accessToken,\n ...(value.refreshToken !== undefined ? { refresh: value.refreshToken } : {}),\n ...(credential.expiresAt !== undefined ? { expires: credential.expiresAt } : {}),\n integration,\n }\n return entry\n }\n const customFields: Record<string, string> = {\n credentialType: credential.type,\n methodId: connection.methodId,\n connectedAt: String(connection.connectedAt),\n account: connection.account,\n }\n if (connection.label !== undefined)\n customFields.label = connection.label\n const entry: ApiKeyCredential = {\n kind: 'apikey',\n value: credential.type === 'apiKey' ? credential.key : credential.token,\n customFields,\n }\n return entry\n}\n\n/**\n * The stored connection a credentials-file entry holds. `undefined` for an\n * entry this module did not write.\n *\n * @param integrationId - The integration the entry belongs to.\n * @param entry - The entry read from the file.\n */\nexport function fromEntry(integrationId: string, entry: ProviderCredential): StoredIntegration | undefined {\n if (entry.kind === 'oauth') {\n const extra = entry.integration as Partial<OAuthExtra> | undefined\n if (!extra || typeof extra.methodId !== 'string' || typeof extra.connectedAt !== 'number' || typeof entry.access !== 'string')\n return undefined\n const credential: Credential = {\n type: 'oauth',\n accessToken: entry.access,\n ...(typeof entry.expires === 'number' ? { expiresAt: entry.expires } : {}),\n ...(Array.isArray(extra.scopes) ? { scopes: extra.scopes.filter((s): s is string => typeof s === 'string') } : {}),\n ...(extra.extra && typeof extra.extra === 'object' && !Array.isArray(extra.extra) ? { extra: extra.extra } : {}),\n }\n return {\n connection: connection(integrationId, extra.methodId, extra.connectedAt, extra.account, extra.label),\n credential,\n ...(typeof entry.refresh === 'string' && entry.refresh ? { refreshToken: entry.refresh } : {}),\n }\n }\n if (entry.kind !== 'apikey' || typeof entry.value !== 'string')\n return undefined\n const fields = entry.customFields ?? {}\n const connectedAt = Number(fields.connectedAt)\n if (typeof fields.methodId !== 'string' || !Number.isFinite(connectedAt))\n return undefined\n const credential: Credential = fields.credentialType === 'token'\n ? { type: 'token', token: entry.value }\n : { type: 'apiKey', key: entry.value }\n return { connection: connection(integrationId, fields.methodId, connectedAt, fields.account, fields.label), credential }\n}\n\n/**\n * The grant of a legacy provider entry, when it was not adopted yet.\n *\n * @param entry - The entry under the legacy key.\n */\nexport function legacyGrant(entry: ProviderCredential): LegacyGrant | undefined {\n const record = entry as unknown as Record<string, unknown>\n if (record[LEGACY_ADOPTED_FIELD] !== undefined)\n return undefined\n const text = (key: string): string | undefined => (typeof record[key] === 'string' && (record[key] as string).trim() ? (record[key] as string).trim() : undefined)\n const account = text('account') ?? text('email')\n const label = text('label') ?? text('email')\n const named = { ...(account ? { account } : {}), ...(label ? { label } : {}) }\n if (entry.kind === 'oauth') {\n if (typeof entry.access !== 'string' || !entry.access)\n return undefined\n const extra: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(entry)) {\n if (!['kind', 'access', 'refresh', 'expires', 'id', 'label', LEGACY_ADOPTED_FIELD].includes(key))\n extra[key] = value\n }\n return {\n credential: {\n type: 'oauth',\n accessToken: entry.access,\n ...(typeof entry.expires === 'number' ? { expiresAt: entry.expires } : {}),\n ...(Object.keys(extra).length ? { extra } : {}),\n },\n ...(typeof entry.refresh === 'string' && entry.refresh ? { refreshToken: entry.refresh } : {}),\n ...named,\n }\n }\n if (entry.kind === 'apikey' && typeof entry.value === 'string' && entry.value)\n return { credential: { type: 'apiKey', key: entry.value }, ...named }\n return undefined\n}\n\nfunction connection(integrationId: string, methodId: string, connectedAt: number, account: unknown, label: unknown): Connection {\n return {\n integrationId,\n methodId,\n account: typeof account === 'string' && account ? account : DEFAULT_ACCOUNT,\n ...(typeof label === 'string' && label ? { label } : {}),\n connectedAt,\n }\n}\n"],"mappings":";;;AA6BA,MAAa,gCAAg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} from "./types-DuSJ8EKs.js";
|
|
18
18
|
import { n as humanBytes } from "./format-bytes-LHrZVMIt.js";
|
|
19
19
|
import { n as createDecider } from "./decisions-B5Mnx7Zr.js";
|
|
20
|
-
import { Bt as resolveExtensionKeybindings, It as mergeKeybindings, zt as readKeybindingsRaw } from "./registry-
|
|
20
|
+
import { Bt as resolveExtensionKeybindings, It as mergeKeybindings, zt as readKeybindingsRaw } from "./registry-DTotchq6.js";
|
|
21
21
|
import { n as entryPortOf, t as createProcessContext } from "./contexts-DLZTSRHU.js";
|
|
22
22
|
import { c as terminalProcesses, r as hasLocalPty } from "./local-terminal-lBMwNIZl.js";
|
|
23
23
|
import { n as createAnsiStripper } from "./types-4q1bFG53.js";
|
|
@@ -45,24 +45,24 @@ import { a as listMarkdownDefFiles, i as loadMarkdownCommands, n as applyMarkdow
|
|
|
45
45
|
import { t as projectUserPaths } from "./project-user-paths-Chsi83mp.js";
|
|
46
46
|
import { B as githubTokenSource, F as configureGithubClient, I as createGithubClient, N as clockSkewMs, P as clockTime$1, R as githubClient, V as normalizeGithubHost, r as EMPTY_EXTENSION_REGISTRY } from "./row-fields-CAYcZogp.js";
|
|
47
47
|
import { r as artifacts_default } from "./presets-D9YhrgOL.js";
|
|
48
|
-
import { t as ZIDANE_VERSION } from "./version-
|
|
48
|
+
import { t as ZIDANE_VERSION } from "./version-Bu3Nc8-U.js";
|
|
49
49
|
import { n as abortableInstallIo, s as parseInstallSource } from "./source-3ZnEPOSa.js";
|
|
50
|
-
import { S as withZidaneSkillEditSkill, a as sectionDigest, c as EXTENSION_EDIT_METADATA_KEY, d as ZIDANE_SKILL_EDIT_SKILL_NAME, g as extensionDirForCwd, i as latestSystemSnapshot, l as SKILL_EDIT_METADATA_KEY, n as announcedDigest, o as sectionDigests, r as catalogChangeNotes, s as systemSnapshotTurn, u as ZIDANE_EXTENSION_SKILL_NAME, v as readSkillEditMarker, x as withZidaneExtensionSkill } from "./system-freeze-
|
|
50
|
+
import { S as withZidaneSkillEditSkill, a as sectionDigest, c as EXTENSION_EDIT_METADATA_KEY, d as ZIDANE_SKILL_EDIT_SKILL_NAME, g as extensionDirForCwd, i as latestSystemSnapshot, l as SKILL_EDIT_METADATA_KEY, n as announcedDigest, o as sectionDigests, r as catalogChangeNotes, s as systemSnapshotTurn, u as ZIDANE_EXTENSION_SKILL_NAME, v as readSkillEditMarker, x as withZidaneExtensionSkill } from "./system-freeze-CY4Hc9WX.js";
|
|
51
51
|
import { d as querySessions } from "./references-BEKthBnn.js";
|
|
52
52
|
import { r as createLogger, t as consoleSink } from "./logger-BQj8QCJp.js";
|
|
53
|
-
import { F as extensionRuntimeOf, L as filterRegistryPlugins } from "./extensions-
|
|
53
|
+
import { F as extensionRuntimeOf, L as filterRegistryPlugins } from "./extensions-D7DeZNpn.js";
|
|
54
54
|
import { t as resolveStorageDirs } from "./xdg-DFSAQQG8.js";
|
|
55
55
|
import { l as resolveOAuthApiKey } from "./oauth-HKL8zPcd.js";
|
|
56
56
|
import { p as oauthAccountLabel } from "./cred-keys-C0KaSRp7.js";
|
|
57
57
|
import { n as sanitizeProviderDiagnosticMetadata, o as THINKING_BINDING_SETTING_ENV, s as anthropicEffortForLevel } from "./anthropic-C7QHyMJm.js";
|
|
58
|
-
import { A as enabledModelOptions, I as modelSupportsReasoning, L as modelsForDescriptor, O as credKeyOf, P as modelLabel, S as storedCredentialsOf, T as BUILTIN_PROVIDERS, V as restoreModelOptions, _ as setCredentialEmail, a as ensureCredentialIds, c as providerFactoryOptions, d as readCredentials, i as credentialsPath, j as getContextWindow, k as defaultModelOf, t as applyApiKeyEnv } from "./credentials-
|
|
58
|
+
import { A as enabledModelOptions, I as modelSupportsReasoning, L as modelsForDescriptor, O as credKeyOf, P as modelLabel, S as storedCredentialsOf, T as BUILTIN_PROVIDERS, V as restoreModelOptions, _ as setCredentialEmail, a as ensureCredentialIds, c as providerFactoryOptions, d as readCredentials, i as credentialsPath, j as getContextWindow, k as defaultModelOf, t as applyApiKeyEnv } from "./credentials-axv5VvMR.js";
|
|
59
59
|
import { n as defaultPluginDataRoot, r as loadAgentPlugin } from "./plugins-D0O18C1m.js";
|
|
60
60
|
import { i as sqliteStoreConnection } from "./sqlite-store-iz6pMqe0.js";
|
|
61
61
|
import { a as createGenerateImageTool } from "./tools-E7HG_n5f.js";
|
|
62
62
|
import { d as buildBuildSystem, f as buildPlanSystem, h as replaceEnvSection, m as envSectionDate, p as envSection } from "./agent-prompt-BXVwL89Y.js";
|
|
63
63
|
import { L as readPlansBag, M as formatUserEditNote, R as viewPlans, S as activePlanSummary, c as isSecretAnswer, d as isSecretTtl, f as savedSecretReference, j as formatStoppedNotice, l as isSecretName, m as secretPathFor, p as secretExpiresAt, r as SECRETS_ENV_VAR, s as declinedSecretReference, u as isSecretReference, w as applyingPlan, x as SESSION_SCOPE } from "./protocol-B-UjvTMK.js";
|
|
64
64
|
import { C as planScopeForRun, T as readSessionPlans, _ as secretQuestionsOf, a as buildResumedToolResultsTurn, b as commitPlanEventToStore, c as interactionAwakeableKey, d as isRefusedInteraction, g as planRejectionReason, h as pendingInteractionsFromTurns, i as PRESENT_PLAN_TOOL, o as createAutomaticInteractionResponse, r as HOST_INTERACTION_ID_PREFIX, s as createInteractionTools, t as ASK_USER_TOOL, u as isModelInteraction, y as commitPlanEvent } from "./interactions-protocol-K4Trjw9h.js";
|
|
65
|
-
import { C as profileTools, E as singleAgentRegistry, T as sessionComposition, _ as availableAgents, a as deleteSessionData, b as compositionFits, d as BUILTIN_AGENTS, f as DEFAULT_AGENT_ID, g as READ_ONLY_TOOLS, i as createSessionInStore, j as isTodoTool, n as isDurabilityMode, s as forkSession, v as builtInPromptOf, w as resolveAgentId, x as compositionTools } from "./setting-
|
|
65
|
+
import { C as profileTools, E as singleAgentRegistry, T as sessionComposition, _ as availableAgents, a as deleteSessionData, b as compositionFits, d as BUILTIN_AGENTS, f as DEFAULT_AGENT_ID, g as READ_ONLY_TOOLS, i as createSessionInStore, j as isTodoTool, n as isDurabilityMode, s as forkSession, v as builtInPromptOf, w as resolveAgentId, x as compositionTools } from "./setting-DzTMJIV3.js";
|
|
66
66
|
import { _ as runSessionEnvironmentAction, b as workspacePath, c as environmentMetadata, f as parseEnvironmentRequest, g as resolveExecution, h as requireEnvironmentProvider, i as assertEnvironmentReady, l as environmentTakesBranch, m as readSessionEnvironment, o as createEnvironmentRegistry, r as LOCAL_ENVIRONMENT, s as environmentActionSummaries, u as initialEnvironment, v as teardownSessionEnvironment, y as verifyEnvironment } from "./environment-Cxws_RyM.js";
|
|
67
67
|
import { E as restoreChainFallbacks, a as replaceTurnTextBlocks, c as SESSION_ACCOUNT_METADATA_KEY, f as buildRunModel, i as referencedRuns, l as modelChainMetadata, n as deleteTurnSafely, o as truncateTurnsAt, u as readSessionAccount } from "./turn-operations-CWoCTC_L.js";
|
|
68
68
|
import { $ as sessionLink, B as isSideSession, D as MAIN_SESSION_TITLE, E as MAIN_PLAYBOOK_FRAGMENT, F as artifactsFromTurns, G as renderProjectsBriefing, H as parseOrchestrationTools, I as capRequestPayload, J as sessionCreator, K as renderSessionEventXml, L as isBackgroundSession, N as SUBSCRIBE_KEY, O as ORCHESTRATED_BY_KEY, P as WORKER_REPORT_FRAGMENT, R as isMainSession, T as CREATED_BY_KEY, V as orchestratedBy, W as parseSessionScope, Z as sessionEventLabel, _t as runReceiptFromRun, c as extensionSpace, et as sessionOrchestrationTools, ft as formatRunReceiptLine, ht as hasRunReceipt, j as SESSION_ROLE_KEY, k as ORCHESTRATION_TOOLS_KEY, m as readSessionSpaceId, q as scopeMatches, rt as sideSessionParent, tt as sessionSubscription, u as isExtensionSpaceId, w as parseModelSetting, z as isOrchestratorSession } from "./spaces-DOaCwIDA.js";
|
|
@@ -80,9 +80,9 @@ import { t as StreamQueue } from "./stream-queue-Cd9OJxl7.js";
|
|
|
80
80
|
import { t as createDaytonaProvider } from "./daytona-09L4otMp.js";
|
|
81
81
|
import { n as hostWorkspaceMounts, t as createDockerContext } from "./docker-D3CARts8.js";
|
|
82
82
|
import { t as createE2BProvider } from "./e2b-4ByYdO1e.js";
|
|
83
|
-
import { g as fieldsReadBy, s as modelKey, t as accountModelKey } from "./providers-
|
|
83
|
+
import { g as fieldsReadBy, s as modelKey, t as accountModelKey } from "./providers-CsYrxuX1.js";
|
|
84
84
|
import { n as sqliteRuntimeForStore } from "./sqlite-runtime-COkBGhzM.js";
|
|
85
|
-
import { a as integrationCredentialsOf, i as detectAuth, o as isIntegrationCredentialKey, r as activeAccountOf, t as createCliExecution } from "./cli-shared-
|
|
85
|
+
import { a as integrationCredentialsOf, i as detectAuth, o as isIntegrationCredentialKey, r as activeAccountOf, t as createCliExecution } from "./cli-shared-BVtiiICW.js";
|
|
86
86
|
import { t as createSchedules } from "./scheduler-D5T4GvNo.js";
|
|
87
87
|
import { a as scheduleTargetSession, i as scheduleLabel } from "./validate-53YmvQ3V.js";
|
|
88
88
|
import { d as isEnvironmentEnabled, p as resolveProviderConfig, u as describeEnvironments } from "./host-scoped-settings-Dh4EILMN.js";
|
|
@@ -22771,7 +22771,7 @@ function pickOAuthSelectOption(options, input) {
|
|
|
22771
22771
|
*/
|
|
22772
22772
|
async function runIntegrationSignIn(descriptor, options) {
|
|
22773
22773
|
if (!descriptor.integration) throw new Error(`${descriptor.label} does not sign in with an integration.`);
|
|
22774
|
-
const { signInWithIntegration } = await import("./registry-
|
|
22774
|
+
const { signInWithIntegration } = await import("./registry-BY45AOA-.js").then((n) => n.r);
|
|
22775
22775
|
return signInWithIntegration(descriptor.integration, loginCallbacks(descriptor, options), options.signal ? { signal: options.signal } : {});
|
|
22776
22776
|
}
|
|
22777
22777
|
/**
|
|
@@ -30376,4 +30376,4 @@ function hasUpdateAppliedMarker(cacheDir) {
|
|
|
30376
30376
|
//#endregion
|
|
30377
30377
|
export { CLAUDE_IMPORT_NOTES as $, resolveCwdPath as $n, createArtifactKindsHost as $t, clearProviderUsageCache as A, chatReferenceTokensForPrompt as An, writeWorkspaceFile as At, exportFilename as B, insideDeclaredRoots as Bn, mcpsWritePath as Bt, parseSemver as C, createPromptSubmissions as Cn, runCompaction as Cr, confineToWorkspace as Ct, resolvePlatformPackage as D, discoverProjectSkills as Dn, gitStatusOf as Dt, reinstallHint as E, defaultSkillScanPaths as En, gitStatus as Et, redeemProviderReset as F, renderAgentsMdBlock as Fn, supersededTools as Ft, detectOnboardingEnvironment as G, prepareWorktree as Gn, runIntegrationSignIn as Gt, resolveSessionExportTarget as H, localEnvironmentProvider as Hn, upsertMcpServer as Ht, usageChecksOptedOut as I, createProviderBuilder as In, makeToolContext as It, probeLocalModelServers as J, MachineLinkLostError as Jn, supportsOAuth as Jt, detectOtherAgents as K, teardownWorktree as Kn, runOAuthLogin as Kt, usageSourceFor as L, resolveSessionModel as Ln, fileEntriesFromPaths as Lt, fetchProviderUsage as M, createDeliveryStates as Mn, invalidateDiagnostics as Mt, fetchProviderUsageAccounts as N, installProviderDiagnosticHook as Nn, listDiagnosticsTools as Nt, updateChecksOptedOut as O, createBuiltinCommands as On, listWorkspace as Ot, providerUsageSupported as P, discoverAgentsMd as Pn, runDiagnostics as Pt, listExtensionSource as Q, readFileSafe as Qn, createMcpStatusTracker as Qt, fetchGithubUsage as R, discoverSessionMcpServers as Rn, listProjectFiles as Rt, overrideManager as S, planRunNotes as Sn, liveAgentProfiles as Sr, assembleDiff as St, performSelfUpdate as T, createSkillNameProbe as Tn, createMemoryApprovalsStore as Tr, gitShowHead as Tt, writeSessionExport as U, WORKTREE_ENVIRONMENT_KIND as Un, oauthUsesManualCodePaste as Ut, renderSession as V, builtinEnvironmentProviders as Vn, removeMcpServer as Vt, connectorGithubToken as W, createWorktreeEnvironmentProvider as Wn, pickOAuthSelectOption as Wt, onboardingProviders as X, recordAgentHooksFanout as Xn, tryRevealPath as Xt, FEATURED_PROVIDERS as Y, createAgentHooksFanout as Yn, tryOpenBrowser as Yt, clearExtensionSourceCache as Z, extractEditPayloadForGate as Zn, backfillAccountEmails as Zt, checkForUpdate as _, readPinnedSkills as _n, parseDecisionModel as _r, gitOriginUrl as _t, updateAppliedMarkerPath as a, resolveSandboxForRoots as an, discoverProjectPlugins as ar, createGitWatches as at, detectLibc as b, PLAN_EDITED_NOTE_KIND as bn, applyExtensionAgents as br, WORKSPACE_MAX_ENTRIES as bt, UPDATE_LOCK_FILE as c, mcpCredentialsPath as cn, loadMcpToolsCache as cr, forgetGitCaches as ct, describeUpdateLockHolder as d, createWorkspaceConfinement as dn, saveMcpToolsCache as dr, gitCreateBranch as dt, createExtensionMcpHost as en, serializePreview as er, claudeImportHostNote as et, isUpdateLockStale as f, isInside$1 as fn, subscribeMcpToolsCache as fr, gitInfo as ft, SELF_UPDATE_TIMEOUT_MS as g, pinnedSkillsValue as gn, listDecisionModels as gr, cloneRepository as gt, findInstalledCompanion as h, PINNED_SKILLS_META_KEY as hn, listImageModels as hr, gitSwitch as ht, readUpdateAppliedMarker as i, createInteractionHub as in, buildPluginContributions as ir, previewClaudeImport as it, fetchAllProviderUsage as j, createChatTurnsReadTool as jn, resolvePaths as jt, USAGE_CACHE_TTL_MS as k, applyThinkingBindingSetting as kn, readWorkspaceFile as kt, UPDATE_LOCK_STALE_MS as l, patchMcpCredential as ln, mcpToolsCachePath as lr, gitBranches as lt, updateLockPath as m, linkCatalogs as mn, imageModelSources as mr, gitPrList as mt, hasUpdateAppliedMarker as n, resolveStoragePaths as nn, resolveSessionCwd as nr, hasClaudeCodeSetup as nt, watchInstalledVersion as o, sandboxUnreadableDirs as on, parsePluginScanPathEnv as or, watchGitRepository as ot, readUpdateLock as p, createCatalogPorts as pn, imageGenerationTools as pr, gitPr as pt, onboardingInstallSignals as q, readRemoteSandboxRef as qn, signsInWithIntegration as qt, probeInstalledVersion as r, createChatHost as rn, scopeCwd as rr, importFromClaudeCode as rt, writeUpdateAppliedMarker as s, createFileMcpCredentialStore as sn, clearMcpToolsCache as sr, gitSync as st, UPDATE_APPLIED_MARKER as t, resolveConfig as tn, folderlessCwd as tr, countClaudeSessionFiles as tt, acquireUpdateLock as u, provisionSessionEnvironment as un, refreshMcpToolsCatalog as ur, gitCommit as ut, checkTarballAvailable as v, storeHasDurability as vn, resolveDecisionsOption as vr, createCapabilityProbe as vt, performInPlaceSelfUpdate as w, buildSkillsConfig as wn, createApprovalHub as wr, gitDiff as wt, detectPackageManager as x, PLAN_STOPPED_NOTE_KIND as xn, changedCatalogItems as xr, WORKSPACE_MAX_FILE_BYTES as xt, compareSemver as y, isStaleRunMarker as yn, testDecisionModel as yr, searchWorkspace as yt, aggregateUsage as z, machineDiscoveryCwd as zn, isMcpServerName as zt };
|
|
30378
30378
|
|
|
30379
|
-
//# sourceMappingURL=auto-update-restart-
|
|
30379
|
+
//# sourceMappingURL=auto-update-restart-B4pU7Qgf.js.map
|