@odla-ai/cli 0.41.1 → 0.42.1

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,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runCli
4
- } from "./chunk-6RGM4W73.js";
4
+ } from "./chunk-FWPQSTNF.js";
5
5
  import {
6
6
  exitCodeFor
7
7
  } from "./chunk-UKLSRQ5J.js";
@@ -9,4 +9,4 @@ export {
9
9
  exitCodeFor,
10
10
  runCli
11
11
  };
12
- //# sourceMappingURL=cli-N5PASRYU.js.map
12
+ //# sourceMappingURL=cli-K5SBFFAY.js.map
package/dist/index.cjs CHANGED
@@ -6275,7 +6275,7 @@ async function stageWorkspacePair(baselineSource, workspaceSource, options = {})
6275
6275
  }
6276
6276
  }
6277
6277
 
6278
- // ../harness/dist/chunk-5HX5LWTG.js
6278
+ // ../harness/dist/chunk-QZXCQSPZ.js
6279
6279
  var import_crypto = require("crypto");
6280
6280
  var import_promises5 = require("fs/promises");
6281
6281
  var import_path5 = require("path");
@@ -6612,7 +6612,7 @@ function validateSnapshot(snapshot, limits) {
6612
6612
  }
6613
6613
  }
6614
6614
 
6615
- // ../harness/dist/chunk-5HX5LWTG.js
6615
+ // ../harness/dist/chunk-QZXCQSPZ.js
6616
6616
  var import_child_process4 = require("child_process");
6617
6617
  var import_promises6 = require("fs/promises");
6618
6618
  var import_path6 = require("path");
@@ -6915,7 +6915,7 @@ function looksLikeDestination(value2) {
6915
6915
  return /^(?:[a-z][a-z0-9+.-]*:\/\/|\/|\\\\)/i.test(text3) || /^[\w.-]+\.[a-z]{2,}(?:[/:]|$)/i.test(text3);
6916
6916
  }
6917
6917
 
6918
- // ../harness/dist/chunk-5HX5LWTG.js
6918
+ // ../harness/dist/chunk-QZXCQSPZ.js
6919
6919
  var import_promises10 = require("fs/promises");
6920
6920
  var import_promises11 = require("fs/promises");
6921
6921
  var import_path10 = require("path");
@@ -7183,7 +7183,7 @@ async function buildCodeGraph(input) {
7183
7183
  return builder.build();
7184
7184
  }
7185
7185
 
7186
- // ../harness/dist/chunk-5HX5LWTG.js
7186
+ // ../harness/dist/chunk-QZXCQSPZ.js
7187
7187
  var import_crypto4 = require("crypto");
7188
7188
  async function digestStagedWorkspace(root, limits) {
7189
7189
  const files = [];
@@ -8012,7 +8012,7 @@ var CodeRuntimeCheckpointManager = class {
8012
8012
  await this.options.event(command, { type: "message", actor: "system", body: prepared.note }, active.conversationRefs).catch(() => void 0);
8013
8013
  await active.workspace.cleanup();
8014
8014
  await this.options.event(command, { type: "status", status: "checkpointed" }, active.conversationRefs).catch(() => void 0);
8015
- return { status: "checkpointed", checkpoint: prepared.checkpoint, message: "Pi stopped at a portable checkpoint" };
8015
+ return { status: "checkpointed", checkpoint: prepared.checkpoint, message: "Theseus stopped at a portable checkpoint" };
8016
8016
  }
8017
8017
  async acknowledged(command, result) {
8018
8018
  if (command.kind !== "checkpoint_stop" || result.status !== "checkpointed") return false;
@@ -8237,7 +8237,7 @@ async function materializeCommandWorkspace(input) {
8237
8237
  await materialized.cleanup();
8238
8238
  }
8239
8239
  }
8240
- var V1_SYSTEM_PROMPT = `You are Pi, the coding agent inside an odla Code harness.
8240
+ var V1_SYSTEM_PROMPT = `You are Theseus, the coding agent inside an odla Code harness.
8241
8241
  Use only the odla_read, odla_apply_git_diff, and odla_run_recipe tools.
8242
8242
  For mutations, call odla_apply_git_diff with raw git diff text. It must start
8243
8243
  with "diff --git a/<path> b/<path>", include matching "---" and "+++" file
@@ -8284,7 +8284,12 @@ function codeSkill(opts) {
8284
8284
  { lease: opts.lease, workspaceDir: opts.workspaceDir, signal },
8285
8285
  { requestId: `bench-${tool}-${++seq}`, tool, input }
8286
8286
  );
8287
- opts.onToolCall?.({ tool, ok: response2.ok, durationMs: Date.now() - startedAt });
8287
+ opts.onToolCall?.({
8288
+ tool,
8289
+ ok: response2.ok,
8290
+ durationMs: Date.now() - startedAt,
8291
+ ...response2.ok ? {} : { error: String(response2.content).slice(0, 300) }
8292
+ });
8288
8293
  return { content: response2.content, isError: !response2.ok };
8289
8294
  };
