@bicharts/chart-mcp 0.6.103 → 0.6.104
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/dist/index.mjs +113 -113
- package/package.json +1 -1
- package/skills/bic-charts/SKILL.md +30 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bicharts/chart-mcp",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.104",
|
|
4
4
|
"description": "AI Data Components for Power BI, Excel, Fabric Apps and the web, over MCP: bivariate maps, what-if projections and about 90 everyday chart types, with selection and cross-filtering already wired. It profiles your table locally; the code it writes is yours and runs with no license.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -553,9 +553,21 @@ overwrites a file, and its reply ends with a worked example. Building notes on m
|
|
|
553
553
|
data service is on (the notes recipe below, step a), run it again with `features: ["notes", "scenarios"]`: it writes
|
|
554
554
|
those files finished.
|
|
555
555
|
|
|
556
|
+
**The model's name is the `connection`.** Connect the semantic model the way the template's AGENTS.md says - before or
|
|
557
|
+
after `setup_fabric_app`, whose reply names it either way. On the template's current layout the model is a Rayfin
|
|
558
|
+
connector: `npx rayfin connector search "<model name>" --all-workspaces --type fabric-semanticmodel --json`, then the
|
|
559
|
+
`npx rayfin connector add --type fabric-semanticmodel --name <name> --workspace-id <id> --item-id <id>` it prints (ids from
|
|
560
|
+
the search, never guessed); the connector's name in `rayfin/rayfin.yml` is what `useSemanticModelQuery({ connection })`
|
|
561
|
+
takes. On the template's older layout (a `fabric.yaml`, `@microsoft/fabric-app-data`) it is the model's alias in
|
|
562
|
+
`fabric.yaml`. `query_semantic_model` and `suggest_charts` read it from whichever file the project has; pass `alias` only
|
|
563
|
+
when the project declares more than one.
|
|
564
|
+
|
|
556
565
|
**1. Pull each chart's rows at the chart's GRAIN, with a query written for that chart.** One row per
|
|
557
|
-
country for a country map, one per route for a flow map, one per month for a trend. The template's
|
|
558
|
-
|
|
566
|
+
country for a country map, one per route for a flow map, one per month for a trend. The template's own
|
|
567
|
+
command runs a `.dax` file through the connector: `npx fabric-app-semantic-model-tools run-dax-query --dax <file.dax>
|
|
568
|
+
--alias <connector>` (on its older layout, `npx fabric-app-data query <alias> --query '<DAX>'`).
|
|
569
|
+
`query_semantic_model` runs the query through that same connector and the project's own sign-in, so a query it returned
|
|
570
|
+
has passed the template's check: don't run it again with `run-dax-query`. Don't pull a fact
|
|
559
571
|
table and aggregate it in the browser: the Execute Queries API refuses a response over 15 MB, and a
|
|
560
572
|
column repeated on every fact row (a country's population on each sale) sums to nonsense.
|
|
561
573
|
|
|
@@ -573,12 +585,14 @@ name. Pass the model's metadata as you rename: `isMeasure`, `format` and `descri
|
|
|
573
585
|
Power BI visual gets for free. In `INFO.VIEW.COLUMNS()` a column's name is `[Name]`, not `[Column]`.
|
|
574
586
|
|
|
575
587
|
**Steps 1-3 are one call: `query_semantic_model`.** Give it the chart's DAX (`dax`, or a `.dax` file) and a
|
|
576
|
-
`name`; it runs the query through the project's own
|
|
588
|
+
`name`; it runs the query through the project's own tooling - the model's Rayfin connector (through
|
|
589
|
+
`@microsoft/fabric-app-semantic-model-tools`, else the Rayfin CLI), or on the older layout the `fabric-app-data` CLI - so
|
|
590
|
+
it signs in and gets the reply the app will get. It renames the headers (dropping the
|
|
577
591
|
table and any symbols: `[Occupancy %]` becomes `Occupancy`), saves every row to `.bic/data/<name>.csv`,
|
|
578
592
|
reads each column's role, format and description from the model (`INFO.VIEW.MEASURES()` / `INFO.VIEW.COLUMNS()`),
|
|
579
593
|
and profiles the result. Its reply ends with the arguments for the next two calls - `csv_path`, `measures`,
|
|
580
594
|
`dimensions`, `formats`, `descriptions` - so pass them to `list_eligible_charts` and `generate_chart` as they
|
|
581
|
-
are.
|
|
595
|
+
are. It keeps at most 1,000 rows of a query; the tool says so when it cut a result, and the fix is a query at the
|
|
582
596
|
chart's grain.
|
|
583
597
|
|
|
584
598
|
**4. Ask before choosing, then choose what answers the question.** `list_eligible_charts` on that
|
|
@@ -635,7 +649,8 @@ import { BicChartPanel } from "@/components/bic-chart-panel";
|
|
|
635
649
|
import { useBicChartOptions } from "@/lib/bic-chart-options";
|
|
636
650
|
import QUERY from "@/queries/overview/occupancy-map.dax?raw"; // the template's rule: DAX lives in .dax files
|
|
637
651
|
|
|
638
|
-
|
|
652
|
+
// connection: the model's connector name in rayfin/rayfin.yml (fabric.yaml's alias on the older layout)
|
|
653
|
+
const result = useSemanticModelQuery({ connection: "<connector name>", query: QUERY }); // the DAX it was generated on
|
|
639
654
|
const options = useBicChartOptions();
|
|
640
655
|
const country = useBicFilter("CountryIso3", { label: "Country", display: "CountryName" }); // step 6
|
|
641
656
|
<BicChartPanel result={result}>
|
|
@@ -732,7 +747,7 @@ import FORECAST_DAX from "@/queries/overview/bookings-forecast.dax?raw";
|
|
|
732
747
|
const country = useBicFilter("CountryIso3", { label: "Country", display: "CountryName" });
|
|
733
748
|
const route = useBicFilter(["OriginCode", "DestinationCode"],
|
|
734
749
|
{ label: "Route", display: ["OriginName", "DestinationName"] });
|
|
735
|
-
const forecast = useSemanticModelQuery({ connection: "<
|
|
750
|
+
const forecast = useSemanticModelQuery({ connection: "<connector name>",
|
|
736
751
|
query: filterQuery(FORECAST_DAX, treatAs(country, "Geography[CountryIso3]")) });
|
|
737
752
|
|
|
738
753
|
<BicFilterChips /> {/* "Country: Japan ×" - what's filtered, and its clear */}
|
|
@@ -799,8 +814,10 @@ npx rayfin init --services auth,data --auth-methods fabric --dialect mssql --ove
|
|
|
799
814
|
Each flag is needed: without `--overwrite` it prints "Initialization cancelled" and exits 0 with no
|
|
800
815
|
reason; without `--project-name` (pass the `id:` already in `rayfin/rayfin.yml`, so nothing is renamed)
|
|
801
816
|
it stops with "--project-name is required in non-interactive mode". It rewrites `rayfin/rayfin.yml`
|
|
802
|
-
and `.gitignore`, so `git diff` both and put back what's yours
|
|
803
|
-
`
|
|
817
|
+
and `.gitignore`, so `git diff` both and put back what's yours: on the template's connector layout that is the
|
|
818
|
+
`connectors:` list in `rayfin/rayfin.yml` (put it back, or run the same `npx rayfin connector add` again - without it
|
|
819
|
+
the app and `query_semantic_model` have no model) and the template's `.gitignore` lines; on the older layout, on 1.36.1, it
|
|
820
|
+
dropped the `src/fabric.generated.ts` line. It writes `rayfin/tsconfig.json` - keep its
|
|
804
821
|
`outDir`, `.temp/compiled`, which is where the deploy reads the entities from - and no entities. On 1.36.2 it
|
|
805
822
|
writes no `rayfin/data/schema.ts` either: don't write one by hand - `setup_fabric_app` with `features` (step c) writes it
|
|
806
823
|
when `rayfin/rayfin.yml` shows the data service on.
|
|
@@ -809,9 +826,11 @@ when `rayfin/rayfin.yml` shows the data service on.
|
|
|
809
826
|
- `rayfin/tsconfig.json`, in `compilerOptions`: `"tsBuildInfoFile": ".temp/tsconfig.tsbuildinfo"` and
|
|
810
827
|
`"allowImportingTsExtensions": false` (it inherits both from the root: TS6377 and TS5096 otherwise).
|
|
811
828
|
- the root `tsconfig.json`: `"references": [{ "path": "./rayfin" }]`.
|
|
812
|
-
- type the client with your schema
|
|
813
|
-
|
|
814
|
-
`
|
|
829
|
+
- type the client with your schema (`import type { AppSchema } from "../../rayfin/data/schema";`): in
|
|
830
|
+
`src/lib/rayfin-client.ts`, on the connector layout, `AppSchema` in place of `EntitySchema` as the first type argument
|
|
831
|
+
of `ConnectorsRayfinClient<EntitySchema, FunctionsSchema, AppConnectorsSchema>` (the older layout's file has
|
|
832
|
+
`RayfinClient<AppSchema>`); and `RayfinClient<AppSchema>` in the constructor of `src/services/rayfin-auth.service.ts`
|
|
833
|
+
(TS2345 otherwise).
|
|
815
834
|
|
|
816
835
|
Check with `npx tsc -b`; a bare `tsc --noEmit` reports TS6305 until the `rayfin/` project is built. If a
|
|
817
836
|
TS2345 names two copies of `rayfin-auth`, something installed only some Rayfin packages: run
|