@eir-labs/coltrane 0.7.2 → 0.7.3
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/agents/lineage-scout-external.json +25 -0
- package/agents/lineage-scout-internal.json +32 -0
- package/agents/lineage-scribe.json +21 -0
- package/agents/lineage-weaver.json +23 -0
- package/dist/src/cli.d.ts +1 -1
- package/dist/src/genome_schema.d.ts +73 -0
- package/dist/src/genome_schema.js +33 -0
- package/dist/src/genome_schema.js.map +1 -1
- package/dist/src/mcp.js +12 -0
- package/dist/src/mcp.js.map +1 -1
- package/dist/src/reuse.d.ts +15 -0
- package/dist/src/reuse.js.map +1 -1
- package/dist/src/runtime.js +19 -1
- package/dist/src/runtime.js.map +1 -1
- package/dist/src/server.d.ts +5 -0
- package/dist/src/server.js +71 -0
- package/dist/src/server.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/worker.d.ts +46 -0
- package/dist/src/worker.js +128 -0
- package/dist/src/worker.js.map +1 -1
- package/domain_types/alignment-plan.json +16 -0
- package/domain_types/internal-inventory.json +26 -0
- package/domain_types/lineage-hit.json +19 -0
- package/domain_types/lineage-map.json +32 -0
- package/domain_types/lineage-question.json +17 -0
- package/domain_types/lineage-record.json +19 -0
- package/domain_types/lineage-verdict.json +16 -0
- package/package.json +1 -1
- package/standards/lineage-pass-v1.json +96 -0
- package/dist/src/conduct_daemon.d.ts +0 -59
- package/dist/src/conduct_daemon.js +0 -178
- package/dist/src/conduct_daemon.js.map +0 -1
- package/dist/src/play_worker.d.ts +0 -24
- package/dist/src/play_worker.js +0 -49
- package/dist/src/play_worker.js.map +0 -1
- package/dist/src/supabase_genome.d.ts +0 -28
- package/dist/src/supabase_genome.js +0 -49
- package/dist/src/supabase_genome.js.map +0 -1
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import type { AgentInvoker, ChairSelector } from "./runtime.js";
|
|
2
|
-
export type { ChairSelector };
|
|
3
|
-
export interface MaintainerPort {
|
|
4
|
-
ask(question: string, options: readonly string[]): Promise<{
|
|
5
|
-
choice: string;
|
|
6
|
-
}>;
|
|
7
|
-
}
|
|
8
|
-
export interface PersonaRouter {
|
|
9
|
-
/** Default sink for member requests — personal instance only. */
|
|
10
|
-
to_personal(payload: unknown): Promise<void>;
|
|
11
|
-
/** The ONLY institutional sink; reachable solely through publish_to_institution. */
|
|
12
|
-
to_signal_input(payload: unknown): Promise<void>;
|
|
13
|
-
}
|
|
14
|
-
export interface RigorGate {
|
|
15
|
-
admits(payload: unknown): boolean | Promise<boolean>;
|
|
16
|
-
}
|
|
17
|
-
export interface ConductDaemonOptions {
|
|
18
|
-
invoke: AgentInvoker;
|
|
19
|
-
maintainer: MaintainerPort;
|
|
20
|
-
/** Routing law seam — deny-by-default when omitted. */
|
|
21
|
-
router?: PersonaRouter | undefined;
|
|
22
|
-
/** Rigor gate seam — deny-by-default (admits=false) when omitted. */
|
|
23
|
-
rigor?: RigorGate | undefined;
|
|
24
|
-
/** Optional routing hook wired to the existing ChairSelector seam. */
|
|
25
|
-
selectChairs?: ChairSelector | undefined;
|
|
26
|
-
}
|
|
27
|
-
interface StanceTask {
|
|
28
|
-
stance: string;
|
|
29
|
-
result?: Record<string, unknown>;
|
|
30
|
-
}
|
|
31
|
-
export interface ConductStop {
|
|
32
|
-
maxIterations: number;
|
|
33
|
-
}
|
|
34
|
-
export interface ConductDaemon {
|
|
35
|
-
fan_out(stances: string[]): Promise<StanceTask[]>;
|
|
36
|
-
cross_review(): Promise<void>;
|
|
37
|
-
synthesize(): Promise<void>;
|
|
38
|
-
/** Non-blocking background merge of a settled result into the artifact. */
|
|
39
|
-
fold_back(result: Record<string, unknown>): void;
|
|
40
|
-
adjudicate(): Promise<{
|
|
41
|
-
choice: string;
|
|
42
|
-
} | null>;
|
|
43
|
-
settle(): Promise<string>;
|
|
44
|
-
duetto_declare(payload: unknown): string;
|
|
45
|
-
duetto_receive(id: string): Promise<unknown>;
|
|
46
|
-
/** Resident loop: fan_out → cross_review → synthesize → adjudicate → settle. */
|
|
47
|
-
run(stop: ConductStop): Promise<string>;
|
|
48
|
-
/** Test hook — forces the artifact into a non-unanimous state. */
|
|
49
|
-
_forceNonUnanimous(): void;
|
|
50
|
-
/** Routes member request to personal instance only; appends to shared scratchpad. */
|
|
51
|
-
route_member_request(payload: unknown): Promise<void>;
|
|
52
|
-
/** The rigor gate — the ONLY path to router.to_signal_input. */
|
|
53
|
-
publish_to_institution(payload: unknown): Promise<{
|
|
54
|
-
published: boolean;
|
|
55
|
-
}>;
|
|
56
|
-
/** Read-only view of the single shared scratchpad accumulator. */
|
|
57
|
-
read_scratchpad(): readonly unknown[];
|
|
58
|
-
}
|
|
59
|
-
export declare function makeConductDaemon(opts: ConductDaemonOptions): ConductDaemon;
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* conduct_daemon.ts — A9: the conduct daemon (podium + persona).
|
|
3
|
-
*
|
|
4
|
-
* Runs the nine conduct verbs as a resident loop over a single content-addressed
|
|
5
|
-
* conductor artifact. The coordinator's own model calls go through the INJECTED
|
|
6
|
-
* `invoke` seam (AgentInvoker → Bifrost in production) — no hardcoded vendor or
|
|
7
|
-
* model name appears here. Adjudication escalates through the INJECTED
|
|
8
|
-
* MaintainerPort — no Slack room id, ant-farm vocabulary, or HTTP transport
|
|
9
|
-
* appears here. Both seams are deny-by-default; tests pass spies; production
|
|
10
|
-
* passes makeBifrostInvoker(...) and a concrete adapter.
|
|
11
|
-
*/
|
|
12
|
-
import { createHash } from "node:crypto";
|
|
13
|
-
// Deny-by-default implementations — used when caller does not inject a seam.
|
|
14
|
-
// Personal sink is a no-op (safe); institutional sink is unreachable (rigor denies).
|
|
15
|
-
const DENY_ROUTER = {
|
|
16
|
-
async to_personal(_payload) { },
|
|
17
|
-
async to_signal_input(_payload) { },
|
|
18
|
-
};
|
|
19
|
-
const DENY_RIGOR = {
|
|
20
|
-
admits(_payload) { return false; },
|
|
21
|
-
};
|
|
22
|
-
export function makeConductDaemon(opts) {
|
|
23
|
-
const { invoke, maintainer } = opts;
|
|
24
|
-
const router = opts.router ?? DENY_ROUTER;
|
|
25
|
-
const rigor = opts.rigor ?? DENY_RIGOR;
|
|
26
|
-
const artifact = {
|
|
27
|
-
stances: [],
|
|
28
|
-
reviews: [],
|
|
29
|
-
synthesis: undefined,
|
|
30
|
-
unanimous: undefined,
|
|
31
|
-
open_questions: [],
|
|
32
|
-
settled: false,
|
|
33
|
-
content_sha: undefined,
|
|
34
|
-
};
|
|
35
|
-
// Single scratchpad accumulator — one box shared by all interfaces (Slack/X/MCP/browser).
|
|
36
|
-
const scratchpad = [];
|
|
37
|
-
// Duetto handshake registry: id → payload (declare immediately resolves).
|
|
38
|
-
const duettoStore = new Map();
|
|
39
|
-
let duettoCounter = 0;
|
|
40
|
-
// Minimal AgentInvocationContext builder — the daemon constructs coordination
|
|
41
|
-
// contexts for its own model calls. The invoke spy in tests only reads
|
|
42
|
-
// ctx.phase and ctx.agent.slug; Bifrost reads those plus model_tier.
|
|
43
|
-
function makeCtx(slug, phase, gigInput) {
|
|
44
|
-
return {
|
|
45
|
-
agent: {
|
|
46
|
-
slug,
|
|
47
|
-
output_types: [],
|
|
48
|
-
input_types: [],
|
|
49
|
-
},
|
|
50
|
-
phase,
|
|
51
|
-
inputs: [],
|
|
52
|
-
gig_input: gigInput,
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
const daemon = {
|
|
56
|
-
async fan_out(stances) {
|
|
57
|
-
artifact.stances = [];
|
|
58
|
-
for (const stance of stances) {
|
|
59
|
-
// Route through the injected invoke seam — never a hardcoded invoker.
|
|
60
|
-
const result = await invoke(makeCtx(`fan-out/${stance}`, "fan_out", { stance }));
|
|
61
|
-
artifact.stances.push({ stance, result });
|
|
62
|
-
}
|
|
63
|
-
return artifact.stances.slice();
|
|
64
|
-
},
|
|
65
|
-
async cross_review() {
|
|
66
|
-
artifact.reviews = [];
|
|
67
|
-
for (const reviewer of artifact.stances) {
|
|
68
|
-
for (const target of artifact.stances) {
|
|
69
|
-
if (reviewer.stance === target.stance)
|
|
70
|
-
continue;
|
|
71
|
-
const result = await invoke(makeCtx(`cross-review/${reviewer.stance}→${target.stance}`, "cross_review", { reviewer_stance: reviewer.stance, target_stance: target.stance }));
|
|
72
|
-
artifact.reviews.push({
|
|
73
|
-
reviewer_stance: reviewer.stance,
|
|
74
|
-
target_stance: target.stance,
|
|
75
|
-
result,
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
async synthesize() {
|
|
81
|
-
const result = await invoke(makeCtx("synthesize", "synthesize", {
|
|
82
|
-
stances: artifact.stances.map((s) => s.stance),
|
|
83
|
-
review_count: artifact.reviews.length,
|
|
84
|
-
}));
|
|
85
|
-
artifact.synthesis = result;
|
|
86
|
-
// Unanimous when only one stance (no conflicting reviews possible) or
|
|
87
|
-
// when the daemon hasn't been told otherwise via _forceNonUnanimous().
|
|
88
|
-
if (artifact.unanimous === undefined) {
|
|
89
|
-
artifact.unanimous = artifact.stances.length <= 1;
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
fold_back(result) {
|
|
93
|
-
// Non-blocking — fire and forget; swallowed errors are intentional (observability can't sink the loop).
|
|
94
|
-
Promise.resolve().then(() => {
|
|
95
|
-
if (!artifact.settled) {
|
|
96
|
-
artifact.synthesis = { ...(artifact.synthesis ?? {}), ...result };
|
|
97
|
-
}
|
|
98
|
-
}).catch(() => { });
|
|
99
|
-
},
|
|
100
|
-
async adjudicate() {
|
|
101
|
-
if (artifact.unanimous !== false) {
|
|
102
|
-
// Unanimous (or single-stance, or no synthesis yet) — no escalation.
|
|
103
|
-
return null;
|
|
104
|
-
}
|
|
105
|
-
const question = "Synthesis is non-unanimous — how should this proceed?";
|
|
106
|
-
const options = [
|
|
107
|
-
"Accept majority view",
|
|
108
|
-
"Request additional stances",
|
|
109
|
-
"Defer to maintainer judgment",
|
|
110
|
-
];
|
|
111
|
-
const choice = await maintainer.ask(question, options);
|
|
112
|
-
artifact.open_questions.push({ question, choice: choice.choice });
|
|
113
|
-
return choice;
|
|
114
|
-
},
|
|
115
|
-
async settle() {
|
|
116
|
-
// Serialize only the stable structural fields (not ephemeral pointers).
|
|
117
|
-
const snapshot = JSON.stringify({
|
|
118
|
-
stances: artifact.stances.map((s) => s.stance),
|
|
119
|
-
reviews: artifact.reviews.map((r) => ({
|
|
120
|
-
reviewer_stance: r.reviewer_stance,
|
|
121
|
-
target_stance: r.target_stance,
|
|
122
|
-
})),
|
|
123
|
-
synthesis_keys: Object.keys(artifact.synthesis ?? {}).sort(),
|
|
124
|
-
unanimous: artifact.unanimous ?? true,
|
|
125
|
-
open_questions: artifact.open_questions.map((q) => q.question).sort(),
|
|
126
|
-
});
|
|
127
|
-
const sha = createHash("sha256").update(snapshot).digest("hex");
|
|
128
|
-
artifact.settled = true;
|
|
129
|
-
artifact.content_sha = sha;
|
|
130
|
-
return sha;
|
|
131
|
-
},
|
|
132
|
-
duetto_declare(payload) {
|
|
133
|
-
const id = `duetto-${++duettoCounter}`;
|
|
134
|
-
duettoStore.set(id, payload);
|
|
135
|
-
return id;
|
|
136
|
-
},
|
|
137
|
-
async duetto_receive(id) {
|
|
138
|
-
if (!duettoStore.has(id)) {
|
|
139
|
-
throw new Error(`duetto not found: ${id}`);
|
|
140
|
-
}
|
|
141
|
-
return duettoStore.get(id);
|
|
142
|
-
},
|
|
143
|
-
async run(stop) {
|
|
144
|
-
let iterations = 0;
|
|
145
|
-
while (iterations < stop.maxIterations) {
|
|
146
|
-
iterations++;
|
|
147
|
-
if (artifact.stances.length === 0)
|
|
148
|
-
break;
|
|
149
|
-
await daemon.cross_review();
|
|
150
|
-
await daemon.synthesize();
|
|
151
|
-
if (artifact.unanimous === false) {
|
|
152
|
-
await daemon.adjudicate();
|
|
153
|
-
}
|
|
154
|
-
if (artifact.settled || artifact.open_questions.length === 0)
|
|
155
|
-
break;
|
|
156
|
-
}
|
|
157
|
-
return daemon.settle();
|
|
158
|
-
},
|
|
159
|
-
_forceNonUnanimous() {
|
|
160
|
-
artifact.unanimous = false;
|
|
161
|
-
},
|
|
162
|
-
async route_member_request(payload) {
|
|
163
|
-
scratchpad.push(payload);
|
|
164
|
-
await router.to_personal(payload);
|
|
165
|
-
},
|
|
166
|
-
async publish_to_institution(payload) {
|
|
167
|
-
if (!(await rigor.admits(payload)))
|
|
168
|
-
return { published: false };
|
|
169
|
-
await router.to_signal_input(payload);
|
|
170
|
-
return { published: true };
|
|
171
|
-
},
|
|
172
|
-
read_scratchpad() {
|
|
173
|
-
return scratchpad.slice();
|
|
174
|
-
},
|
|
175
|
-
};
|
|
176
|
-
return daemon;
|
|
177
|
-
}
|
|
178
|
-
//# sourceMappingURL=conduct_daemon.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"conduct_daemon.js","sourceRoot":"","sources":["../../src/conduct_daemon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AA0BzC,6EAA6E;AAC7E,qFAAqF;AACrF,MAAM,WAAW,GAAkB;IACjC,KAAK,CAAC,WAAW,CAAC,QAAiB,IAA8D,CAAC;IAClG,KAAK,CAAC,eAAe,CAAC,QAAiB,IAAmE,CAAC;CAC5G,CAAC;AACF,MAAM,UAAU,GAAc;IAC5B,MAAM,CAAC,QAAiB,IAAa,OAAO,KAAK,CAAC,CAAC,CAAC;CACrD,CAAC;AAsEF,MAAM,UAAU,iBAAiB,CAAC,IAA0B;IAC1D,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;IACpC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,WAAW,CAAC;IAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,UAAU,CAAC;IAEvC,MAAM,QAAQ,GAAsB;QAClC,OAAO,EAAE,EAAE;QAC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K,CAAC;oBAAE,MAAM;YACtE,CAAC;YACD,OAAO,MAAM,CAAC,MAAM,EAAE,CAAC;QACzB,CAAC;QAED,kBAAkB;YAChB,QAAQ,CAAC,SAAS,GAAG,KAAK,CAAC;QAC7B,CAAC;QAED,KAAK,CAAC,oBAAoB,CAAC,OAAgB;YACzC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACzB,MAAM,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACpC,CAAC;QAED,KAAK,CAAC,sBAAsB,CAAC,OAAgB;YAC3C,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;gBAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;YAChE,MAAM,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;YACtC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAC7B,CAAC;QAED,eAAe;YACb,OAAO,UAAU,CAAC,KAAK,EAAE,CAAC;QAC5B,CAAC;KACF,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export declare const GIG_BRANCH_RE: RegExp;
|
|
2
|
-
export declare function gigBranchName(queueId: string): string;
|
|
3
|
-
export declare function assertGigBranchLaw(branch: string): void;
|
|
4
|
-
export declare function defaultStagesDir(root?: string): string;
|
|
5
|
-
export interface GitDeps {
|
|
6
|
-
run(bin: string, args: readonly string[]): string;
|
|
7
|
-
}
|
|
8
|
-
export declare function stageGig(opts: {
|
|
9
|
-
repo_url: string;
|
|
10
|
-
queue_id: string;
|
|
11
|
-
stage_dir: string;
|
|
12
|
-
operator_tree?: string;
|
|
13
|
-
}, deps?: GitDeps): {
|
|
14
|
-
stage_dir: string;
|
|
15
|
-
branch: string;
|
|
16
|
-
repo_url: string;
|
|
17
|
-
};
|
|
18
|
-
export declare function publishGig(opts: {
|
|
19
|
-
stage_dir: string;
|
|
20
|
-
branch: string;
|
|
21
|
-
}, deps?: GitDeps): {
|
|
22
|
-
pushed: true;
|
|
23
|
-
branch: string;
|
|
24
|
-
};
|
package/dist/src/play_worker.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import * as path from "node:path";
|
|
2
|
-
import { execFileSync } from "node:child_process";
|
|
3
|
-
export const GIG_BRANCH_RE = /^gig\/[a-z0-9]{8}$/;
|
|
4
|
-
export function gigBranchName(queueId) {
|
|
5
|
-
const id8 = queueId.toLowerCase().slice(0, 8);
|
|
6
|
-
if (!/^[a-z0-9]{8}$/.test(id8)) {
|
|
7
|
-
throw new Error(`gigBranchName: queue id must yield 8 [a-z0-9] chars, got "${id8}"`);
|
|
8
|
-
}
|
|
9
|
-
return `gig/${id8}`;
|
|
10
|
-
}
|
|
11
|
-
export function assertGigBranchLaw(branch) {
|
|
12
|
-
if (!GIG_BRANCH_RE.test(branch)) {
|
|
13
|
-
throw new Error(`assertGigBranchLaw: branch "${branch}" violates the gig branch law (must match ${GIG_BRANCH_RE})`);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
export function defaultStagesDir(root) {
|
|
17
|
-
const override = process.env["COLTRANE_STAGES_DIR"];
|
|
18
|
-
if (override && override.length > 0)
|
|
19
|
-
return override;
|
|
20
|
-
if (root)
|
|
21
|
-
return path.join(root, ".coltrane", "stages");
|
|
22
|
-
const home = process.env["HOME"] ?? process.env["USERPROFILE"] ?? ".";
|
|
23
|
-
return path.join(home, ".eir", "coltrane_stages");
|
|
24
|
-
}
|
|
25
|
-
const defaultDeps = {
|
|
26
|
-
run(bin, args) {
|
|
27
|
-
return execFileSync(bin, args, { encoding: "utf8" });
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
export function stageGig(opts, deps = defaultDeps) {
|
|
31
|
-
const branch = gigBranchName(opts.queue_id);
|
|
32
|
-
const stageAbs = path.resolve(opts.stage_dir);
|
|
33
|
-
const operatorTree = path.resolve(opts.operator_tree ?? process.cwd());
|
|
34
|
-
// Fail closed: stage must not be or overlap with the operator working tree
|
|
35
|
-
if (stageAbs === operatorTree ||
|
|
36
|
-
stageAbs.startsWith(operatorTree + path.sep) ||
|
|
37
|
-
operatorTree.startsWith(stageAbs + path.sep)) {
|
|
38
|
-
throw new Error(`stageGig: stage must be a fresh clone, not the operator working tree (stage="${stageAbs}", operator="${operatorTree}")`);
|
|
39
|
-
}
|
|
40
|
-
deps.run("git", ["clone", "--depth", "1", opts.repo_url, stageAbs]);
|
|
41
|
-
deps.run("git", ["-C", stageAbs, "checkout", "-b", branch]);
|
|
42
|
-
return { stage_dir: stageAbs, branch, repo_url: opts.repo_url };
|
|
43
|
-
}
|
|
44
|
-
export function publishGig(opts, deps = defaultDeps) {
|
|
45
|
-
assertGigBranchLaw(opts.branch);
|
|
46
|
-
deps.run("git", ["-C", opts.stage_dir, "push", "-u", "origin", opts.branch]);
|
|
47
|
-
return { pushed: true, branch: opts.branch };
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=play_worker.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"play_worker.js","sourceRoot":"","sources":["../../src/play_worker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,CAAC,MAAM,aAAa,GAAW,oBAAoB,CAAC;AAE1D,MAAM,UAAU,aAAa,CAAC,OAAe;IAC3C,MAAM,GAAG,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9C,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CACb,6DAA6D,GAAG,GAAG,CACpE,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,GAAG,EAAE,CAAC;AACtB,CAAC;AAED,MAAM,UAAU,kBAA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,CAAC,UAAU,CAAC,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC;QAC5C,YAAY,CAAC,UAAU,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,EAC5C,CAAC;QACD,MAAM,IAAI,KAAK,CACb,gFAAgF,QAAQ,gBAAgB,YAAY,IAAI,CACzH,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;IACpE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IAE5D,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC;AAClE,CAAC;AAED,MAAM,UAAU,UAAU,CACxB,IAA2C,EAC3C,OAAgB,WAAW;IAE3B,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAChC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7E,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;AAC/C,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { LoadedGenome } from "./loader.js";
|
|
2
|
-
export interface SupabaseGenomeConfig {
|
|
3
|
-
url: string;
|
|
4
|
-
key: string;
|
|
5
|
-
token?: string;
|
|
6
|
-
}
|
|
7
|
-
export type SupabaseClientLike = {
|
|
8
|
-
from(table: string): unknown;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Reads COLTRANE_SUPABASE_URL + COLTRANE_SUPABASE_KEY from the given env dict.
|
|
12
|
-
* Returns a SupabaseGenomeConfig only when both are present and non-empty strings.
|
|
13
|
-
* COLTRANE_SUPABASE_TOKEN is optional; when absent the returned object has no `token` key.
|
|
14
|
-
*/
|
|
15
|
-
export declare function supabaseGenomeConfigFromEnv(env?: NodeJS.ProcessEnv): SupabaseGenomeConfig | null;
|
|
16
|
-
/**
|
|
17
|
-
* Load the coltrane genome from a Supabase-hosted store.
|
|
18
|
-
*
|
|
19
|
-
* A0 ships the SEAM only: the client is accepted/used here so the injection point
|
|
20
|
-
* is established; the concrete row→LoadedGenome query mapping is the next chunk.
|
|
21
|
-
*
|
|
22
|
-
* When opts.client is injected (tests always do this) no @supabase/supabase-js import
|
|
23
|
-
* occurs. Without injection the package is lazy-imported and a real client is constructed
|
|
24
|
-
* (cfg.token is forwarded as the Authorization header for future RLS scoping).
|
|
25
|
-
*/
|
|
26
|
-
export declare function loadGenomeFromSupabase(cfg: SupabaseGenomeConfig, opts?: {
|
|
27
|
-
client?: SupabaseClientLike;
|
|
28
|
-
}): Promise<LoadedGenome>;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Reads COLTRANE_SUPABASE_URL + COLTRANE_SUPABASE_KEY from the given env dict.
|
|
3
|
-
* Returns a SupabaseGenomeConfig only when both are present and non-empty strings.
|
|
4
|
-
* COLTRANE_SUPABASE_TOKEN is optional; when absent the returned object has no `token` key.
|
|
5
|
-
*/
|
|
6
|
-
export function supabaseGenomeConfigFromEnv(env = process.env) {
|
|
7
|
-
const url = env["COLTRANE_SUPABASE_URL"];
|
|
8
|
-
const key = env["COLTRANE_SUPABASE_KEY"];
|
|
9
|
-
if (!url || !key)
|
|
10
|
-
return null;
|
|
11
|
-
const token = env["COLTRANE_SUPABASE_TOKEN"];
|
|
12
|
-
return token ? { url, key, token } : { url, key };
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Load the coltrane genome from a Supabase-hosted store.
|
|
16
|
-
*
|
|
17
|
-
* A0 ships the SEAM only: the client is accepted/used here so the injection point
|
|
18
|
-
* is established; the concrete row→LoadedGenome query mapping is the next chunk.
|
|
19
|
-
*
|
|
20
|
-
* When opts.client is injected (tests always do this) no @supabase/supabase-js import
|
|
21
|
-
* occurs. Without injection the package is lazy-imported and a real client is constructed
|
|
22
|
-
* (cfg.token is forwarded as the Authorization header for future RLS scoping).
|
|
23
|
-
*/
|
|
24
|
-
export async function loadGenomeFromSupabase(cfg, opts) {
|
|
25
|
-
let client;
|
|
26
|
-
if (opts?.client !== undefined) {
|
|
27
|
-
client = opts.client;
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
const { createClient } = await import("@supabase/supabase-js");
|
|
31
|
-
const authOpts = cfg.token
|
|
32
|
-
? { global: { headers: { Authorization: `Bearer ${cfg.token}` } } }
|
|
33
|
-
: undefined;
|
|
34
|
-
client = createClient(cfg.url, cfg.key, authOpts);
|
|
35
|
-
}
|
|
36
|
-
// A0: DB row→LoadedGenome mapping deferred to the schema chunk.
|
|
37
|
-
// Call client.from to establish the seam and confirm the client is wired.
|
|
38
|
-
void client.from("genomes");
|
|
39
|
-
return {
|
|
40
|
-
core_types: new Map(),
|
|
41
|
-
domain_types: new Map(),
|
|
42
|
-
agents: new Map(),
|
|
43
|
-
standards: new Map(),
|
|
44
|
-
skills: new Map(),
|
|
45
|
-
evals: new Map(),
|
|
46
|
-
load_errors: [],
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=supabase_genome.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"supabase_genome.js","sourceRoot":"","sources":["../../src/supabase_genome.ts"],"names":[],"mappings":"AAcA;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CACzC,MAAyB,OAAO,CAAC,GAAG;IAEpC,MAAM,GAAG,GAAG,GAAG,CAAC,uBAAuB,CAAC,CAAC;IACzC,MAAM,GAAG,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