@agiflowai/agent-cli 0.2.13 → 0.2.14

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.
@@ -26,28 +26,28 @@ l || o.cwd;
26
26
  const S = (r) => M ? "\x1BPtmux;" + r.replaceAll("\x1B", "\x1B\x1B") + "\x1B\\" : r, v = f + "2J", N = () => {
27
27
  if (l || !I)
28
28
  return !1;
29
- const r = O.release().split("."), e = Number(r[0]), n = Number(r[2] ?? 0);
30
- return e < 10 || e === 10 && n < 10586;
29
+ const r = O.release().split("."), e = Number(r[0]), t = Number(r[2] ?? 0);
30
+ return e < 10 || e === 10 && t < 10586;
31
31
  };
32
32
  N() ? `${v}${f}` : `${v}${f}${f}`;
33
33
  const j = (r, e) => {
34
- const n = S(`${g}8${c}${c}${e}${k}`), t = S(`${g}8${c}${c}${k}`);
35
- return n + r + t;
34
+ const t = S(`${g}8${c}${c}${e}${k}`), n = S(`${g}8${c}${c}${k}`);
35
+ return t + r + n;
36
36
  };
37
37
  function i(r, e = A.argv) {
38
- const n = r.startsWith("-") ? "" : r.length === 1 ? "-" : "--", t = e.indexOf(n + r), u = e.indexOf("--");
39
- return t !== -1 && (u === -1 || t < u);
38
+ const t = r.startsWith("-") ? "" : r.length === 1 ? "-" : "--", n = e.indexOf(t + r), u = e.indexOf("--");
39
+ return n !== -1 && (u === -1 || n < u);
40
40
  }
