@sourcegraph/amp 0.0.1748793680-gb5cb75 → 0.0.1748808093-g235c50

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 (41) hide show
  1. package/dist/amp.js +2 -2
  2. package/dist/{console-BEoM5C3l.js → console-k3nh7b4U.js} +4477 -4461
  3. package/dist/console-k3nh7b4U.js.map +1 -0
  4. package/dist/{create_file.node-BFS-uX0h.js → create_file.node-Dxp9NAiW.js} +2 -2
  5. package/dist/{create_file.node-BFS-uX0h.js.map → create_file.node-Dxp9NAiW.js.map} +1 -1
  6. package/dist/{edit_file.node-D0utnpOc.js → edit_file.node-BlCpGVR-.js} +3 -3
  7. package/dist/{edit_file.node-D0utnpOc.js.map → edit_file.node-BlCpGVR-.js.map} +1 -1
  8. package/dist/{executable-Bm7iL2Wr.js → executable-DTI1_xm7.js} +2 -2
  9. package/dist/{executable-Bm7iL2Wr.js.map → executable-DTI1_xm7.js.map} +1 -1
  10. package/dist/{files-8V4d25dw.js → files-DdjDm_B8.js} +2 -2
  11. package/dist/{files-8V4d25dw.js.map → files-DdjDm_B8.js.map} +1 -1
  12. package/dist/{glob.node-CxhUfk73.js → glob.node-BnKeKl9M.js} +3 -3
  13. package/dist/{glob.node-CxhUfk73.js.map → glob.node-BnKeKl9M.js.map} +1 -1
  14. package/dist/{list_directory.node-BvKQRegC.js → list_directory.node-DDhJZGvT.js} +2 -2
  15. package/dist/{list_directory.node-BvKQRegC.js.map → list_directory.node-DDhJZGvT.js.map} +1 -1
  16. package/dist/{load-profile-DRELVkLs.js → load-profile-CWDhvBXX.js} +2 -2
  17. package/dist/{load-profile-DRELVkLs.js.map → load-profile-CWDhvBXX.js.map} +1 -1
  18. package/dist/{main-DQYKrEMt.js → main-lA7epsKO.js} +22 -21
  19. package/dist/main-lA7epsKO.js.map +1 -0
  20. package/dist/{node-BuGshbyJ.js → node-3m0J6gBv.js} +3 -3
  21. package/dist/{node-BuGshbyJ.js.map → node-3m0J6gBv.js.map} +1 -1
  22. package/dist/{node-BhYs8yvR.js → node-BERNSnKR.js} +3 -3
  23. package/dist/{node-BhYs8yvR.js.map → node-BERNSnKR.js.map} +1 -1
  24. package/dist/{node-DHEAQDoa.js → node-BZlRkYQw.js} +2 -2
  25. package/dist/{node-DHEAQDoa.js.map → node-BZlRkYQw.js.map} +1 -1
  26. package/dist/{node-DeRmGqmZ.js → node-D1PGQIOw.js} +3 -3
  27. package/dist/{node-DeRmGqmZ.js.map → node-D1PGQIOw.js.map} +1 -1
  28. package/dist/{node-CcCnjzdp.js → node-DuhaU87r.js} +3 -3
  29. package/dist/{node-CcCnjzdp.js.map → node-DuhaU87r.js.map} +1 -1
  30. package/dist/{node-xakp4FYv.js → node-w5kFgl6-.js} +2 -2
  31. package/dist/{node-xakp4FYv.js.map → node-w5kFgl6-.js.map} +1 -1
  32. package/dist/{read_file.node-Bh95y2qD.js → read_file.node-CsATnmUF.js} +2 -2
  33. package/dist/{read_file.node-Bh95y2qD.js.map → read_file.node-CsATnmUF.js.map} +1 -1
  34. package/dist/{stdio-D-NQCSHu.js → stdio-Bqoe1JiA.js} +3 -3
  35. package/dist/{stdio-D-NQCSHu.js.map → stdio-Bqoe1JiA.js.map} +1 -1
  36. package/dist/storybook.js +1 -1
  37. package/dist/{undo_edit.node-BZBcJgmC.js → undo_edit.node-CHrrMPkn.js} +2 -2
  38. package/dist/{undo_edit.node-BZBcJgmC.js.map → undo_edit.node-CHrrMPkn.js.map} +1 -1
  39. package/package.json +1 -1
  40. package/dist/console-BEoM5C3l.js.map +0 -1
  41. package/dist/main-DQYKrEMt.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"load-profile-DRELVkLs.js","sources":["../../core/src/tools/builtin/bash/load-profile.ts"],"sourcesContent":["import { catchError, Observable, tap } from '@sourcegraph/observable'\nimport { spawn } from 'node:child_process'\nimport os from 'node:os'\nimport logger from '../../../common/logger'\nimport type { ResolvedConfiguration } from '../../../configuration/resolver'\n\ninterface CachedLoginEnvironment {\n\ttimestamp: number\n\tenv: Record<string, string>\n}\nconst dailyTimeout = 24 * 60 * 60 * 1000 // Expire the login environment daily\nconst shellEnvCache = new Map<string, CachedLoginEnvironment>()\nconst defaultEnv = process.env as Record<string, string>\n\n// Adaptation of the equivalent logic from Zed here:\n// https://sourcegraph.com/github.com/zed-industries/zed/-/blob/crates/util/src/util.rs?L309\nexport function loadProfileEnvironmentVariables(\n\tdir: string,\n\tconfig: ResolvedConfiguration['settings']['terminal.commands.nodeSpawn.loadProfile'] = 'always',\n): Observable<Record<string, string>> {\n\tif (config === 'never') {\n\t\treturn Observable.of(defaultEnv)\n\t}\n\tif (import.meta.env.VITE_PLATFORM === 'node') {\n\t\t// Skipping automatic environment detection for the CLI since the user\n\t\t// is presumably already running in a shell.\n\t\treturn Observable.of(defaultEnv)\n\t}\n\tif (isNixShell()) {\n\t\t// Skip automatic detection for Nix users, because they're smart enough\n\t\t// to figure out how to run `code .`\n\t\tlogger.info(\n\t\t\t'Detected Nix Shell, skipping automatic detection of login environment. To skip this Nix detection, set the environment variable IN_NIX_SHELL=false.',\n\t\t)\n\t\treturn Observable.of(defaultEnv)\n\t}\n\tif (config === 'always') {\n\t\treturn loadProfileEnvironmentVariablesUnchached(dir)\n\t}\n\tif (config !== 'daily') {\n\t\tlogger.warn(\n\t\t\t`Unknown setting value for loadLoginShellEnvironment. Valid values are \"never\", \"always\", \"daily\". Falling back to default \"daily\"`,\n\t\t\t{\n\t\t\t\tsetting: config,\n\t\t\t},\n\t\t)\n\t}\n\n\t// Regularly clean up old cached to avoid holding onto an infinitely growing\n\t// number of cached environments.\n\tevictExpiredCache()\n\n\tconst cachedEnv = shellEnvCache.get(dir)\n\tif (cachedEnv) {\n\t\treturn Observable.of(cachedEnv.env)\n\t}\n\treturn loadProfileEnvironmentVariablesUnchached(dir).pipe(\n\t\ttap((env) => {\n\t\t\tshellEnvCache.set(dir, { timestamp: Date.now(), env })\n\t\t}),\n\t\tcatchError((error) => {\n\t\t\tlogger.error('failed to read login environment. Falling back to default environment', {\n\t\t\t\terror,\n\t\t\t})\n\t\t\treturn Observable.of(defaultEnv)\n\t\t}),\n\t)\n}\n\nfunction loadProfileEnvironmentVariablesUnchached(dir: string): Observable<Record<string, string>> {\n\t// For non-Unix systems, just return the current environment\n\tif (os.platform() !== 'darwin' && os.platform() !== 'linux') {\n\t\treturn Observable.of(defaultEnv)\n\t}\n\tconst start = Date.now()\n\n\treturn new Observable<Record<string, string>>((observer) => {\n\t\t// For Unix-like systems, get environment from login shell\n\t\tconst shell = os.userInfo().shell ?? process.env.SHELL ?? '/bin/bash'\n\t\tconst marker = 'AMP_SHELL_ENV_MARKER'\n\n\t\t// Try to cd into the directory to trigger directory-specific env tools\n\t\tconst shellCmdPrefix = dir ? `cd '${dir.replace(/'/g, \"\\\\'\")}';` : ''\n\t\tconst shellCmd = `${shellCmdPrefix}printf '%s' ${marker}; /usr/bin/env;`\n\n\t\t// Set timeout to prevent hanging\n\t\tconst timeout = setTimeout(() => {\n\t\t\tlogger.error('Shell environment collection timed out')\n\t\t\tchild.kill()\n\t\t\tobserver.next(defaultEnv)\n\t\t\tobserver.complete()\n\t\t}, 5000)\n\n\t\t// Run login shell\n\t\tconst child = spawn(shell, ['-l', '-i', '-c', shellCmd], {\n\t\t\tstdio: ['ignore', 'pipe', 'pipe'],\n\t\t\tdetached: true, // Prevent shell from taking control of the terminal\n\t\t\tenv: {\n\t\t\t\t...process.env,\n\t\t\t\tNONINTERACTIVE: '1',\n\t\t\t\tDEBIAN_FRONTEND: 'noninteractive',\n\t\t\t},\n\t\t})\n\n\t\tlet stdout = ''\n\t\tlet stderr = ''\n\n\t\tif (child.stdout) {\n\t\t\tchild.stdout.on('data', (data) => {\n\t\t\t\tstdout += data.toString()\n\t\t\t})\n\t\t}\n\n\t\tif (child.stderr) {\n\t\t\tchild.stderr.on('data', (data) => {\n\t\t\t\tstderr += data.toString()\n\t\t\t})\n\t\t}\n\n\t\tchild.on('error', (err) => {\n\t\t\tlogger.error('Failed to spawn shell:', { err })\n\t\t\tclearTimeout(timeout)\n\t\t\tobserver.next(defaultEnv)\n\t\t\tobserver.complete()\n\t\t})\n\n\t\tchild.on('close', (code) => {\n\t\t\tclearTimeout(timeout)\n\t\t\tconst end = Date.now()\n\t\t\tconst durationMillis = end - start\n\n\t\t\tif (code !== 0) {\n\t\t\t\tlogger.error(`Shell process exited with code ${code}`)\n\t\t\t\tobserver.next(defaultEnv)\n\t\t\t\tobserver.complete()\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Parse environment variables after marker\n\t\t\tconst envVars: Record<string, string> = {}\n\t\t\tconst markerIndex = stdout.indexOf(marker)\n\n\t\t\tif (markerIndex !== -1) {\n\t\t\t\tconst envOutput = stdout.substring(markerIndex + marker.length)\n\t\t\t\t// Parse KEY=VALUE lines\n\t\t\t\tenvOutput.split('\\n').forEach((line) => {\n\t\t\t\t\tconst match = line.match(/^([^=]+)=(.*)$/)\n\t\t\t\t\tif (match && match[1] && match[2]) {\n\t\t\t\t\t\tconst key = match[1]\n\t\t\t\t\t\tconst value = match[2]\n\t\t\t\t\t\tenvVars[key] = value\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\t// Fallback to current environment\n\t\t\t\tObject.assign(envVars, defaultEnv)\n\t\t\t}\n\n\t\t\tlogger.info('Loaded login shell environment', {\n\t\t\t\tdurationMillis,\n\t\t\t\tdirectory: dir,\n\t\t\t\tloadedVariableCount: Object.keys(envVars).length,\n\t\t\t})\n\t\t\tobserver.next(envVars)\n\t\t\tobserver.complete()\n\t\t})\n\n\t\treturn () => {\n\t\t\tclearTimeout(timeout)\n\t\t\tchild.kill()\n\t\t}\n\t})\n}\nfunction evictExpiredCache(): void {\n\tfor (const [key, value] of Object.entries(shellEnvCache)) {\n\t\tif (isExpiredCache(value)) {\n\t\t\tshellEnvCache.delete(key)\n\t\t}\n\t}\n}\n\nfunction isExpiredCache(env: CachedLoginEnvironment): boolean {\n\treturn env.timestamp + dailyTimeout > Date.now()\n}\n\nconst pathDelimeter = os.platform() === 'win32' ? ';' : ':'\nfunction isNixShell(): boolean {\n\tif (process.env.IN_NIX_SHELL === 'false') {\n\t\t// Escape hatch to disable this detection.\n\t\treturn false\n\t}\n\n\tif (process.env.IN_NIX_SHELL) {\n\t\treturn true\n\t}\n\n\t// Check for new `nix shell` using PATH using a heuristic. Borrowed from Starship:\n\t// https://github.com/starship/starship/blob/fccf4ccebf1533989234ec13c5a0f6d44e47e937/src/modules/nix_shell.rs#L14C1-L40C6\n\tconst path = process.env.PATH ?? ''\n\treturn path.split(pathDelimeter).some((p) => p.startsWith('/nix/store'))\n}\n"],"names":["defaultEnv","loadProfileEnvironmentVariables","dir","config","Observable","os"],"mappings":";;;AAYA,MAAMA,IAAa,QAAQ;AAIX,SAAAC,EACfC,GACAC,IAAuF,UAClD;AACrC,SAAIA,MAAW,UACPC,EAAW,GAAGJ,CAAU,IAKxBI,EAAW,GAAGJ,CAAU;AAyCjC;AAsHsBK,EAAG,SAAS;"}
