@pome-sh/cli 0.21.10 → 0.21.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/dist/build-info.json +3 -3
- package/dist/{checks-ZWCORWK4.js → checks-FLXH5OG3.js} +1 -1
- package/dist/{chunk-BK7HSHRA.js → chunk-563RZ7P3.js} +16 -16
- package/dist/{chunk-5TEVH6RY.js → chunk-6BCL7HYR.js} +2 -2
- package/dist/{chunk-F7YLHTCM.js → chunk-75SDBO3W.js} +1 -1
- package/dist/{chunk-PRCZLT4W.js → chunk-EI5ECLLN.js} +2 -2
- package/dist/{chunk-2CMCN5PW.js → chunk-OR4X4BIY.js} +2 -2
- package/dist/{chunk-35TG2GHS.js → chunk-TV5S6WQV.js} +182 -4
- package/dist/{runDemo-7NYX7S5T.js → runDemo-7ZNVR4GX.js} +5 -5
- package/dist/{runTrialGroup-BYUY5WJ7.js → runTrialGroup-7KEOFQEU.js} +4 -4
- package/dist/{server-NJBWJIS3.js → server-DR56XIGP.js} +1 -1
- package/dist/src/cli/main.js +13 -13
- package/dist/{src-TKGHXPEM.js → src-B63VPRRZ.js} +69 -1162
- package/dist/{src-CI5W335G.js → src-JWB5RQSN.js} +66 -331
- package/dist/{src-WQE3MFBD.js → src-RDRKZ4FM.js} +116 -87
- package/dist/{src-4ZLCEPCN.js → src-RUUCDQU4.js} +108 -137
- package/dist/{src-PJGE6SSY.js → src-YH33B2LP.js} +74 -47
- package/dist/twinHarness-4RDIJIM7.js +5 -0
- package/dist/{twinStart-5ZWCVBPZ.js → twinStart-Y525LQUR.js} +3 -3
- package/package.json +1 -1
- package/dist/twinHarness-CJX3IXR3.js +0 -5
package/dist/build-info.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"package": "pome-sh",
|
|
3
|
-
"version": "0.21.
|
|
4
|
-
"git_sha": "
|
|
5
|
-
"build_time": "2026-08-
|
|
3
|
+
"version": "0.21.12",
|
|
4
|
+
"git_sha": "013cfce31a6025daeedeb4c2bd47edd3db56b85a",
|
|
5
|
+
"build_time": "2026-08-07T08:56:26.617Z"
|
|
6
6
|
}
|
|
@@ -183,7 +183,7 @@ async function checkTwinReachable(_configDir) {
|
|
|
183
183
|
});
|
|
184
184
|
let harness;
|
|
185
185
|
try {
|
|
186
|
-
const { bootTwin } = await import('./twinHarness-
|
|
186
|
+
const { bootTwin } = await import('./twinHarness-4RDIJIM7.js');
|
|
187
187
|
harness = await bootTwin({
|
|
188
188
|
twin: "github",
|
|
189
189
|
seedState: void 0,
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
// ../packages/twin-github/package.json
|
|
2
2
|
var package_default = {
|
|
3
|
-
version: "0.9.
|
|
3
|
+
version: "0.9.2"};
|
|
4
4
|
|
|
5
5
|
// ../packages/twin-slack/package.json
|
|
6
6
|
var package_default2 = {
|
|
7
|
-
version: "0.3.
|
|
7
|
+
version: "0.3.5"};
|
|
8
8
|
|
|
9
9
|
// ../packages/twin-stripe/package.json
|
|
10
10
|
var package_default3 = {
|
|
11
|
-
version: "0.4.
|
|
11
|
+
version: "0.4.6"};
|
|
12
12
|
|
|
13
13
|
// ../packages/twin-gmail/package.json
|
|
14
14
|
var package_default4 = {
|
|
15
|
-
version: "0.3.
|
|
15
|
+
version: "0.3.5"};
|
|
16
16
|
|
|
17
17
|
// ../packages/twin-linear/package.json
|
|
18
18
|
var package_default5 = {
|
|
19
|
-
version: "0.3.
|
|
19
|
+
version: "0.3.5"};
|
|
20
20
|
|
|
21
21
|
// src/twin/registry.ts
|
|
22
22
|
var TWIN_NAME_LIST = ["github", "slack", "stripe", "gmail", "linear"];
|
|
@@ -39,7 +39,7 @@ var TWIN_REGISTRY = {
|
|
|
39
39
|
defaultSeedState,
|
|
40
40
|
GitHubDomain,
|
|
41
41
|
openGitHubCloneDatabase
|
|
42
|
-
} = await import('./src-
|
|
42
|
+
} = await import('./src-RDRKZ4FM.js');
|
|
43
43
|
const db = openGitHubCloneDatabase();
|
|
44
44
|
const domain = new GitHubDomain(db);
|
|
45
45
|
domain.seed(seedState === void 0 ? defaultSeedState() : seedState);
|
|
@@ -59,9 +59,9 @@ var TWIN_REGISTRY = {
|
|
|
59
59
|
envName: "SLACK",
|
|
60
60
|
defaultPort: 3333,
|
|
61
61
|
version: package_default2.version,
|
|
62
|
-
defaultSeed: async () => (await import('./src-
|
|
62
|
+
defaultSeed: async () => (await import('./src-RUUCDQU4.js')).defaultSeedState(),
|
|
63
63
|
async boot({ seedState, runId, recorder }) {
|
|
64
|
-
const { createSlackTwinApp, openSlackTwinDatabase, SlackDomain } = await import('./src-
|
|
64
|
+
const { createSlackTwinApp, openSlackTwinDatabase, SlackDomain } = await import('./src-RUUCDQU4.js');
|
|
65
65
|
const db = openSlackTwinDatabase(":memory:");
|
|
66
66
|
const domain = new SlackDomain(db);
|
|
67
67
|
domain.applySeed(seedState);
|
|
@@ -84,10 +84,10 @@ var TWIN_REGISTRY = {
|
|
|
84
84
|
envName: "STRIPE",
|
|
85
85
|
defaultPort: 3333,
|
|
86
86
|
version: package_default3.version,
|
|
87
|
-
defaultSeed: async () => (await import('./src-
|
|
87
|
+
defaultSeed: async () => (await import('./src-YH33B2LP.js')).defaultSeed(),
|
|
88
88
|
async boot({ seedState, runId, recorder, twinBaseUrl }) {
|
|
89
|
-
const stripeTwin = await import('./src-
|
|
90
|
-
const { createApp } = await import('./server-
|
|
89
|
+
const stripeTwin = await import('./src-YH33B2LP.js');
|
|
90
|
+
const { createApp } = await import('./server-DR56XIGP.js');
|
|
91
91
|
const {
|
|
92
92
|
applySeed: applyStripeSeed,
|
|
93
93
|
createTwinStripeApp,
|
|
@@ -128,9 +128,9 @@ var TWIN_REGISTRY = {
|
|
|
128
128
|
portEnvName: "GMAIL_TWIN_PORT",
|
|
129
129
|
tokenEnvName: "POME_GMAIL_TOKEN",
|
|
130
130
|
version: package_default4.version,
|
|
131
|
-
defaultSeed: async () => (await import('./src-
|
|
131
|
+
defaultSeed: async () => (await import('./src-B63VPRRZ.js')).defaultSeedState(),
|
|
132
132
|
async boot({ seedState, runId, recorder }) {
|
|
133
|
-
const { createGmailTwinApp, GmailDomain, openGmailTwinDatabase, parseSeed } = await import('./src-
|
|
133
|
+
const { createGmailTwinApp, GmailDomain, openGmailTwinDatabase, parseSeed } = await import('./src-B63VPRRZ.js');
|
|
134
134
|
const db = openGmailTwinDatabase(":memory:");
|
|
135
135
|
const seed = parseSeed(seedState);
|
|
136
136
|
const domain = new GmailDomain(db);
|
|
@@ -149,7 +149,7 @@ var TWIN_REGISTRY = {
|
|
|
149
149
|
portEnvName: "LINEAR_TWIN_PORT",
|
|
150
150
|
tokenEnvName: "POME_LINEAR_TOKEN",
|
|
151
151
|
version: package_default5.version,
|
|
152
|
-
defaultSeed: async () => (await import('./src-
|
|
152
|
+
defaultSeed: async () => (await import('./src-JWB5RQSN.js')).defaultSeedState(),
|
|
153
153
|
async boot({ seedState, runId, recorder }) {
|
|
154
154
|
const {
|
|
155
155
|
createLinearTwinApp,
|
|
@@ -157,7 +157,7 @@ var TWIN_REGISTRY = {
|
|
|
157
157
|
LinearDomain,
|
|
158
158
|
openLinearTwinDatabase,
|
|
159
159
|
parseSeed
|
|
160
|
-
} = await import('./src-
|
|
160
|
+
} = await import('./src-JWB5RQSN.js');
|
|
161
161
|
const db = openLinearTwinDatabase(":memory:");
|
|
162
162
|
const seed = parseSeed(seedState);
|
|
163
163
|
const domain = new LinearDomain(db);
|
|
@@ -173,7 +173,7 @@ var TWIN_REGISTRY = {
|
|
|
173
173
|
}
|
|
174
174
|
};
|
|
175
175
|
async function createGitHubSmokeApp() {
|
|
176
|
-
const { createGitHubCloneApp } = await import('./src-
|
|
176
|
+
const { createGitHubCloneApp } = await import('./src-RDRKZ4FM.js');
|
|
177
177
|
return createGitHubCloneApp();
|
|
178
178
|
}
|
|
179
179
|
function defaultPortFor(twin, env = process.env) {
|
|
@@ -2,8 +2,8 @@ import { criterionSchema, finalizeResponseSchema, HostedDiscardRefusedError, Hos
|
|
|
2
2
|
import { seedSchema, parseSeed, defaultSeedState as defaultSeedState$2 } from './chunk-SGDUD7KK.js';
|
|
3
3
|
import { gmailSeedSchema, defaultSeedState } from './chunk-NJ246QPJ.js';
|
|
4
4
|
import { linearSeedSchema, defaultSeedState as defaultSeedState$1 } from './chunk-ZKID2HS3.js';
|
|
5
|
-
import { isTwinName, TWIN_REGISTRY } from './chunk-
|
|
6
|
-
import { toTwinHttpEventRow } from './chunk-
|
|
5
|
+
import { isTwinName, TWIN_REGISTRY } from './chunk-563RZ7P3.js';
|
|
6
|
+
import { toTwinHttpEventRow } from './chunk-TV5S6WQV.js';
|
|
7
7
|
import { redactEvent, redactSecrets } from './chunk-SG6ZTIMT.js';
|
|
8
8
|
import { mkdir, appendFile, writeFile, readFile } from 'node:fs/promises';
|
|
9
9
|
import { existsSync } from 'node:fs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { readManifest, normalizeManifestTwins } from './chunk-KUVTL4NZ.js';
|
|
2
|
-
import { createHostedClient, perTwinReturnedByCloud, parseTaskFile, runAgentCommand, writeRunArtifactsCore, toTwinHttpEvent, redactJsonl, uploadRunBlobs, scoreFromFinalizeResponse, scoreStatus } from './chunk-
|
|
2
|
+
import { createHostedClient, perTwinReturnedByCloud, parseTaskFile, runAgentCommand, writeRunArtifactsCore, toTwinHttpEvent, redactJsonl, uploadRunBlobs, scoreFromFinalizeResponse, scoreStatus } from './chunk-6BCL7HYR.js';
|
|
3
3
|
import { MOUNTED_TWINS, HostedAuthError, HostedDiscardRefusedError, HostedQuotaError, HostedOrchError, HostedTrialError, agentResponseSchema } from './chunk-PQYIAA6K.js';
|
|
4
4
|
import { redactSecrets, redactEvent } from './chunk-SG6ZTIMT.js';
|
|
5
5
|
import { existsSync } from 'node:fs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getAvailablePort } from './chunk-XDU6TD4O.js';
|
|
2
2
|
import { buildEgressAllowlist, readBlockedEgress } from './chunk-CBFKZZBR.js';
|
|
3
|
-
import { parseTaskFile, seedStateForTwin, runAgentCommand, writeRunArtifactsCore } from './chunk-
|
|
4
|
-
import { createRecorder, bootTwin } from './chunk-
|
|
3
|
+
import { parseTaskFile, seedStateForTwin, runAgentCommand, writeRunArtifactsCore } from './chunk-6BCL7HYR.js';
|
|
4
|
+
import { createRecorder, bootTwin } from './chunk-OR4X4BIY.js';
|
|
5
5
|
import { eventSchema } from './chunk-VBATFCWR.js';
|
|
6
6
|
import { redactSecrets, redactEvent } from './chunk-SG6ZTIMT.js';
|
|
7
7
|
import { serve } from '@hono/node-server';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TWIN_NAMES, isTwinName, TWIN_REGISTRY } from './chunk-
|
|
2
|
-
import { createFileBackedRecorderStore, createRecorderStore } from './chunk-
|
|
1
|
+
import { TWIN_NAMES, isTwinName, TWIN_REGISTRY } from './chunk-563RZ7P3.js';
|
|
2
|
+
import { createFileBackedRecorderStore, createRecorderStore } from './chunk-TV5S6WQV.js';
|
|
3
3
|
|
|
4
4
|
// src/recorder/recorder.ts
|
|
5
5
|
function createRecorder(options = {}) {
|
|
@@ -4,7 +4,7 @@ import { z } from 'zod';
|
|
|
4
4
|
import { mkdirSync, openSync, createWriteStream, closeSync, writeFileSync, rmSync, readFileSync, fsync } from 'node:fs';
|
|
5
5
|
import { dirname, join } from 'node:path';
|
|
6
6
|
import { DatabaseSync } from 'node:sqlite';
|
|
7
|
-
import { timingSafeEqual, createHmac, randomBytes, randomUUID } from 'node:crypto';
|
|
7
|
+
import { timingSafeEqual, createHmac, randomBytes, randomUUID, createHash } from 'node:crypto';
|
|
8
8
|
import { verify } from 'hono/jwt';
|
|
9
9
|
|
|
10
10
|
var NodeSqliteTwinDatabase = class {
|
|
@@ -92,6 +92,184 @@ function openTwinDatabase(path = ":memory:", options = {}) {
|
|
|
92
92
|
options.migrate?.(db);
|
|
93
93
|
return db;
|
|
94
94
|
}
|
|
95
|
+
var mcpFixtureSubstrateSchema = z.enum([
|
|
96
|
+
"live-wire-unauth",
|
|
97
|
+
"live-wire-oauth",
|
|
98
|
+
"oss-source",
|
|
99
|
+
"not-captured",
|
|
100
|
+
"twin-code-transcription",
|
|
101
|
+
"twin-authored-from-vendor-docs"
|
|
102
|
+
]);
|
|
103
|
+
var UPSTREAM_SUBSTRATES = /* @__PURE__ */ new Set([
|
|
104
|
+
"live-wire-unauth",
|
|
105
|
+
"live-wire-oauth",
|
|
106
|
+
"oss-source"
|
|
107
|
+
]);
|
|
108
|
+
var TWIN_OWNED_SUBSTRATES = /* @__PURE__ */ new Set([
|
|
109
|
+
"twin-code-transcription",
|
|
110
|
+
"twin-authored-from-vendor-docs"
|
|
111
|
+
]);
|
|
112
|
+
var OSS_SUBSTRATES = /* @__PURE__ */ new Set(["oss-source"]);
|
|
113
|
+
var sha256Hex = z.string().regex(/^[0-9a-f]{64}$/, "must be a lowercase hex sha256");
|
|
114
|
+
var mcpToolFixtureMetaSchema = z.strictObject({
|
|
115
|
+
twin: z.string().min(1),
|
|
116
|
+
substrate: mcpFixtureSubstrateSchema,
|
|
117
|
+
/** Where the listing was read from — a vendor URL, or the twin's own endpoint. */
|
|
118
|
+
endpoint: z.string().min(1),
|
|
119
|
+
method: z.literal("tools/list"),
|
|
120
|
+
protocol: z.string().min(1),
|
|
121
|
+
protocolVersion: z.string().min(1),
|
|
122
|
+
captureDate: z.string().regex(/^\d{4}-\d{2}-\d{2}$/, "must be an ISO date (YYYY-MM-DD)"),
|
|
123
|
+
rawFileSha256: sha256Hex,
|
|
124
|
+
canonicalFileSha256: sha256Hex,
|
|
125
|
+
liveToolCount: z.number().int().positive(),
|
|
126
|
+
liveToolOrder: z.array(z.string().min(1)).min(1),
|
|
127
|
+
/**
|
|
128
|
+
* The configuration the substrate was read under. Mandatory on every
|
|
129
|
+
* upstream substrate for F-1326's reason: the remote GitHub server serves
|
|
130
|
+
* 44 tools at `/mcp/` and 85 at `/mcp/x/all`, so a capture that does not
|
|
131
|
+
* say which one it read is an unstated assumption a consumer cannot argue
|
|
132
|
+
* with.
|
|
133
|
+
*/
|
|
134
|
+
configuration: z.record(z.string(), z.unknown()).optional(),
|
|
135
|
+
/**
|
|
136
|
+
* The public source tree an `oss-source` capture was built from. Mandatory
|
|
137
|
+
* on that substrate and rejected everywhere else: the whole reason to read
|
|
138
|
+
* a vendor's OSS server rather than its wire is that the answer is
|
|
139
|
+
* reproducible, and it is only reproducible from a pinned commit. Same
|
|
140
|
+
* shape and same keys as F-1326's producer writes, so a golden it produced
|
|
141
|
+
* parses here unchanged — which is what F-1327 does when it adopts an
|
|
142
|
+
* upstream capture as a twin's fixture.
|
|
143
|
+
*/
|
|
144
|
+
source: z.strictObject({
|
|
145
|
+
repo: z.string().min(1),
|
|
146
|
+
commit: z.string().min(1),
|
|
147
|
+
package: z.string().min(1),
|
|
148
|
+
language: z.string().min(1).optional()
|
|
149
|
+
}).optional(),
|
|
150
|
+
/** Mandatory on twin-owned substrates: what this is, and what it is not. */
|
|
151
|
+
transcription: z.strictObject({
|
|
152
|
+
readFrom: z.string().min(1),
|
|
153
|
+
contentOrigin: z.string().min(1),
|
|
154
|
+
comparedToUpstream: z.string().min(1)
|
|
155
|
+
}).optional(),
|
|
156
|
+
notes: z.array(z.string()).optional(),
|
|
157
|
+
files: z.strictObject({ raw: z.string().min(1), canonical: z.string().min(1) })
|
|
158
|
+
}).superRefine((meta, ctx) => {
|
|
159
|
+
if (UPSTREAM_SUBSTRATES.has(meta.substrate) && !meta.configuration) {
|
|
160
|
+
ctx.addIssue({
|
|
161
|
+
code: "custom",
|
|
162
|
+
path: ["configuration"],
|
|
163
|
+
message: `substrate '${meta.substrate}' reads a real deployment, so the fixture must declare the configuration it assumed. A capture with no recorded configuration cannot be argued with.`
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
if (TWIN_OWNED_SUBSTRATES.has(meta.substrate) && !meta.transcription) {
|
|
167
|
+
ctx.addIssue({
|
|
168
|
+
code: "custom",
|
|
169
|
+
path: ["transcription"],
|
|
170
|
+
message: `substrate '${meta.substrate}' means nobody read this table from upstream, so the fixture must carry a transcription record saying where the content came from and that it has never been compared to the vendor.`
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
if (OSS_SUBSTRATES.has(meta.substrate) && !meta.source) {
|
|
174
|
+
ctx.addIssue({
|
|
175
|
+
code: "custom",
|
|
176
|
+
path: ["source"],
|
|
177
|
+
message: `substrate '${meta.substrate}' reads a public source tree, so the fixture must pin the repo, commit and package it was built from. An unpinned OSS capture is not reproducible.`
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
if (meta.source && !OSS_SUBSTRATES.has(meta.substrate)) {
|
|
181
|
+
ctx.addIssue({
|
|
182
|
+
code: "custom",
|
|
183
|
+
path: ["source"],
|
|
184
|
+
message: `substrate '${meta.substrate}' does not build from source, so \`source\` is a claim nothing here made.`
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
if (meta.substrate === "not-captured") {
|
|
188
|
+
ctx.addIssue({
|
|
189
|
+
code: "custom",
|
|
190
|
+
path: ["substrate"],
|
|
191
|
+
message: `'not-captured' records the ABSENCE of a listing \u2014 it is legal in the shared vocabulary and on a status file, but not on a tool table a twin serves. Use 'twin-code-transcription' if the table was transcribed from this twin's own code.`
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
var canonicalMcpToolSchema = z.strictObject({
|
|
196
|
+
name: z.string().min(1),
|
|
197
|
+
description: z.string(),
|
|
198
|
+
inputSchema: z.record(z.string(), z.unknown()),
|
|
199
|
+
title: z.string().optional(),
|
|
200
|
+
outputSchema: z.record(z.string(), z.unknown()).optional(),
|
|
201
|
+
annotations: z.record(z.string(), z.unknown()).optional()
|
|
202
|
+
});
|
|
203
|
+
var toolsListEnvelopeSchema = z.object({
|
|
204
|
+
jsonrpc: z.string().min(1),
|
|
205
|
+
id: z.union([z.string(), z.number()]),
|
|
206
|
+
result: z.object({ tools: z.array(canonicalMcpToolSchema).min(1) })
|
|
207
|
+
});
|
|
208
|
+
function sha256(text) {
|
|
209
|
+
return createHash("sha256").update(text, "utf8").digest("hex");
|
|
210
|
+
}
|
|
211
|
+
function loadMcpToolFixture(modules) {
|
|
212
|
+
const parsedMeta = mcpToolFixtureMetaSchema.safeParse(modules.meta);
|
|
213
|
+
if (!parsedMeta.success) {
|
|
214
|
+
throw new Error(`MCP tool fixture: invalid provenance in meta.json \u2014 ${issues(parsedMeta.error)}`);
|
|
215
|
+
}
|
|
216
|
+
const meta = parsedMeta.data;
|
|
217
|
+
const rawBytes = JSON.stringify(modules.raw);
|
|
218
|
+
const actual = sha256(rawBytes);
|
|
219
|
+
if (actual !== meta.rawFileSha256) {
|
|
220
|
+
throw new Error(`MCP tool fixture (${meta.twin}): ${meta.files.raw} hashes to ${actual} but ${meta.files.canonical.replace(/canonical\.json$/, "meta.json")} declares rawFileSha256 ${meta.rawFileSha256}. Either the raw listing was edited by hand or the sha was typed rather than computed; both are a change to what this twin serves.`);
|
|
221
|
+
}
|
|
222
|
+
const parsedRaw = toolsListEnvelopeSchema.safeParse(modules.raw);
|
|
223
|
+
if (!parsedRaw.success) {
|
|
224
|
+
throw new Error(`MCP tool fixture (${meta.twin}): ${meta.files.raw} is not a tools/list envelope \u2014 ${issues(parsedRaw.error)}`);
|
|
225
|
+
}
|
|
226
|
+
const tools = parsedRaw.data.result.tools;
|
|
227
|
+
const toolNames = tools.map((tool) => tool.name);
|
|
228
|
+
const duplicate = toolNames.find((name, index) => toolNames.indexOf(name) !== index);
|
|
229
|
+
if (duplicate) {
|
|
230
|
+
throw new Error(`MCP tool fixture (${meta.twin}): '${duplicate}' is declared twice`);
|
|
231
|
+
}
|
|
232
|
+
if (meta.liveToolCount !== tools.length) {
|
|
233
|
+
throw new Error(`MCP tool fixture (${meta.twin}): meta declares liveToolCount ${meta.liveToolCount} but ${meta.files.raw} carries ${tools.length} tools`);
|
|
234
|
+
}
|
|
235
|
+
if (meta.liveToolOrder.join("\0") !== toolNames.join("\0")) {
|
|
236
|
+
throw new Error(`MCP tool fixture (${meta.twin}): meta.liveToolOrder no longer describes ${meta.files.raw}
|
|
237
|
+
declared: ${meta.liveToolOrder.join(", ")}
|
|
238
|
+
actual: ${toolNames.join(", ")}`);
|
|
239
|
+
}
|
|
240
|
+
return { meta, tools, toolNames };
|
|
241
|
+
}
|
|
242
|
+
function deriveMcpToolTable(fixture, implementations, options = {}) {
|
|
243
|
+
const declared = new Set(fixture.toolNames);
|
|
244
|
+
const undeclared = Object.keys(implementations).filter((name) => !declared.has(name));
|
|
245
|
+
if (undeclared.length > 0) {
|
|
246
|
+
throw new Error(`MCP tool table (${fixture.meta.twin}): ${undeclared.join(", ")} ${undeclared.length === 1 ? "is" : "are"} implemented but absent from ${fixture.meta.files.raw}. The fixture is the tool table; add the tool there (with its provenance) or delete the implementation.`);
|
|
247
|
+
}
|
|
248
|
+
return fixture.tools.map((tool) => {
|
|
249
|
+
const implementation = implementations[tool.name];
|
|
250
|
+
if (!implementation) {
|
|
251
|
+
throw new Error(`MCP tool table (${fixture.meta.twin}): ${fixture.meta.files.raw} declares '${tool.name}' and this twin implements no such tool.`);
|
|
252
|
+
}
|
|
253
|
+
const outputSchema = tool.outputSchema ?? implementation.outputSchema ?? options.outputSchema;
|
|
254
|
+
const includeIsError = implementation.includeIsError ?? options.includeIsError;
|
|
255
|
+
return {
|
|
256
|
+
name: tool.name,
|
|
257
|
+
description: tool.description,
|
|
258
|
+
inputSchema: tool.inputSchema,
|
|
259
|
+
...tool.title !== void 0 ? { title: tool.title } : {},
|
|
260
|
+
...tool.annotations !== void 0 ? { annotations: tool.annotations } : {},
|
|
261
|
+
...outputSchema !== void 0 ? { outputSchema } : {},
|
|
262
|
+
schema: implementation.schema,
|
|
263
|
+
mutation: implementation.mutation,
|
|
264
|
+
...implementation.contentText ? { contentText: implementation.contentText } : {},
|
|
265
|
+
...includeIsError !== void 0 ? { includeIsError } : {},
|
|
266
|
+
handler: implementation.handler
|
|
267
|
+
};
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
function issues(error) {
|
|
271
|
+
return error.issues.map((issue) => `${issue.path.join(".") || "<root>"}: ${issue.message}`).join("; ");
|
|
272
|
+
}
|
|
95
273
|
|
|
96
274
|
// ../packages/sdk/dist/index.js
|
|
97
275
|
var fidelityTierSchema = z.enum(["semantic", "shape", "unsupported"]);
|
|
@@ -107,9 +285,9 @@ function toolListExtras(tool) {
|
|
|
107
285
|
}
|
|
108
286
|
var TwinManifestError = class extends Error {
|
|
109
287
|
issues;
|
|
110
|
-
constructor(message,
|
|
288
|
+
constructor(message, issues2 = []) {
|
|
111
289
|
super(message);
|
|
112
|
-
this.issues =
|
|
290
|
+
this.issues = issues2;
|
|
113
291
|
this.name = "TwinManifestError";
|
|
114
292
|
}
|
|
115
293
|
};
|
|
@@ -1511,4 +1689,4 @@ function unregisterServeShutdown(close) {
|
|
|
1511
1689
|
serveShutdownHooks.delete(close);
|
|
1512
1690
|
}
|
|
1513
1691
|
|
|
1514
|
-
export { FAILURE_INJECTION_OVERRIDE_KEY, POME_RECORDER_EVENTS_PATH, PROVIDER_SHAPED_TEAM_ID, TwinBootError, TwinError, UnknownToolError, bearerAuth, createAdminGate, createApp, createFailureInjectionStore, createFileBackedRecorderStore, createRecorderHandle, createRecorderStore, created, defineTwin, ensureTwinAuthSecret, failureInjectionMiddleware, failureInjectionRuleSchema, formTokenResolver, isLoopbackHost, mintProviderToken, ok, openTwinDatabase, queryTokenResolver, recordedRequestHeaders, requireAdminAuth, resolveAuthSecret, resolveRecorderStore, serve, setClientIp, setRecordedTool, toTwinHttpEventRow, twinBuildInfo, verifyProviderToken };
|
|
1692
|
+
export { FAILURE_INJECTION_OVERRIDE_KEY, POME_RECORDER_EVENTS_PATH, PROVIDER_SHAPED_TEAM_ID, TwinBootError, TwinError, UnknownToolError, bearerAuth, createAdminGate, createApp, createFailureInjectionStore, createFileBackedRecorderStore, createRecorderHandle, createRecorderStore, created, defineTwin, deriveMcpToolTable, ensureTwinAuthSecret, failureInjectionMiddleware, failureInjectionRuleSchema, formTokenResolver, isLoopbackHost, loadMcpToolFixture, mintProviderToken, ok, openTwinDatabase, queryTokenResolver, recordedRequestHeaders, requireAdminAuth, resolveAuthSecret, resolveRecorderStore, serve, setClientIp, setRecordedTool, toTwinHttpEventRow, twinBuildInfo, verifyProviderToken };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { newGroupId, reassuranceBox, twinReadyLine, trialsHeaderLine, trialLine, summaryLines, evaluatingLine, criterionPhrase } from './chunk-RGZBC7NF.js';
|
|
2
2
|
import { DemoCapacityError, capacityLabel, parseCapacityMarker, capacityKindFrom } from './chunk-ZX4WNSZ5.js';
|
|
3
|
-
import { runTask, demoTaskPath, DEMO_TASK_NAME, DEMO_REPO } from './chunk-
|
|
3
|
+
import { runTask, demoTaskPath, DEMO_TASK_NAME, DEMO_REPO } from './chunk-EI5ECLLN.js';
|
|
4
4
|
import { getAvailablePort } from './chunk-XDU6TD4O.js';
|
|
5
5
|
import './chunk-CBFKZZBR.js';
|
|
6
|
-
import { createHostedClient, parseTaskFile, uploadRunBlobs, scoreFromFinalizeResponse, scoreStatus, outcomeOf } from './chunk-
|
|
6
|
+
import { createHostedClient, parseTaskFile, uploadRunBlobs, scoreFromFinalizeResponse, scoreStatus, outcomeOf } from './chunk-6BCL7HYR.js';
|
|
7
7
|
import './chunk-NW7HGA2K.js';
|
|
8
8
|
import { HostedQuotaError, HostedOrchError } from './chunk-PQYIAA6K.js';
|
|
9
9
|
import './chunk-SGDUD7KK.js';
|
|
10
10
|
import './chunk-NJ246QPJ.js';
|
|
11
11
|
import './chunk-ZKID2HS3.js';
|
|
12
|
-
import { bootTwin } from './chunk-
|
|
13
|
-
import './chunk-
|
|
14
|
-
import './chunk-
|
|
12
|
+
import { bootTwin } from './chunk-OR4X4BIY.js';
|
|
13
|
+
import './chunk-563RZ7P3.js';
|
|
14
|
+
import './chunk-TV5S6WQV.js';
|
|
15
15
|
import './chunk-VBATFCWR.js';
|
|
16
16
|
import './chunk-SG6ZTIMT.js';
|
|
17
17
|
import { readFile } from 'node:fs/promises';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { newGroupId, criterionPhrase } from './chunk-RGZBC7NF.js';
|
|
2
|
-
import { runTaskHosted, resolveRunAgentIdentity } from './chunk-
|
|
2
|
+
import { runTaskHosted, resolveRunAgentIdentity } from './chunk-75SDBO3W.js';
|
|
3
3
|
import './chunk-KUVTL4NZ.js';
|
|
4
|
-
import { createHostedClient, parseTaskFile, outcomeOf } from './chunk-
|
|
4
|
+
import { createHostedClient, parseTaskFile, outcomeOf } from './chunk-6BCL7HYR.js';
|
|
5
5
|
import './chunk-NW7HGA2K.js';
|
|
6
6
|
import { HostedQuotaError, HostedTrialError } from './chunk-PQYIAA6K.js';
|
|
7
7
|
import './chunk-SGDUD7KK.js';
|
|
8
8
|
import './chunk-NJ246QPJ.js';
|
|
9
9
|
import './chunk-ZKID2HS3.js';
|
|
10
|
-
import './chunk-
|
|
11
|
-
import './chunk-
|
|
10
|
+
import './chunk-563RZ7P3.js';
|
|
11
|
+
import './chunk-TV5S6WQV.js';
|
|
12
12
|
import './chunk-VBATFCWR.js';
|
|
13
13
|
import './chunk-SG6ZTIMT.js';
|
|
14
14
|
import { randomUUID } from 'node:crypto';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { FAILURE_INJECTION_OVERRIDE_KEY, POME_RECORDER_EVENTS_PATH, PROVIDER_SHAPED_TEAM_ID, TwinBootError, TwinError, UnknownToolError, bearerAuth, createAdminGate, createApp, createFailureInjectionStore, createFileBackedRecorderStore, createRecorderHandle, createRecorderStore, created, ensureTwinAuthSecret, failureInjectionMiddleware, failureInjectionRuleSchema, formTokenResolver, isLoopbackHost, mintProviderToken, ok, queryTokenResolver, recordedRequestHeaders, requireAdminAuth, resolveAuthSecret, resolveRecorderStore, serve, setClientIp, setRecordedTool, toTwinHttpEventRow, twinBuildInfo, verifyProviderToken } from './chunk-
|
|
1
|
+
export { FAILURE_INJECTION_OVERRIDE_KEY, POME_RECORDER_EVENTS_PATH, PROVIDER_SHAPED_TEAM_ID, TwinBootError, TwinError, UnknownToolError, bearerAuth, createAdminGate, createApp, createFailureInjectionStore, createFileBackedRecorderStore, createRecorderHandle, createRecorderStore, created, ensureTwinAuthSecret, failureInjectionMiddleware, failureInjectionRuleSchema, formTokenResolver, isLoopbackHost, mintProviderToken, ok, queryTokenResolver, recordedRequestHeaders, requireAdminAuth, resolveAuthSecret, resolveRecorderStore, serve, setClientIp, setRecordedTool, toTwinHttpEventRow, twinBuildInfo, verifyProviderToken } from './chunk-TV5S6WQV.js';
|
|
2
2
|
import './chunk-VBATFCWR.js';
|
|
3
3
|
export { redactEvent, redactSecrets } from './chunk-SG6ZTIMT.js';
|
package/dist/src/cli/main.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { DEFAULT_CONTROL_PLANE_URL, DEFAULT_DASHBOARD_URL, clearLocalCredentials, friendlyHostedError, runSessionCreate, runSessionList, runSessionStop, resolveCredentials, runTaskHosted, discoverRunSet, loadTrialEvents, persistCredentialsAfterLogin, DEFAULT_DOCS_SITE_ORIGIN, resolveSeams, resolveCachedAgentId, readLinkCache, postAgentResolver, writeLinkCache, ensurePomeGitignored } from '../../chunk-
|
|
2
|
+
import { DEFAULT_CONTROL_PLANE_URL, DEFAULT_DASHBOARD_URL, clearLocalCredentials, friendlyHostedError, runSessionCreate, runSessionList, runSessionStop, resolveCredentials, runTaskHosted, discoverRunSet, loadTrialEvents, persistCredentialsAfterLogin, DEFAULT_DOCS_SITE_ORIGIN, resolveSeams, resolveCachedAgentId, readLinkCache, postAgentResolver, writeLinkCache, ensurePomeGitignored } from '../../chunk-75SDBO3W.js';
|
|
3
3
|
import { readManifest, writeManifest, MANIFEST_JSON, readRequiredManifest, normalizeManifestTwins } from '../../chunk-KUVTL4NZ.js';
|
|
4
|
-
import { assetPath, runTask, resolvePackageRoot, DEMO_TASK_NAME, demoTaskPath } from '../../chunk-
|
|
4
|
+
import { assetPath, runTask, resolvePackageRoot, DEMO_TASK_NAME, demoTaskPath } from '../../chunk-EI5ECLLN.js';
|
|
5
5
|
import '../../chunk-XDU6TD4O.js';
|
|
6
6
|
import '../../chunk-CBFKZZBR.js';
|
|
7
|
-
import { parseTaskFile, scoreStatus, runScoreLine, readLatestRun, readMetaSummary, readConfigTwins, scoreCountsSummary, markerFor, outcomeOf, criterionMarkerLabel, twinSkipSuffix, readCodeCriteria, createHostedClient, toTwinHttpEvent, redactJsonl, scoreFromFinalizeResponse, parseGitHubSeedState, uploadRunBlobs } from '../../chunk-
|
|
7
|
+
import { parseTaskFile, scoreStatus, runScoreLine, readLatestRun, readMetaSummary, readConfigTwins, scoreCountsSummary, markerFor, outcomeOf, criterionMarkerLabel, twinSkipSuffix, readCodeCriteria, createHostedClient, toTwinHttpEvent, redactJsonl, scoreFromFinalizeResponse, parseGitHubSeedState, uploadRunBlobs } from '../../chunk-6BCL7HYR.js';
|
|
8
8
|
import '../../chunk-NW7HGA2K.js';
|
|
9
9
|
import { MOUNTED_TWINS, deriveAgentSlug, exitCodeFor, HostedUsageError, HostedOrchError, HostedAuthError, HostedQuotaError } from '../../chunk-PQYIAA6K.js';
|
|
10
10
|
import { TAPE_ASSERTABLE_TOOLS } from '../../chunk-FKZZWWYC.js';
|
|
@@ -15,9 +15,9 @@ import '../../chunk-NJ246QPJ.js';
|
|
|
15
15
|
import { LINEAR_CHECKS } from '../../chunk-3QVSXFJI.js';
|
|
16
16
|
import '../../chunk-ZKID2HS3.js';
|
|
17
17
|
import { oneOf, defineCheck, repoRef, VACUITY_SENTINEL_NUMBER, childStatePath, VACUITY_SENTINEL, statePath, templateSlots, renderCheck, checksDigest, checkPattern, checkNearMissPattern } from '../../chunk-NY55QTVQ.js';
|
|
18
|
-
import '../../chunk-
|
|
19
|
-
import { TWIN_NAME_LIST, isTwinName, createGitHubSmokeApp } from '../../chunk-
|
|
20
|
-
import '../../chunk-
|
|
18
|
+
import '../../chunk-OR4X4BIY.js';
|
|
19
|
+
import { TWIN_NAME_LIST, isTwinName, createGitHubSmokeApp } from '../../chunk-563RZ7P3.js';
|
|
20
|
+
import '../../chunk-TV5S6WQV.js';
|
|
21
21
|
import { isLegacyEventRow, eventSchema } from '../../chunk-VBATFCWR.js';
|
|
22
22
|
import { redactEvent, redactSecrets } from '../../chunk-SG6ZTIMT.js';
|
|
23
23
|
import { Command } from 'commander';
|
|
@@ -850,7 +850,7 @@ async function throwForStatus(res) {
|
|
|
850
850
|
|
|
851
851
|
// src/task/seed-verifier.ts
|
|
852
852
|
async function verifySeedWithTwin(seed) {
|
|
853
|
-
const { GitHubDomain, openGitHubCloneDatabase } = await import('../../src-
|
|
853
|
+
const { GitHubDomain, openGitHubCloneDatabase } = await import('../../src-RDRKZ4FM.js');
|
|
854
854
|
const db = openGitHubCloneDatabase(":memory:");
|
|
855
855
|
try {
|
|
856
856
|
new GitHubDomain(db).seed(seed);
|
|
@@ -4490,7 +4490,7 @@ var DEFAULT_AGENT_FILE = "examples/agents/scripted-triage-agent.ts";
|
|
|
4490
4490
|
var DEFAULT_AGENT_COMMAND = `node ${DEFAULT_AGENT_FILE}`;
|
|
4491
4491
|
var MANIFEST_SCHEMA_URL = "https://pome.sh/schemas/v1/pome.json";
|
|
4492
4492
|
function readPackageVersion() {
|
|
4493
|
-
if ("0.21.
|
|
4493
|
+
if ("0.21.12".length > 0) return "0.21.12";
|
|
4494
4494
|
try {
|
|
4495
4495
|
const here = dirname(fileURLToPath(import.meta.url));
|
|
4496
4496
|
const candidates = [
|
|
@@ -4945,7 +4945,7 @@ function createProgram() {
|
|
|
4945
4945
|
return;
|
|
4946
4946
|
}
|
|
4947
4947
|
{
|
|
4948
|
-
const { runDoctorChecks } = await import('../../checks-
|
|
4948
|
+
const { runDoctorChecks } = await import('../../checks-FLXH5OG3.js');
|
|
4949
4949
|
const { renderDoctorReport } = await import('../../render-ZQQ4UMNO.js');
|
|
4950
4950
|
const doctorReport = await runDoctorChecks({ mode: useLocal ? "full" : "hosted" });
|
|
4951
4951
|
if (!doctorReport.ok) {
|
|
@@ -4983,7 +4983,7 @@ function createProgram() {
|
|
|
4983
4983
|
taskForRuns.config.runs
|
|
4984
4984
|
);
|
|
4985
4985
|
if (k > 1) {
|
|
4986
|
-
const { runTrialGroup } = await import('../../runTrialGroup-
|
|
4986
|
+
const { runTrialGroup } = await import('../../runTrialGroup-7KEOFQEU.js');
|
|
4987
4987
|
const fileForRerun = relative(process.cwd(), file);
|
|
4988
4988
|
const rerunCommand = defaultTask ? options.trials !== void 0 ? `pome run -n ${k}` : "pome run" : `pome run ${fileForRerun && !fileForRerun.startsWith("..") ? fileForRerun : file} -n ${k}`;
|
|
4989
4989
|
const groupResult = await runTrialGroup({
|
|
@@ -5077,7 +5077,7 @@ function createProgram() {
|
|
|
5077
5077
|
process.exitCode = 5;
|
|
5078
5078
|
return;
|
|
5079
5079
|
}
|
|
5080
|
-
const { runDemo } = await import('../../runDemo-
|
|
5080
|
+
const { runDemo } = await import('../../runDemo-7ZNVR4GX.js');
|
|
5081
5081
|
const result = await runDemo({
|
|
5082
5082
|
apiBase: opts.apiUrl.replace(/\/$/, ""),
|
|
5083
5083
|
dashboardBase: process.env.POME_DASHBOARD_URL ?? DEFAULT_DASHBOARD_URL,
|
|
@@ -5095,7 +5095,7 @@ function createProgram() {
|
|
|
5095
5095
|
program.command("doctor").description(
|
|
5096
5096
|
"Check the agent\u2194twin wiring: pome.json (or pome.yaml) present + valid, the local twin boots + serves, requests routed to the twin (not a hardcoded production host), egress floor active. On failure prints one named cause (file:line where knowable) + one concrete fix and exits non-zero."
|
|
5097
5097
|
).action(async () => {
|
|
5098
|
-
const { runDoctorChecks } = await import('../../checks-
|
|
5098
|
+
const { runDoctorChecks } = await import('../../checks-FLXH5OG3.js');
|
|
5099
5099
|
const { renderDoctorReport } = await import('../../render-ZQQ4UMNO.js');
|
|
5100
5100
|
const report = await runDoctorChecks();
|
|
5101
5101
|
for (const line of renderDoctorReport(report, { passNote: true })) console.error(line);
|
|
@@ -5227,7 +5227,7 @@ function createProgram() {
|
|
|
5227
5227
|
).description(
|
|
5228
5228
|
"Start a standalone twin as a long-lived foreground server (Ctrl-C to stop)"
|
|
5229
5229
|
).action(async (name, options) => {
|
|
5230
|
-
const { runTwinStartCommand } = await import('../../twinStart-
|
|
5230
|
+
const { runTwinStartCommand } = await import('../../twinStart-Y525LQUR.js');
|
|
5231
5231
|
await runTwinStartCommand(name, options);
|
|
5232
5232
|
});
|
|
5233
5233
|
twin.command("reset").argument("[name]", "Twin name (default: github)", "github").description("Reset standalone twin state").action(async (name) => {
|