@graphit/cli 0.2.379 → 0.2.380

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.379"
10
+ "version": "0.2.380"
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.379"
19
+ "version": "0.2.380"
20
20
  },
21
- "version": "0.2.379",
21
+ "version": "0.2.380",
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.379",
3
+ "version": "0.2.380",
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.379",
3
+ "version": "0.2.380",
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.379"
17
+ FLOOR_VERSION="0.2.380"
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.379"
10
+ $FloorVersion = "0.2.380"
11
11
 
12
12
  $PackageName = "@graphit/cli"
13
13
  # Strict semver: anything else is rejected so a tampered cache cannot inject.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphit/cli",
3
- "version": "0.2.379",
3
+ "version": "0.2.380",
4
4
  "description": "Graphit CLI - Build custom dashboards from any AI coding assistant",
5
5
  "repository": {
6
6
  "type": "git",
@@ -31,6 +31,27 @@ function isGraphitQuery(command) {
31
31
  return /(?:graphit|index\.js)\s+query\b/.test(command);
32
32
  }
33
33
 
34
+ // Issue #1025: a query whose stdout is piped (`|`) or sent to a file (`>`) never
35
+ // reaches this Bash call's output, so any JSON there belongs to another command.
36
+ // Formats only when at least one query invocation writes to the call's stdout.
37
+ // `2>` / `2>&1` redirect stderr only and do not count.
38
+ function queryReachesStdout(command) {
39
+ const invocation = /(?:graphit|index\.js)\s+query\b/g;
40
+ for (const match of command.matchAll(invocation)) {
41
+ const tail = command.slice(match.index).split(/\n|;|&&|\|\||(?<![|&])&(?![&>])/)[0];
42
+ const withoutStderr = tail.replace(/\d?>&\d|2>>?\s*\S+/g, "");
43
+ if (!/(?<!\|)\|(?!\|)|>/.test(withoutStderr)) return true;
44
+ }
45
+ return false;
46
+ }
47
+
48
+ // Issue #1025: every CLI command prints JSON, and some carry `row_count`
49
+ // (`ds create`, `ds re-upload`). Only a query result has a `rows` array together
50
+ // with its `columns` or `provenance`.
51
+ function isQueryResult(parsed) {
52
+ return Array.isArray(parsed.rows) && ("columns" in parsed || "provenance" in parsed);
53
+ }
54
+
34
55
  // The CLI prints verbose SQL before and a provenance footer after the JSON, so
35
56
  // we extract the first complete top-level JSON object (string-aware brace match).
36
57
  function extractFirstJsonObject(text) {
@@ -166,7 +187,7 @@ function main() {
166
187
  if (payload.tool_name !== "Bash") return;
167
188
 
168
189
  const command = payload.tool_input?.command ?? "";
169
- if (!isGraphitQuery(command)) return;
190
+ if (!isGraphitQuery(command) || !queryReachesStdout(command)) return;
170
191
 
171
192
  // tool_response may be an object ({stdout,stderr,...}) or a raw string.
172
193
  const resp = payload.tool_response;
@@ -188,9 +209,7 @@ function main() {
188
209
  emit(`### Graphit query failed\n\n\`${clean(parsed.error)}\``);
189
210
  return;
190
211
  }
191
- if (!("rows" in parsed) && !("data" in parsed) && !("row_count" in parsed)) {
192
- return;
193
- }
212
+ if (!isQueryResult(parsed)) return;
194
213
  emit(buildMarkdown(parsed));
195
214
  }
196
215
 
@@ -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.379"
5
+ skill_version: "0.2.380"
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. -->
@@ -125,7 +125,7 @@ Workflow rows below are generated in-app adapters; CLI hosts load the named work
125
125
 
126
126
  ## Commands
127
127
 
128
- Claude Code supplies the `graphit` wrapper. On Codex, Cursor, terminals and CI, use `npx -y @graphit/cli@0.2.379 <command>`; pin a version for reproducibility. The table is generated from the CLI; check command help for exact flags.
128
+ Claude Code supplies the `graphit` wrapper. On Codex, Cursor, terminals and CI, use `npx -y @graphit/cli@0.2.380 <command>`; pin a version for reproducibility. The table is generated from the CLI; check command help for exact flags.
129
129
 
130
130
  <!-- COMMANDS:START -->
131
131
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "package": "@graphit/cli",
3
- "version": "0.2.379",
3
+ "version": "0.2.380",
4
4
  "source": "cli/package.json"
5
5
  }
@@ -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.379"
5
+ skill_version: "0.2.380"
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.379"
5
+ skill_version: "0.2.380"
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.379"
5
+ skill_version: "0.2.380"
6
6
  ---
7
7
 
8
8
  # Share: checks at the shared write