@intra-mart/accel 0.5.0 → 0.6.0-dev.202609070354

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 (48) hide show
  1. package/README.md +21 -3
  2. package/assets/runtime/ensure.mjs +914 -0
  3. package/dist/asset/dependencies.d.ts +7 -0
  4. package/dist/asset/dependencies.js +23 -0
  5. package/dist/asset/deployer.d.ts +1 -0
  6. package/dist/asset/deployer.js +11 -3
  7. package/dist/asset/installer.js +3 -8
  8. package/dist/asset/updater.d.ts +2 -0
  9. package/dist/asset/updater.js +3 -0
  10. package/dist/asset/walker.d.ts +1 -0
  11. package/dist/asset/walker.js +65 -3
  12. package/dist/commands/attach.d.ts +4 -1
  13. package/dist/commands/attach.js +8 -1
  14. package/dist/commands/detach.d.ts +2 -0
  15. package/dist/commands/detach.js +4 -0
  16. package/dist/commands/init.d.ts +4 -1
  17. package/dist/commands/init.js +8 -1
  18. package/dist/commands/switch.d.ts +3 -0
  19. package/dist/commands/switch.js +12 -3
  20. package/dist/commands/update.d.ts +4 -0
  21. package/dist/commands/update.js +26 -5
  22. package/dist/core/constants.d.ts +10 -1
  23. package/dist/core/constants.js +22 -1
  24. package/dist/core/errors.d.ts +11 -0
  25. package/dist/core/errors.js +6 -0
  26. package/dist/core/gitignore-entries.d.ts +7 -0
  27. package/dist/core/gitignore-entries.js +16 -0
  28. package/dist/core/paths.d.ts +1 -0
  29. package/dist/core/paths.js +1 -0
  30. package/dist/core/types.d.ts +2 -1
  31. package/dist/core/variable-interpolator.js +4 -0
  32. package/dist/i18n/en.js +14 -0
  33. package/dist/i18n/ja.js +14 -0
  34. package/dist/i18n/zh_CN.js +14 -0
  35. package/dist/interactive/next-steps.d.ts +1 -0
  36. package/dist/interactive/next-steps.js +3 -0
  37. package/dist/utils/credentials.d.ts +2 -1
  38. package/dist/utils/credentials.js +3 -2
  39. package/dist/utils/gitignore.d.ts +1 -0
  40. package/dist/utils/gitignore.js +8 -6
  41. package/dist/utils/mcp-generate.js +1 -1
  42. package/dist/utils/runtime-ensure.d.ts +55 -0
  43. package/dist/utils/runtime-ensure.js +391 -0
  44. package/dist/utils/sanitize-text.d.ts +2 -0
  45. package/dist/utils/sanitize-text.js +7 -0
  46. package/dist/utils/settings-io.d.ts +2 -1
  47. package/dist/utils/settings-io.js +2 -1
  48. package/package.json +7 -2