41
41
  function w(r = "") {
42
42
  if (/^\d{3,4}$/.test(r)) {
43
- const n = /(\d{1,2})(\d{2})/.exec(r) ?? [];
43
+ const t = /(\d{1,2})(\d{2})/.exec(r) ?? [];
44
44
  return {
45
45
  major: 0,
46
- minor: Number.parseInt(n[1], 10),
47
- patch: Number.parseInt(n[2], 10)
46
+ minor: Number.parseInt(t[1], 10),
47
+ patch: Number.parseInt(t[2], 10)
48
48
  };
49
49
  }
50
- const e = (r ?? "").split(".").map((n) => Number.parseInt(n, 10));
50
+ const e = (r ?? "").split(".").map((t) => Number.parseInt(t, 10));
51
51
  return {
52
52
  major: e[0],
53
53
  minor: e[1],
@@ -57,8 +57,8 @@ function w(r = "") {
57
57
  function E(r) {
58
58
  const {
59
59
  CI: e,
60
- CURSOR_TRACE_ID: n,
61
- FORCE_HYPERLINK: t,
60
+ CURSOR_TRACE_ID: t,
61
+ FORCE_HYPERLINK: n,
62
62
  NETLIFY: u,
63
63
  TEAMCITY_VERSION: R,
64
64
  TERM_PROGRAM: b,
@@ -66,8 +66,8 @@ function E(r) {
66
66
  VTE_VERSION: m,
67
67
  TERM: $
68
68
  } = o.env;
69
- if (t)
70
- return !(t.length > 0 && Number.parseInt(t, 10) === 0);
69
+ if (n)
70
+ return !(n.length > 0 && Number.parseInt(n, 10) === 0);
71
71
  if (i("no-hyperlink") || i("no-hyperlinks") || i("hyperlink=false") || i("hyperlink=never"))
72
72
  return !1;
73
73
  if (i("hyperlink=true") || i("hyperlink=always") || u)
@@ -86,9 +86,11 @@ function E(r) {
86
86
  case "WezTerm":
87
87
  return /^0-unstable-\d{4}-\d{2}-\d{2}$/.test(p) ? p.slice(11) >= "2020-06-20" : s.major >= 20200620;
88
88
  case "vscode":
89
- return n ? !0 : s.major > 1 || s.major === 1 && s.minor >= 72;
89
+ return t ? !0 : s.major > 1 || s.major === 1 && s.minor >= 72;
90
90
  case "ghostty":
91
91
  return !0;
92
+ case "zed":
93
+ return !0;
92
94
  }
93
95
  }
94
96
  if (m) {
@@ -109,14 +111,14 @@ const h = {
109
111
  stdout: E(o.stdout),
110
112
  stderr: E(o.stderr)
111
113
  };
112
- function a(r, e, { target: n = "stdout", ...t } = {}) {
113
- return h[n] ? j(r, e) : t.fallback === !1 ? r : typeof t.fallback == "function" ? t.fallback(r, e) : `${r} ${e}`;
114
+ function a(r, e, { target: t = "stdout", ...n } = {}) {
115
+ return h[t] ? j(r, e) : n.fallback === !1 ? r : typeof n.fallback == "function" ? n.fallback(r, e) : `${r} ${e}`;
114
116
  }
115
117
  a.isSupported = h.stdout;
116
- a.stderr = (r, e, n = {}) => a(r, e, { target: "stderr", ...n });
118
+ a.stderr = (r, e, t = {}) => a(r, e, { target: "stderr", ...t });
117
119
  a.stderr.isSupported = h.stderr;
118
- const V = ({ children: r, url: e, fallback: n = !0 }) => T(y, { transform: (t) => a(t, e, { fallback: n }), children: T(W, { children: r }) });
120
+ const V = ({ children: r, url: e, fallback: t = !0 }) => T(y, { transform: (n) => a(n, e, { fallback: t }), children: T(W, { children: r }) });
119
121
  export {
120
122
  V as default
121
123
  };
122
- //# sourceMappingURL=index-BQL-MgGG.mjs.map
124
+ //# sourceMappingURL=index-BxTdyWuL.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-BQL-MgGG.mjs","sources":["../../../node_modules/.pnpm/environment@1.1.0/node_modules/environment/index.js","../../../node_modules/.pnpm/ansi-escapes@7.2.0/node_modules/ansi-escapes/base.js","../../../node_modules/.pnpm/has-flag@5.0.1/node_modules/has-flag/index.js","../../../node_modules/.pnpm/supports-hyperlinks@4.3.0/node_modules/supports-hyperlinks/index.js","../../../node_modules/.pnpm/terminal-link@5.0.0/node_modules/terminal-link/index.js","../../../node_modules/.pnpm/ink-link@5.0.0_ink@6.5.0_@types+react@19.1.9_react@19.2.0_/node_modules/ink-link/dist/index.js"],"sourcesContent":["/* globals WorkerGlobalScope, DedicatedWorkerGlobalScope, SharedWorkerGlobalScope, ServiceWorkerGlobalScope */\n\nexport const isBrowser = globalThis.window?.document !== undefined;\n\nexport const isNode = globalThis.process?.versions?.node !== undefined;\n\nexport const isBun = globalThis.process?.versions?.bun !== undefined;\n\nexport const isDeno = globalThis.Deno?.version?.deno !== undefined;\n\nexport const isElectron = globalThis.process?.versions?.electron !== undefined;\n\nexport const isJsDom = globalThis.navigator?.userAgent?.includes('jsdom') === true;\n\nexport const isWebWorker = typeof WorkerGlobalScope !== 'undefined' && globalThis instanceof WorkerGlobalScope;\n\nexport const isDedicatedWorker = typeof DedicatedWorkerGlobalScope !== 'undefined' && globalThis instanceof DedicatedWorkerGlobalScope;\n\nexport const isSharedWorker = typeof SharedWorkerGlobalScope !== 'undefined' && globalThis instanceof SharedWorkerGlobalScope;\n\nexport const isServiceWorker = typeof ServiceWorkerGlobalScope !== 'undefined' && globalThis instanceof ServiceWorkerGlobalScope;\n\n// Note: I'm intentionally not DRYing up the other variables to keep them \"lazy\".\nconst platform = globalThis.navigator?.userAgentData?.platform;\n\nexport const isMacOs = platform === 'macOS'\n\t|| globalThis.navigator?.platform === 'MacIntel' // Even on Apple silicon Macs.\n\t|| globalThis.navigator?.userAgent?.includes(' Mac ') === true\n\t|| globalThis.process?.platform === 'darwin';\n\nexport const isWindows = platform === 'Windows'\n\t|| globalThis.navigator?.platform === 'Win32'\n\t|| globalThis.process?.platform === 'win32';\n\nexport const isLinux = platform === 'Linux'\n\t|| globalThis.navigator?.platform?.startsWith('Linux') === true\n\t|| globalThis.navigator?.userAgent?.includes(' Linux ') === true\n\t|| globalThis.process?.platform === 'linux';\n\nexport const isIos = platform === 'iOS'\n\t|| (globalThis.navigator?.platform === 'MacIntel' && globalThis.navigator?.maxTouchPoints > 1)\n\t|| /iPad|iPhone|iPod/.test(globalThis.navigator?.platform);\n\nexport const isAndroid = platform === 'Android'\n\t|| globalThis.navigator?.platform === 'Android'\n\t|| globalThis.navigator?.userAgent?.includes(' Android ') === true\n\t|| globalThis.process?.platform === 'android';\n","import process from 'node:process';\nimport os from 'node:os';\nimport {isBrowser} from 'environment';\n\nconst ESC = '\\u001B[';\nconst OSC = '\\u001B]';\nconst BEL = '\\u0007';\nconst SEP = ';';\n\nconst isTerminalApp = !isBrowser && process.env.TERM_PROGRAM === 'Apple_Terminal';\nconst isWindows = !isBrowser && process.platform === 'win32';\nconst isTmux = !isBrowser && (process.env.TERM?.startsWith('screen') || process.env.TERM?.startsWith('tmux') || process.env.TMUX !== undefined);\n\nconst cwdFunction = isBrowser ? () => {\n\tthrow new Error('`process.cwd()` only works in Node.js, not the browser.');\n} : process.cwd;\n\nconst wrapOsc = sequence => {\n\tif (isTmux) {\n\t\t// Tmux requires OSC sequences to be wrapped with DCS tmux; <sequence> ST\n\t\t// and all ESCs in <sequence> to be replaced with ESC ESC.\n\t\t// It only accepts ESC backslash for ST.\n\t\treturn '\\u001BPtmux;' + sequence.replaceAll('\\u001B', '\\u001B\\u001B') + '\\u001B\\\\';\n\t}\n\n\treturn sequence;\n};\n\nexport const cursorTo = (x, y) => {\n\tif (typeof x !== 'number') {\n\t\tthrow new TypeError('The `x` argument is required');\n\t}\n\n\tif (typeof y !== 'number') {\n\t\treturn ESC + (x + 1) + 'G';\n\t}\n\n\treturn ESC + (y + 1) + SEP + (x + 1) + 'H';\n};\n\nexport const cursorMove = (x, y) => {\n\tif (typeof x !== 'number') {\n\t\tthrow new TypeError('The `x` argument is required');\n\t}\n\n\tlet returnValue = '';\n\n\tif (x < 0) {\n\t\treturnValue += ESC + (-x) + 'D';\n\t} else if (x > 0) {\n\t\treturnValue += ESC + x + 'C';\n\t}\n\n\tif (y < 0) {\n\t\treturnValue += ESC + (-y) + 'A';\n\t} else if (y > 0) {\n\t\treturnValue += ESC + y + 'B';\n\t}\n\n\treturn returnValue;\n};\n\nexport const cursorUp = (count = 1) => ESC + count + 'A';\nexport const cursorDown = (count = 1) => ESC + count + 'B';\nexport const cursorForward = (count = 1) => ESC + count + 'C';\nexport const cursorBackward = (count = 1) => ESC + count + 'D';\n\nexport const cursorLeft = ESC + 'G';\nexport const cursorSavePosition = isTerminalApp ? '\\u001B7' : ESC + 's';\nexport const cursorRestorePosition = isTerminalApp ? '\\u001B8' : ESC + 'u';\nexport const cursorGetPosition = ESC + '6n';\nexport const cursorNextLine = ESC + 'E';\nexport const cursorPrevLine = ESC + 'F';\nexport const cursorHide = ESC + '?25l';\nexport const cursorShow = ESC + '?25h';\n\nexport const eraseLines = count => {\n\tlet clear = '';\n\n\tfor (let i = 0; i < count; i++) {\n\t\tclear += eraseLine + (i < count - 1 ? cursorUp() : '');\n\t}\n\n\tif (count) {\n\t\tclear += cursorLeft;\n\t}\n\n\treturn clear;\n};\n\nexport const eraseEndLine = ESC + 'K';\nexport const eraseStartLine = ESC + '1K';\nexport const eraseLine = ESC + '2K';\nexport const eraseDown = ESC + 'J';\nexport const eraseUp = ESC + '1J';\nexport const eraseScreen = ESC + '2J';\nexport const scrollUp = ESC + 'S';\nexport const scrollDown = ESC + 'T';\n\nexport const clearScreen = '\\u001Bc';\n\nexport const clearViewport = `${eraseScreen}${ESC}H`;\n\nconst isOldWindows = () => {\n\tif (isBrowser || !isWindows) {\n\t\treturn false;\n\t}\n\n\tconst parts = os.release().split('.');\n\tconst major = Number(parts[0]);\n\tconst build = Number(parts[2] ?? 0);\n\n\tif (major < 10) {\n\t\treturn true;\n\t}\n\n\tif (major === 10 && build < 10_586) {\n\t\treturn true;\n\t}\n\n\treturn false;\n};\n\nexport const clearTerminal = isOldWindows()\n\t? `${eraseScreen}${ESC}0f`\n\t// 1. Erases the screen (Only done in case `2` is not supported)\n\t// 2. Erases the whole screen including scrollback buffer\n\t// 3. Moves cursor to the top-left position\n\t// More info: https://www.real-world-systems.com/docs/ANSIcode.html\n\t: `${eraseScreen}${ESC}3J${ESC}H`;\n\nexport const enterAlternativeScreen = ESC + '?1049h';\nexport const exitAlternativeScreen = ESC + '?1049l';\n\nexport const beep = BEL;\n\nexport const link = (text, url) => {\n\tconst openLink = wrapOsc(`${OSC}8${SEP}${SEP}${url}${BEL}`);\n\tconst closeLink = wrapOsc(`${OSC}8${SEP}${SEP}${BEL}`);\n\treturn openLink + text + closeLink;\n};\n\nexport const image = (data, options = {}) => {\n\tlet returnValue = `${OSC}1337;File=inline=1`;\n\n\tif (options.width) {\n\t\treturnValue += `;width=${options.width}`;\n\t}\n\n\tif (options.height) {\n\t\treturnValue += `;height=${options.height}`;\n\t}\n\n\tif (options.preserveAspectRatio === false) {\n\t\treturnValue += ';preserveAspectRatio=0';\n\t}\n\n\tconst imageBuffer = Buffer.from(data);\n\n\t// `size` is optional in the spec, but xterm.js requires it.\n\treturn wrapOsc(returnValue + `;size=${imageBuffer.byteLength}` + ':' + imageBuffer.toString('base64') + BEL);\n};\n\nexport const iTerm = {\n\tsetCwd: (cwd = cwdFunction()) => wrapOsc(`${OSC}50;CurrentDir=${cwd}${BEL}`),\n\n\tannotation(message, options = {}) {\n\t\tlet returnValue = `${OSC}1337;`;\n\n\t\tconst hasX = options.x !== undefined;\n\t\tconst hasY = options.y !== undefined;\n\t\tif ((hasX || hasY) && !(hasX && hasY && options.length !== undefined)) {\n\t\t\tthrow new Error('`x`, `y` and `length` must be defined when `x` or `y` is defined');\n\t\t}\n\n\t\tmessage = message.replaceAll('|', '');\n\n\t\treturnValue += options.isHidden ? 'AddHiddenAnnotation=' : 'AddAnnotation=';\n\n\t\tif (options.length > 0) {\n\t\t\treturnValue += (\n\t\t\t\thasX\n\t\t\t\t\t? [message, options.length, options.x, options.y]\n\t\t\t\t\t: [options.length, message]\n\t\t\t).join('|');\n\t\t} else {\n\t\t\treturnValue += message;\n\t\t}\n\n\t\treturn wrapOsc(returnValue + BEL);\n\t},\n};\n\nexport const ConEmu = {\n\tsetCwd: (cwd = cwdFunction()) => wrapOsc(`${OSC}9;9;${cwd}${BEL}`),\n};\n\nexport const setCwd = (cwd = cwdFunction()) => iTerm.setCwd(cwd) + ConEmu.setCwd(cwd);\n","import process from 'process'; // eslint-disable-line node/prefer-global/process\n\nexport default function hasFlag(flag, argv = process.argv) {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n}\n","import process from 'node:process';\nimport {createSupportsColor} from 'supports-color';\nimport hasFlag from 'has-flag';\n\nfunction parseVersion(versionString = '') {\n\tif (/^\\d{3,4}$/.test(versionString)) {\n\t\t// Env var doesn't always use dots. example: 4601 => 46.1.0\n\t\tconst match = /(\\d{1,2})(\\d{2})/.exec(versionString) ?? [];\n\t\treturn {\n\t\t\tmajor: 0,\n\t\t\tminor: Number.parseInt(match[1], 10),\n\t\t\tpatch: Number.parseInt(match[2], 10),\n\t\t};\n\t}\n\n\tconst versions = (versionString ?? '').split('.').map(n => Number.parseInt(n, 10));\n\treturn {\n\t\tmajor: versions[0],\n\t\tminor: versions[1],\n\t\tpatch: versions[2],\n\t};\n}\n\n// eslint-disable-next-line complexity\nexport function createSupportsHyperlinks(stream) {\n\tconst {\n\t\tCI,\n\t\tCURSOR_TRACE_ID,\n\t\tFORCE_HYPERLINK,\n\t\tNETLIFY,\n\t\tTEAMCITY_VERSION,\n\t\tTERM_PROGRAM,\n\t\tTERM_PROGRAM_VERSION,\n\t\tVTE_VERSION,\n\t\tTERM,\n\t} = process.env;\n\n\tif (FORCE_HYPERLINK) {\n\t\treturn !(FORCE_HYPERLINK.length > 0 && Number.parseInt(FORCE_HYPERLINK, 10) === 0);\n\t}\n\n\tif (hasFlag('no-hyperlink') || hasFlag('no-hyperlinks') || hasFlag('hyperlink=false') || hasFlag('hyperlink=never')) {\n\t\treturn false;\n\t}\n\n\tif (hasFlag('hyperlink=true') || hasFlag('hyperlink=always')) {\n\t\treturn true;\n\t}\n\n\t// Netlify does not run a TTY, it does not need `supportsColor` check\n\tif (NETLIFY) {\n\t\treturn true;\n\t}\n\n\t// If they specify no colors, they probably don't want hyperlinks.\n\tif (!createSupportsColor(stream)) {\n\t\treturn false;\n\t}\n\n\tif (stream && !stream.isTTY) {\n\t\treturn false;\n\t}\n\n\t// Windows Terminal\n\tif ('WT_SESSION' in process.env) {\n\t\treturn true;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\treturn false;\n\t}\n\n\tif (CI) {\n\t\treturn false;\n\t}\n\n\tif (TEAMCITY_VERSION) {\n\t\treturn false;\n\t}\n\n\tif (TERM_PROGRAM) {\n\t\tconst version = parseVersion(TERM_PROGRAM_VERSION);\n\n\t\tswitch (TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app': {\n\t\t\t\tif (version.major === 3) {\n\t\t\t\t\treturn version.minor >= 1;\n\t\t\t\t}\n\n\t\t\t\treturn version.major > 3;\n\t\t\t}\n\n\t\t\tcase 'WezTerm': {\n\t\t\t\t// WezTerm packaged by Nix uses their own version scheme.\n\t\t\t\tif (/^0-unstable-\\d{4}-\\d{2}-\\d{2}$/.test(TERM_PROGRAM_VERSION)) {\n\t\t\t\t\tconst date = TERM_PROGRAM_VERSION.slice('0-unstable-'.length);\n\t\t\t\t\treturn date >= '2020-06-20';\n\t\t\t\t}\n\n\t\t\t\t// This number is a date and reads better grouped as such.\n\t\t\t\t// eslint-disable-next-line unicorn/numeric-separators-style\n\t\t\t\treturn version.major >= 2020_06_20;\n\t\t\t}\n\n\t\t\tcase 'vscode': {\n\t\t\t\t// Cursor forked VS Code and supports hyperlinks in 0.x.x\n\t\t\t\tif (CURSOR_TRACE_ID) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\t// eslint-disable-next-line no-mixed-operators\n\t\t\t\treturn version.major > 1 || version.major === 1 && version.minor >= 72;\n\t\t\t}\n\n\t\t\tcase 'ghostty': {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (VTE_VERSION) {\n\t\t// 0.50.0 was supposed to support hyperlinks, but throws a segfault\n\t\tif (VTE_VERSION === '0.50.0') {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst version = parseVersion(VTE_VERSION);\n\t\treturn version.major > 0 || version.minor >= 50;\n\t}\n\n\tswitch (TERM) {\n\t\tcase 'alacritty': {\n\t\t\t// Support added in v0.11 (2022-10-13)\n\t\t\treturn true;\n\t\t}\n\n\t\tcase 'xterm-kitty': {\n\t\t\treturn true;\n\t\t}\n\t\t// No default\n\t}\n\n\treturn false;\n}\n\nconst supportsHyperlinks = {\n\tstdout: createSupportsHyperlinks(process.stdout),\n\tstderr: createSupportsHyperlinks(process.stderr),\n};\n\nexport default supportsHyperlinks;\n","import ansiEscapes from 'ansi-escapes';\nimport supportsHyperlinks from 'supports-hyperlinks';\n\nexport default function terminalLink(text, url, {target = 'stdout', ...options} = {}) {\n\tif (!supportsHyperlinks[target]) {\n\t\t// If the fallback has been explicitly disabled, don't modify the text itself.\n\t\tif (options.fallback === false) {\n\t\t\treturn text;\n\t\t}\n\n\t\tif (typeof options.fallback === 'function') {\n\t\t\treturn options.fallback(text, url);\n\t\t}\n\n\t\t// Use raw URL bounded by whitespace for maximum compatibility.\n\t\t// Most terminal linkifiers only guarantee correct detection when URLs are\n\t\t// delimited by whitespace. No brackets, quotes, or special characters that\n\t\t// could interfere with URL detection or be included in the linked text.\n\t\treturn `${text} ${url}`;\n\t}\n\n\treturn ansiEscapes.link(text, url);\n}\n\nterminalLink.isSupported = supportsHyperlinks.stdout;\nterminalLink.stderr = (text, url, options = {}) => terminalLink(text, url, {target: 'stderr', ...options});\nterminalLink.stderr.isSupported = supportsHyperlinks.stderr;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { Transform, Text } from 'ink';\nimport terminalLink from 'terminal-link';\n/**\nAn Ink component that creates clickable links in the terminal.\n\n[Supported terminals.](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda)\n\nFor unsupported terminals, the link will be printed after the text: `My website https://sindresorhus.com`.\n\n@example\n```\nimport React from 'react';\nimport {render, Color} from 'ink';\nimport Link from 'ink-link';\n\nrender(\n <Link url=\"https://sindresorhus.com\">\n My <Color cyan>Website</Color>\n </Link>\n);\n```\n*/\nconst Link = ({ children, url, fallback = true }) => (_jsx(Transform, { transform: children => terminalLink(children, url, { fallback }), children: _jsx(Text, { children: children }) }));\nexport default Link;\n"],"names":["isBrowser","platform","ESC","OSC","BEL","SEP","process","isWindows","isTmux","wrapOsc","sequence","eraseScreen","isOldWindows","parts","os","major","build","link","text","url","openLink","closeLink","hasFlag","flag","argv","prefix","position","terminatorPosition","parseVersion","versionString","match","versions","createSupportsHyperlinks","stream","CI","CURSOR_TRACE_ID","FORCE_HYPERLINK","NETLIFY","TEAMCITY_VERSION","TERM_PROGRAM","TERM_PROGRAM_VERSION","VTE_VERSION","TERM","createSupportsColor","version","supportsHyperlinks","terminalLink","target","options","ansiEscapes.link","Link","children","fallback","_jsx","Transform","Text"],"mappings":";;;;;;AAEO,MAAMA,IAAY,WAAW,QAAQ,aAAa;AAEnC,WAAW,SAAS,UAAU;AAE/B,WAAW,SAAS,UAAU;AAE7B,WAAW,MAAM,SAAS;AAEtB,WAAW,SAAS,UAAU;AAEjC,WAAW,WAAW,WAAW,SAAS,OAAO;AAE7C,OAAO,oBAAsB,OAAe,sBAAsB;AAE5D,OAAO,6BAA+B,OAAe,sBAAsB;AAE9E,OAAO,0BAA4B,OAAe,sBAAsB;AAEvE,OAAO,2BAA6B,OAAe,sBAAsB;AAGxG,MAAMC,IAAW,WAAW,WAAW,eAAe;AAE/BA,MAAa,WAChC,WAAW,WAAW,aAAa,cACnC,WAAW,WAAW,WAAW,SAAS,OAAO,MAAM,MACvD,WAAW,SAAS;AAECA,MAAa,aAClC,WAAW,WAAW,aAAa,WACnC,WAAW,SAAS;AAEDA,MAAa,WAChC,WAAW,WAAW,UAAU,WAAW,OAAO,MAAM,MACxD,WAAW,WAAW,WAAW,SAAS,SAAS,MAAM,MACzD,WAAW,SAAS;AAMCA,MAAa,aAClC,WAAW,WAAW,aAAa,aACnC,WAAW,WAAW,WAAW,SAAS,WAAW,MAAM,MAC3D,WAAW,SAAS;AC1CxB,MAAMC,IAAM,SACNC,IAAM,SACNC,IAAM,QACNC,IAAM;AAEU,CAACL,KAAaM,EAAQ,IAAI;AAChD,MAAMC,IAAY,CAACP,KAAaM,EAAQ,aAAa,SAC/CE,IAAS,CAACR,MAAcM,EAAQ,IAAI,MAAM,WAAW,QAAQ,KAAKA,EAAQ,IAAI,MAAM,WAAW,MAAM,KAAKA,EAAQ,IAAI,SAAS;AAEjHN,KAEhBM,EAAQ;AAEZ,MAAMG,IAAU,CAAAC,MACXF,IAII,eAAiBE,EAAS,WAAW,QAAU,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.0/node_modules/ansi-escapes/base.js","../../../node_modules/.pnpm/has-flag@5.0.1/node_modules/has-flag/index.js","../../../node_modules/.pnpm/supports-hyperlinks@4.4.0/node_modules/supports-hyperlinks/index.js","../../../node_modules/.pnpm/terminal-link@5.0.0/node_modules/terminal-link/index.js","../../../node_modules/.pnpm/ink-link@5.0.0_ink@6.6.0_@types+react@19.2.7_react@19.2.3_/node_modules/ink-link/dist/index.js"],"sourcesContent":["/* globals WorkerGlobalScope, DedicatedWorkerGlobalScope, SharedWorkerGlobalScope, ServiceWorkerGlobalScope */\n\nexport const isBrowser = globalThis.window?.document !== undefined;\n\nexport const isNode = globalThis.process?.versions?.node !== undefined;\n\nexport const isBun = globalThis.process?.versions?.bun !== undefined;\n\nexport const isDeno = globalThis.Deno?.version?.deno !== undefined;\n\nexport const isElectron = globalThis.process?.versions?.electron !== undefined;\n\nexport const isJsDom = globalThis.navigator?.userAgent?.includes('jsdom') === true;\n\nexport const isWebWorker = typeof WorkerGlobalScope !== 'undefined' && globalThis instanceof WorkerGlobalScope;\n\nexport const isDedicatedWorker = typeof DedicatedWorkerGlobalScope !== 'undefined' && globalThis instanceof DedicatedWorkerGlobalScope;\n\nexport const isSharedWorker = typeof SharedWorkerGlobalScope !== 'undefined' && globalThis instanceof SharedWorkerGlobalScope;\n\nexport const isServiceWorker = typeof ServiceWorkerGlobalScope !== 'undefined' && globalThis instanceof ServiceWorkerGlobalScope;\n\n// Note: I'm intentionally not DRYing up the other variables to keep them \"lazy\".\nconst platform = globalThis.navigator?.userAgentData?.platform;\n\nexport const isMacOs = platform === 'macOS'\n\t|| globalThis.navigator?.platform === 'MacIntel' // Even on Apple silicon Macs.\n\t|| globalThis.navigator?.userAgent?.includes(' Mac ') === true\n\t|| globalThis.process?.platform === 'darwin';\n\nexport const isWindows = platform === 'Windows'\n\t|| globalThis.navigator?.platform === 'Win32'\n\t|| globalThis.process?.platform === 'win32';\n\nexport const isLinux = platform === 'Linux'\n\t|| globalThis.navigator?.platform?.startsWith('Linux') === true\n\t|| globalThis.navigator?.userAgent?.includes(' Linux ') === true\n\t|| globalThis.process?.platform === 'linux';\n\nexport const isIos = platform === 'iOS'\n\t|| (globalThis.navigator?.platform === 'MacIntel' && globalThis.navigator?.maxTouchPoints > 1)\n\t|| /iPad|iPhone|iPod/.test(globalThis.navigator?.platform);\n\nexport const isAndroid = platform === 'Android'\n\t|| globalThis.navigator?.platform === 'Android'\n\t|| globalThis.navigator?.userAgent?.includes(' Android ') === true\n\t|| globalThis.process?.platform === 'android';\n","import process from 'node:process';\nimport os from 'node:os';\nimport {isBrowser} from 'environment';\n\nconst ESC = '\\u001B[';\nconst OSC = '\\u001B]';\nconst BEL = '\\u0007';\nconst SEP = ';';\n\nconst isTerminalApp = !isBrowser && process.env.TERM_PROGRAM === 'Apple_Terminal';\nconst isWindows = !isBrowser && process.platform === 'win32';\nconst isTmux = !isBrowser && (process.env.TERM?.startsWith('screen') || process.env.TERM?.startsWith('tmux') || process.env.TMUX !== undefined);\n\nconst cwdFunction = isBrowser ? () => {\n\tthrow new Error('`process.cwd()` only works in Node.js, not the browser.');\n} : process.cwd;\n\nconst wrapOsc = sequence => {\n\tif (isTmux) {\n\t\t// Tmux requires OSC sequences to be wrapped with DCS tmux; <sequence> ST\n\t\t// and all ESCs in <sequence> to be replaced with ESC ESC.\n\t\t// It only accepts ESC backslash for ST.\n\t\treturn '\\u001BPtmux;' + sequence.replaceAll('\\u001B', '\\u001B\\u001B') + '\\u001B\\\\';\n\t}\n\n\treturn sequence;\n};\n\nexport const cursorTo = (x, y) => {\n\tif (typeof x !== 'number') {\n\t\tthrow new TypeError('The `x` argument is required');\n\t}\n\n\tif (typeof y !== 'number') {\n\t\treturn ESC + (x + 1) + 'G';\n\t}\n\n\treturn ESC + (y + 1) + SEP + (x + 1) + 'H';\n};\n\nexport const cursorMove = (x, y) => {\n\tif (typeof x !== 'number') {\n\t\tthrow new TypeError('The `x` argument is required');\n\t}\n\n\tlet returnValue = '';\n\n\tif (x < 0) {\n\t\treturnValue += ESC + (-x) + 'D';\n\t} else if (x > 0) {\n\t\treturnValue += ESC + x + 'C';\n\t}\n\n\tif (y < 0) {\n\t\treturnValue += ESC + (-y) + 'A';\n\t} else if (y > 0) {\n\t\treturnValue += ESC + y + 'B';\n\t}\n\n\treturn returnValue;\n};\n\nexport const cursorUp = (count = 1) => ESC + count + 'A';\nexport const cursorDown = (count = 1) => ESC + count + 'B';\nexport const cursorForward = (count = 1) => ESC + count + 'C';\nexport const cursorBackward = (count = 1) => ESC + count + 'D';\n\nexport const cursorLeft = ESC + 'G';\nexport const cursorSavePosition = isTerminalApp ? '\\u001B7' : ESC + 's';\nexport const cursorRestorePosition = isTerminalApp ? '\\u001B8' : ESC + 'u';\nexport const cursorGetPosition = ESC + '6n';\nexport const cursorNextLine = ESC + 'E';\nexport const cursorPrevLine = ESC + 'F';\nexport const cursorHide = ESC + '?25l';\nexport const cursorShow = ESC + '?25h';\n\nexport const eraseLines = count => {\n\tlet clear = '';\n\n\tfor (let i = 0; i < count; i++) {\n\t\tclear += eraseLine + (i < count - 1 ? cursorUp() : '');\n\t}\n\n\tif (count) {\n\t\tclear += cursorLeft;\n\t}\n\n\treturn clear;\n};\n\nexport const eraseEndLine = ESC + 'K';\nexport const eraseStartLine = ESC + '1K';\nexport const eraseLine = ESC + '2K';\nexport const eraseDown = ESC + 'J';\nexport const eraseUp = ESC + '1J';\nexport const eraseScreen = ESC + '2J';\nexport const scrollUp = ESC + 'S';\nexport const scrollDown = ESC + 'T';\n\nexport const clearScreen = '\\u001Bc';\n\nexport const clearViewport = `${eraseScreen}${ESC}H`;\n\nconst isOldWindows = () => {\n\tif (isBrowser || !isWindows) {\n\t\treturn false;\n\t}\n\n\tconst parts = os.release().split('.');\n\tconst major = Number(parts[0]);\n\tconst build = Number(parts[2] ?? 0);\n\n\tif (major < 10) {\n\t\treturn true;\n\t}\n\n\tif (major === 10 && build < 10_586) {\n\t\treturn true;\n\t}\n\n\treturn false;\n};\n\nexport const clearTerminal = isOldWindows()\n\t? `${eraseScreen}${ESC}0f`\n\t// 1. Erases the screen (Only done in case `2` is not supported)\n\t// 2. Erases the whole screen including scrollback buffer\n\t// 3. Moves cursor to the top-left position\n\t// More info: https://www.real-world-systems.com/docs/ANSIcode.html\n\t: `${eraseScreen}${ESC}3J${ESC}H`;\n\nexport const enterAlternativeScreen = ESC + '?1049h';\nexport const exitAlternativeScreen = ESC + '?1049l';\n\nexport const beep = BEL;\n\nexport const link = (text, url) => {\n\tconst openLink = wrapOsc(`${OSC}8${SEP}${SEP}${url}${BEL}`);\n\tconst closeLink = wrapOsc(`${OSC}8${SEP}${SEP}${BEL}`);\n\treturn openLink + text + closeLink;\n};\n\nexport const image = (data, options = {}) => {\n\tlet returnValue = `${OSC}1337;File=inline=1`;\n\n\tif (options.width) {\n\t\treturnValue += `;width=${options.width}`;\n\t}\n\n\tif (options.height) {\n\t\treturnValue += `;height=${options.height}`;\n\t}\n\n\tif (options.preserveAspectRatio === false) {\n\t\treturnValue += ';preserveAspectRatio=0';\n\t}\n\n\tconst imageBuffer = Buffer.from(data);\n\n\t// `size` is optional in the spec, but xterm.js requires it.\n\treturn wrapOsc(returnValue + `;size=${imageBuffer.byteLength}` + ':' + imageBuffer.toString('base64') + BEL);\n};\n\nexport const iTerm = {\n\tsetCwd: (cwd = cwdFunction()) => wrapOsc(`${OSC}50;CurrentDir=${cwd}${BEL}`),\n\n\tannotation(message, options = {}) {\n\t\tlet returnValue = `${OSC}1337;`;\n\n\t\tconst hasX = options.x !== undefined;\n\t\tconst hasY = options.y !== undefined;\n\t\tif ((hasX || hasY) && !(hasX && hasY && options.length !== undefined)) {\n\t\t\tthrow new Error('`x`, `y` and `length` must be defined when `x` or `y` is defined');\n\t\t}\n\n\t\tmessage = message.replaceAll('|', '');\n\n\t\treturnValue += options.isHidden ? 'AddHiddenAnnotation=' : 'AddAnnotation=';\n\n\t\tif (options.length > 0) {\n\t\t\treturnValue += (\n\t\t\t\thasX\n\t\t\t\t\t? [message, options.length, options.x, options.y]\n\t\t\t\t\t: [options.length, message]\n\t\t\t).join('|');\n\t\t} else {\n\t\t\treturnValue += message;\n\t\t}\n\n\t\treturn wrapOsc(returnValue + BEL);\n\t},\n};\n\nexport const ConEmu = {\n\tsetCwd: (cwd = cwdFunction()) => wrapOsc(`${OSC}9;9;${cwd}${BEL}`),\n};\n\nexport const setCwd = (cwd = cwdFunction()) => iTerm.setCwd(cwd) + ConEmu.setCwd(cwd);\n","import process from 'process'; // eslint-disable-line node/prefer-global/process\n\nexport default function hasFlag(flag, argv = process.argv) {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n}\n","import process from 'node:process';\nimport {createSupportsColor} from 'supports-color';\nimport hasFlag from 'has-flag';\n\nfunction parseVersion(versionString = '') {\n\tif (/^\\d{3,4}$/.test(versionString)) {\n\t\t// Env var doesn't always use dots. example: 4601 => 46.1.0\n\t\tconst match = /(\\d{1,2})(\\d{2})/.exec(versionString) ?? [];\n\t\treturn {\n\t\t\tmajor: 0,\n\t\t\tminor: Number.parseInt(match[1], 10),\n\t\t\tpatch: Number.parseInt(match[2], 10),\n\t\t};\n\t}\n\n\tconst versions = (versionString ?? '').split('.').map(n => Number.parseInt(n, 10));\n\treturn {\n\t\tmajor: versions[0],\n\t\tminor: versions[1],\n\t\tpatch: versions[2],\n\t};\n}\n\n// eslint-disable-next-line complexity\nexport function createSupportsHyperlinks(stream) {\n\tconst {\n\t\tCI,\n\t\tCURSOR_TRACE_ID,\n\t\tFORCE_HYPERLINK,\n\t\tNETLIFY,\n\t\tTEAMCITY_VERSION,\n\t\tTERM_PROGRAM,\n\t\tTERM_PROGRAM_VERSION,\n\t\tVTE_VERSION,\n\t\tTERM,\n\t} = process.env;\n\n\tif (FORCE_HYPERLINK) {\n\t\treturn !(FORCE_HYPERLINK.length > 0 && Number.parseInt(FORCE_HYPERLINK, 10) === 0);\n\t}\n\n\tif (hasFlag('no-hyperlink') || hasFlag('no-hyperlinks') || hasFlag('hyperlink=false') || hasFlag('hyperlink=never')) {\n\t\treturn false;\n\t}\n\n\tif (hasFlag('hyperlink=true') || hasFlag('hyperlink=always')) {\n\t\treturn true;\n\t}\n\n\t// Netlify does not run a TTY, it does not need `supportsColor` check\n\tif (NETLIFY) {\n\t\treturn true;\n\t}\n\n\t// If they specify no colors, they probably don't want hyperlinks.\n\tif (!createSupportsColor(stream)) {\n\t\treturn false;\n\t}\n\n\tif (stream && !stream.isTTY) {\n\t\treturn false;\n\t}\n\n\t// Windows Terminal\n\tif ('WT_SESSION' in process.env) {\n\t\treturn true;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\treturn false;\n\t}\n\n\tif (CI) {\n\t\treturn false;\n\t}\n\n\tif (TEAMCITY_VERSION) {\n\t\treturn false;\n\t}\n\n\tif (TERM_PROGRAM) {\n\t\tconst version = parseVersion(TERM_PROGRAM_VERSION);\n\n\t\tswitch (TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app': {\n\t\t\t\tif (version.major === 3) {\n\t\t\t\t\treturn version.minor >= 1;\n\t\t\t\t}\n\n\t\t\t\treturn version.major > 3;\n\t\t\t}\n\n\t\t\tcase 'WezTerm': {\n\t\t\t\t// WezTerm packaged by Nix uses their own version scheme.\n\t\t\t\tif (/^0-unstable-\\d{4}-\\d{2}-\\d{2}$/.test(TERM_PROGRAM_VERSION)) {\n\t\t\t\t\tconst date = TERM_PROGRAM_VERSION.slice('0-unstable-'.length);\n\t\t\t\t\treturn date >= '2020-06-20';\n\t\t\t\t}\n\n\t\t\t\t// This number is a date and reads better grouped as such.\n\t\t\t\t// eslint-disable-next-line unicorn/numeric-separators-style\n\t\t\t\treturn version.major >= 2020_06_20;\n\t\t\t}\n\n\t\t\tcase 'vscode': {\n\t\t\t\t// Cursor forked VS Code and supports hyperlinks in 0.x.x\n\t\t\t\tif (CURSOR_TRACE_ID) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\t// eslint-disable-next-line @stylistic/no-mixed-operators\n\t\t\t\treturn version.major > 1 || version.major === 1 && version.minor >= 72;\n\t\t\t}\n\n\t\t\tcase 'ghostty': {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tcase 'zed': {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t// No default\n\t\t}\n\t}\n\n\tif (VTE_VERSION) {\n\t\t// 0.50.0 was supposed to support hyperlinks, but throws a segfault\n\t\tif (VTE_VERSION === '0.50.0') {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst version = parseVersion(VTE_VERSION);\n\t\treturn version.major > 0 || version.minor >= 50;\n\t}\n\n\tswitch (TERM) {\n\t\tcase 'alacritty': {\n\t\t\t// Support added in v0.11 (2022-10-13)\n\t\t\treturn true;\n\t\t}\n\n\t\tcase 'xterm-kitty': {\n\t\t\treturn true;\n\t\t}\n\t\t// No default\n\t}\n\n\treturn false;\n}\n\nconst supportsHyperlinks = {\n\tstdout: createSupportsHyperlinks(process.stdout),\n\tstderr: createSupportsHyperlinks(process.stderr),\n};\n\nexport default supportsHyperlinks;\n","import ansiEscapes from 'ansi-escapes';\nimport supportsHyperlinks from 'supports-hyperlinks';\n\nexport default function terminalLink(text, url, {target = 'stdout', ...options} = {}) {\n\tif (!supportsHyperlinks[target]) {\n\t\t// If the fallback has been explicitly disabled, don't modify the text itself.\n\t\tif (options.fallback === false) {\n\t\t\treturn text;\n\t\t}\n\n\t\tif (typeof options.fallback === 'function') {\n\t\t\treturn options.fallback(text, url);\n\t\t}\n\n\t\t// Use raw URL bounded by whitespace for maximum compatibility.\n\t\t// Most terminal linkifiers only guarantee correct detection when URLs are\n\t\t// delimited by whitespace. No brackets, quotes, or special characters that\n\t\t// could interfere with URL detection or be included in the linked text.\n\t\treturn `${text} ${url}`;\n\t}\n\n\treturn ansiEscapes.link(text, url);\n}\n\nterminalLink.isSupported = supportsHyperlinks.stdout;\nterminalLink.stderr = (text, url, options = {}) => terminalLink(text, url, {target: 'stderr', ...options});\nterminalLink.stderr.isSupported = supportsHyperlinks.stderr;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { Transform, Text } from 'ink';\nimport terminalLink from 'terminal-link';\n/**\nAn Ink component that creates clickable links in the terminal.\n\n[Supported terminals.](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda)\n\nFor unsupported terminals, the link will be printed after the text: `My website https://sindresorhus.com`.\n\n@example\n```\nimport React from 'react';\nimport {render, Color} from 'ink';\nimport Link from 'ink-link';\n\nrender(\n <Link url=\"https://sindresorhus.com\">\n My <Color cyan>Website</Color>\n </Link>\n);\n```\n*/\nconst Link = ({ children, url, fallback = true }) => (_jsx(Transform, { transform: children => terminalLink(children, url, { fallback }), children: _jsx(Text, { children: children }) }));\nexport default Link;\n"],"names":["isBrowser","platform","ESC","OSC","BEL","SEP","process","isWindows","isTmux","wrapOsc","sequence","eraseScreen","isOldWindows","parts","os","major","build","link","text","url","openLink","closeLink","hasFlag","flag","argv","prefix","position","terminatorPosition","parseVersion","versionString","match","versions","n","createSupportsHyperlinks","stream","CI","CURSOR_TRACE_ID","FORCE_HYPERLINK","NETLIFY","TEAMCITY_VERSION","TERM_PROGRAM","TERM_PROGRAM_VERSION","VTE_VERSION","TERM","createSupportsColor","version","supportsHyperlinks","terminalLink","target","options","ansiEscapes.link","Link","children","fallback","_jsx","Transform","Text"],"mappings":";;;;;;AAEO,MAAMA,IAAY,WAAW,QAAQ,aAAa;AAEnC,WAAW,SAAS,UAAU;AAE/B,WAAW,SAAS,UAAU;AAE7B,WAAW,MAAM,SAAS;AAEtB,WAAW,SAAS,UAAU;AAEjC,WAAW,WAAW,WAAW,SAAS,OAAO;AAE7C,OAAO,oBAAsB,OAAe,sBAAsB;AAE5D,OAAO,6BAA+B,OAAe,sBAAsB;AAE9E,OAAO,0BAA4B,OAAe,sBAAsB;AAEvE,O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,EAAC,QAAA6B,IAAS,UAAU,GAAGC,EAAO,IAAI,IAAI;AACrF,SAAKH,EAAmBE,CAAM,IAiBvBE,EAAiBhC,GAAMC,CAAG,IAf5B8B,EAAQ,aAAa,KACjB/B,IAGJ,OAAO+B,EAAQ,YAAa,aACxBA,EAAQ,SAAS/B,GAAMC,CAAG,IAO3B,GAAGD,CAAI,IAAIC,CAAG;AAIvB;AAEA4B,EAAa,cAAcD,EAAmB;AAC9CC,EAAa,SAAS,CAAC7B,GAAMC,GAAK8B,IAAU,CAAA,MAAOF,EAAa7B,GAAMC,GAAK,EAAC,QAAQ,UAAU,GAAG8B,EAAO,CAAC;AACzGF,EAAa,OAAO,cAAcD,EAAmB;ACHhD,MAACK,IAAO,CAAC,EAAE,UAAAC,GAAU,KAAAjC,GAAK,UAAAkC,IAAW,GAAI,MAAQC,EAAKC,GAAW,EAAE,WAAW,CAAAH,MAAYL,EAAaK,GAAUjC,GAAK,EAAE,UAAAkC,EAAQ,CAAE,GAAG,UAAUC,EAAKE,GAAM,EAAE,UAAUJ,EAAQ,CAAE,EAAC,CAAE;","x_google_ignoreList":[0,1,2,3,4,5]}
@@ -1,4 +1,4 @@
1
- import { am as s, al as t, ad as o, ai as c, ah as S, a4 as m, a8 as r, ak as n, ac as h, aa as g, ap as l, ab as p, ag as M, an as P, aj as T, a9 as u, a5 as i, ae as C, af as v, a7 as I, a6 as d, ao as x, aq as A, ar as R, at as f, as as q, au as V } from "./index-988rqE3P.mjs";
1
+ import { am as s, al as t, ad as o, ai as c, ah as S, a4 as m, a8 as r, ak as n, ac as h, aa as g, ap as l, ab as p, ag as M, an as P, aj as T, a9 as u, a5 as i, ae as C, af as v, a7 as I, a6 as d, ao as x, aq as A, ar as R, at as f, as as q, au as V } from "./index-BXUoBnV1.mjs";
2
2
  export {
3
3
  s as AgentMessageCreateSchema,
4
4
  t as AgentMessageTypeSchema,
@@ -28,4 +28,4 @@ export {
28
28
  q as createTextPart,
29
29
  V as createToolInvocationInput
30
30
  };
31
- //# sourceMappingURL=index-DeR4poGm.mjs.map
31
+ //# sourceMappingURL=index-Fd9XrPfV.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-Fd9XrPfV.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,4 +1,4 @@
1
- import { A as a, a as t, b as n, c as S, d as m, e as o, f as E, g as c, h as A, i as g, j as h, k as v, l as i, m as u, n as r, o as R, p, q as D, r as T, s as M, t as q, u as d, v as O, w as k, x as N, y as _, z as C, B as P, C as l, D as I, E as G, F as U, G as f, H as L, I as Y, J as B, K as V, L as x, M as y, N as z, O as b, P as j, Q as w, R as F, S as H, T as J, U as K, V as Q, W, X, Y as Z, Z as $, _ as ee, $ as se, a0 as ae, a1 as te, a2 as ne, a3 as Se } from "./index-988rqE3P.mjs";
1
+ import { A as a, a as t, b as n, c as S, d as m, e as o, f as E, g as c, h as A, i as g, j as h, k as v, l as i, m as u, n as r, o as R, p, q as D, r as T, s as M, t as q, u as d, v as O, w as k, x as N, y as _, z as C, B as P, C as l, D as I, E as G, F as U, G as f, H as L, I as Y, J as B, K as V, L as x, M as y, N as z, O as b, P as j, Q as w, R as F, S as H, T as J, U as K, V as Q, W, X, Y as Z, Z as $, _ as ee, $ as se, a0 as ae, a1 as te, a2 as ne, a3 as Se } from "./index-BXUoBnV1.mjs";
2
2
  export {
3
3
  a as AGENT_EVENT_TYPES,
4
4
  t as AGENT_STATUS,
@@ -59,4 +59,4 @@ export {
59
59
  ne as OutputStreamSchema,
60
60
  Se as TraceIdSchema
61
61
  };
62
- //# sourceMappingURL=index-C9K_GPuD.mjs.map
62
+ //# sourceMappingURL=index-dyqI6XRC.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-dyqI6XRC.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { av as o, aw as l } from "./index-988rqE3P.mjs";
2
- import { aO as E, aM as I, aN as k, aP as A, aQ as T, aB as L, ba as R, aC as N, aD as P, aR as U, aS as B, b6 as J, aU as $, ax as z, aT as V, aV as W, aW as G, aX as H, aY as O, aZ as _, aG as Y, bc as K, a_ as j, ay as q, b7 as Q, b0 as X, aF as Z, b3 as ee, b1 as te, b4 as ae, b5 as se, a$ as re, b8 as ie, b2 as ne, aE as oe, bi as le, aK as ue, b9 as me, aL as ce, aI as fe, aJ as he, az as de, bb as ge, bh as be, bd as Se, aH as pe, be as we, aA as ve, bf as xe, bg as ye } from "./index-988rqE3P.mjs";
1
+ import { av as o, aw as l } from "./index-BXUoBnV1.mjs";
2
+ import { aO as E, aM as I, aN as k, aP as A, aQ as T, aB as L, ba as R, aC as N, aD as P, aR as U, aS as B, b6 as J, aU as $, ax as z, aT as V, aV as W, aW as G, aX as H, aY as O, aZ as _, aG as Y, bc as K, a_ as j, ay as q, b7 as Q, b0 as X, aF as Z, b3 as ee, b1 as te, b4 as ae, b5 as se, a$ as re, b8 as ie, b2 as ne, aE as oe, bi as le, aK as ue, b9 as me, aL as ce, aI as fe, aJ as he, az as de, bb as ge, bh as be, bd as Se, aH as pe, be as we, aA as ve, bf as xe, bg as ye } from "./index-BXUoBnV1.mjs";
3
3
  import * as n from "node:fs";
4
4
  import * as c from "node:path";
5
5
  import { confirm as f, input as h, password as d, select as g, checkbox as b, number as S } from "@inquirer/prompts";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/utils/prompts.ts","../src/services/Disposable/DisposableBuffer.ts","../src/services/Disposable/DisposableTimeout.ts","../src/services/Logger/FileLogger.ts"],"sourcesContent":["import { checkbox, confirm, input, number, password, select } from '@inquirer/prompts';\n\nexport class PromptUtils {\n /**\n * Ask for confirmation with a yes/no prompt\n */\n static async confirm(message: string, defaultValue = true): Promise<boolean> {\n return await confirm({\n message,\n default: defaultValue,\n });\n }\n\n /**\n * Ask for text input\n */\n static async input(\n message: string,\n options?: {\n default?: string;\n validate?: (input: string) => boolean | string;\n },\n ): Promise<string> {\n return await input({\n message,\n default: options?.default,\n validate: options?.validate,\n });\n }\n\n /**\n * Ask for password input (hidden)\n */\n static async password(\n message: string,\n options?: {\n validate?: (input: string) => boolean | string;\n },\n ): Promise<string> {\n return await password({\n message,\n validate: options?.validate,\n });\n }\n\n /**\n * Ask user to select from a list of choices\n */\n static async select(message: string, choices: string[], defaultChoice?: string): Promise<string> {\n return await select({\n message,\n choices: choices.map((choice) => ({ name: choice, value: choice })),\n default: defaultChoice,\n });\n }\n\n /**\n * Ask user to select multiple items from a list\n */\n static async multiSelect(message: string, choices: string[], defaultChoices?: string[]): Promise<string[]> {\n return await checkbox({\n message,\n choices: choices.map((choice) => ({\n name: choice,\n value: choice,\n checked: defaultChoices?.includes(choice) || false,\n })),\n });\n }\n\n /**\n * Ask for a number input\n */\n static async number(\n message: string,\n options?: {\n default?: number;\n min?: number;\n max?: number;\n },\n ): Promise<number> {\n const result = await number({\n message,\n default: options?.default,\n validate: (input?: number) => {\n if (input === undefined || input === null) return 'Value is required';\n if (options?.min !== undefined && input < options.min) {\n return `Value must be at least ${options.min}`;\n }\n if (options?.max !== undefined && input > options.max) {\n return `Value must be at most ${options.max}`;\n }\n return true;\n },\n });\n\n if (result === undefined) {\n throw new Error('Number input was cancelled or invalid');\n }\n\n return result;\n }\n}\n","/**\n * DisposableBuffer - Manages a string buffer with automatic flush on disposal\n *\n * Use this for output buffering that needs to be flushed when\n * the agent session terminates.\n */\n\nimport { DisposalPriority } from '@/interfaces/disposable';\nimport { BaseDisposable } from './BaseDisposable';\n\n/**\n * A disposable buffer that flushes remaining content on disposal.\n * Useful for buffering output data that needs to be sent before cleanup.\n */\nexport class DisposableBuffer extends BaseDisposable {\n readonly resourceType = 'BUFFER';\n readonly priority = DisposalPriority.NORMAL;\n\n private buffer: string[] = [];\n private onFlush?: (data: string[]) => void | Promise<void>;\n private maxSize: number;\n\n /**\n * Create a new disposable buffer.\n * @param onFlush - Optional callback to receive buffer contents on disposal\n * @param maxSize - Maximum number of items to keep (default: unlimited)\n * @param resourceId - Optional custom resource ID\n */\n constructor(onFlush?: (data: string[]) => void | Promise<void>, maxSize: number = Infinity, resourceId?: string) {\n super(resourceId);\n this.onFlush = onFlush;\n this.maxSize = maxSize;\n }\n\n /**\n * Add data to the buffer.\n * If maxSize is set, oldest items are removed when limit is exceeded.\n */\n push(data: string): void {\n if (this.isDisposed) return;\n\n this.buffer.push(data);\n\n // Trim if over maxSize\n if (this.buffer.length > this.maxSize) {\n this.buffer = this.buffer.slice(-this.maxSize);\n }\n }\n\n /**\n * Get current buffer contents without clearing.\n */\n peek(): ReadonlyArray<string> {\n return this.buffer;\n }\n\n /**\n * Get current buffer size.\n */\n get size(): number {\n return this.buffer.length;\n }\n\n /**\n * Clear the buffer without flushing.\n */\n clear(): void {\n this.buffer = [];\n }\n\n protected async doDispose(): Promise<void> {\n // Flush remaining content\n if (this.onFlush && this.buffer.length > 0) {\n await this.onFlush(this.buffer);\n }\n this.buffer = [];\n this.onFlush = undefined;\n }\n}\n","/**\n * DisposableTimeout - Wraps setTimeout with automatic cleanup\n *\n * Use this instead of raw setTimeout to ensure timeouts are\n * properly cleaned up when the agent session terminates.\n */\n\nimport { DisposalPriority } from '@/interfaces/disposable';\nimport { BaseDisposable } from './BaseDisposable';\n\n/**\n * A disposable wrapper around setTimeout.\n * Automatically clears the timeout on disposal.\n */\nexport class DisposableTimeout extends BaseDisposable {\n readonly resourceType = 'TIMEOUT';\n readonly priority = DisposalPriority.LOW;\n\n private timeoutId: NodeJS.Timeout | null = null;\n\n /**\n * Create a new disposable timeout.\n * @param callback - Function to call when timeout fires\n * @param ms - Delay in milliseconds\n * @param resourceId - Optional custom resource ID\n */\n constructor(callback: () => void, ms: number, resourceId?: string) {\n super(resourceId);\n this.timeoutId = setTimeout(() => {\n callback();\n this.timeoutId = null; // Mark as fired\n }, ms);\n }\n\n protected async doDispose(): Promise<void> {\n if (this.timeoutId !== null) {\n clearTimeout(this.timeoutId);\n this.timeoutId = null;\n }\n }\n}\n","/**\n * File Logger Implementation\n *\n * Simple file stream logger without stdout pollution.\n * Features:\n * - Direct fs.WriteStream writing\n * - Structured JSON logging\n * - No stdout interference\n * - Pino-compatible log levels\n */\n\nimport * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport type { ILogger } from './types';\n\nexport interface FileLoggerOptions {\n logFilePath: string;\n useJsonFormat?: boolean;\n}\n\nexport class FileLogger implements ILogger {\n private stream: fs.WriteStream;\n private useJsonFormat: boolean;\n\n constructor(options: FileLoggerOptions) {\n // Ensure log directory exists\n const logDir = path.dirname(options.logFilePath);\n if (!fs.existsSync(logDir)) {\n fs.mkdirSync(logDir, { recursive: true });\n }\n\n this.stream = fs.createWriteStream(options.logFilePath, {\n flags: 'a', // Append mode\n encoding: 'utf8',\n });\n\n this.useJsonFormat = options.useJsonFormat ?? true;\n\n // Handle stream errors\n this.stream.on('error', (error) => {\n console.error('[FileLogger] Stream error:', error);\n });\n }\n\n /**\n * Write a log entry to the file\n */\n private write(level: number, levelName: string, message: string, ...args: any[]): void {\n const logEntry = {\n level,\n time: Date.now(),\n msg: message,\n ...(args.length > 0 && { args }),\n };\n\n if (this.useJsonFormat) {\n this.stream.write(JSON.stringify(logEntry) + '\\n');\n } else {\n const timestamp = new Date().toISOString();\n const argsStr = args.length > 0 ? ' ' + JSON.stringify(args) : '';\n this.stream.write(`[${timestamp}] ${levelName.toUpperCase()}: ${message}${argsStr}\\n`);\n }\n }\n\n /**\n * Log an informational message\n */\n info(message: string, ...args: any[]): void {\n this.write(30, 'info', message, ...args);\n }\n\n /**\n * Log a success message\n */\n success(message: string, ...args: any[]): void {\n this.write(30, 'success', message, ...args);\n }\n\n /**\n * Log a warning message\n */\n warn(message: string, ...args: any[]): void {\n this.write(40, 'warn', message, ...args);\n }\n\n /**\n * Log an error message\n */\n error(message: string, errorOrOptions?: Error | any): void {\n let error: Error | undefined;\n\n if (errorOrOptions instanceof Error) {\n error = errorOrOptions;\n }\n\n if (error) {\n this.write(50, 'error', message, {\n error: {\n message: error.message,\n stack: error.stack,\n name: error.name,\n },\n });\n } else {\n this.write(50, 'error', message, errorOrOptions);\n }\n }\n\n /**\n * Log a debug message\n */\n debug(message: string, ...args: any[]): void {\n this.write(20, 'debug', message, ...args);\n }\n\n /**\n * Log a trace message\n */\n trace(message: string, ...args: any[]): void {\n this.write(10, 'trace', message, ...args);\n }\n\n /**\n * Log a title/header message\n */\n title(message: string, ...args: any[]): void {\n this.write(30, 'title', message, ...args);\n }\n\n /**\n * Log code or formatted content\n */\n code(message: string, ...args: any[]): void {\n this.write(30, 'code', message, ...args);\n }\n\n /**\n * Log a new line (no-op for file logger)\n */\n newLine(): void {\n // No-op for file logger\n }\n\n /**\n * Log a terminal command or output\n */\n terminal(message: string, ...args: any[]): void {\n this.write(30, 'terminal', message, ...args);\n }\n\n /**\n * Generic log method with level\n */\n log(level: string, message: string, ...args: any[]): void {\n const levelMap: Record<string, number> = {\n trace: 10,\n debug: 20,\n info: 30,\n warn: 40,\n error: 50,\n fatal: 60,\n };\n\n const levelNum = levelMap[level.toLowerCase()] || 30;\n this.write(levelNum, level, message, ...args);\n }\n\n /**\n * Close the file stream\n */\n close(): Promise<void> {\n return new Promise((resolve, reject) => {\n this.stream.end((error) => {\n if (error) {\n reject(error);\n } else {\n resolve();\n }\n });\n });\n }\n\n /**\n * Flush pending writes to disk\n */\n flush(): void {\n // Node.js WriteStream doesn't have a flush method\n // But we can drain the buffer by writing an empty string\n this.stream.write('');\n }\n}\n"],"names":["PromptUtils","message","defaultValue","confirm","options","input","password","choices","defaultChoice","select","choice","defaultChoices","checkbox","result","number","DisposableBuffer","BaseDisposable","DisposalPriority","onFlush","maxSize","resourceId","data","DisposableTimeout","callback","ms","FileLogger","logDir","path","fs","error","level","levelName","args","logEntry","timestamp","argsStr","errorOrOptions","levelNum","resolve","reject"],"mappings":";;;;;;AAEO,MAAMA,EAAY;AAAA;AAAA;AAAA;AAAA,EAIvB,aAAa,QAAQC,GAAiBC,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MAAoB+B,GAAmB;AAC9C,SAAK,MAAM,IAAI,YAAY/B,GAAS,GAAG+B,CAAI;AAAA,EAC7C;AAAA;AAAA;AAAA;AAAA,EAKA,IAAIF,GAAe7B,MAAoB+B,GAAmB;AAUxD,UAAMK,IATmC;AAAA,MACvC,OAAO;AAAA,MACP,OAAO;AAAA,MACP,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,MACP,OAAO;AAAA,IAAA,EAGiBP,EAAM,YAAA,CAAa,KAAK;AAClD,SAAK,MAAMO,GAAUP,GAAO7B,GAAS,GAAG+B,CAAI;AAAA,EAC9C;AAAA;AAAA;AAAA;AAAA,EAKA,QAAuB;AACrB,WAAO,IAAI,QAAQ,CAACM,GAASC,MAAW;AACtC,WAAK,OAAO,IAAI,CAACV,MAAU;AACzB,QAAIA,IACFU,EAAOV,CAAK,IAEZS,EAAA;AAAA,MAEJ,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA,EAKA,QAAc;AAGZ,SAAK,OAAO,MAAM,EAAE;AAAA,EACtB;AACF;"}
1
+ {"version":3,"file":"index.js","sources":["../src/utils/prompts.ts","../src/services/Disposable/DisposableBuffer.ts","../src/services/Disposable/DisposableTimeout.ts","../src/services/Logger/FileLogger.ts"],"sourcesContent":["import { checkbox, confirm, input, number, password, select } from '@inquirer/prompts';\n\nexport class PromptUtils {\n /**\n * Ask for confirmation with a yes/no prompt\n */\n static async confirm(message: string, defaultValue = true): Promise<boolean> {\n return await confirm({\n message,\n default: defaultValue,\n });\n }\n\n /**\n * Ask for text input\n */\n static async input(\n message: string,\n options?: {\n default?: string;\n validate?: (input: string) => boolean | string;\n },\n ): Promise<string> {\n return await input({\n message,\n default: options?.default,\n validate: options?.validate,\n });\n }\n\n /**\n * Ask for password input (hidden)\n */\n static async password(\n message: string,\n options?: {\n validate?: (input: string) => boolean | string;\n },\n ): Promise<string> {\n return await password({\n message,\n validate: options?.validate,\n });\n }\n\n /**\n * Ask user to select from a list of choices\n */\n static async select(message: string, choices: string[], defaultChoice?: string): Promise<string> {\n return await select({\n message,\n choices: choices.map((choice) => ({ name: choice, value: choice })),\n default: defaultChoice,\n });\n }\n\n /**\n * Ask user to select multiple items from a list\n */\n static async multiSelect(message: string, choices: string[], defaultChoices?: string[]): Promise<string[]> {\n return await checkbox({\n message,\n choices: choices.map((choice) => ({\n name: choice,\n value: choice,\n checked: defaultChoices?.includes(choice) || false,\n })),\n });\n }\n\n /**\n * Ask for a number input\n */\n static async number(\n message: string,\n options?: {\n default?: number;\n min?: number;\n max?: number;\n },\n ): Promise<number> {\n const result = await number({\n message,\n default: options?.default,\n validate: (input?: number) => {\n if (input === undefined || input === null) return 'Value is required';\n if (options?.min !== undefined && input < options.min) {\n return `Value must be at least ${options.min}`;\n }\n if (options?.max !== undefined && input > options.max) {\n return `Value must be at most ${options.max}`;\n }\n return true;\n },\n });\n\n if (result === undefined) {\n throw new Error('Number input was cancelled or invalid');\n }\n\n return result;\n }\n}\n","/**\n * DisposableBuffer - Manages a string buffer with automatic flush on disposal\n *\n * Use this for output buffering that needs to be flushed when\n * the agent session terminates.\n */\n\nimport { DisposalPriority } from '@/interfaces/disposable';\nimport { BaseDisposable } from './BaseDisposable';\n\n/**\n * A disposable buffer that flushes remaining content on disposal.\n * Useful for buffering output data that needs to be sent before cleanup.\n */\nexport class DisposableBuffer extends BaseDisposable {\n readonly resourceType = 'BUFFER';\n readonly priority = DisposalPriority.NORMAL;\n\n private buffer: string[] = [];\n private onFlush?: (data: string[]) => void | Promise<void>;\n private maxSize: number;\n\n /**\n * Create a new disposable buffer.\n * @param onFlush - Optional callback to receive buffer contents on disposal\n * @param maxSize - Maximum number of items to keep (default: unlimited)\n * @param resourceId - Optional custom resource ID\n */\n constructor(onFlush?: (data: string[]) => void | Promise<void>, maxSize: number = Infinity, resourceId?: string) {\n super(resourceId);\n this.onFlush = onFlush;\n this.maxSize = maxSize;\n }\n\n /**\n * Add data to the buffer.\n * If maxSize is set, oldest items are removed when limit is exceeded.\n */\n push(data: string): void {\n if (this.isDisposed) return;\n\n this.buffer.push(data);\n\n // Trim if over maxSize\n if (this.buffer.length > this.maxSize) {\n this.buffer = this.buffer.slice(-this.maxSize);\n }\n }\n\n /**\n * Get current buffer contents without clearing.\n */\n peek(): ReadonlyArray<string> {\n return this.buffer;\n }\n\n /**\n * Get current buffer size.\n */\n get size(): number {\n return this.buffer.length;\n }\n\n /**\n * Clear the buffer without flushing.\n */\n clear(): void {\n this.buffer = [];\n }\n\n protected async doDispose(): Promise<void> {\n // Flush remaining content\n if (this.onFlush && this.buffer.length > 0) {\n await this.onFlush(this.buffer);\n }\n this.buffer = [];\n this.onFlush = undefined;\n }\n}\n","/**\n * DisposableTimeout - Wraps setTimeout with automatic cleanup\n *\n * Use this instead of raw setTimeout to ensure timeouts are\n * properly cleaned up when the agent session terminates.\n */\n\nimport { DisposalPriority } from '@/interfaces/disposable';\nimport { BaseDisposable } from './BaseDisposable';\n\n/**\n * A disposable wrapper around setTimeout.\n * Automatically clears the timeout on disposal.\n */\nexport class DisposableTimeout extends BaseDisposable {\n readonly resourceType = 'TIMEOUT';\n readonly priority = DisposalPriority.LOW;\n\n private timeoutId: NodeJS.Timeout | null = null;\n\n /**\n * Create a new disposable timeout.\n * @param callback - Function to call when timeout fires\n * @param ms - Delay in milliseconds\n * @param resourceId - Optional custom resource ID\n */\n constructor(callback: () => void, ms: number, resourceId?: string) {\n super(resourceId);\n this.timeoutId = setTimeout(() => {\n callback();\n this.timeoutId = null; // Mark as fired\n }, ms);\n }\n\n protected async doDispose(): Promise<void> {\n if (this.timeoutId !== null) {\n clearTimeout(this.timeoutId);\n this.timeoutId = null;\n }\n }\n}\n","/**\n * File Logger Implementation\n *\n * Simple file stream logger without stdout pollution.\n * Features:\n * - Direct fs.WriteStream writing\n * - Structured JSON logging\n * - No stdout interference\n * - Pino-compatible log levels\n */\n\nimport * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport type { ILogger } from './types';\n\nexport interface FileLoggerOptions {\n logFilePath: string;\n useJsonFormat?: boolean;\n}\n\nexport class FileLogger implements ILogger {\n private stream: fs.WriteStream;\n private useJsonFormat: boolean;\n\n constructor(options: FileLoggerOptions) {\n // Ensure log directory exists\n const logDir = path.dirname(options.logFilePath);\n if (!fs.existsSync(logDir)) {\n fs.mkdirSync(logDir, { recursive: true });\n }\n\n this.stream = fs.createWriteStream(options.logFilePath, {\n flags: 'a', // Append mode\n encoding: 'utf8',\n });\n\n this.useJsonFormat = options.useJsonFormat ?? true;\n\n // Handle stream errors\n this.stream.on('error', (error) => {\n console.error('[FileLogger] Stream error:', error);\n });\n }\n\n /**\n * Write a log entry to the file\n */\n private write(level: number, levelName: string, message: string, ...args: any[]): void {\n const logEntry = {\n level,\n time: Date.now(),\n msg: message,\n ...(args.length > 0 && { args }),\n };\n\n if (this.useJsonFormat) {\n this.stream.write(JSON.stringify(logEntry) + '\\n');\n } else {\n const timestamp = new Date().toISOString();\n const argsStr = args.length > 0 ? ' ' + JSON.stringify(args) : '';\n this.stream.write(`[${timestamp}] ${levelName.toUpperCase()}: ${message}${argsStr}\\n`);\n }\n }\n\n /**\n * Log an informational message\n */\n info(message: string, ...args: any[]): void {\n this.write(30, 'info', message, ...args);\n }\n\n /**\n * Log a success message\n */\n success(message: string, ...args: any[]): void {\n this.write(30, 'success', message, ...args);\n }\n\n /**\n * Log a warning message\n */\n warn(message: string, ...args: any[]): void {\n this.write(40, 'warn', message, ...args);\n }\n\n /**\n * Log an error message\n */\n error(message: string, errorOrOptions?: Error | any): void {\n let error: Error | undefined;\n\n if (errorOrOptions instanceof Error) {\n error = errorOrOptions;\n }\n\n if (error) {\n this.write(50, 'error', message, {\n error: {\n message: error.message,\n stack: error.stack,\n name: error.name,\n },\n });\n } else {\n this.write(50, 'error', message, errorOrOptions);\n }\n }\n\n /**\n * Log a debug message\n */\n debug(message: string, ...args: any[]): void {\n this.write(20, 'debug', message, ...args);\n }\n\n /**\n * Log a trace message\n */\n trace(message: string, ...args: any[]): void {\n this.write(10, 'trace', message, ...args);\n }\n\n /**\n * Log a title/header message\n */\n title(message: string, ...args: any[]): void {\n this.write(30, 'title', message, ...args);\n }\n\n /**\n * Log code or formatted content\n */\n code(message: string, ...args: any[]): void {\n this.write(30, 'code', message, ...args);\n }\n\n /**\n * Log a new line (no-op for file logger)\n */\n newLine(): void {\n // No-op for file logger\n }\n\n /**\n * Log a terminal command or output\n */\n terminal(message: string, ...args: any[]): void {\n this.write(30, 'terminal', message, ...args);\n }\n\n /**\n * Generic log method with level\n */\n log(level: string, message: string, ...args: any[]): void {\n const levelMap: Record<string, number> = {\n trace: 10,\n debug: 20,\n info: 30,\n warn: 40,\n error: 50,\n fatal: 60,\n };\n\n const levelNum = levelMap[level.toLowerCase()] || 30;\n this.write(levelNum, level, message, ...args);\n }\n\n /**\n * Close the file stream\n */\n close(): Promise<void> {\n return new Promise((resolve, reject) => {\n this.stream.end((error: Error | null | undefined) => {\n if (error) {\n reject(error);\n } else {\n resolve();\n }\n });\n });\n }\n\n /**\n * Flush pending writes to disk\n */\n flush(): void {\n // Node.js WriteStream doesn't have a flush method\n // But we can drain the buffer by writing an empty string\n this.stream.write('');\n }\n}\n"],"names":["PromptUtils","message","defaultValue","confirm","options","input","password","choices","defaultChoice","select","choice","defaultChoices","checkbox","result","number","DisposableBuffer","BaseDisposable","DisposalPriority","onFlush","maxSize","resourceId","data","DisposableTimeout","callback","ms","FileLogger","logDir","path","fs","error","level","levelName","args","logEntry","timestamp","argsStr","errorOrOptions","levelNum","resolve","reject"],"mappings":";;;;;;AAEO,MAAMA,EAAY;AAAA;AAAA;AAAA;AAAA,EAIvB,aAAa,QAAQC,GAAiBC,IAAe,IAAwB;AAC3E,WAAO,MAAMC,EAAQ;AAAA,MACnB,SAAAF;AAAA,MACA,SAASC;AAAA,IAAA,CACV;AAAA,EACH;AAAA;AAAA;AAAA;AAAA,EAKA,aAAa,MACXD,GACAG,GAIiB;AACjB,WAAO,MAAMC,EAAM;A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AAA,MACP,OAAO;AAAA,MACP,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,MACP,OAAO;AAAA,IAAA,EAGiBP,EAAM,YAAA,CAAa,KAAK;AAClD,SAAK,MAAMO,GAAUP,GAAO7B,GAAS,GAAG+B,CAAI;AAAA,EAC9C;AAAA;AAAA;AAAA;AAAA,EAKA,QAAuB;AACrB,WAAO,IAAI,QAAQ,CAACM,GAASC,MAAW;AACtC,WAAK,OAAO,IAAI,CAACV,MAAoC;AACnD,QAAIA,IACFU,EAAOV,CAAK,IAEZS,EAAA;AAAA,MAEJ,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA,EAKA,QAAc;AAGZ,SAAK,OAAO,MAAM,EAAE;AAAA,EACtB;AACF;"}
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agiflowai/agent-cli",
3
- "version": "0.2.12",
3
+ "version": "0.2.13",
4
4
  "description": "@agiflowai/agent-cli - Command-line interface for Agiflow development tools",
5
5
  "type": "module",
6
6
  "bin": {
@@ -24,12 +24,12 @@
24
24
  "inversify": "7.10.4",
25
25
  "mkdirp": "^3.0.1",
26
26
  "node-forge": "^1.3.1",
27
- "node-pty": "^1.0.0",
27
+ "node-pty": "1.0.0",
28
28
  "ora": "8.1.1",
29
29
  "pino": "10.1.0",
30
30
  "pino-pretty": "13.1.2",
31
31
  "pino-roll": "^3.1.0",
32
- "react": "19.2.0",
32
+ "react": "19.2.3",
33
33
  "react-redux": "^9.2.0",
34
34
  "redux": "5.0.1",
35
35
  "reflect-metadata": "0.2.2",
@@ -38,7 +38,7 @@
38
38
  "supports-color": "^10.2.2",
39
39
  "ulidx": "2.4.1",
40
40
  "ws": "^8.18.3",
41
- "zod": "4.1.12"
41
+ "zod": "4.3.4"
42
42
  },
43
43
  "author": "Agimon Team",
44
44
  "license": "Elastic-2.0"