@sourcegraph/amp 0.0.1748736136-g61031a → 0.0.1748751230-ga82eb7

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 (40) hide show
  1. package/dist/amp.js +2 -2
  2. package/dist/{console-BJjMaAP0.js → console-BHPG7ghh.js} +10 -10
  3. package/dist/console-BHPG7ghh.js.map +1 -0
  4. package/dist/{create_file.node-QMdr-ACC.js → create_file.node-BfhNTTlb.js} +2 -2
  5. package/dist/{create_file.node-QMdr-ACC.js.map → create_file.node-BfhNTTlb.js.map} +1 -1
  6. package/dist/{edit_file.node-DlCSzOeS.js → edit_file.node-DfNYbY3f.js} +3 -3
  7. package/dist/{edit_file.node-DlCSzOeS.js.map → edit_file.node-DfNYbY3f.js.map} +1 -1
  8. package/dist/{executable-BSze2cp7.js → executable-Bg-Dnv9N.js} +2 -2
  9. package/dist/{executable-BSze2cp7.js.map → executable-Bg-Dnv9N.js.map} +1 -1
  10. package/dist/{files-kwFa1B7T.js → files-Ce5pZkWD.js} +2 -2
  11. package/dist/{files-kwFa1B7T.js.map → files-Ce5pZkWD.js.map} +1 -1
  12. package/dist/{glob.node-BOJStTrC.js → glob.node-RxL5iYzN.js} +3 -3
  13. package/dist/{glob.node-BOJStTrC.js.map → glob.node-RxL5iYzN.js.map} +1 -1
  14. package/dist/{list_directory.node-CZoXp5Bu.js → list_directory.node-DGhzMMXH.js} +2 -2
  15. package/dist/{list_directory.node-CZoXp5Bu.js.map → list_directory.node-DGhzMMXH.js.map} +1 -1
  16. package/dist/{load-profile-Cb1zwI0M.js → load-profile-DM9rbkOm.js} +2 -2
  17. package/dist/{load-profile-Cb1zwI0M.js.map → load-profile-DM9rbkOm.js.map} +1 -1
  18. package/dist/{main-DTIj_PW3.js → main-00oKVtTe.js} +20 -20
  19. package/dist/{main-DTIj_PW3.js.map → main-00oKVtTe.js.map} +1 -1
  20. package/dist/{node-B1giiC00.js → node-BHXqdrs5.js} +2 -2
  21. package/dist/{node-B1giiC00.js.map → node-BHXqdrs5.js.map} +1 -1
  22. package/dist/{node-Bhjgb-Ms.js → node-CQtpFy7X.js} +3 -3
  23. package/dist/{node-Bhjgb-Ms.js.map → node-CQtpFy7X.js.map} +1 -1
  24. package/dist/{node-C_7XbfjW.js → node-Cp6INRFE.js} +2 -2
  25. package/dist/{node-C_7XbfjW.js.map → node-Cp6INRFE.js.map} +1 -1
  26. package/dist/{node-D09RVPDj.js → node-DO1f17bA.js} +3 -3
  27. package/dist/{node-D09RVPDj.js.map → node-DO1f17bA.js.map} +1 -1
  28. package/dist/{node-CCCtPw6d.js → node-DmYohWBm.js} +3 -3
  29. package/dist/{node-CCCtPw6d.js.map → node-DmYohWBm.js.map} +1 -1
  30. package/dist/{node-BVbbWGKv.js → node-OczSPdLb.js} +3 -3
  31. package/dist/{node-BVbbWGKv.js.map → node-OczSPdLb.js.map} +1 -1
  32. package/dist/{read_file.node-BgMklkX3.js → read_file.node-2VqMj-ax.js} +2 -2
  33. package/dist/{read_file.node-BgMklkX3.js.map → read_file.node-2VqMj-ax.js.map} +1 -1
  34. package/dist/{stdio-B8Jgx9V2.js → stdio-CO70V3Ze.js} +3 -3
  35. package/dist/{stdio-B8Jgx9V2.js.map → stdio-CO70V3Ze.js.map} +1 -1
  36. package/dist/storybook.js +1 -1
  37. package/dist/{undo_edit.node-BY8yEF1r.js → undo_edit.node-B6m1Nlh6.js} +2 -2
  38. package/dist/{undo_edit.node-BY8yEF1r.js.map → undo_edit.node-B6m1Nlh6.js.map} +1 -1
  39. package/package.json +1 -1
  40. package/dist/console-BJjMaAP0.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"load-profile-Cb1zwI0M.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-DM9rbkOm.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-BJjMaAP0.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-BHPG7ghh.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-BSze2cp7.js";