@@ -0,0 +1,391 @@
1
+ import { execFile } from "node:child_process";
2
+ import { createHash, randomBytes } from "node:crypto";
3
+ import { lstat, mkdir, readFile, rename, rm, rmdir, unlink, writeFile, } from "node:fs/promises";
4
+ import { dirname, join } from "node:path";
5
+ import { promisify } from "node:util";
6
+ import { AGENT_OPTIONS, ENSURE_COMMANDS, ENSURE_SCRIPT_REL, ensureCommandFor, PACKAGE_JSON_NAME, RUNTIME_DIR_REL, lockfileFor, } from "../core/constants.js";
7
+ import { DEPENDENCY_GITIGNORE_ENTRIES } from "../core/gitignore-entries.js";
8
+ import { getAssetsRuntimeRoot } from "../core/paths.js";
9
+ import { readTextFileCapped } from "../git/read-capped.js";
10
+ import { getMessage } from "../i18n/index.js";
11
+ import { ensureGitignoreEntries } from "./gitignore.js";
12
+ import { detectLocale } from "./locale-detect.js";
13
+ import { isSafeRelPath } from "./safe-rel-path.js";
14
+ import { sanitizeDisplayBlock, sanitizeDisplayText } from "./sanitize-text.js";
15
+ import { readSettingsSafe } from "./settings-io.js";
16
+ const execFileAsync = promisify(execFile);
17
+ const MANAGED_MARKER = "@accel-cli-managed";
18
+ const ENSURE_SCRIPT_NAME = "ensure.mjs";
19
+ const MAX_SCRIPT_BYTES = 1024 * 1024;
20
+ const MAX_HOOK_FILE_BYTES = 1024 * 1024;
21
+ const ENSURE_OUTPUT_MAX_BUFFER = 16 * 1024 * 1024;
22
+ const STATE_FILE = "state.json";
23
+ export const ENSURE_STRICT_ENV = "ACCEL_ENSURE_STRICT";
24
+ export const CLAUDE_SETTINGS_REL = ".claude/settings.json";
25
+ export const CODEX_HOOKS_REL = ".codex/hooks.json";
26
+ export const COPILOT_HOOK_FILE_REL = ".github/hooks/accel-dependencies.json";
27
+ const SESSION_START_MATCHER = "startup|resume|clear";
28
+ const HOOK_TIMEOUT_SEC = 600;
29
+ const noop = () => { };
30
+ const isPlainObject = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
31
+ const normalizeLf = (text) => text.replace(/\r\n/g, "\n");
32
+ export const isAllowedDependencyDir = (p) => {
33
+ if (!isSafeRelPath(p) || p === ".")
34
+ return false;
35
+ const head = p.split("/")[0];
36
+ return head !== ".accel" && head !== ".git" && head !== ".";
37
+ };
38
+ const safeDependencyDirs = (dirs) => {
39
+ if (!Array.isArray(dirs))
40
+ return [];
41
+ const set = new Set();
42
+ for (const d of dirs) {
43
+ if (typeof d === "string" && isAllowedDependencyDir(d))
44
+ set.add(d);
45
+ }
46
+ return [...set].sort();
47
+ };
48
+ const MAX_DEPENDENCY_FILE_BYTES = 64 * 1024 * 1024;
49
+ export const computeDependencyId = (packageJsonText, lockText) => createHash("sha256")
50
+ .update(normalizeLf(packageJsonText))
51
+ .update(normalizeLf(lockText))
52
+ .digest("hex")
53
+ .slice(0, 16);
54
+ export const computeDependencyIds = async (projectDir, dirs, packageManager) => {
55
+ const ids = new Set();
56
+ const lockName = lockfileFor(packageManager);
57
+ for (const dir of safeDependencyDirs(dirs)) {
58
+ const pkg = await readTextFileCapped(join(projectDir, dir, PACKAGE_JSON_NAME), MAX_DEPENDENCY_FILE_BYTES);
59
+ const lock = await readTextFileCapped(join(projectDir, dir, lockName), MAX_DEPENDENCY_FILE_BYTES);
60
+ if (pkg !== null && lock !== null)
61
+ ids.add(computeDependencyId(pkg, lock));
62
+ }
63
+ return ids;
64
+ };
65
+ export const placeEnsureScript = async (projectDir, opts) => {
66
+ const warn = opts.warn ?? noop;
67
+ const content = normalizeLf(await readFile(join(getAssetsRuntimeRoot(), ENSURE_SCRIPT_NAME), "utf-8"));
68
+ const destPath = join(projectDir, ENSURE_SCRIPT_REL);
69
+ const destStats = await lstat(destPath).catch(() => null);
70
+ if (destStats !== null && !destStats.isFile()) {
71
+ warn(getMessage("warning.ensureScriptUserFile", opts.locale, {
72
+ path: ENSURE_SCRIPT_REL,
73
+ }));
74
+ return false;
75
+ }
76
+ const existing = destStats === null
77
+ ? null
78
+ : await readTextFileCapped(destPath, MAX_SCRIPT_BYTES);
79
+ if (destStats !== null && (existing === null || !existing.includes(MANAGED_MARKER))) {
80
+ warn(getMessage("warning.ensureScriptUserFile", opts.locale, {
81
+ path: ENSURE_SCRIPT_REL,
82
+ }));
83
+ return false;
84
+ }
85
+ if (existing === content)
86
+ return true;
87
+ await mkdir(dirname(destPath), { recursive: true });
88
+ await writeFile(destPath, content, "utf-8");
89
+ return true;
90
+ };
91
+ export const resolveEnsureRuntime = () => process.versions.electron ? "node" : process.execPath;
92
+ export const runEnsure = async (projectDir, opts = {}) => {
93
+ const info = opts.info ?? noop;
94
+ const warn = opts.warn ?? noop;
95
+ const settings = await readSettingsSafe(projectDir);
96
+ const locale = settings?.locale ?? detectLocale();
97
+ info(getMessage("progress.ensuringDependencies", locale));
98
+ const runtime = opts.runtime ?? resolveEnsureRuntime();
99
+ try {
100
+ const { stdout } = await execFileAsync(runtime, [join(projectDir, ENSURE_SCRIPT_REL)], {
101
+ cwd: projectDir,
102
+ env: { ...process.env, [ENSURE_STRICT_ENV]: "1" },
103
+ windowsHide: true,
104
+ maxBuffer: ENSURE_OUTPUT_MAX_BUFFER,
105
+ encoding: "utf-8",
106
+ });
107
+ if (stdout.trim().length > 0)
108
+ info(sanitizeDisplayBlock(stdout.trimEnd()));
109
+ return { ran: true, exitCode: 0, stdout };
110
+ }
111
+ catch (err) {
112
+ const e = err;
113
+ if (e.code === "ENOENT") {
114
+ warn(getMessage("warning.ensureLaunchFailed", locale, {
115
+ command: `${runtime} ${ENSURE_SCRIPT_REL}`,
116
+ }));
117
+ return { ran: false, exitCode: null, stdout: "" };
118
+ }
119
+ const stdout = typeof e.stdout === "string" ? e.stdout : "";
120
+ const stderr = typeof e.stderr === "string" ? e.stderr : "";
121
+ const detail = (stdout.trim().length > 0 ? stdout : stderr).trimEnd();
122
+ warn(getMessage("dependencies.ensureFailed", locale) +
123
+ (detail.length > 0 ? `\n${sanitizeDisplayBlock(detail)}` : ""));
124
+ return {
125
+ ran: true,
126
+ exitCode: typeof e.code === "number" ? e.code : 1,
127
+ stdout,
128
+ };
129
+ }
130
+ };
131
+ const managedSessionStartGroup = (command) => ({
132
+ matcher: SESSION_START_MATCHER,
133
+ hooks: [{ type: "command", command, timeout: HOOK_TIMEOUT_SEC }],
134
+ });
135
+ const isManagedHook = (h) => isPlainObject(h) &&
136
+ typeof h.command === "string" &&
137
+ ENSURE_COMMANDS.has(h.command);
138
+ export const mergeManagedSessionStart = (doc, shouldHave, command) => {
139
+ const next = structuredClone(doc);
140
+ const rawHooks = next.hooks;
141
+ if (rawHooks !== undefined && !isPlainObject(rawHooks)) {
142
+ return { doc, changed: false, unsupported: true };
143
+ }
144
+ const hooksObj = rawHooks;
145
+ const rawGroups = hooksObj?.SessionStart;
146
+ if (rawGroups !== undefined && !Array.isArray(rawGroups)) {
147
+ return { doc, changed: false, unsupported: true };
148
+ }
149
+ let groups;
150
+ let insertAt = -1;
151
+ if (rawGroups !== undefined) {
152
+ const kept = [];
153
+ for (const group of rawGroups) {
154
+ if (isPlainObject(group) && Array.isArray(group.hooks)) {
155
+ const inner = group.hooks.filter((h) => !isManagedHook(h));
156
+ if (inner.length !== group.hooks.length) {
157
+ if (insertAt === -1)
158
+ insertAt = kept.length;
159
+ if (inner.length === 0)
160
+ continue;
161
+ kept.push({ ...group, hooks: inner });
162
+ continue;
163
+ }
164
+ }
165
+ kept.push(group);
166
+ }
167
+ groups = kept;
168
+ }
169
+ if (shouldHave) {
170
+ const target = groups ?? [];
171
+ target.splice(insertAt === -1 ? target.length : insertAt, 0, managedSessionStartGroup(command));
172
+ const obj = hooksObj ?? {};
173
+ obj.SessionStart = target;
174
+ next.hooks = obj;
175
+ }
176
+ else if (hooksObj !== undefined && groups !== undefined) {
177
+ if (groups.length === 0)
178
+ delete hooksObj.SessionStart;
179
+ else
180
+ hooksObj.SessionStart = groups;
181
+ if (Object.keys(hooksObj).length === 0)
182
+ delete next.hooks;
183
+ }
184
+ return {
185
+ doc: next,
186
+ changed: JSON.stringify(next) !== JSON.stringify(doc),
187
+ unsupported: false,
188
+ };
189
+ };
190
+ export const copilotHookFileContent = (command) => JSON.stringify({
191
+ version: 1,
192
+ hooks: {
193
+ sessionStart: [
194
+ {
195
+ type: "command",
196
+ bash: command,
197
+ powershell: command,
198
+ cwd: ".",
199
+ timeoutSec: HOOK_TIMEOUT_SEC,
200
+ },
201
+ ],
202
+ },
203
+ }, null, 2) + "\n";
204
+ const syncJsonHookFile = async (projectDir, rel, shouldHave, command, locale, sink) => {
205
+ const filePath = join(projectDir, rel);
206
+ const stats = await lstat(filePath).catch(() => null);
207
+ if (stats === null && !shouldHave)
208
+ return;
209
+ let doc = {};
210
+ if (stats !== null) {
211
+ if (!stats.isFile()) {
212
+ sink.warn(getMessage("dependencies.hooks.outputParse", locale, { path: rel }));
213
+ return;
214
+ }
215
+ const raw = await readTextFileCapped(filePath, MAX_HOOK_FILE_BYTES);
216
+ let parsed;
217
+ try {
218
+ parsed = raw === null ? undefined : JSON.parse(raw);
219
+ }
220
+ catch {
221
+ parsed = undefined;
222
+ }
223
+ if (!isPlainObject(parsed)) {
224
+ sink.warn(getMessage("dependencies.hooks.outputParse", locale, { path: rel }));
225
+ return;
226
+ }
227
+ doc = parsed;
228
+ }
229
+ const merged = mergeManagedSessionStart(doc, shouldHave, command);
230
+ if (merged.unsupported) {
231
+ sink.warn(getMessage("dependencies.hooks.outputParse", locale, { path: rel }));
232
+ return;
233
+ }
234
+ if (!merged.changed)
235
+ return;
236
+ await mkdir(dirname(filePath), { recursive: true });
237
+ await writeFile(filePath, JSON.stringify(merged.doc, null, 2) + "\n", "utf-8");
238
+ sink.info(getMessage(shouldHave ? "dependencies.hooks.generated" : "dependencies.hooks.removed", locale, { path: rel }));
239
+ };
240
+ const syncCopilotHookFile = async (projectDir, shouldHave, command, locale, sink) => {
241
+ const rel = COPILOT_HOOK_FILE_REL;
242
+ const filePath = join(projectDir, rel);
243
+ const stats = await lstat(filePath).catch(() => null);
244
+ if (!shouldHave) {
245
+ if (stats === null)
246
+ return;
247
+ if (!stats.isFile()) {
248
+ sink.warn(getMessage("dependencies.hooks.outputParse", locale, { path: rel }));
249
+ return;
250
+ }
251
+ await unlink(filePath);
252
+ sink.info(getMessage("dependencies.hooks.removed", locale, { path: rel }));
253
+ return;
254
+ }
255
+ if (stats !== null && !stats.isFile()) {
256
+ sink.warn(getMessage("dependencies.hooks.outputParse", locale, { path: rel }));
257
+ return;
258
+ }
259
+ const content = copilotHookFileContent(command);
260
+ const existing = stats === null ? null : await readTextFileCapped(filePath, MAX_HOOK_FILE_BYTES);
261
+ if (existing === content)
262
+ return;
263
+ await mkdir(dirname(filePath), { recursive: true });
264
+ await writeFile(filePath, content, "utf-8");
265
+ sink.info(getMessage("dependencies.hooks.generated", locale, { path: rel }));
266
+ };
267
+ export const syncDependencyHooks = async (projectDir, opts, agents, hasDeps) => {
268
+ const sink = { info: opts.info ?? noop, warn: opts.warn ?? noop };
269
+ const locale = opts.locale;
270
+ const command = ensureCommandFor(opts.packageManager);
271
+ const has = (agent) => hasDeps && agents.includes(agent);
272
+ await syncJsonHookFile(projectDir, CLAUDE_SETTINGS_REL, has("claude-code"), command, locale, sink);
273
+ await syncJsonHookFile(projectDir, CODEX_HOOKS_REL, has("codex"), command, locale, sink);
274
+ await syncCopilotHookFile(projectDir, has("github-copilot"), command, locale, sink);
275
+ };
276
+ export const syncDependencyArtifacts = async (projectDir, opts = {}) => {
277
+ const settings = await readSettingsSafe(projectDir);
278
+ const locale = settings?.locale ?? detectLocale();
279
+ const dirs = safeDependencyDirs(settings?.dependencies);
280
+ const hasDeps = dirs.length > 0;
281
+ let ensureReady = false;
282
+ if (hasDeps) {
283
+ ensureReady = await placeEnsureScript(projectDir, { locale, warn: opts.warn });
284
+ await ensureGitignoreEntries(projectDir, DEPENDENCY_GITIGNORE_ENTRIES);
285
+ }
286
+ await syncDependencyHooks(projectDir, {
287
+ locale,
288
+ packageManager: settings?.packageManager ?? "bun",
289
+ info: opts.info,
290
+ warn: opts.warn,
291
+ }, Array.isArray(settings?.agents) ? settings.agents : [], hasDeps);
292
+ return { hasDeps, ensureReady };
293
+ };
294
+ const removeLink = async (linkPath) => {
295
+ try {
296
+ await unlink(linkPath);
297
+ }
298
+ catch (err) {
299
+ const code = err.code;
300
+ if (code === "EPERM" || code === "EISDIR") {
301
+ await rmdir(linkPath);
302
+ return;
303
+ }
304
+ throw err;
305
+ }
306
+ };
307
+ export const removeDependencyArtifacts = async (projectDir, opts = {}) => {
308
+ const sink = { info: opts.info ?? noop, warn: opts.warn ?? noop };
309
+ const settings = await readSettingsSafe(projectDir);
310
+ const locale = settings?.locale ?? detectLocale();
311
+ for (const dir of safeDependencyDirs(settings?.dependencies)) {
312
+ const rel = dir === "." ? "node_modules" : `${dir}/node_modules`;
313
+ const linkPath = join(projectDir, dir, "node_modules");
314
+ const stats = await lstat(linkPath).catch(() => null);
315
+ if (stats === null || !stats.isSymbolicLink())
316
+ continue;
317
+ await removeLink(linkPath);
318
+ sink.info(getMessage("dependencies.detach.linkRemoved", locale, {
319
+ path: sanitizeDisplayText(rel),
320
+ }));
321
+ }
322
+ await syncDependencyHooks(projectDir, {
323
+ locale,
324
+ packageManager: settings?.packageManager ?? "bun",
325
+ info: sink.info,
326
+ warn: sink.warn,
327
+ }, [...AGENT_OPTIONS], false);
328
+ };
329
+ const ID_PATTERN = /^[0-9a-f]{16}$/;
330
+ export const pruneRuntimeIds = async (projectDir, ids) => {
331
+ const targets = [...ids].filter((id) => ID_PATTERN.test(id));
332
+ if (targets.length === 0)
333
+ return;
334
+ const runtimeDir = join(projectDir, RUNTIME_DIR_REL);
335
+ for (const id of targets) {
336
+ await rm(join(runtimeDir, id), { recursive: true, force: true });
337
+ }
338
+ const statePath = join(runtimeDir, STATE_FILE);
339
+ let state = null;
340
+ try {
341
+ const parsed = JSON.parse(await readFile(statePath, "utf-8"));
342
+ if (isPlainObject(parsed) && isPlainObject(parsed.ids))
343
+ state = parsed;
344
+ }
345
+ catch {
346
+ state = null;
347
+ }
348
+ if (state === null)
349
+ return;
350
+ const idsObj = state.ids;
351
+ let changed = false;
352
+ for (const id of targets) {
353
+ if (Object.hasOwn(idsObj, id)) {
354
+ delete idsObj[id];
355
+ changed = true;
356
+ }
357
+ }
358
+ if (!changed)
359
+ return;
360
+ const tmpPath = `${statePath}.${randomBytes(4).toString("hex")}.tmp`;
361
+ await writeFile(tmpPath, JSON.stringify(state, null, 2) + "\n", "utf-8");
362
+ await rename(tmpPath, statePath);
363
+ };
364
+ const bestEffort = async (run, fallback) => {
365
+ try {
366
+ return await run();
367
+ }
368
+ catch {
369
+ return fallback;
370
+ }
371
+ };
372
+ const sinkOf = (logger) => ({
373
+ info: (msg) => logger.info(msg),
374
+ warn: (msg) => logger.warn(msg),
375
+ });
376
+ export const syncDependencyArtifactsBestEffort = (projectDir, logger, impl = syncDependencyArtifacts) => bestEffort(() => impl(projectDir, sinkOf(logger)), {
377
+ hasDeps: false,
378
+ ensureReady: false,
379
+ });
380
+ export const runEnsureBestEffort = (projectDir, logger, impl = runEnsure) => bestEffort(async () => {
381
+ await impl(projectDir, sinkOf(logger));
382
+ }, undefined);
383
+ export const removeDependencyArtifactsBestEffort = (projectDir, logger, impl = removeDependencyArtifacts) => bestEffort(() => impl(projectDir, sinkOf(logger)), undefined);
384
+ export const pruneRuntimeIdsBestEffort = (projectDir, ids, impl = pruneRuntimeIds) => bestEffort(() => impl(projectDir, ids), undefined);
385
+ export const syncDependencyArtifactsAndEnsureBestEffort = async (projectDir, logger, opts) => {
386
+ const result = await syncDependencyArtifactsBestEffort(projectDir, logger, opts.syncImpl);
387
+ if (result.ensureReady && !opts.skipInstall) {
388
+ await runEnsureBestEffort(projectDir, logger, opts.runImpl);
389
+ }
390
+ return result;
391
+ };
@@ -1,2 +1,4 @@
1
1
  export declare const MAX_DISPLAY_TEXT_LENGTH = 500;