1
+ {"version":3,"file":"load-profile-CWDhvBXX.js","sources":["../../core/src/tools/builtin/bash/load-profile.ts"],"sourcesContent":["import { catchError, Observable, tap } from '@sourcegraph/observable'\nimport { spawn } from 'node:child_process'\nimport os from 'node:os'\nimport logger from '../../../common/logger'\nimport type { ResolvedConfiguration } from '../../../configuration/resolver'\n\ninterface CachedLoginEnvironment {\n\ttimestamp: number\n\tenv: Record<string, string>\n}\nconst dailyTimeout = 24 * 60 * 60 * 1000 // Expire the login environment daily\nconst shellEnvCache = new Map<string, CachedLoginEnvironment>()\nconst defaultEnv = process.env as Record<string, string>\n\n// Adaptation of the equivalent logic from Zed here:\n// https://sourcegraph.com/github.com/zed-industries/zed/-/blob/crates/util/src/util.rs?L309\nexport function loadProfileEnvironmentVariables(\n\tdir: string,\n\tconfig: ResolvedConfiguration['settings']['terminal.commands.nodeSpawn.loadProfile'] = 'always',\n): Observable<Record<string, string>> {\n\tif (config === 'never') {\n\t\treturn Observable.of(defaultEnv)\n\t}\n\tif (import.meta.env.VITE_PLATFORM === 'node') {\n\t\t// Skipping automatic environment detection for the CLI since the user\n\t\t// is presumably already running in a shell.\n\t\treturn Observable.of(defaultEnv)\n\t}\n\tif (isNixShell()) {\n\t\t// Skip automatic detection for Nix users, because they're smart enough\n\t\t// to figure out how to run `code .`\n\t\tlogger.info(\n\t\t\t'Detected Nix Shell, skipping automatic detection of login environment. To skip this Nix detection, set the environment variable IN_NIX_SHELL=false.',\n\t\t)\n\t\treturn Observable.of(defaultEnv)\n\t}\n\tif (config === 'always') {\n\t\treturn loadProfileEnvironmentVariablesUnchached(dir)\n\t}\n\tif (config !== 'daily') {\n\t\tlogger.warn(\n\t\t\t`Unknown setting value for loadLoginShellEnvironment. Valid values are \"never\", \"always\", \"daily\". Falling back to default \"daily\"`,\n\t\t\t{\n\t\t\t\tsetting: config,\n\t\t\t},\n\t\t)\n\t}\n\n\t// Regularly clean up old cached to avoid holding onto an infinitely growing\n\t// number of cached environments.\n\tevictExpiredCache()\n\n\tconst cachedEnv = shellEnvCache.get(dir)\n\tif (cachedEnv) {\n\t\treturn Observable.of(cachedEnv.env)\n\t}\n\treturn loadProfileEnvironmentVariablesUnchached(dir).pipe(\n\t\ttap((env) => {\n\t\t\tshellEnvCache.set(dir, { timestamp: Date.now(), env })\n\t\t}),\n\t\tcatchError((error) => {\n\t\t\tlogger.error('failed to read login environment. Falling back to default environment', {\n\t\t\t\terror,\n\t\t\t})\n\t\t\treturn Observable.of(defaultEnv)\n\t\t}),\n\t)\n}\n\nfunction loadProfileEnvironmentVariablesUnchached(dir: string): Observable<Record<string, string>> {\n\t// For non-Unix systems, just return the current environment\n\tif (os.platform() !== 'darwin' && os.platform() !== 'linux') {\n\t\treturn Observable.of(defaultEnv)\n\t}\n\tconst start = Date.now()\n\n\treturn new Observable<Record<string, string>>((observer) => {\n\t\t// For Unix-like systems, get environment from login shell\n\t\tconst shell = os.userInfo().shell ?? process.env.SHELL ?? '/bin/bash'\n\t\tconst marker = 'AMP_SHELL_ENV_MARKER'\n\n\t\t// Try to cd into the directory to trigger directory-specific env tools\n\t\tconst shellCmdPrefix = dir ? `cd '${dir.replace(/'/g, \"\\\\'\")}';` : ''\n\t\tconst shellCmd = `${shellCmdPrefix}printf '%s' ${marker}; /usr/bin/env;`\n\n\t\t// Set timeout to prevent hanging\n\t\tconst timeout = setTimeout(() => {\n\t\t\tlogger.error('Shell environment collection timed out')\n\t\t\tchild.kill()\n\t\t\tobserver.next(defaultEnv)\n\t\t\tobserver.complete()\n\t\t}, 5000)\n\n\t\t// Run login shell\n\t\tconst child = spawn(shell, ['-l', '-i', '-c', shellCmd], {\n\t\t\tstdio: ['ignore', 'pipe', 'pipe'],\n\t\t\tdetached: true, // Prevent shell from taking control of the terminal\n\t\t\tenv: {\n\t\t\t\t...process.env,\n\t\t\t\tNONINTERACTIVE: '1',\n\t\t\t\tDEBIAN_FRONTEND: 'noninteractive',\n\t\t\t},\n\t\t})\n\n\t\tlet stdout = ''\n\t\tlet stderr = ''\n\n\t\tif (child.stdout) {\n\t\t\tchild.stdout.on('data', (data) => {\n\t\t\t\tstdout += data.toString()\n\t\t\t})\n\t\t}\n\n\t\tif (child.stderr) {\n\t\t\tchild.stderr.on('data', (data) => {\n\t\t\t\tstderr += data.toString()\n\t\t\t})\n\t\t}\n\n\t\tchild.on('error', (err) => {\n\t\t\tlogger.error('Failed to spawn shell:', { err })\n\t\t\tclearTimeout(timeout)\n\t\t\tobserver.next(defaultEnv)\n\t\t\tobserver.complete()\n\t\t})\n\n\t\tchild.on('close', (code) => {\n\t\t\tclearTimeout(timeout)\n\t\t\tconst end = Date.now()\n\t\t\tconst durationMillis = end - start\n\n\t\t\tif (code !== 0) {\n\t\t\t\tlogger.error(`Shell process exited with code ${code}`)\n\t\t\t\tobserver.next(defaultEnv)\n\t\t\t\tobserver.complete()\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Parse environment variables after marker\n\t\t\tconst envVars: Record<string, string> = {}\n\t\t\tconst markerIndex = stdout.indexOf(marker)\n\n\t\t\tif (markerIndex !== -1) {\n\t\t\t\tconst envOutput = stdout.substring(markerIndex + marker.length)\n\t\t\t\t// Parse KEY=VALUE lines\n\t\t\t\tenvOutput.split('\\n').forEach((line) => {\n\t\t\t\t\tconst match = line.match(/^([^=]+)=(.*)$/)\n\t\t\t\t\tif (match && match[1] && match[2]) {\n\t\t\t\t\t\tconst key = match[1]\n\t\t\t\t\t\tconst value = match[2]\n\t\t\t\t\t\tenvVars[key] = value\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\t// Fallback to current environment\n\t\t\t\tObject.assign(envVars, defaultEnv)\n\t\t\t}\n\n\t\t\tlogger.info('Loaded login shell environment', {\n\t\t\t\tdurationMillis,\n\t\t\t\tdirectory: dir,\n\t\t\t\tloadedVariableCount: Object.keys(envVars).length,\n\t\t\t})\n\t\t\tobserver.next(envVars)\n\t\t\tobserver.complete()\n\t\t})\n\n\t\treturn () => {\n\t\t\tclearTimeout(timeout)\n\t\t\tchild.kill()\n\t\t}\n\t})\n}\nfunction evictExpiredCache(): void {\n\tfor (const [key, value] of Object.entries(shellEnvCache)) {\n\t\tif (isExpiredCache(value)) {\n\t\t\tshellEnvCache.delete(key)\n\t\t}\n\t}\n}\n\nfunction isExpiredCache(env: CachedLoginEnvironment): boolean {\n\treturn env.timestamp + dailyTimeout > Date.now()\n}\n\nconst pathDelimeter = os.platform() === 'win32' ? ';' : ':'\nfunction isNixShell(): boolean {\n\tif (process.env.IN_NIX_SHELL === 'false') {\n\t\t// Escape hatch to disable this detection.\n\t\treturn false\n\t}\n\n\tif (process.env.IN_NIX_SHELL) {\n\t\treturn true\n\t}\n\n\t// Check for new `nix shell` using PATH using a heuristic. Borrowed from Starship:\n\t// https://github.com/starship/starship/blob/fccf4ccebf1533989234ec13c5a0f6d44e47e937/src/modules/nix_shell.rs#L14C1-L40C6\n\tconst path = process.env.PATH ?? ''\n\treturn path.split(pathDelimeter).some((p) => p.startsWith('/nix/store'))\n}\n"],"names":["defaultEnv","loadProfileEnvironmentVariables","dir","config","Observable","os"],"mappings":";;;AAYA,MAAMA,IAAa,QAAQ;AAIX,SAAAC,EACfC,GACAC,IAAuF,UAClD;AACrC,SAAIA,MAAW,UACPC,EAAW,GAAGJ,CAAU,IAKxBI,EAAW,GAAGJ,CAAU;AAyCjC;AAsHsBK,EAAG,SAAS;"}
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { B as _i, O as Qt, s as fn, c as UE, a as Jn, b as nc, f as pt, d as ta, p as es, m as Et, e as ha, g as un, h as pa, i as KO, j as qE, k as ic, M as Qn, l as JO, n as ie, N as vu, o as Um, r as Fr, q as qm, t as YO, u as jO, v as Bm, w as ZO, x as QO, y as Jy, z as Ru, A as XO, C as eM, D as tM, E as rM, F as nM, G as iM, H as oM, I as sM, J as aM, K as lM, L as uM, P as cM, Q as fM, R as dM, S as hM, T as pM, U as ku, V as BE, W as mM, X as gM, Y as Sn, Z as vM, _ as yM, $ as vW, a0 as ra, a1 as _M, a2 as wM, a3 as bM, a4 as Zi, a5 as VE, a6 as SM, a7 as wi, a8 as HE, a9 as GE, aa as EM, ab as TM, ac as Yp, ad as CM, ae as AM, af as PM, ag as xM, ah as IM, ai as id, aj as RM, ak as WE, al as Yy, am as kM, an as OM, ao as MM, ap as LM, aq as NM, ar as DM, as as FM, at as $M, au as UM, av as qM, aw as BM, ax as jy, ay as VM, az as HM, aA as GM, aB as zE, aC as jp, aD as Tt, aE as WM, aF as zM, aG as KM, aH as Zy, aI as Qy, aJ as Xy, aK as JM, aL as YM, aM as KE, aN as JE, aO as jM } from "./console-BEoM5C3l.js";
2
+ import { B as _i, O as Qt, s as fn, c as UE, a as Jn, b as nc, f as pt, d as ta, p as es, m as Et, e as ha, g as un, h as pa, i as KO, j as qE, k as ic, M as Qn, l as JO, n as ie, N as vu, o as Um, r as Fr, q as qm, t as YO, u as jO, v as Bm, w as ZO, x as QO, y as Jy, z as Ru, A as XO, C as eM, D as tM, E as rM, F as nM, G as iM, H as oM, I as sM, J as aM, K as lM, L as uM, P as cM, Q as fM, R as dM, S as hM, T as pM, U as ku, V as BE, W as mM, X as gM, Y as Sn, Z as vM, _ as yM, $ as vW, a0 as ra, a1 as _M, a2 as wM, a3 as bM, a4 as Zi, a5 as VE, a6 as SM, a7 as wi, a8 as HE, a9 as GE, aa as EM, ab as TM, ac as Yp, ad as CM, ae as AM, af as PM, ag as xM, ah as IM, ai as id, aj as RM, ak as WE, al as Yy, am as kM, an as OM, ao as MM, ap as LM, aq as NM, ar as DM, as as FM, at as $M, au as UM, av as qM, aw as BM, ax as jy, ay as VM, az as HM, aA as GM, aB as zE, aC as jp, aD as Tt, aE as WM, aF as zM, aG as KM, aH as Zy, aI as Qy, aJ as Xy, aK as JM, aL as YM, aM as KE, aN as JE, aO as jM } from "./console-k3nh7b4U.js";
3
3
  import * as ZM from "node:fs/promises";
