@pome-sh/cli 0.45.1 → 0.46.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.
- package/assets/dashboard/app.css +3 -0
- package/assets/dashboard/app.js +9 -0
- package/assets/dashboard/index.html +15 -0
- package/dist/build-info.json +3 -3
- package/dist/{checks-RDU56OGI.js → checks-FMIUVJ73.js} +2 -2
- package/dist/{twinTape-5P3HQ27N.js → chunk-4EPQF6CR.js} +261 -31
- package/dist/{chunk-IZFM7W2V.js → chunk-GBMPR32X.js} +34 -10
- package/dist/{chunk-DX2KCFJM.js → chunk-GTLGXFLQ.js} +1 -1
- package/dist/{chunk-HEEFOMSZ.js → chunk-J5IF4T3C.js} +7 -4
- package/dist/{chunk-BXYPNEJY.js → chunk-LDDR6XRN.js} +45 -22
- package/dist/{chunk-EZYVICDB.js → chunk-QO6QJ6MN.js} +3 -1
- package/dist/chunk-TG6GFWA3.js +48 -0
- package/dist/{runTrialGroup-MMTTTDWY.js → runTrialGroup-FZWKPVI5.js} +6 -6
- package/dist/src/cli/main.js +121 -154
- package/dist/{src-STAXYPD3.js → src-F5FHPGJP.js} +1 -1
- package/dist/{src-46YGR2WY.js → src-L54OSFDK.js} +1 -1
- package/dist/{src-LPTWNBO5.js → src-LYV6LLKW.js} +1 -1
- package/dist/{src-D3PKLT54.js → src-MRJ73S46.js} +1 -1
- package/dist/{src-CV7QDV5E.js → src-PQ35TNOF.js} +1 -1
- package/dist/twinHarness-VEIXQJ4Y.js +6 -0
- package/dist/{twinSeed-ZFZO7BL7.js → twinSeed-LDKR3NPY.js} +1 -1
- package/dist/{twinStart-XN3BYOUF.js → twinStart-44W63TRH.js} +379 -93
- package/dist/twinTape-433A4IC4.js +10 -0
- package/package.json +2 -1
- package/dist/chunk-AGZOWSLG.js +0 -142
- package/dist/twinHarness-I2JGKQYD.js +0 -6
- package/dist/{run-WONFTZS3.js → run-CFA4LZWQ.js} +1 -1
package/dist/src/cli/main.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { getAvailablePort } from '../../chunk-XDU6TD4O.js';
|
|
3
|
-
import { DEFAULT_CONTROL_PLANE_URL, DEFAULT_DASHBOARD_URL, clearLocalCredentials, friendlyHostedError, SESSION_TWIN_NAMES, runSessionCreate, runSessionList, runSessionStop, resolveCredentials, parseTaskFile, runTaskHosted, scoreStatus, runScoreLine, narratorReadingLines, readLatestRun, readMetaSummary, discoverRunSet, outcomeOf, persistCredentialsAfterLogin, DEFAULT_DOCS_SITE_ORIGIN, resolveSeams, readConfigTwins, resolveCachedAgentId, readLinkCache, seedStateForTwin, runAgentCommand, scoreCountsSummary, criterionRowLine, readCodeCriteria, postAgentResolver, writeLinkCache, ensurePomeGitignored, writeRunArtifactsCore, createHostedClient, redactJsonl, scoreFromFinalizeResponse, parseGitHubSeedState, uploadRunBlobs, isPreSatisfied } from '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
5
|
-
import { readManifest, writeManifest, MANIFEST_JSON, exitCodeFor, readRequiredManifest, HostedUsageError, HostedOrchError, normalizeManifestTwins } from '../../chunk-26UAPLHK.js';
|
|
6
|
-
import { MOUNTED_TWINS, deriveAgentSlug } from '../../chunk-M7ATJ423.js';
|
|
7
|
-
import '../../chunk-NW7HGA2K.js';
|
|
3
|
+
import { DEFAULT_CONTROL_PLANE_URL, DEFAULT_DASHBOARD_URL, clearLocalCredentials, friendlyHostedError, SESSION_TWIN_NAMES, runSessionCreate, runSessionList, runSessionStop, resolveCredentials, parseTaskFile, runTaskHosted, scoreStatus, runScoreLine, narratorReadingLines, readLatestRun, readMetaSummary, discoverRunSet, outcomeOf, persistCredentialsAfterLogin, DEFAULT_DOCS_SITE_ORIGIN, resolveSeams, readConfigTwins, resolveCachedAgentId, readLinkCache, seedStateForTwin, runAgentCommand, scoreCountsSummary, criterionRowLine, readCodeCriteria, postAgentResolver, writeLinkCache, ensurePomeGitignored, writeRunArtifactsCore, createHostedClient, redactJsonl, scoreFromFinalizeResponse, parseGitHubSeedState, uploadRunBlobs, isPreSatisfied } from '../../chunk-J5IF4T3C.js';
|
|
4
|
+
import { readManifest, writeManifest, MANIFEST_JSON, exitCodeFor, HostedAuthError, readRequiredManifest, HostedUsageError, HostedOrchError, normalizeManifestTwins } from '../../chunk-26UAPLHK.js';
|
|
8
5
|
import { GMAIL_CHECKS } from '../../chunk-JM6VS62R.js';
|
|
9
6
|
import '../../chunk-PASFBRK4.js';
|
|
10
7
|
import { LINEAR_CHECKS } from '../../chunk-TSOSDKXP.js';
|
|
11
8
|
import '../../chunk-3FZY376K.js';
|
|
12
9
|
import { buildEgressAllowlist, readBlockedEgress } from '../../chunk-CBFKZZBR.js';
|
|
13
|
-
import '../../chunk-
|
|
14
|
-
import
|
|
15
|
-
import
|
|
10
|
+
import { assetPath, resolvePackageRoot, openBrowser } from '../../chunk-TG6GFWA3.js';
|
|
11
|
+
import '../../chunk-GTLGXFLQ.js';
|
|
12
|
+
import '../../chunk-NW7HGA2K.js';
|
|
13
|
+
import { createRecorder, bootTwin } from '../../chunk-QO6QJ6MN.js';
|
|
14
|
+
import '../../chunk-4LQ4IJOC.js';
|
|
15
|
+
import { MOUNTED_TWINS, deriveAgentSlug } from '../../chunk-M7ATJ423.js';
|
|
16
|
+
import { TWIN_NAME_LIST, TWIN_REGISTRY, createGitHubSmokeApp } from '../../chunk-LDDR6XRN.js';
|
|
16
17
|
import { TAPE_ASSERTABLE_TOOLS } from '../../chunk-C4BVTUA3.js';
|
|
17
18
|
import { seedSchema } from '../../chunk-NBOQN5VX.js';
|
|
18
19
|
import { SLACK_CHECKS } from '../../chunk-2ZGVDTJC.js';
|
|
@@ -31,7 +32,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
31
32
|
import { serve } from '@hono/node-server';
|
|
32
33
|
import { randomBytes, randomUUID, createHash } from 'node:crypto';
|
|
33
34
|
import { sign } from 'hono/jwt';
|
|
34
|
-
import {
|
|
35
|
+
import { spawn } from 'node:child_process';
|
|
35
36
|
import { createServer } from 'node:http';
|
|
36
37
|
import { createInterface } from 'node:readline';
|
|
37
38
|
import { z } from 'zod';
|
|
@@ -217,7 +218,7 @@ async function spawnCaptureServerChild(options) {
|
|
|
217
218
|
});
|
|
218
219
|
let stderrBuf = "";
|
|
219
220
|
let resolved = false;
|
|
220
|
-
const readyPromise = new Promise((
|
|
221
|
+
const readyPromise = new Promise((resolve6, reject) => {
|
|
221
222
|
const onData = (chunk) => {
|
|
222
223
|
stderrBuf += chunk.toString("utf8");
|
|
223
224
|
if (stderrBuf.length > 8192) stderrBuf = stderrBuf.slice(-8192);
|
|
@@ -225,7 +226,7 @@ async function spawnCaptureServerChild(options) {
|
|
|
225
226
|
if (match) {
|
|
226
227
|
resolved = true;
|
|
227
228
|
cleanup();
|
|
228
|
-
|
|
229
|
+
resolve6(Number(match[1]));
|
|
229
230
|
}
|
|
230
231
|
};
|
|
231
232
|
const onExit = (code, signal) => {
|
|
@@ -296,21 +297,21 @@ function makeShutdown(child, graceMs) {
|
|
|
296
297
|
let done = null;
|
|
297
298
|
return () => {
|
|
298
299
|
if (done) return done;
|
|
299
|
-
done = new Promise((
|
|
300
|
+
done = new Promise((resolve6) => {
|
|
300
301
|
if (child.exitCode !== null || child.signalCode !== null) {
|
|
301
|
-
|
|
302
|
+
resolve6();
|
|
302
303
|
return;
|
|
303
304
|
}
|
|
304
305
|
const onExit = () => {
|
|
305
306
|
clearTimeout(killTimer);
|
|
306
|
-
|
|
307
|
+
resolve6();
|
|
307
308
|
};
|
|
308
309
|
child.once("exit", onExit);
|
|
309
310
|
try {
|
|
310
311
|
child.kill("SIGTERM");
|
|
311
312
|
} catch {
|
|
312
313
|
child.off("exit", onExit);
|
|
313
|
-
|
|
314
|
+
resolve6();
|
|
314
315
|
return;
|
|
315
316
|
}
|
|
316
317
|
const killTimer = setTimeout(() => {
|
|
@@ -647,8 +648,8 @@ async function startCallbackServer(expectedState) {
|
|
|
647
648
|
let rejectCode = null;
|
|
648
649
|
let settled = false;
|
|
649
650
|
let deliveredCode = false;
|
|
650
|
-
const codePromise = new Promise((
|
|
651
|
-
resolveCode =
|
|
651
|
+
const codePromise = new Promise((resolve6, reject) => {
|
|
652
|
+
resolveCode = resolve6;
|
|
652
653
|
rejectCode = reject;
|
|
653
654
|
});
|
|
654
655
|
const fail = (err) => {
|
|
@@ -692,9 +693,9 @@ async function startCallbackServer(expectedState) {
|
|
|
692
693
|
succeed(code);
|
|
693
694
|
void closeServer2(server);
|
|
694
695
|
});
|
|
695
|
-
await new Promise((
|
|
696
|
+
await new Promise((resolve6, reject) => {
|
|
696
697
|
server?.once("error", reject);
|
|
697
|
-
server?.listen(0, "127.0.0.1",
|
|
698
|
+
server?.listen(0, "127.0.0.1", resolve6);
|
|
698
699
|
});
|
|
699
700
|
const address = server.address();
|
|
700
701
|
if (!address || typeof address === "string") {
|
|
@@ -731,22 +732,8 @@ async function startCallbackServer(expectedState) {
|
|
|
731
732
|
};
|
|
732
733
|
}
|
|
733
734
|
function closeServer2(server) {
|
|
734
|
-
return new Promise((
|
|
735
|
-
server?.close(() =>
|
|
736
|
-
});
|
|
737
|
-
}
|
|
738
|
-
async function openBrowser(url) {
|
|
739
|
-
const command = process.platform === "darwin" ? "open" : process.platform === "win32" ? "powershell.exe" : "xdg-open";
|
|
740
|
-
const args = process.platform === "win32" ? ["-NoProfile", "-Command", "Start-Process", url] : [url];
|
|
741
|
-
await new Promise((resolve7) => {
|
|
742
|
-
execFile(command, args, (error) => {
|
|
743
|
-
if (error) {
|
|
744
|
-
console.error(
|
|
745
|
-
"Could not open a browser automatically \u2014 copy the URL above into a browser."
|
|
746
|
-
);
|
|
747
|
-
}
|
|
748
|
-
resolve7();
|
|
749
|
-
});
|
|
735
|
+
return new Promise((resolve6) => {
|
|
736
|
+
server?.close(() => resolve6());
|
|
750
737
|
});
|
|
751
738
|
}
|
|
752
739
|
function normalizeBaseUrl(raw) {
|
|
@@ -891,7 +878,7 @@ var DOCS_TOPICS = [
|
|
|
891
878
|
}
|
|
892
879
|
];
|
|
893
880
|
|
|
894
|
-
// src/cli/
|
|
881
|
+
// src/cli/tty-color.ts
|
|
895
882
|
function useColor() {
|
|
896
883
|
return Boolean(process.stdout.isTTY && !process.env.NO_COLOR);
|
|
897
884
|
}
|
|
@@ -901,6 +888,8 @@ function dim(s) {
|
|
|
901
888
|
function bold(s) {
|
|
902
889
|
return useColor() ? `\x1B[1m${s}\x1B[0m` : s;
|
|
903
890
|
}
|
|
891
|
+
|
|
892
|
+
// src/cli/docs.ts
|
|
904
893
|
function wrapLine(text, width) {
|
|
905
894
|
if (text.length <= width) return [text];
|
|
906
895
|
const words = text.split(/\s+/);
|
|
@@ -954,7 +943,7 @@ function topicMatchesFilter(t, filter) {
|
|
|
954
943
|
return t.id.includes(f) || t.title.toLowerCase().includes(f) || t.keywords.some((k) => k.toLowerCase().includes(f)) || t.path.toLowerCase().includes(f);
|
|
955
944
|
}
|
|
956
945
|
async function promptLine(rl, q) {
|
|
957
|
-
return await new Promise((
|
|
946
|
+
return await new Promise((resolve6) => rl.question(q, resolve6));
|
|
958
947
|
}
|
|
959
948
|
function printTopicUrl(topic, site) {
|
|
960
949
|
console.log(`${site}${topic.path}`);
|
|
@@ -1112,7 +1101,7 @@ function extractJsonPayload(text) {
|
|
|
1112
1101
|
|
|
1113
1102
|
// src/task/seed-verifier.ts
|
|
1114
1103
|
async function verifySeedWithTwin(seed) {
|
|
1115
|
-
const { GitHubDomain, openGitHubCloneDatabase } = await import('../../src-
|
|
1104
|
+
const { GitHubDomain, openGitHubCloneDatabase } = await import('../../src-L54OSFDK.js');
|
|
1116
1105
|
const db = openGitHubCloneDatabase(":memory:");
|
|
1117
1106
|
try {
|
|
1118
1107
|
new GitHubDomain(db).seed(seed);
|
|
@@ -1313,16 +1302,6 @@ function statusStamp(status) {
|
|
|
1313
1302
|
return "FAIL";
|
|
1314
1303
|
}
|
|
1315
1304
|
}
|
|
1316
|
-
function resolvePackageRoot(importMetaUrl) {
|
|
1317
|
-
let dir = dirname(fileURLToPath(importMetaUrl));
|
|
1318
|
-
for (let i = 0; i < 6; i++) {
|
|
1319
|
-
if (existsSync(join(dir, "package.json"))) return dir;
|
|
1320
|
-
const parent = resolve(dir, "..");
|
|
1321
|
-
if (parent === dir) break;
|
|
1322
|
-
dir = parent;
|
|
1323
|
-
}
|
|
1324
|
-
return void 0;
|
|
1325
|
-
}
|
|
1326
1305
|
|
|
1327
1306
|
// src/cli/tasks-catalog.ts
|
|
1328
1307
|
var TASK_TWINS = [
|
|
@@ -1511,15 +1490,6 @@ function runnableTasks(twin) {
|
|
|
1511
1490
|
|
|
1512
1491
|
// src/cli/tasks.ts
|
|
1513
1492
|
var DEFAULT_DEST_DIR = "tasks";
|
|
1514
|
-
function useColor2() {
|
|
1515
|
-
return Boolean(process.stdout.isTTY && !process.env.NO_COLOR);
|
|
1516
|
-
}
|
|
1517
|
-
function dim2(s) {
|
|
1518
|
-
return useColor2() ? `\x1B[2m${s}\x1B[0m` : s;
|
|
1519
|
-
}
|
|
1520
|
-
function bold2(s) {
|
|
1521
|
-
return useColor2() ? `\x1B[1m${s}\x1B[0m` : s;
|
|
1522
|
-
}
|
|
1523
1493
|
async function runTasksCommand(twinArg, opts) {
|
|
1524
1494
|
if (!opts.copy && (opts.force || opts.dest)) {
|
|
1525
1495
|
console.error("`--force` and `--dest` only do anything with `--copy`.");
|
|
@@ -1554,36 +1524,36 @@ async function runTasksCommand(twinArg, opts) {
|
|
|
1554
1524
|
printTwinTasks(twin);
|
|
1555
1525
|
}
|
|
1556
1526
|
function printTwinIndex() {
|
|
1557
|
-
console.log(
|
|
1558
|
-
console.log(
|
|
1527
|
+
console.log(bold("Pome tasks"));
|
|
1528
|
+
console.log(dim("Bundled task library, grouped by twin."));
|
|
1559
1529
|
console.log("");
|
|
1560
1530
|
for (const twin of TASK_TWINS) {
|
|
1561
1531
|
const count2 = runnableTasks(twin).length;
|
|
1562
|
-
console.log(` ${
|
|
1563
|
-
console.log(` ${
|
|
1532
|
+
console.log(` ${bold(twin.id)} ${dim(`(${count2} tasks)`)} \u2014 ${twin.label}`);
|
|
1533
|
+
console.log(` ${dim(twin.description)}`);
|
|
1564
1534
|
}
|
|
1565
1535
|
console.log("");
|
|
1566
1536
|
console.log(
|
|
1567
|
-
|
|
1537
|
+
dim("Run `pome tasks <twin>` to list tasks, or add `--copy` to drop them into ./tasks/.")
|
|
1568
1538
|
);
|
|
1569
1539
|
}
|
|
1570
1540
|
function printTwinTasks(twin) {
|
|
1571
1541
|
const runnable = runnableTasks(twin);
|
|
1572
|
-
console.log(
|
|
1573
|
-
console.log(
|
|
1542
|
+
console.log(bold(`Pome tasks \u2014 ${twin.label}`));
|
|
1543
|
+
console.log(dim(`${runnable.length} tasks bundled with this CLI.`));
|
|
1574
1544
|
console.log("");
|
|
1575
1545
|
for (const task of runnable) {
|
|
1576
|
-
console.log(` ${
|
|
1577
|
-
console.log(` ${
|
|
1546
|
+
console.log(` ${bold(task.filename)}`);
|
|
1547
|
+
console.log(` ${dim(task.title)} \u2014 ${task.summary}`);
|
|
1578
1548
|
}
|
|
1579
1549
|
console.log("");
|
|
1580
1550
|
console.log(
|
|
1581
|
-
|
|
1551
|
+
dim(
|
|
1582
1552
|
`Copy locally: \`pome tasks ${twin.id} --copy\` (or \`--copy --dest <dir>\`).`
|
|
1583
1553
|
)
|
|
1584
1554
|
);
|
|
1585
1555
|
if (runnable[0]) {
|
|
1586
|
-
console.log(
|
|
1556
|
+
console.log(dim(`Run one: \`pome run tasks/${runnable[0].filename}\`.`));
|
|
1587
1557
|
}
|
|
1588
1558
|
}
|
|
1589
1559
|
async function copyTwinTasks(twin, opts) {
|
|
@@ -1606,24 +1576,24 @@ async function copyTwinTasks(twin, opts) {
|
|
|
1606
1576
|
});
|
|
1607
1577
|
const written = outcome.copied.length + outcome.overwritten.length;
|
|
1608
1578
|
console.log(
|
|
1609
|
-
|
|
1579
|
+
bold(
|
|
1610
1580
|
`Copied ${written} ${twin.label} task${written === 1 ? "" : "s"} into ${opts.destDir}/.`
|
|
1611
1581
|
)
|
|
1612
1582
|
);
|
|
1613
1583
|
for (const file of outcome.copied) {
|
|
1614
|
-
console.log(` ${
|
|
1584
|
+
console.log(` ${dim("+")} ${file}`);
|
|
1615
1585
|
}
|
|
1616
1586
|
for (const file of outcome.overwritten) {
|
|
1617
|
-
console.log(` ${
|
|
1587
|
+
console.log(` ${dim("~")} ${file} ${dim("(overwritten)")}`);
|
|
1618
1588
|
}
|
|
1619
1589
|
for (const file of outcome.skipped) {
|
|
1620
1590
|
console.log(
|
|
1621
|
-
` ${
|
|
1591
|
+
` ${dim("-")} ${file} ${dim("(exists \u2014 pass --force to overwrite)")}`
|
|
1622
1592
|
);
|
|
1623
1593
|
}
|
|
1624
1594
|
for (const file of outcome.missingSources) {
|
|
1625
1595
|
console.error(
|
|
1626
|
-
` ${
|
|
1596
|
+
` ${dim("!")} ${file} ${dim("(missing from this package install)")}`
|
|
1627
1597
|
);
|
|
1628
1598
|
}
|
|
1629
1599
|
if (outcome.missingSources.length > 0) {
|
|
@@ -1634,7 +1604,7 @@ async function copyTwinTasks(twin, opts) {
|
|
|
1634
1604
|
const first = runnableTasks(twin)[0]?.filename;
|
|
1635
1605
|
if (first) {
|
|
1636
1606
|
console.log(
|
|
1637
|
-
|
|
1607
|
+
dim(`Next: \`pome run ${opts.destDir}/${first}\`.`)
|
|
1638
1608
|
);
|
|
1639
1609
|
}
|
|
1640
1610
|
}
|
|
@@ -3345,21 +3315,12 @@ var SUBSTRATE_HELP = {
|
|
|
3345
3315
|
"seed+final": "the seed and the final state",
|
|
3346
3316
|
tape: "the recorded call tape"
|
|
3347
3317
|
};
|
|
3348
|
-
function useColor3() {
|
|
3349
|
-
return Boolean(process.stdout.isTTY && !process.env.NO_COLOR);
|
|
3350
|
-
}
|
|
3351
|
-
function dim3(s) {
|
|
3352
|
-
return useColor3() ? `\x1B[2m${s}\x1B[0m` : s;
|
|
3353
|
-
}
|
|
3354
|
-
function bold3(s) {
|
|
3355
|
-
return useColor3() ? `\x1B[1m${s}\x1B[0m` : s;
|
|
3356
|
-
}
|
|
3357
3318
|
function argFlagsFor(def) {
|
|
3358
3319
|
return templateSlots(def.template).params.map((name) => `--arg ${name}=${def.params[name].example}`).join(" ");
|
|
3359
3320
|
}
|
|
3360
3321
|
function checksHeader(twin, count2, version) {
|
|
3361
|
-
const label =
|
|
3362
|
-
return version === void 0 ? label : `${label} ${
|
|
3322
|
+
const label = bold(`${twin} \u2014 ${count2} declared check${count2 === 1 ? "" : "s"}`);
|
|
3323
|
+
return version === void 0 ? label : `${label} ${dim(`(@pome-sh/twin-${twin} ${version})`)}`;
|
|
3363
3324
|
}
|
|
3364
3325
|
function jsonView(twin) {
|
|
3365
3326
|
return {
|
|
@@ -3381,17 +3342,17 @@ function jsonView(twin) {
|
|
|
3381
3342
|
async function runChecksCommand(twinArg, opts) {
|
|
3382
3343
|
if (!twinArg) {
|
|
3383
3344
|
if (opts.json) {
|
|
3384
|
-
console.log(JSON.stringify({ twins: twinsWithChecks() }, null, 2));
|
|
3345
|
+
console.log(JSON.stringify({ twins: twinsWithChecks().map(jsonView) }, null, 2));
|
|
3385
3346
|
return;
|
|
3386
3347
|
}
|
|
3387
|
-
console.log(
|
|
3388
|
-
console.log(
|
|
3348
|
+
console.log(bold("Pome checks"));
|
|
3349
|
+
console.log(dim("Twins that declare an assertable vocabulary."));
|
|
3389
3350
|
console.log("");
|
|
3390
3351
|
for (const twin2 of twinsWithChecks()) {
|
|
3391
|
-
console.log(` ${
|
|
3352
|
+
console.log(` ${bold(twin2)} ${dim(`(${checksFor(twin2).length} checks)`)}`);
|
|
3392
3353
|
}
|
|
3393
3354
|
console.log("");
|
|
3394
|
-
console.log(
|
|
3355
|
+
console.log(dim("Run `pome checks <twin>` to list them."));
|
|
3395
3356
|
return;
|
|
3396
3357
|
}
|
|
3397
3358
|
const twin = twinArg.trim();
|
|
@@ -3408,23 +3369,23 @@ async function runChecksCommand(twinArg, opts) {
|
|
|
3408
3369
|
}
|
|
3409
3370
|
const checks = checksFor(twin);
|
|
3410
3371
|
if (checks.length === 0) {
|
|
3411
|
-
console.log(
|
|
3372
|
+
console.log(bold(`${twin} \u2014 no declared checks yet`));
|
|
3412
3373
|
console.log(
|
|
3413
|
-
|
|
3374
|
+
dim(`Its vocabulary has not been migrated. Use [model] criteria for ${twin} for now.`)
|
|
3414
3375
|
);
|
|
3415
3376
|
return;
|
|
3416
3377
|
}
|
|
3417
3378
|
console.log(checksHeader(twin, checks.length, pinnedVersion(`@pome-sh/twin-${twin}`)));
|
|
3418
3379
|
console.log("");
|
|
3419
3380
|
for (const def of checks) {
|
|
3420
|
-
console.log(` ${
|
|
3381
|
+
console.log(` ${bold(def.id)}`);
|
|
3421
3382
|
console.log(` ${displaySentence(def)}`);
|
|
3422
|
-
console.log(` ${
|
|
3423
|
-
console.log(` ${
|
|
3424
|
-
console.log(` ${
|
|
3383
|
+
console.log(` ${dim(def.description)}`);
|
|
3384
|
+
console.log(` ${dim(`needs: ${SUBSTRATE_HELP[def.substrate] ?? def.substrate}`)}`);
|
|
3385
|
+
console.log(` ${dim(`pome checks add <file> --check ${def.id} ${argFlagsFor(def)}`)}`);
|
|
3425
3386
|
console.log("");
|
|
3426
3387
|
}
|
|
3427
|
-
console.log(
|
|
3388
|
+
console.log(dim(`digest ${localDigest(twin)}`));
|
|
3428
3389
|
}
|
|
3429
3390
|
|
|
3430
3391
|
// src/task/insertCriterion.ts
|
|
@@ -4296,21 +4257,6 @@ async function runEvalCommand(runDirArg, opts) {
|
|
|
4296
4257
|
process.exitCode = code;
|
|
4297
4258
|
}
|
|
4298
4259
|
}
|
|
4299
|
-
function assetPath(...segments) {
|
|
4300
|
-
const root = resolvePackageRoot(import.meta.url);
|
|
4301
|
-
if (!root) {
|
|
4302
|
-
throw new Error(
|
|
4303
|
-
`Could not locate the @pome-sh/cli package root (no enclosing package.json) while resolving the packaged asset ${segments.join("/")}.`
|
|
4304
|
-
);
|
|
4305
|
-
}
|
|
4306
|
-
const candidate = join(root, "assets", ...segments);
|
|
4307
|
-
if (!existsSync(candidate)) {
|
|
4308
|
-
throw new Error(
|
|
4309
|
-
`Packaged asset not found at ${candidate}. This is a packaging bug \u2014 \`assets/\` must be listed in cli/package.json \`files\`.`
|
|
4310
|
-
);
|
|
4311
|
-
}
|
|
4312
|
-
return candidate;
|
|
4313
|
-
}
|
|
4314
4260
|
|
|
4315
4261
|
// src/demo/task.ts
|
|
4316
4262
|
var DEMO_TASK_NAME = "first-run-demo";
|
|
@@ -4872,7 +4818,7 @@ function firstSentence(description) {
|
|
|
4872
4818
|
function resolveExampleRef(env = process.env) {
|
|
4873
4819
|
const override = env.POME_EXAMPLE_REF?.trim();
|
|
4874
4820
|
if (override) return override;
|
|
4875
|
-
const baked = "
|
|
4821
|
+
const baked = "c830c89c6055e3371f4693f49bffe96cf230e060".trim() ;
|
|
4876
4822
|
return FULL_SHA.test(baked) ? baked : "main";
|
|
4877
4823
|
}
|
|
4878
4824
|
function rawUrlFor(example, file, ref) {
|
|
@@ -5372,7 +5318,7 @@ var DEFAULT_AGENT_COMMAND = `node ${DEFAULT_AGENT_FILE}`;
|
|
|
5372
5318
|
var MANIFEST_SCHEMA_URL = "https://pome.sh/schemas/v1/pome.json";
|
|
5373
5319
|
var MAX_UNREADABLE_PATHS_SHOWN = 5;
|
|
5374
5320
|
function readPackageVersion() {
|
|
5375
|
-
if ("0.
|
|
5321
|
+
if ("0.46.0".length > 0) return "0.46.0";
|
|
5376
5322
|
try {
|
|
5377
5323
|
const here = dirname(fileURLToPath(import.meta.url));
|
|
5378
5324
|
const candidates = [
|
|
@@ -5421,16 +5367,32 @@ function createProgram() {
|
|
|
5421
5367
|
).option(
|
|
5422
5368
|
"--seed <path>",
|
|
5423
5369
|
"Boot from a JSON or YAML seed file instead of the default. A seed REPLACES the default; it does not merge. Takes the per-twin envelope { <twin>: { \u2026 } } or one twin's flat seed (several twins need the envelope, one entry per named twin). Overrides POME_SEED_JSON."
|
|
5370
|
+
).option(
|
|
5371
|
+
"--no-dashboard",
|
|
5372
|
+
"Do not serve the local dashboard. It is a read-only view of the tape on its own loopback port; this turns the port off."
|
|
5373
|
+
).option(
|
|
5374
|
+
"--open",
|
|
5375
|
+
"Open the dashboard in a browser once the twins are listening. Off by default: the URL is printed either way, and this command runs in CI."
|
|
5376
|
+
).option(
|
|
5377
|
+
"--dashboard-port <port>",
|
|
5378
|
+
"Bind the dashboard to this port instead of a free one. The twins' own ports are unaffected."
|
|
5424
5379
|
).description(
|
|
5425
|
-
|
|
5426
|
-
|
|
5427
|
-
|
|
5428
|
-
|
|
5429
|
-
|
|
5380
|
+
// The db variables are the registry's, not this text's: naming them here
|
|
5381
|
+
// is how the reader learns state is in memory by default BEFORE the boot
|
|
5382
|
+
// banner says so.
|
|
5383
|
+
`Start one or more standalone twins as a long-lived foreground server (Ctrl-C to stop). Each twin's state is in memory unless its own db variable names a file (${TWIN_NAME_LIST.map(
|
|
5384
|
+
(twin2) => TWIN_REGISTRY[twin2].dbEnvName
|
|
5385
|
+
).join(", ")}); with one set, the twin's matching *_NO_SEED=1 serves what the file holds instead of re-seeding over it.`
|
|
5386
|
+
).action(
|
|
5387
|
+
async (names, options) => {
|
|
5388
|
+
const { runTwinStartCommand } = await import('../../twinStart-44W63TRH.js');
|
|
5389
|
+
await runTwinStartCommand(names, options);
|
|
5390
|
+
}
|
|
5391
|
+
);
|
|
5430
5392
|
twin.command("new-seed").argument("<name...>", `Twin name (${TWIN_NAME_LIST.join(" | ")}). Repeat for one file covering several.`).option("--out <path>", "Write to this file instead of stdout. Refuses to overwrite.").summary("Print a new starter seed file for a twin").description(
|
|
5431
5393
|
"Print a new starter seed file for a twin, generated from the twin's own starting state. One twin is flat, several are the per-twin envelope. Boot it with `twin start <twin> --seed`, seed a sandbox with `sandbox create --twin <twin> --seed`, or drop it beside a task as <task>.seed.json"
|
|
5432
5394
|
).action(async (names, options) => {
|
|
5433
|
-
const { runTwinSeedCommand } = await import('../../twinSeed-
|
|
5395
|
+
const { runTwinSeedCommand } = await import('../../twinSeed-LDKR3NPY.js');
|
|
5434
5396
|
await runTwinSeedCommand(names, options);
|
|
5435
5397
|
});
|
|
5436
5398
|
twin.command("status").summary("Say whether the local twins are running").description(
|
|
@@ -5441,7 +5403,7 @@ function createProgram() {
|
|
|
5441
5403
|
console.log("No standalone twin status found.");
|
|
5442
5404
|
return;
|
|
5443
5405
|
}
|
|
5444
|
-
const { standaloneStatusEntries } = await import('../../twinStart-
|
|
5406
|
+
const { standaloneStatusEntries } = await import('../../twinStart-44W63TRH.js');
|
|
5445
5407
|
let entries;
|
|
5446
5408
|
try {
|
|
5447
5409
|
entries = standaloneStatusEntries(JSON.parse(await readFile(statusPath, "utf8"))).map(
|
|
@@ -5477,13 +5439,15 @@ function createProgram() {
|
|
|
5477
5439
|
`Twin name (${TWIN_NAME_LIST.join(" | ")}). Optional when one twin is recorded in .pome/twin-status.json.`
|
|
5478
5440
|
).option(
|
|
5479
5441
|
"--diff",
|
|
5480
|
-
"Also print the state diff since the twin booted \u2014 its seed, default or --seed \u2014 per collection: added, changed, removed."
|
|
5481
|
-
|
|
5482
|
-
).option("--json", "Print the tape (and the diff, with --diff) as one JSON envelope.", false).summary("Show what the agent did on a local twin").description(
|
|
5442
|
+
"Also print the state diff since the twin booted \u2014 its seed, default or --seed \u2014 per collection: added, changed, removed."
|
|
5443
|
+
).option("--json", "Print the tape (and the diff, with --diff) as one JSON envelope.").summary("Show what the agent did on a local twin").description(
|
|
5483
5444
|
"Print the running twin's tape: one line per request with status, fidelity and whether state changed, so a call that claimed success but landed nothing stands out. Reads the twin's address and token from .pome/twin-status.json; no account, no hosted call."
|
|
5484
5445
|
).action(async (name, options) => {
|
|
5485
|
-
const { runTwinTapeCommand } = await import('../../twinTape-
|
|
5486
|
-
await runTwinTapeCommand(name,
|
|
5446
|
+
const { runTwinTapeCommand } = await import('../../twinTape-433A4IC4.js');
|
|
5447
|
+
await runTwinTapeCommand(name, {
|
|
5448
|
+
diff: options.diff ?? false,
|
|
5449
|
+
json: options.json ?? false
|
|
5450
|
+
});
|
|
5487
5451
|
});
|
|
5488
5452
|
program.commandsGroup("Going further:");
|
|
5489
5453
|
program.command("init").summary("Set up Pome in this project").description(
|
|
@@ -5584,8 +5548,7 @@ function createProgram() {
|
|
|
5584
5548
|
"Override docs site origin (default https://docs.pome.sh)"
|
|
5585
5549
|
).option(
|
|
5586
5550
|
"--url",
|
|
5587
|
-
"Print the URL instead of opening the interactive topic picker."
|
|
5588
|
-
false
|
|
5551
|
+
"Print the URL instead of opening the interactive topic picker."
|
|
5589
5552
|
).description(
|
|
5590
5553
|
"Navigate canonical narrative docs on docs.pome.sh"
|
|
5591
5554
|
).action(async (topic, opts) => {
|
|
@@ -5596,12 +5559,10 @@ function createProgram() {
|
|
|
5596
5559
|
"Twin id (e.g. github). Omit to list available twins."
|
|
5597
5560
|
).option(
|
|
5598
5561
|
"--copy",
|
|
5599
|
-
"Copy the twin's runnable tasks into the local project."
|
|
5600
|
-
false
|
|
5562
|
+
"Copy the twin's runnable tasks into the local project."
|
|
5601
5563
|
).option(
|
|
5602
5564
|
"--force",
|
|
5603
|
-
"With --copy, overwrite existing files in the destination."
|
|
5604
|
-
false
|
|
5565
|
+
"With --copy, overwrite existing files in the destination."
|
|
5605
5566
|
).option(
|
|
5606
5567
|
"--dest <dir>",
|
|
5607
5568
|
"With --copy, write into this directory instead of ./tasks/."
|
|
@@ -5610,16 +5571,16 @@ function createProgram() {
|
|
|
5610
5571
|
).action(
|
|
5611
5572
|
async (twin2, opts) => {
|
|
5612
5573
|
await runTasksCommand(twin2, {
|
|
5613
|
-
copy: opts.copy,
|
|
5614
|
-
force: opts.force,
|
|
5574
|
+
copy: opts.copy ?? false,
|
|
5575
|
+
force: opts.force ?? false,
|
|
5615
5576
|
dest: opts.dest
|
|
5616
5577
|
});
|
|
5617
5578
|
}
|
|
5618
5579
|
);
|
|
5619
|
-
const checks = program.command("checks").summary("List, add, and lint a twin's checks").argument("[twin]", "Twin id (e.g. github). Omit to list twins that declare checks.").option("--json", "Emit the declaration as JSON (for skills and agents)."
|
|
5580
|
+
const checks = program.command("checks").summary("List, add, and lint a twin's checks").argument("[twin]", "Twin id (e.g. github). Omit to list twins that declare checks.").option("--json", "Emit the declaration as JSON (for skills and agents).").description(
|
|
5620
5581
|
"Browse the typed checks a twin declares \u2014 the closed set a [code] criterion is graded by"
|
|
5621
5582
|
).action(async (twin2, opts) => {
|
|
5622
|
-
await runChecksCommand(twin2, { json: opts.json });
|
|
5583
|
+
await runChecksCommand(twin2, { json: opts.json ?? false });
|
|
5623
5584
|
});
|
|
5624
5585
|
checks.command("add").argument("<file>", "Task markdown file to append a criterion to").option("--check <id>", "Check id (run `pome checks <twin>` to list them)").option(
|
|
5625
5586
|
"--arg <key=value>",
|
|
@@ -5638,10 +5599,10 @@ function createProgram() {
|
|
|
5638
5599
|
checks.command("lint").argument("<file...>", "Task markdown file(s) \u2014 shell globs work: tasks/*.md").description("Report [code] criteria that bind no declared check, so are never graded").action(async (files) => {
|
|
5639
5600
|
await runChecksLintCommand(files);
|
|
5640
5601
|
});
|
|
5641
|
-
program.command("compile-seeds").summary("Compile prose seed state to JSON via Claude").argument("[target]", "Task .md file or directory (defaults to ./tasks)").option("--force", "Recompile even if the sidecar's source hash matches"
|
|
5602
|
+
program.command("compile-seeds").summary("Compile prose seed state to JSON via Claude").argument("[target]", "Task .md file or directory (defaults to ./tasks)").option("--force", "Recompile even if the sidecar's source hash matches").description(
|
|
5642
5603
|
"Compile prose `## Seed State` sections into sidecar .seed.json files \u2014 one Claude call per file, billed to your ANTHROPIC_API_KEY"
|
|
5643
5604
|
).action(async (target, opts) => {
|
|
5644
|
-
const code = await runCompileSeeds(target, { force: opts.force });
|
|
5605
|
+
const code = await runCompileSeeds(target, { force: opts.force ?? false });
|
|
5645
5606
|
if (code !== 0) process.exitCode = code;
|
|
5646
5607
|
});
|
|
5647
5608
|
const register = program.command("register").summary("Register an agent with Pome").description(
|
|
@@ -5649,8 +5610,7 @@ function createProgram() {
|
|
|
5649
5610
|
);
|
|
5650
5611
|
register.command("agent").argument("<name>", 'Human-readable agent name (e.g. "triage-bot")').option(
|
|
5651
5612
|
"--force",
|
|
5652
|
-
"Re-resolve the agent even when .pome/link.json already links one"
|
|
5653
|
-
false
|
|
5613
|
+
"Re-resolve the agent even when .pome/link.json already links one"
|
|
5654
5614
|
).option(
|
|
5655
5615
|
"--twins <list>",
|
|
5656
5616
|
"Comma-separated services this agent may exercise (e.g. github,slack), unioned with the manifest's twins. Default: the manifest's twins, else the cloud's default enablement."
|
|
@@ -5663,12 +5623,12 @@ function createProgram() {
|
|
|
5663
5623
|
apiBaseUrl: globals(cmd).apiUrl,
|
|
5664
5624
|
dashboardBaseUrl: process.env.POME_DASHBOARD_URL ?? DEFAULT_DASHBOARD_URL,
|
|
5665
5625
|
name,
|
|
5666
|
-
force: opts.force,
|
|
5626
|
+
force: opts.force ?? false,
|
|
5667
5627
|
twins: normalizeRegisterTwins(opts.twins)
|
|
5668
5628
|
});
|
|
5669
5629
|
} catch (err) {
|
|
5670
5630
|
console.error(friendlyHostedError(err));
|
|
5671
|
-
process.exitCode =
|
|
5631
|
+
process.exitCode = exitCodeFor(err);
|
|
5672
5632
|
}
|
|
5673
5633
|
}
|
|
5674
5634
|
);
|
|
@@ -5697,19 +5657,19 @@ function createProgram() {
|
|
|
5697
5657
|
).option(
|
|
5698
5658
|
"--secrets-file <path>",
|
|
5699
5659
|
"Write shell exports containing session secrets to a local file with mode 0600"
|
|
5700
|
-
).option("--json", "Print the sandbox as JSON instead of the human summary."
|
|
5660
|
+
).option("--json", "Print the sandbox as JSON instead of the human summary.").action(
|
|
5701
5661
|
async (opts, cmd) => {
|
|
5702
5662
|
try {
|
|
5703
5663
|
await runSessionCreate({
|
|
5704
5664
|
apiBaseUrl: globals(cmd).apiUrl,
|
|
5705
5665
|
twins: opts.twin ?? [],
|
|
5706
|
-
json: opts.json,
|
|
5666
|
+
json: opts.json ?? false,
|
|
5707
5667
|
secretsFile: opts.secretsFile,
|
|
5708
5668
|
seedPath: opts.seed
|
|
5709
5669
|
});
|
|
5710
5670
|
} catch (err) {
|
|
5711
5671
|
console.error(friendlyHostedError(err));
|
|
5712
|
-
process.exitCode =
|
|
5672
|
+
process.exitCode = exitCodeFor(err);
|
|
5713
5673
|
}
|
|
5714
5674
|
}
|
|
5715
5675
|
);
|
|
@@ -5717,7 +5677,7 @@ function createProgram() {
|
|
|
5717
5677
|
"--state <state>",
|
|
5718
5678
|
"Filter by sandbox state: running, ready, done, expired, or all. `running` also matches the server-side `ready` state, the way the dashboard shows them in one column.",
|
|
5719
5679
|
"running"
|
|
5720
|
-
).option("--json", "Print the sandboxes as JSON."
|
|
5680
|
+
).option("--json", "Print the sandboxes as JSON.").action(
|
|
5721
5681
|
async (opts, cmd) => {
|
|
5722
5682
|
const validStates = [
|
|
5723
5683
|
"running",
|
|
@@ -5738,18 +5698,17 @@ function createProgram() {
|
|
|
5738
5698
|
apiBaseUrl: globals(cmd).apiUrl,
|
|
5739
5699
|
limit: Number.parseInt(opts.limit, 10) || 20,
|
|
5740
5700
|
state: opts.state,
|
|
5741
|
-
json: opts.json
|
|
5701
|
+
json: opts.json ?? false
|
|
5742
5702
|
});
|
|
5743
5703
|
} catch (err) {
|
|
5744
5704
|
console.error(friendlyHostedError(err));
|
|
5745
|
-
process.exitCode =
|
|
5705
|
+
process.exitCode = exitCodeFor(err);
|
|
5746
5706
|
}
|
|
5747
5707
|
}
|
|
5748
5708
|
);
|
|
5749
5709
|
session.command("stop").description("Stop a hosted sandbox").argument("<session-id>", "Sandbox id (ses_\u2026)").option(
|
|
5750
5710
|
"--discard",
|
|
5751
|
-
"Confirm destroying a session whose run has not been graded"
|
|
5752
|
-
false
|
|
5711
|
+
"Confirm destroying a session whose run has not been graded"
|
|
5753
5712
|
).action(
|
|
5754
5713
|
async (sessionId, opts, cmd) => {
|
|
5755
5714
|
try {
|
|
@@ -5859,7 +5818,7 @@ function createProgram() {
|
|
|
5859
5818
|
return;
|
|
5860
5819
|
}
|
|
5861
5820
|
{
|
|
5862
|
-
const { runDoctorChecks } = await import('../../checks-
|
|
5821
|
+
const { runDoctorChecks } = await import('../../checks-FMIUVJ73.js');
|
|
5863
5822
|
const { renderDoctorReport } = await import('../../render-ZQQ4UMNO.js');
|
|
5864
5823
|
const doctorReport = await runDoctorChecks({ mode: useLocal ? "full" : "hosted" });
|
|
5865
5824
|
if (!doctorReport.ok) {
|
|
@@ -5897,7 +5856,7 @@ function createProgram() {
|
|
|
5897
5856
|
taskForRuns.config.runs
|
|
5898
5857
|
);
|
|
5899
5858
|
if (k > 1) {
|
|
5900
|
-
const { runTrialGroup } = await import('../../runTrialGroup-
|
|
5859
|
+
const { runTrialGroup } = await import('../../runTrialGroup-FZWKPVI5.js');
|
|
5901
5860
|
const fileForRerun = relative(process.cwd(), file);
|
|
5902
5861
|
const rerunCommand = defaultTask ? options.trials !== void 0 ? `pome run -n ${k}` : "pome run" : `pome run ${fileForRerun && !fileForRerun.startsWith("..") ? fileForRerun : file} -n ${k}`;
|
|
5903
5862
|
const groupResult = await runTrialGroup({
|
|
@@ -5943,6 +5902,14 @@ function createProgram() {
|
|
|
5943
5902
|
if (result.exitCode !== 0) worstExit = result.exitCode;
|
|
5944
5903
|
} catch (err) {
|
|
5945
5904
|
const code = exitCodeFor(err);
|
|
5905
|
+
if (err instanceof HostedAuthError) {
|
|
5906
|
+
console.error(err.message);
|
|
5907
|
+
console.error(
|
|
5908
|
+
"Tip: `pome login` to run against Pome cloud (which returns a verdict), or `pome run --local <path>` to run a self-hosted twin and capture a trace only."
|
|
5909
|
+
);
|
|
5910
|
+
process.exitCode = code;
|
|
5911
|
+
return;
|
|
5912
|
+
}
|
|
5946
5913
|
console.error(`ERROR ${file}`);
|
|
5947
5914
|
console.error(` ${err instanceof Error ? err.message : String(err)}`);
|
|
5948
5915
|
if (code > worstExit) worstExit = code;
|
|
@@ -5979,7 +5946,7 @@ function createProgram() {
|
|
|
5979
5946
|
program.command("doctor").summary("Check the agent and twin wiring").description(
|
|
5980
5947
|
"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."
|
|
5981
5948
|
).action(async () => {
|
|
5982
|
-
const { runDoctorChecks } = await import('../../checks-
|
|
5949
|
+
const { runDoctorChecks } = await import('../../checks-FMIUVJ73.js');
|
|
5983
5950
|
const { renderDoctorReport } = await import('../../render-ZQQ4UMNO.js');
|
|
5984
5951
|
const report = await runDoctorChecks();
|
|
5985
5952
|
for (const line of renderDoctorReport(report, { passNote: true })) console.error(line);
|
|
@@ -6153,7 +6120,7 @@ function createProgram() {
|
|
|
6153
6120
|
process.exitCode = 2;
|
|
6154
6121
|
return;
|
|
6155
6122
|
}
|
|
6156
|
-
const { runCaptureServerCommand } = await import('../../run-
|
|
6123
|
+
const { runCaptureServerCommand } = await import('../../run-CFA4LZWQ.js');
|
|
6157
6124
|
const { parseAllowCsv } = await import('../../egress-4V6DVJZ7.js');
|
|
6158
6125
|
await runCaptureServerCommand({
|
|
6159
6126
|
port,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { routeInputDeclarer, bracketedQuery, integerInput, booleanInput, mountDeclaredRoute, UndeclaredInputError } from './chunk-
|
|
1
|
+
import { routeInputDeclarer, bracketedQuery, integerInput, booleanInput, mountDeclaredRoute, UndeclaredInputError } from './chunk-GBMPR32X.js';
|
|
2
2
|
import { loadMcpToolFixture, openTwinDatabase, defineTwin, twinBuildInfo, deriveMcpToolTable, failureInjectionMiddleware, createApp, recordedRequestHeaders, UnknownToolError } from './chunk-TWURH7YM.js';
|
|
3
3
|
import './chunk-7VZBAHQ2.js';
|
|
4
4
|
import './chunk-SG6ZTIMT.js';
|