8290
8295
  const read22 = {
@@ -8315,11 +8320,17 @@ function codeSkill(opts) {
8315
8320
  };
8316
8321
  const runRecipe = {
8317
8322
  name: "odla_run_recipe",
8318
- description: "Run one app-registered build or test recipe through CaMeL policy.",
8323
+ description: `Run one app-registered build or test recipe through CaMeL policy.${opts.recipeIds?.length ? ` Available recipes: ${opts.recipeIds.join(", ")}.` : ""}`,
8319
8324
  inputSchema: {
8320
8325
  type: "object",
8321
8326
  required: ["recipeId"],
8322
- properties: { recipeId: { type: "string", minLength: 1, maxLength: 120, pattern: "^[a-zA-Z0-9._:-]+$" } },
8327
+ properties: { recipeId: {
8328
+ type: "string",
8329
+ minLength: 1,
8330
+ maxLength: 120,
8331
+ pattern: "^[a-zA-Z0-9._:-]+$",
8332
+ ...opts.recipeIds?.length ? { enum: [...opts.recipeIds] } : {}
8333
+ } },
8323
8334
  additionalProperties: false
8324
8335
  },
8325
8336
  handler: (input, ctx) => call4("sandbox.run_recipe", input, ctx.signal)
@@ -8401,6 +8412,7 @@ async function runCodeAgent(options) {
8401
8412
  lease: options.lease,
8402
8413
  workspaceDir: options.workspaceDir,
8403
8414
  surface,
8415
+ ...options.recipeIds ? { recipeIds: options.recipeIds } : {},
8404
8416
  onToolCall: (call4) => {
8405
8417
  toolCalls.push(call4);
8406
8418
  options.onToolCall?.(call4);
@@ -8429,7 +8441,7 @@ async function runCodeAgent(options) {
8429
8441
  }
8430
8442
  async function runCodeAgentAttempt(options) {
8431
8443
  try {
8432
- const surface = options.surface ?? "v2";
8444
+ const surface = options.surface ?? "v3";
8433
8445
  const { run } = await runCodeAgent({
8434
8446
  inference: options.inference,
8435
8447
  broker: options.broker,
@@ -8440,6 +8452,7 @@ async function runCodeAgentAttempt(options) {
8440
8452
  // id only labels the request the control plane is about to rewrite.
8441
8453
  model: "brokered",
8442
8454
  surface,
8455
+ ...options.recipeIds ? { recipeIds: options.recipeIds } : {},
8443
8456
  ...options.maxSteps === void 0 ? {} : { maxSteps: options.maxSteps },
8444
8457
  ...options.budget ? { budget: options.budget } : {},
8445
8458
  ...options.signal ? { signal: options.signal } : {},
@@ -9375,7 +9388,7 @@ async function appendCodeRuntimeEvent(control, command, event, refs) {
9375
9388
  }
9376
9389
  var digestRuntimeValue = (value2) => `sha256:${(0, import_crypto4.createHash)("sha256").update(value2).digest("hex")}`;
9377
9390
  var runtimeErrorMessage = (value2) => value2 instanceof Error ? value2.message : String(value2);
9378
- var CodePiRuntimeEngine = class {
9391
+ var TheseusRuntimeEngine = class {
9379
9392
  constructor(options) {
9380
9393
  this.options = options;
9381
9394
  this.#attempt = options.runAgentAttempt ?? runCodeAgentAttempt;
@@ -9461,7 +9474,7 @@ var CodePiRuntimeEngine = class {
9461
9474
  await this.#failure(command, active, detail);
9462
9475
  return null;
9463
9476
  });
9464
- return { status: "running", message: resume ? "Pi resumed from a portable checkpoint" : "Pi started" };
9477
+ return { status: "running", message: resume ? "Theseus resumed from a portable checkpoint" : "Theseus started" };
9465
9478
  }
9466
9479
  /**
9467
9480
  * Pursue a goal: attempt, judge with the clean verifier, re-prompt from what
@@ -9549,7 +9562,7 @@ var CodePiRuntimeEngine = class {
9549
9562
  await this.#failure(command, active, detail);
9550
9563
  return null;
9551
9564
  });
9552
- return { status: "running", message: "Pi accepted the owner prompt" };
9565
+ return { status: "running", message: "Theseus accepted the owner prompt" };
9553
9566
  }
9554
9567
  async #runAttempt(command, metadata2, active) {
9555
9568
  const lease = fakeCodeLease(command, metadata2);
@@ -9574,7 +9587,8 @@ var CodePiRuntimeEngine = class {
9574
9587
  lease,
9575
9588
  workspaceDir: active.workspace.workspaceDir,
9576
9589
  prompt: metadata2.prompt,
9577
- signal: active.abort.signal
9590
+ signal: active.abort.signal,
9591
+ recipeIds: this.options.recipes.map((recipe2) => recipe2.id)
9578
9592
  });
9579
9593
  const closing = result.finalText.trim();
9580
9594
  const completed = result.status === "completed" && Boolean(closing);
@@ -9638,7 +9652,7 @@ var CodePiRuntimeEngine = class {
9638
9652
  }
9639
9653
  }
9640
9654
  async #diagnostic(command, active, value2) {
9641
- const detail = value2.trim().slice(0, 2e3) || "Pi runtime failed";
9655
+ const detail = value2.trim().slice(0, 2e3) || "Theseus runtime failed";
9642
9656
  this.options.onDiagnostic?.(detail);
9643
9657
  await this.#event(
9644
9658
  command,
@@ -9968,8 +9982,9 @@ async function codeConnect(options) {
9968
9982
  const appId = requestedAppId ?? cfg?.app.id;
9969
9983
  const platform = (options.platform ?? cfg?.platformUrl ?? process.env.ODLA_PLATFORM_URL ?? "https://odla.ai").replace(/\/+$/, "");
9970
9984
  const appEnv = options.env ?? (cfg ? cfg.envs.includes("dev") ? "dev" : cfg.envs[0] : void 0);
9971
- if (appEnv !== "dev" && appEnv !== "prod" || cfg && !cfg.envs.includes(appEnv)) {
9972
- throw new Error(cfg ? `Code env "${appEnv ?? ""}" must be dev or prod and declared in ${options.configPath}` : `Code env "${appEnv ?? ""}" must be dev or prod; pass --env explicitly when there is no ${options.configPath}`);
9985
+ const explicitEnv = options.env !== void 0;
9986
+ if (appEnv !== "dev" && appEnv !== "prod" || !explicitEnv && cfg && !cfg.envs.includes(appEnv)) {
9987
+ throw new Error(cfg ? `Code env "${appEnv ?? ""}" must be dev or prod and declared in ${options.configPath}, unless dev or prod is passed explicitly` : `Code env "${appEnv ?? ""}" must be dev or prod; pass --env explicitly when there is no ${options.configPath}`);
9973
9988
  }
9974
9989
  if (process.platform !== "darwin" && process.platform !== "linux") {
9975
9990
  throw new Error("odla Code hosts require macOS or Linux");
@@ -10066,16 +10081,15 @@ async function runCodeRuntime(input) {
10066
10081
  const control = createCodeRuntimeControlClient({
10067
10082
  endpoint: input.endpoint,
10068
10083
  token: input.token,
10069
- signal,
10070
10084
  fetch: input.fetch
10071
10085
  });
10072
- const commandEngine = new CodePiRuntimeEngine({
10086
+ const commandEngine = new TheseusRuntimeEngine({
10073
10087
  control,
10074
10088
  engine: input.engine,
10075
10089
  recipes: CODE_BUILD_RECIPES,
10076
10090
  recipeAuthorization: "registered_recipe",
10077
10091
  localSource: input.localSource,
10078
- onDiagnostic: (message2) => input.stdout.error(`Pi runtime failed \xB7 ${message2}`)
10092
+ onDiagnostic: (message2) => input.stdout.error(`Theseus runtime failed \xB7 ${message2}`)
10079
10093
  });
10080
10094
  const reconciler = new CodeRuntimeReconciler(control, commandEngine);
10081
10095
  try {
@@ -10827,7 +10841,7 @@ Commands:
10827
10841
  their own credentials for the shared db (the live one included)
10828
10842
  \u2014 no secret is ever copied between people.
10829
10843
  capabilities Show what the CLI automates vs agent edits and human checkpoints.
10830
- code Enroll this Mac/Linux host for the current Studio-connected repository and run Pi.
10844
+ code Enroll this Mac/Linux host for the current Studio-connected repository and run Theseus.
10831
10845
  "code repository show" reports the repository an app works on (Studio or a
10832
10846
  human session connects one); "code grant request|list|approve|revoke" then
10833
10847
  governs unattended access: an agent may request, only a human may approve.
@@ -10843,12 +10857,10 @@ Commands:
10843
10857
  explicitly. Same device-grant auth as "app".
10844
10858
  Status changes and comments post to each item's @odla-ai/chat
10845
10859
  discussion thread.
10846
- NOTE: "--column ready" is OWNER-ONLY. Creating a task in Ready
10847
- approves its complete execution contract, so it needs pm.plan,
10848
- which no device enrollment or handshake approval can grant. An
10849
- agent proposes in Backlog (the default); a human owner or a
10850
- pm.plan agent promotes. This is deliberate, not a permission
10851
- gap \u2014 it was reported as one.
10860
+ Creating or promoting a task in Ready requires a complete
10861
+ execution contract and a reviewed revision. Any caller with PM
10862
+ mutation access to that app/project may do it; claims coordinate
10863
+ execution but never own or lock the PM record.
10852
10864
  bug Intent-first alias for PM bugs. "bug report" writes to
10853
10865
  odla PM; odla product defects do not belong in GitHub Issues.
10854
10866
  discuss Group discussions (via @odla-ai/chat) for the apps you co-own: