zidane 9.1.3 → 9.1.4

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 (73) hide show
  1. package/dist/{acp-CeCavNlg.js → acp-Cl4gCZN6.js} +3 -3
  2. package/dist/{acp-CeCavNlg.js.map → acp-Cl4gCZN6.js.map} +1 -1
  3. package/dist/acp-cli.js +4 -4
  4. package/dist/acp.js +1 -1
  5. package/dist/{auth-store-port-BKpjlJ8a.js → auth-store-port-DBl2JUC6.js} +2 -2
  6. package/dist/{auth-store-port-BKpjlJ8a.js.map → auth-store-port-DBl2JUC6.js.map} +1 -1
  7. package/dist/{auto-update-restart-CQJtndMG.js → auto-update-restart-CF_kjcJd.js} +10 -10
  8. package/dist/{auto-update-restart-CQJtndMG.js.map → auto-update-restart-CF_kjcJd.js.map} +1 -1
  9. package/dist/chat.js +9 -9
  10. package/dist/{cli-shared-DeRHgYvl.js → cli-shared-DIV9c5Nr.js} +3 -3
  11. package/dist/{cli-shared-DeRHgYvl.js.map → cli-shared-DIV9c5Nr.js.map} +1 -1
  12. package/dist/{credentials-Bqg-qNBM.js → credentials-D71duF64.js} +2 -2
  13. package/dist/{credentials-Bqg-qNBM.js.map → credentials-D71duF64.js.map} +1 -1
  14. package/dist/daemon-cli.js +2 -2
  15. package/dist/{discovery-CX7nbMCn.js → discovery-DD4wPWKS.js} +4 -4
  16. package/dist/{discovery-CX7nbMCn.js.map → discovery-DD4wPWKS.js.map} +1 -1
  17. package/dist/{engine-CxBGgU94.js → engine-BDmtgr2O.js} +3 -3
  18. package/dist/{engine-CxBGgU94.js.map → engine-BDmtgr2O.js.map} +1 -1
  19. package/dist/{executor-j_LFRBwS.js → executor-EWOhLyd9.js} +2 -2
  20. package/dist/{executor-j_LFRBwS.js.map → executor-EWOhLyd9.js.map} +1 -1
  21. package/dist/extensions/testing.js +2 -2
  22. package/dist/{extensions-ADlhBQ_1.js → extensions-DklXPjiq.js} +6 -6
  23. package/dist/{extensions-ADlhBQ_1.js.map → extensions-DklXPjiq.js.map} +1 -1
  24. package/dist/extensions.js +5 -5
  25. package/dist/{google-B-Dhmzzf.js → google-BtMW9KzL.js} +2 -2
  26. package/dist/{google-B-Dhmzzf.js.map → google-BtMW9KzL.js.map} +1 -1
  27. package/dist/{host-signals-Cb2TlGtN.js → host-signals-91zyko_i.js} +5 -5
  28. package/dist/{host-signals-Cb2TlGtN.js.map → host-signals-91zyko_i.js.map} +1 -1
  29. package/dist/{host-C61ntFBC.js → host-uP3t08w8.js} +9 -9
  30. package/dist/{host-C61ntFBC.js.map → host-uP3t08w8.js.map} +1 -1
  31. package/dist/{host-version-BIx4CuBM.js → host-version-_RHlAB29.js} +2 -2
  32. package/dist/{host-version-BIx4CuBM.js.map → host-version-_RHlAB29.js.map} +1 -1
  33. package/dist/index.js +5 -5
  34. package/dist/ipc/remote.js +3 -3
  35. package/dist/{ipc-DiH_P-wr.js → ipc-CatnsVEd.js} +4 -4
  36. package/dist/{ipc-DiH_P-wr.js.map → ipc-CatnsVEd.js.map} +1 -1
  37. package/dist/ipc.js +4 -4
  38. package/dist/{links-BbC_lOnn.js → links-a8C9eby4.js} +8 -8
  39. package/dist/{links-BbC_lOnn.js.map → links-a8C9eby4.js.map} +1 -1
  40. package/dist/{loaded-entry-C0vkCVNQ.js → loaded-entry-D6jzt5HQ.js} +2 -2
  41. package/dist/{loaded-entry-C0vkCVNQ.js.map → loaded-entry-D6jzt5HQ.js.map} +1 -1
  42. package/dist/{memory-C3w8nO8f.js → memory-CJy52DNi.js} +15 -15
  43. package/dist/{memory-C3w8nO8f.js.map → memory-CJy52DNi.js.map} +1 -1
  44. package/dist/{path-display-DRAEpKOU.js → path-display-CAWz-sMq.js} +3 -3
  45. package/dist/{path-display-DRAEpKOU.js.map → path-display-CAWz-sMq.js.map} +1 -1
  46. package/dist/providers/google.js +1 -1
  47. package/dist/{providers-CpXV_uLE.js → providers-zVRxiJDv.js} +2 -2
  48. package/dist/{providers-CpXV_uLE.js.map → providers-zVRxiJDv.js.map} +1 -1
  49. package/dist/providers.js +1 -1
  50. package/dist/{registry-CJHvmvaP.js → registry-CBoYDIND.js} +2 -2
  51. package/dist/{registry-CJHvmvaP.js.map → registry-CBoYDIND.js.map} +1 -1
  52. package/dist/{registry-CN6JlZKj.js → registry-CQOU5jvF.js} +2 -2
  53. package/dist/{registry-CN6JlZKj.js.map → registry-CQOU5jvF.js.map} +1 -1
  54. package/dist/{registry-CnnKaY9s.js → registry-YUUqbYGr.js} +2 -2
  55. package/dist/{registry-CnnKaY9s.js.map → registry-YUUqbYGr.js.map} +1 -1
  56. package/dist/{remote-hosts-DoO9CJUQ.js → remote-hosts-CT8Q95dR.js} +4 -4
  57. package/dist/{remote-hosts-DoO9CJUQ.js.map → remote-hosts-CT8Q95dR.js.map} +1 -1
  58. package/dist/{setting-D_FpKFMw.js → setting-_jh2OtiL.js} +2 -2
  59. package/dist/{setting-D_FpKFMw.js.map → setting-_jh2OtiL.js.map} +1 -1
  60. package/dist/{settings-keys-CW2UgHgb.js → settings-keys-BT0_oKjO.js} +2 -2
  61. package/dist/{settings-keys-CW2UgHgb.js.map → settings-keys-BT0_oKjO.js.map} +1 -1
  62. package/dist/{system-freeze-XgDPIwQS.js → system-freeze-DxJ-lRhu.js} +2 -2
  63. package/dist/{system-freeze-XgDPIwQS.js.map → system-freeze-DxJ-lRhu.js.map} +1 -1
  64. package/dist/tui.js +15 -15
  65. package/dist/{version-szdW1Od9.js → version-DwQI12WA.js} +2 -2
  66. package/dist/{version-szdW1Od9.js.map → version-DwQI12WA.js.map} +1 -1
  67. package/dist/{wire-C3l9jl9x.js → wire-Dxwxb7QQ.js} +2 -2
  68. package/dist/{wire-C3l9jl9x.js.map → wire-Dxwxb7QQ.js.map} +1 -1
  69. package/dist/{ws-CEHi0CiB.js → ws-CA3o2nie.js} +4 -4
  70. package/dist/{ws-CEHi0CiB.js.map → ws-CA3o2nie.js.map} +1 -1
  71. package/dist/{ws-client-t8XNWxcq.js → ws-client-C0iPAAzc.js} +2 -2
  72. package/dist/{ws-client-t8XNWxcq.js.map → ws-client-C0iPAAzc.js.map} +1 -1
  73. package/package.json +1 -1
