@graphit/cli 0.2.259 → 0.2.270

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 (46) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.codex-plugin/plugin.json +1 -1
  4. package/bin/graphit +1 -1
  5. package/bin/graphit.ps1 +1 -1
  6. package/dist/commands/ds/api.d.ts +19 -0
  7. package/dist/commands/ds/api.js +74 -0
  8. package/dist/commands/ds/api.js.map +1 -0
  9. package/dist/commands/ds/polling.d.ts +13 -0
  10. package/dist/commands/ds/polling.js +189 -0
  11. package/dist/commands/ds/polling.js.map +1 -0
  12. package/dist/commands/ds/render.d.ts +15 -0
  13. package/dist/commands/ds/render.js +88 -0
  14. package/dist/commands/ds/render.js.map +1 -0
  15. package/dist/commands/ds/types.d.ts +65 -0
  16. package/dist/commands/ds/types.js +31 -0
  17. package/dist/commands/ds/types.js.map +1 -0
  18. package/dist/commands/ds/ui-only.d.ts +15 -0
  19. package/dist/commands/ds/ui-only.js +29 -0
  20. package/dist/commands/ds/ui-only.js.map +1 -0
  21. package/dist/commands/ds-config.d.ts +1 -0
  22. package/dist/commands/ds-config.js +25 -2
  23. package/dist/commands/ds-config.js.map +1 -1
  24. package/dist/commands/ds.js +10 -355
  25. package/dist/commands/ds.js.map +1 -1
  26. package/dist/commands/kb-create.js +11 -6
  27. package/dist/commands/kb-create.js.map +1 -1
  28. package/dist/commands/kb-delete.js +10 -2
  29. package/dist/commands/kb-delete.js.map +1 -1
  30. package/dist/commands/kb-read.js +6 -2
  31. package/dist/commands/kb-read.js.map +1 -1
  32. package/dist/commands/kb-shared.d.ts +16 -1
  33. package/dist/commands/kb-shared.js +28 -0
  34. package/dist/commands/kb-shared.js.map +1 -1
  35. package/dist/commands/kb-update.js +11 -5
  36. package/dist/commands/kb-update.js.map +1 -1
  37. package/package.json +1 -1
  38. package/scripts/sync-plugin-marketplace.sh +134 -0
  39. package/skills/graphit/SKILL.md +7 -7
  40. package/skills/graphit/VERSION.json +1 -1
  41. package/skills/graphit/references/data-sources.md +8 -6
  42. package/skills/graphit/references/kb-discovery.md +1 -1
  43. package/skills/graphit/references/kb-scope.md +23 -0
  44. package/skills/graphit/references/kb-structure.md +3 -1
  45. package/skills/graphit/references/kb-traversal.md +1 -4
  46. package/skills/graphit/references/onboarding.md +12 -3
@@ -12,7 +12,7 @@ Work narrow, not broad: **domain -> data source -> assets.** The first move is a
12
12
  4. **Handle gaps.** If the domain's data source is missing something, check `graphit kb list relationships` for a connection to another data source you can join; if the data genuinely does not exist, propose creating the asset or a new data source (see below).
13
13
  5. **Broaden only as a fallback.** Use `graphit kb search "<concept>"` only when an exploration came up empty or the concept name is too fuzzy to match a domain or topic. Search is semantic (matches by meaning, ranked by a relevance `score`) merged with name/text matching, and capped by `--limit` - the result carries `total` and `truncated`. So an empty or unexpected result means *maybe ranked-out or truncated*, never proof an asset is absent: raise `--limit`, narrow `--type`, or confirm a specific name with `kb get` before concluding it doesn't exist. `graphit kb list` carries `total`/`truncated` too - fewer rows than `total` means the list was capped, not that assets are missing; raise `--limit`. (`graphit kb list domains` enumerates domain names when you need to pick one; it is a name lookup, not the asset-discovery path - explore the domain to see its assets.)
14
14
 