2
2
  export declare const sanitizeDisplayText: (input: string) => string;
3
+ export declare const MAX_DISPLAY_BLOCK_LINES = 60;
4
+ export declare const sanitizeDisplayBlock: (input: string) => string;
@@ -9,3 +9,10 @@ export const sanitizeDisplayText = (input) => {
9
9
  return cleaned;
10
10
  return codePoints.slice(0, MAX_DISPLAY_TEXT_LENGTH).join("") + "...";
11
11
  };
12
+ export const MAX_DISPLAY_BLOCK_LINES = 60;
13
+ export const sanitizeDisplayBlock = (input) => {
14
+ const lines = input.split(/\r\n|\n/).map(sanitizeDisplayText);
15
+ if (lines.length <= MAX_DISPLAY_BLOCK_LINES)
16
+ return lines.join("\n");
17
+ return [...lines.slice(0, MAX_DISPLAY_BLOCK_LINES), "..."].join("\n");
18
+ };
@@ -1,5 +1,6 @@
1
1
  import type { AccelSettings, HashsumEntry } from "../core/types.js";
2
- export declare const ACCEL_DIR = ".accel";
2
+ import { ACCEL_DIR } from "../core/constants.js";
3
+ export { ACCEL_DIR };
3
4
  export declare const ensureAccelDir: (projectDir: string) => Promise<string>;