package/dist/acp-cli.js CHANGED
@@ -6,14 +6,14 @@ import { t as anthropic } from "./anthropic-Dp6JSSyY.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-B-Dhmzzf.js";
9
+ import { i as google, o as googleVertex } from "./google-BtMW9KzL.js";
10
10
  import { r as openai } from "./openai-CQw3EVu6.js";
11
11
  import { r as openrouter } from "./openrouter-CgBpQR6G.js";
12
12
  import { t as xai } from "./xai-BDoEXsjQ.js";
13
13
  import { neuralwatt } from "./providers/neuralwatt.js";
14
- import { D as credKeyOf, I as modelsForDescriptor, d as readCredentials, i as credentialsPath, w as BUILTIN_PROVIDERS } from "./credentials-Bqg-qNBM.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-CeCavNlg.js";
16
- import { i as detectAuth, n as isRemoteSandboxContext, t as createCliExecution } from "./cli-shared-DeRHgYvl.js";
14
+ import { D as credKeyOf, I as modelsForDescriptor, d as readCredentials, i as credentialsPath, w as BUILTIN_PROVIDERS } from "./credentials-D71duF64.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-Cl4gCZN6.js";
16
+ import { i as detectAuth, n as isRemoteSandboxContext, t as createCliExecution } from "./cli-shared-DIV9c5Nr.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-CeCavNlg.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-Cl4gCZN6.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 { S as writeCredentialEntry, u as readCredentialEntry } from "./credentials-Bqg-qNBM.js";
1
+ import { S as writeCredentialEntry, u as readCredentialEntry } from "./credentials-D71duF64.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-BKpjlJ8a.js.map
209
+ //# sourceMappingURL=auth-store-port-DBl2JUC6.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth-store-port-BKpjlJ8a.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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ources":["../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,gCAAgC;;AAG7C,MAAM,eA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,KAAK,OAAO,KAAK,KAAK,OAAO;CAC3C,MAAM,QAAQ;EAAE,GAAI,UAAU,EAAE,QAAQ,IAAI,CAAC;EAAI,GAAI,QAAQ,EAAE,MAAM,IAAI,CAAC;CAAG;CAC7E,IAAI,MAAM,SAAS,SAAS;EAC1B,IAAI,OAAO,MAAM,WAAW,YAAY,CAAC,MAAM,QAC7C,OAAO,KAAA;EACT,MAAM,QAAiC,CAAC;EACxC,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,KAAK,GAC7C,IAAI,CAAC;GAAC;GAAQ;GAAU;GAAW;GAAW;GAAM;;EAA6B,CAAC,CAAC,SAAS,GAAG,GAC7F,MAAM,OAAO;EAEjB,OAAO;GACL,YAAY;IACV,MAAM;IACN,aAAa,MAAM;IACnB,GAAI,OAAO,MAAM,YAAY,WAAW,EAAE,WAAW,MAAM,QAAQ,IAAI,CAAC;IACxE,GAAI,OAAO,KAAK,KAAK,CAAC,CAAC,SAAS,EAAE,MAAM,IAAI,CAAC;GAC/C;GACA,GAAI,OAAO,MAAM,YAAY,YAAY,MAAM,UAAU,EAAE,cAAc,MAAM,QAAQ,IAAI,CAAC;GAC5F,GAAG;EACL;CACF;CACA,IAAI,MAAM,SAAS,YAAY,OAAO,MAAM,UAAU,YAAY,MAAM,OACtE,OAAO;EAAE,YAAY;GAAE,MAAM;GAAU,KAAK,MAAM;EAAM;EAAG,GAAG;CAAM;AAExE;AAEA,SAAS,WAAW,eAAuB,UAAkB,aAAqB,SAAkB,OAA4B;CAC9H,OAAO;EACL;EACA;EACA,SAAS,OAAO,YAAY,YAAY,UAAU,UAAU;EAC5D,GAAI,OAAO,UAAU,YAAY,QAAQ,EAAE,MAAM,IAAI,CAAC;EACtD;CACF;AACF"}
@@ -15,7 +15,7 @@ import { splitSystemPrompt } from "./prompt.js";
15
15
  import { a as isRunOwnerHolding, i as isRunOwnerDead, r as currentRunOwner } from "./send-requests-Bpb99rP5.js";