20
+ import { r as mL } from "./executable-Bg-Dnv9N.js";
21
21
  function gL() {
22
22
  const i = /* @__PURE__ */ new Set(), e = new _i(i);
23
23
  return {
@@ -7746,10 +7746,10 @@ async function h2(i, e, t) {
7746
7746
  if ("url" in i)
7747
7747
  n = new f2(new URL(i.url));
7748
7748
  else {
7749
- const { loadProfileEnvironmentVariables: r } = await import("./load-profile-Cb1zwI0M.js"), o = t.loadProfile === "never" || !t.workingDirectory ? process.env : await pt(
7749
+ const { loadProfileEnvironmentVariables: r } = await import("./load-profile-DM9rbkOm.js"), o = t.loadProfile === "never" || !t.workingDirectory ? process.env : await pt(
7750
7750
  r(t.workingDirectory, t.loadProfile)
7751
7751
  );
7752
- n = await import("./stdio-B8Jgx9V2.js").then(
7752
+ n = await import("./stdio-CO70V3Ze.js").then(
7753
7753
  ({ StdioClientTransport: s }) => new s({
7754
7754
  ...i,
7755
7755
  stderr: "pipe",
@@ -8526,7 +8526,7 @@ This tool converts web content to markdown format for better readability.`,
8526
8526
  requiresNetwork: !0
8527
8527
  }
8528
8528
  },
8529
- fn: import("./node-C_7XbfjW.js").then(({ nodeReadWebPageTool: i }) => i)
8529
+ fn: import("./node-Cp6INRFE.js").then(({ nodeReadWebPageTool: i }) => i)
8530
8530
  }, x2 = "web_search", I2 = `Search the web for information.
8531
8531
 
8532
8532
  Returns search result titles, associated URLs, and a small summary of the
@@ -8574,7 +8574,7 @@ the \`${dm}\` with the url.
8574
8574
  requiresNetwork: !0
8575
8575
  }
8576
8576
  },
8577
- fn: import("./node-Bhjgb-Ms.js").then(({ nodeWebSearchTool: i }) => i)
8577
+ fn: import("./node-CQtpFy7X.js").then(({ nodeWebSearchTool: i }) => i)
8578
8578
  }, k2 = `Execute a routine from your routines.amp.yaml file.
8579
8579
 
8580
8580
  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 +8604,7 @@ IMPORTANT: The result of this tool (if any) should be displayed directly to the
8604
8604
  },
8605
8605
  source: "builtin"
8606
8606
  },
8607
- fn: import("./node-BVbbWGKv.js").then(({ runRoutine: i }) => i)
8607
+ fn: import("./node-OczSPdLb.js").then(({ runRoutine: i }) => i)
8608
8608
  };
8609
8609
  let f_ = !1;
8610
8610
  async function MT(i, e = !1) {
@@ -36212,7 +36212,7 @@ async function yG(i, e) {
36212
36212
  }
36213
36213
  }
36214
36214
  async function _G(i, e) {
36215
- return (await import("./list_directory.node-CZoXp5Bu.js")).resolveArgumentDirectoryNode(i, e);
36215
+ return (await import("./list_directory.node-DGhzMMXH.js")).resolveArgumentDirectoryNode(i, e);
36216
36216
  }
36217
36217
  function wG(i) {
36218
36218
  if (!i._regex)
@@ -37386,7 +37386,7 @@ async function xG({
37386
37386
  fileMentions: void 0,
37387
37387
  userState: void 0
37388
37388
  };
37389
- const o = (await import("./files-kwFa1B7T.js").then(
37389
+ const o = (await import("./files-Ce5pZkWD.js").then(
37390
37390
  ({ getFileMentions: a }) => a(
37391
37391
  GE(t.content),
37392
37392
  r,
@@ -38197,7 +38197,7 @@ function zs(i = "idle") {
38197
38197
  ie.error(`Failed to play notification sound (${i}):`, e);
38198
38198
  }
38199
38199
  }
38200
- const RG = import("./node-B1giiC00.js").then(
38200
+ const RG = import("./node-BHXqdrs5.js").then(
38201
38201
  ({ nodeFileSystem: i }) => i
38202
38202
  );
38203
38203
  async function kG() {
@@ -40203,7 +40203,7 @@ function Tr() {
40203
40203
  }
40204
40204
  async function sW(i, e) {
40205
40205
  try {
40206
- const t = await ZG("0.0.1748736136-g61031a");
40206
+ const t = await ZG("0.0.1748751230-ga82eb7");
40207
40207
  t.hasUpdate && t.latestVersion ? e ? (i.next({ type: "update-start-updating" }), setTimeout(async () => {
40208
40208
  try {
40209
40209
  await tW(t.latestVersion), i.next({
@@ -40218,7 +40218,7 @@ async function sW(i, e) {
40218
40218
  version: t.latestVersion
40219
40219
  });
40220
40220
  }
40221
- }, 100)) : ie.info(`New version available: 0.0.1748736136-g61031a → ${t.latestVersion}`) : ie.info("No update available");
40221
+ }, 100)) : ie.info(`New version available: 0.0.1748751230-ga82eb7 → ${t.latestVersion}`) : ie.info("No update available");
40222
40222
  } catch (t) {
40223
40223
  ie.debug("Update check failed", t);
40224
40224
  }
@@ -40316,7 +40316,7 @@ async function Iu(i, e) {
40316
40316
  cg({
40317
40317
  logLevel: e.logLevel || process.env.AMP_LOG_LEVEL,
40318
40318
  logFile: e.logFile || process.env.AMP_LOG_FILE
40319
- }), jM("0.0.1748736136-g61031a");
40319
+ }), jM("0.0.1748751230-ga82eb7");
40320
40320
  const t = e.settingsFile ?? process.env.AMP_SETTINGS_FILE;
40321
40321
  ie.info("Using settings file", { settingsFile: t });
40322
40322
  const n = wu(), r = $T({ settingsFile: t }), o = process.env.AMP_API_KEY;
@@ -40416,7 +40416,7 @@ function dW(i) {
40416
40416
  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
40417
  e.option("-V, --version", "output the version number", () => {
40418
40418
  if (i.isTTY) {
40419
- const r = "0.0.1748736136-g61031a".match(/^(\d+\.\d+)\.(\d+)-(.+)$/);
40419
+ const r = "0.0.1748751230-ga82eb7".match(/^(\d+\.\d+)\.(\d+)-(.+)$/);
40420
40420
  if (r) {
40421
40421
  const [, , o] = r;
40422
40422
  try {
@@ -40427,21 +40427,21 @@ function dW(i) {
40427
40427
  day: "numeric"
40428
40428
  });
40429
40429
  tt.write(
40430
- `0.0.1748736136-g61031a ${i.printer.print(`(released ${a})`, { foreground: "gray" })}
40430
+ `0.0.1748751230-ga82eb7 ${i.printer.print(`(released ${a})`, { foreground: "gray" })}
40431
40431
  `
40432
40432
  );
40433
40433
  } else
40434
- tt.write(`0.0.1748736136-g61031a
40434
+ tt.write(`0.0.1748751230-ga82eb7
40435
40435
  `);
40436
40436
  } catch {
40437
- tt.write(`0.0.1748736136-g61031a
40437
+ tt.write(`0.0.1748751230-ga82eb7
40438
40438
  `);
40439
40439
  }
40440
40440
  } else
40441
- tt.write(`0.0.1748736136-g61031a
40441
+ tt.write(`0.0.1748751230-ga82eb7
40442
40442
  `);
40443
40443
  } else
40444
- tt.write(`0.0.1748736136-g61031a
40444
+ tt.write(`0.0.1748751230-ga82eb7
40445
40445
  `);
40446
40446
  process.exit(0);
40447
40447
  }), e.addHelpText(
@@ -40839,4 +40839,4 @@ export {
40839
40839
  ge as s,
40840
40840
  lr as u
40841
40841
  };
40842
- //# sourceMappingURL=main-DTIj_PW3.js.map
40842
+ //# sourceMappingURL=main-00oKVtTe.js.map