@eir-labs/coltrane 0.5.0 → 0.6.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.
- package/README.md +33 -4
- package/dist/src/bifrost_invoker.js +5 -3
- package/dist/src/bifrost_invoker.js.map +1 -1
- package/dist/src/claude_invoker.d.ts +20 -3
- package/dist/src/claude_invoker.js +30 -5
- package/dist/src/claude_invoker.js.map +1 -1
- package/dist/src/cli.d.ts +1 -1
- package/dist/src/conduct_daemon.d.ts +59 -0
- package/dist/src/conduct_daemon.js +178 -0
- package/dist/src/conduct_daemon.js.map +1 -0
- package/dist/src/genome_schema.d.ts +366 -0
- package/dist/src/genome_schema.js +129 -0
- package/dist/src/genome_schema.js.map +1 -1
- package/dist/src/genome_store.d.ts +29 -0
- package/dist/src/genome_store.js +326 -0
- package/dist/src/genome_store.js.map +1 -0
- package/dist/src/hosted_tools.d.ts +23 -0
- package/dist/src/hosted_tools.js +170 -0
- package/dist/src/hosted_tools.js.map +1 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.js +3 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/mcp.js +10 -1
- package/dist/src/mcp.js.map +1 -1
- package/dist/src/output_mirror.d.ts +70 -0
- package/dist/src/output_mirror.js +381 -0
- package/dist/src/output_mirror.js.map +1 -0
- package/dist/src/outputs.d.ts +2 -0
- package/dist/src/outputs.js +37 -9
- package/dist/src/outputs.js.map +1 -1
- package/dist/src/play_worker.d.ts +24 -0
- package/dist/src/play_worker.js +49 -0
- package/dist/src/play_worker.js.map +1 -0
- package/dist/src/registry.d.ts +2 -0
- package/dist/src/registry.js +63 -33
- package/dist/src/registry.js.map +1 -1
- package/dist/src/runtime.js +19 -1
- package/dist/src/runtime.js.map +1 -1
- package/dist/src/seal_drill.d.ts +32 -0
- package/dist/src/seal_drill.js +138 -0
- package/dist/src/seal_drill.js.map +1 -0
- package/dist/src/server.d.ts +28 -1
- package/dist/src/server.js +243 -16
- package/dist/src/server.js.map +1 -1
- package/dist/src/server_relay.d.ts +2 -0
- package/dist/src/server_relay.js +31 -8
- package/dist/src/server_relay.js.map +1 -1
- package/dist/src/skill_subprocess.d.ts +9 -17
- package/dist/src/skill_subprocess.js +39 -4
- package/dist/src/skill_subprocess.js.map +1 -1
- package/dist/src/supabase_genome.d.ts +28 -0
- package/dist/src/supabase_genome.js +49 -0
- package/dist/src/supabase_genome.js.map +1 -0
- package/dist/src/tool_surface.d.ts +5 -0
- package/dist/src/tool_surface.js +15 -0
- package/dist/src/tool_surface.js.map +1 -0
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +11 -7
- package/dist/src/version.js.map +1 -1
- package/package.json +22 -7
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
// genome_store.ts — the GenomeStore port. Governor ruling: GENOME IS NOT LOCAL. The hosted
|
|
2
|
+
// Coltrane MCP is the Coltrane MCP — the full tool surface, functioning against the Supabase
|
|
3
|
+
// store — so the engine needs ONE port for "where do definitions live", with two backings:
|
|
4
|
+
//
|
|
5
|
+
// * fileGenomeStore(root) — the existing loader/writer, unchanged behavior. Local dev
|
|
6
|
+
// and the stdio server keep reading/writing genome files on disk.
|
|
7
|
+
// * postgrestGenomeStore(ctx) — loads the five genome tables over PostgREST (the caller's
|
|
8
|
+
// bearer rides the Authorization header, so RLS is the scope) and reconstructs the SAME
|
|
9
|
+
// in-memory genome shape the file loader produces. Every record is validated through the
|
|
10
|
+
// genome_schema Zod parsers exactly as the loader does; rows that fail parse are load
|
|
11
|
+
// errors (LoadedGenome.load_errors — surfaced by system_health), never silent skips.
|
|
12
|
+
// Writes ride the coltrane_genome_upsert RPC as the caller.
|
|
13
|
+
//
|
|
14
|
+
// No new dependencies: plain fetch, and the Zod schemas the engine already owns.
|
|
15
|
+
import { mkdirSync, writeFileSync } from "node:fs";
|
|
16
|
+
import { join } from "node:path";
|
|
17
|
+
import { resolveGenome, GenomeLoadError, } from "./loader.js";
|
|
18
|
+
import { writeGenomeFileVersioned } from "./genome_writer.js";
|
|
19
|
+
import { defineAgent, composeStandard } from "./composition.js";
|
|
20
|
+
import { DomainTypeSchema, SkillSchema } from "./genome_schema.js";
|
|
21
|
+
import { domainTypeDefect } from "./registry.js";
|
|
22
|
+
import { CANONICAL_CORE_TYPES } from "./canonical_core_types.js";
|
|
23
|
+
const CLASS_SUBDIR = {
|
|
24
|
+
agent: "agents",
|
|
25
|
+
standard: "standards",
|
|
26
|
+
skill: "skills",
|
|
27
|
+
domain_type: "domain_types",
|
|
28
|
+
};
|
|
29
|
+
/** Local-dev backing: the existing loader/writer, behavior identical. load() is
|
|
30
|
+
* resolveGenome (manifest-aware, canonical-core seeding); upsert() writes the loadable
|
|
31
|
+
* file via the versioned writer (prior bytes snapshotted, atomic replace). Ledger sealing
|
|
32
|
+
* stays where it lives today — in the MCP tools (sealDefinition / sealAgentDefinition). */
|
|
33
|
+
export function fileGenomeStore(root) {
|
|
34
|
+
return {
|
|
35
|
+
async load() {
|
|
36
|
+
return resolveGenome(root);
|
|
37
|
+
},
|
|
38
|
+
async upsert(cls, payload) {
|
|
39
|
+
const slug = typeof payload["slug"] === "string" ? payload["slug"].trim() : "";
|
|
40
|
+
if (!slug)
|
|
41
|
+
throw new Error(`genome upsert: ${cls} payload has no slug`);
|
|
42
|
+
if (cls === "skill") {
|
|
43
|
+
// Skills are PACKAGE directories (the loader's only skill format) — mirror
|
|
44
|
+
// sealSkillPackage's file half: meta.json + code/md halves + fixtures.
|
|
45
|
+
const pkgDir = join(root, "skills", slug);
|
|
46
|
+
mkdirSync(pkgDir, { recursive: true });
|
|
47
|
+
const { fixtures, code, md, ...meta } = payload;
|
|
48
|
+
writeFileSync(join(pkgDir, "meta.json"), JSON.stringify(meta, null, 2) + "\n");
|
|
49
|
+
if (typeof code === "string")
|
|
50
|
+
writeFileSync(join(pkgDir, "skill.mjs"), code);
|
|
51
|
+
if (typeof md === "string")
|
|
52
|
+
writeFileSync(join(pkgDir, "skill.md"), md);
|
|
53
|
+
if (Array.isArray(fixtures)) {
|
|
54
|
+
const fxDir = join(pkgDir, "fixtures");
|
|
55
|
+
mkdirSync(fxDir, { recursive: true });
|
|
56
|
+
fixtures.forEach((fx, i) => writeFileSync(join(fxDir, `fixture-${String(i + 1).padStart(3, "0")}.json`), JSON.stringify(fx, null, 2) + "\n"));
|
|
57
|
+
}
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
writeGenomeFileVersioned(root, CLASS_SUBDIR[cls], slug, JSON.stringify(payload, null, 2) + "\n");
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
// ── PostgREST backing ─────────────────────────────────────────────────────────────
|
|
65
|
+
// The five genome tables and the columns the engine reads back. Row shapes are the
|
|
66
|
+
// round-tripped Supabase schema (org_id is RLS's concern, not the engine's).
|
|
67
|
+
const Q = {
|
|
68
|
+
core_types: "coltrane_core_types?select=slug,primitive,base_schema,description",
|
|
69
|
+
domain_types: "coltrane_domain_types?select=slug,version,extends,domain,status,schema,required_fields",
|
|
70
|
+
agents: "coltrane_agent_profiles?select=slug,version,status,primitives,input_types,output_types,domain," +
|
|
71
|
+
"identity,method,constraints,depth_profile,permissions,behavioral_primitives,skill_slots,default_skills",
|
|
72
|
+
standards: "coltrane_standards?select=slug,version,status,domain,phases,output_types",
|
|
73
|
+
skills: "coltrane_skills?select=slug,name,description,skill_md,tier,input_type,output_type,status",
|
|
74
|
+
};
|
|
75
|
+
async function restGet(ctx, pathAndQuery) {
|
|
76
|
+
const res = await fetch(`${ctx.baseUrl}/rest/v1/${pathAndQuery}`, {
|
|
77
|
+
headers: {
|
|
78
|
+
apikey: ctx.anonKey,
|
|
79
|
+
// The bearer authenticates via the header; RLS scopes what this caller may load.
|
|
80
|
+
Authorization: `Bearer ${ctx.bearer}`,
|
|
81
|
+
"Content-Type": "application/json",
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
const text = await res.text();
|
|
85
|
+
if (!res.ok) {
|
|
86
|
+
throw new GenomeLoadError(`genome load: GET ${pathAndQuery.split("?")[0]} → ${res.status}: ${text}`);
|
|
87
|
+
}
|
|
88
|
+
const parsed = text ? JSON.parse(text) : [];
|
|
89
|
+
return Array.isArray(parsed) ? parsed : [];
|
|
90
|
+
}
|
|
91
|
+
const zodWhy = (issues) => issues.map((i) => `${i.path.join(".") || "(root)"}: ${i.message}`).join("; ");
|
|
92
|
+
/** Build the engine AgentDef from an agent-profile row: the permissions jsonb unpacks to the
|
|
93
|
+
* flat schema fields; default_skills is the row's skill-binding column (skill_slugs). */
|
|
94
|
+
function agentDefFromRow(row) {
|
|
95
|
+
const perms = (row["permissions"] ?? {});
|
|
96
|
+
const def = {
|
|
97
|
+
slug: row["slug"],
|
|
98
|
+
primitives: row["primitives"],
|
|
99
|
+
input_types: row["input_types"] ?? [],
|
|
100
|
+
output_types: row["output_types"] ?? [],
|
|
101
|
+
domain: row["domain"] ?? null,
|
|
102
|
+
identity: row["identity"],
|
|
103
|
+
method: row["method"],
|
|
104
|
+
constraints: row["constraints"] ?? [],
|
|
105
|
+
behavioral_primitives: row["behavioral_primitives"],
|
|
106
|
+
allowed_tools: perms["allowed_tools"],
|
|
107
|
+
disallowed_tools: perms["disallowed_tools"],
|
|
108
|
+
model_tier: perms["model_tier"],
|
|
109
|
+
max_tool_calls: perms["max_tool_calls"],
|
|
110
|
+
code_tool_access: perms["code_tool_access"],
|
|
111
|
+
depth_profile: row["depth_profile"],
|
|
112
|
+
skill_slugs: row["default_skills"],
|
|
113
|
+
};
|
|
114
|
+
for (const k of Object.keys(def))
|
|
115
|
+
if (def[k] === undefined || def[k] === null)
|
|
116
|
+
delete def[k];
|
|
117
|
+
// domain is honestly nullable on the schema — restore it if the row said null.
|
|
118
|
+
if (!("domain" in def))
|
|
119
|
+
def["domain"] = null;
|
|
120
|
+
return def;
|
|
121
|
+
}
|
|
122
|
+
const REQUIRED_CORE_SLUGS = ["Signal", "Interpretation", "Judgment", "Plan", "Artifact", "Verdict"];
|
|
123
|
+
/** Hosted backing: load the genome from the store's five tables and reconstruct the SAME
|
|
124
|
+
* in-memory shape the file loader produces; upsert through the governed RPC. */
|
|
125
|
+
export function postgrestGenomeStore(ctx) {
|
|
126
|
+
return {
|
|
127
|
+
async load() {
|
|
128
|
+
const [coreRows, typeRows, agentRows, standardRows, skillRows] = await Promise.all([
|
|
129
|
+
restGet(ctx, Q.core_types),
|
|
130
|
+
restGet(ctx, Q.domain_types),
|
|
131
|
+
restGet(ctx, Q.agents),
|
|
132
|
+
restGet(ctx, Q.standards),
|
|
133
|
+
restGet(ctx, Q.skills),
|
|
134
|
+
]);
|
|
135
|
+
const load_errors = [];
|
|
136
|
+
// core types — engine-owned, immutable 6. No rows visible → seed the canonical set,
|
|
137
|
+
// exactly as loadGenome does for a root with no core_types/. A PARTIAL set is a corrupt
|
|
138
|
+
// store view and hard-fails, mirroring the loader's strict gate.
|
|
139
|
+
const core_types = new Map();
|
|
140
|
+
if (coreRows.length === 0) {
|
|
141
|
+
for (const c of CANONICAL_CORE_TYPES)
|
|
142
|
+
core_types.set(c.slug, c);
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
for (const r of coreRows) {
|
|
146
|
+
core_types.set(String(r["slug"]), {
|
|
147
|
+
slug: String(r["slug"]),
|
|
148
|
+
primitive: String(r["primitive"]),
|
|
149
|
+
description: String(r["description"] ?? ""),
|
|
150
|
+
schema: (r["base_schema"] ?? {}),
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
const missing = REQUIRED_CORE_SLUGS.filter((s) => !core_types.has(s));
|
|
154
|
+
if (missing.length > 0) {
|
|
155
|
+
throw new GenomeLoadError(`coltrane_core_types missing required slugs: ${missing.join(", ")}`);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
// domain types — the loader's three checks, in the loader's order: core-type extends,
|
|
159
|
+
// representability (domainTypeDefect), then the single Zod source. Soft-fail per row.
|
|
160
|
+
const domain_types = new Map();
|
|
161
|
+
for (const r of typeRows) {
|
|
162
|
+
const slug = typeof r["slug"] === "string" ? r["slug"] : null;
|
|
163
|
+
const path = `postgrest:coltrane_domain_types/${slug ?? "?"}`;
|
|
164
|
+
try {
|
|
165
|
+
if (!core_types.has(String(r["extends"]))) {
|
|
166
|
+
throw new Error(`field "extends" references "${String(r["extends"])}" which is not a core type`);
|
|
167
|
+
}
|
|
168
|
+
const defect = domainTypeDefect(r);
|
|
169
|
+
if (defect)
|
|
170
|
+
throw new Error(defect);
|
|
171
|
+
const check = DomainTypeSchema.safeParse(r);
|
|
172
|
+
if (!check.success)
|
|
173
|
+
throw new Error(`type schema validation failed — ${zodWhy(check.error.issues)}`);
|
|
174
|
+
const rec = check.data;
|
|
175
|
+
domain_types.set(`${rec.slug}@${rec.version}`, rec);
|
|
176
|
+
}
|
|
177
|
+
catch (e) {
|
|
178
|
+
load_errors.push({ kind: "domain_type", path, slug, error: e instanceof Error ? e.message : String(e) });
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
// agents — defineAgent is the loader's own gate (schema parse + composition rules).
|
|
182
|
+
// Hosted rows soft-fail per row: one broken profile is a reported load error, not a
|
|
183
|
+
// dead genome for every caller behind this RLS scope.
|
|
184
|
+
const agents = new Map();
|
|
185
|
+
for (const r of agentRows) {
|
|
186
|
+
const slug = typeof r["slug"] === "string" ? r["slug"] : null;
|
|
187
|
+
const path = `postgrest:coltrane_agent_profiles/${slug ?? "?"}`;
|
|
188
|
+
try {
|
|
189
|
+
if (!slug)
|
|
190
|
+
throw new Error(`missing required "slug" field`);
|
|
191
|
+
if (agents.has(slug))
|
|
192
|
+
throw new Error(`duplicate agent slug "${slug}"`);
|
|
193
|
+
agents.set(slug, defineAgent(agentDefFromRow(r)));
|
|
194
|
+
}
|
|
195
|
+
catch (e) {
|
|
196
|
+
load_errors.push({ kind: "agent", path, slug, error: e instanceof Error ? e.message : String(e) });
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
// standards — phases jsonb is already the engine phase shape; the agents a standard
|
|
200
|
+
// composes are the ones its chairs name. composeStandard is the loader's own gate.
|
|
201
|
+
const standards = new Map();
|
|
202
|
+
for (const r of standardRows) {
|
|
203
|
+
const slug = typeof r["slug"] === "string" ? r["slug"] : null;
|
|
204
|
+
const path = `postgrest:coltrane_standards/${slug ?? "?"}`;
|
|
205
|
+
try {
|
|
206
|
+
if (!slug)
|
|
207
|
+
throw new Error(`missing required "slug" field`);
|
|
208
|
+
if (standards.has(slug))
|
|
209
|
+
throw new Error(`duplicate standard slug "${slug}"`);
|
|
210
|
+
const phases = (r["phases"] ?? []);
|
|
211
|
+
const chairAgentSlugs = [
|
|
212
|
+
...new Set(phases.flatMap((p) => (p.chairs ?? []).map((c) => c.agent_slug).filter((s) => !!s))),
|
|
213
|
+
];
|
|
214
|
+
const resolved = chairAgentSlugs.map((aslug) => {
|
|
215
|
+
const a = agents.get(aslug);
|
|
216
|
+
if (!a)
|
|
217
|
+
throw new Error(`references unknown agent "${aslug}"`);
|
|
218
|
+
return a;
|
|
219
|
+
});
|
|
220
|
+
standards.set(slug, composeStandard({
|
|
221
|
+
slug,
|
|
222
|
+
domain: String(r["domain"] ?? ""),
|
|
223
|
+
agents: resolved,
|
|
224
|
+
phases,
|
|
225
|
+
status: r["status"] ?? "active",
|
|
226
|
+
...(Array.isArray(r["output_types"]) ? { output_types: r["output_types"] } : {}),
|
|
227
|
+
}));
|
|
228
|
+
}
|
|
229
|
+
catch (e) {
|
|
230
|
+
load_errors.push({ kind: "standard", path, slug, error: e instanceof Error ? e.message : String(e) });
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
// skills — the row's skill_md IS the loaded reasoning half (`md`, the prompt's Skills
|
|
234
|
+
// layer). Hosted skills carry no local package dir / code half by construction.
|
|
235
|
+
const skills = new Map();
|
|
236
|
+
for (const r of skillRows) {
|
|
237
|
+
const slug = typeof r["slug"] === "string" ? r["slug"] : null;
|
|
238
|
+
const path = `postgrest:coltrane_skills/${slug ?? "?"}`;
|
|
239
|
+
try {
|
|
240
|
+
if (!slug)
|
|
241
|
+
throw new Error(`missing required "slug" field`);
|
|
242
|
+
if (skills.has(slug))
|
|
243
|
+
throw new Error(`duplicate skill slug "${slug}"`);
|
|
244
|
+
const meta = {
|
|
245
|
+
slug,
|
|
246
|
+
description: r["description"] ?? undefined,
|
|
247
|
+
input_type: r["input_type"] ?? undefined,
|
|
248
|
+
output_type: r["output_type"] ?? undefined,
|
|
249
|
+
...(typeof r["tier"] === "number" ? { permission: { tier: r["tier"] } } : {}),
|
|
250
|
+
...(typeof r["skill_md"] === "string" ? { md: r["skill_md"] } : {}),
|
|
251
|
+
};
|
|
252
|
+
for (const k of Object.keys(meta))
|
|
253
|
+
if (meta[k] === undefined)
|
|
254
|
+
delete meta[k];
|
|
255
|
+
const check = SkillSchema.safeParse(meta);
|
|
256
|
+
if (!check.success)
|
|
257
|
+
throw new Error(`skill schema validation failed — ${zodWhy(check.error.issues)}`);
|
|
258
|
+
skills.set(slug, check.data);
|
|
259
|
+
}
|
|
260
|
+
catch (e) {
|
|
261
|
+
load_errors.push({ kind: "skill", path, slug, error: e instanceof Error ? e.message : String(e) });
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
// evals — no hosted table today; present and empty, the same shape as a genome
|
|
265
|
+
// root with no evals/ directory.
|
|
266
|
+
const evals = new Map();
|
|
267
|
+
return { core_types, domain_types, agents, standards, skills, evals, load_errors };
|
|
268
|
+
},
|
|
269
|
+
async upsert(cls, payload) {
|
|
270
|
+
const res = await fetch(`${ctx.baseUrl}/rest/v1/rpc/coltrane_genome_upsert`, {
|
|
271
|
+
method: "POST",
|
|
272
|
+
headers: {
|
|
273
|
+
apikey: ctx.anonKey,
|
|
274
|
+
Authorization: `Bearer ${ctx.bearer}`,
|
|
275
|
+
"Content-Type": "application/json",
|
|
276
|
+
},
|
|
277
|
+
body: JSON.stringify({ p_class: cls, p_payload: payload }),
|
|
278
|
+
});
|
|
279
|
+
if (!res.ok) {
|
|
280
|
+
const text = await res.text();
|
|
281
|
+
let message = text || `store error ${res.status}`;
|
|
282
|
+
try {
|
|
283
|
+
const parsed = JSON.parse(text);
|
|
284
|
+
if (parsed.message)
|
|
285
|
+
message = parsed.message;
|
|
286
|
+
}
|
|
287
|
+
catch { /* keep the raw text */ }
|
|
288
|
+
throw new Error(`genome upsert (${cls}) refused: ${message}`);
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
/** The hosted gig-queue seam for createToolSurface: queue one run through the governor-gated
|
|
294
|
+
* dispatch RPC AS THE CALLER (member JWT — RLS + the governor gate decide). Queuing only;
|
|
295
|
+
* a drain worker claims and runs it. Shape mirrors hosted_tools' member dispatch path. */
|
|
296
|
+
export function postgrestQueueGig(ctx) {
|
|
297
|
+
return async (args) => {
|
|
298
|
+
const res = await fetch(`${ctx.baseUrl}/rest/v1/rpc/coltrane_gig_dispatch`, {
|
|
299
|
+
method: "POST",
|
|
300
|
+
headers: {
|
|
301
|
+
apikey: ctx.anonKey,
|
|
302
|
+
Authorization: `Bearer ${ctx.bearer}`,
|
|
303
|
+
"Content-Type": "application/json",
|
|
304
|
+
},
|
|
305
|
+
body: JSON.stringify({
|
|
306
|
+
p_standard: args["standard_slug"],
|
|
307
|
+
p_mode: args["mode"] ?? "live",
|
|
308
|
+
p_input: args["input"] ?? {},
|
|
309
|
+
p_org_slug: args["org_slug"] ?? null,
|
|
310
|
+
}),
|
|
311
|
+
});
|
|
312
|
+
const text = await res.text();
|
|
313
|
+
if (!res.ok) {
|
|
314
|
+
let message = text || `store error ${res.status}`;
|
|
315
|
+
try {
|
|
316
|
+
const parsed = JSON.parse(text);
|
|
317
|
+
if (parsed.message)
|
|
318
|
+
message = parsed.message;
|
|
319
|
+
}
|
|
320
|
+
catch { /* keep the raw text */ }
|
|
321
|
+
throw new Error(message);
|
|
322
|
+
}
|
|
323
|
+
return { gig_id: JSON.parse(text), status: "queued" };
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
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AAU,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,IAAI;aACrC,CAAC;SACH,CAAC,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;QAC9B,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;YACZ,IAAI,OAAO,GAAG,IAAI,IAAI,eAAe,GAAG,CAAC,MAAM,EAAE,CAAC;YAClD,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAyB,CAAC;gBACxD,IAAI,MAAM,CAAC,OAAO;oBAAE,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;YAC/C,CAAC;YAAC,MAAM,CAAC,CAAC,uBAAuB,CAAC,CAAC;YACnC,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;IAClE,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** Everything a hosted tool needs from its host: where the org store is, and who is calling. */
|
|
2
|
+
export interface HostedToolContext {
|
|
3
|
+
/** The org store's base URL (a Supabase project or PostgREST-compatible equivalent). */
|
|
4
|
+
baseUrl: string;
|
|
5
|
+
/** The store's public (anon) API key — required by PostgREST as `apikey`; not a secret. */
|
|
6
|
+
anonKey: string;
|
|
7
|
+
/** The caller's bearer: a member session JWT, or an issued ctk_ agent capability token. */
|
|
8
|
+
bearer: string;
|
|
9
|
+
}
|
|
10
|
+
export interface HostedToolResult {
|
|
11
|
+
text: string;
|
|
12
|
+
isError?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface HostedTool {
|
|
15
|
+
name: string;
|
|
16
|
+
title: string;
|
|
17
|
+
description: string;
|
|
18
|
+
/** Plain JSON Schema for the tool's params — transport-agnostic, no schema-library coupling. */
|
|
19
|
+
paramsJsonSchema: Record<string, unknown>;
|
|
20
|
+
handler(args: Record<string, unknown>, ctx: HostedToolContext): Promise<HostedToolResult>;
|
|
21
|
+
}
|
|
22
|
+
export declare const HOSTED_TOOLS: HostedTool[];
|
|
23
|
+
export declare function hostedToolByName(name: string): HostedTool;
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
// hosted_tools.ts — the INTERIM six-tool hosted surface. DEPRECATED in favor of the full
|
|
2
|
+
// engine surface: `createToolSurface` (subpath "./tool_surface") mounts ALL engine tools
|
|
3
|
+
// per-request, backed by a GenomeStore (subpath "./genome_store" — postgrestGenomeStore
|
|
4
|
+
// rides the same {baseUrl, anonKey, bearer} context this module established). Kept because
|
|
5
|
+
// the current deploy still consumes it; new hosts should mount the full surface instead.
|
|
6
|
+
//
|
|
7
|
+
// The original charter, still true of the pattern this module pioneered:
|
|
8
|
+
// the hosted MCP tool surface, defined ONCE here (OSS, npm-published) and
|
|
9
|
+
// consumed by any host: the Vercel app, a self-hosted wrapper, a test harness. The split of
|
|
10
|
+
// responsibilities is the auth-boundary law applied to tooling:
|
|
11
|
+
//
|
|
12
|
+
// * THE ENGINE (this module) owns what the tools ARE — names, schemas, store-facing
|
|
13
|
+
// behavior. It is dependency-free (plain fetch against a PostgREST-shaped org store)
|
|
14
|
+
// and auth-BLIND: it never decides whether a bearer is valid, it only routes by the
|
|
15
|
+
// bearer's CLASS, and the store refuses invalid credentials where the hashes live.
|
|
16
|
+
// * THE HOST owns transport and authentication — it verifies/obtains the bearer (OAuth
|
|
17
|
+
// browser login for humans, issued ctk_ capability tokens for agents), mounts these
|
|
18
|
+
// definitions on whatever MCP transport it serves, and passes the context in.
|
|
19
|
+
//
|
|
20
|
+
// Two bearer classes, per the mcp-auth model:
|
|
21
|
+
// * ctk_ agent capability token → security-definer RPCs (coltrane_mcp_*) resolve the
|
|
22
|
+
// token's hash inside the store and scope to its org + exact may_dispatch list.
|
|
23
|
+
// * a member session JWT → rides PostgREST directly; RLS scopes rows to the member, and
|
|
24
|
+
// dispatch runs the governor-gated RPC as them (auth.uid()).
|
|
25
|
+
const isAgentBearer = (bearer) => bearer.startsWith("ctk_");
|
|
26
|
+
const ok = (data) => ({ text: JSON.stringify(data) });
|
|
27
|
+
const err = (message) => ({ text: message, isError: true });
|
|
28
|
+
async function rpc(ctx, fn, body, asCaller) {
|
|
29
|
+
const res = await fetch(`${ctx.baseUrl}/rest/v1/rpc/${fn}`, {
|
|
30
|
+
method: "POST",
|
|
31
|
+
headers: {
|
|
32
|
+
apikey: ctx.anonKey,
|
|
33
|
+
// The JWT authenticates via the header (PostgREST verifies it; RLS/auth.uid() scope it).
|
|
34
|
+
// A ctk_ bearer is NOT a JWT — it authenticates inside the definer RPC via the body, and
|
|
35
|
+
// the transport rides the anon key.
|
|
36
|
+
Authorization: `Bearer ${asCaller ? ctx.bearer : ctx.anonKey}`,
|
|
37
|
+
"Content-Type": "application/json",
|
|
38
|
+
},
|
|
39
|
+
body: JSON.stringify(body),
|
|
40
|
+
});
|
|
41
|
+
const text = await res.text();
|
|
42
|
+
if (!res.ok) {
|
|
43
|
+
try {
|
|
44
|
+
const parsed = JSON.parse(text);
|
|
45
|
+
return err(parsed.message ?? text);
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return err(text || `store error ${res.status}`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return { text: text || "null" };
|
|
52
|
+
}
|
|
53
|
+
async function restGet(ctx, pathAndQuery) {
|
|
54
|
+
const res = await fetch(`${ctx.baseUrl}/rest/v1/${pathAndQuery}`, {
|
|
55
|
+
headers: {
|
|
56
|
+
apikey: ctx.anonKey,
|
|
57
|
+
Authorization: `Bearer ${ctx.bearer}`,
|
|
58
|
+
"Content-Type": "application/json",
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
const text = await res.text();
|
|
62
|
+
if (!res.ok)
|
|
63
|
+
return err(text || `store error ${res.status}`);
|
|
64
|
+
return { text };
|
|
65
|
+
}
|
|
66
|
+
export const HOSTED_TOOLS = [
|
|
67
|
+
{
|
|
68
|
+
name: "list_standards",
|
|
69
|
+
title: "List standards",
|
|
70
|
+
description: "The standards in your organizations' genome layers — what a gig can be.",
|
|
71
|
+
paramsJsonSchema: { type: "object", properties: {} },
|
|
72
|
+
async handler(_args, ctx) {
|
|
73
|
+
if (isAgentBearer(ctx.bearer))
|
|
74
|
+
return rpc(ctx, "coltrane_mcp_standards", { p_bearer: ctx.bearer }, false);
|
|
75
|
+
return restGet(ctx, "coltrane_standards?select=slug,version,status,domain,output_types,org_id&order=slug");
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: "list_gigs",
|
|
80
|
+
title: "List gigs",
|
|
81
|
+
description: "The queue and the history — the gig table IS the queue. Optionally filter by status (queued|running|completed|failed|aborted).",
|
|
82
|
+
paramsJsonSchema: {
|
|
83
|
+
type: "object",
|
|
84
|
+
properties: {
|
|
85
|
+
status: { type: "string", description: "queued|running|completed|failed|aborted" },
|
|
86
|
+
limit: { type: "number" },
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
async handler(args, ctx) {
|
|
90
|
+
if (isAgentBearer(ctx.bearer))
|
|
91
|
+
return err("agent tokens read single gigs via gig_status; listing is a member surface");
|
|
92
|
+
const limit = Math.min(Number(args["limit"] ?? 25), 100);
|
|
93
|
+
const status = args["status"] ? `&status=eq.${encodeURIComponent(String(args["status"]))}` : "";
|
|
94
|
+
return restGet(ctx, `coltrane_gigs?select=id,standard_slug,status,mode,total_cost_usd,dispatched_by,acting_for,created_at,completed_at&order=created_at.desc&limit=${limit}${status}`);
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
name: "gig_status",
|
|
99
|
+
title: "Gig status",
|
|
100
|
+
description: "One gig's status, spend, and reproducibility keys (org-scoped).",
|
|
101
|
+
paramsJsonSchema: {
|
|
102
|
+
type: "object",
|
|
103
|
+
properties: { gig_id: { type: "string" } },
|
|
104
|
+
required: ["gig_id"],
|
|
105
|
+
},
|
|
106
|
+
async handler(args, ctx) {
|
|
107
|
+
const gig = String(args["gig_id"] ?? "");
|
|
108
|
+
if (isAgentBearer(ctx.bearer))
|
|
109
|
+
return rpc(ctx, "coltrane_mcp_gig_status", { p_bearer: ctx.bearer, p_gig: gig }, false);
|
|
110
|
+
return restGet(ctx, `coltrane_gigs?select=id,standard_slug,status,mode,total_cost_usd,genome_hash,run_fingerprint,started_at,completed_at,manifest&id=eq.${encodeURIComponent(gig)}`);
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: "gig_outputs",
|
|
115
|
+
title: "Gig outputs",
|
|
116
|
+
description: "A gig's sealed outputs with their provenance (content_sha + input_shas).",
|
|
117
|
+
paramsJsonSchema: {
|
|
118
|
+
type: "object",
|
|
119
|
+
properties: { gig_id: { type: "string" } },
|
|
120
|
+
required: ["gig_id"],
|
|
121
|
+
},
|
|
122
|
+
async handler(args, ctx) {
|
|
123
|
+
const gig = String(args["gig_id"] ?? "");
|
|
124
|
+
if (isAgentBearer(ctx.bearer))
|
|
125
|
+
return rpc(ctx, "coltrane_mcp_gig_outputs", { p_bearer: ctx.bearer, p_gig: gig }, false);
|
|
126
|
+
return restGet(ctx, `coltrane_outputs?select=id,domain_type,agent_slug,phase,content_sha,input_shas,created_at,data&gig_id=eq.${encodeURIComponent(gig)}&order=created_at`);
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: "roster",
|
|
131
|
+
title: "Roster",
|
|
132
|
+
description: "The named players and humans of your organizations — names, forebears, status (member surface).",
|
|
133
|
+
paramsJsonSchema: { type: "object", properties: {} },
|
|
134
|
+
async handler(_args, ctx) {
|
|
135
|
+
if (isAgentBearer(ctx.bearer))
|
|
136
|
+
return err("the roster is a member surface; agent tokens read gigs and outputs");
|
|
137
|
+
return restGet(ctx, "coltrane_agent?select=slug,name,kind,status,named_from_forebear&order=slug");
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: "dispatch_gig",
|
|
142
|
+
title: "Dispatch a gig",
|
|
143
|
+
description: "Queue one run of a standard. Queuing only — a drain worker claims and runs it. Members dispatch as themselves (governor-gated); agent tokens are limited to their exact may_dispatch list.",
|
|
144
|
+
paramsJsonSchema: {
|
|
145
|
+
type: "object",
|
|
146
|
+
properties: {
|
|
147
|
+
standard_slug: { type: "string" },
|
|
148
|
+
mode: { type: "string", enum: ["rehearsal", "studio", "live"] },
|
|
149
|
+
input: { type: "object" },
|
|
150
|
+
org_slug: { type: "string", description: "Disambiguates when you belong to several orgs carrying the standard." },
|
|
151
|
+
},
|
|
152
|
+
required: ["standard_slug", "mode", "input"],
|
|
153
|
+
},
|
|
154
|
+
async handler(args, ctx) {
|
|
155
|
+
if (isAgentBearer(ctx.bearer)) {
|
|
156
|
+
const out = await rpc(ctx, "coltrane_mcp_dispatch", { p_bearer: ctx.bearer, p_standard: args["standard_slug"], p_mode: args["mode"], p_input: args["input"] ?? {} }, false);
|
|
157
|
+
return out.isError ? out : ok({ gig_id: JSON.parse(out.text), status: "queued" });
|
|
158
|
+
}
|
|
159
|
+
const out = await rpc(ctx, "coltrane_gig_dispatch", { p_standard: args["standard_slug"], p_mode: args["mode"], p_input: args["input"] ?? {}, p_org_slug: args["org_slug"] ?? null }, true);
|
|
160
|
+
return out.isError ? out : ok({ gig_id: JSON.parse(out.text), status: "queued" });
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
];
|
|
164
|
+
export function hostedToolByName(name) {
|
|
165
|
+
const tool = HOSTED_TOOLS.find((t) => t.name === name);
|
|
166
|
+
if (!tool)
|
|
167
|
+
throw new Error(`unknown hosted tool: ${name}`);
|
|
168
|
+
return tool;
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=hosted_tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hosted_tools.js","sourceRoot":"","sources":["../../src/hosted_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GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;YACpF,CAAC;YACD,MAAM,GAAG,GAAG,MAAM,GAAG,CACnB,GAAG,EACH,uBAAuB,EACvB,EAAE,UAAU,EAAE,IAAI,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,IAAI,EAAE,EAC/H,IAAI,CACL,CAAC;YACF,OAAO,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;QACpF,CAAC;KACF;CACF,CAAC;AAEF,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;IACvD,IAAI,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,wBAAwB,IAAI,EAAE,CAAC,CAAC;IAC3D,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -18,6 +18,9 @@ export * from "./canonical_core_types.js";
|
|
|
18
18
|
export * from "./canonical_form.js";
|
|
19
19
|
export * from "./ledger.js";
|
|
20
20
|
export * from "./outputs.js";
|
|
21
|
+
export * from "./output_mirror.js";
|
|
22
|
+
export * from "./hosted_tools.js";
|
|
23
|
+
export * from "./genome_store.js";
|
|
21
24
|
export * from "./reuse.js";
|
|
22
25
|
export * from "./charter.js";
|
|
23
26
|
export * from "./server.js";
|
package/dist/src/index.js
CHANGED
|
@@ -18,6 +18,9 @@ export * from "./canonical_core_types.js";
|
|
|
18
18
|
export * from "./canonical_form.js";
|
|
19
19
|
export * from "./ledger.js";
|
|
20
20
|
export * from "./outputs.js";
|
|
21
|
+
export * from "./output_mirror.js";
|
|
22
|
+
export * from "./hosted_tools.js";
|
|
23
|
+
export * from "./genome_store.js";
|
|
21
24
|
export * from "./reuse.js";
|
|
22
25
|
export * from "./charter.js";
|
|
23
26
|
export * from "./server.js";
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAA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AAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC"}
|
package/dist/src/mcp.js
CHANGED
|
@@ -21,7 +21,16 @@ export const MCP_TOOLS = [
|
|
|
21
21
|
{ slug: "type_resolve", category: "understand", input_schema: obj({ core_type: "string", extends: "string", domain: "string", required_fields: "array" }), output_schema: obj({ action: "string", candidates: "array", recommendation: "object" }) },
|
|
22
22
|
{ slug: "type_browse", category: "understand", input_schema: obj({ domain: "string", extends: "string", status: "string", min_usage: "number" }), output_schema: obj({ types: "array", stats: "object" }) },
|
|
23
23
|
{ slug: "tool_registry_browse", category: "understand", input_schema: obj({ category: "string" }), output_schema: obj({ tools: "array", usage_stats: "array", dependency_map: "object" }) },
|
|
24
|
-
|
|
24
|
+
// Discoverability parity (tests/genome_browse_parity.test.ts): every genome class that is
|
|
25
|
+
// authorable over MCP is listable over MCP. Standards and agents lacked these because the
|
|
26
|
+
// registry grew up in a working tree where `ls standards/` was free — the first hosted mount
|
|
27
|
+
// (no filesystem) turned that local assumption into an undiscoverable-slug hole.
|
|
28
|
+
{ slug: "standard_browse", category: "understand", input_schema: obj({ domain: "string", status: "string" }), output_schema: obj({ standards: "array", count: "number" }) },
|
|
29
|
+
{ slug: "agent_browse", category: "understand", input_schema: obj({ domain: "string", primitive: "string" }), output_schema: obj({ agents: "array", count: "number" }) },
|
|
30
|
+
// Tier-1 traversal by default (compact rows: id, gig_id, agent, phase, content_sha, preview,
|
|
31
|
+
// storage_ref…). `output_id`/`content_sha` + `include_data:true` is the deeper second pass —
|
|
32
|
+
// it fetches ONE output's full payload from the artifact tier (local mirror, or remote when drained).
|
|
33
|
+
{ slug: "output_query", category: "understand", input_schema: obj({ domain_type: "string", gig_id: "string", agent_slug: "string", data_filter: "object", output_id: "string", content_sha: "string", include_data: "boolean" }), output_schema: obj({ outputs: "array", total_count: "number" }) },
|
|
25
34
|
{ slug: "output_trace", category: "understand", input_schema: obj({ output_id: "string", direction: "string", max_depth: "number" }), output_schema: obj({ graph: "object", root_signals: "array", terminal_outputs: "array" }) },
|
|
26
35
|
{ slug: "charter_read", category: "understand", input_schema: obj({ path: "string" }), output_schema: obj({ products: "array", goals: "array", pain_points: "array", tech_stack: "array", access_grants: "array" }) },
|
|
27
36
|
// #217 — advertised contract == handler. The five filters src/server.ts actually reads, and
|