skillscript-runtime 0.7.0 → 0.7.2

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.
@@ -0,0 +1,94 @@
1
+ // v0.7.2 — `MemoryStoreMcpConnector`. Bridge class that exposes a registered
2
+ // `MemoryStore` instance as an `McpConnector`, so the canonical
3
+ // `$ memory mode=... query=... limit=N` MCP-dispatch path works in default
4
+ // deployments without adopter wiring.
5
+ //
6
+ // Per Perry's v0.7.2 kickoff (d284763f) + Scott's substrate-portability
7
+ // architectural decision (831c2661 thread) + Perry's bundled-memory-call
8
+ // scope-lock (5f471b0a).
9
+ //
10
+ // **Bundled surface is ONE canonical call.** Read-only FTS-flavored query:
11
+ //
12
+ // $ <connector_name> mode="fts|semantic|rerank" query="..." limit=N [...extras] -> R
13
+ //
14
+ // where R is `{items: PortableMemory[]}` envelope (consistent with the
15
+ // object-iteration-advisory hint pattern: cold authors write
16
+ // `foreach M in ${R.items}`).
17
+ //
18
+ // Explicitly NOT in this bridge: `memory_write`, by-id lookup, thread
19
+ // operations, introspection / traversal / promote / reinforce. Those
20
+ // are substrate-specific and adopter-wired via the dotted form
21
+ // (e.g., `$ amp.amp_write_memory ...`).
22
+ //
23
+ // Substrate-portability: skills written against this bridge's shape
24
+ // work across any `MemoryStore` interface impl. The bundled
25
+ // `SqliteMemoryStore` is the reference impl; adopters with FTS-style
26
+ // substrates implement `MemoryStore` and the bridge transparently
27
+ // wraps. Fundamentally-different substrates (vector DBs, embedding-
28
+ // based stores) wire under different connector names with their own
29
+ // surface — this bridge stays canonical FTS-flavored.
30
+ //
31
+ // Wiring: auto-registered at bootstrap as connector instance "memory"
32
+ // pointing at the "default" MemoryStore registration. Adopters override
33
+ // by re-registering "memory" with their own bridge instance OR a
34
+ // different MCP connector entirely.
35
+ const CONTRACT_VERSION = "1.0.0";
36
+ export class MemoryStoreMcpConnector {
37
+ memoryStore;
38
+ static staticCapabilities() {
39
+ return {
40
+ connector_type: "mcp_connector",
41
+ implementation: "MemoryStoreMcpConnector",
42
+ contract_version: CONTRACT_VERSION,
43
+ features: {
44
+ supports_identity_propagation: false,
45
+ supports_streaming_responses: false,
46
+ supports_batch: false,
47
+ },
48
+ };
49
+ }
50
+ constructor(memoryStore) {
51
+ this.memoryStore = memoryStore;
52
+ }
53
+ async call(_toolName, args, _ctxOverrides) {
54
+ const query = typeof args["query"] === "string" ? args["query"] : "";
55
+ if (query === "") {
56
+ throw new Error("MemoryStoreMcpConnector: `query` kwarg is required and must be a non-empty string.");
57
+ }
58
+ const mode = typeof args["mode"] === "string" && args["mode"] !== "" ? args["mode"] : "fts";
59
+ let limit = 10;
60
+ const rawLimit = args["limit"];
61
+ if (typeof rawLimit === "number" && rawLimit > 0) {
62
+ limit = rawLimit;
63
+ }
64
+ else if (typeof rawLimit === "string") {
65
+ const n = parseInt(rawLimit, 10);
66
+ if (Number.isFinite(n) && n > 0)
67
+ limit = n;
68
+ }
69
+ // Pass extras (anything beyond mode/query/limit) verbatim — substrate
70
+ // impls may consume domain_tags, vault, payload_type, etc.
71
+ const filters = { query, limit, mode };
72
+ for (const [k, v] of Object.entries(args)) {
73
+ if (k === "query" || k === "limit" || k === "mode")
74
+ continue;
75
+ filters[k] = v;
76
+ }
77
+ const items = await this.memoryStore.query(filters);
78
+ // Envelope-wrap per the canonical contract. Cold-author iteration
79
+ // pattern: `foreach M in ${R.items}` (consistent with the v0.7.2
80
+ // object-iteration-advisory's hint).
81
+ return { items };
82
+ }
83
+ async manifest() {
84
+ const msManifest = await this.memoryStore.manifest();
85
+ return {
86
+ capabilities_version: "1",
87
+ manifest: {
88
+ kind: "memory-store-bridge",
89
+ wraps: msManifest.manifest ?? {},
90
+ },
91
+ };
92
+ }
93
+ }
94
+ //# sourceMappingURL=memory-store-mcp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory-store-mcp.js","sourceRoot":"","sources":["../../src/connectors/memory-store-mcp.ts"],"names":[],"mappings":"AAAA,6EAA6E;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EAAE;gBACR,IAAI,EAAE,qBAAqB;gBAC3B,KAAK,EAAE,UAAU,CAAC,QAAQ,IAAI,EAAE;aACjC;SACF,CAAC;IACJ,CAAC;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"help-content.d.ts","sourceRoot":"","sources":["../src/help-content.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAuoBzD,wBAAgB,YAAY,CAC1B,KAAK,EAAE,MAAM,GAAG,IAAI,EACpB,cAAc,EAAE,MAAM,EACtB,QAAQ,CAAC,EAAE,QAAQ,GAClB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAqBzB"}
1
+ {"version":3,"file":"help-content.d.ts","sourceRoot":"","sources":["../src/help-content.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAstBzD,wBAAgB,YAAY,CAC1B,KAAK,EAAE,MAAM,GAAG,IAAI,EACpB,cAAc,EAAE,MAAM,EACtB,QAAQ,CAAC,EAAE,QAAQ,GAClB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAqBzB"}