16
16
  import { a as getExtensionSessionState, l as setExtensionSessionState, r as deleteExtensionSessionState, s as loadSession, t as createSession, u as withExtensionSession } from "./session-BORxmqlM.js";
17
17
  import { n as createDecider } from "./decisions-hsw5XS2g.js";
18
- import { Lt as readKeybindingsRaw, Pt as mergeKeybindings, Rt as resolveExtensionKeybindings } from "./registry-CnnKaY9s.js";
18
+ import { Lt as readKeybindingsRaw, Pt as mergeKeybindings, Rt as resolveExtensionKeybindings } from "./registry-YUUqbYGr.js";
19
19
  import { n as entryPortOf, t as createProcessContext } from "./contexts-DLZTSRHU.js";
20
20
  import { c as terminalProcesses, r as hasLocalPty } from "./local-terminal-lBMwNIZl.js";
21
21
  import { n as createAnsiStripper } from "./types-4q1bFG53.js";
@@ -43,22 +43,22 @@ import { a as listMarkdownDefFiles, i as loadMarkdownCommands, n as applyMarkdow
43
43
  import { t as projectUserPaths } from "./project-user-paths-Chsi83mp.js";
44
44
  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";
45
45
  import { r as artifacts_default } from "./presets-CMY43nUP.js";
46
- import { t as ZIDANE_VERSION } from "./version-szdW1Od9.js";
46
+ import { t as ZIDANE_VERSION } from "./version-DwQI12WA.js";
47
47
  import { n as abortableInstallIo, s as parseInstallSource } from "./source-3ZnEPOSa.js";
48
- 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-XgDPIwQS.js";
48
+ 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-DxJ-lRhu.js";
49
49
  import { d as querySessions } from "./references-DZ5qTYDl.js";
50
50
  import { r as createLogger, t as consoleSink } from "./logger-BQj8QCJp.js";
51
- import { F as extensionRuntimeOf, L as filterRegistryPlugins } from "./extensions-ADlhBQ_1.js";
51
+ import { F as extensionRuntimeOf, L as filterRegistryPlugins } from "./extensions-DklXPjiq.js";
52
52
  import { t as resolveStorageDirs } from "./xdg-DFSAQQG8.js";
53
53
  import { l as resolveOAuthApiKey } from "./oauth-7IvbubTT.js";
54
54
  import { p as oauthAccountLabel } from "./cred-keys-C0KaSRp7.js";
55
55
  import { n as sanitizeProviderDiagnosticMetadata, o as THINKING_BINDING_SETTING_ENV, s as anthropicEffortForLevel } from "./anthropic-Dp6JSSyY.js";
56
- import { A as getContextWindow, B as restoreModelOptions, D as credKeyOf, F as modelSupportsReasoning, I as modelsForDescriptor, N as modelLabel, O as defaultModelOf, a as ensureCredentialIds, c as providerFactoryOptions, d as readCredentials, i as credentialsPath, k as enabledModelOptions, t as applyApiKeyEnv, w as BUILTIN_PROVIDERS, x as storedCredentialsOf } from "./credentials-Bqg-qNBM.js";
56
+ import { A as getContextWindow, B as restoreModelOptions, D as credKeyOf, F as modelSupportsReasoning, I as modelsForDescriptor, N as modelLabel, O as defaultModelOf, a as ensureCredentialIds, c as providerFactoryOptions, d as readCredentials, i as credentialsPath, k as enabledModelOptions, t as applyApiKeyEnv, w as BUILTIN_PROVIDERS, x as storedCredentialsOf } from "./credentials-D71duF64.js";
57
57
  import { n as defaultPluginDataRoot, r as loadAgentPlugin } from "./plugins-CNj4kHpO.js";
58
58
  import { i as sqliteStoreConnection } from "./sqlite-store-D5y70PuL.js";
59
59
  import { a as createGenerateImageTool } from "./tools-BsrGQ8K4.js";
60
60
  import { d as buildBuildSystem, f as buildPlanSystem, h as replaceEnvSection, m as envSectionDate, p as envSection } from "./agent-prompt-BXVwL89Y.js";
61
- import { B as selectActiveTodos, C as profileTools, E as singleAgentRegistry, F as getTodosForRun, I as isTodoTool, R as pruneTodosByRun, T as sessionComposition, V as setTodosForRun, _ 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, n as isDurabilityMode, s as forkSession, v as builtInPromptOf, w as resolveAgentId, x as compositionTools, z as sanitizeTodoItems } from "./setting-D_FpKFMw.js";
61
+ import { B as selectActiveTodos, C as profileTools, E as singleAgentRegistry, F as getTodosForRun, I as isTodoTool, R as pruneTodosByRun, T as sessionComposition, V as setTodosForRun, _ 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, n as isDurabilityMode, s as forkSession, v as builtInPromptOf, w as resolveAgentId, x as compositionTools, z as sanitizeTodoItems } from "./setting-_jh2OtiL.js";
62
62
  import { _ as verifyEnvironment, c as environmentMetadata, f as readSessionEnvironment, g as teardownSessionEnvironment, h as runSessionEnvironmentAction, i as assertEnvironmentReady, l as environmentTakesBranch, m as resolveExecution, o as createEnvironmentRegistry, p as requireEnvironmentProvider, r as LOCAL_ENVIRONMENT, s as environmentActionSummaries, u as initialEnvironment, v as workspacePath } from "./environment-DWlIhAKo.js";
63
63
  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";
64
64
  import { $ as sessionOrchestrationTools, 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, c as extensionSpace, dt as formatRunReceiptLine, et as sessionSubscription, gt as runReceiptFromRun, j as SESSION_ROLE_KEY, k as ORCHESTRATION_TOOLS_KEY, m as readSessionSpaceId, mt as hasRunReceipt, nt as sideSessionParent, q as scopeMatches, u as isExtensionSpaceId, w as parseModelSetting, z as isOrchestratorSession } from "./spaces-BaE3ZcBx.js";
@@ -76,9 +76,9 @@ import { t as StreamQueue } from "./stream-queue-Cd9OJxl7.js";
76
76
  import { t as createDaytonaProvider } from "./daytona-CgC8wQzg.js";
77
77
  import { n as hostWorkspaceMounts, t as createDockerContext } from "./docker-D3CARts8.js";
78
78
  import { t as createE2BProvider } from "./e2b-4ByYdO1e.js";
79
- import { g as fieldsReadBy, s as modelKey, t as accountModelKey } from "./providers-CpXV_uLE.js";
79
+ import { g as fieldsReadBy, s as modelKey, t as accountModelKey } from "./providers-zVRxiJDv.js";
80
80
  import { n as sqliteRuntimeForStore } from "./sqlite-runtime-DUtWWIVu.js";
81
- import { a as integrationCredentialsOf, i as detectAuth, o as isIntegrationCredentialKey, r as activeAccountOf, t as createCliExecution } from "./cli-shared-DeRHgYvl.js";
81
+ import { a as integrationCredentialsOf, i as detectAuth, o as isIntegrationCredentialKey, r as activeAccountOf, t as createCliExecution } from "./cli-shared-DIV9c5Nr.js";
82
82
  import { d as isEnvironmentEnabled, p as resolveProviderConfig, u as describeEnvironments } from "./host-scoped-settings-WBYaCork.js";
83
83
  import { Buffer } from "node:buffer";
84
84
  import { basename, delimiter, dirname, isAbsolute, join, normalize, posix, relative, resolve, sep } from "node:path";
@@ -20667,7 +20667,7 @@ function pickOAuthSelectOption(options, input) {
20667
20667
  */
20668
20668
  async function runIntegrationSignIn(descriptor, options) {
20669
20669
  if (!descriptor.integration) throw new Error(`${descriptor.label} does not sign in with an integration.`);
20670
- const { signInWithIntegration } = await import("./registry-CJHvmvaP.js").then((n) => n.r);
20670
+ const { signInWithIntegration } = await import("./registry-CBoYDIND.js").then((n) => n.r);
20671
20671
  return signInWithIntegration(descriptor.integration, loginCallbacks(descriptor, options), options.signal ? { signal: options.signal } : {});
20672
20672
  }
20673
20673
  /**
@@ -28219,4 +28219,4 @@ function hasUpdateAppliedMarker(cacheDir) {
28219
28219
  //#endregion
28220
28220
  export { CLAUDE_IMPORT_NOTES as $, buildPluginContributions as $n, createExtensionMcpHost as $t, clearProviderUsageCache as A, renderAgentsMdBlock as An, writeWorkspaceFile as At, exportFilename as B, prepareWorktree as Bn, mcpsWritePath as Bt, parseSemver as C, discoverProjectSkills as Cn, confineToWorkspace as Ct, resolvePlatformPackage as D, createChatTurnsReadTool as Dn, gitStatusOf as Dt, reinstallHint as E, chatReferenceTokensForPrompt as En, gitStatus as Et, redeemProviderReset as F, insideDeclaredRoots as Fn, supersededTools as Ft, detectOnboardingEnvironment as G, recordAgentHooksFanout as Gn, runIntegrationSignIn as Gt, resolveSessionExportTarget as H, readRemoteSandboxRef as Hn, upsertMcpServer as Ht, usageChecksOptedOut as I, builtinEnvironmentProviders as In, makeToolContext as It, probeLocalModelServers as J, resolveCwdPath as Jn, supportsOAuth as Jt, detectOtherAgents as K, extractEditPayloadForGate as Kn, runOAuthLogin as Kt, usageSourceFor as L, localEnvironmentProvider as Ln, fileEntriesFromPaths as Lt, fetchProviderUsage as M, resolveSessionModel as Mn, invalidateDiagnostics as Mt, fetchProviderUsageAccounts as N, discoverSessionMcpServers as Nn, listDiagnosticsTools as Nt, updateChecksOptedOut as O, installProviderDiagnosticHook as On, listWorkspace as Ot, providerUsageSupported as P, machineDiscoveryCwd as Pn, runDiagnostics as Pt, listExtensionSource as Q, scopeCwd as Qn, createArtifactKindsHost as Qt, fetchGithubUsage as R, WORKTREE_ENVIRONMENT_KIND as Rn, listProjectFiles as Rt, overrideManager as S, defaultSkillScanPaths as Sn, assembleDiff as St, performSelfUpdate as T, applyThinkingBindingSetting as Tn, gitShowHead as Tt, writeSessionExport as U, MachineLinkLostError as Un, oauthUsesManualCodePaste as Ut, renderSession as V, teardownWorktree as Vn, removeMcpServer as Vt, connectorGithubToken as W, createAgentHooksFanout as Wn, pickOAuthSelectOption as Wt, onboardingProviders as X, folderlessCwd as Xn, tryRevealPath as Xt, FEATURED_PROVIDERS as Y, serializePreview as Yn, tryOpenBrowser as Yt, clearExtensionSourceCache as Z, resolveSessionCwd as Zn, createMcpStatusTracker as Zt, checkForUpdate as _, storeHasDurability as _n, liveAgentProfiles as _r, gitOriginUrl as _t, updateAppliedMarkerPath as a, sandboxUnreadableDirs as an, refreshMcpToolsCatalog as ar, createGitWatches as at, detectLibc as b, buildSkillsConfig as bn, createMemoryApprovalsStore as br, WORKSPACE_MAX_ENTRIES as bt, UPDATE_LOCK_FILE as c, patchMcpCredential as cn, imageGenerationTools as cr, forgetGitCaches as ct, describeUpdateLockHolder as d, isInside$1 as dn, listDecisionModels as dr, gitCreateBranch as dt, resolveConfig as en, discoverProjectPlugins as er, claudeImportHostNote as et, isUpdateLockStale as f, createCatalogPorts as fn, parseDecisionModel as fr, gitInfo as ft, SELF_UPDATE_TIMEOUT_MS as g, readPinnedSkills as gn, changedCatalogItems as gr, cloneRepository as gt, findInstalledCompanion as h, pinnedSkillsValue as hn, applyExtensionAgents as hr, gitSwitch as ht, readUpdateAppliedMarker as i, resolveSandboxForRoots as in, mcpToolsCachePath as ir, previewClaudeImport as it, fetchAllProviderUsage as j, createProviderBuilder as jn, resolvePaths as jt, USAGE_CACHE_TTL_MS as k, discoverAgentsMd as kn, readWorkspaceFile as kt, UPDATE_LOCK_STALE_MS as l, provisionSessionEnvironment as ln, imageModelSources as lr, gitBranches as lt, updateLockPath as m, PINNED_SKILLS_META_KEY as mn, testDecisionModel as mr, gitPrList as mt, hasUpdateAppliedMarker as n, createChatHost as nn, clearMcpToolsCache as nr, hasClaudeCodeSetup as nt, watchInstalledVersion as o, createFileMcpCredentialStore as on, saveMcpToolsCache as or, watchGitRepository as ot, readUpdateLock as p, linkCatalogs as pn, resolveDecisionsOption as pr, gitPr as pt, onboardingInstallSignals as q, readFileSafe as qn, signsInWithIntegration as qt, probeInstalledVersion as r, createInteractionHub as rn, loadMcpToolsCache as rr, importFromClaudeCode as rt, writeUpdateAppliedMarker as s, mcpCredentialsPath as sn, subscribeMcpToolsCache as sr, gitSync as st, UPDATE_APPLIED_MARKER as t, resolveStoragePaths as tn, parsePluginScanPathEnv as tr, countClaudeSessionFiles as tt, acquireUpdateLock as u, createWorkspaceConfinement as un, listImageModels as ur, gitCommit as ut, checkTarballAvailable as v, isStaleRunMarker as vn, runCompaction as vr, createCapabilityProbe as vt, performInPlaceSelfUpdate as w, createBuiltinCommands as wn, gitDiff as wt, detectPackageManager as x, createSkillNameProbe as xn, WORKSPACE_MAX_FILE_BYTES as xt, compareSemver as y, createPromptSubmissions as yn, createApprovalHub as yr, searchWorkspace as yt, aggregateUsage as z, createWorktreeEnvironmentProvider as zn, isMcpServerName as zt };
28221
28221
 
28222
- //# sourceMappingURL=auto-update-restart-CQJtndMG.js.map
28222
+ //# sourceMappingURL=auto-update-restart-CF_kjcJd.js.map