4
4
  import Yo, { readdir as QM, stat as YE, readFile as bi, mkdir as Ou, writeFile as na, unlink as XM, open as eL, readlink as tL } from "node:fs/promises";
5
5
  import * as rL from "node:path";
@@ -17,7 +17,7 @@ import fL from "node:zlib";
17
17
  import dL from "node:string_decoder";
18
18
  import hL, { createServer as QE } from "node:http";
19
19
  import pL from "node:https";
20
- import { r as mL } from "./executable-Bm7iL2Wr.js";
20
+ import { r as mL } from "./executable-DTI1_xm7.js";
21
21
  function gL() {
22
22
  const i = /* @__PURE__ */ new Set(), e = new _i(i);
23
23
  return {
@@ -107,7 +107,8 @@ function XE({
107
107
  ),
108
108
  Et((s) => ({
109
109
  ...s,
110
- url: s.url || n
110
+ url: s.url || n,
111
+ "todos.enabled": s["todos.enabled"] ?? !0
111
112
  })),
112
113
  nc(),
113
114
  ha()
@@ -7746,10 +7747,10 @@ async function h2(i, e, t) {
7746
7747
  if ("url" in i)
7747
7748
  n = new f2(new URL(i.url));
7748
7749
  else {
7749
- const { loadProfileEnvironmentVariables: r } = await import("./load-profile-DRELVkLs.js"), o = t.loadProfile === "never" || !t.workingDirectory ? process.env : await pt(
7750
+ const { loadProfileEnvironmentVariables: r } = await import("./load-profile-CWDhvBXX.js"), o = t.loadProfile === "never" || !t.workingDirectory ? process.env : await pt(
7750
7751
  r(t.workingDirectory, t.loadProfile)
7751
7752
  );
7752
- n = await import("./stdio-D-NQCSHu.js").then(
7753
+ n = await import("./stdio-Bqoe1JiA.js").then(
7753
7754
  ({ StdioClientTransport: s }) => new s({
7754
7755
  ...i,
7755
7756
  stderr: "pipe",
@@ -8526,7 +8527,7 @@ This tool converts web content to markdown format for better readability.`,
8526
8527
  requiresNetwork: !0
8527
8528
  }
8528
8529
  },
8529
- fn: import("./node-xakp4FYv.js").then(({ nodeReadWebPageTool: i }) => i)
8530
+ fn: import("./node-w5kFgl6-.js").then(({ nodeReadWebPageTool: i }) => i)
8530
8531
  }, x2 = "web_search", I2 = `Search the web for information.
8531
8532
 
8532
8533
  Returns search result titles, associated URLs, and a small summary of the
@@ -8574,7 +8575,7 @@ the \`${dm}\` with the url.
8574
8575
  requiresNetwork: !0
8575
8576
  }
8576
8577
  },
8577
- fn: import("./node-BhYs8yvR.js").then(({ nodeWebSearchTool: i }) => i)
8578
+ fn: import("./node-BERNSnKR.js").then(({ nodeWebSearchTool: i }) => i)
8578
8579
  }, k2 = `Execute a routine from your routines.amp.yaml file.
8579
8580
 
8580
8581
  This tool allows you to run predefined routines that automate common tasks. You can optionally provide a userInput argument that describes what input should be passed to the routine.
@@ -8604,7 +8605,7 @@ IMPORTANT: The result of this tool (if any) should be displayed directly to the
8604
8605
  },
8605
8606
  source: "builtin"
8606
8607
  },
8607
- fn: import("./node-DeRmGqmZ.js").then(({ runRoutine: i }) => i)
8608
+ fn: import("./node-D1PGQIOw.js").then(({ runRoutine: i }) => i)
8608
8609
  };
8609
8610
  let f_ = !1;
8610
8611
  async function MT(i, e = !1) {
@@ -36212,7 +36213,7 @@ async function yG(i, e) {
36212
36213
  }
36213
36214
  }
36214
36215
  async function _G(i, e) {
36215
- return (await import("./list_directory.node-BvKQRegC.js")).resolveArgumentDirectoryNode(i, e);
36216
+ return (await import("./list_directory.node-DDhJZGvT.js")).resolveArgumentDirectoryNode(i, e);
36216
36217
  }
36217
36218
  function wG(i) {
36218
36219
  if (!i._regex)
@@ -37386,7 +37387,7 @@ async function xG({
37386
37387
  fileMentions: void 0,
37387
37388
  userState: void 0
37388
37389
  };
37389
- const o = (await import("./files-8V4d25dw.js").then(
37390
+ const o = (await import("./files-DdjDm_B8.js").then(
37390
37391
  ({ getFileMentions: a }) => a(
37391
37392
  GE(t.content),
37392
37393
  r,
@@ -38197,7 +38198,7 @@ function zs(i = "idle") {
38197
38198
  ie.error(`Failed to play notification sound (${i}):`, e);
38198
38199
  }
38199
38200
  }
38200
- const RG = import("./node-DHEAQDoa.js").then(
38201
+ const RG = import("./node-BZlRkYQw.js").then(
38201
38202
  ({ nodeFileSystem: i }) => i
38202
38203
  );
38203
38204
  async function kG() {
@@ -40203,7 +40204,7 @@ function Tr() {
40203
40204
  }
40204
40205
  async function sW(i, e) {
40205
40206
  try {
40206
- const t = await ZG("0.0.1748793680-gb5cb75");
40207
+ const t = await ZG("0.0.1748808093-g235c50");
40207
40208
  t.hasUpdate && t.latestVersion ? e ? (i.next({ type: "update-start-updating" }), setTimeout(async () => {
40208
40209
  try {
40209
40210
  await tW(t.latestVersion), i.next({
@@ -40218,7 +40219,7 @@ async function sW(i, e) {
40218
40219
  version: t.latestVersion
40219
40220
  });
40220
40221
  }
40221
- }, 100)) : ie.info(`New version available: 0.0.1748793680-gb5cb75 → ${t.latestVersion}`) : ie.info("No update available");
40222
+ }, 100)) : ie.info(`New version available: 0.0.1748808093-g235c50 → ${t.latestVersion}`) : ie.info("No update available");
40222
40223
  } catch (t) {
40223
40224
  ie.debug("Update check failed", t);
40224
40225
  }
@@ -40316,7 +40317,7 @@ async function Iu(i, e) {
40316
40317
  cg({
40317
40318
  logLevel: e.logLevel || process.env.AMP_LOG_LEVEL,
40318
40319
  logFile: e.logFile || process.env.AMP_LOG_FILE
40319
- }), jM("0.0.1748793680-gb5cb75");
40320
+ }), jM("0.0.1748808093-g235c50");
40320
40321
  const t = e.settingsFile ?? process.env.AMP_SETTINGS_FILE;
40321
40322
  ie.info("Using settings file", { settingsFile: t });
40322
40323
  const n = wu(), r = $T({ settingsFile: t }), o = process.env.AMP_API_KEY;
@@ -40416,7 +40417,7 @@ function dW(i) {
40416
40417
  const e = new U2().name("amp").description("AI-powered coding assistant").option("--thread-id [THREAD_ID]", "ID of the thread to continue running", void 0);
40417
40418
  e.option("-V, --version", "output the version number", () => {
40418
40419
  if (i.isTTY) {
40419
- const r = "0.0.1748793680-gb5cb75".match(/^(\d+\.\d+)\.(\d+)-(.+)$/);
40420
+ const r = "0.0.1748808093-g235c50".match(/^(\d+\.\d+)\.(\d+)-(.+)$/);
40420
40421
  if (r) {
40421
40422
  const [, , o] = r;
40422
40423
  try {
@@ -40427,21 +40428,21 @@ function dW(i) {
40427
40428
  day: "numeric"
40428
40429
  });
40429
40430
  tt.write(
40430
- `0.0.1748793680-gb5cb75 ${i.printer.print(`(released ${a})`, { foreground: "gray" })}
40431
+ `0.0.1748808093-g235c50 ${i.printer.print(`(released ${a})`, { foreground: "gray" })}
40431
40432
  `
40432
40433
  );
40433
40434
  } else
40434
- tt.write(`0.0.1748793680-gb5cb75
40435
+ tt.write(`0.0.1748808093-g235c50
40435
40436
  `);
40436
40437
  } catch {
40437
- tt.write(`0.0.1748793680-gb5cb75
40438
+ tt.write(`0.0.1748808093-g235c50
40438
40439
  `);
40439
40440
  }
40440
40441
  } else
40441
- tt.write(`0.0.1748793680-gb5cb75
40442
+ tt.write(`0.0.1748808093-g235c50
40442
40443
  `);
40443
40444
  } else
40444
- tt.write(`0.0.1748793680-gb5cb75
40445
+ tt.write(`0.0.1748808093-g235c50
40445
40446
  `);
40446
40447
  process.exit(0);
40447
40448
  }), e.addHelpText(
@@ -40839,4 +40840,4 @@ export {
40839
40840
  ge as s,
40840
40841
  lr as u
40841
40842
  };
40842
- //# sourceMappingURL=main-DQYKrEMt.js.map
40843
+ //# sourceMappingURL=main-lA7epsKO.js.map