@agentdocumentformat/cli 0.7.2

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 (117) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +45 -0
  3. package/dist/adf.mjs +162 -0
  4. package/dist/chunks/APEv2Parser-2CNNHMXV.mjs +22 -0
  5. package/dist/chunks/AiffParser-7BR4RL6G.mjs +162 -0
  6. package/dist/chunks/App-L5L37JI5.mjs +16747 -0
  7. package/dist/chunks/AsfParser-VVRSLFOM.mjs +538 -0
  8. package/dist/chunks/DsdiffParser-CMD4AX7A.mjs +156 -0
  9. package/dist/chunks/DsfParser-UOGZDS2M.mjs +94 -0
  10. package/dist/chunks/FlacParser-HB3T3CD4.mjs +23 -0
  11. package/dist/chunks/MP4Parser-66HBRUSX.mjs +973 -0
  12. package/dist/chunks/MatroskaParser-J3HUIMEW.mjs +579 -0
  13. package/dist/chunks/MpegParser-YW6LIUEW.mjs +442 -0
  14. package/dist/chunks/MusepackParser-PAUSXP7D.mjs +252 -0
  15. package/dist/chunks/OggParser-NUBV3GWC.mjs +359 -0
  16. package/dist/chunks/WavPackParser-WQAGT7TC.mjs +171 -0
  17. package/dist/chunks/WaveParser-EWLQVDX4.mjs +238 -0
  18. package/dist/chunks/adf-schema-JRU2BTOG.mjs +62 -0
  19. package/dist/chunks/build-QF5W473T.mjs +60 -0
  20. package/dist/chunks/chatgpt-subscription-BQGWYZXE.mjs +23 -0
  21. package/dist/chunks/chunk-2DIECGFL.mjs +6 -0
  22. package/dist/chunks/chunk-2NAP2ZF7.mjs +60 -0
  23. package/dist/chunks/chunk-3AT7IIP7.mjs +25696 -0
  24. package/dist/chunks/chunk-3GNIDM53.mjs +35 -0
  25. package/dist/chunks/chunk-3M4ZPOA3.mjs +1477 -0
  26. package/dist/chunks/chunk-4MQPTCXY.mjs +510 -0
  27. package/dist/chunks/chunk-5PO5PKRV.mjs +366 -0
  28. package/dist/chunks/chunk-5QU5VY7N.mjs +52 -0
  29. package/dist/chunks/chunk-5W7KES6P.mjs +436 -0
  30. package/dist/chunks/chunk-62NE4LG4.mjs +61 -0
  31. package/dist/chunks/chunk-64OKE4X3.mjs +45 -0
  32. package/dist/chunks/chunk-6GJ4QHRI.mjs +1278 -0
  33. package/dist/chunks/chunk-6VQEXLE2.mjs +144 -0
  34. package/dist/chunks/chunk-6XUV6EK6.mjs +41 -0
  35. package/dist/chunks/chunk-776TSXEP.mjs +43 -0
  36. package/dist/chunks/chunk-7CV2SA3H.mjs +285 -0
  37. package/dist/chunks/chunk-7MTRVW2U.mjs +3103 -0
  38. package/dist/chunks/chunk-7N2R2VCG.mjs +1434 -0
  39. package/dist/chunks/chunk-7T2YMTWL.mjs +374 -0
  40. package/dist/chunks/chunk-7XYNI52E.mjs +149 -0
  41. package/dist/chunks/chunk-APHX6HSV.mjs +7731 -0
  42. package/dist/chunks/chunk-APRU6PHC.mjs +40 -0
  43. package/dist/chunks/chunk-AUYKRQPJ.mjs +499 -0
  44. package/dist/chunks/chunk-DXWDD5XJ.mjs +136 -0
  45. package/dist/chunks/chunk-EWL5FG4I.mjs +39 -0
  46. package/dist/chunks/chunk-EYX2YLJW.mjs +117 -0
  47. package/dist/chunks/chunk-F5ELW46V.mjs +27 -0
  48. package/dist/chunks/chunk-G426FACA.mjs +49 -0
  49. package/dist/chunks/chunk-GEKSJHIV.mjs +2472 -0
  50. package/dist/chunks/chunk-HBUENVQL.mjs +570 -0
  51. package/dist/chunks/chunk-HPVFJYXR.mjs +112 -0
  52. package/dist/chunks/chunk-HWLWPXQ7.mjs +721 -0
  53. package/dist/chunks/chunk-I2HJYHFT.mjs +665 -0
  54. package/dist/chunks/chunk-I3UYSITV.mjs +68 -0
  55. package/dist/chunks/chunk-IC4JDZCI.mjs +3864 -0
  56. package/dist/chunks/chunk-IHDDCZBS.mjs +112 -0
  57. package/dist/chunks/chunk-IIGMZHQQ.mjs +10416 -0
  58. package/dist/chunks/chunk-KWFOS5WC.mjs +41 -0
  59. package/dist/chunks/chunk-LAZIXV2F.mjs +5290 -0
  60. package/dist/chunks/chunk-LFMB4PAA.mjs +10814 -0
  61. package/dist/chunks/chunk-M2RX3S2T.mjs +49 -0
  62. package/dist/chunks/chunk-M3WPIJYM.mjs +65 -0
  63. package/dist/chunks/chunk-NBTUWMGP.mjs +263 -0
  64. package/dist/chunks/chunk-NGK6PVSF.mjs +2676 -0
  65. package/dist/chunks/chunk-NZ7JTHEO.mjs +85 -0
  66. package/dist/chunks/chunk-OQN33RGQ.mjs +52 -0
  67. package/dist/chunks/chunk-RIX34QHC.mjs +2935 -0
  68. package/dist/chunks/chunk-SGUTYISF.mjs +16 -0
  69. package/dist/chunks/chunk-SLJ5L7PY.mjs +1473 -0
  70. package/dist/chunks/chunk-SLUKGXKH.mjs +68 -0
  71. package/dist/chunks/chunk-TMT32MXT.mjs +419 -0
  72. package/dist/chunks/chunk-UYY5M2PB.mjs +151 -0
  73. package/dist/chunks/chunk-VAUOM3IN.mjs +298 -0
  74. package/dist/chunks/chunk-VMHTYDH4.mjs +172 -0
  75. package/dist/chunks/chunk-VZS54AA5.mjs +200 -0
  76. package/dist/chunks/chunk-WFQUVXML.mjs +295 -0
  77. package/dist/chunks/chunk-X34PDRUH.mjs +809 -0
  78. package/dist/chunks/chunk-XNPZBLYL.mjs +33 -0
  79. package/dist/chunks/chunk-XX7OSWTO.mjs +157 -0
  80. package/dist/chunks/chunk-XYTWGHFS.mjs +600 -0
  81. package/dist/chunks/chunk-XYV3VCIX.mjs +336 -0
  82. package/dist/chunks/chunk-Y5ZLKFLE.mjs +1469 -0
  83. package/dist/chunks/chunk-ZJKXHM4Q.mjs +230 -0
  84. package/dist/chunks/cli-TCMBNZF6.mjs +1030 -0
  85. package/dist/chunks/commands-DTEKM4ZL.mjs +20 -0
  86. package/dist/chunks/daemon-ZC3FZ2P4.mjs +112449 -0
  87. package/dist/chunks/daemon-control-WDX7PMTC.mjs +300 -0
  88. package/dist/chunks/daemon-token-WRSULP7G.mjs +23 -0
  89. package/dist/chunks/devtools-H7CI2ZVG.mjs +85 -0
  90. package/dist/chunks/discord-IWDQJA7A.mjs +70588 -0
  91. package/dist/chunks/dist-C57KYFS2.mjs +4952 -0
  92. package/dist/chunks/dist-I3XBAGDL.mjs +11 -0
  93. package/dist/chunks/email-V4Q4VJON.mjs +58679 -0
  94. package/dist/chunks/environment-NX277MQG.mjs +15 -0
  95. package/dist/chunks/grok-subscription-4PYX7TBF.mjs +19 -0
  96. package/dist/chunks/layout-EPJQNFAI.mjs +22 -0
  97. package/dist/chunks/lib-N7FCZWKH.mjs +4038 -0
  98. package/dist/chunks/open-OTQDGDH5.mjs +36 -0
  99. package/dist/chunks/parser-JVY2PWSM.mjs +19 -0
  100. package/dist/chunks/pipeline-executor-BHBSJX2K.mjs +19 -0
  101. package/dist/chunks/react-IUIDQ5LX.mjs +11 -0
  102. package/dist/chunks/screen-54BUTYCW.mjs +27 -0
  103. package/dist/chunks/slack-3L5QTDZX.mjs +8113 -0
  104. package/dist/chunks/store-WR7TZJZS.mjs +32 -0
  105. package/dist/chunks/telegram-5ISVFBV3.mjs +14918 -0
  106. package/dist/chunks/terminal-O5WO7C5U.mjs +48 -0
  107. package/dist/chunks/theme-NORU4J74.mjs +20 -0
  108. package/dist/chunks/themes-F2FKU7CP.mjs +23 -0
  109. package/dist/chunks/token-6G3HCMNX.mjs +54 -0
  110. package/dist/chunks/token-util-UXYSDQIW.mjs +12 -0
  111. package/dist/chunks/tui-ODVYUIMT.mjs +197 -0
  112. package/dist/chunks/welcome-XHXFV7SH.mjs +32 -0
  113. package/dist/chunks/whatsapp-XSAMNGPJ.mjs +85412 -0
  114. package/dist/chunks/xterm-headless-YF53XWXE.mjs +3353 -0
  115. package/package.json +53 -0
  116. package/resources/wasm/coreutils.LICENSE +18 -0
  117. package/resources/wasm/coreutils.wasm +0 -0
