@graphit/cli 0.2.321 → 0.2.323
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/api/client.js +15 -0
- package/dist/api/client.js.map +1 -1
- package/dist/commands/ds-config.js +2 -2
- package/dist/commands/ds-config.js.map +1 -1
- package/dist/commands/ds.js +2 -2
- package/dist/commands/ds.js.map +1 -1
- package/dist/commands/kb.js +347 -15
- package/dist/commands/kb.js.map +1 -1
- package/dist/commands/query.js +3 -3
- package/dist/commands/query.js.map +1 -1
- package/dist/skill-guard.js +2 -1
- package/dist/skill-guard.js.map +1 -1
- package/package.json +1 -1
- package/scripts/verb-policy-source.json +30 -102
- package/skills/graphit/SKILL.md +31 -39
- package/skills/graphit/VERSION.json +1 -1
- package/skills/graphit/references/data-source-refresh.md +27 -0
- package/skills/graphit/references/data-sources.md +27 -122
- package/skills/graphit/references/filters-advanced.md +2 -2
- package/skills/graphit/references/governance-explained.md +18 -29
- package/skills/graphit/references/governance.md +20 -83
- package/skills/graphit/references/kb-actions.md +28 -81
- package/skills/graphit/references/kb-discovery.md +35 -64
- package/skills/graphit/references/kb-scope.md +17 -15
- package/skills/graphit/references/kb-structure.md +28 -54
- package/skills/graphit/references/kb-traversal.md +24 -96
- package/skills/graphit/references/metric-families.md +19 -0
- package/skills/graphit/references/migration.md +2 -2
- package/skills/graphit/references/onboarding.md +5 -4
- package/skills/graphit/references/presentations.md +1 -1
- package/skills/graphit/references/runtime.md +6 -6
- package/skills/graphit/references/semantic-authoring.md +65 -0
- package/skills/graphit/references/sql-reference.md +10 -20
- package/dist/commands/kb-constraints.d.ts +0 -14
- package/dist/commands/kb-constraints.js +0 -53
- package/dist/commands/kb-constraints.js.map +0 -1
- package/dist/commands/kb-create.d.ts +0 -2
- package/dist/commands/kb-create.js +0 -296
- package/dist/commands/kb-create.js.map +0 -1
- package/dist/commands/kb-delete.d.ts +0 -2
- package/dist/commands/kb-delete.js +0 -37
- package/dist/commands/kb-delete.js.map +0 -1
- package/dist/commands/kb-read.d.ts +0 -2
- package/dist/commands/kb-read.js +0 -223
- package/dist/commands/kb-read.js.map +0 -1
- package/dist/commands/kb-shared.d.ts +0 -43
- package/dist/commands/kb-shared.js +0 -81
- package/dist/commands/kb-shared.js.map +0 -1
- package/dist/commands/kb-update.d.ts +0 -2
- package/dist/commands/kb-update.js +0 -240
- package/dist/commands/kb-update.js.map +0 -1
- package/skills/graphit/references/parameterized-metrics.md +0 -77
package/dist/commands/kb-read.js
DELETED
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
import { apiClient } from "../api/client.js";
|
|
2
|
-
import { output, errorOutput, getOutputFormat, note } from "../output/format.js";
|
|
3
|
-
import { styledIntro, styledOutro, styledInfo, styledMessage, styledTable, styledNote, styledWarn, formatBold, } from "../output/styled.js";
|
|
4
|
-
import { ENTITY_COLUMNS, MIGRATION_INCOMPLETE_WARNING, KB_ARG_TYPE, KB_ARG_NAME, } from "./kb-shared.js";
|
|
5
|
-
// Project #254 Phase 1: kb read verbs (list/get/search/explore/usage/verify/unverify).
|
|
6
|
-
export function addKBReadCommands(kb) {
|
|
7
|
-
kb.command("list")
|
|
8
|
-
.argument("<type>", KB_ARG_TYPE)
|
|
9
|
-
.description("List KB entities (metric, dimension, table, rule, domain, synonym) - the inventory verb. " +
|
|
10
|
-
"Parameterized metrics are collapsed: each template shows a variant_count, child variants are hidden. " +
|
|
11
|
-
"Use --include-variants for the full flat set, kb explore metric <name> to enumerate one template's variants, " +
|
|
12
|
-
"kb get for the full definition. The response carries total/truncated, so fewer rows than total means raise --limit.")
|
|
13
|
-
.option("--limit <n>", "Max rows to return; the response carries total/truncated so a short list means raise this", "50")
|
|
14
|
-
.option("--verified", "Only verified entities")
|
|
15
|
-
.option("--unverified", "Only unverified entities")
|
|
16
|
-
.option("--include-variants", "metric: expand parameterized child variants instead of collapsing them under their template")
|
|
17
|
-
.action(async function (type) {
|
|
18
|
-
try {
|
|
19
|
-
const opts = this.opts();
|
|
20
|
-
const fmt = getOutputFormat(this);
|
|
21
|
-
const params = new URLSearchParams({ limit: opts.limit });
|
|
22
|
-
if (opts.verified)
|
|
23
|
-
params.set("verified", "true");
|
|
24
|
-
if (opts.unverified)
|
|
25
|
-
params.set("verified", "false");
|
|
26
|
-
if (opts.includeVariants)
|
|
27
|
-
params.set("include_variants", "true");
|
|
28
|
-
const resp = await apiClient.get(`/api/v1/cli/kb/${type}?${params}`);
|
|
29
|
-
let entities = resp.entities;
|
|
30
|
-
if (type === "metric") {
|
|
31
|
-
entities = entities.map((e) => {
|
|
32
|
-
const calc = e.calculation || "";
|
|
33
|
-
const paramMatches = calc.match(/\$\{PARAM:(\w+)\}/g);
|
|
34
|
-
return { ...e, params: paramMatches ? paramMatches.map((m) => m.replace(/\$\{PARAM:|}/g, "")).join(", ") : "" };
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
if (fmt === "styled") {
|
|
38
|
-
styledIntro(`graphit kb list ${type}`);
|
|
39
|
-
styledInfo(`${resp.count} ${type}${resp.count !== 1 ? "s" : ""}`);
|
|
40
|
-
const cols = ENTITY_COLUMNS[type] ?? Object.keys(entities[0] ?? {});
|
|
41
|
-
const displayCols = cols.filter((c) => c !== "id");
|
|
42
|
-
const tableRows = entities.map((e) => displayCols.map((c) => c === "name" || c === "term"
|
|
43
|
-
? formatBold(String(e[c] ?? ""))
|
|
44
|
-
: String(e[c] ?? "")));
|
|
45
|
-
if (tableRows.length) {
|
|
46
|
-
styledMessage(styledTable(displayCols, tableRows));
|
|
47
|
-
}
|
|
48
|
-
if (resp.truncated) {
|
|
49
|
-
styledNote(`Showing ${resp.count} of ${resp.total} - raise --limit to see the rest.`, "Truncated");
|
|
50
|
-
}
|
|
51
|
-
if (resp.migration_incomplete)
|
|
52
|
-
styledWarn(MIGRATION_INCOMPLETE_WARNING);
|
|
53
|
-
styledOutro();
|
|
54
|
-
}
|
|
55
|
-
else if (getOutputFormat(this) === "json") {
|
|
56
|
-
// json: emit the full envelope (count/total/truncated) with the
|
|
57
|
-
// enriched entities - the bare array dropped the completeness
|
|
58
|
-
// signal this command's own --help promises.
|
|
59
|
-
output(this, { ...resp, entities });
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
output(this, entities, { columns: ENTITY_COLUMNS[type] });
|
|
63
|
-
if (resp.truncated) {
|
|
64
|
-
note(`Showing ${resp.count} of ${resp.total} ${type}s - raise --limit to see the rest (a missing asset may be truncated, not absent).`);
|
|
65
|
-
}
|
|
66
|
-
if (resp.migration_incomplete)
|
|
67
|
-
note(MIGRATION_INCOMPLETE_WARNING);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
catch (err) {
|
|
71
|
-
errorOutput(err);
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
kb.command("get")
|
|
75
|
-
.argument("<type>", KB_ARG_TYPE)
|
|
76
|
-
.argument("<name>", KB_ARG_NAME)
|
|
77
|
-
.description("Get a KB entity by name")
|
|
78
|
-
.action(async function (type, name) {
|
|
79
|
-
try {
|
|
80
|
-
const resp = await apiClient.get(`/api/v1/cli/kb/${type}/by-name/${encodeURIComponent(name)}`);
|
|
81
|
-
output(this, resp.entity, { keyValue: true });
|
|
82
|
-
}
|
|
83
|
-
catch (err) {
|
|
84
|
-
errorOutput(err);
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
kb.command("search")
|
|
88
|
-
.argument("<query>", "Search text - matched against asset names, descriptions and SQL")
|
|
89
|
-
.description("Semantic + substring search across KB assets, ranked by relevance")
|
|
90
|
-
.option("--type <type>", "Filter by entity type")
|
|
91
|
-
.option("--limit <n>", "Max rows to return; the response carries total/truncated so a short list means raise this", "50")
|
|
92
|
-
.action(async function (query) {
|
|
93
|
-
try {
|
|
94
|
-
const opts = this.opts();
|
|
95
|
-
const params = new URLSearchParams({ q: query, limit: opts.limit });
|
|
96
|
-
if (opts.type)
|
|
97
|
-
params.set("type", opts.type);
|
|
98
|
-
const resp = await apiClient.get(`/api/v1/cli/kb/search?${params}`);
|
|
99
|
-
// json (default): emit the full payload so callers see count/total/truncated
|
|
100
|
-
// (a miss may be truncation, not absence). table: clean rows + a stderr note.
|
|
101
|
-
if (getOutputFormat(this) === "json") {
|
|
102
|
-
output(this, resp);
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
output(this, resp.results, { columns: ["score", "type", "name", "description"] });
|
|
106
|
-
if (resp.truncated) {
|
|
107
|
-
note(`Showing ${resp.count} of ${resp.total} matches - narrow with --type or raise --limit (max 100).`);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
catch (err) {
|
|
112
|
-
errorOutput(err);
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
kb.command("explore")
|
|
116
|
-
.argument("<type>", KB_ARG_TYPE)
|
|
117
|
-
.argument("<name>", KB_ARG_NAME)
|
|
118
|
-
.description("Traverse the KB graph - the relationships verb. metric: tables, dimensions, parameters + its concrete variants; " +
|
|
119
|
-
"table/domain/topic: every bound metric (collapsed, with variant_count), dimension and rule plus counts. " +
|
|
120
|
-
"Use this for what's bound to a table X or show me this template's variants.")
|
|
121
|
-
.action(async function (type, name) {
|
|
122
|
-
try {
|
|
123
|
-
const resp = await apiClient.get(`/api/v1/cli/kb/explore/${type}/${encodeURIComponent(name)}`);
|
|
124
|
-
output(this, resp, { keyValue: true });
|
|
125
|
-
}
|
|
126
|
-
catch (err) {
|
|
127
|
-
errorOutput(err);
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
kb.command("usage")
|
|
131
|
-
.argument("[type]", KB_ARG_TYPE)
|
|
132
|
-
.argument("[name]", KB_ARG_NAME)
|
|
133
|
-
.description("Reverse lookup: which custom dashboards present a metric, use a dimension, or enforce a rule. " +
|
|
134
|
-
"[type] [name] = primary facet; --metric/--dimension/--rule AND together. Governed macros only - raw SQL invisible.")
|
|
135
|
-
.option("--metric <name>", "Filter to entities presenting this metric")
|
|
136
|
-
.option("--dimension <name>", "Filter to entities using this dimension")
|
|
137
|
-
.option("--rule <name>", "Filter to entities where this rule is enforced")
|
|
138
|
-
.action(async function (type, name) {
|
|
139
|
-
try {
|
|
140
|
-
const opts = this.opts();
|
|
141
|
-
const facets = {
|
|
142
|
-
metric: opts.metric,
|
|
143
|
-
dimension: opts.dimension,
|
|
144
|
-
rule: opts.rule,
|
|
145
|
-
};
|
|
146
|
-
// Positional <type> <name> sets the primary facet (flags take precedence).
|
|
147
|
-
if (type && name) {
|
|
148
|
-
const t = type.toLowerCase();
|
|
149
|
-
if (t === "metric" || t === "dimension" || t === "rule") {
|
|
150
|
-
facets[t] = facets[t] ?? name;
|
|
151
|
-
}
|
|
152
|
-
else {
|
|
153
|
-
errorOutput(new Error(`Unknown usage type '${type}'. Use metric, dimension, or rule.`));
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
const params = new URLSearchParams();
|
|
158
|
-
if (facets.metric)
|
|
159
|
-
params.set("metric", facets.metric);
|
|
160
|
-
if (facets.dimension)
|
|
161
|
-
params.set("dimension", facets.dimension);
|
|
162
|
-
if (facets.rule)
|
|
163
|
-
params.set("rule", facets.rule);
|
|
164
|
-
if ([...params.keys()].length === 0) {
|
|
165
|
-
errorOutput(new Error("Provide a facet: usage <metric|dimension|rule> <name>, or --metric/--dimension/--rule."));
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
const resp = await apiClient.get(`/api/v1/cli/kb/usage?${params}`);
|
|
169
|
-
if (getOutputFormat(this) === "json") {
|
|
170
|
-
output(this, resp);
|
|
171
|
-
}
|
|
172
|
-
else {
|
|
173
|
-
const rows = resp.used_in.map((h) => ({
|
|
174
|
-
dashboard: h.dashboard_name,
|
|
175
|
-
entity: h.entity_id,
|
|
176
|
-
label: h.label,
|
|
177
|
-
metrics: h.metrics.join(", "),
|
|
178
|
-
dimensions: h.dimensions.join(", "),
|
|
179
|
-
rules: h.rules.map((r) => r.name).join(", "),
|
|
180
|
-
}));
|
|
181
|
-
output(this, rows, {
|
|
182
|
-
columns: ["dashboard", "entity", "label", "metrics", "dimensions", "rules"],
|
|
183
|
-
});
|
|
184
|
-
if (resp.subject) {
|
|
185
|
-
const s = resp.subject;
|
|
186
|
-
note(`${s.name} (${s.type}${s.home_table ? ` on ${s.home_table}` : ""})` +
|
|
187
|
-
(s.expression ? `: ${s.expression}` : ""));
|
|
188
|
-
}
|
|
189
|
-
note(`Presented in ${resp.dashboard_count} dashboard(s), ${resp.hit_count} chart(s).`);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
catch (err) {
|
|
193
|
-
errorOutput(err);
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
kb.command("verify")
|
|
197
|
-
.argument("<type>", KB_ARG_TYPE)
|
|
198
|
-
.argument("<name>", KB_ARG_NAME)
|
|
199
|
-
.description("Verify a KB asset by name; metric templates cascade to all variants")
|
|
200
|
-
.action(async function (type, name) {
|
|
201
|
-
try {
|
|
202
|
-
const resp = await apiClient.post(`/api/v1/cli/kb/${encodeURIComponent(type)}/${encodeURIComponent(name)}/verify`, {});
|
|
203
|
-
output(this, resp, { keyValue: true });
|
|
204
|
-
}
|
|
205
|
-
catch (err) {
|
|
206
|
-
errorOutput(err);
|
|
207
|
-
}
|
|
208
|
-
});
|
|
209
|
-
kb.command("unverify")
|
|
210
|
-
.argument("<type>", KB_ARG_TYPE)
|
|
211
|
-
.argument("<name>", KB_ARG_NAME)
|
|
212
|
-
.description("Unverify a KB asset (mark as draft); cascades to metric variants")
|
|
213
|
-
.action(async function (type, name) {
|
|
214
|
-
try {
|
|
215
|
-
const resp = await apiClient.post(`/api/v1/cli/kb/${encodeURIComponent(type)}/${encodeURIComponent(name)}/verify?unverify=true`, {});
|
|
216
|
-
output(this, resp, { keyValue: true });
|
|
217
|
-
}
|
|
218
|
-
catch (err) {
|
|
219
|
-
errorOutput(err);
|
|
220
|
-
}
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
//# sourceMappingURL=kb-read.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kb-read.js","sourceRoot":"","sources":["../../src/commands/kb-read.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EACL,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EACnD,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,GAChD,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAC0B,cAAc,EAAE,4BAA4B,EAC3E,WAAW,EAAE,WAAW,GACzB,MAAM,gBAAgB,CAAC;AAExB,uFAAuF;AAEvF,MAAM,UAAU,iBAAiB,CAAC,EAAW;IAC3C,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC;SACf,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;SAC/B,WAAW,CACV,2FAA2F;QACzF,uGAAuG;QACvG,+GAA+G;QAC/G,qHAAqH,CACxH;SACA,MAAM,CAAC,aAAa,EAAE,2FAA2F,EAAE,IAAI,CAAC;SACxH,MAAM,CAAC,YAAY,EAAE,wBAAwB,CAAC;SAC9C,MAAM,CAAC,cAAc,EAAE,0BAA0B,CAAC;SAClD,MAAM,CAAC,oBAAoB,EAAE,6FAA6F,CAAC;SAC3H,MAAM,CAAC,KAAK,WAA0B,IAAY;QACjD,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;YACzB,MAAM,GAAG,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;YAClC,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,EAAE,KAAK,EA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BAAkB,CAAC,IAAI,CAAC,IAAI,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAC/E,EAAE,CACH,CAAC;YACF,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;QACzC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,WAAW,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CAAC,CAAC;IAEL,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC;SACnB,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;SAC/B,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;SAC/B,WAAW,CAAC,kEAAkE,CAAC;SAC/E,MAAM,CAAC,KAAK,WAA0B,IAAY,EAAE,IAAY;QAC/D,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,IAAI,CAC/B,kBAAkB,kBAAkB,CAAC,IAAI,CAAC,IAAI,kBAAkB,CAAC,IAAI,CAAC,uBAAuB,EAC7F,EAAE,CACH,CAAC;YACF,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;QACzC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,WAAW,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Command } from "commander";
|
|
2
|
-
export declare const KB_ARG_TYPE: string;
|
|
3
|
-
export declare const KB_ARG_NAME = "Entity name (UPPER_SNAKE_CASE), as returned by kb list or kb search";
|
|
4
|
-
export declare const KB_ARG_TERM = "Synonym term (UPPER_SNAKE_CASE), as returned by kb list synonym";
|
|
5
|
-
export interface KBListResponse {
|
|
6
|
-
entity_type: string;
|
|
7
|
-
count: number;
|
|
8
|
-
total?: number;
|
|
9
|
-
truncated?: boolean;
|
|
10
|
-
entities: Record<string, unknown>[];
|
|
11
|
-
migration_incomplete?: boolean;
|
|
12
|
-
}
|
|
13
|
-
export interface KBVisibilityNotice {
|
|
14
|
-
scope: "private";
|
|
15
|
-
message: string;
|
|
16
|
-
}
|
|
17
|
-
export interface KBWriteResponse {
|
|
18
|
-
entity: Record<string, unknown>;
|
|
19
|
-
visibility?: KBVisibilityNotice;
|
|
20
|
-
}
|
|
21
|
-
export interface KBCreateResponse extends KBWriteResponse {
|
|
22
|
-
validation?: {
|
|
23
|
-
status: string;
|
|
24
|
-
sample_query?: string;
|
|
25
|
-
sample_data?: Record<string, unknown>[];
|
|
26
|
-
sample_columns?: string[];
|
|
27
|
-
warnings?: string[];
|
|
28
|
-
skip_reason?: string;
|
|
29
|
-
display_instruction?: string;
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
export interface KBGetResponse {
|
|
33
|
-
entity: Record<string, unknown>;
|
|
34
|
-
}
|
|
35
|
-
export declare const ENTITY_COLUMNS: Record<string, string[]>;
|
|
36
|
-
export declare const MIGRATION_INCOMPLETE_WARNING: string;
|
|
37
|
-
export declare function renderVisibility(cmd: Command, resp: {
|
|
38
|
-
visibility?: KBVisibilityNotice;
|
|
39
|
-
}): void;
|
|
40
|
-
export declare function withVisibility(cmd: Command, out: Record<string, unknown>, resp: {
|
|
41
|
-
visibility?: KBVisibilityNotice;
|
|
42
|
-
}): Record<string, unknown>;
|
|
43
|
-
export declare function renderValidation(cmd: Command, resp: KBCreateResponse): void;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { getOutputFormat } from "../output/format.js";
|
|
2
|
-
import { styledSuccess, styledInfo, styledMessage, styledWarn, styledNote, styledTable, } from "../output/styled.js";
|
|
3
|
-
import chalk from "chalk";
|
|
4
|
-
// Shared types + helpers for the kb command group.
|
|
5
|
-
// Project #254 Phase 1: extracted from kb.ts so each verb group (read/create/
|
|
6
|
-
// update/delete) lives in its own file under the 800L cap.
|
|
7
|
-
// Project #275: positional arguments carry descriptions because the same
|
|
8
|
-
// Commander metadata that renders `--help` also generates the platform agent's
|
|
9
|
-
// tool parameter schemas - an argument with no description reaches the model as
|
|
10
|
-
// a bare `{"type": "string"}` it has to guess at. Shared constants because the
|
|
11
|
-
// argument means the same thing on all ~20 kb verbs; one edit moves them all.
|
|
12
|
-
export const KB_ARG_TYPE = "KB entity type - metric, dimension, table, rule, domain, topic, synonym or relationship " +
|
|
13
|
-
"(each verb's description names the subset it accepts)";
|
|
14
|
-
export const KB_ARG_NAME = "Entity name (UPPER_SNAKE_CASE), as returned by kb list or kb search";
|
|
15
|
-
export const KB_ARG_TERM = "Synonym term (UPPER_SNAKE_CASE), as returned by kb list synonym";
|
|
16
|
-
export const ENTITY_COLUMNS = {
|
|
17
|
-
metric: ["id", "name", "description", "calculation", "params", "variant_count", "verified"],
|
|
18
|
-
dimension: ["id", "name", "description", "expression", "verified"],
|
|
19
|
-
table: ["id", "name", "description", "verified"],
|
|
20
|
-
rule: ["id", "name", "description", "verified"],
|
|
21
|
-
domain: ["id", "name", "description", "color"],
|
|
22
|
-
synonym: ["id", "term", "canonical", "canonical_type", "description"],
|
|
23
|
-
template: ["id", "name", "description", "chart_types"],
|
|
24
|
-
relationship: ["id", "name", "primary_table", "primary_column", "description"],
|
|
25
|
-
topic: ["id", "name", "description", "verified"],
|
|
26
|
-
};
|
|
27
|
-
// An empty list is normally trustworthy. This one is not: the organization holds
|
|
28
|
-
// assets that never finished migrating, and until that completes they are
|
|
29
|
-
// invisible to everyone, administrators included. Said loudly because the failure
|
|
30
|
-
// it replaces was silent - the same "0 of 0" a genuinely empty organization gets.
|
|
31
|
-
export const MIGRATION_INCOMPLETE_WARNING = "This organization has knowledge base assets that have not finished migrating. " +
|
|
32
|
-
"They are invisible to everyone, including administrators, so this empty result " +
|
|
33
|
-
"is NOT evidence the knowledge base is empty. Ask an administrator to complete " +
|
|
34
|
-
"the domain backfill before acting on it.";
|
|
35
|
-
// The write said nothing about who would ever read the asset. A metric defined
|
|
36
|
-
// on a table only its author can see comes back `verified: true`, which reads as
|
|
37
|
-
// "you gave your team a governed metric" - so say otherwise, on every write verb.
|
|
38
|
-
// The server owns the wording; repeating it here would let the two drift.
|
|
39
|
-
export function renderVisibility(cmd, resp) {
|
|
40
|
-
if (!resp.visibility)
|
|
41
|
-
return;
|
|
42
|
-
if (getOutputFormat(cmd) === "styled") {
|
|
43
|
-
styledWarn(resp.visibility.message);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
// Fold the notice into the machine-readable body - what a `--json` caller and
|
|
47
|
-
// the agent read. Skipped under `styled`, where `renderVisibility` has already
|
|
48
|
-
// printed it and folding would say the same thing twice.
|
|
49
|
-
export function withVisibility(cmd, out, resp) {
|
|
50
|
-
if (resp.visibility && getOutputFormat(cmd) !== "styled") {
|
|
51
|
-
out.visibility = resp.visibility;
|
|
52
|
-
}
|
|
53
|
-
return out;
|
|
54
|
-
}
|
|
55
|
-
export function renderValidation(cmd, resp) {
|
|
56
|
-
const fmt = getOutputFormat(cmd);
|
|
57
|
-
const v = resp.validation;
|
|
58
|
-
if (!v)
|
|
59
|
-
return;
|
|
60
|
-
if (fmt === "styled") {
|
|
61
|
-
if (v.status === "pass") {
|
|
62
|
-
styledSuccess("Validated against real data");
|
|
63
|
-
if (v.sample_query) {
|
|
64
|
-
styledNote(chalk.dim(v.sample_query), "Validation SQL");
|
|
65
|
-
}
|
|
66
|
-
if (v.sample_data?.length && v.sample_columns?.length) {
|
|
67
|
-
const cols = v.sample_columns;
|
|
68
|
-
const rows = v.sample_data.map((r) => cols.map((c) => String(r[c] ?? "")));
|
|
69
|
-
styledMessage(styledTable(cols, rows));
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
else if (v.status === "skipped") {
|
|
73
|
-
styledInfo(`Validation skipped: ${v.skip_reason ?? "unknown reason"}`);
|
|
74
|
-
}
|
|
75
|
-
if (v.warnings?.length) {
|
|
76
|
-
for (const w of v.warnings)
|
|
77
|
-
styledWarn(w);
|
|
78
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AC,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;YACxB,aAAa,CAAC,6BAA6B,CAAC,CAAC;YAC7C,IAAI,CAAC,CAAC,YAAY,EAAE,CAAC;gBACnB,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,EAAE,gBAAgB,CAAC,CAAC;YAC1D,CAAC;YACD,IAAI,CAAC,CAAC,WAAW,EAAE,MAAM,IAAI,CAAC,CAAC,cAAc,EAAE,MAAM,EAAE,CAAC;gBACtD,MAAM,IAAI,GAAG,CAAC,CAAC,cAAc,CAAC;gBAC9B,MAAM,IAAI,GAAG,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;gBAC3E,aAAa,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;YACzC,CAAC;QACH,CAAC;aAAM,IAAI,CAAC,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YAClC,UAAU,CAAC,uBAAuB,CAAC,CAAC,WAAW,IAAI,gBAAgB,EAAE,CAAC,CAAC;QACzE,CAAC;QACD,IAAI,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;YACvB,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ;gBAAE,UAAU,CAAC,CAAC,CAAC,CAAC;QAC5C,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
import { readFile } from "node:fs/promises";
|
|
2
|
-
import { apiClient } from "../api/client.js";
|
|
3
|
-
import { output, errorOutput } from "../output/format.js";
|
|
4
|
-
import { parseConstraintFlags, parseApplyOnFlags } from "./kb-constraints.js";
|
|
5
|
-
import { renderVisibility, withVisibility, KB_ARG_NAME, KB_ARG_TERM, } from "./kb-shared.js";
|
|
6
|
-
// Project #254 Phase 1: kb update verbs (metric/dimension/rule/template/table/
|
|
7
|
-
// domain/synonym/relationship/topic). Null fields are left unchanged server-side.
|
|
8
|
-
export function addKBUpdateCommands(kb) {
|
|
9
|
-
const update = kb.command("update").description("Update KB entities");
|
|
10
|
-
update
|
|
11
|
-
.command("metric")
|
|
12
|
-
.argument("<name>", KB_ARG_NAME)
|
|
13
|
-
.description("Update a metric.")
|
|
14
|
-
.option("--sql <expr>", "New SQL calculation")
|
|
15
|
-
.option("--table <table>", "New primary table")
|
|
16
|
-
.option("--description <desc>", "New description")
|
|
17
|
-
.option("--topics <topics>", "Comma-separated topic names (replaces existing)")
|
|
18
|
-
.option("--default-dimensions <dims>", "Comma-separated dimension names (replaces existing)")
|
|
19
|
-
.option("--secondary-tables <tables>", "Comma-separated secondary table names (replaces existing)")
|
|
20
|
-
.option("--parameters <json>", "JSON array of parameter definitions (replaces existing)")
|
|
21
|
-
.option("--parameters-file <path>", "Read parameters JSON from file")
|
|
22
|
-
.action(async function (name) {
|
|
23
|
-
try {
|
|
24
|
-
const opts = this.opts();
|
|
25
|
-
const topics = opts.topics !== undefined ? opts.topics.split(",").map((s) => s.trim()).filter(Boolean) : undefined;
|
|
26
|
-
const defaultDimensions = opts.defaultDimensions !== undefined ? opts.defaultDimensions.split(",").map((s) => s.trim()).filter(Boolean) : undefined;
|
|
27
|
-
const secondaryTables = opts.secondaryTables !== undefined ? opts.secondaryTables.split(",").map((s) => s.trim()).filter(Boolean) : undefined;
|
|
28
|
-
let parameters;
|
|
29
|
-
if (opts.parametersFile) {
|
|
30
|
-
parameters = JSON.parse(await readFile(opts.parametersFile, "utf-8"));
|
|
31
|
-
}
|
|
32
|
-
else if (opts.parameters) {
|
|
33
|
-
parameters = JSON.parse(opts.parameters);
|
|
34
|
-
}
|
|
35
|
-
const resp = await apiClient.put(`/api/v1/cli/kb/metric/${encodeURIComponent(name)}`, {
|
|
36
|
-
calculation: opts.sql ?? null,
|
|
37
|
-
table: opts.table ?? null,
|
|
38
|
-
description: opts.description ?? null,
|
|
39
|
-
topics: topics ?? null,
|
|
40
|
-
default_dimensions: defaultDimensions ?? null,
|
|
41
|
-
secondary_tables: secondaryTables ?? null,
|
|
42
|
-
parameters: parameters ?? null,
|
|
43
|
-
});
|
|
44
|
-
renderVisibility(this, resp);
|
|
45
|
-
output(this, withVisibility(this, { ...resp.entity }, resp), { keyValue: true });
|
|
46
|
-
}
|
|
47
|
-
catch (err) {
|
|
48
|
-
errorOutput(err);
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
update
|
|
52
|
-
.command("dimension")
|
|
53
|
-
.argument("<name>", KB_ARG_NAME)
|
|
54
|
-
.description("Update a dimension.")
|
|
55
|
-
.option("--expr <expr>", "New SQL expression")
|
|
56
|
-
.option("--table <table>", "New primary table")
|
|
57
|
-
.option("--description <desc>", "New description")
|
|
58
|
-
.option("--topics <topics>", "Comma-separated topic names (replaces existing)")
|
|
59
|
-
.option("--secondary-tables <tables>", "Comma-separated secondary table names (replaces existing)")
|
|
60
|
-
.action(async function (name) {
|
|
61
|
-
try {
|
|
62
|
-
const opts = this.opts();
|
|
63
|
-
const topics = opts.topics !== undefined ? opts.topics.split(",").map((s) => s.trim()).filter(Boolean) : undefined;
|
|
64
|
-
const secondaryTables = opts.secondaryTables !== undefined ? opts.secondaryTables.split(",").map((s) => s.trim()).filter(Boolean) : undefined;
|
|
65
|
-
const resp = await apiClient.put(`/api/v1/cli/kb/dimension/${encodeURIComponent(name)}`, {
|
|
66
|
-
expression: opts.expr ?? null,
|
|
67
|
-
table: opts.table ?? null,
|
|
68
|
-
description: opts.description ?? null,
|
|
69
|
-
topics: topics ?? null,
|
|
70
|
-
secondary_tables: secondaryTables ?? null,
|
|
71
|
-
});
|
|
72
|
-
renderVisibility(this, resp);
|
|
73
|
-
output(this, withVisibility(this, { ...resp.entity }, resp), { keyValue: true });
|
|
74
|
-
}
|
|
75
|
-
catch (err) {
|
|
76
|
-
errorOutput(err);
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
update
|
|
80
|
-
.command("rule")
|
|
81
|
-
.argument("<name>", KB_ARG_NAME)
|
|
82
|
-
.description("Update a rule. Broadening a verified rule's targeting requires org admin.")
|
|
83
|
-
.option("--sql <expr>", "New rule content")
|
|
84
|
-
.option("--description <desc>", "New description")
|
|
85
|
-
.option("--topics <topics>", "Comma-separated topic names (replaces existing)")
|
|
86
|
-
.option("--constraint <spec...>", "Enforceable constraints (replaces existing)")
|
|
87
|
-
.option("--enforcement-mode <mode>", "Rule enforcement: advisory|always|conditional")
|
|
88
|
-
.option("--apply-on <targets...>", "What the rule governs (replaces existing). table:NAME governs whole table(s) and cascades to all their metrics/dimensions; metric:NAME / dimension:NAME governs only those assets. Cannot mix table + metric/dimension targets.")
|
|
89
|
-
.action(async function (name) {
|
|
90
|
-
try {
|
|
91
|
-
const opts = this.opts();
|
|
92
|
-
const topics = opts.topics !== undefined ? opts.topics.split(",").map((s) => s.trim()).filter(Boolean) : undefined;
|
|
93
|
-
const constraints = opts.constraint ? parseConstraintFlags(opts.constraint) : undefined;
|
|
94
|
-
const applyOn = opts.applyOn ? parseApplyOnFlags(opts.applyOn) : undefined;
|
|
95
|
-
const resp = await apiClient.put(`/api/v1/cli/kb/rule/${encodeURIComponent(name)}`, {
|
|
96
|
-
content: opts.sql ?? null,
|
|
97
|
-
description: opts.description ?? null,
|
|
98
|
-
topics: topics ?? null,
|
|
99
|
-
constraints: constraints ?? null,
|
|
100
|
-
enforcement_mode: opts.enforcementMode ?? null,
|
|
101
|
-
apply_on: applyOn ?? null,
|
|
102
|
-
});
|
|
103
|
-
renderVisibility(this, resp);
|
|
104
|
-
output(this, withVisibility(this, { ...resp.entity }, resp), { keyValue: true });
|
|
105
|
-
}
|
|
106
|
-
catch (err) {
|
|
107
|
-
errorOutput(err);
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
update
|
|
111
|
-
.command("template")
|
|
112
|
-
.argument("<name>", KB_ARG_NAME)
|
|
113
|
-
.description("Update a template")
|
|
114
|
-
.option("--render-code <code>", "New JS function body")
|
|
115
|
-
.option("--file <path>", "Read render code from a local file")
|
|
116
|
-
.option("--description <desc>", "New description")
|
|
117
|
-
.action(async function (name) {
|
|
118
|
-
try {
|
|
119
|
-
const opts = this.opts();
|
|
120
|
-
let renderCode = opts.renderCode ?? null;
|
|
121
|
-
if (opts.file) {
|
|
122
|
-
renderCode = await readFile(opts.file, "utf-8");
|
|
123
|
-
}
|
|
124
|
-
const resp = await apiClient.put(`/api/v1/cli/kb/template/${encodeURIComponent(name)}`, {
|
|
125
|
-
render_code: renderCode,
|
|
126
|
-
description: opts.description ?? null,
|
|
127
|
-
});
|
|
128
|
-
output(this, resp.entity, { keyValue: true });
|
|
129
|
-
}
|
|
130
|
-
catch (err) {
|
|
131
|
-
errorOutput(err);
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
update
|
|
135
|
-
.command("table")
|
|
136
|
-
.argument("<name>", KB_ARG_NAME)
|
|
137
|
-
.description("Update a table's description or domain")
|
|
138
|
-
.option("--description <desc>", "New description")
|
|
139
|
-
.option("--domain <domain_id>", "New domain ID")
|
|
140
|
-
.action(async function (name) {
|
|
141
|
-
try {
|
|
142
|
-
const opts = this.opts();
|
|
143
|
-
const resp = await apiClient.put(`/api/v1/cli/kb/table/${encodeURIComponent(name)}`, {
|
|
144
|
-
description: opts.description ?? null,
|
|
145
|
-
domain_id: opts.domain ?? null,
|
|
146
|
-
});
|
|
147
|
-
output(this, resp.entity, { keyValue: true });
|
|
148
|
-
}
|
|
149
|
-
catch (err) {
|
|
150
|
-
errorOutput(err);
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
update
|
|
154
|
-
.command("domain")
|
|
155
|
-
.argument("<name>", KB_ARG_NAME)
|
|
156
|
-
.description("Update a domain. --owner sets the governance owner (the person accountable for the domain and the fallback owner for its assets); pass an empty string to clear it.")
|
|
157
|
-
.option("--description <desc>", "New description")
|
|
158
|
-
.option("--color <hex>", "New hex color")
|
|
159
|
-
.option("--owner <user>", "Governance owner (email or user id); pass \"\" to clear")
|
|
160
|
-
.action(async function (name) {
|
|
161
|
-
try {
|
|
162
|
-
const opts = this.opts();
|
|
163
|
-
const resp = await apiClient.put(`/api/v1/cli/kb/domain/${encodeURIComponent(name)}`, {
|
|
164
|
-
description: opts.description ?? null,
|
|
165
|
-
color: opts.color ?? null,
|
|
166
|
-
owner: opts.owner ?? null,
|
|
167
|
-
});
|
|
168
|
-
output(this, resp.entity, { keyValue: true });
|
|
169
|
-
}
|
|
170
|
-
catch (err) {
|
|
171
|
-
errorOutput(err);
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
update
|
|
175
|
-
.command("synonym")
|
|
176
|
-
.argument("<term>", KB_ARG_TERM)
|
|
177
|
-
.description("Update a synonym")
|
|
178
|
-
.option("--canonical <name>", "New canonical asset name")
|
|
179
|
-
.option("--type <type>", "New canonical type: metric, column, or table")
|
|
180
|
-
.option("--description <desc>", "New description")
|
|
181
|
-
.action(async function (term) {
|
|
182
|
-
try {
|
|
183
|
-
const opts = this.opts();
|
|
184
|
-
const resp = await apiClient.put(`/api/v1/cli/kb/synonym/${encodeURIComponent(term)}`, {
|
|
185
|
-
canonical: opts.canonical ?? null,
|
|
186
|
-
canonical_type: opts.type ?? null,
|
|
187
|
-
description: opts.description ?? null,
|
|
188
|
-
});
|
|
189
|
-
renderVisibility(this, resp);
|
|
190
|
-
output(this, withVisibility(this, { ...resp.entity }, resp), { keyValue: true });
|
|
191
|
-
}
|
|
192
|
-
catch (err) {
|
|
193
|
-
errorOutput(err);
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
update
|
|
197
|
-
.command("relationship")
|
|
198
|
-
.argument("<name>", KB_ARG_NAME)
|
|
199
|
-
.description("Update a relationship")
|
|
200
|
-
.option("--description <desc>", "New description")
|
|
201
|
-
.option("--primary-table <table>", "New primary table")
|
|
202
|
-
.option("--primary-column <col>", "New primary column")
|
|
203
|
-
.option("--related-table <table>", "New related table")
|
|
204
|
-
.option("--related-column <col>", "New related column")
|
|
205
|
-
.action(async function (name) {
|
|
206
|
-
try {
|
|
207
|
-
const opts = this.opts();
|
|
208
|
-
const resp = await apiClient.put(`/api/v1/cli/kb/relationship/${encodeURIComponent(name)}`, {
|
|
209
|
-
description: opts.description ?? null,
|
|
210
|
-
primary_table: opts.primaryTable ?? null,
|
|
211
|
-
primary_column: opts.primaryColumn ?? null,
|
|
212
|
-
related_table: opts.relatedTable ?? null,
|
|
213
|
-
related_column: opts.relatedColumn ?? null,
|
|
214
|
-
});
|
|
215
|
-
renderVisibility(this, resp);
|
|
216
|
-
output(this, withVisibility(this, { ...resp.entity }, resp), { keyValue: true });
|
|
217
|
-
}
|
|
218
|
-
catch (err) {
|
|
219
|
-
errorOutput(err);
|
|
220
|
-
}
|
|
221
|
-
});
|
|
222
|
-
update
|
|
223
|
-
.command("topic")
|
|
224
|
-
.argument("<name>", KB_ARG_NAME)
|
|
225
|
-
.description("Update a topic")
|
|
226
|
-
.option("--description <desc>", "New description")
|
|
227
|
-
.action(async function (name) {
|
|
228
|
-
try {
|
|
229
|
-
const opts = this.opts();
|
|
230
|
-
const resp = await apiClient.put(`/api/v1/cli/kb/topic/${encodeURIComponent(name)}`, {
|
|
231
|
-
description: opts.description ?? null,
|
|
232
|
-
});
|
|
233
|
-
output(this, resp.entity, { keyValue: true });
|
|
234
|
-
}
|
|
235
|
-
catch (err) {
|
|
236
|
-
errorOutput(err);
|
|
237
|
-
}
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
//# sourceMappingURL=kb-update.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kb-update.js","sourceRoot":"","sources":["../../src/commands/kb-update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAk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