@vibgrate/cli 2026.729.2 → 2026.729.3

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 (84) hide show
  1. package/DOCS.md +5 -1
  2. package/dist/agent-Z4Z66IGM.js +22 -0
  3. package/dist/agent-Z4Z66IGM.js.map +1 -0
  4. package/dist/baseline-Q3QQF5QF.js +9 -0
  5. package/dist/{baseline-UOTGTJYT.js.map → baseline-Q3QQF5QF.js.map} +1 -1
  6. package/dist/checkpoint-4WFZMKEO.js +56 -0
  7. package/dist/checkpoint-4WFZMKEO.js.map +1 -0
  8. package/dist/{chunk-CYC3ZI32.js → chunk-3FQSBVQD.js} +6 -6
  9. package/dist/{chunk-CYC3ZI32.js.map → chunk-3FQSBVQD.js.map} +1 -1
  10. package/dist/{chunk-2ZHWF7C6.js → chunk-42RDYQFF.js} +42 -67
  11. package/dist/chunk-42RDYQFF.js.map +1 -0
  12. package/dist/{chunk-HDQG3QYV.js → chunk-4BOWWYSE.js} +32 -17
  13. package/dist/chunk-4BOWWYSE.js.map +1 -0
  14. package/dist/chunk-543E6WDJ.js +61 -0
  15. package/dist/chunk-543E6WDJ.js.map +1 -0
  16. package/dist/{chunk-JIBOJTGS.js → chunk-5HYCB55P.js} +101 -101
  17. package/dist/chunk-5HYCB55P.js.map +1 -0
  18. package/dist/{chunk-QDZ47G45.js → chunk-5MNX3OLS.js} +19 -11
  19. package/dist/chunk-5MNX3OLS.js.map +1 -0
  20. package/dist/{chunk-74ZMAOVF.js → chunk-EQ3IOFIG.js} +55 -9
  21. package/dist/chunk-EQ3IOFIG.js.map +1 -0
  22. package/dist/{chunk-SIPGDJT4.js → chunk-EVLS2M5G.js} +4 -4
  23. package/dist/{chunk-SIPGDJT4.js.map → chunk-EVLS2M5G.js.map} +1 -1
  24. package/dist/{chunk-PXXVLX7K.js → chunk-HWFVBYX4.js} +6 -6
  25. package/dist/{chunk-PXXVLX7K.js.map → chunk-HWFVBYX4.js.map} +1 -1
  26. package/dist/{chunk-P3QIO4ZU.js → chunk-JXMZCTVZ.js} +3 -3
  27. package/dist/{chunk-P3QIO4ZU.js.map → chunk-JXMZCTVZ.js.map} +1 -1
  28. package/dist/{chunk-VZRQUI54.js → chunk-KBPNH67Q.js} +4 -4
  29. package/dist/{chunk-VZRQUI54.js.map → chunk-KBPNH67Q.js.map} +1 -1
  30. package/dist/{chunk-RZEXHDCF.js → chunk-MYM5VIJ4.js} +14 -3
  31. package/dist/chunk-MYM5VIJ4.js.map +1 -0
  32. package/dist/chunk-N3HCPBFY.js +6 -0
  33. package/dist/{chunk-WQE4OIZS.js.map → chunk-N3HCPBFY.js.map} +1 -1
  34. package/dist/{chunk-PMYWZRRS.js → chunk-RBIRXQR6.js} +21 -3
  35. package/dist/chunk-RBIRXQR6.js.map +1 -0
  36. package/dist/{chunk-TCJTQGAO.js → chunk-RGEVBSLK.js} +3 -3
  37. package/dist/{chunk-TCJTQGAO.js.map → chunk-RGEVBSLK.js.map} +1 -1
  38. package/dist/{chunk-67YG3R5F.js → chunk-RIEUPFXO.js} +4 -4
  39. package/dist/{chunk-67YG3R5F.js.map → chunk-RIEUPFXO.js.map} +1 -1
  40. package/dist/{chunk-PRGCCW7D.js → chunk-WBMMRERH.js} +3 -3
  41. package/dist/{chunk-PRGCCW7D.js.map → chunk-WBMMRERH.js.map} +1 -1
  42. package/dist/{chunk-6HX47EBL.js → chunk-X634FZVG.js} +3 -3
  43. package/dist/{chunk-6HX47EBL.js.map → chunk-X634FZVG.js.map} +1 -1
  44. package/dist/{chunk-F6ZPUKED.js → chunk-YMSXP6AO.js} +3 -3
  45. package/dist/{chunk-F6ZPUKED.js.map → chunk-YMSXP6AO.js.map} +1 -1
  46. package/dist/cli.js +713 -373
  47. package/dist/cli.js.map +1 -1
  48. package/dist/{graph-backend-GBL33GMW.js → graph-backend-G5Y6QQV4.js} +4 -4
  49. package/dist/{graph-backend-GBL33GMW.js.map → graph-backend-G5Y6QQV4.js.map} +1 -1
  50. package/dist/index.d.ts +1 -1
  51. package/dist/index.js +8 -8
  52. package/dist/{interactive-HLGJJFLI.js → interactive-MJVMY5JP.js} +23 -22
  53. package/dist/interactive-MJVMY5JP.js.map +1 -0
  54. package/dist/{llm-host-5RE34322.js → llm-host-DZBD5D36.js} +5 -5
  55. package/dist/{llm-host-5RE34322.js.map → llm-host-DZBD5D36.js.map} +1 -1
  56. package/dist/load-4PARCNMD.js +9 -0
  57. package/dist/{load-4MLIHGXF.js.map → load-4PARCNMD.js.map} +1 -1
  58. package/dist/rules-ASYEUNB5.js +74 -0
  59. package/dist/rules-ASYEUNB5.js.map +1 -0
  60. package/dist/runtime-session-AILFASQV.js +19 -0
  61. package/dist/{runtime-session-5M6QZZOS.js.map → runtime-session-AILFASQV.js.map} +1 -1
  62. package/dist/{session-2JT4AUZT.js → session-3OBIQLE4.js} +5 -5
  63. package/dist/{session-2JT4AUZT.js.map → session-3OBIQLE4.js.map} +1 -1
  64. package/dist/{stream-json-Y45JBNYP.js → stream-json-MTPWWVRR.js} +81 -9
  65. package/dist/stream-json-MTPWWVRR.js.map +1 -0
  66. package/dist/{vg-mcp-bridge-ZCKBYQ2D.js → vg-mcp-bridge-BLHEIWMT.js} +6 -6
  67. package/dist/{vg-mcp-bridge-ZCKBYQ2D.js.map → vg-mcp-bridge-BLHEIWMT.js.map} +1 -1
  68. package/dist/{vgd-TGGEAGQZ.js → vgd-S7D2SITC.js} +8 -8
  69. package/dist/vgd-S7D2SITC.js.map +1 -0
  70. package/package.json +1 -1
  71. package/dist/baseline-UOTGTJYT.js +0 -9
  72. package/dist/chunk-2ZHWF7C6.js.map +0 -1
  73. package/dist/chunk-74ZMAOVF.js.map +0 -1
  74. package/dist/chunk-HDQG3QYV.js.map +0 -1
  75. package/dist/chunk-JIBOJTGS.js.map +0 -1
  76. package/dist/chunk-PMYWZRRS.js.map +0 -1
  77. package/dist/chunk-QDZ47G45.js.map +0 -1
  78. package/dist/chunk-RZEXHDCF.js.map +0 -1
  79. package/dist/chunk-WQE4OIZS.js +0 -6
  80. package/dist/interactive-HLGJJFLI.js.map +0 -1
  81. package/dist/load-4MLIHGXF.js +0 -9
  82. package/dist/runtime-session-5M6QZZOS.js +0 -19
  83. package/dist/stream-json-Y45JBNYP.js.map +0 -1
  84. package/dist/vgd-TGGEAGQZ.js.map +0 -1
