reevesagents 1.2.0 → 1.3.0
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.
- package/CHANGELOG.md +41 -0
- package/README.ar.md +397 -0
- package/README.de.md +406 -0
- package/README.es.md +418 -0
- package/README.fr.md +340 -0
- package/README.it.md +400 -0
- package/README.md +290 -171
- package/README.pt.md +417 -0
- package/README.ru.md +401 -0
- package/README.tr.md +415 -0
- package/README.zh-Hans.md +340 -0
- package/dist/chunk-4LWTEYRI.js +4878 -0
- package/dist/chunk-4W6MVOPK.js +29 -0
- package/dist/{chunk-4Q3JF22J.js → chunk-5DOCQLT7.js} +2 -2
- package/dist/{chunk-MVMGFG4W.js → chunk-65LHCGPC.js} +836 -263
- package/dist/chunk-D24DQQ6V.js +0 -0
- package/dist/chunk-HS6TOISU.js +30 -0
- package/dist/chunk-Z2JHNE7V.js +317 -0
- package/dist/cli.d.ts +4 -1
- package/dist/cli.js +374 -45
- package/dist/extras-25AF6TAR.js +0 -0
- package/dist/index.d.ts +13 -37
- package/dist/index.js +13 -19
- package/dist/open-browser-DRSIJQ37.js +0 -0
- package/dist/{router-WCFLHJV7.js → router-I4WDR7CD.js} +1478 -764
- package/dist/server-H2XEJQYT.js +622 -0
- package/dist/{server-Z2YTGWSX.js → server-ZJKAIRL5.js} +261 -135
- package/dist/{tui-launch-7RGFE5KY.js → tui-launch-VHLX6JOW.js} +2 -2
- package/dist/web/app.css +321 -13
- package/dist/web/app.js +626 -51
- package/dist/web/index.html +115 -10
- package/package.json +22 -18
- package/dist/chunk-3IXII4H5.js +0 -129
- package/dist/chunk-DHAW6OY3.js +0 -40
- package/dist/chunk-G6FN75ZW.js +0 -2393
- package/dist/chunk-JY4ZTTRK.js +0 -172
- package/dist/chunk-LUW6GCPO.js +0 -108
package/dist/web/index.html
CHANGED
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
<div id="brand-duck" class="brand-duck" aria-hidden="true"></div>
|
|
15
15
|
<span class="brand-lockup">
|
|
16
16
|
<span class="brand-name">ReevesAgents</span>
|
|
17
|
-
<span id="brand-beta" class="brand-beta">web · beta</span>
|
|
18
17
|
</span>
|
|
19
18
|
</div>
|
|
20
19
|
<div class="topbar-actions">
|
|
@@ -23,6 +22,11 @@
|
|
|
23
22
|
<span id="language-label" class="language-label">Language</span>
|
|
24
23
|
<select id="language-select" aria-label="Language"></select>
|
|
25
24
|
</label>
|
|
25
|
+
<button id="agent-control-btn" class="btn btn-secondary" type="button">Agent control</button>
|
|
26
|
+
<button id="config-btn" class="btn btn-secondary" type="button">Config</button>
|
|
27
|
+
<button id="presets-btn" class="btn btn-secondary" type="button">Presets</button>
|
|
28
|
+
<button id="doctor-btn" class="btn btn-secondary" type="button">Doctor</button>
|
|
29
|
+
<button id="about-btn" class="btn btn-secondary" type="button">About</button>
|
|
26
30
|
<button id="new-agent-btn" class="btn btn-agent" type="button">New agent</button>
|
|
27
31
|
<button id="new-run-btn" class="btn btn-accent" type="button">New run</button>
|
|
28
32
|
</div>
|
|
@@ -133,6 +137,28 @@
|
|
|
133
137
|
</div>
|
|
134
138
|
<span id="permissions-help" class="field-help">Ask first is safer. Skip prompts only in trusted workspaces.</span>
|
|
135
139
|
</div>
|
|
140
|
+
|
|
141
|
+
<label class="field" id="auth-mode-field" hidden>
|
|
142
|
+
<span class="field-label">Auth</span>
|
|
143
|
+
<select id="f-auth-mode">
|
|
144
|
+
<option value="">Default login</option>
|
|
145
|
+
<option value="api-key">API key</option>
|
|
146
|
+
</select>
|
|
147
|
+
<span class="field-help">Default uses the signed-in CLI session. API key forces key-based auth.</span>
|
|
148
|
+
</label>
|
|
149
|
+
|
|
150
|
+
<label class="field" id="effort-field" hidden>
|
|
151
|
+
<span class="field-label">Reasoning effort</span>
|
|
152
|
+
<select id="f-effort">
|
|
153
|
+
<option value="">Provider default</option>
|
|
154
|
+
<option value="low">Low</option>
|
|
155
|
+
<option value="medium">Medium</option>
|
|
156
|
+
<option value="high">High</option>
|
|
157
|
+
<option value="xhigh">Extra high</option>
|
|
158
|
+
<option value="max">Max</option>
|
|
159
|
+
</select>
|
|
160
|
+
<span class="field-help">Higher effort spends more on reasoning. Provider default is safest.</span>
|
|
161
|
+
</label>
|
|
136
162
|
</div>
|
|
137
163
|
|
|
138
164
|
<label class="field" id="agent-name-field">
|
|
@@ -141,15 +167,6 @@
|
|
|
141
167
|
<span id="agent-name-help" class="field-help">Optional display name and tmux window name.</span>
|
|
142
168
|
</label>
|
|
143
169
|
|
|
144
|
-
<label class="field" id="mode-field" hidden>
|
|
145
|
-
<span class="field-label">New run mode</span>
|
|
146
|
-
<select id="f-mode">
|
|
147
|
-
<option value="spawner">Agent run</option>
|
|
148
|
-
<option value="orchestrator">Orchestrator MCP · pre-beta</option>
|
|
149
|
-
</select>
|
|
150
|
-
<span id="mode-help" class="field-help">Normal runs are direct agent workspaces. Orchestrator MCP is pre-beta.</span>
|
|
151
|
-
</label>
|
|
152
|
-
|
|
153
170
|
<label class="field" id="cwd-field">
|
|
154
171
|
<span class="field-label">Working directory</span>
|
|
155
172
|
<input id="f-cwd" type="text" placeholder="defaults to the server's directory" autocomplete="off" />
|
|
@@ -171,6 +188,94 @@
|
|
|
171
188
|
</form>
|
|
172
189
|
</dialog>
|
|
173
190
|
|
|
191
|
+
<dialog id="mcp-dialog" class="dialog mcp-dialog">
|
|
192
|
+
<div class="mcp-panel">
|
|
193
|
+
<div class="dialog-header">
|
|
194
|
+
<div id="mcp-dialog-title" class="dialog-title">Agent control</div>
|
|
195
|
+
<div id="mcp-dialog-subtitle" class="dialog-subtitle">Attach the reevesagents MCP to your CLIs so an agent can spawn and drive other agents.</div>
|
|
196
|
+
</div>
|
|
197
|
+
|
|
198
|
+
<div id="mcp-host-list" class="mcp-host-list" aria-label="MCP host CLIs"></div>
|
|
199
|
+
<div id="mcp-empty" class="mcp-empty" hidden>No MCP-capable CLI was found on this machine.</div>
|
|
200
|
+
<div id="mcp-error" class="dialog-error" hidden></div>
|
|
201
|
+
|
|
202
|
+
<div class="dialog-actions">
|
|
203
|
+
<button type="button" id="mcp-attach-all" class="btn btn-agent">Attach all</button>
|
|
204
|
+
<button type="button" id="mcp-close" class="btn">Close</button>
|
|
205
|
+
</div>
|
|
206
|
+
</div>
|
|
207
|
+
</dialog>
|
|
208
|
+
|
|
209
|
+
<dialog id="doctor-dialog" class="dialog mcp-dialog">
|
|
210
|
+
<div class="mcp-panel">
|
|
211
|
+
<div class="dialog-header">
|
|
212
|
+
<div class="dialog-title">Doctor</div>
|
|
213
|
+
<div class="dialog-subtitle">Environment health checks for this machine.</div>
|
|
214
|
+
</div>
|
|
215
|
+
|
|
216
|
+
<div id="doctor-list" class="doctor-list" aria-label="health checks"></div>
|
|
217
|
+
<div id="doctor-error" class="dialog-error" hidden></div>
|
|
218
|
+
|
|
219
|
+
<div class="dialog-actions">
|
|
220
|
+
<button type="button" id="doctor-refresh" class="btn btn-agent">Refresh</button>
|
|
221
|
+
<button type="button" id="doctor-close" class="btn">Close</button>
|
|
222
|
+
</div>
|
|
223
|
+
</div>
|
|
224
|
+
</dialog>
|
|
225
|
+
|
|
226
|
+
<dialog id="about-dialog" class="dialog mcp-dialog">
|
|
227
|
+
<div class="mcp-panel">
|
|
228
|
+
<div class="dialog-header">
|
|
229
|
+
<div class="dialog-title">About ReevesAgents</div>
|
|
230
|
+
<div class="dialog-subtitle">Local tmux-first workspace manager for AI CLI agents.</div>
|
|
231
|
+
</div>
|
|
232
|
+
<div id="about-list" class="about-list" aria-label="about"></div>
|
|
233
|
+
<div class="dialog-actions">
|
|
234
|
+
<button type="button" id="about-close" class="btn">Close</button>
|
|
235
|
+
</div>
|
|
236
|
+
</div>
|
|
237
|
+
</dialog>
|
|
238
|
+
|
|
239
|
+
<dialog id="config-dialog" class="dialog mcp-dialog">
|
|
240
|
+
<div class="mcp-panel">
|
|
241
|
+
<div class="dialog-header">
|
|
242
|
+
<div class="dialog-title">Config</div>
|
|
243
|
+
<div class="dialog-subtitle">Edit global settings.</div>
|
|
244
|
+
</div>
|
|
245
|
+
|
|
246
|
+
<div id="config-list" class="config-list" aria-label="global settings"></div>
|
|
247
|
+
<div id="config-error" class="dialog-error" hidden></div>
|
|
248
|
+
|
|
249
|
+
<div class="dialog-actions">
|
|
250
|
+
<button type="button" id="config-save" class="btn btn-agent">Save</button>
|
|
251
|
+
<button type="button" id="config-close" class="btn">Close</button>
|
|
252
|
+
</div>
|
|
253
|
+
</div>
|
|
254
|
+
</dialog>
|
|
255
|
+
|
|
256
|
+
<dialog id="presets-dialog" class="dialog mcp-dialog">
|
|
257
|
+
<div class="mcp-panel">
|
|
258
|
+
<div class="dialog-header">
|
|
259
|
+
<div class="dialog-title">Presets</div>
|
|
260
|
+
<div class="dialog-subtitle">Saved agent-team templates.</div>
|
|
261
|
+
</div>
|
|
262
|
+
|
|
263
|
+
<div id="presets-list" class="mcp-host-list" aria-label="saved presets"></div>
|
|
264
|
+
|
|
265
|
+
<div class="field" id="preset-save-field">
|
|
266
|
+
<span class="field-label">Save current run</span>
|
|
267
|
+
<input id="preset-name-input" type="text" maxlength="64" placeholder="preset name" autocomplete="off" />
|
|
268
|
+
<button type="button" id="preset-save" class="btn btn-agent">Save current run</button>
|
|
269
|
+
</div>
|
|
270
|
+
|
|
271
|
+
<div id="presets-error" class="dialog-error" hidden></div>
|
|
272
|
+
|
|
273
|
+
<div class="dialog-actions">
|
|
274
|
+
<button type="button" id="presets-close" class="btn">Close</button>
|
|
275
|
+
</div>
|
|
276
|
+
</div>
|
|
277
|
+
</dialog>
|
|
278
|
+
|
|
174
279
|
<script src="xterm.js"></script>
|
|
175
280
|
<script src="addon-fit.js"></script>
|
|
176
281
|
<script src="app.js"></script>
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reevesagents",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Local tmux-first workspace manager for AI CLI agents",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"packageManager": "pnpm@10.34.1",
|
|
6
7
|
"bin": {
|
|
7
8
|
"reevesagents": "dist/cli.js"
|
|
8
9
|
},
|
|
@@ -16,7 +17,23 @@
|
|
|
16
17
|
"CHANGELOG.md",
|
|
17
18
|
"LICENSE"
|
|
18
19
|
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsup && node scripts/build-web-client.mjs",
|
|
22
|
+
"dev": "tsup --watch",
|
|
23
|
+
"test": "vitest run",
|
|
24
|
+
"test:watch": "vitest",
|
|
25
|
+
"typecheck": "tsc --noEmit",
|
|
26
|
+
"lint": "eslint src test",
|
|
27
|
+
"smoke:cli": "node scripts/smoke-cli.mjs",
|
|
28
|
+
"check:package": "node scripts/check-package-contents.mjs",
|
|
29
|
+
"check:install-matrix": "node scripts/check-install-matrix.mjs",
|
|
30
|
+
"render-mascot": "node scripts/render-mascot.mjs",
|
|
31
|
+
"verify": "pnpm typecheck && pnpm lint && pnpm test && pnpm build && pnpm smoke:cli && pnpm check:package",
|
|
32
|
+
"verify:release": "pnpm verify && pnpm check:install-matrix",
|
|
33
|
+
"release": "release-it"
|
|
34
|
+
},
|
|
19
35
|
"dependencies": {
|
|
36
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
20
37
|
"chalk": "^5.6.2",
|
|
21
38
|
"commander": "^14.0.3",
|
|
22
39
|
"ink": "^7.0.2",
|
|
@@ -29,6 +46,7 @@
|
|
|
29
46
|
},
|
|
30
47
|
"devDependencies": {
|
|
31
48
|
"@eslint/js": "^10.0.1",
|
|
49
|
+
"@release-it/conventional-changelog": "^11.0.1",
|
|
32
50
|
"@types/node": "^25.7.0",
|
|
33
51
|
"@types/react": "^19.2.14",
|
|
34
52
|
"@types/ws": "^8.18.1",
|
|
@@ -37,7 +55,7 @@
|
|
|
37
55
|
"@xterm/xterm": "^6.0.0",
|
|
38
56
|
"eslint": "10.3.0",
|
|
39
57
|
"ink-testing-library": "^4.0.0",
|
|
40
|
-
"
|
|
58
|
+
"release-it": "^20.2.0",
|
|
41
59
|
"tsup": "^8.5.1",
|
|
42
60
|
"typescript": "^6.0.3",
|
|
43
61
|
"vitest": "^4.1.6"
|
|
@@ -68,19 +86,5 @@
|
|
|
68
86
|
"agents",
|
|
69
87
|
"cli",
|
|
70
88
|
"ink"
|
|
71
|
-
]
|
|
72
|
-
|
|
73
|
-
"build": "tsup && node scripts/build-web-client.mjs",
|
|
74
|
-
"dev": "tsup --watch",
|
|
75
|
-
"test": "vitest run",
|
|
76
|
-
"test:watch": "vitest",
|
|
77
|
-
"typecheck": "tsc --noEmit",
|
|
78
|
-
"lint": "eslint src test",
|
|
79
|
-
"smoke:cli": "node scripts/smoke-cli.mjs",
|
|
80
|
-
"check:package": "node scripts/check-package-contents.mjs",
|
|
81
|
-
"check:install-matrix": "node scripts/check-install-matrix.mjs",
|
|
82
|
-
"render-mascot": "node scripts/render-mascot.mjs",
|
|
83
|
-
"verify": "pnpm typecheck && pnpm lint && pnpm test && pnpm build && pnpm smoke:cli && pnpm check:package",
|
|
84
|
-
"verify:release": "pnpm verify && CI=true pnpm --dir packages/orchestrator install --frozen-lockfile --ignore-workspace && pnpm --dir packages/orchestrator verify && pnpm check:install-matrix"
|
|
85
|
-
}
|
|
86
|
-
}
|
|
89
|
+
]
|
|
90
|
+
}
|
package/dist/chunk-3IXII4H5.js
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
colors,
|
|
4
|
-
isProvider,
|
|
5
|
-
stateRoot
|
|
6
|
-
} from "./chunk-MVMGFG4W.js";
|
|
7
|
-
|
|
8
|
-
// src/components/ErrorBoundary.tsx
|
|
9
|
-
import { Component } from "react";
|
|
10
|
-
import { Box, Text } from "ink";
|
|
11
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
-
var ErrorBoundary = class extends Component {
|
|
13
|
-
constructor(props) {
|
|
14
|
-
super(props);
|
|
15
|
-
this.state = { hasError: false, error: null };
|
|
16
|
-
}
|
|
17
|
-
static getDerivedStateFromError(error) {
|
|
18
|
-
return { hasError: true, error };
|
|
19
|
-
}
|
|
20
|
-
componentDidCatch(error) {
|
|
21
|
-
process.stderr.write(`[ERROR] ${error.message}
|
|
22
|
-
`);
|
|
23
|
-
}
|
|
24
|
-
render() {
|
|
25
|
-
if (this.state.hasError && this.state.error) {
|
|
26
|
-
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", paddingX: 1, children: [
|
|
27
|
-
/* @__PURE__ */ jsx(Box, { marginBottom: 1, children: /* @__PURE__ */ jsx(Text, { color: colors.status.error, bold: true, children: "ERROR" }) }),
|
|
28
|
-
/* @__PURE__ */ jsx(Text, { color: colors.text.primary, children: this.state.error.message }),
|
|
29
|
-
/* @__PURE__ */ jsx(Box, { marginTop: 1, children: /* @__PURE__ */ jsx(Text, { color: colors.text.muted, dimColor: true, children: "press Ctrl-C to quit" }) })
|
|
30
|
-
] });
|
|
31
|
-
}
|
|
32
|
-
return this.props.children;
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
// src/state/store.ts
|
|
37
|
-
import { readFileSync, writeFileSync, mkdirSync, readdirSync, unlinkSync, renameSync, existsSync } from "fs";
|
|
38
|
-
import { join, dirname } from "path";
|
|
39
|
-
function stateDir() {
|
|
40
|
-
return stateRoot();
|
|
41
|
-
}
|
|
42
|
-
function savedTreesDir() {
|
|
43
|
-
return join(stateDir(), "presets");
|
|
44
|
-
}
|
|
45
|
-
var presetsDir = savedTreesDir;
|
|
46
|
-
function atomicWrite(path, data) {
|
|
47
|
-
mkdirSync(dirname(path), { recursive: true });
|
|
48
|
-
const tmp = `${path}.tmp`;
|
|
49
|
-
writeFileSync(tmp, JSON.stringify(data, null, 2), "utf-8");
|
|
50
|
-
try {
|
|
51
|
-
renameSync(tmp, path);
|
|
52
|
-
} catch {
|
|
53
|
-
writeFileSync(path, JSON.stringify(data, null, 2), "utf-8");
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
function isEffort(value) {
|
|
57
|
-
return value === "default" || value === "low" || value === "medium" || value === "high" || value === "xhigh" || value === "max";
|
|
58
|
-
}
|
|
59
|
-
function normalizeSlot(raw, fallbackDir = "") {
|
|
60
|
-
const promptRaw = typeof raw.initial_prompt === "string" ? raw.initial_prompt : typeof raw.task_template === "string" ? raw.task_template : "";
|
|
61
|
-
return {
|
|
62
|
-
nickname_template: typeof raw.nickname_template === "string" ? raw.nickname_template : "agent",
|
|
63
|
-
provider: isProvider(raw.provider) ? raw.provider : "cc",
|
|
64
|
-
model: typeof raw.model === "string" ? raw.model : "",
|
|
65
|
-
auth_mode: raw.auth_mode === "api-key" ? "api-key" : "default",
|
|
66
|
-
effort: isEffort(raw.effort) ? raw.effort : "default",
|
|
67
|
-
initial_prompt: promptRaw,
|
|
68
|
-
working_dir: typeof raw.working_dir === "string" ? raw.working_dir : fallbackDir,
|
|
69
|
-
permissions: raw.permissions === "skip" ? "skip" : "ask",
|
|
70
|
-
rc_enabled: typeof raw.rc_enabled === "boolean" ? raw.rc_enabled : false
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
function normalizeSavedTree(raw) {
|
|
74
|
-
if (typeof raw !== "object" || raw === null) return null;
|
|
75
|
-
const obj = raw;
|
|
76
|
-
const legacyDir = typeof obj.working_dir_pattern === "string" ? obj.working_dir_pattern : "";
|
|
77
|
-
const rootRaw = typeof obj.root === "object" && obj.root !== null ? obj.root : {};
|
|
78
|
-
const workersRaw = Array.isArray(obj.workers) ? obj.workers : [];
|
|
79
|
-
return {
|
|
80
|
-
name: typeof obj.name === "string" ? obj.name : "preset",
|
|
81
|
-
description: typeof obj.description === "string" ? obj.description : "",
|
|
82
|
-
root: normalizeSlot(rootRaw, legacyDir),
|
|
83
|
-
workers: workersRaw.filter((w) => typeof w === "object" && w !== null).map((w) => normalizeSlot(w, legacyDir)),
|
|
84
|
-
working_dir_pattern: legacyDir || void 0,
|
|
85
|
-
created_at: typeof obj.created_at === "string" ? obj.created_at : (/* @__PURE__ */ new Date()).toISOString(),
|
|
86
|
-
updated_at: typeof obj.updated_at === "string" ? obj.updated_at : (/* @__PURE__ */ new Date()).toISOString()
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
function listSavedTrees() {
|
|
90
|
-
const dir = savedTreesDir();
|
|
91
|
-
if (!existsSync(dir)) return [];
|
|
92
|
-
try {
|
|
93
|
-
return readdirSync(dir).filter((f) => f.endsWith(".json")).map((f) => {
|
|
94
|
-
try {
|
|
95
|
-
return normalizeSavedTree(JSON.parse(readFileSync(join(dir, f), "utf-8")));
|
|
96
|
-
} catch {
|
|
97
|
-
return null;
|
|
98
|
-
}
|
|
99
|
-
}).filter((t) => t !== null);
|
|
100
|
-
} catch {
|
|
101
|
-
return [];
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
function loadSavedTree(name) {
|
|
105
|
-
try {
|
|
106
|
-
return normalizeSavedTree(JSON.parse(readFileSync(join(savedTreesDir(), `${name}.json`), "utf-8")));
|
|
107
|
-
} catch {
|
|
108
|
-
return null;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
function saveSavedTree(tree) {
|
|
112
|
-
atomicWrite(join(savedTreesDir(), `${tree.name}.json`), tree);
|
|
113
|
-
}
|
|
114
|
-
function deleteSavedTree(name) {
|
|
115
|
-
try {
|
|
116
|
-
unlinkSync(join(savedTreesDir(), `${name}.json`));
|
|
117
|
-
} catch {
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export {
|
|
122
|
-
ErrorBoundary,
|
|
123
|
-
presetsDir,
|
|
124
|
-
listSavedTrees,
|
|
125
|
-
loadSavedTree,
|
|
126
|
-
saveSavedTree,
|
|
127
|
-
deleteSavedTree
|
|
128
|
-
};
|
|
129
|
-
//# sourceMappingURL=chunk-3IXII4H5.js.map
|
package/dist/chunk-DHAW6OY3.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
stateRoot
|
|
4
|
-
} from "./chunk-MVMGFG4W.js";
|
|
5
|
-
|
|
6
|
-
// src/state/tui-open.ts
|
|
7
|
-
import { mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
8
|
-
import { join } from "path";
|
|
9
|
-
function tokenPath() {
|
|
10
|
-
return join(stateRoot(), "tui-open-token");
|
|
11
|
-
}
|
|
12
|
-
function readTuiOpenToken() {
|
|
13
|
-
try {
|
|
14
|
-
return readFileSync(tokenPath(), "utf-8").trim();
|
|
15
|
-
} catch {
|
|
16
|
-
return "";
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
function writeTuiOpenToken() {
|
|
20
|
-
mkdirSync(stateRoot(), { recursive: true });
|
|
21
|
-
writeFileSync(tokenPath(), `${Date.now()}
|
|
22
|
-
`, "utf-8");
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// src/version.ts
|
|
26
|
-
import { readFileSync as readFileSync2 } from "fs";
|
|
27
|
-
import { URL } from "url";
|
|
28
|
-
function readVersion() {
|
|
29
|
-
const pkg = JSON.parse(readFileSync2(new URL("../package.json", import.meta.url), "utf8"));
|
|
30
|
-
if (typeof pkg.version !== "string") throw new Error("package.json version must be a string");
|
|
31
|
-
return pkg.version;
|
|
32
|
-
}
|
|
33
|
-
var REEVESAGENTS_VERSION = readVersion();
|
|
34
|
-
|
|
35
|
-
export {
|
|
36
|
-
readTuiOpenToken,
|
|
37
|
-
writeTuiOpenToken,
|
|
38
|
-
REEVESAGENTS_VERSION
|
|
39
|
-
};
|
|
40
|
-
//# sourceMappingURL=chunk-DHAW6OY3.js.map
|