@malloy-publisher/create-malloy-package 0.0.10 → 0.0.12
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
|
@@ -77,7 +77,7 @@ this workspace. That briefing is `AGENTS.md`, or `AGENTS.malloy.md` in a directo
|
|
|
77
77
|
that already had an `AGENTS.md` of its own; see "Running it again" below.
|
|
78
78
|
|
|
79
79
|
A directory nobody has trusted yet is a second gate, separate from connecting the MCP
|
|
80
|
-
server: Claude Code lists the
|
|
80
|
+
server: Claude Code lists the Malloy tools and then refuses every call, and a
|
|
81
81
|
`.claude/settings.json` allowlist is discarded rather than merged. Start Claude Code
|
|
82
82
|
interactively in the directory once and answer the trust prompt, which is asked once per
|
|
83
83
|
directory. A headless run is never asked, so it cannot clear the gate either. You will
|
package/dist/index.js
CHANGED
|
@@ -674,7 +674,7 @@ var MCP_PORT = 4040;
|
|
|
674
674
|
var ALT_PUBLISHER_PORT = PUBLISHER_PORT + 100;
|
|
675
675
|
var ALT_MCP_PORT = MCP_PORT + 100;
|
|
676
676
|
var BIND_HOST = "127.0.0.1";
|
|
677
|
-
var SERVER_VERSION = "0.2.
|
|
677
|
+
var SERVER_VERSION = "0.2.4";
|
|
678
678
|
function startCommandFor(envName) {
|
|
679
679
|
return `npx -y @malloy-publisher/server@${SERVER_VERSION} --server_root . ` + `--config ./publisher.config.json --host ${BIND_HOST} ` + `--watch-env ${envName}`;
|
|
680
680
|
}
|
|
@@ -1361,12 +1361,12 @@ function renderAgentsFile(result, host, envPackages) {
|
|
|
1361
1361
|
const trustNote = host === "cursor" ? "" : [
|
|
1362
1362
|
"",
|
|
1363
1363
|
"One gate can void the reconnect fix below, and you cannot clear it yourself: if the",
|
|
1364
|
-
"
|
|
1364
|
+
"Malloy tools are listed but every call is refused, the usual cause is that this",
|
|
1365
1365
|
"workspace has not been trusted, which also discards a `.claude/settings.json` allowlist.",
|
|
1366
1366
|
"A human has to start Claude Code interactively in this directory once and answer the",
|
|
1367
1367
|
"trust prompt; a non-interactive run is never asked, so it cannot clear the gate either.",
|
|
1368
1368
|
"Tell the user and leave the choice to them. You will know the prompt was answered when a",
|
|
1369
|
-
"
|
|
1369
|
+
"Malloy tool call returns data instead of being refused. If that does not change it, the",
|
|
1370
1370
|
"other cause is a `malloy` server whose own approval was never given, which the user",
|
|
1371
1371
|
"clears in the same `/mcp` panel named below. If the tools are not listed at all, this",
|
|
1372
1372
|
"gate is not the cause, so read on.",
|
|
@@ -1420,7 +1420,7 @@ function otherPackagesParagraph(result, others, restBase) {
|
|
|
1420
1420
|
const opening = result.packageCreated ? `This file is regenerated on every run and details only the package that run created. \`publisher.config.json\` registers ${others.length} other package${plural} in the \`${result.envName}\` environment` : `This run created no package. \`publisher.config.json\` registers ${others.length} package${plural} in the \`${result.envName}\` environment`;
|
|
1421
1421
|
const named = others.every(isNameableHere) ? `: ${others.map((name) => `\`${name}\``).join(", ")}` : `, whose names this file does not repeat because at least one of them is outside the character set Publisher accepts in a URL`;
|
|
1422
1422
|
const shape = result.packageCreated ? `the one above with the package name changed` : `\`${restBase("<package>")}\``;
|
|
1423
|
-
return `${opening}${named}. Nothing here has read those models, so use ` + `\`
|
|
1423
|
+
return `${opening}${named}. Nothing here has read those models, so use ` + `\`get_context\`, or read the \`.malloy\` file in each package's ` + `own directory, for its source, field, and view names. Their REST bases ` + `are ${shape}. The packages endpoint further down lists what the running ` + `server actually mounted, which is the only answer that counts.`;
|
|
1424
1424
|
}
|
|
1425
1425
|
function isNameableHere(name) {
|
|
1426
1426
|
try {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@malloy-publisher/create-malloy-package",
|
|
3
3
|
"description": "Scaffold a Malloy Publisher package and a local agent workspace, so one command takes you from nothing to an agent that can query your data.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.12",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"test:e2e": "bun test --timeout 180000 tests/e2e"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@malloy-publisher/skills": "^0.1.
|
|
48
|
+
"@malloy-publisher/skills": "^0.1.16",
|
|
49
49
|
"commander": "^12.1.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
package/templates/AGENTS.md
CHANGED
|
@@ -46,8 +46,8 @@ returning the old model's rows; it may instead make the source vanish, so every
|
|
|
46
46
|
fails with `Reference to undefined object '<source>'`. Either way the failure goes only
|
|
47
47
|
to the server's stdout, which you are not reading if you started it in the background.
|
|
48
48
|
So a query that succeeds after an edit is not proof the edit compiled, and the rows you
|
|
49
|
-
get back may be the old model's. Compile-check the edit with `
|
|
50
|
-
`
|
|
49
|
+
get back may be the old model's. Compile-check the edit with `compile_model`, or reload with
|
|
50
|
+
`reload_package` afterwards (both described below, and reload has a REST form for a
|
|
51
51
|
script or an unattended run); either one reports the failure that watch mode swallowed.
|
|
52
52
|
|
|
53
53
|
Poll until it reports serving rather than assuming a fixed wait; the first run
|
|
@@ -141,14 +141,16 @@ from the database it replaces.
|
|
|
141
141
|
|
|
142
142
|
Two interfaces reach the same models with the same governance.
|
|
143
143
|
|
|
144
|
-
MCP, for an interactive agent: the tools are `
|
|
145
|
-
environments
|
|
146
|
-
|
|
144
|
+
MCP, for an interactive agent: the tools are `list_packages` (name the
|
|
145
|
+
environments and the packages in each, which is where `get_context`'s required
|
|
146
|
+
scope comes from), `get_context` (discover the sources, views, and fields inside
|
|
147
|
+
one of those packages), `execute_query` (run a view or
|
|
148
|
+
ad-hoc Malloy and get JSON back), `compile_model` (compile-check a snippet of Malloy
|
|
147
149
|
against the model, so it takes the snippet as a required `source` argument; it reports
|
|
148
150
|
the model file's own errors too),
|
|
149
|
-
`
|
|
151
|
+
`reload_package` (pick up on-disk model edits with no restart, and surface a
|
|
150
152
|
watch-mode recompile that failed), and
|
|
151
|
-
`
|
|
153
|
+
`search_malloy_docs`, and `search_database_schema` (find the tables in a database
|
|
152
154
|
connection by plain-English description, for modelling data that is not in this package
|
|
153
155
|
yet; it returns each table's columns and the `source:` line to start from). {{mcpNote}}
|
|
154
156
|
|
|
@@ -167,10 +169,10 @@ curl -s http://localhost:{{port}}/api/v0/environments/{{envName}}/packages
|
|
|
167
169
|
That list is what this workspace serves. This file is not: it describes at most one
|
|
168
170
|
package, the one the scaffolder created on the run that wrote this file. A workspace
|
|
169
171
|
scaffolded more than once serves more than that, so take the packages, sources and
|
|
170
|
-
views you do not see here from the list above and from `
|
|
172
|
+
views you do not see here from the list above and from `get_context`, never
|
|
171
173
|
from their absence here.
|
|
172
174
|
{{trustNote}}
|
|
173
|
-
If you started this server yourself in this session, your
|
|
175
|
+
If you started this server yourself in this session, your Malloy tools will not
|
|
174
176
|
appear however long you wait: an MCP client fixes its tool list when it connects, so
|
|
175
177
|
it never saw a server that did not yet exist. You cannot reconnect yourself. Say so,
|
|
176
178
|
and {{reconnectNote}} Do not quietly switch to curl instead and call it done: it
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
// This model was scaffolded from a data file whose columns are not known ahead of
|
|
7
7
|
// time, so it starts with just a row count. Build it out for your columns: group_by
|
|
8
8
|
// a column to break the count down, and define measures like
|
|
9
|
-
// `total_amount is amount.sum()`. Validate edits with
|
|
10
|
-
// views by name with
|
|
9
|
+
// `total_amount is amount.sum()`. Validate edits with compile_model and run new
|
|
10
|
+
// views by name with reload_package. The malloy-modeling skill walks through
|
|
11
11
|
// turning a raw table into a semantic model.
|
|
12
12
|
|
|
13
13
|
source: {{sourceName}} is duckdb.table('{{dataPath}}') extend {
|
|
@@ -137,8 +137,8 @@
|
|
|
137
137
|
// Beyond that this is the same starting point as any seeded package: the
|
|
138
138
|
// scaffolder does not read your columns, so it begins with a row count. Build it
|
|
139
139
|
// out for your columns: group_by a column to break the count down, and define
|
|
140
|
-
// measures over the numeric ones. Validate edits with
|
|
141
|
-
// views by name with
|
|
140
|
+
// measures over the numeric ones. Validate edits with compile_model and run new
|
|
141
|
+
// views by name with reload_package. The malloy-modeling skill walks
|
|
142
142
|
// through turning a raw table into a semantic model.
|
|
143
143
|
|
|
144
144
|
source: {{sourceName}} is duckdb.table('{{dataPath}}') extend {
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
// no credentials and no build step. DuckDB auto-detects the header row and column
|
|
8
8
|
// types. Edit this file and the dev server recompiles it, because it boots in
|
|
9
9
|
// watch mode; AGENTS.md carries the command that starts it for this workspace.
|
|
10
|
-
// An agent can validate a change with
|
|
11
|
-
// with
|
|
10
|
+
// An agent can validate a change with compile_model and run new views by name
|
|
11
|
+
// with reload_package.
|
|
12
12
|
|
|
13
13
|
source: {{sourceName}} is duckdb.table('data/sales.csv') extend {
|
|
14
14
|
primary_key: id
|