package/DOCS.md CHANGED
@@ -1306,6 +1306,8 @@ Most developers never need this directly — Vibgrate for VS Code and `vg code`
1306
1306
  vg daemon status
1307
1307
  vg daemon ensure
1308
1308
  vg daemon start
1309
+ vg daemon stop
1310
+ vg daemon restart
1309
1311
  vg daemon register
1310
1312
  vg daemon list
1311
1313
  vg daemon federation
@@ -1320,10 +1322,12 @@ vg daemon graphs
1320
1322
  | `status` | Whether the daemon is running and how many workspaces it tracks |
1321
1323
  | `start` | Run in the foreground (Ctrl-C to stop) |
1322
1324
  | `ensure` | Start in the background if not already running (idempotent; for hosts and agents) |
1325
+ | `stop` | Stop the running daemon (idempotent — succeeds if none is running) |
1326
+ | `restart` | Stop the daemon if running, then start it in the background (`vg update` does this automatically after installing a new version) |
1323
1327
  | `register [root]` | Register the current (or given) repository with a running daemon |
1324
1328
  | `list` | List registered workspaces |
1325
1329
  | `federation [root]` | Register a multi-root federation from `.vibgrate/federation.json` (or primary cwd) |
1326
- | `publish [root]` | Load the workspace code map into the daemon active graph (run `vg build` first) |
1330
+ | `publish [root]` | Load the workspace code map into the daemon active graph (run `vg build` first). The daemon reads the map from disk itself, binary snapshot first — nothing heavy crosses the socket |
1327
1331
  | `query <query...>` | Lexical/structural query against the active graph |
