@rasmusengelbrecht/pi-semantic-query 0.1.3 → 0.1.4

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/README.md CHANGED
@@ -8,14 +8,14 @@ It gives pi tools to discover metrics, inspect definitions, validate a model, an
8
8
 
9
9
  - pi coding agent
10
10
  - Node/npm for installing the pi package
11
- - `semantic-query-compiler` installed so the `semantic` CLI is on `PATH`
11
+ - `semantic-query-compiler >= 0.1.2` installed so the `semantic` CLI is on `PATH`
12
12
  - a semantic model in the project, usually `semantic.yml`
13
13
 
14
14
  Install the Python compiler first:
15
15
 
16
16
  ```bash
17
- uv tool install 'semantic-query-compiler @ git+https://github.com/rasmusengelbrecht/semantic-query-compiler.git'
18
- semantic --help
17
+ uv tool install 'semantic-query-compiler>=0.1.2'
18
+ semantic --version
19
19
  ```
20
20
 
21
21
  ## Install in pi
@@ -50,7 +50,13 @@ The package registers a bundled `semantic-query` skill plus these pi tools:
50
50
 
51
51
  The skill teaches pi the default workflow: search before guessing metric IDs, describe ambiguous metrics, validate model changes, prefer `period`, and never present compiled SQL as executed results.
52
52
 
53
- All tools shell out to the local `semantic` CLI. By default they look for one of:
53
+ All tools shell out to the local `semantic` CLI. If target relation flags fail with `unrecognized arguments`, upgrade the Python CLI:
54
+
55
+ ```bash
56
+ uv tool install 'semantic-query-compiler>=0.1.2' --force
57
+ ```
58
+
59
+ By default tools look for one of:
54
60
 
55
61
  - `semantic.yml`
56
62
  - `semantic.yaml`
@@ -116,6 +116,13 @@ function runSemantic(
116
116
  const result = { stdout, stderr, command: [command, ...args] };
117
117
  if (error) {
118
118
  const message = stderr.trim() || error.message;
119
+ if (message.includes("unrecognized arguments") && (message.includes("--target-project") || message.includes("--target-schema"))) {
120
+ reject(new Error(
121
+ `${command} failed because targetProject/targetSchema require semantic-query-compiler >= 0.1.1. `
122
+ + `Upgrade the Python CLI with: uv tool install semantic-query-compiler>=0.1.2 --force. Original error: ${message}`,
123
+ ));
124
+ return;
125
+ }
119
126
  reject(new Error(`${command} failed: ${message}`));
120
127
  return;
121
128
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rasmusengelbrecht/pi-semantic-query",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Compile and inspect governed semantic metrics from pi coding agent",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -7,6 +7,8 @@ description: Compile and inspect governed semantic metrics with semantic-query-c
7
7
 
8
8
  Use the `semantic_*` tools from this package to discover governed metrics and compile inspectable SQL. These tools do **not** execute warehouse queries.
9
9
 
10
+ This package shells out to the local `semantic` CLI and expects `semantic-query-compiler >= 0.1.2`. If a tool reports `unrecognized arguments` for target relation flags, tell the user to upgrade with `uv tool install 'semantic-query-compiler>=0.1.2' --force` and verify `semantic --version`.
11
+
10
12
  ## Default workflow
11
13
 
12
14
  1. Start with `semantic_search_metrics` when the user describes a metric in business language.