@graphit/cli 0.2.372 → 0.2.377
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/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/bin/graphit +1 -1
- package/bin/graphit.ps1 +1 -1
- package/dist/commands/dashboard-delete.d.ts +43 -0
- package/dist/commands/dashboard-delete.js +66 -0
- package/dist/commands/dashboard-delete.js.map +1 -0
- package/dist/commands/dashboard.js +11 -19
- package/dist/commands/dashboard.js.map +1 -1
- package/dist/commands/ds/render.js +21 -2
- package/dist/commands/ds/render.js.map +1 -1
- package/dist/commands/ds/types.d.ts +2 -0
- package/dist/commands/ds/types.js.map +1 -1
- package/dist/commands/ds/usage.d.ts +50 -0
- package/dist/commands/ds/usage.js +72 -0
- package/dist/commands/ds/usage.js.map +1 -0
- package/dist/commands/ds.js +4 -0
- package/dist/commands/ds.js.map +1 -1
- package/dist/commands/kb-batch.d.ts +29 -0
- package/dist/commands/kb-batch.js +93 -0
- package/dist/commands/kb-batch.js.map +1 -0
- package/dist/commands/kb.js +2 -0
- package/dist/commands/kb.js.map +1 -1
- package/dist/commands/report.d.ts +2 -0
- package/dist/commands/report.js +214 -0
- package/dist/commands/report.js.map +1 -0
- package/dist/index.js +3 -30
- package/dist/index.js.map +1 -1
- package/dist/output/format.d.ts +14 -0
- package/dist/output/format.js +33 -2
- package/dist/output/format.js.map +1 -1
- package/dist/program.d.ts +7 -0
- package/dist/program.js +43 -0
- package/dist/program.js.map +1 -0
- package/dist/skill-guard.js +2 -0
- package/dist/skill-guard.js.map +1 -1
- package/package.json +1 -1
- package/scripts/commander-walk.mjs +2 -2
- package/scripts/generate-tool-manifest.mjs +1 -1
- package/scripts/verb-policy-source.json +127 -3
- package/skills/graphit/SKILL.md +26 -8
- package/skills/graphit/VERSION.json +1 -1
- package/skills/graphit/references/build.md +3 -1
- package/skills/graphit/references/dashboard-create.md +1 -1
- package/skills/graphit/references/data-sources.md +1 -1
- package/skills/graphit/references/filters-advanced.md +9 -7
- package/skills/graphit/references/kb-actions.md +7 -0
- package/skills/graphit/references/onboarding.md +1 -1
- package/skills/graphit/references/query-contract.md +2 -2
- package/skills/graphit/references/scheduled-reports.md +22 -0
- package/skills/graphit/references/share.md +2 -2
- package/skills/graphit-build/SKILL.md +4 -2
- package/skills/graphit-explore/SKILL.md +1 -1
- package/skills/graphit-share/SKILL.md +3 -3
|
@@ -39,6 +39,13 @@ Constraints keep their five semantics: required predicate, forbidden column, req
|
|
|
39
39
|
5. Verify/unverify separately when intended.
|
|
40
40
|
6. Inspect receipts; a degraded write may have landed and must not be retried blindly.
|
|
41
41
|
|
|
42
|
+
When one task creates or changes several metrics or semantic models, send them as one `graphit kb batch` instead of one `kb create` or `kb update` each. Every item gets the same checks and its own result, and dashboards rebuild once for the whole batch instead of once per edit, so they keep serving while you author. A single edit stays `kb update`. Steps 1-2 still apply to every item; a batch changes the transport, not the patch discipline.
|
|
43
|
+
|
|
44
|
+
- Shape: `{"operations": [...]}` or a bare array of `{"op": "update", "noun", "name", "patch"}` and `{"op": "create", "noun", "definition", "unverified"?}` items. Nouns are `metric` and `semantic-model` only; groups, rules and deletes keep their own verbs. Up to 50 items per batch, 20 in-app.
|
|
45
|
+
- Order items so each validates against the ones before it: a semantic model before the metrics that use its measures, a metric before a derived metric over it. Use `--stop-on-error` when later items depend on earlier ones.
|
|
46
|
+
- Items are not all-or-nothing: earlier items stay applied when a later one fails. Read `results` per item, fix what each `error` names, and re-send only the `failed` and `not_attempted` items as a new batch. Never replay the whole batch. An `unknown` item may have landed; read it back with `kb get` before sending it again.
|
|
47
|
+
- In-app, approving the batch verifies each updated item, as approving a single update does.
|
|
48
|
+
|
|
42
49
|
## Delete
|
|
43
50
|
|
|
44
51
|
Confirm with the user and inspect usage first. The server checks known definition dependencies, not every canvas reference. A green guard is not exhaustive impact proof.
|
|
@@ -67,7 +67,7 @@ Ask whether the user wants a quick query answer or a deployed HTML dashboard. Bu
|
|
|
67
67
|
After the first dashboard is deployed, tell the user - concisely - what they get for free on it. Keep this to the first dashboard; it never needs repeating, because onboarding stops firing once the workspace has data.
|
|
68
68
|
|
|
69
69
|
- **Each graph's 3-dot (hamburger) menu**: "view details" opens a panel with the SQL, live query results, and the trust tier plus any enforced rules (the KB assets it lists open as explorable tabs).
|
|
70
|
-
- **The dashboard's own hamburger** (top bar): share it, schedule a recurring email report, export to PNG or PDF, and browse version history.
|
|
70
|
+
- **The dashboard's own hamburger** (top bar): share it, schedule a recurring email or Slack report (or ask Graphit to schedule it), export to PNG or PDF, and browse version history.
|
|
71
71
|
- **Themes and colors** are automatic - dark and light mode, and the brand palette, with no extra work.
|
|
72
72
|
|
|
73
73
|
Then continue in the normal loop; the workspace is no longer empty.
|
|
@@ -15,7 +15,7 @@ Keep the default SQL in `data-graphit-sql` and source in `data-graphit-ds`. Add
|
|
|
15
15
|
</div>
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
These are invented names; use actual accessible sources/columns and governed Metric/Dimension/Measure references where available. A variant contains only `sql` and inherits the owner's source. Cross-source alternatives need separate owners. The spec has no second default SQL, source override or variant named `default`. Unknown fields, versions, duplicate JSON keys, malformed types, undeclared placeholders and the names `__proto__`, `constructor` and `prototype` refuse the save; the refusal names the owner, and the parameter or variant when one is at fault. Save the declaration
|
|
18
|
+
These are invented names; use actual accessible sources/columns and governed Metric/Dimension/Measure references where available. A variant contains only `sql` and inherits the owner's source. Cross-source alternatives need separate owners. The spec has no second default SQL, source override or variant named `default`. Unknown fields, versions, duplicate JSON keys, malformed types, undeclared placeholders and the names `__proto__`, `constructor` and `prototype` refuse the save; the refusal names the owner, and the parameter or variant when one is at fault. Save the declaration so the save rule validates it. The SDK reads the specification from the page, picks the default or named statement and sends it as that entity's query; the server authorizes and governs it like any other query.
|
|
19
19
|
|
|
20
20
|
```js
|
|
21
21
|
const result = await graphit.resolve({
|
|
@@ -32,7 +32,7 @@ Omit `variant` to select the default. Do not combine `variant` with explicit `sq
|
|
|
32
32
|
|
|
33
33
|
**One name, one declaration.** A parameter name is one input: every owner that declares `country` declares it identically, so one control's value is valid everywhere it is sent. While authoring, keep one type table per dashboard and copy into each owner's static specification exactly the placeholders its default and variant statements use; an unused declaration refuses the save. Never build specifications in page JavaScript. When owners disagree, the shared check/save path returns a non-blocking `query_param_type_conflict` warning naming the parameter and its declarations; align them, or rename inputs that genuinely differ, and save again.
|
|
34
34
|
|
|
35
|
-
Dates/as-of, search text, returned top-category arrays and cohort labels are bound values. Keep their parameter names stable across state changes; do not turn a category label into a SQL identifier. Metric/group/grain/horizon changes select authored statements, not SQL fragments passed as values. Send every binding the selected statement uses; bindings removed by the existing integer sentinel simplifier may be omitted.
|
|
35
|
+
Dates/as-of, search text, returned top-category arrays and cohort labels are bound values. Keep their parameter names stable across state changes; do not turn a category label into a SQL identifier. Metric/group/grain/horizon changes select authored statements, not SQL fragments passed as values. Send every binding the selected statement uses; bindings removed by the existing integer sentinel simplifier may be omitted. Values the selected statement does not use are ignored, so one params object can serve all of that owner's variants.
|
|
36
36
|
|
|
37
37
|
Preserve the dashboard's authored All/None/include/exclude behavior. An authored empty selection that means All stays distinct from None; do not globally translate every empty list or null. Use explicit mode values such as an enum when appropriate. The existing integer `all_x` sentinel contract remains in `filters.md`.
|
|
38
38
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Scheduled Reports
|
|
2
|
+
|
|
3
|
+
Load before creating, changing, sending or troubleshooting a scheduled report: a dashboard emailed or posted to Slack on a schedule, optionally with agent commentary. A report delivers an existing dashboard, so build or pick the dashboard first. Delivery from a private source still needs Share for the source and its bound model.
|
|
4
|
+
|
|
5
|
+
## Before creating
|
|
6
|
+
|
|
7
|
+
- Before `report create`, check `report list --dashboard <id>` and update an existing report instead of creating a second.
|
|
8
|
+
- Resolve destinations with `report destinations`: the Slack channels the bot can post to, the org's members (name and email) and its allowed email domains. Map the user's words ("#growth", "Dana") to those entries; an address outside members and allowed domains is refused.
|
|
9
|
+
- Add only recipients and channels the user named. Confirm destinations, schedule and timezone in one line before `report create`; never widen delivery on your own.
|
|
10
|
+
- A report and its commentary render with the creator's data access - yours when you create it. Say so when the recipients differ from who can open the dashboard.
|
|
11
|
+
|
|
12
|
+
## Creating and changing
|
|
13
|
+
|
|
14
|
+
- `report create` needs `--dashboard`, `--name`, `--frequency`, `--send-time` and at least one `--email` or `--slack`. Weekly takes `--day-of-week` (mon..sun), monthly `--day-of-month` (1-28); `--timezone` is IANA and defaults to UTC, so pass the user's.
|
|
15
|
+
- `--filter key=value` sets a dashboard filter by its declared state key (state-contract.md): `a,b` for several values, `start..end` for a date range. `--instructions` adds agent commentary to every run.
|
|
16
|
+
- `report update` changes only the flags passed. `--email`, `--slack`, `--filter` and `--state-file` REPLACE the stored value: read it with `report get` and send the full intended list or map. `--clear-filters` / `--clear-instructions` remove them.
|
|
17
|
+
- Recipients, channels, instructions and filters are the creator's alone to change; pausing, rescheduling, sending, testing and deleting need the creator, a dashboard editor or an org admin. Report a refusal as that rule, not a fault.
|
|
18
|
+
|
|
19
|
+
## Sending and checking
|
|
20
|
+
|
|
21
|
+
- `report test` goes to the creator only; use it to check a render. `report send` goes to every recipient now: only when the user asks.
|
|
22
|
+
- `report runs` shows each run's status, deliveries, error and commentary outcome; `report run <id> <run-id>` shows the commentary exchange (creator only). Report partial or failed delivery as it is: a run is not a delivery.
|
|
@@ -12,7 +12,7 @@ For "publish", inspect the dashboard state and follow dashboard-create.md's publ
|
|
|
12
12
|
|---|---|
|
|
13
13
|
| a. Share a private dashboard | Resolve its private dependency closure, then share and file the same dashboard ID. |
|
|
14
14
|
| b. Share definitions | Reuse or move the selected models/metrics into the agreed group; a bound source follows its model. |
|
|
15
|
-
| c. Schedule or deliver from a private source | Plan the source and bound model's move to a shared group before
|
|
15
|
+
| c. Schedule or deliver from a private source | Plan the source and bound model's move to a shared group before scheduling per scheduled-reports.md. The dashboard may stay private. |
|
|
16
16
|
| d. Author directly in a group | "Shared from the start": apply checks before each shared source/definition write. Build authors the new private dashboard; share it when complete. Keep the agreed scope. |
|
|
17
17
|
| e. Repository-owned work | Apply the same decisions through repo-kb.md's repository/PR workflow on a capable surface. An in-app ownership refusal is a handoff, not permission for a direct-write replacement. |
|
|
18
18
|
|
|
@@ -24,7 +24,7 @@ Read kb-scope.md for effective permissions and exact placement, kb-discovery.md
|
|
|
24
24
|
|
|
25
25
|
**KB-readiness gate:** before work goes live for others, confirm the required models, nested components, metrics, groups and rules exist and have the needed verification. If a business measure is missing, present its gap and proposed governed definition for approval, then author and verify the approved prerequisites. An ad-hoc business measure can be unavailable to governed-only viewers; do not silently publish it as a reusable governed answer. Compare actual binding, grain, time dimension, aggregation, filters, units and policy, not just names or SQL. A same-named conflicting asset is not equivalent: explain the difference and resolve the consequential choice. A truly equivalent accessible asset should be reused.
|
|
26
26
|
|
|
27
|
-
Choose dashboard audience and folder through dashboard-create.md when sharing.
|
|
27
|
+
Choose dashboard audience and folder through dashboard-create.md when sharing. Owners share their own; org admins/owners also any they can see. Org needs admin/owner; Team needs membership. When needed, explain Private/ORG/named scopes via kb-scope.md; keep dashboard audience separate.
|
|
28
28
|
|
|
29
29
|
Before any share or publish, inspect the dashboard for `data-graphit-placeholder` markers. Refuse while any remain and offer "wire it" through build.md. Do not remove markers simply to make sharing pass; real resolves must replace the placeholders.
|
|
30
30
|
|
|
@@ -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.
|
|
5
|
+
skill_version: "0.2.377"
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Build: author and verify content
|
|
@@ -59,8 +59,10 @@ When no source exists and the user asks for a sketch, mockup, wireframe or layou
|
|
|
59
59
|
|
|
60
60
|
Build and show sections as they become useful; continue authorized work without an approval round per chart. Check the canvas, fix `entity_sql_warnings`, and verify rendering and real resolves before calling a data-backed dashboard complete. For a preview, verify layout and marker coverage and report it specifically as a preview.
|
|
61
61
|
|
|
62
|
-
Without Share's established shared scope/draft, Build writes only privately. Shared authoring stays within that authorization; Share retains checks before shared dependency writes and publication. Private sources refresh manually, in full. A schedule or Slack/email delivery request needs Share for the source and its bound model; explain that and offer it if not already requested. The dashboard may remain private. A private report or export alone does not imply scheduled delivery or a visibility change.
|
|
62
|
+
Without Share's established shared scope/draft, Build writes only privately. Shared authoring stays within that authorization; Share retains checks before shared dependency writes and publication. Private sources refresh manually, in full. A schedule or Slack/email delivery request needs Share for the source and its bound model; explain that and offer it if not already requested, then schedule through ../graphit/references/scheduled-reports.md. The dashboard may remain private. A private report or export alone does not imply scheduled delivery or a visibility change.
|
|
63
63
|
|
|
64
64
|
For Private first, end with the private link, verification and limitations, plus one offer to share; an offer grants no permission. When sharing/publication is already requested, continue the same artifact through Share's remaining checks and report its actual outcome. Do not repeat an answered choice; obtain approval for additional effects when required. A draft-only request stays a draft.
|
|
65
65
|
|
|
66
|
+
After completing a dashboard, or when the user asks for something recurring ("every Monday", "a weekly update", "send this to the team"), offer once per session to schedule it as a report; create one only after an explicit yes.
|
|
67
|
+
|
|
66
68
|
<!-- WORKFLOW:END -->
|
|
@@ -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.
|
|
5
|
+
skill_version: "0.2.377"
|
|
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.
|
|
5
|
+
skill_version: "0.2.377"
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Share: checks at the shared write
|
|
@@ -39,7 +39,7 @@ For "publish", inspect the dashboard state and follow ../graphit/references/dash
|
|
|
39
39
|
|---|---|
|
|
40
40
|
| a. Share a private dashboard | Resolve its private dependency closure, then share and file the same dashboard ID. |
|
|
41
41
|
| b. Share definitions | Reuse or move the selected models/metrics into the agreed group; a bound source follows its model. |
|
|
42
|
-
| c. Schedule or deliver from a private source | Plan the source and bound model's move to a shared group before
|
|
42
|
+
| c. Schedule or deliver from a private source | Plan the source and bound model's move to a shared group before scheduling per ../graphit/references/scheduled-reports.md. The dashboard may stay private. |
|
|
43
43
|
| d. Author directly in a group | "Shared from the start": apply checks before each shared source/definition write. Build authors the new private dashboard; share it when complete. Keep the agreed scope. |
|
|
44
44
|
| e. Repository-owned work | Apply the same decisions through ../graphit/references/repo-kb.md's repository/PR workflow on a capable surface. An in-app ownership refusal is a handoff, not permission for a direct-write replacement. |
|
|
45
45
|
|
|
@@ -51,7 +51,7 @@ Read ../graphit/references/kb-scope.md for effective permissions and exact place
|
|
|
51
51
|
|
|
52
52
|
**KB-readiness gate:** before work goes live for others, confirm the required models, nested components, metrics, groups and rules exist and have the needed verification. If a business measure is missing, present its gap and proposed governed definition for approval, then author and verify the approved prerequisites. An ad-hoc business measure can be unavailable to governed-only viewers; do not silently publish it as a reusable governed answer. Compare actual binding, grain, time dimension, aggregation, filters, units and policy, not just names or SQL. A same-named conflicting asset is not equivalent: explain the difference and resolve the consequential choice. A truly equivalent accessible asset should be reused.
|
|
53
53
|
|
|
54
|
-
Choose dashboard audience and folder through ../graphit/references/dashboard-create.md when sharing.
|
|
54
|
+
Choose dashboard audience and folder through ../graphit/references/dashboard-create.md when sharing. Owners share their own; org admins/owners also any they can see. Org needs admin/owner; Team needs membership. When needed, explain Private/ORG/named scopes via ../graphit/references/kb-scope.md; keep dashboard audience separate.
|
|
55
55
|
|
|
56
56
|
Before any share or publish, inspect the dashboard for `data-graphit-placeholder` markers. Refuse while any remain and offer "wire it" through [graphit-build](../graphit-build/SKILL.md). Do not remove markers simply to make sharing pass; real resolves must replace the placeholders.
|
|
57
57
|
|