@pome-sh/cli 0.42.2 → 0.42.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/dist/build-info.json +3 -3
- package/dist/src/cli/main.js +29 -11
- package/package.json +1 -1
package/dist/build-info.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"package": "pome-sh",
|
|
3
|
-
"version": "0.42.
|
|
4
|
-
"git_sha": "
|
|
5
|
-
"build_time": "2026-08-
|
|
3
|
+
"version": "0.42.3",
|
|
4
|
+
"git_sha": "427e67af93e006eada090db181006321bd24b62e",
|
|
5
|
+
"build_time": "2026-08-30T23:10:16.999Z"
|
|
6
6
|
}
|
package/dist/src/cli/main.js
CHANGED
|
@@ -35,7 +35,6 @@ import { createServer } from 'node:http';
|
|
|
35
35
|
import { createInterface } from 'node:readline';
|
|
36
36
|
import { z } from 'zod';
|
|
37
37
|
import Anthropic from '@anthropic-ai/sdk';
|
|
38
|
-
import { zodOutputFormat } from '@anthropic-ai/sdk/helpers/zod';
|
|
39
38
|
|
|
40
39
|
async function readEventsJsonl(runDir) {
|
|
41
40
|
const file = resolve(runDir, "events.jsonl");
|
|
@@ -710,6 +709,8 @@ async function runDocsCommand(topicArg, opts) {
|
|
|
710
709
|
}
|
|
711
710
|
}
|
|
712
711
|
var COMPILER_MODEL = "claude-opus-4-7";
|
|
712
|
+
var MAX_TOKENS = 8192;
|
|
713
|
+
var SEED_JSON_SCHEMA = JSON.stringify(z.toJSONSchema(seedSchema, { io: "input" }));
|
|
713
714
|
var SYSTEM_PROMPT = `You convert natural-language descriptions of a GitHub twin's seed state into JSON matching the provided schema.
|
|
714
715
|
|
|
715
716
|
Rules:
|
|
@@ -721,7 +722,13 @@ Rules:
|
|
|
721
722
|
6. Issue \`number\` is required and must be set (use #N if the prose says so, otherwise start at 1).
|
|
722
723
|
7. PR \`number\` is optional; set it when the prose says "#N".
|
|
723
724
|
8. Issue \`assignees\` is an array of login strings; use [] when unassigned.
|
|
724
|
-
9. Use fenced code blocks in the prose to indicate the exact content of \`files[].content\`. Preserve trailing newlines verbatim
|
|
725
|
+
9. Use fenced code blocks in the prose to indicate the exact content of \`files[].content\`. Preserve trailing newlines verbatim.
|
|
726
|
+
|
|
727
|
+
Respond with a single JSON object that validates against this JSON Schema. Output only the JSON object \u2014 no prose, no markdown fences.
|
|
728
|
+
|
|
729
|
+
<schema>
|
|
730
|
+
${SEED_JSON_SCHEMA}
|
|
731
|
+
</schema>`;
|
|
725
732
|
async function compileSeed(prose, opts = {}) {
|
|
726
733
|
if (!process.env.ANTHROPIC_API_KEY) {
|
|
727
734
|
throw new Error(
|
|
@@ -731,20 +738,26 @@ async function compileSeed(prose, opts = {}) {
|
|
|
731
738
|
const model = opts.model ?? COMPILER_MODEL;
|
|
732
739
|
const client = new Anthropic();
|
|
733
740
|
const t0 = Date.now();
|
|
734
|
-
const response = await client.messages.
|
|
741
|
+
const response = await client.messages.create({
|
|
735
742
|
model,
|
|
736
|
-
max_tokens:
|
|
743
|
+
max_tokens: MAX_TOKENS,
|
|
737
744
|
system: SYSTEM_PROMPT,
|
|
738
|
-
messages: [{ role: "user", content: prose }]
|
|
739
|
-
output_config: { format: zodOutputFormat(seedSchema) }
|
|
745
|
+
messages: [{ role: "user", content: prose }]
|
|
740
746
|
});
|
|
741
747
|
const durationMs = Date.now() - t0;
|
|
742
|
-
if (
|
|
748
|
+
if (response.stop_reason === "max_tokens") {
|
|
743
749
|
throw new Error(
|
|
744
|
-
`Compiler
|
|
750
|
+
`Compiler output was truncated at max_tokens=${MAX_TOKENS}. The seed prose may describe more state than one compile can emit.`
|
|
745
751
|
);
|
|
746
752
|
}
|
|
747
|
-
const
|
|
753
|
+
const text = response.content.map((block) => block.type === "text" ? block.text : "").join("");
|
|
754
|
+
let candidate;
|
|
755
|
+
try {
|
|
756
|
+
candidate = JSON.parse(extractJsonPayload(text));
|
|
757
|
+
} catch (err) {
|
|
758
|
+
throw new Error(`Compiler did not return valid JSON: ${err.message}`);
|
|
759
|
+
}
|
|
760
|
+
const seed = parseGitHubSeedState(candidate);
|
|
748
761
|
return {
|
|
749
762
|
seed,
|
|
750
763
|
inputTokens: response.usage.input_tokens,
|
|
@@ -753,6 +766,11 @@ async function compileSeed(prose, opts = {}) {
|
|
|
753
766
|
durationMs
|
|
754
767
|
};
|
|
755
768
|
}
|
|
769
|
+
function extractJsonPayload(text) {
|
|
770
|
+
const trimmed = text.trim();
|
|
771
|
+
const fenced = trimmed.match(/^```(?:json)?\s*([\s\S]*?)\s*```$/);
|
|
772
|
+
return fenced ? fenced[1] : trimmed;
|
|
773
|
+
}
|
|
756
774
|
|
|
757
775
|
// src/task/seed-verifier.ts
|
|
758
776
|
async function verifySeedWithTwin(seed) {
|
|
@@ -4604,7 +4622,7 @@ function firstSentence(description) {
|
|
|
4604
4622
|
function resolveExampleRef(env = process.env) {
|
|
4605
4623
|
const override = env.POME_EXAMPLE_REF?.trim();
|
|
4606
4624
|
if (override) return override;
|
|
4607
|
-
const baked = "
|
|
4625
|
+
const baked = "427e67af93e006eada090db181006321bd24b62e".trim() ;
|
|
4608
4626
|
return FULL_SHA.test(baked) ? baked : "main";
|
|
4609
4627
|
}
|
|
4610
4628
|
function rawUrlFor(example, file, ref) {
|
|
@@ -4967,7 +4985,7 @@ var DEFAULT_AGENT_COMMAND = `node ${DEFAULT_AGENT_FILE}`;
|
|
|
4967
4985
|
var MANIFEST_SCHEMA_URL = "https://pome.sh/schemas/v1/pome.json";
|
|
4968
4986
|
var MAX_UNREADABLE_PATHS_SHOWN = 5;
|
|
4969
4987
|
function readPackageVersion() {
|
|
4970
|
-
if ("0.42.
|
|
4988
|
+
if ("0.42.3".length > 0) return "0.42.3";
|
|
4971
4989
|
try {
|
|
4972
4990
|
const here = dirname(fileURLToPath(import.meta.url));
|
|
4973
4991
|
const candidates = [
|