acryl 0.1.8 → 0.1.10
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/lib/bin.js +15 -331
- package/lib/bin.js.map +1 -0
- package/lib/index.js +5051 -0
- package/lib/index.js.map +1 -0
- package/lib/types/bin.d.ts +4 -0
- package/lib/types/cli/grammar.d.ts +9 -0
- package/lib/types/cli/node-launcher.d.ts +9 -0
- package/lib/types/cli/run.d.ts +32 -0
- package/lib/types/host/direct.d.ts +18 -0
- package/lib/types/index.d.ts +3 -0
- package/lib/types/markdown.d.ts +28 -0
- package/lib/types/render.d.ts +78 -0
- package/lib/types/sessionId.d.ts +12 -0
- package/lib/types/tui/CustomEditor.d.ts +51 -0
- package/lib/types/tui/Spinner.d.ts +18 -0
- package/lib/types/tui/TuiApp.d.ts +64 -0
- package/lib/types/tui/actions.d.ts +85 -0
- package/lib/types/tui/agentPresets/AgentPresetsOverlay.d.ts +19 -0
- package/lib/types/tui/agentPresets/types.d.ts +18 -0
- package/lib/types/tui/bannerText.d.ts +19 -0
- package/lib/types/tui/commands.d.ts +54 -0
- package/lib/types/tui/context/ContextOverlay.d.ts +17 -0
- package/lib/types/tui/fileIndex.d.ts +17 -0
- package/lib/types/tui/fileMention.d.ts +31 -0
- package/lib/types/tui/interaction/ApprovalOverlay.d.ts +18 -0
- package/lib/types/tui/interaction/QuestionOverlay.d.ts +26 -0
- package/lib/types/tui/interaction/types.d.ts +36 -0
- package/lib/types/tui/liveText.d.ts +60 -0
- package/lib/types/tui/logoArt.generated.d.ts +9 -0
- package/lib/types/tui/miniTextField.d.ts +20 -0
- package/lib/types/tui/modelProfile/ModelProfileOverlay.d.ts +48 -0
- package/lib/types/tui/modelProfile/types.d.ts +63 -0
- package/lib/types/tui/piTheme.d.ts +10 -0
- package/lib/types/tui/plugins/PluginsOverlay.d.ts +22 -0
- package/lib/types/tui/plugins/types.d.ts +18 -0
- package/lib/types/tui/promptAutocomplete.d.ts +29 -0
- package/lib/types/tui/statsFormat.d.ts +89 -0
- package/lib/types/tui/store.d.ts +246 -0
- package/lib/types/tui/text.d.ts +21 -0
- package/lib/types/tui/theme.d.ts +35 -0
- package/lib/types/tui/toolCards/ToolCardsOverlay.d.ts +33 -0
- package/lib/types/tui/trajectory/TrajectoryDetail.d.ts +13 -0
- package/lib/types/tui/trajectory/TrajectoryLedger.d.ts +9 -0
- package/lib/types/tui/trajectory/TrajectoryOverlay.d.ts +39 -0
- package/lib/types/tui/trajectory/detail.d.ts +10 -0
- package/lib/types/tui/trajectory/layout.d.ts +16 -0
- package/lib/types/tui/trajectory/types.d.ts +74 -0
- package/lib/types/tui-app/session.d.ts +21 -0
- package/lib/types/version.d.ts +2 -0
- package/lib/types/yly/yly-frames.generated.d.ts +18 -0
- package/lib/types/yly/yly-pet.d.ts +46 -0
- package/lib/types/yly/yly-programs.d.ts +41 -0
- package/package.json +25 -7
package/lib/bin.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
|
-
import {
|
|
4
|
+
import { realpathSync } from "node:fs";
|
|
5
|
+
import { join, relative, resolve } from "node:path";
|
|
5
6
|
import { spawn } from "node:child_process";
|
|
6
7
|
import { randomUUID } from "node:crypto";
|
|
8
|
+
import { bootAcrylHarnessProfile, bootAcrylWebProfile, createAcrylSessionBridge } from "acryl-harness-runtime";
|
|
7
9
|
import { BlockAssembler, createUserMessage } from "@deepseek-ai/dsh-llm";
|
|
8
|
-
import { SessionId } from "@deepseek-ai/dsh-session";
|
|
9
|
-
import { existsSync, writeFileSync } from "node:fs";
|
|
10
|
-
import { DEFAULT_PROFILE_BUNDLES, boot, composeEntries, healProfilesModuleFallback, initProfile, loadProfile, resolveProfileDir } from "@deepseek-ai/dsh-app-boot";
|
|
11
10
|
import { diffLines } from "diff";
|
|
12
11
|
import { Container, Editor, HStack, Key, KeybindingsManager, ProcessTerminal, ScrollView, TUI_KEYBINDINGS, Text, TuiAltScreen, VStack, matchesKey, setKeybindings, visibleWidth, wrapTextWithAnsi } from "@earendil-works/pi-tui";
|
|
13
12
|
import { readdir } from "node:fs/promises";
|
|
14
13
|
import { ManualCompactionError } from "@deepseek-ai/dsh-compaction";
|
|
15
14
|
import { GoalError } from "@deepseek-ai/dsh-goal";
|
|
15
|
+
import { SessionId } from "@deepseek-ai/dsh-session";
|
|
16
16
|
//#region src/cli/node-launcher.ts
|
|
17
17
|
/** Return the child Node invocation required to expose Cordis HMR internals. */
|
|
18
18
|
function exposedInternalsInvocation(input) {
|
|
@@ -37,327 +37,6 @@ async function relaunchWithExposedInternals(input) {
|
|
|
37
37
|
return true;
|
|
38
38
|
}
|
|
39
39
|
//#endregion
|
|
40
|
-
//#region ../node_modules/.pnpm/@deepseek-ai+dsh-cmdline@0.1.1-rc.2_@deepseek-ai+cordis-plugin-loader@1.0.2_@deepseek-a_1bc57e8c58566d7b9c3fbf261d0f481e/node_modules/@deepseek-ai/dsh-cmdline/lib/index.js
|
|
41
|
-
/**
|
|
42
|
-
* @deepseek-ai/dsh-cmdline — the command line a dsh launcher hands to the app
|
|
43
|
-
* it boots.
|
|
44
|
-
*
|
|
45
|
-
* The launcher parses only its own flags (`--profile`, `--patch`, the config
|
|
46
|
-
* dumps) and hands everything after them to the tree verbatim through the
|
|
47
|
-
* {@link CmdlineArgs} service, so an app owns its flag family, its `--help`
|
|
48
|
-
* text, and its parse errors instead of the launcher knowing them.
|
|
49
|
-
*
|
|
50
|
-
* Any app plugin can inject `cmdlineArgs` and call {@link parseCmdline}. A
|
|
51
|
-
* provider may publish the parsed values as its own service from its program's
|
|
52
|
-
* commander action, and ordinary rows
|
|
53
|
-
* can inject that service and read it from lazily resolved config —
|
|
54
|
-
* `port: !!js ctx.webStartup.port ?? 3080` — so a flag beats the value written
|
|
55
|
-
* beside it. No row has launcher-level command-line status.
|
|
56
|
-
* @module @deepseek-ai/dsh-cmdline
|
|
57
|
-
*/
|
|
58
|
-
/**
|
|
59
|
-
* Provide the command line and the exit request on a host context before any
|
|
60
|
-
* tree entry mounts. Both are launcher facts, not config: an embedding host
|
|
61
|
-
* with no command line provides an empty argument list.
|
|
62
|
-
* @param ctx - the host context the tree will mount under.
|
|
63
|
-
* @param host - the invocation's arguments and its exit request.
|
|
64
|
-
*/
|
|
65
|
-
function provideCmdline(ctx, host) {
|
|
66
|
-
const snapshot = Object.freeze([...host.args]);
|
|
67
|
-
ctx.provide("cmdlineArgs", { get: () => snapshot });
|
|
68
|
-
ctx.provide("appExit", host.exit);
|
|
69
|
-
}
|
|
70
|
-
process.stdout, process.stderr;
|
|
71
|
-
//#endregion
|
|
72
|
-
//#region ../acryl-harness-runtime/lib/index.mjs
|
|
73
|
-
function contentText(content) {
|
|
74
|
-
return content.filter((block) => {
|
|
75
|
-
return block.type === "text" && typeof block.text === "string";
|
|
76
|
-
}).map((block) => block.text).join("");
|
|
77
|
-
}
|
|
78
|
-
function transcript(events) {
|
|
79
|
-
const items = [];
|
|
80
|
-
for (const event of events) {
|
|
81
|
-
if (event.type === "user/message" && event.data.source.kind === "user") {
|
|
82
|
-
const text = contentText(event.data.content);
|
|
83
|
-
if (text !== "") items.push(Object.freeze({
|
|
84
|
-
id: `event-${event.seq}`,
|
|
85
|
-
author: "user",
|
|
86
|
-
text
|
|
87
|
-
}));
|
|
88
|
-
}
|
|
89
|
-
if (event.type === "assistant/message") {
|
|
90
|
-
const text = contentText(event.data.message.content);
|
|
91
|
-
if (text !== "") items.push(Object.freeze({
|
|
92
|
-
id: `event-${event.seq}`,
|
|
93
|
-
author: "assistant",
|
|
94
|
-
text
|
|
95
|
-
}));
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
return Object.freeze(items);
|
|
99
|
-
}
|
|
100
|
-
function tools(events) {
|
|
101
|
-
const current = /* @__PURE__ */ new Map();
|
|
102
|
-
for (const event of events) {
|
|
103
|
-
if (event.type === "tool/call") current.set(event.data.callId, Object.freeze({
|
|
104
|
-
callId: event.data.callId,
|
|
105
|
-
name: event.data.name,
|
|
106
|
-
status: "running"
|
|
107
|
-
}));
|
|
108
|
-
if (event.type === "tool/result") {
|
|
109
|
-
const callId = event.data.message.source.callId;
|
|
110
|
-
const existing = current.get(callId);
|
|
111
|
-
if (existing !== void 0) current.set(callId, Object.freeze({
|
|
112
|
-
...existing,
|
|
113
|
-
status: "succeeded"
|
|
114
|
-
}));
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
return Object.freeze([...current.values()]);
|
|
118
|
-
}
|
|
119
|
-
function status(agent) {
|
|
120
|
-
return agent.status === "running" ? "running" : "idle";
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Runtime-owned adapter over one native DSH agent/session. It creates or resumes
|
|
124
|
-
* the native agent and derives every presentation value from its durable log.
|
|
125
|
-
*/
|
|
126
|
-
function createAcrylSessionBridge(ctx, options) {
|
|
127
|
-
const handles = /* @__PURE__ */ new Map();
|
|
128
|
-
const subscribers = /* @__PURE__ */ new Map();
|
|
129
|
-
const eventListeners = /* @__PURE__ */ new Map();
|
|
130
|
-
let disposed = false;
|
|
131
|
-
const notify = (sessionId) => {
|
|
132
|
-
const listeners = subscribers.get(sessionId);
|
|
133
|
-
if (listeners === void 0) return;
|
|
134
|
-
snapshot(sessionId).then((next) => {
|
|
135
|
-
for (const listener of listeners) try {
|
|
136
|
-
listener(next);
|
|
137
|
-
} catch {}
|
|
138
|
-
});
|
|
139
|
-
};
|
|
140
|
-
const offSessionEvent = ctx.on("session/event", (session, event) => {
|
|
141
|
-
if (!handles.has(session.id)) return;
|
|
142
|
-
notify(session.id);
|
|
143
|
-
const listeners = eventListeners.get(session.id);
|
|
144
|
-
if (listeners === void 0) return;
|
|
145
|
-
for (const listener of listeners) try {
|
|
146
|
-
listener(event);
|
|
147
|
-
} catch {}
|
|
148
|
-
});
|
|
149
|
-
const snapshot = async (sessionId) => {
|
|
150
|
-
const agent = agentFor(sessionId);
|
|
151
|
-
return Object.freeze({
|
|
152
|
-
profile: options.profile,
|
|
153
|
-
generationId: options.generationId,
|
|
154
|
-
attachment: options.attachment,
|
|
155
|
-
sessionId: agent.id,
|
|
156
|
-
agentStatus: status(agent),
|
|
157
|
-
transcript: transcript(agent.session.events),
|
|
158
|
-
tools: tools(agent.session.events)
|
|
159
|
-
});
|
|
160
|
-
};
|
|
161
|
-
const agentFor = (sessionId) => {
|
|
162
|
-
if (disposed) throw new Error("ACRYL session bridge is disposed");
|
|
163
|
-
const handle = handles.get(sessionId);
|
|
164
|
-
if (handle === void 0) throw new Error(`ACRYL session ${sessionId} is not active`);
|
|
165
|
-
return handle.agent;
|
|
166
|
-
};
|
|
167
|
-
return Object.freeze({
|
|
168
|
-
async open(resumeSessionId) {
|
|
169
|
-
if (disposed) throw new Error("ACRYL session bridge is disposed");
|
|
170
|
-
if (handles.size !== 0) throw new Error("ACRYL session bridge already has an active session");
|
|
171
|
-
const defaultModel = ctx.get("agentDefaultModel");
|
|
172
|
-
if (defaultModel === void 0) throw new Error("ACRYL profile has no default agent model");
|
|
173
|
-
const selection = defaultModel.currentSelection();
|
|
174
|
-
const handle = resumeSessionId === void 0 ? await ctx.agents.create({
|
|
175
|
-
sessionId: SessionId(`acryl-session-${crypto.randomUUID()}`),
|
|
176
|
-
meta: { cwd: options.cwd },
|
|
177
|
-
agentOptions: {
|
|
178
|
-
provider: selection.provider,
|
|
179
|
-
model: selection.model
|
|
180
|
-
}
|
|
181
|
-
}) : await ctx.agents.resume({
|
|
182
|
-
resumeSessionId: SessionId(resumeSessionId),
|
|
183
|
-
agentOptions: {
|
|
184
|
-
provider: selection.provider,
|
|
185
|
-
model: selection.model
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
handles.set(handle.agent.id, handle);
|
|
189
|
-
return handle.agent.id;
|
|
190
|
-
},
|
|
191
|
-
snapshot,
|
|
192
|
-
events(sessionId) {
|
|
193
|
-
return agentFor(sessionId).session.events;
|
|
194
|
-
},
|
|
195
|
-
async subscribe(sessionId, listener, _onError) {
|
|
196
|
-
agentFor(sessionId);
|
|
197
|
-
const listeners = subscribers.get(sessionId) ?? /* @__PURE__ */ new Set();
|
|
198
|
-
subscribers.set(sessionId, listeners);
|
|
199
|
-
listeners.add(listener);
|
|
200
|
-
try {
|
|
201
|
-
listener(await snapshot(sessionId));
|
|
202
|
-
} catch {}
|
|
203
|
-
let active = true;
|
|
204
|
-
return Object.freeze({
|
|
205
|
-
whenError() {
|
|
206
|
-
return new Promise(() => {});
|
|
207
|
-
},
|
|
208
|
-
async dispose() {
|
|
209
|
-
if (!active) return;
|
|
210
|
-
active = false;
|
|
211
|
-
listeners.delete(listener);
|
|
212
|
-
if (listeners.size === 0) subscribers.delete(sessionId);
|
|
213
|
-
}
|
|
214
|
-
});
|
|
215
|
-
},
|
|
216
|
-
async subscribeEvents(sessionId, listener) {
|
|
217
|
-
agentFor(sessionId);
|
|
218
|
-
const listeners = eventListeners.get(sessionId) ?? /* @__PURE__ */ new Set();
|
|
219
|
-
eventListeners.set(sessionId, listeners);
|
|
220
|
-
listeners.add(listener);
|
|
221
|
-
let active = true;
|
|
222
|
-
return Object.freeze({ async dispose() {
|
|
223
|
-
if (!active) return;
|
|
224
|
-
active = false;
|
|
225
|
-
listeners.delete(listener);
|
|
226
|
-
if (listeners.size === 0) eventListeners.delete(sessionId);
|
|
227
|
-
} });
|
|
228
|
-
},
|
|
229
|
-
async submitPrompt(input) {
|
|
230
|
-
const agent = agentFor(input.sessionId);
|
|
231
|
-
if (input.text.trim() === "") throw new Error("ACRYL prompt must not be empty");
|
|
232
|
-
const accepted = new Promise((resolve) => {
|
|
233
|
-
const off = ctx.on("session/event", (session, event) => {
|
|
234
|
-
if (session !== agent.session || event.type !== "user/message") return;
|
|
235
|
-
off();
|
|
236
|
-
resolve();
|
|
237
|
-
});
|
|
238
|
-
});
|
|
239
|
-
agent.followup(createUserMessage({
|
|
240
|
-
content: [{
|
|
241
|
-
type: "text",
|
|
242
|
-
text: input.text
|
|
243
|
-
}],
|
|
244
|
-
source: { kind: "user" }
|
|
245
|
-
}));
|
|
246
|
-
await accepted;
|
|
247
|
-
},
|
|
248
|
-
async cancel(sessionId) {
|
|
249
|
-
agentFor(sessionId).cancel({ kind: "user" });
|
|
250
|
-
},
|
|
251
|
-
async dispose() {
|
|
252
|
-
if (disposed) return;
|
|
253
|
-
disposed = true;
|
|
254
|
-
offSessionEvent();
|
|
255
|
-
subscribers.clear();
|
|
256
|
-
eventListeners.clear();
|
|
257
|
-
const activeHandles = [...handles.values()];
|
|
258
|
-
handles.clear();
|
|
259
|
-
const sessions = ctx.get("sessions");
|
|
260
|
-
for (const handle of activeHandles) {
|
|
261
|
-
try {
|
|
262
|
-
await handle.agent.whenIdle();
|
|
263
|
-
} catch {}
|
|
264
|
-
try {
|
|
265
|
-
await sessions?.flush(handle.agent.session);
|
|
266
|
-
} catch {}
|
|
267
|
-
}
|
|
268
|
-
await Promise.all(activeHandles.map((handle) => handle.dispose()));
|
|
269
|
-
}
|
|
270
|
-
});
|
|
271
|
-
}
|
|
272
|
-
const dshInstallAnchor = createRequire(import.meta.url).resolve("@deepseek-ai/dsh/package.json");
|
|
273
|
-
const profileRoot = "[]\n";
|
|
274
|
-
const shippedPresetsDir = join(resolve(dirname(fileURLToPath(import.meta.url)), "../.."), "deepseek-harness", "packages", "preset", "agent-presets", "presets");
|
|
275
|
-
const ACRYL_RUNTIME_ROWS = [{
|
|
276
|
-
id: "system-prompt",
|
|
277
|
-
name: "@deepseek-ai/dsh-system-prompt",
|
|
278
|
-
config: { persona: "You are a coding agent powered by the {{model}} model. Your working directory is {{cwd}}." }
|
|
279
|
-
}, { insert: [{
|
|
280
|
-
id: "agent-presets",
|
|
281
|
-
name: "@deepseek-ai/dsh-agent-presets",
|
|
282
|
-
config: {
|
|
283
|
-
default: "standard",
|
|
284
|
-
roots: existsSync(shippedPresetsDir) ? [{
|
|
285
|
-
path: shippedPresetsDir,
|
|
286
|
-
trust: "system"
|
|
287
|
-
}] : [],
|
|
288
|
-
includeShippedRoot: false,
|
|
289
|
-
includeUserRoot: true
|
|
290
|
-
}
|
|
291
|
-
}, {
|
|
292
|
-
id: "session-stats",
|
|
293
|
-
name: "@deepseek-ai/dsh-session-stats"
|
|
294
|
-
}] }];
|
|
295
|
-
/** Boot one normal pinned-Harness ACRYL profile in a single Cordis root. */
|
|
296
|
-
async function bootAcrylHarnessProfile(options) {
|
|
297
|
-
if (options.profile.trim() === "") throw new Error("ACRYL Harness profile must not be empty");
|
|
298
|
-
initProfile(resolveProfileDir(options.profile), DEFAULT_PROFILE_BUNDLES);
|
|
299
|
-
healProfilesModuleFallback(dshInstallAnchor);
|
|
300
|
-
const profile = loadProfile("acryl", options.profile, dshInstallAnchor);
|
|
301
|
-
const rootConfig = join(profile.dir, "cordis.yml");
|
|
302
|
-
writeFileSync(rootConfig, profileRoot);
|
|
303
|
-
const patches = structuredClone([
|
|
304
|
-
...profile.layers.flatMap((layer) => layer.patches),
|
|
305
|
-
...ACRYL_RUNTIME_ROWS,
|
|
306
|
-
...profile.patches
|
|
307
|
-
]);
|
|
308
|
-
if (composeEntries([patches]).find((entry) => entry.id === "hmr")?.disabled !== true && !process.execArgv.includes("--expose-internals")) throw new Error("ACRYL profile enables Cordis HMR and must be launched with Node --expose-internals");
|
|
309
|
-
const ctx = await boot("acryl", rootConfig, patches, options.prepare);
|
|
310
|
-
let disposed = false;
|
|
311
|
-
return Object.freeze({
|
|
312
|
-
ctx,
|
|
313
|
-
profileDirectory: profile.dir,
|
|
314
|
-
async dispose() {
|
|
315
|
-
if (disposed) return;
|
|
316
|
-
disposed = true;
|
|
317
|
-
await ctx.fiber.dispose();
|
|
318
|
-
}
|
|
319
|
-
});
|
|
320
|
-
}
|
|
321
|
-
/**
|
|
322
|
-
* Boot the DSH browser surface (the `web` profile: `dsh-base` + `dsh-web-app`)
|
|
323
|
-
* as one normal ACRYL runtime, so `pnpm acryl-web` serves the same DSH
|
|
324
|
-
* HTTP/WebSocket seam the web surface always uses. The web profile already
|
|
325
|
-
* composes the persona/agent rows ACRYL's terminal surface adds, so no
|
|
326
|
-
* ACRYL_RUNTIME_ROWS are re-inserted (that would duplicate `system-prompt`).
|
|
327
|
-
*/
|
|
328
|
-
async function bootAcrylWebProfile(options = {}) {
|
|
329
|
-
const profileName = "web";
|
|
330
|
-
initProfile(resolveProfileDir(profileName), DEFAULT_PROFILE_BUNDLES);
|
|
331
|
-
healProfilesModuleFallback(dshInstallAnchor);
|
|
332
|
-
const profile = loadProfile("web", profileName, dshInstallAnchor);
|
|
333
|
-
const rootConfig = join(profile.dir, "cordis.yml");
|
|
334
|
-
writeFileSync(rootConfig, profileRoot);
|
|
335
|
-
const patches = structuredClone([...profile.layers.flatMap((layer) => layer.patches), ...profile.patches]);
|
|
336
|
-
const cmdlineArgs = options.cmdlineArgs ?? [];
|
|
337
|
-
const ctx = await boot("web", rootConfig, patches, (hostCtx) => {
|
|
338
|
-
provideCmdline(hostCtx, {
|
|
339
|
-
args: [...cmdlineArgs],
|
|
340
|
-
exit: (code) => {
|
|
341
|
-
process.exitCode = code;
|
|
342
|
-
}
|
|
343
|
-
});
|
|
344
|
-
return options.prepare?.(hostCtx);
|
|
345
|
-
});
|
|
346
|
-
const startup = ctx.get("webStartup");
|
|
347
|
-
const url = `http://${startup?.host ?? "127.0.0.1"}:${startup?.port ?? 3080}`;
|
|
348
|
-
let disposed = false;
|
|
349
|
-
return Object.freeze({
|
|
350
|
-
ctx,
|
|
351
|
-
url,
|
|
352
|
-
profileDirectory: profile.dir,
|
|
353
|
-
async dispose() {
|
|
354
|
-
if (disposed) return;
|
|
355
|
-
disposed = true;
|
|
356
|
-
await ctx.fiber.dispose();
|
|
357
|
-
}
|
|
358
|
-
});
|
|
359
|
-
}
|
|
360
|
-
//#endregion
|
|
361
40
|
//#region src/host/direct.ts
|
|
362
41
|
/** Start one normal local Harness runtime for this terminal surface. */
|
|
363
42
|
/**
|
|
@@ -4909,6 +4588,8 @@ async function walkDirectory(cwd) {
|
|
|
4909
4588
|
}
|
|
4910
4589
|
return results;
|
|
4911
4590
|
}
|
|
4591
|
+
/** Canonical ACRYL version string used by the CLI and the release smoke checks. */
|
|
4592
|
+
const ACRYL_VERSION = createRequire(import.meta.url)("../package.json").version;
|
|
4912
4593
|
//#endregion
|
|
4913
4594
|
//#region src/tui-app/session.ts
|
|
4914
4595
|
/**
|
|
@@ -4921,7 +4602,7 @@ async function walkDirectory(cwd) {
|
|
|
4921
4602
|
* TUI shows the same capabilities the web surface does. `/clear` flushes the
|
|
4922
4603
|
* current session and re-attaches a fresh one (durable history stays on disk).
|
|
4923
4604
|
*/
|
|
4924
|
-
const TUI_VERSION =
|
|
4605
|
+
const TUI_VERSION = ACRYL_VERSION;
|
|
4925
4606
|
const PROMPT_HISTORY_LIMIT = 200;
|
|
4926
4607
|
function failUnknown(status) {
|
|
4927
4608
|
return status === "running" ? "running" : "idle";
|
|
@@ -5326,10 +5007,6 @@ async function runAcrylTui(options) {
|
|
|
5326
5007
|
}
|
|
5327
5008
|
}
|
|
5328
5009
|
//#endregion
|
|
5329
|
-
//#region src/version.ts
|
|
5330
|
-
/** Canonical ACRYL version string used by the CLI and the release smoke checks. */
|
|
5331
|
-
const ACRYL_VERSION = "0.1.0-dev.0";
|
|
5332
|
-
//#endregion
|
|
5333
5010
|
//#region src/cli/grammar.ts
|
|
5334
5011
|
const HOST_COMMANDS = /* @__PURE__ */ new Set([
|
|
5335
5012
|
"tui",
|
|
@@ -5485,7 +5162,12 @@ async function runAcryl(args, supplied = {}) {
|
|
|
5485
5162
|
//#region src/bin.ts
|
|
5486
5163
|
function isEntrypoint() {
|
|
5487
5164
|
const entrypoint = process.argv[1];
|
|
5488
|
-
|
|
5165
|
+
if (entrypoint === void 0) return false;
|
|
5166
|
+
try {
|
|
5167
|
+
return realpathSync(entrypoint) === realpathSync(fileURLToPath(import.meta.url));
|
|
5168
|
+
} catch {
|
|
5169
|
+
return resolve(entrypoint) === fileURLToPath(import.meta.url);
|
|
5170
|
+
}
|
|
5489
5171
|
}
|
|
5490
5172
|
if (isEntrypoint()) (async () => {
|
|
5491
5173
|
const script = process.argv[1];
|
|
@@ -5503,3 +5185,5 @@ if (isEntrypoint()) (async () => {
|
|
|
5503
5185
|
});
|
|
5504
5186
|
//#endregion
|
|
5505
5187
|
export { parseAcrylArgs, runAcryl };
|
|
5188
|
+
|
|
5189
|
+
//# sourceMappingURL=bin.js.map
|