@graphit/cli 0.2.370 → 0.2.372

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.
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "metadata": {
9
9
  "description": "Graphit CLI plugin for AI coding assistants",
10
- "version": "0.2.370"
10
+ "version": "0.2.372"
11
11
  },
12
12
  "plugins": [
13
13
  {
@@ -16,9 +16,9 @@
16
16
  "source": {
17
17
  "source": "npm",
18
18
  "package": "@graphit/cli",
19
- "version": "0.2.370"
19
+ "version": "0.2.372"
20
20
  },
21
- "version": "0.2.370",
21
+ "version": "0.2.372",
22
22
  "category": "data-visualization",
23
23
  "tags": [
24
24
  "bi",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphit",
3
- "version": "0.2.370",
3
+ "version": "0.2.372",
4
4
  "description": "Build custom HTML dashboards from real data using the Graphit CLI. KB-aware queries, entity wrapping, cached data sources.",
5
5
  "author": {
6
6
  "name": "Graphit",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphit",
3
- "version": "0.2.370",
3
+ "version": "0.2.372",
4
4
  "description": "Build custom HTML dashboards from real data using the Graphit CLI. KB-aware queries, entity wrapping, cached data sources.",
5
5
  "author": {
6
6
  "name": "Graphit",
package/bin/graphit CHANGED
@@ -14,7 +14,7 @@ if [ -z "${GRAPHIT_PLUGIN_ROOT:-}" ]; then
14
14
  fi
15
15
 
16
16
  # graphit:floor (stamped by scripts/sync-plugin-version.mjs from cli/package.json)
17
- FLOOR_VERSION="0.2.370"
17
+ FLOOR_VERSION="0.2.372"
18
18
 
19
19
  PACKAGE_NAME="@graphit/cli"
20
20
  # Strict semver: anything else is rejected so a tampered cache cannot inject.
package/bin/graphit.ps1 CHANGED
@@ -7,7 +7,7 @@ if (-not $env:GRAPHIT_PLUGIN_ROOT) {
7
7
  }
8
8
 
9
9
  # graphit:floor (stamped by scripts/sync-plugin-version.mjs from cli/package.json)
10
- $FloorVersion = "0.2.370"
10
+ $FloorVersion = "0.2.372"
11
11
 
12
12
  $PackageName = "@graphit/cli"
13
13
  # Strict semver: anything else is rejected so a tampered cache cannot inject.
@@ -9,6 +9,18 @@ type InstallContext = "npx" | "global" | "local";
9
9
  */
10
10
  export declare function classifyInstallContext(selfPath: string, cwd: string): InstallContext;
11
11
  export declare function getCurrentVersion(): string;
12
+ /**
13
+ * Issue #994: the remedy for a stale CLI depends on who launched it. The Claude
14
+ * Code plugin's wrapper exports GRAPHIT_PLUGIN_ROOT and resolves npm latest once
15
+ * per session, so a newer release arrives in the next session on its own - and
16
+ * `npm install -g` there would create a global that shadows the wrapper on PATH.
17
+ * A pinned `npx -y @graphit/cli@<version>` (Codex, Cursor, CI) is also npx, but a
18
+ * new session reruns the same pin, so it keeps the pre-existing guidance.
19
+ */
20
+ export type UpdateChannel = "plugin" | "global" | "other";
21
+ export declare function updateChannel(context: InstallContext, env?: NodeJS.ProcessEnv): UpdateChannel;
22
+ export declare function updateRemedy(channel: UpdateChannel): string;
23
+ export declare function formatUpdateBanner(channel: UpdateChannel, current: string, latest: string): string;
12
24
  /**
13
25
  * Issue #904: the one line that turns an uninterpretable failure into an
14
26
  * actionable one, for the caller who is behind the server's contract.
@@ -66,19 +66,22 @@ export function classifyInstallContext(selfPath, cwd) {
66
66
  return "local";
67
67
  }
68
68
  /**
69
- * Whether THIS binary is a stale global install (the `npm i -g` shadowing the
70
- * plugin's npx wrapper). One definition for the three call sites, and safe on
71
- * the error path: `process.cwd()` throws ENOENT from an unlinked directory, and
72
- * a probe that cannot answer must read as "not global", never as a crash.
69
+ * How THIS binary was launched. One definition for every call site, and safe on
70
+ * the error path: `process.cwd()` throws ENOENT from an unlinked directory, and a
71
+ * probe that cannot answer reads as "local" (quiet, never global), never as a crash.
73
72
  */
74
- function isGlobalInstall() {
73
+ function installContext() {
75
74
  try {
76
- return classifyInstallContext(fileURLToPath(import.meta.url), process.cwd()) === "global";
75
+ return classifyInstallContext(fileURLToPath(import.meta.url), process.cwd());
77
76
  }
78
77
  catch {
79
- return false;
78
+ return "local";
80
79
  }
81
80
  }
81
+ /** Whether THIS binary is a stale global install (the `npm i -g` shadowing the plugin's npx wrapper). */
82
+ function isGlobalInstall() {
83
+ return installContext() === "global";
84
+ }
82
85
  function migrationNoticeAllowed() {
83
86
  try {
84
87
  if (!existsSync(MIGRATION_NOTICE_FILE))
@@ -136,6 +139,28 @@ function isNewer(latest, current) {
136
139
  export function getCurrentVersion() {
137
140
  return pkg.version;
138
141
  }
142
+ export function updateChannel(context, env = process.env) {
143
+ if (context === "global")
144
+ return "global";
145
+ return env.GRAPHIT_PLUGIN_ROOT ? "plugin" : "other";
146
+ }
147
+ export function updateRemedy(channel) {
148
+ if (channel === "global")
149
+ return INSTALL_LATEST_COMMAND;
150
+ if (channel === "plugin")
151
+ return "start a new session - the plugin runs the newest CLI automatically";
152
+ return "your assistant's plugin manager";
153
+ }
154
+ export function formatUpdateBanner(channel, current, latest) {
155
+ if (channel === "plugin") {
156
+ return (`\n Graphit CLI update published: ${current} → ${latest}\n` +
157
+ " The plugin picks it up automatically in your next session - no install needed.\n\n");
158
+ }
159
+ return (`\n Graphit CLI update available: ${current} → ${latest}\n` +
160
+ ` Update the CLI binary: ${INSTALL_LATEST_COMMAND}\n` +
161
+ " (If `graphit` is on a custom npm prefix, add --prefix <dir> for that prefix.)\n" +
162
+ " Your assistant's skill bundle updates separately via the plugin manager.\n\n");
163
+ }
139
164
  /**
140
165
  * Issue #904: the one line that turns an uninterpretable failure into an
141
166
  * actionable one, for the caller who is behind the server's contract.
@@ -160,9 +185,7 @@ export function staleVersionHint() {
160
185
  return undefined;
161
186
  if (Date.now() - cache.checkedAt > HINT_MAX_AGE_MS)
162
187
  return undefined;
163
- const remedy = isGlobalInstall()
164
- ? INSTALL_LATEST_COMMAND
165
- : "your assistant's plugin manager";
188
+ const remedy = updateRemedy(updateChannel(installContext()));
166
189
  return (`This CLI is ${current}; ${cache.latestVersion} is available. ` +
167
190
  `The server's contract can move ahead of an older CLI - update (${remedy}) and retry.`);
168
191
  }
@@ -172,12 +195,9 @@ export function printUpdateBanner() {
172
195
  // Project #246: when running as the stale global, the self-announcing shim
173
196
  // prints the migration notice instead - suppress the "npm install -g" banner so
174
197
  // we don't tell the user to reinstall the very global we're asking them to remove.
175
- const onGlobal = isGlobalInstall();
176
- if (!onGlobal && cache && isNewer(cache.latestVersion, current)) {
177
- writeStderr(`\n Graphit CLI update available: ${current} → ${cache.latestVersion}\n` +
178
- ` Update the CLI binary: ${INSTALL_LATEST_COMMAND}\n` +
179
- " (If `graphit` is on a custom npm prefix, add --prefix <dir> for that prefix.)\n" +
180
- " Your assistant's skill bundle updates separately via the plugin manager.\n\n");
198
+ const channel = updateChannel(installContext());
199
+ if (channel !== "global" && cache && isNewer(cache.latestVersion, current)) {
200
+ writeStderr(formatUpdateBanner(channel, current, cache.latestVersion));
181
201
  }
182
202
  const skillBanner = formatSkillStalenessBanner(findOutdatedSkillInstalls(current), current);
183
203
  if (skillBanner) {
@@ -1 +1 @@
1
- {"version":3,"file":"update-check.js","sourceRoot":"","sources":["../src/update-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACtF,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EACL,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,C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CAAC,CAAE,IAA8B,CAAC,OAAO;YACzC,CAAC,CAAC,SAAS,CAAC;QAChB,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YAC3D,UAAU,CAAC,EAAE,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAChE,CAAC;IACH,CAAC,CAAC;SACD,KAAK,CAAC,GAAG,EAAE;QACV,2CAA2C;IAC7C,CAAC,CAAC,CAAC;AACP,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphit/cli",
3
- "version": "0.2.370",
3
+ "version": "0.2.372",
4
4
  "description": "Graphit CLI - Build custom dashboards from any AI coding assistant",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,7 +15,7 @@
15
15
  "build": "npm run sync:version && npm run sync:workflows && tsc",
16
16
  "dev": "tsx src/index.ts",
17
17
  "lint": "npm run check:version && tsc --noEmit",
18
- "test": "npm run build && npm run check:commands && node --test test/*.test.mjs",
18
+ "test": "npm run build && npm run check:commands && GRAPHIT_SKIP_PLUGIN_PREFLIGHT=1 node --test test/*.test.mjs",
19
19
  "sync:version": "node scripts/sync-plugin-version.mjs",
20
20
  "sync:workflows": "node scripts/sync-workflow-references.mjs",
21
21
  "check:workflows": "node scripts/sync-workflow-references.mjs --check",
@@ -50,11 +50,21 @@ const shouldRepair = args.has("--repair") || args.has("--auto-repair");
50
50
  const isPreflight = args.has("--preflight");
51
51
  const hookIndex = process.argv.indexOf("--hook");
52
52
  const hookEvent = hookIndex >= 0 ? process.argv[hookIndex + 1] : null;
53
- const pluginRoot =
53
+ const pluginRootFromEnv =
54
54
  process.env.CLAUDE_PLUGIN_ROOT ??
55
55
  process.env.CODEX_PLUGIN_ROOT ??
56
- process.env.GRAPHIT_PLUGIN_ROOT ??
57
- dirname(dirname(fileURLToPath(import.meta.url)));
56
+ process.env.GRAPHIT_PLUGIN_ROOT;
57
+ const pluginRoot = pluginRootFromEnv ?? dirname(dirname(fileURLToPath(import.meta.url)));
58
+ // Issue #994: a plugin root variable means this run inspects the bundle an
59
+ // assistant loaded (hooks get CLAUDE_PLUGIN_ROOT, the bin/graphit wrapper exports
60
+ // GRAPHIT_PLUGIN_ROOT). That bundle's CLI already tracks npm latest through npx, so
61
+ // a newer release means the BUNDLE is behind. Without one, this run inspects the
62
+ // npm package it ships in - a CLI launched without the plugin, i.e. a global install.
63
+ const inspectsPluginBundle = pluginRootFromEnv !== undefined;
64
+ const PLUGIN_UPDATE_STEPS =
65
+ "In Claude Code run `/plugin marketplace update graphit-plugin`, then `/plugin update graphit@graphit-plugin`, " +
66
+ "then restart Claude Code (asking to update Graphit runs the same steps via `/graphit:update`). " +
67
+ "In Codex, update the Graphit plugin through its plugin manager.";
58
68
  // Project #246: the version cache must be shared between this SessionStart hook
59
69
  // and the bin/graphit wrapper (agent Bash tool). CLAUDE_PLUGIN_DATA is set
60
70
  // per-plugin/per-context by Claude Code and is NOT guaranteed identical across
@@ -629,10 +639,23 @@ async function collectStatus() {
629
639
  const marketplace = bundleInfo.marketplace;
630
640
  const marketplacePlugin = bundleInfo.marketplacePlugin;
631
641
 
642
+ // Issue #994: only the npm package (and the repo's cli/ dir) carries package.json
643
+ // and the npm-shaped marketplace.json that sync:version stamps. A bundle installed
644
+ // from the git marketplace ships that repo's own catalog (source "./", no
645
+ // metadata) by design, so the catalog checks are publisher checks - CI gates them
646
+ // (`check:version`, `sync-plugin-marketplace.sh verify`) - and a customer who hits
647
+ // real drift needs a plugin update, not a publish step.
648
+ const isPackageLayout = existsSync(join(pluginRoot, "package.json"));
649
+ const driftRemediation = isPackageLayout
650
+ ? "Run `npm run sync:version` before publishing @graphit/cli."
651
+ : `This installed Graphit plugin bundle is inconsistent. Update or reinstall it: ${PLUGIN_UPDATE_STEPS}`;
652
+
632
653
  const versionChecks = [
633
654
  [".claude-plugin/plugin.json", claudePlugin?.version],
634
655
  [".codex-plugin/plugin.json", codexPlugin?.version],
635
- [".claude-plugin/marketplace.json metadata", marketplace?.metadata?.version],
656
+ ...(isPackageLayout
657
+ ? [[".claude-plugin/marketplace.json metadata", marketplace?.metadata?.version]]
658
+ : []),
636
659
  [".claude-plugin/marketplace.json plugin", marketplacePlugin?.version],
637
660
  ["skills/graphit/VERSION.json", tryReadJson(join(pluginRoot, "skills", "graphit", "VERSION.json"))?.version],
638
661
  ["skills/graphit/SKILL.md", readFrontmatterVersion(join(pluginRoot, "skills", "graphit", "SKILL.md"))],
@@ -646,39 +669,47 @@ async function collectStatus() {
646
669
  findings.push({
647
670
  type: "metadata-drift",
648
671
  message: `${label} is ${version ?? "missing"}, expected ${currentVersion}`,
649
- remediation: "Run `npm run sync:version` before publishing @graphit/cli.",
672
+ remediation: driftRemediation,
650
673
  });
651
674
  }
652
675
  metadata.push({ label, version: version ?? null });
653
676
  }
654
677
 
655
678
  const marketplaceSource = marketplacePlugin?.source;
656
- const sourceMatches =
657
- marketplaceSource?.source === "npm" &&
658
- marketplaceSource.package === packageName &&
659
- marketplaceSource.version === currentVersion;
660
679
  metadata.push({
661
680
  label: ".claude-plugin/marketplace.json source",
662
681
  version: marketplaceSource?.version ?? null,
663
682
  source: marketplaceSource ?? null,
664
683
  });
665
- if (!isPreflight && !sourceMatches) {
684
+ const sourceMatches =
685
+ marketplaceSource?.source === "npm" &&
686
+ marketplaceSource.package === packageName &&
687
+ marketplaceSource.version === currentVersion;
688
+ if (!isPreflight && isPackageLayout && !sourceMatches) {
666
689
  findings.push({
667
690
  type: "metadata-drift",
668
691
  message: `.claude-plugin/marketplace.json source is ${
669
692
  marketplaceSource ? JSON.stringify(marketplaceSource) : "missing"
670
693
  }, expected npm source ${packageName}@${currentVersion}`,
671
- remediation: "Run `npm run sync:version` before publishing @graphit/cli.",
694
+ remediation: driftRemediation,
672
695
  });
673
696
  }
674
697
 
675
698
  const latestVersion = await getLatestVersion(currentVersion);
676
699
  if (!isPreflight && latestVersion && compareVersions(latestVersion, currentVersion) > 0) {
677
- findings.push({
678
- type: "package-update",
679
- message: `@graphit/cli update available: ${currentVersion} -> ${latestVersion}`,
680
- remediation: "This update is for the npm CLI binary (@graphit/cli), a separate artifact from the skill bundle. Update the binary with `npm install -g @graphit/cli@latest` (not `npm update -g`, which respects the original semver range and can miss the latest). If `graphit` resolves to a custom npm prefix (compare `command -v graphit` with `npm prefix -g`), reinstall to that prefix with `npm install -g @graphit/cli@latest --prefix <dir>` (<dir> = the parent of the bin dir holding graphit). The Claude Code/Codex skill bundle updates separately via `claude plugin update graphit@graphit-plugin` and does NOT update the binary.",
681
- });
700
+ findings.push(
701
+ inspectsPluginBundle
702
+ ? {
703
+ type: "plugin-update",
704
+ message: `Graphit plugin update available: ${currentVersion} -> ${latestVersion}`,
705
+ remediation: `The plugin runs the latest Graphit CLI automatically; what is behind is the plugin bundle itself (skills, hooks and commands at ${currentVersion}). ${PLUGIN_UPDATE_STEPS} Do not install @graphit/cli globally: a global install shadows the plugin's CLI on PATH.`,
706
+ }
707
+ : {
708
+ type: "package-update",
709
+ message: `@graphit/cli update available: ${currentVersion} -> ${latestVersion}`,
710
+ remediation: "This update is for the npm CLI binary (@graphit/cli), a separate artifact from the skill bundle. Update the binary with `npm install -g @graphit/cli@latest` (not `npm update -g`, which respects the original semver range and can miss the latest). If `graphit` resolves to a custom npm prefix (compare `command -v graphit` with `npm prefix -g`), reinstall to that prefix with `npm install -g @graphit/cli@latest --prefix <dir>` (<dir> = the parent of the bin dir holding graphit). The Claude Code/Codex skill bundle updates separately via `claude plugin update graphit@graphit-plugin` and does NOT update the binary.",
711
+ },
712
+ );
682
713
  }
683
714
 
684
715
  const claudeInstall = inspectClaudeInstalledPlugin(currentVersion, shouldRepair);
@@ -759,8 +790,8 @@ function buildHookNudges(status) {
759
790
  ) {
760
791
  lines.push(
761
792
  `- A newer Graphit plugin is available (${status.currentVersion} -> ${status.latestVersion}). ` +
762
- "Tell the user once to update the bundle with `/plugin update graphit@graphit-plugin`; " +
763
- "the CLI binary itself updates automatically.",
793
+ "Tell the user once to update it with `/plugin marketplace update graphit-plugin`, then " +
794
+ "`/plugin update graphit@graphit-plugin`, then restart Claude Code; the CLI itself already runs the latest release.",
764
795
  );
765
796
  shown.push("plugin-update");
766
797
  }
@@ -2,7 +2,7 @@
2
2
  name: graphit
3
3
  description: >-
4
4
  Use Graphit for ANY business or product data question: metrics, KPIs, revenue, retention, spend, users, cohorts, funnels, trends, comparisons, diagnosis, analysis, reports or dashboards, even when the user never names Graphit. This is the Graphit entry: identify the task and load graphit-explore, graphit-build or graphit-share. Use the team's governed definitions and cached data to deliver answers or interactive dashboards. Prefer Graphit over one-off analysis for the user's business numbers. Skip pure software tasks or data unrelated to their business.
5
- skill_version: "0.2.370"
5
+ skill_version: "0.2.372"
6
6
  ---
7
7
 
8
8
  <!-- SIZE EXEMPTION (SKILL.md): hard limit 12,288 chars, exempted ceiling 35,072. Reviewed 2026-09-17. Always-loaded: identity, hard constraints, intent routing and the opening choice, plus the generated command table (COMMANDS markers; cli/scripts/generate-commands-doc.mjs) - needed every turn, not deferrable. Marker sits after the frontmatter so the loader and sync-plugin-version.mjs parse it. Raises pay only for command-table growth; each is recorded in docs/knowledge/prompt-engineering/sizing/SIZING.md, prose changes in docs/workflow/prompt-changes/INDEX.md. -->
@@ -124,7 +124,7 @@ Workflow rows below are generated in-app adapters; CLI hosts load the named work
124
124
 
125
125
  ## Commands
126
126
 
127
- Claude Code supplies the `graphit` wrapper. On Codex, Cursor, terminals and CI, use `npx -y @graphit/cli@0.2.370 <command>`; pin a version for reproducibility. The table is generated from the CLI; check command help for exact flags.
127
+ Claude Code supplies the `graphit` wrapper. On Codex, Cursor, terminals and CI, use `npx -y @graphit/cli@0.2.372 <command>`; pin a version for reproducibility. The table is generated from the CLI; check command help for exact flags.
128
128
 
129
129
  <!-- COMMANDS:START -->
130
130
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "package": "@graphit/cli",
3
- "version": "0.2.370",
3
+ "version": "0.2.372",
4
4
  "source": "cli/package.json"
5
5
  }
@@ -25,7 +25,7 @@ graphit.cascade('#user-list', {
25
25
  ```
26
26
 
27
27
  - `filters()` returns `{ COLUMN: value }`. A scalar makes `COLUMN = :p`; an array makes `COLUMN IN :p`. One contract everywhere: `null`, absent or `''` means ALL (no constraint), and `[]` means match NOTHING - an empty-array upstream settles the list empty without issuing a query.
28
- - `selection` (a filter handle) is auto-pruned to the surviving values when an upstream changes.
28
+ - `selection` (a filter handle) is auto-pruned to the surviving values when an upstream changes. Name the control a cascade feeds - pass `selection`, or use the `column` that control declares in `data-graphit-field` - so report and saved-view editors can list and search these values.
29
29
  - Returns `{ destroy(), search(term) }`. Keep the result set small (default `LIMIT 1001`); these parameterized queries skip the result cache, so they hit DuckDB directly.
30
30
  - `withCounts: true` adds a per-value row count, delivered as `ctx.counts` alongside `values` (same order).
31
31
  - Type-ahead: call the handle's `search('ber')` to narrow server-side; it is debounced with the normal refetch and matches literally, so `100%` finds `100%`. Clearing it (`search('')`) restores the full list.
@@ -1,6 +1,6 @@
1
1
  # Headless Filters, Parameters, and Saved Views
2
2
 
3
- Load when the dashboard has ANY user-changeable control - a select, a button set, a slider, a date picker - plus saved views. A dashboard nobody changes skips this file. Dependent dropdowns and date presets live in `filters-advanced.md`.
3
+ Load when the dashboard has ANY user-changeable control - a select, a button set, a slider, a date picker - plus saved views. A dashboard nobody changes skips this file. Dependent dropdowns, date presets and the `date_range` kind live in `filters-advanced.md`.
4
4
 
5
5
  ## Contents
6
6
 
@@ -32,7 +32,7 @@ A declared key is a live filter before any of your script runs. `graphit.state.g
32
32
 
33
33
  **Reuse a control.** A control is page markup and a template cannot declare state, so copy the wrapper and its `<script>` between dashboards; `templates.md` says what a template can carry.
34
34
 
35
- **Registering from JavaScript instead.** `graphit.filter(id, options)` / `graphit.param(id, options)` still work and return a handle; calling either on a key you already declared adopts it. They are the escape hatch for keys you cannot write as markup, and a NEW undeclared one is refused at save. Both, plus the retrofit procedure, are in `state-contract.md`.
35
+ **Registering from JavaScript instead.** `graphit.filter(id, options)` / `graphit.param(id, options)` still work and return a handle; calling either on a key you already declared adopts it. A fixed choice list (buttons, a static `<select>`) names its choices that way - `graphit.param('gran', { options: ['day', 'week', 'month'] })` - so report and saved-view editors can list them. They are the escape hatch for keys you cannot write as markup, and a NEW undeclared one is refused at save. Both, plus the retrofit procedure, are in `state-contract.md`.
36
36
 
37
37
  ## Wiring a Control
38
38
 
@@ -76,7 +76,7 @@ Params: 50 keys, arrays of 200 items, 8,192 bytes serialized. For typed value sc
76
76
 
77
77
  ## Saved Views
78
78
 
79
- Users save the current state as a named view and restore it later. The platform snapshots every declared and registered key automatically, and views survive page reloads (state is baked into the iframe on every render). A default view auto-applies on dashboard open with no flash.
79
+ Users save the current state as a named view. The platform snapshots every declared and registered key, views survive page reloads, and a default view auto-applies on open.
80
80
 
81
81
  The subscribe callback restores each control's visual state when a view is applied, so every control MUST have one. A control with neither a `data-graphit-state` wrapper nor a `graphit.filter`/`param` call - a bare hand-rolled `<select>` - is invisible to views: the user changes it, saves, and the view captures nothing.
82
82
 
@@ -114,5 +114,3 @@ One declared control, wired to one reactive chart. The `<select>` is your own ma
114
114
  });
115
115
  </script>
116
116
  ```
117
-
118
- Dependent dropdowns, date-preset pickers and the `date_range` kind: `filters-advanced.md`.
@@ -4,9 +4,12 @@ Load this only when installing, updating, or repairing Graphit itself: a `plugin
4
4
 
5
5
  ## Install and update
6
6
 
7
- Two separate artifacts ship to Claude Code and Codex: the **CLI binary** (`@graphit/cli`, installed and updated with npm) and the **skill bundle** (the plugin `graphit@graphit-plugin`, updated through the assistant's plugin manager). The plugin bundle does NOT contain the CLI binary, so updating one never updates the other.
7
+ Graphit has two parts: the **CLI** (`@graphit/cli` on npm) and the **plugin bundle** (`graphit@graphit-plugin`: skills, references, hooks, commands). In Claude Code the plugin's `graphit` wrapper runs the CLI through npx at the latest npm release, so the CLI stays current on its own; the bundle changes only when the plugin is updated.
8
8
 
9
- `graphit plugin status` reports "update available" for the **npm CLI binary**. Update it with `npm install -g @graphit/cli@latest` (not `npm update -g`, which can keep you on an old release). If `graphit` resolves to a custom npm prefix - compare `command -v graphit` with `npm prefix -g` - reinstall to that prefix: `npm install -g @graphit/cli@latest --prefix <dir>`, where `<dir>` is the parent of the bin directory holding graphit. The **skill bundle** updates separately with `claude plugin update graphit@graphit-plugin`; that never touches the binary.
9
+ `graphit plugin status --json` names what is behind by the finding's `type`:
10
+
11
+ - `plugin-update` - the plugin bundle is behind. Update it with `/plugin marketplace update graphit-plugin`, then `/plugin update graphit@graphit-plugin` (`/graphit:update` runs both; in Codex, use its plugin manager), then restart: the running session keeps the old skill until then. Never suggest a global `npm install -g @graphit/cli` here - it shadows the plugin's wrapper on PATH, and the user would run whatever version they installed.
12
+ - `package-update` - the CLI runs without the plugin, from a global npm install. Update it with `npm install -g @graphit/cli@latest` (not `npm update -g`, which can keep you on an old release). If `graphit` resolves to a custom npm prefix - compare `command -v graphit` with `npm prefix -g` - reinstall to that prefix: `npm install -g @graphit/cli@latest --prefix <dir>`, where `<dir>` is the parent of the bin directory holding graphit. If the Graphit plugin is also installed, the global is shadowing it: offer `npm uninstall -g @graphit/cli` instead, and run it only after the user confirms.
10
13
 
11
14
  How you run the binary depends on the surface: on Claude Code the plugin's `graphit` wrapper runs it directly; on Codex, Cursor, a terminal, or CI, invoke it explicitly with `npx -y @graphit/cli@<version>` (or pin `npx -y @graphit/cli@<exact>` for a deterministic, reproducible run).
12
15
 
@@ -2,7 +2,7 @@
2
2
  name: graphit-build
3
3
  description: >-
4
4
  Author and verify Graphit dashboard content, private or shared, and build private reports, sources and saved metrics. Pair with graphit-share for shared dependencies, draft sessions and publication. Use graphit-explore for answers without artifacts.
5
- skill_version: "0.2.370"
5
+ skill_version: "0.2.372"
6
6
  ---
7
7
 
8
8
  # Build: author and verify content
@@ -2,7 +2,7 @@
2
2
  name: graphit-explore
3
3
  description: >-
4
4
  Answer, explain or diagnose business data using Graphit. Use after Graphit routing or for a direct Graphit question, including reads of shared dashboards. Does not authorize creating reusable definitions or sharing; use graphit-build to keep a private artifact and graphit-share for shared writes.
5
- skill_version: "0.2.370"
5
+ skill_version: "0.2.372"
6
6
  ---
7
7
 
8
8
  # Explore: answer the question
@@ -2,7 +2,7 @@
2
2
  name: graphit-share
3
3
  description: >-
4
4
  Share or publish Graphit work, edit shared Graphit dashboards, or author into a shared group. Use after Graphit routing or a direct Graphit shared-scope request. Pair with graphit-build for dashboard authoring. Read-only questions belong to graphit-explore.
5
- skill_version: "0.2.370"
5
+ skill_version: "0.2.372"
6
6
  ---
7
7
 
8
8
  # Share: checks at the shared write