15
- If a domain has tables but no metrics or dimensions, that is the strongest signal to propose foundational assets before building any graph - this is the KB-readiness gate the build workflow enforces. If the user declines ("just build it", "skip KB"), respect it and work from the table schema - read it with `graphit kb explore table <NAME>`, which returns the columns (names, types, descriptions).
15
+ If a domain has tables but no metrics or dimensions, that is the strongest signal to propose foundational assets before building any graph - this is the KB-readiness gate the build workflow enforces. **Exception:** when a response carries `migration_incomplete: true`, the org's KB rows are mid-migration and invisible, so emptiness is not evidence of anything - report the migration state instead of proposing creation. If the user declines ("just build it", "skip KB"), respect it and work from the table schema - read its columns with `graphit kb explore table <NAME>`.
16
16
 
17
17
  ## Metric vs Dimension
18
18
 
@@ -0,0 +1,23 @@
1
+ # KB Scope: Who Will See It
2
+
3
+ Consult BEFORE creating or moving any KB asset, and whenever the user asks who can see something. A domain is not only a filing shelf, it is the access boundary, so choosing one is choosing an audience - and the choice is not freely reversible.
4
+
5
+ | Scope | Who reads it | Use it for |
6
+ |---|---|---|
7
+ | The org commons | Everyone in the organization. It always exists, cannot be deleted, and is where an org-wide asset belongs | Definitions the whole company shares, and anything with no narrower home |
8
+ | A shared business domain | Whoever has been granted it. `graphit status` shows the caller's own access, advisory only - the server decides | The normal case: work a team owns and reuses |
9
+ | A private space | Its owner alone. Invisible to everyone else, admins included, and shown simply as "Private" | Scratch work, or data someone is not ready to share |
10
+
11
+ **Settle the scope with the user before creating anything.** Ask which of these the work belongs in rather than inferring it, and say plainly what the choice means: work put in a private space will not appear for their team at all. Default to a shared domain (or the commons) for anything the team should be able to use.
12
+
13
+ If a create or update response carries a `visibility` notice, the asset landed where only its author can read it. Relay the notice, and if the user meant the work for their team, treat that as the moment to fix the scope - not a detail to skip past.
14
+
15
+ **It is not freely reversible**, which is why the question comes first:
16
+
17
+ - An asset whose DEFINITION reads a private table (a metric's dependencies, a synonym's canonical target, a relationship's tables, or a table's own home) is readable by its author alone. That is by design, and it stays that way.
18
+ - Redefining an ALREADY-SHARED asset onto a private table is refused, because it would remove a working asset from the team without telling them. Copy it into the private space instead and change the copy.
19
+ - ATTACHING a private table to a shared asset as a placement (a secondary table, a rule target, an extra domain) is fully supported: the asset stays shared and usable, and nobody else sees the private reference. This is the safe way to enrich a team asset with something personal.
20
+
21
+ **When a delete is refused over someone's private dependency.** Deleting a shared asset can be blocked because another member's PRIVATE asset depends on it. The refusal names the owners to go ask - never their assets - and that attribution is the point: relay who is named and suggest asking them first. `--force` on `kb delete` proceeds anyway (it is offered only when every hidden blocker has a named owner), and every named owner is notified of what was deleted, by whom, and what of theirs broke. Treat `--force` as the user's deliberate escalation: never add it on your own to get past a refusal.
22
+
23
+ Never read a private space's stored name aloud or invent one. Refer to it as the user's private space. To target it in a command, pass `--domain Private` - the alias always resolves to the caller's OWN space, so no spelling of it can reach anyone else's.
@@ -14,7 +14,7 @@ The KB is a labeled property graph: assets carry tags that place them in a tree,
14
14
  | synonym | Maps a business term to a canonical metric, dimension, or column |
15
15
  | table | Physical data location in the warehouse, with typed columns |
16
16
  | topic | Business-concept tag applied to assets (e.g., REVENUE, ACQUISITION) |
17
- | domain | High-level business area (e.g., MARKETING, SALES, PRODUCT) |
17
+ | domain | High-level business area (e.g., MARKETING, SALES, PRODUCT), and the boundary that decides who can see what sits in it |
18
18
  | relationship | Documented JOIN pattern between two tables |
19
19
  | memory | Org-level context notes, always global scope |
20
20
 