4
5
  export declare const writeSettings: (projectDir: string, settings: AccelSettings) => Promise<void>;
5
6
  export declare const readSettings: (projectDir: string) => Promise<AccelSettings>;
@@ -1,7 +1,8 @@
1
1
  import { readFile, writeFile, mkdir } from "node:fs/promises";
2
2
  import { join } from "node:path";
3
3
  import { isSafeRelPath } from "./safe-rel-path.js";
4
- export const ACCEL_DIR = ".accel";
4
+ import { ACCEL_DIR } from "../core/constants.js";
5
+ export { ACCEL_DIR };
5
6
  const SETTINGS_FILE = "settings.json";
6
7
  const HASHSUM_FILE = "hashsum.txt";
7
8
  export const ensureAccelDir = async (projectDir) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intra-mart/accel",
3
- "version": "0.5.0",
3
+ "version": "0.6.0-dev.202609070354",
4
4
  "type": "module",
5
5
  "description": "CLI tool for intra-mart Accel Platform development",
6
6
  "author": "NTT DATA INTRAMART",
@@ -42,7 +42,11 @@
42
42
  "test:unit": "vitest run tests/unit",
43
43
  "test:e2e": "vitest run tests/e2e",
44
44
  "test:watch": "vitest",
45
- "typecheck": "tsc --noEmit"
45
+ "typecheck": "tsc --noEmit",
46
+ "formal:typecheck": "quint typecheck formal/updater.qnt",
47
+ "formal:run": "quint run formal/updater.qnt --backend=typescript --max-samples=2000 --max-steps=12 --invariants P1_editPreserved P3_selfHealing --witnesses witness_recordedButMissing witness_recordedMismatch witness_keptWarnThenConflict && quint run formal/updater.qnt --backend=typescript --main switch_roundtrip --max-samples=2000 --max-steps=5 --invariant P2_switchRoundTrip && quint run formal/updater.qnt --backend=typescript --max-samples=1 --max-steps=0 --invariant P4_classifierConsistency",
48
+ "formal:verify": "quint verify formal/updater.qnt --max-steps=5 --invariants P1_editPreserved P3_selfHealing && quint verify formal/updater.qnt --main switch_roundtrip --max-steps=5 --invariant P2_switchRoundTrip",
49
+ "formal:traces": "bun run formal/generate-traces.ts"
46
50
  },
47
51
  "dependencies": {
48
52
  "@clack/prompts": "^1.7.0",
@@ -58,6 +62,7 @@
58
62
  "unified": "^11.0.5"
59
63
  },
60
64
  "devDependencies": {
65
+ "@informalsystems/quint": "0.32.0",
61
66
  "@types/node": "^24.13.3",
62
67
  "@types/semver": "^7.8.0",
63
68
  "execa": "^10.0.1",