@@ -0,0 +1,48 @@
1
+ import { createRequire as __adfCreateRequire } from 'node:module';
2
+ import { fileURLToPath as __adfFileURLToPath } from 'node:url';
3
+ import { dirname as __adfDirname } from 'node:path';
4
+ const require = __adfCreateRequire(import.meta.url);
5
+ const __filename = __adfFileURLToPath(import.meta.url);
6
+ const __dirname = __adfDirname(__filename);
7
+ import {
8
+ ALT_SCROLL_OFF,
9
+ ALT_SCROLL_ON,
10
+ MOUSE_OFF,
11
+ MOUSE_ON,
12
+ installTerminalModes,
13
+ isMouseGarbage,
14
+ lastRawInput,
15
+ newlineKey,
16
+ noteRawInput,
17
+ noteShiftEnter,
18
+ parseMouse,
19
+ setMouseWanted,
20
+ setWriteTap,
21
+ shiftEnterWorks,
22
+ superArrow,
23
+ terminalCaps,
24
+ useTerminalCaps,
25
+ writeTerminal
26
+ } from "./chunk-7XYNI52E.mjs";
27
+ import "./chunk-6GJ4QHRI.mjs";
28
+ import "./chunk-M2RX3S2T.mjs";
29
+ export {
30
+ ALT_SCROLL_OFF,
31
+ ALT_SCROLL_ON,
32
+ MOUSE_OFF,
33
+ MOUSE_ON,
34
+ installTerminalModes,
35
+ isMouseGarbage,
36
+ lastRawInput,
37
+ newlineKey,
38
+ noteRawInput,
39
+ noteShiftEnter,
40
+ parseMouse,
41
+ setMouseWanted,
42
+ setWriteTap,
43
+ shiftEnterWorks,
44
+ superArrow,
45
+ terminalCaps,
46
+ useTerminalCaps,
47
+ writeTerminal
48
+ };
@@ -0,0 +1,20 @@
1
+ import { createRequire as __adfCreateRequire } from 'node:module';
2
+ import { fileURLToPath as __adfFileURLToPath } from 'node:url';
3
+ import { dirname as __adfDirname } from 'node:path';
4
+ const require = __adfCreateRequire(import.meta.url);
5
+ const __filename = __adfFileURLToPath(import.meta.url);
6
+ const __dirname = __adfDirname(__filename);
7
+ import {
8
+ ThemeContext,
9
+ createTheme,
10
+ stateColor,
11
+ useTheme
12
+ } from "./chunk-EYX2YLJW.mjs";
13
+ import "./chunk-6GJ4QHRI.mjs";
14
+ import "./chunk-M2RX3S2T.mjs";
15
+ export {
16
+ ThemeContext,
17
+ createTheme,
18
+ stateColor,
19
+ useTheme
20
+ };
@@ -0,0 +1,23 @@
1
+ import { createRequire as __adfCreateRequire } from 'node:module';
2
+ import { fileURLToPath as __adfFileURLToPath } from 'node:url';
3
+ import { dirname as __adfDirname } from 'node:path';
4
+ const require = __adfCreateRequire(import.meta.url);
5
+ const __filename = __adfFileURLToPath(import.meta.url);
6
+ const __dirname = __adfDirname(__filename);
7
+ import {
8
+ THEMES,
9
+ applyTheme,
10
+ findTheme,
11
+ nextThemeName,
12
+ themeNames
13
+ } from "./chunk-SLUKGXKH.mjs";
14
+ import "./chunk-EYX2YLJW.mjs";
15
+ import "./chunk-6GJ4QHRI.mjs";
16
+ import "./chunk-M2RX3S2T.mjs";
17
+ export {
18
+ THEMES,
19
+ applyTheme,
20
+ findTheme,
21
+ nextThemeName,
22
+ themeNames
23
+ };
@@ -0,0 +1,54 @@
1
+ import { createRequire as __adfCreateRequire } from 'node:module';
2
+ import { fileURLToPath as __adfFileURLToPath } from 'node:url';
3
+ import { dirname as __adfDirname } from 'node:path';
4
+ const require = __adfCreateRequire(import.meta.url);
5
+ const __filename = __adfFileURLToPath(import.meta.url);
6
+ const __dirname = __adfDirname(__filename);
7
+ import {
8
+ require_token_util
9
+ } from "./chunk-XYV3VCIX.mjs";
10
+ import {
11
+ require_token_error
12
+ } from "./chunk-KWFOS5WC.mjs";
13
+ import {
14
+ __commonJS
15
+ } from "./chunk-M2RX3S2T.mjs";
16
+
17
+ // node_modules/@vercel/oidc/dist/token.js
18
+ var require_token = __commonJS({
19
+ "node_modules/@vercel/oidc/dist/token.js"(exports, module) {
20
+ var __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.getOwnPropertyNames, __hasOwnProp = Object.prototype.hasOwnProperty, __export = (target, all) => {
21
+ for (var name in all)
22
+ __defProp(target, name, { get: all[name], enumerable: !0 });
23
+ }, __copyProps = (to, from, except, desc) => {
24
+ if (from && typeof from == "object" || typeof from == "function")
25
+ for (let key of __getOwnPropNames(from))
26
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
27
+ return to;
28
+ }, __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod), token_exports = {};
29
+ __export(token_exports, {
30
+ refreshToken: () => refreshToken
31
+ });
32
+ module.exports = __toCommonJS(token_exports);
33
+ var import_token_error = require_token_error(), import_token_util = require_token_util();
34
+ async function refreshToken() {
35
+ let { projectId, teamId } = (0, import_token_util.findProjectInfo)(), maybeToken = (0, import_token_util.loadToken)(projectId);
36
+ if (!maybeToken || (0, import_token_util.isExpired)((0, import_token_util.getTokenPayload)(maybeToken.token))) {
37
+ let authToken = await (0, import_token_util.getVercelCliToken)();
38
+ if (!authToken)
39
+ throw new import_token_error.VercelOidcTokenError(
40
+ "Failed to refresh OIDC token: Log in to Vercel CLI and link your project with `vc link`"
41
+ );
42
+ if (!projectId)
43
+ throw new import_token_error.VercelOidcTokenError(
44
+ "Failed to refresh OIDC token: Try re-linking your project with `vc link`"
45
+ );
46
+ if (maybeToken = await (0, import_token_util.getVercelOidcToken)(authToken, projectId, teamId), !maybeToken)
47
+ throw new import_token_error.VercelOidcTokenError("Failed to refresh OIDC token");
48
+ (0, import_token_util.saveToken)(maybeToken, projectId);
49
+ }
50
+ process.env.VERCEL_OIDC_TOKEN = maybeToken.token;
51
+ }
52
+ }
53
+ });
54
+ export default require_token();
@@ -0,0 +1,12 @@
1
+ import { createRequire as __adfCreateRequire } from 'node:module';
2
+ import { fileURLToPath as __adfFileURLToPath } from 'node:url';
3
+ import { dirname as __adfDirname } from 'node:path';
4
+ const require = __adfCreateRequire(import.meta.url);
5
+ const __filename = __adfFileURLToPath(import.meta.url);
6
+ const __dirname = __adfDirname(__filename);
7
+ import {
8
+ require_token_util
9
+ } from "./chunk-XYV3VCIX.mjs";
10
+ import "./chunk-KWFOS5WC.mjs";
11
+ import "./chunk-M2RX3S2T.mjs";
12
+ export default require_token_util();
@@ -0,0 +1,197 @@
1
+ import { createRequire as __adfCreateRequire } from 'node:module';
2
+ import { fileURLToPath as __adfFileURLToPath } from 'node:url';
3
+ import { dirname as __adfDirname } from 'node:path';
4
+ const require = __adfCreateRequire(import.meta.url);
5
+ const __filename = __adfFileURLToPath(import.meta.url);
6
+ const __dirname = __adfDirname(__filename);
7
+ import {
8
+ DaemonClient
9
+ } from "./chunk-X34PDRUH.mjs";
10
+ import "./chunk-XNPZBLYL.mjs";
11
+ import {
12
+ cjs
13
+ } from "./chunk-SGUTYISF.mjs";
14
+ import {
15
+ defaultPrefsPath,
16
+ loadPrefs,
17
+ savePrefs
18
+ } from "./chunk-5QU5VY7N.mjs";
19
+ import {
20
+ daemon_url_exports
21
+ } from "./chunk-G426FACA.mjs";
22
+ import "./chunk-IHDDCZBS.mjs";
23
+ import "./chunk-M2RX3S2T.mjs";
24
+
25
+ // src/main/tui/index.tsx
26
+ var { resolveDaemonUrl } = cjs(daemon_url_exports);
27
+ function preferProductionReact(env = process.env) {
28
+ env.NODE_ENV ??= "production";
29
+ }
30
+ function tuiUsage() {
31
+ return `Usage: adf [tui] [options]
32
+
33
+ The ADF terminal app: your fleet of agents, each agent's
34
+ loops, chat, files, approvals and live umbilical events. Loops are an agent's
35
+ separate chat sessions (threads): main talks to you; inner loops (side loops)
36
+ such as a memory consolidator on a nightly timer or a researcher work on their
37
+ own goal, on demand or on a schedule.
38
+
39
+ Options:
40
+ --url, -u <url> Daemon URL (default ADF_DAEMON_URL or ${resolveDaemonUrl(void 0, {})})
41
+ --token <token> Bearer token (default ADF_DAEMON_TOKEN)
42
+ --view <id> Start view: fleet | chat | files | loops | inspect | runtime
43
+ --agent <id|handle> Preselect an agent
44
+ --loop <name> Preselect one of its loops (default main)
45
+ --theme <name> adf (dark) | adf-light | adf-contrast | adf-mono (also ADF_TUI_THEME)
46
+ --mono No color (also NO_COLOR=1)
47
+ --ascii ASCII glyphs (also ADF_TUI_ASCII=1)
48
+ --no-alt-screen Render in the main screen buffer (also turns mouse mode off)
49
+ --mouse Mouse mode, the default: the wheel scrolls what is under the pointer, a click
50
+ expands a tool call or thinking, drag selects and copies, right-click pastes
51
+ (Shift+drag, Option+drag in iTerm2: the terminal's own selection)
52
+ --no-mouse The terminal's own mouse (also ADF_TUI_MOUSE=0, /mouse off; remembered)
53
+ --no-kitty Never enable the kitty keyboard protocol (Shift+Enter; also ADF_TUI_KITTY=0)
54
+ -h, --help Show this help`;
55
+ }
56
+ function parseTuiArgs(argv) {
57
+ let options = { altScreen: !0, help: !1 };
58
+ for (let i = 0; i < argv.length; i++) {
59
+ let arg = argv[i], value = () => {
60
+ let next = argv[++i];
61
+ if (next === void 0) throw new Error(`${arg} requires a value`);
62
+ return next;
63
+ };
64
+ if (arg === "--url" || arg === "-u") options.url = value();
65
+ else if (arg.startsWith("--url=")) options.url = arg.slice(6);
66
+ else if (arg === "--token") options.token = value();
67
+ else if (arg === "--view") options.view = value();
68
+ else if (arg === "--agent") options.agent = value();
69
+ else if (arg === "--loop") options.loop = value();
70
+ else if (arg === "--theme") options.theme = value();
71
+ else if (arg.startsWith("--theme=")) options.theme = arg.slice(8);
72
+ else if (arg === "--mono" || arg === "--no-color") options.mono = !0;
73
+ else if (arg === "--ascii") options.ascii = !0;
74
+ else if (arg === "--no-alt-screen") options.altScreen = !1;
75
+ else if (arg === "--no-mouse") options.mouse = !1;
76
+ else if (arg === "--mouse") options.mouse = !0;
77
+ else if (arg === "--no-kitty") options.kitty = !1;
78
+ else if (arg === "-h" || arg === "--help") options.help = !0;
79
+ else {
80
+ if (arg === "tui") continue;
81
+ throw new Error(`Unknown option: ${arg}`);
82
+ }
83
+ }
84
+ return options;
85
+ }
86
+ var defaultIo = () => ({ stdout: process.stdout, stdin: process.stdin, stderr: process.stderr, env: process.env });
87
+ function resolveThemeChoice(options, env, { THEMES, findTheme }) {
88
+ let wanted = options.theme ?? env.ADF_TUI_THEME;
89
+ return wanted ? findTheme(wanted) ? { name: wanted } : { error: `Unknown theme "${wanted}". Themes: ${THEMES.map((t) => t.name).join(", ")}` } : {};
90
+ }
91
+ async function runTui(argv = process.argv.slice(2), io = defaultIo()) {
92
+ let options;
93
+ try {
94
+ options = parseTuiArgs(argv);
95
+ } catch (err) {
96
+ return io.stderr.write(`${err instanceof Error ? err.message : String(err)}
97
+
98
+ ${tuiUsage()}
99
+ `), 2;
100
+ }
101
+ if (options.help)
102
+ return io.stdout.write(`${tuiUsage()}
103
+ `), 0;
104
+ if (!io.stdout.isTTY || !io.stdin.isTTY)
105
+ return io.stderr.write(
106
+ "adf: the terminal app needs a terminal (stdin and stdout must be a TTY).\nFor scripts and pipes use one-shot commands, e.g. `npm run adf -- agents` or `npm run adf -- --help`.\n"
107
+ ), 1;
108
+ preferProductionReact();
109
+ let [
110
+ { default: React },
111
+ { render },
112
+ { App },
113
+ themes,
114
+ { createTuiStore },
115
+ { createTheme },
116
+ { installTerminalModes, shiftEnterWorks, terminalCaps },
117
+ { LAYOUT_STATE_KEY }
118
+ ] = await Promise.all([
119
+ import("./react-IUIDQ5LX.mjs"),
120
+ import("./build-QF5W473T.mjs"),
121
+ import("./App-L5L37JI5.mjs"),
122
+ import("./themes-F2FKU7CP.mjs"),
123
+ import("./store-WR7TZJZS.mjs"),
124
+ import("./theme-NORU4J74.mjs"),
125
+ import("./terminal-O5WO7C5U.mjs"),
126
+ import("./layout-EPJQNFAI.mjs")
127
+ ]), { installScreenMirror } = await import("./screen-54BUTYCW.mjs"), uninstallMirror = options.altScreen ? await installScreenMirror(io.stdout).catch(() => () => {
128
+ }) : () => {
129
+ };
130
+ globalThis.React ??= React;
131
+ let { applyTheme, findTheme } = themes, themeChoice = resolveThemeChoice(options, io.env, themes);
132
+ if (themeChoice.error)
133
+ return io.stderr.write(`${themeChoice.error}
134
+ `), 2;
135
+ let client = new DaemonClient({ baseUrl: options.url, token: options.token, fetch: io.fetch, localToken: !0, env: io.env }), store = createTuiStore({ client, initialView: options.view }), prefs = loadPrefs(defaultPrefsPath(io.env));
136
+ prefs.sidebar === !1 && store.actions.setViewState(LAYOUT_STATE_KEY, { sidebarHidden: !0 });
137
+ let mouse = options.mouse ?? (io.env.ADF_TUI_MOUSE === "0" ? !1 : io.env.ADF_TUI_MOUSE === "1" ? !0 : prefs.mouse ?? !0), kitty = options.kitty ?? io.env.ADF_TUI_KITTY !== "0", uninstallModes = installTerminalModes({
138
+ stdin: io.stdin,
139
+ stdout: io.stdout,
140
+ mouse,
141
+ altScreen: options.altScreen,
142
+ shiftEnterForced: io.env.ADF_TUI_SHIFT_ENTER === "1"
143
+ }), theme = createTheme({ mono: options.mono, ascii: options.ascii, env: io.env }), choice = themeChoice.name ? findTheme(themeChoice.name) : void 0;
144
+ choice && !theme.mono && applyTheme(theme, choice);
145
+ let reserveRows = process.platform === "win32" && io.env.ADF_TUI_FULL_HEIGHT !== "1" ? 1 : 0, instance = render(React.createElement(App, { store, theme, reserveRows, reserveColumns: 1 }), {
146
+ stdout: io.stdout,
147
+ stdin: io.stdin,
148
+ stderr: io.stderr,
149
+ exitOnCtrlC: !1,
150
+ alternateScreen: options.altScreen,
151
+ patchConsole: !0,
152
+ maxFps: 30,
153
+ incrementalRendering: !0,
154
+ // Shift+Enter: ask the terminal (CSI ? u) and turn on "disambiguate" when
155
+ // it answers. ink restores the mode on exit, crash and suspendTerminal.
156
+ kittyKeyboard: kitty ? { mode: "auto", flags: ["disambiguateEscapeCodes"] } : { mode: "disabled" }
157
+ }), tipTimer = setTimeout(() => {
158
+ shiftEnterWorks(terminalCaps()) || prefs.tips?.shiftEnter || (savePrefs({ tips: { shiftEnter: !0 } }), store.actions.toast("This terminal sends Shift+Enter as Enter: Alt+Enter or Ctrl+J add a newline \xB7 /terminal-setup to fix", "info", 8e3));
159
+ }, 1500);
160
+ store.start().then(async () => {
161
+ let { recordWelcomeLaunch } = await import("./welcome-XHXFV7SH.mjs");
162
+ if (recordWelcomeLaunch()) {
163
+ let { openWelcome } = await import("./open-OTQDGDH5.mjs");
164
+ openWelcome(store);
165
+ }
166
+ if (!options.agent) return;
167
+ let state = store.getState(), id = state.agentOrder.find((agentId) => {
168
+ let summary = state.agents[agentId]?.summary;
169
+ return agentId === options.agent || summary?.handle === options.agent || summary?.name === options.agent;
170
+ });
171
+ if (!id) {
172
+ store.actions.toast(`No loaded agent "${options.agent}"`, "warn");
173
+ return;
174
+ }
175
+ store.actions.selectAgent(id), options.loop && store.actions.selectLoop(id, options.loop);
176
+ });
177
+ try {
178
+ await instance.waitUntilExit();
179
+ } finally {
180
+ clearTimeout(tipTimer), store.stop(), uninstallMirror(), uninstallModes();
181
+ }
182
+ return io.stdout.write(`Left the ADF terminal app. Agents keep running in the daemon at ${client.baseUrl}.
183
+ `), 0;
184
+ }
185
+ var entry = process.argv[1] ?? "";
186
+ /[\\/]tui[\\/]index\.tsx?$/.test(entry) && runTui().then((code) => {
187
+ process.exitCode = code;
188
+ }, (err) => {
189
+ process.stderr.write(`${err instanceof Error ? err.stack ?? err.message : String(err)}
190
+ `), process.exitCode = 1;
191
+ });
192
+ export {
193
+ parseTuiArgs,
194
+ preferProductionReact,
195
+ runTui,
196
+ tuiUsage
197
+ };
@@ -0,0 +1,32 @@
1
+ import { createRequire as __adfCreateRequire } from 'node:module';
2
+ import { fileURLToPath as __adfFileURLToPath } from 'node:url';
3
+ import { dirname as __adfDirname } from 'node:path';
4
+ const require = __adfCreateRequire(import.meta.url);
5
+ const __filename = __adfFileURLToPath(import.meta.url);
6
+ const __dirname = __adfDirname(__filename);
7
+ import {
8
+ WELCOME_INTRO,
9
+ WELCOME_LAUNCHES,
10
+ WELCOME_OVERLAY,
11
+ WELCOME_TITLE,
12
+ dismissWelcome,
13
+ enabledAdapters,
14
+ nextStepIndex,
15
+ recordWelcomeLaunch,
16
+ welcomeFacts,
17
+ welcomeSteps
18
+ } from "./chunk-I3UYSITV.mjs";
19
+ import "./chunk-5QU5VY7N.mjs";
20
+ import "./chunk-M2RX3S2T.mjs";
21
+ export {
22
+ WELCOME_INTRO,
23
+ WELCOME_LAUNCHES,
24
+ WELCOME_OVERLAY,
25
+ WELCOME_TITLE,
26
+ dismissWelcome,
27
+ enabledAdapters,
28
+ nextStepIndex,
29
+ recordWelcomeLaunch,
30
+ welcomeFacts,
31
+ welcomeSteps
32
+ };