@@ -42,6 +42,8 @@ Other placements layered on top:
42
42
 
43
43
  Domains are coarse and few (broad business areas); topics are finer and more numerous. A single domain like MARKETING typically spans topics such as ACQUISITION, ATTRIBUTION, and CAMPAIGN_PERFORMANCE.
44
44
 
45
+ A domain is also the access boundary: it decides who can see what sits in it. Settle that with the user before creating anything - see kb-scope.md.
46
+
45
47
  ## Tree Rendering Order
46
48
 
47
49
  The default tree renders Domain > Table > Topic > Asset, with each table under its one home domain. This is a visualization choice; the model also supports Topic > Table or a flat list. When the user asks "where is X?", an asset lives under its primary table's home domain - report that, plus any domains from its `secondary_tables` placements and its topics.
@@ -37,11 +37,8 @@ Which `graphit kb` read command answers each question, and how to present the re
37
37
  ### "What topics does ARPU_D1 belong to?"
38
38
  `graphit kb explore metric ARPU_D1` - the response includes its topics, along with its tables, dimensions, and home domain.
39
39
 
40
- ### "What's left uncategorized?"
41
- `graphit kb explore domain Uncategorized` - returns the tables with no home domain and their assets.
42
-
43
40
  ### "What domains do we have?" (enumerate names)
44
- `graphit kb list domains` - returns every domain with its description and asset count, plus an "Uncategorized" entry when tables have no domain. Report all of them, including empty ones. This enumerates domain NAMES; to see what is in one, explore it. Domain is not a searchable type, so `graphit kb search` will not surface domains.
41
+ `graphit kb list domains` - returns every domain with its description and asset count. Report all of them, including empty ones. This enumerates domain NAMES; to see what is in one, explore it. Domain is not a searchable type, so `graphit kb search` will not surface domains.
45
42
 
46
43
  ## Presenting KB Results
47
44
 
@@ -23,7 +23,7 @@ Two ways in. Lead with the warehouse; offer the file as the lighter path.
23
23
  - Snowflake keypair from the CLI: `graphit connector add snowflake-keypair` needs `--account --user --key --warehouse --role --database` (all required), plus optional `--name` for a friendly label (it defaults to `Snowflake (<account>)`). It validates the connection before saving, so a success really did connect.
24
24
  - OAuth and GitHub connections are set up in the Graphit web app, not the CLI - name that handoff when it applies.
25
25
 
26
- **File (lighter).** For a quick start with no warehouse, `graphit ds create --file ./data.csv` uploads a CSV or Excel file and creates a data source directly - no connector needed.
26
+ **File (lighter).** For a quick start with no warehouse, `graphit ds create --file ./data.csv --domain <NAME>` uploads a CSV or Excel file and creates a data source directly - no connector needed.
27
27
 
28
28
  Present the outcome: which connection is live, or the exact web-app / admin step the user has to finish.
29
29
 
@@ -33,10 +33,19 @@ Before creating anything, ask what business question the user wants to answer. T
33
33
 
34
34
  ## 3. Create the data source
35
35
 
36
- Explain that answering the question fast needs a cached data source over the connection, not repeated live-warehouse queries. Create it, then activate it:
36
+ Explain that answering the question fast needs a cached data source over the connection, not repeated live-warehouse queries.
37
+
38
+ **A domain comes first.** Every data source is created inside a KB domain - it is what makes the source findable and grantable, and there is no uncategorized fallback. A brand-new workspace has only the org-wide commons, so check with `graphit kb list domains` and, if the user's work deserves its own area, agree a name and create it before the source:
39
+
40
+ ```bash
41
+ graphit kb list domains
42
+ graphit kb create domain --name MARKETING --description "Acquisition and spend"
43
+ ```
44
+
45
+ Then create the source and activate it:
37
46
 
38
47
  ```bash
39
- graphit ds create --name "MY_DS" --sql "SELECT ..." --connection <id>
48
+ graphit ds create --name "MY_DS" --domain MARKETING --sql "SELECT ..." --connection <id>
40
49
  graphit ds verify <id> --accept-schema
41
50
  ```
42
51