arcane-cli 0.22.6 → 0.22.8
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/dist/assets/.arcane/governance/universal-agent-rules.md +1 -1
- package/dist/assets/.github/prompts/spell-arcane-version.prompt.md +16 -12
- package/dist/assets/.github/prompts/spell-open-session.prompt.md +13 -1
- package/dist/index.js +47 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -33,7 +33,7 @@ See also: [[README]], [[DECISIONS]], [[governance/git-conventions|Git Convention
|
|
|
33
33
|
|
|
34
34
|
7. **Use wiki-links for cross-references** (e.g., `[[DECISIONS#ADR-NNN|Short Title]]`, `[[journal/YYYY-MM-DD-topic-slug|Session Label]]`). This enables knowledge graph visualization.
|
|
35
35
|
|
|
36
|
-
8. **Use Mermaid for diagrams** (` ```mermaid ` blocks) for all flow charts, architecture diagrams, and sequence diagrams. Directory trees stay as plain code blocks.
|
|
36
|
+
8. **Use Mermaid for diagrams** (` ```mermaid ` blocks) for all flow charts, architecture diagrams, and sequence diagrams. Directory trees stay as plain code blocks. Spell output describing state the spell already computed — not authored, freehand explanatory content — additionally follows the **generated state diagrams** convention ([ARC-036](https://github.com/codemagicianhq/arcane/blob/main/DECISIONS.md#arc-036--generated-state-diagrams-deterministic-mermaid-for-computed-spell-state)): a deterministic, data-derived Mermaid diagram built only from values already in scope, never modeled or invented. Skip it for one-line outputs, speed-rule spells, or any state with only a single reading — the diagram exists to make relationships between multiple already-computed values legible, not to decorate simple output.
|
|
37
37
|
|
|
38
38
|
9. **Journal files use date-prefix naming:** `journal/YYYY-MM-DD-topic-slug.md` for chronological sorting.
|
|
39
39
|
|
|
@@ -40,23 +40,27 @@ Produce output in this exact structure:
|
|
|
40
40
|
| **Installed At** | `{installedAt}` |
|
|
41
41
|
| **Components** | `{count}` installed |
|
|
42
42
|
|
|
43
|
-
### Update Check
|
|
43
|
+
### Update Check (two-axis)
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
-
|
|
47
|
-
- Compare to the installed version.
|
|
45
|
+
This repo's `.arcane.json` version is one of three readings — check both axes, the same two as
|
|
46
|
+
`spell-open-session`'s own version check:
|
|
48
47
|
|
|
49
|
-
|
|
48
|
+
- **Repo-files version** — already read in Step 1 (`.arcane.json`'s `version` field).
|
|
49
|
+
- **Installed CLI version** — determine the version of the installed `arcane-cli` CLI (for example,
|
|
50
|
+
`npx arcane-cli --version`, or the locally installed package version).
|
|
51
|
+
- **Npm-latest version** — fetch `https://registry.npmjs.org/arcane-cli/latest` and extract the
|
|
52
|
+
`version` field.
|
|
50
53
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
- **(a) Repo-files behind the installed CLI:** `⚠ Managed files out of date: files at {version} → CLI at {cli}. Run spell update to resync files.`
|
|
55
|
+
- **(b) Installed CLI behind npm-latest:** `⚠ Update available: CLI at {cli} → latest {latest}. Upgrade the CLI, then run spell update.`
|
|
56
|
+
- **If either axis drifts, emit the canonical version-drift diagram** — same template, same collapsing/
|
|
57
|
+
branching rule, same `:::mermaid`-for-ADO-wikis fencing as `spell-open-session.prompt.md`'s own
|
|
58
|
+
"Arcane version check (two-axis)" step; that file holds the canonical shape, referenced here rather
|
|
59
|
+
than repeated.
|
|
60
|
+
- If both axes are current:
|
|
56
61
|
|
|
57
62
|
```
|
|
58
|
-
|
|
59
|
-
Run `spell update` to upgrade.
|
|
63
|
+
✔ You are on the latest version ({version}).
|
|
60
64
|
```
|
|
61
65
|
|
|
62
66
|
If the npm registry is unreachable, report:
|
|
@@ -96,7 +96,19 @@ Before anything else, check:
|
|
|
96
96
|
- Run `npm view arcane-cli version` to get the latest published version.
|
|
97
97
|
- **(a) Managed files behind the installed CLI** (installed CLI version is newer than the version recorded in `.arcane.json`): surface a warning: `⚠️ Managed files out of date: files at <installed> → CLI at <cli>. Run spell update to resync files.`
|
|
98
98
|
- **(b) Installed CLI behind the latest published version** (latest published is newer than the installed CLI): surface a warning: `⚠️ Arcane CLI update available: CLI at <cli> → latest <latest>. Upgrade the CLI, then run spell update.`
|
|
99
|
-
- If
|
|
99
|
+
- **If either axis shows drift, emit the canonical version-drift diagram beside the warning(s)** — per the generated state diagrams convention (rule 8, ARC-036). One commit per *distinct* version value among the three readings, in the order repo-files → installed-CLI → npm-latest; collapse consecutive identical values into a single shared commit rather than repeating it. Branch off immediately after the commit for each axis that drifts — `repo-files` after the repo-files-version commit if axis A drifts, `installed-cli` after the installed-CLI-version commit if axis B drifts. Tag the final commit `"latest"`. The dangling branch(es) *are* the drifting axis/axes — no legend needed:
|
|
100
|
+
```mermaid
|
|
101
|
+
gitGraph
|
|
102
|
+
commit id: "<repo-files version>"
|
|
103
|
+
branch repo-files
|
|
104
|
+
checkout main
|
|
105
|
+
commit id: "<installed-CLI version>"
|
|
106
|
+
branch installed-cli
|
|
107
|
+
checkout main
|
|
108
|
+
commit id: "<npm-latest version>" tag: "latest"
|
|
109
|
+
```
|
|
110
|
+
(Shown here with both axes drifting — omit whichever `branch`/`checkout` pair belongs to a non-drifting axis, and collapse its commit into its neighbor's if the values are equal.) Use `:::mermaid` fencing instead of ` ```mermaid ` when the output surface is an Azure DevOps wiki — resolve `external_provider` from `.arcane.json` rather than assuming, the same as every other tracker-conditional step in this file; note for bare terminals that the fenced source is still readable without a renderer.
|
|
111
|
+
- If both axes are current, report current and continue — no diagram (the applicability guard: a single, matching reading has nothing to visualize).
|
|
100
112
|
- If no `.arcane.json` exists, skip silently.
|
|
101
113
|
|
|
102
114
|
## State Snapshot
|
package/dist/index.js
CHANGED
|
@@ -3371,6 +3371,33 @@ async function checkForUpdate(currentVersion, feedUrl, cachePath = DEFAULT_CACHE
|
|
|
3371
3371
|
}
|
|
3372
3372
|
}
|
|
3373
3373
|
|
|
3374
|
+
// src/modules/diagram-generator.ts
|
|
3375
|
+
function generateVersionDriftDiagram(repoFilesVersion, installedCliVersion, npmLatestVersion) {
|
|
3376
|
+
if (repoFilesVersion === installedCliVersion && installedCliVersion === npmLatestVersion) {
|
|
3377
|
+
return null;
|
|
3378
|
+
}
|
|
3379
|
+
const lines = ["gitGraph", ` commit id: "${repoFilesVersion}"`];
|
|
3380
|
+
let lastDistinctVersion = repoFilesVersion;
|
|
3381
|
+
if (installedCliVersion !== repoFilesVersion) {
|
|
3382
|
+
lines.push(
|
|
3383
|
+
" branch repo-files",
|
|
3384
|
+
" checkout main",
|
|
3385
|
+
` commit id: "${installedCliVersion}"`
|
|
3386
|
+
);
|
|
3387
|
+
lastDistinctVersion = installedCliVersion;
|
|
3388
|
+
}
|
|
3389
|
+
if (npmLatestVersion !== lastDistinctVersion) {
|
|
3390
|
+
lines.push(
|
|
3391
|
+
" branch installed-cli",
|
|
3392
|
+
" checkout main",
|
|
3393
|
+
` commit id: "${npmLatestVersion}" tag: "latest"`
|
|
3394
|
+
);
|
|
3395
|
+
} else {
|
|
3396
|
+
lines[lines.length - 1] += ' tag: "latest"';
|
|
3397
|
+
}
|
|
3398
|
+
return lines.join("\n");
|
|
3399
|
+
}
|
|
3400
|
+
|
|
3374
3401
|
// src/commands/status.ts
|
|
3375
3402
|
async function runStatus(targetDir, packageVersion) {
|
|
3376
3403
|
let manifest;
|
|
@@ -3429,6 +3456,26 @@ async function runStatus(targetDir, packageVersion) {
|
|
|
3429
3456
|
footer += " (spell update available)";
|
|
3430
3457
|
}
|
|
3431
3458
|
console.log(footer);
|
|
3459
|
+
if (versionResult.latest !== null) {
|
|
3460
|
+
const diagram = generateVersionDriftDiagram(
|
|
3461
|
+
manifest.version,
|
|
3462
|
+
packageVersion,
|
|
3463
|
+
versionResult.latest
|
|
3464
|
+
);
|
|
3465
|
+
if (diagram !== null) {
|
|
3466
|
+
console.log("");
|
|
3467
|
+
if (process.stdout.isTTY) {
|
|
3468
|
+
console.log(" Version drift:");
|
|
3469
|
+
console.log(` repo-files: ${manifest.version}`);
|
|
3470
|
+
console.log(` installed-cli: ${packageVersion}`);
|
|
3471
|
+
console.log(` latest (npm): ${versionResult.latest}`);
|
|
3472
|
+
} else {
|
|
3473
|
+
console.log("```mermaid");
|
|
3474
|
+
console.log(diagram);
|
|
3475
|
+
console.log("```");
|
|
3476
|
+
}
|
|
3477
|
+
}
|
|
3478
|
+
}
|
|
3432
3479
|
}
|
|
3433
3480
|
|
|
3434
3481
|
// src/commands/uninstall.ts
|