1328
1332
  | `impact <symbol>` | Blast radius for a symbol in the active graph |
1329
1333
  | `graphs` | List multi-branch graph slots currently resident |
@@ -0,0 +1,22 @@
1
+ export { CONTEXT_POLICY_VERSION, DISCOVERY_TOOLS, MUTATION_TOOLS, compact, runAgent } from './chunk-42RDYQFF.js';
2
+ import './chunk-543E6WDJ.js';
3
+ import './chunk-MYM5VIJ4.js';
4
+ import './chunk-REIGWTTH.js';
5
+ import './chunk-RGEVBSLK.js';
6
+ import './chunk-RBIRXQR6.js';
7
+ import './chunk-5HYCB55P.js';
8
+ import './chunk-IPICO2RV.js';
9
+ import './chunk-G4HTI4ZM.js';
10
+ export { summarizeCapsule } from './chunk-US2DAKCM.js';
11
+ import './chunk-3LSG7Z4I.js';
12
+ import './chunk-J7LKEB2R.js';
13
+ import './chunk-EETK7S43.js';
14
+ import './chunk-UTNNGKKX.js';
15
+ import './chunk-RXP66R2E.js';
16
+ import './chunk-ZKNB4YH4.js';
17
+ import './chunk-BWPBB45M.js';
18
+ import './chunk-JFGYT6BI.js';
19
+ import './chunk-BPF3YX2U.js';
20
+ import './chunk-Z6ZWNWWR.js';
21
+ //# sourceMappingURL=agent-Z4Z66IGM.js.map
22
+ //# sourceMappingURL=agent-Z4Z66IGM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"agent-Z4Z66IGM.js"}
@@ -0,0 +1,9 @@
1
+ export { baselineCommand, runBaseline } from './chunk-YMSXP6AO.js';
2
+ import './chunk-4BOWWYSE.js';
3
+ import './chunk-CRAMOEBE.js';
4
+ import './chunk-RXP66R2E.js';
5
+ import './chunk-N3HCPBFY.js';
6
+ import './chunk-GI6W53LM.js';
7
+ import './chunk-Z6ZWNWWR.js';
8
+ //# sourceMappingURL=baseline-Q3QQF5QF.js.map
9
+ //# sourceMappingURL=baseline-Q3QQF5QF.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"baseline-UOTGTJYT.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"baseline-Q3QQF5QF.js"}
@@ -0,0 +1,56 @@
1
+ import './chunk-Z6ZWNWWR.js';
2
+
3
+ // src/code/checkpoint.ts
4
+ function checkpointRef(sessionId, seq) {
5
+ const safe = sessionId.replace(/[^A-Za-z0-9_-]/g, "") || "session";
6
+ return `refs/vibgrate/checkpoints/${safe}/${seq}`;
7
+ }
8
+ function isGitRepo(git) {
9
+ return git(["rev-parse", "--is-inside-work-tree"]).exitCode === 0;
10
+ }
11
+ function createCheckpoint(git, opts) {
12
+ if (!isGitRepo(git)) return null;
13
+ const env = { GIT_INDEX_FILE: opts.indexFile };
14
+ if (git(["add", "-A"], env).exitCode !== 0) return null;
15
+ const tree = git(["write-tree"], env);
16
+ if (tree.exitCode !== 0) return null;
17
+ const treeId = tree.stdout.trim();
18
+ if (!treeId) return null;
19
+ const head = git(["rev-parse", "HEAD"]);
20
+ const parent = head.exitCode === 0 && head.stdout.trim() ? ["-p", head.stdout.trim()] : [];
21
+ const message = opts.message ?? `vg code checkpoint ${opts.seq}`;
22
+ const commit = git(["commit-tree", treeId, ...parent, "-m", message], env);
23
+ if (commit.exitCode !== 0) return null;
24
+ const commitId = commit.stdout.trim();
25
+ if (!commitId) return null;
26
+ const ref = checkpointRef(opts.sessionId, opts.seq);
27
+ if (git(["update-ref", ref, commitId]).exitCode !== 0) return null;
28
+ return { ref, commit: commitId, seq: opts.seq, files: [...opts.files] };
29
+ }
30
+ function restoreCheckpoint(git, opts) {
31
+ const restored = [];
32
+ const removed = [];
33
+ const failed = [];
34
+ for (const file of opts.files) {
35
+ const probe = git(["cat-file", "-e", `${opts.commit}:${file}`]);
36
+ if (probe.exitCode === 0) {
37
+ const res = git(["checkout", opts.commit, "--", file]);
38
+ if (res.exitCode === 0) restored.push(file);
39
+ else failed.push(file);
40
+ continue;
41
+ }
42
+ const rm = git(["rm", "-f", "--ignore-unmatch", "--", file]);
43
+ if (rm.exitCode === 0) removed.push(file);
44
+ else failed.push(file);
45
+ }
46
+ return { restored, removed, failed };
47
+ }
48
+ function deleteCheckpoints(git, sessionId, upTo) {
49
+ for (let seq = 1; seq <= upTo; seq++) {
50
+ git(["update-ref", "-d", checkpointRef(sessionId, seq)]);
51
+ }
52
+ }
53
+
54
+ export { checkpointRef, createCheckpoint, deleteCheckpoints, isGitRepo, restoreCheckpoint };
55
+ //# sourceMappingURL=checkpoint-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CAAC,UAAA,EAAY,KAAK,MAAA,EAAQ,IAAA,EAAM,IAAI,CAAC,CAAA;AACrD,MAAA,IAAI,GAAA,CAAI,QAAA,KAAa,CAAA,EAAG,QAAA,CAAS,KAAK,IAAI,CAAA;AAAA,WACrC,MAAA,CAAO,KAAK,IAAI,CAAA;AACrB,MAAA;AAAA,IACF;AAEA,IAAA,MAAM,EAAA,GAAK,IAAI,CAAC,IAAA,EAAM,MAAM,kBAAA,EAAoB,IAAA,EAAM,IAAI,CAAC,CAAA;AAC3D,IAAA,IAAI,EAAA,CAAG,QAAA,KAAa,CAAA,EAAG,OAAA,CAAQ,KAAK,IAAI,CAAA;AAAA,SACnC,MAAA,CAAO,KAAK,IAAI,CAAA;AAAA,EACvB;AACA,EAAA,OAAO,EAAE,QAAA,EAAU,OAAA,EAAS,MAAA,EAAO;AACrC;AAGO,SAAS,iBAAA,CAAkB,GAAA,EAAgB,SAAA,EAAmB,IAAA,EAAoB;AACvF,EAAA,KAAA,IAAS,GAAA,GAAM,CAAA,EAAG,GAAA,IAAO,IAAA,EAAM,GAAA,EAAA,EAAO;AACpC,IAAA,GAAA,CAAI,CAAC,YAAA,EAAc,IAAA,EAAM,cAAc,SAAA,EAAW,GAAG,CAAC,CAAC,CAAA;AAAA,EACzD;AACF","file":"checkpoint-4WFZMKEO.js","sourcesContent":["/**\n * Checkpoints for VG Code (VG-CLI-CODE §18.4).\n *\n * A checkpoint is a snapshot of the working tree taken when the user approves a\n * change, so an approved edit can be undone after the fact. Two design choices\n * matter:\n *\n * - **Per approval, not per tool call.** A snapshot costs a tree write; taking\n * one for every read or search makes large repositories crawl. Approvals are\n * the points a user would actually want to return to.\n * - **Out of the way.** Snapshots are commits under `refs/vibgrate/checkpoints/`,\n * written with a private index file. The user's own index, staged changes,\n * branch, and HEAD are never touched, and nothing appears in `git log`.\n * Ignored files stay ignored — a checkpoint captures the project, not\n * `node_modules`.\n *\n * A checkpoint id is also recorded in run provenance, so the audit record of a\n * run points at the exact tree the agent produced: an auditor can check out\n * what happened rather than take the record's word for it.\n *\n * Pure over an injected git runner, so every path is unit-tested without a\n * repository.\n */\n\n/** Result of running a git command. */\nexport interface GitResult {\n stdout: string;\n exitCode: number;\n}\n\n/** Runs a git command with an optional private index file. */\nexport type GitRunner = (args: string[], env?: Record<string, string>) => GitResult;\n\nexport interface Checkpoint {\n /** Full ref name, e.g. `refs/vibgrate/checkpoints/s7a/2`. */\n ref: string;\n /** Commit id the ref points at. */\n commit: string;\n /** Sequence within the session, starting at 1. */\n seq: number;\n /** Repo-relative files the approved change touched. */\n files: string[];\n}\n\nexport function checkpointRef(sessionId: string, seq: number): string {\n // Session ids are engine-generated (`s<base36>`); keep the ref path safe anyway.\n const safe = sessionId.replace(/[^A-Za-z0-9_-]/g, '') || 'session';\n return `refs/vibgrate/checkpoints/${safe}/${seq}`;\n}\n\n/** True when the root is inside a git work tree. */\nexport function isGitRepo(git: GitRunner): boolean {\n return git(['rev-parse', '--is-inside-work-tree']).exitCode === 0;\n}\n\n/**\n * Snapshot the current working tree.\n *\n * Returns null when the repository isn't usable for snapshots (no git, or a\n * fresh repo with no objects yet) — a checkpoint is a convenience, and failing\n * to take one must never block an approved change from being applied.\n */\nexport function createCheckpoint(\n git: GitRunner,\n opts: { sessionId: string; seq: number; files: string[]; indexFile: string; message?: string },\n): Checkpoint | null {\n if (!isGitRepo(git)) return null;\n const env = { GIT_INDEX_FILE: opts.indexFile };\n\n // Stage everything into a *private* index: the user's staged work is untouched.\n if (git(['add', '-A'], env).exitCode !== 0) return null;\n const tree = git(['write-tree'], env);\n if (tree.exitCode !== 0) return null;\n const treeId = tree.stdout.trim();\n if (!treeId) return null;\n\n // Parent the snapshot on HEAD when there is one, so the commit is inspectable\n // with ordinary git tooling. A repo with no commits yet simply has no parent.\n const head = git(['rev-parse', 'HEAD']);\n const parent = head.exitCode === 0 && head.stdout.trim() ? ['-p', head.stdout.trim()] : [];\n const message = opts.message ?? `vg code checkpoint ${opts.seq}`;\n const commit = git(['commit-tree', treeId, ...parent, '-m', message], env);\n if (commit.exitCode !== 0) return null;\n const commitId = commit.stdout.trim();\n if (!commitId) return null;\n\n const ref = checkpointRef(opts.sessionId, opts.seq);\n if (git(['update-ref', ref, commitId]).exitCode !== 0) return null;\n return { ref, commit: commitId, seq: opts.seq, files: [...opts.files] };\n}\n\nexport interface RestoreOutcome {\n restored: string[];\n /** Files that did not exist in the checkpoint and were removed. */\n removed: string[];\n failed: string[];\n}\n\n/**\n * Restore files from a checkpoint.\n *\n * Scoped deliberately: only the paths given are touched, never the whole tree.\n * A checkpoint records which files a change wrote, so restoring undoes that\n * change without reverting unrelated work the user did in the meantime — the\n * behaviour someone expects from \"undo this edit\", and the safe default when\n * the alternative is silently discarding their own edits.\n *\n * A file that the checkpoint does not contain was created after it, so undoing\n * means deleting it.\n */\nexport function restoreCheckpoint(\n git: GitRunner,\n opts: { commit: string; files: string[] },\n): RestoreOutcome {\n const restored: string[] = [];\n const removed: string[] = [];\n const failed: string[] = [];\n\n for (const file of opts.files) {\n // Did this path exist in the snapshot?\n const probe = git(['cat-file', '-e', `${opts.commit}:${file}`]);\n if (probe.exitCode === 0) {\n const res = git(['checkout', opts.commit, '--', file]);\n if (res.exitCode === 0) restored.push(file);\n else failed.push(file);\n continue;\n }\n // Absent from the snapshot → it was created after; undo means removing it.\n const rm = git(['rm', '-f', '--ignore-unmatch', '--', file]);\n if (rm.exitCode === 0) removed.push(file);\n else failed.push(file);\n }\n return { restored, removed, failed };\n}\n\n/** Delete a session's checkpoint refs (e.g. when the session is discarded). */\nexport function deleteCheckpoints(git: GitRunner, sessionId: string, upTo: number): void {\n for (let seq = 1; seq <= upTo; seq++) {\n git(['update-ref', '-d', checkpointRef(sessionId, seq)]);\n }\n}\n"]}
@@ -1,11 +1,11 @@
1
- import { FREE_PACK, navigationToolsetConfig, deferredToolNames, HOT_TOOLS } from './chunk-67YG3R5F.js';
1
+ import { FREE_PACK, navigationToolsetConfig, deferredToolNames, HOT_TOOLS } from './chunk-RIEUPFXO.js';
2
2
  import { edgeId, buildModuleResolver, resolve, applyStaticTestLinkage, nodeId } from './chunk-IPICO2RV.js';
