skillscript-runtime 0.15.5 → 0.15.7
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/filters.d.ts.map +1 -1
- package/dist/filters.js +21 -1
- package/dist/filters.js.map +1 -1
- package/docs/adopter-playbook.md +23 -12
- package/examples/connectors/McpConnectorTemplate/README.md +4 -2
- package/examples/onboarding-scaffold/connectors.json +2 -0
- package/examples/skillscripts/hello-world.skill.provenance.json +1 -1
- package/package.json +1 -1
package/dist/filters.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filters.d.ts","sourceRoot":"","sources":["../src/filters.ts"],"names":[],"mappings":"AAEA,wFAAwF;AACxF,eAAO,MAAM,aAAa,4EAA6E,CAAC;AACxG,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD;;;;;;;;GAQG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,EAAE,CAWxE;AAYD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"filters.d.ts","sourceRoot":"","sources":["../src/filters.ts"],"names":[],"mappings":"AAEA,wFAAwF;AACxF,eAAO,MAAM,aAAa,4EAA6E,CAAC;AACxG,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD;;;;;;;;GAQG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,EAAE,CAWxE;AAYD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAiEjE"}
|
package/dist/filters.js
CHANGED
|
@@ -56,7 +56,27 @@ export function applyFilter(value, filter) {
|
|
|
56
56
|
case "shell":
|
|
57
57
|
return `'${value.replace(/'/g, "'\\''")}'`;
|
|
58
58
|
case "json":
|
|
59
|
-
|
|
59
|
+
// v0.15.7 — idempotent. `applyFilter` receives all values as strings
|
|
60
|
+
// (substituteRuntime pre-serializes structured values upstream of the
|
|
61
|
+
// filter chain), so `|json` on a structured-pre-stringified value was
|
|
62
|
+
// double-encoding — turning `'{"id":"abc"}'` into `'"{\\"id\\":\\"abc\\"}"'`.
|
|
63
|
+
// Try JSON.parse first: if the input parses cleanly, it's already a
|
|
64
|
+
// valid JSON representation — pass through. If it doesn't parse, treat
|
|
65
|
+
// as a plain string and stringify once (the v0.3.x behavior, preserved
|
|
66
|
+
// for the non-JSON path).
|
|
67
|
+
//
|
|
68
|
+
// Edge cases that pass through (previously would have been re-quoted):
|
|
69
|
+
// `"null"` / `"true"` / `"42"` — JSON-parseable, treated as already-JSON.
|
|
70
|
+
// The rare author who literally wanted to JSON-escape the string "null"
|
|
71
|
+
// (producing `"\"null\""`) hits a behavior change; documented in the
|
|
72
|
+
// CHANGELOG. The common case — emit({text: "saw ${OBJ|json}"}) — is fixed.
|
|
73
|
+
try {
|
|
74
|
+
JSON.parse(value);
|
|
75
|
+
return value;
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
return JSON.stringify(value);
|
|
79
|
+
}
|
|
60
80
|
case "trim":
|
|
61
81
|
return value.trim();
|
|
62
82
|
case "fallback":
|
package/dist/filters.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filters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AAK,CAAC,2BAA2B,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,+EAA+E,CAAC,CAAC;QACjL,CAAC;QACD,KAAK,QAAQ,CAAC,CAAC,CAAC;YACd,8DAA8D;YAC9D,qEAAqE;YACrE,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAY,CAAC;gBAC5C,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;oBAAE,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAC1D,CAAC;YAAC,MAAM,CAAC;gBACP,wDAAwD;YAC1D,CAAC;YACD,OAAO,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC9B,CAAC;QACD;YACE,MAAM,IAAI,KAAK,CAAC,mBAAmB,MAAM,+CAA+C,CAAC,CAAC;IAC9F,CAAC;AACH,CAAC"}
|
package/docs/adopter-playbook.md
CHANGED
|
@@ -83,22 +83,33 @@ This same skill body runs unchanged against your substrate, against SQLite-FTS (
|
|
|
83
83
|
|
|
84
84
|
### Case 2 — MCP-tools wiring (substrate-locked)
|
|
85
85
|
|
|
86
|
-
Your substrate exposes itself as MCP tools (via a local MCP server or remote one). You wire it as an `McpConnector`
|
|
86
|
+
Your substrate exposes itself as MCP tools (via a local MCP server or remote one). You wire it as an `McpConnector` and skills reference its tools by name with substrate-specific kwargs.
|
|
87
87
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
"
|
|
88
|
+
**MCP transport — two paths.** The protocol's wire layer is the same; the transport differs:
|
|
89
|
+
|
|
90
|
+
- **Stdio MCP** (most common for community servers — YouTrack, GitHub, Linear, etc.): the MCP server is a binary you spawn as a child process and communicate with via stdin/stdout. Wired via `RemoteMcpConnector`:
|
|
91
|
+
|
|
92
|
+
```json
|
|
93
|
+
{
|
|
94
|
+
"my_store": {
|
|
95
|
+
"class": "RemoteMcpConnector",
|
|
96
|
+
"config": {
|
|
97
|
+
"command": "my-store-mcp-server",
|
|
98
|
+
"args": ["--db", "/var/store"]
|
|
99
|
+
}
|
|
96
100
|
}
|
|
97
101
|
}
|
|
98
|
-
|
|
99
|
-
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
- **HTTP MCP / Streamable HTTP** (Anthropic's hosted MCP, AMP, increasingly common for hosted services): the MCP server speaks JSON-RPC over HTTP with Server-Sent Events for the stream channel. Two ways to wire it:
|
|
105
|
+
|
|
106
|
+
- **(a) Stdio bridge** — `RemoteMcpConnector` + `npx mcp-remote https://... --sse` runs a node child process that bridges HTTPS-SSE into stdio for the runtime to consume. Works today; adds the bridge subprocess.
|
|
107
|
+
- **(b) Direct HTTP connector** — wire your own `McpConnector` class against the HTTP transport (no subprocess). See `examples/connectors/McpConnectorTemplate/` for the fork template.
|
|
108
|
+
|
|
109
|
+
Pick (a) for quick wiring against a remote HTTP MCP server with no implementation effort; pick (b) when subprocess overhead matters or you want direct control over connection lifecycle.
|
|
110
|
+
|
|
111
|
+
**In skills**, regardless of transport:
|
|
100
112
|
|
|
101
|
-
**In skills:**
|
|
102
113
|
```
|
|
103
114
|
$ my_store.search query="customer feedback" region="eu-west" cluster="prod" -> CONTEXT
|
|
104
115
|
```
|
|
@@ -14,13 +14,15 @@ A skeleton `McpConnector` implementation for adopters writing their own. Not run
|
|
|
14
14
|
|
|
15
15
|
**Fork this template only when none of those fit** — e.g.:
|
|
16
16
|
|
|
17
|
-
- Direct HTTP MCP (JSON-RPC over HTTP, no child process)
|
|
17
|
+
- Direct HTTP MCP (JSON-RPC over HTTP, no child process) — for now; check the bundled `McpConnector` classes before forking, as a bundled `HttpMcpConnector` is on the near-term roadmap
|
|
18
18
|
- WebSocket MCP
|
|
19
19
|
- In-process MCP (call methods directly without IPC)
|
|
20
20
|
- Custom transport that doesn't match stdio framing
|
|
21
21
|
- Cross-thread / worker-pool dispatch
|
|
22
22
|
|
|
23
|
-
If you're trying to wire a remote MCP server like YouTrack or GitHub, **you want `RemoteMcpConnector` in `connectors.json`**, not this template. See `connectors.json.example` for the wiring pattern.
|
|
23
|
+
If you're trying to wire a remote stdio MCP server like YouTrack or GitHub, **you want `RemoteMcpConnector` in `connectors.json`**, not this template. See `connectors.json.example` for the wiring pattern.
|
|
24
|
+
|
|
25
|
+
If you're trying to wire a Streamable HTTP MCP server (AMP, Anthropic's hosted MCP, etc.), the simplest path today is `RemoteMcpConnector` + `npx mcp-remote https://... --sse` (bridges HTTPS-SSE into stdio via a node subprocess). For lower overhead (no subprocess layer) check whether a bundled `HttpMcpConnector` is available in your installed runtime version — if so, declare an instance in `connectors.json` rather than forking this template.
|
|
24
26
|
|
|
25
27
|
## Forking workflow
|
|
26
28
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_comment": "Onboarding scaffold connectors.json — wires example MCP servers an adopter might add alongside the bundled bridges. Most onboarding deployments don't need anything here; the file-backed data store + OpenAI LLM + tmux-shell wiring lives in bootstrap.ts. This file is the place for adopter-specific MCP servers (your in-house tools, a YouTrack instance, a custom agent API, etc.).",
|
|
3
3
|
|
|
4
|
+
"_comment_transport": "RemoteMcpConnector bridges stdio MCP servers. The `mcp-remote` shape below also bridges Streamable HTTP MCP servers (the wire transport increasingly common for hosted MCPs — Anthropic's hosted MCP, AMP, etc.): `mcp-remote https://endpoint/sse` runs a node subprocess that adapts HTTPS-SSE to stdio for the runtime. For lower overhead (no subprocess layer), wire a direct HTTP MCP connector class — see docs/adopter-playbook.md §Case 2 and examples/connectors/McpConnectorTemplate/.",
|
|
5
|
+
|
|
4
6
|
"_example_remote_mcp": {
|
|
5
7
|
"class": "RemoteMcpConnector",
|
|
6
8
|
"config": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skillscript-runtime",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.7",
|
|
4
4
|
"description": "Runtime, compiler, lint, CLI, and dashboard for Skillscript — a small declarative language for authoring agent workflows.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Scott Shwarts <scotts@pobox.com>",
|