@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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "package": "pome-sh",
3
- "version": "0.42.2",
4
- "git_sha": "435f0e23f093cb0c10d8eccc599cb9364bb8a445",
5
- "build_time": "2026-08-30T17:59:02.962Z"
3
+ "version": "0.42.3",
4
+ "git_sha": "427e67af93e006eada090db181006321bd24b62e",
5
+ "build_time": "2026-08-30T23:10:16.999Z"
6
6
  }
@@ -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.parse({
741
+ const response = await client.messages.create({
735
742
  model,
736
- max_tokens: 8192,
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 (!response.parsed_output) {
748
+ if (response.stop_reason === "max_tokens") {
743
749
  throw new Error(
744
- `Compiler returned no parsed_output (stop_reason=${response.stop_reason}). This usually means the model produced output that failed schema validation.`
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 seed = parseGitHubSeedState(response.parsed_output);
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 = "435f0e23f093cb0c10d8eccc599cb9364bb8a445".trim() ;
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.2".length > 0) return "0.42.2";
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 = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pome-sh/cli",
3
- "version": "0.42.2",
3
+ "version": "0.42.3",
4
4
  "description": "Test AI agents against digital twins of real SaaS APIs. Records tool-call traces and scores them on pome.sh.",
5
5
  "keywords": [
6
6
  "ai",