@pome-sh/cli 0.42.4 → 0.43.0

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "package": "pome-sh",
3
- "version": "0.42.4",
4
- "git_sha": "8596587c815472aa76ee5c89ddf025c3ab7dd19a",
5
- "build_time": "2026-08-30T23:55:15.281Z"
3
+ "version": "0.43.0",
4
+ "git_sha": "589885b59adab9a5fded977620a6adc25125da85",
5
+ "build_time": "2026-09-01T07:18:35.031Z"
6
6
  }
@@ -1,10 +1,9 @@
1
- import { findManifestPath, readManifest } from './chunk-DFOQGAKS.js';
2
1
  import { getAvailablePort } from './chunk-XDU6TD4O.js';
3
- import './chunk-NNXVR46L.js';
2
+ import { findManifestPath, readManifest } from './chunk-CS7O2ZXB.js';
4
3
  import { buildEgressAllowlist } from './chunk-CBFKZZBR.js';
5
4
  import './chunk-NBOQN5VX.js';
6
5
  import './chunk-YBWG5JK2.js';
7
- import './chunk-6KJC4BTO.js';
6
+ import './chunk-5KFDRR53.js';
8
7
  import './chunk-SG6ZTIMT.js';
9
8
  import './chunk-2K6BJ3PI.js';
10
9
  import './chunk-FBSA5L36.js';
@@ -24,7 +23,6 @@ var PRODUCTION_HOSTS = [
24
23
  { host: "www.googleapis.com/gmail/", envVar: "POME_GMAIL_REST_URL" }
25
24
  ];
26
25
  var WIRING_ENV_REGEX = /POME_[A-Z0-9]+_(?:REST_URL|MCP_URL|API_BASE)/;