3
- import { acquireLock, releaseLock, indexFor } from './chunk-EETK7S43.js';
4
3
  import { init_cli_invocation, whichOnPath, isInstalledOwnBinary } from './chunk-3LSG7Z4I.js';
4
+ import { acquireLock, releaseLock, indexFor } from './chunk-EETK7S43.js';
5
5
  import { langById, grammarSetVersion, langForExtension, setGrammarsOverride, parseSource } from './chunk-UTNNGKKX.js';
6
6
  import { redactSecrets } from './chunk-RXP66R2E.js';
7
- import { writeGraphIndex, SCHEMA_VERSION, loadGraph, ensureVibgrateGitignore, vibgrateDir, writeArtifacts } from './chunk-P3QIO4ZU.js';
8
- import { VERSION } from './chunk-WQE4OIZS.js';
7
+ import { writeGraphIndex, SCHEMA_VERSION, loadGraph, ensureVibgrateGitignore, vibgrateDir, writeArtifacts } from './chunk-JXMZCTVZ.js';
8
+ import { VERSION } from './chunk-N3HCPBFY.js';
9
9
  import { loadCache, serializeGraph, cacheDir, stableStringify } from './chunk-ZKNB4YH4.js';
10
10
  import { shortId, canonicalize, hashString, hashBytes } from './chunk-JFGYT6BI.js';
11
11
  import * as fs10 from 'fs';
@@ -3055,5 +3055,5 @@ async function refreshIfStale(root, opts = {}) {
3055
3055
  }
3056
3056
 
3057
3057
  export { ASSISTANTS, CliError, ExitCode, ResourceLimitError, SKIP_DIRS, SKIP_FILES, SMALL_REPO_FILES, UsageError, analyze, applyCoverage, assistantById, buildFacts, buildGraph, decodeScipIndex, detectAssistants, detectServeLaunch, discover, driftCount, epistemicBreakdown, groundGraph, hasDrift, installAssistant, loadCoverage, loadSnapshot, probeFreshness, refreshIfStale, refreshInstalledInstructions, resolveLimits, scipEdges, uninstallAssistant, usageError, verifyDeterminism, writeNavigationConfig, writeSnapshot };
3058
- //# sourceMappingURL=chunk-CYC3ZI32.js.map
3059
- //# sourceMappingURL=chunk-CYC3ZI32.js.map
3058
+ //# sourceMappingURL=chunk-3FQSBVQD.js.map
3059
+ //# sourceMappingURL=chunk-3FQSBVQD.js.map