27
- var ADAPTER_REGEX = /@pome-sh\/adapter-|withPome\s*\(/;
28
26
  var CODE_EXTENSIONS = /* @__PURE__ */ new Set([".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs"]);
29
27
  var SKIP_DIRS = /* @__PURE__ */ new Set([
30
28
  "node_modules",
@@ -69,7 +67,7 @@ async function collectFiles(root) {
69
67
  async function scanAgentSources(rootDir) {
70
68
  const files = await collectFiles(rootDir);
71
69
  let hardcoded = null;
72
- const wiring = { envVar: null, adapterImport: false };
70
+ const wiring = { envVar: null };
73
71
  let filesScanned = 0;
74
72
  for (const file of files) {
75
73
  try {
@@ -106,9 +104,6 @@ async function scanAgentSources(rootDir) {
106
104
  const match = WIRING_ENV_REGEX.exec(line);
107
105
  if (match) wiring.envVar = match[0];
108
106
  }
109
- if (!wiring.adapterImport && ADAPTER_REGEX.test(line)) {
110
- wiring.adapterImport = true;
111
- }
112
107
  }
113
108
  }
114
109
  return { hardcoded, wiring, filesScanned };
@@ -187,7 +182,7 @@ async function checkTwinReachable(_configDir) {
187
182
  });
188
183
  let harness;
189
184
  try {
190
- const { bootTwin } = await import('./twinHarness-ATYQTDA5.js');
185
+ const { bootTwin } = await import('./twinHarness-WJFDLEAO.js');
191
186
  harness = await bootTwin({
192
187
  twin: "github",
193
188
  seedState: void 0,
@@ -249,15 +244,15 @@ async function checkRouting(configDir) {
249
244
  ].join("\n")
250
245
  };
251
246
  }
252
- if (scan.wiring.envVar === null && !scan.wiring.adapterImport) {
247
+ if (scan.wiring.envVar === null) {
253
248
  return {
254
249
  id: "routing",
255
250
  status: "fail",
256
251
  label: "requests are not routed to the twin",
257
- cause: `no POME_*_REST_URL / POME_*_MCP_URL read and no @pome-sh adapter found in the ${scan.filesScanned} source file(s) under ${relative(process.cwd(), configDir) || "."} \u2014 the agent has no path to the twin.`,
252
+ cause: `no POME_*_REST_URL / POME_*_MCP_URL read in the ${scan.filesScanned} source file(s) under ${relative(process.cwd(), configDir) || "."} \u2014 the agent has no path to the twin.`,
258
253
  fix: [
259
- 'wire the adapter: import { withPome } from "@pome-sh/adapter-claude-sdk"; call withPome() at startup;',
260
- "read the twin base URL from POME_GITHUB_REST_URL (injected by the runner) \u2014 or let your own coding agent wire it with the coach skills (`npx skills add pome-sh/digital-twins --skill '*'`)."
254
+ "read the twin base URL from the env the runner injects (e.g. POME_GITHUB_REST_URL / POME_GITHUB_MCP_URL) and send your requests there \u2014",
255
+ "or let your own coding agent wire it with the coach skills (`npx skills add pome-sh/digital-twins --skill '*'`)."
261
256
  ].join("\n")
262
257
  };
263
258
  }
@@ -265,7 +260,7 @@ async function checkRouting(configDir) {
265
260
  id: "routing",
266
261
  status: "pass",
267
262
  label: "requests route to the twin",
268
- detail: scan.wiring.envVar ? `reads ${scan.wiring.envVar}` : "withPome() installed"
263
+ detail: `reads ${scan.wiring.envVar}`
269
264
  };
270
265
  }
271
266
  function checkEgressFloor(env, _configDir) {
@@ -1,4 +1,4 @@
1
- import { isTwinName, TWIN_REGISTRY, TWIN_NAMES } from './chunk-RPPF2KDQ.js';
1
+ import { isTwinName, TWIN_REGISTRY, TWIN_NAMES } from './chunk-ELIEDNF3.js';
2
2
  import { readFileSync } from 'node:fs';
3
3
  import { parse } from 'yaml';
4
4
 
@@ -1,4 +1,4 @@
1
- import { TWIN_NAMES, isTwinName, TWIN_REGISTRY } from './chunk-RPPF2KDQ.js';
1
+ import { TWIN_NAMES, isTwinName, TWIN_REGISTRY } from './chunk-ELIEDNF3.js';
2
2
  import { createFileBackedRecorderStore, createRecorderStore } from './chunk-HRAD7MRX.js';
3
3
 
4
4
  // src/recorder/recorder.ts
@@ -28,8 +28,8 @@ var recorderEventObjectSchema = z.object({
28
28
  task_step_id: z.string().min(1).nullable().optional(),
29
29
  scenario_step_id: z.string().min(1).nullable().optional(),
30
30
  step_id: z.string().nullable(),
31
- // tool_call_id is set by the `@pome-sh/adapter-claude-sdk` adapter when active.
32
- // Null for the heuristic-correlator path (no adapter signal available).
31
+ // tool_call_id is set when an agent stamps the correlation header on its twin
32
+ // requests. Null for the heuristic-correlator path (no correlation signal).
33
33
  tool_call_id: z.string().nullable(),
34
34
  method: z.string().min(1),
35
35
  path: z.string(),
@@ -1,8 +1,11 @@
1
1
  import { seedSchema as seedSchema$2 } from './chunk-NBOQN5VX.js';
2
2
  import { seedSchema } from './chunk-YBWG5JK2.js';
3
- import { twinIdSchema } from './chunk-6KJC4BTO.js';
3
+ import { twinIdSchema } from './chunk-5KFDRR53.js';
4
4
  import { seedSchema as seedSchema$1 } from './chunk-2K6BJ3PI.js';
5
5
  import { z } from 'zod';
6
+ import { readFile, writeFile } from 'node:fs/promises';
7
+ import { resolve, join, dirname } from 'node:path';
8
+ import { stringify, parse } from 'yaml';
6
9
 
7
10
  var SLUG_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
8
11
  var SLUG_MAX_LENGTH = 64;
@@ -1146,5 +1149,114 @@ function exitCodeFor(err) {
1146
1149
  if (err instanceof HostedDiscardRefusedError) return 5;
1147
1150
  return 2;
1148
1151
  }
1152
+ var MANIFEST_JSON = "pome.json";
1153
+ var MANIFEST_YAML = "pome.yaml";
1154
+ var MANIFEST_YML = "pome.yml";
1155
+ var MANIFEST_FILES = [MANIFEST_JSON, MANIFEST_YAML, MANIFEST_YML];
1156
+ var SCHEMA_URL = "https://pome.sh/schemas/v1/pome.json";
1157
+ var YAML_SCHEMA_COMMENT = `# yaml-language-server: $schema=${SCHEMA_URL}`;
1158
+ function formatFor(fileName) {
1159
+ return fileName === MANIFEST_JSON ? "json" : "yaml";
1160
+ }
1161
+ async function findManifestPath(startDir = process.cwd()) {
1162
+ let dir = resolve(startDir);
1163
+ for (; ; ) {
1164
+ const present = [];
1165
+ for (const fileName of MANIFEST_FILES) {
1166
+ if (await fileExists(join(dir, fileName))) present.push(fileName);
1167
+ }
1168
+ if (present.length > 1) {
1169
+ throw new HostedOrchError(
1170
+ `Multiple pome manifests in ${dir}: ${present.join(", ")}. Keep exactly one (pome.json is canonical).`
1171
+ );
1172
+ }
1173
+ if (present.length === 1) {
1174
+ const fileName = present[0];
1175
+ return { path: join(dir, fileName), format: formatFor(fileName) };
1176
+ }
1177
+ const parent = dirname(dir);
1178
+ if (parent === dir) return null;
1179
+ dir = parent;
1180
+ }
1181
+ }
1182
+ async function readManifest(startDir = process.cwd()) {
1183
+ const found = await findManifestPath(startDir);
1184
+ if (!found) return null;
1185
+ const text = await readFile(found.path, "utf8");
1186
+ const raw = parseManifestText(text, found);
1187
+ const manifest = validateManifest(raw, found.path);
1188
+ return { ...found, manifest, raw };
1189
+ }
1190
+ async function readRequiredManifest(startDir = process.cwd()) {
1191
+ const read = await readManifest(startDir);
1192
+ if (!read) {
1193
+ throw new HostedOrchError(
1194
+ `No pome manifest found (${MANIFEST_JSON} or ${MANIFEST_YAML}). Run \`pome init\` first.`
1195
+ );
1196
+ }
1197
+ return read;
1198
+ }
1199
+ async function writeManifest(path, format, data) {
1200
+ if (format === "json") {
1201
+ await writeFile(path, `${JSON.stringify(data, null, 2)}
1202
+ `);
1203
+ return;
1204
+ }
1205
+ const { $schema: _dropped, ...body } = data;
1206
+ await writeFile(path, `${YAML_SCHEMA_COMMENT}
1207
+ ${stringify(body)}`);
1208
+ }
1209
+ function parseManifestText(text, found) {
1210
+ let parsed;
1211
+ try {
1212
+ parsed = found.format === "json" ? JSON.parse(text) : parse(text);
1213
+ } catch (err) {
1214
+ throw new HostedOrchError(
1215
+ `${found.path} is not valid ${found.format.toUpperCase()}: ${err instanceof Error ? err.message : String(err)}`
1216
+ );
1217
+ }
1218
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
1219
+ throw new HostedOrchError(`${found.path} is not a ${found.format} object`);
1220
+ }
1221
+ return parsed;
1222
+ }
1223
+ function validateManifest(raw, path) {
1224
+ const result = manifestSchema.safeParse(raw);
1225
+ if (result.success) return result.data;
1226
+ const slugIssue = result.error.issues.find(
1227
+ (issue) => issue.path[0] === "agent" && issue.path[1] === "slug"
1228
+ );
1229
+ if (slugIssue) {
1230
+ throw new HostedOrchError(slugErrorMessage(raw, path));
1231
+ }
1232
+ const summary = result.error.issues.map((issue) => `${issue.path.join(".") || "(root)"}: ${issue.message}`).join("; ");
1233
+ throw new HostedOrchError(`Invalid pome manifest ${path}: ${summary}`);
1234
+ }
1235
+ function slugErrorMessage(raw, path) {
1236
+ const agent = typeof raw.agent === "object" && raw.agent !== null ? raw.agent : {};
1237
+ const name = typeof agent.name === "string" ? agent.name : "";
1238
+ const badSlug = typeof agent.slug === "string" ? agent.slug : "";
1239
+ const suggestion = deriveAgentSlug(name || badSlug);
1240
+ const base = `Invalid agent.slug in ${path}: must match ${SLUG_RE} (lowercase kebab-case, max 64 chars).`;
1241
+ return suggestion.length > 0 ? `${base} Did you mean "${suggestion}"?` : base;
1242
+ }
1243
+ function normalizeManifestTwins(manifestTwins) {
1244
+ if (manifestTwins === void 0) return void 0;
1245
+ const out = /* @__PURE__ */ new Set();
1246
+ for (const twin of manifestTwins) {
1247
+ const norm = twin.trim().toLowerCase();
1248
+ if (norm.length > 0) out.add(norm);
1249
+ }
1250
+ return out.size > 0 ? [...out] : void 0;
1251
+ }
1252
+ async function fileExists(path) {
1253
+ try {
1254
+ await readFile(path, "utf8");
1255
+ return true;
1256
+ } catch (err) {
1257
+ if (err.code === "ENOENT") return false;
1258
+ throw err;
1259
+ }
1260
+ }
1149
1261
 
1150
- export { HostedAuthError, HostedDiscardRefusedError, HostedOrchError, HostedQuotaError, HostedTrialError, HostedUsageError, MOUNTED_TWINS, SLUG_RE, agentResponseSchema, createEvalSessionResponseSchema, createSessionResponseSchema, criterionSchema, deriveAgentSlug, exitCodeFor, finalizeResponseSchema, isMultiTwinSeedEnvelope, manifestSchema, normalizeTaskConfigKeys, sessionPublicSchema, submitResultResponseSchema };
1262
+ export { HostedAuthError, HostedDiscardRefusedError, HostedOrchError, HostedQuotaError, HostedTrialError, HostedUsageError, MANIFEST_JSON, MOUNTED_TWINS, agentResponseSchema, createEvalSessionResponseSchema, createSessionResponseSchema, criterionSchema, deriveAgentSlug, exitCodeFor, finalizeResponseSchema, findManifestPath, isMultiTwinSeedEnvelope, normalizeManifestTwins, normalizeTaskConfigKeys, readManifest, readRequiredManifest, sessionPublicSchema, submitResultResponseSchema, writeManifest };
@@ -39,7 +39,7 @@ var TWIN_REGISTRY = {
39
39
  defaultSeedState,
40
40
  GitHubDomain,
41
41
  openGitHubCloneDatabase
42
- } = await import('./src-UY4Y75BD.js');
42
+ } = await import('./src-E7NTZL2F.js');
43
43
  const db = openGitHubCloneDatabase();
44
44
  const domain = new GitHubDomain(db);
45
45
  domain.seed(seedState === void 0 ? defaultSeedState() : seedState);
@@ -63,7 +63,7 @@ var TWIN_REGISTRY = {
63
63
  parseSeed: async (input) => (await import('./seed-SYJXLGWF.js')).parseSeed(input),
64
64
  seedFields: async () => Object.keys((await import('./seed-SYJXLGWF.js')).seedSchema.shape),
65
65
  async boot({ seedState, runId, recorder }) {
66
- const { createSlackTwinApp, openSlackTwinDatabase, SlackDomain } = await import('./src-SNSK5ENY.js');
66
+ const { createSlackTwinApp, openSlackTwinDatabase, SlackDomain } = await import('./src-7X62AGW7.js');
67
67
  const db = openSlackTwinDatabase(":memory:");
68
68
  const domain = new SlackDomain(db);
69
69
  domain.applySeed(seedState);
@@ -90,8 +90,8 @@ var TWIN_REGISTRY = {
90
90
  parseSeed: async (input) => (await import('./seed-E6SA4NKZ.js')).parseSeed(input),
91
91
  seedFields: async () => Object.keys((await import('./seed-E6SA4NKZ.js')).seedSchema.shape),
92
92
  async boot({ seedState, runId, recorder, twinBaseUrl }) {
93
- const stripeTwin = await import('./src-V3RUKDMQ.js');
94
- const { createApp } = await import('./server-GDK4TBTL.js');
93
+ const stripeTwin = await import('./src-ESRY2MC7.js');
94
+ const { createApp } = await import('./server-KC57K5AC.js');
95
95
  const {
96
96
  applySeed: applyStripeSeed,
97
97
  createTwinStripeApp,
@@ -136,7 +136,7 @@ var TWIN_REGISTRY = {
136
136
  parseSeed: async (input) => (await import('./seed-W3R53GHH.js')).parseSeed(input),
137
137
  seedFields: async () => Object.keys((await import('./seed-W3R53GHH.js')).gmailSeedSchema.shape),
138
138
  async boot({ seedState, runId, recorder }) {
139
- const { createGmailTwinApp, GmailDomain, openGmailTwinDatabase, parseSeed } = await import('./src-Z4C4SSDR.js');
139
+ const { createGmailTwinApp, GmailDomain, openGmailTwinDatabase, parseSeed } = await import('./src-Z63IOSCJ.js');
140
140
  const db = openGmailTwinDatabase(":memory:");
141
141
  const seed = parseSeed(seedState);
142
142
  const domain = new GmailDomain(db);
@@ -165,7 +165,7 @@ var TWIN_REGISTRY = {
165
165
  LinearDomain,
166
166
  openLinearTwinDatabase,
167
167
  parseSeed
168
- } = await import('./src-FUPOFZI4.js');
168
+ } = await import('./src-5F5OTVYT.js');
169
169
  const db = openLinearTwinDatabase(":memory:");
170
170
  const seed = parseSeed(seedState);
171
171
  const domain = new LinearDomain(db);
@@ -181,7 +181,7 @@ var TWIN_REGISTRY = {
181
181
  }
182
182
  };
183
183
  async function createGitHubSmokeApp() {
184
- const { createGitHubCloneApp } = await import('./src-UY4Y75BD.js');
184
+ const { createGitHubCloneApp } = await import('./src-E7NTZL2F.js');
185
185
  return createGitHubCloneApp();
186
186
  }
187
187
  function defaultPortFor(twin, env = process.env) {