@odla-ai/cli 0.41.0 → 0.42.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/bin/odla-ai.js +19 -10
- package/bin/stale-build.d.ts +16 -0
- package/bin/stale-build.js +77 -0
- package/bin/workspace-build.d.ts +6 -0
- package/bin/workspace-build.js +24 -4
- package/dist/bin.cjs +36 -22
- package/dist/bin.cjs.map +1 -1
- package/dist/bin.js +1 -1
- package/dist/{chunk-6RGM4W73.js → chunk-74DXL2MT.js} +36 -22
- package/dist/chunk-74DXL2MT.js.map +1 -0
- package/dist/{cli-N5PASRYU.js → cli-EGZGMIKB.js} +2 -2
- package/dist/index.cjs +35 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-6RGM4W73.js.map +0 -1
- /package/dist/{cli-N5PASRYU.js.map → cli-EGZGMIKB.js.map} +0 -0
package/dist/bin.js
CHANGED
|
@@ -174,7 +174,7 @@ function absoluteEntryPath(entryPath) {
|
|
|
174
174
|
|
|
175
175
|
// src/bin.ts
|
|
176
176
|
var argv = process.argv.slice(2);
|
|
177
|
-
requireCurrentCliForProvision(argv).then(() => requireCoherentProvisionRuntime(argv)).then(async () => (await import("./cli-
|
|
177
|
+
requireCurrentCliForProvision(argv).then(() => requireCoherentProvisionRuntime(argv)).then(async () => (await import("./cli-EGZGMIKB.js")).runCli()).catch((err) => {
|
|
178
178
|
console.error(redactSecrets(`odla-ai: ${err instanceof Error ? err.message : String(err)}`));
|
|
179
179
|
process.exitCode = exitCodeFor(err);
|
|
180
180
|
});
|
|
@@ -6145,7 +6145,7 @@ async function stageWorkspacePair(baselineSource, workspaceSource, options = {})
|
|
|
6145
6145
|
}
|
|
6146
6146
|
}
|
|
6147
6147
|
|
|
6148
|
-
// ../harness/dist/chunk-
|
|
6148
|
+
// ../harness/dist/chunk-QZXCQSPZ.js
|
|
6149
6149
|
import { createHash as createHash3 } from "crypto";
|
|
6150
6150
|
import { readFile as readFile2, readdir as readdir2 } from "fs/promises";
|
|
6151
6151
|
import { relative as relative4, resolve as resolve10 } from "path";
|
|
@@ -6482,7 +6482,7 @@ function validateSnapshot(snapshot, limits) {
|
|
|
6482
6482
|
}
|
|
6483
6483
|
}
|
|
6484
6484
|
|
|
6485
|
-
// ../harness/dist/chunk-
|
|
6485
|
+
// ../harness/dist/chunk-QZXCQSPZ.js
|
|
6486
6486
|
import { spawn as spawn4 } from "child_process";
|
|
6487
6487
|
import { lstat as lstat2 } from "fs/promises";
|
|
6488
6488
|
import { resolve as resolve23, sep as sep3 } from "path";
|
|
@@ -6788,7 +6788,7 @@ function looksLikeDestination(value2) {
|
|
|
6788
6788
|
return /^(?:[a-z][a-z0-9+.-]*:\/\/|\/|\\\\)/i.test(text3) || /^[\w.-]+\.[a-z]{2,}(?:[/:]|$)/i.test(text3);
|
|
6789
6789
|
}
|
|
6790
6790
|
|
|
6791
|
-
// ../harness/dist/chunk-
|
|
6791
|
+
// ../harness/dist/chunk-QZXCQSPZ.js
|
|
6792
6792
|
import { readFile as readFile4, stat as stat2 } from "fs/promises";
|
|
6793
6793
|
import { readFile as readFile3 } from "fs/promises";
|
|
6794
6794
|
import { join as join33 } from "path";
|
|
@@ -7056,7 +7056,7 @@ async function buildCodeGraph(input) {
|
|
|
7056
7056
|
return builder.build();
|
|
7057
7057
|
}
|
|
7058
7058
|
|
|
7059
|
-
// ../harness/dist/chunk-
|
|
7059
|
+
// ../harness/dist/chunk-QZXCQSPZ.js
|
|
7060
7060
|
import { createHash as createHash32 } from "crypto";
|
|
7061
7061
|
async function digestStagedWorkspace(root, limits) {
|
|
7062
7062
|
const files = [];
|
|
@@ -7885,7 +7885,7 @@ var CodeRuntimeCheckpointManager = class {
|
|
|
7885
7885
|
await this.options.event(command, { type: "message", actor: "system", body: prepared.note }, active.conversationRefs).catch(() => void 0);
|
|
7886
7886
|
await active.workspace.cleanup();
|
|
7887
7887
|
await this.options.event(command, { type: "status", status: "checkpointed" }, active.conversationRefs).catch(() => void 0);
|
|
7888
|
-
return { status: "checkpointed", checkpoint: prepared.checkpoint, message: "
|
|
7888
|
+
return { status: "checkpointed", checkpoint: prepared.checkpoint, message: "Theseus stopped at a portable checkpoint" };
|
|
7889
7889
|
}
|
|
7890
7890
|
async acknowledged(command, result) {
|
|
7891
7891
|
if (command.kind !== "checkpoint_stop" || result.status !== "checkpointed") return false;
|
|
@@ -8110,7 +8110,7 @@ async function materializeCommandWorkspace(input) {
|
|
|
8110
8110
|
await materialized.cleanup();
|
|
8111
8111
|
}
|
|
8112
8112
|
}
|
|
8113
|
-
var V1_SYSTEM_PROMPT = `You are
|
|
8113
|
+
var V1_SYSTEM_PROMPT = `You are Theseus, the coding agent inside an odla Code harness.
|
|
8114
8114
|
Use only the odla_read, odla_apply_git_diff, and odla_run_recipe tools.
|
|
8115
8115
|
For mutations, call odla_apply_git_diff with raw git diff text. It must start
|
|
8116
8116
|
with "diff --git a/<path> b/<path>", include matching "---" and "+++" file
|
|
@@ -8157,7 +8157,12 @@ function codeSkill(opts) {
|
|
|
8157
8157
|
{ lease: opts.lease, workspaceDir: opts.workspaceDir, signal },
|
|
8158
8158
|
{ requestId: `bench-${tool}-${++seq}`, tool, input }
|
|
8159
8159
|
);
|
|
8160
|
-
opts.onToolCall?.({
|
|
8160
|
+
opts.onToolCall?.({
|
|
8161
|
+
tool,
|
|
8162
|
+
ok: response2.ok,
|
|
8163
|
+
durationMs: Date.now() - startedAt,
|
|
8164
|
+
...response2.ok ? {} : { error: String(response2.content).slice(0, 300) }
|
|
8165
|
+
});
|
|
8161
8166
|
return { content: response2.content, isError: !response2.ok };
|
|
8162
8167
|
};
|
|
8163
8168
|
const read22 = {
|
|
@@ -8188,11 +8193,17 @@ function codeSkill(opts) {
|
|
|
8188
8193
|
};
|
|
8189
8194
|
const runRecipe = {
|
|
8190
8195
|
name: "odla_run_recipe",
|
|
8191
|
-
description:
|
|
8196
|
+
description: `Run one app-registered build or test recipe through CaMeL policy.${opts.recipeIds?.length ? ` Available recipes: ${opts.recipeIds.join(", ")}.` : ""}`,
|
|
8192
8197
|
inputSchema: {
|
|
8193
8198
|
type: "object",
|
|
8194
8199
|
required: ["recipeId"],
|
|
8195
|
-
properties: { recipeId: {
|
|
8200
|
+
properties: { recipeId: {
|
|
8201
|
+
type: "string",
|
|
8202
|
+
minLength: 1,
|
|
8203
|
+
maxLength: 120,
|
|
8204
|
+
pattern: "^[a-zA-Z0-9._:-]+$",
|
|
8205
|
+
...opts.recipeIds?.length ? { enum: [...opts.recipeIds] } : {}
|
|
8206
|
+
} },
|
|
8196
8207
|
additionalProperties: false
|
|
8197
8208
|
},
|
|
8198
8209
|
handler: (input, ctx) => call4("sandbox.run_recipe", input, ctx.signal)
|
|
@@ -8274,6 +8285,7 @@ async function runCodeAgent(options) {
|
|
|
8274
8285
|
lease: options.lease,
|
|
8275
8286
|
workspaceDir: options.workspaceDir,
|
|
8276
8287
|
surface,
|
|
8288
|
+
...options.recipeIds ? { recipeIds: options.recipeIds } : {},
|
|
8277
8289
|
onToolCall: (call4) => {
|
|
8278
8290
|
toolCalls.push(call4);
|
|
8279
8291
|
options.onToolCall?.(call4);
|
|
@@ -8302,7 +8314,7 @@ async function runCodeAgent(options) {
|
|
|
8302
8314
|
}
|
|
8303
8315
|
async function runCodeAgentAttempt(options) {
|
|
8304
8316
|
try {
|
|
8305
|
-
const surface = options.surface ?? "
|
|
8317
|
+
const surface = options.surface ?? "v3";
|
|
8306
8318
|
const { run } = await runCodeAgent({
|
|
8307
8319
|
inference: options.inference,
|
|
8308
8320
|
broker: options.broker,
|
|
@@ -8313,6 +8325,7 @@ async function runCodeAgentAttempt(options) {
|
|
|
8313
8325
|
// id only labels the request the control plane is about to rewrite.
|
|
8314
8326
|
model: "brokered",
|
|
8315
8327
|
surface,
|
|
8328
|
+
...options.recipeIds ? { recipeIds: options.recipeIds } : {},
|
|
8316
8329
|
...options.maxSteps === void 0 ? {} : { maxSteps: options.maxSteps },
|
|
8317
8330
|
...options.budget ? { budget: options.budget } : {},
|
|
8318
8331
|
...options.signal ? { signal: options.signal } : {},
|
|
@@ -9248,7 +9261,7 @@ async function appendCodeRuntimeEvent(control, command, event, refs) {
|
|
|
9248
9261
|
}
|
|
9249
9262
|
var digestRuntimeValue = (value2) => `sha256:${createHash32("sha256").update(value2).digest("hex")}`;
|
|
9250
9263
|
var runtimeErrorMessage = (value2) => value2 instanceof Error ? value2.message : String(value2);
|
|
9251
|
-
var
|
|
9264
|
+
var TheseusRuntimeEngine = class {
|
|
9252
9265
|
constructor(options) {
|
|
9253
9266
|
this.options = options;
|
|
9254
9267
|
this.#attempt = options.runAgentAttempt ?? runCodeAgentAttempt;
|
|
@@ -9334,7 +9347,7 @@ var CodePiRuntimeEngine = class {
|
|
|
9334
9347
|
await this.#failure(command, active, detail);
|
|
9335
9348
|
return null;
|
|
9336
9349
|
});
|
|
9337
|
-
return { status: "running", message: resume ? "
|
|
9350
|
+
return { status: "running", message: resume ? "Theseus resumed from a portable checkpoint" : "Theseus started" };
|
|
9338
9351
|
}
|
|
9339
9352
|
/**
|
|
9340
9353
|
* Pursue a goal: attempt, judge with the clean verifier, re-prompt from what
|
|
@@ -9422,7 +9435,7 @@ var CodePiRuntimeEngine = class {
|
|
|
9422
9435
|
await this.#failure(command, active, detail);
|
|
9423
9436
|
return null;
|
|
9424
9437
|
});
|
|
9425
|
-
return { status: "running", message: "
|
|
9438
|
+
return { status: "running", message: "Theseus accepted the owner prompt" };
|
|
9426
9439
|
}
|
|
9427
9440
|
async #runAttempt(command, metadata2, active) {
|
|
9428
9441
|
const lease = fakeCodeLease(command, metadata2);
|
|
@@ -9447,7 +9460,8 @@ var CodePiRuntimeEngine = class {
|
|
|
9447
9460
|
lease,
|
|
9448
9461
|
workspaceDir: active.workspace.workspaceDir,
|
|
9449
9462
|
prompt: metadata2.prompt,
|
|
9450
|
-
signal: active.abort.signal
|
|
9463
|
+
signal: active.abort.signal,
|
|
9464
|
+
recipeIds: this.options.recipes.map((recipe2) => recipe2.id)
|
|
9451
9465
|
});
|
|
9452
9466
|
const closing = result.finalText.trim();
|
|
9453
9467
|
const completed = result.status === "completed" && Boolean(closing);
|
|
@@ -9511,7 +9525,7 @@ var CodePiRuntimeEngine = class {
|
|
|
9511
9525
|
}
|
|
9512
9526
|
}
|
|
9513
9527
|
async #diagnostic(command, active, value2) {
|
|
9514
|
-
const detail = value2.trim().slice(0, 2e3) || "
|
|
9528
|
+
const detail = value2.trim().slice(0, 2e3) || "Theseus runtime failed";
|
|
9515
9529
|
this.options.onDiagnostic?.(detail);
|
|
9516
9530
|
await this.#event(
|
|
9517
9531
|
command,
|
|
@@ -9841,8 +9855,9 @@ async function codeConnect(options) {
|
|
|
9841
9855
|
const appId = requestedAppId ?? cfg?.app.id;
|
|
9842
9856
|
const platform = (options.platform ?? cfg?.platformUrl ?? process.env.ODLA_PLATFORM_URL ?? "https://odla.ai").replace(/\/+$/, "");
|
|
9843
9857
|
const appEnv = options.env ?? (cfg ? cfg.envs.includes("dev") ? "dev" : cfg.envs[0] : void 0);
|
|
9844
|
-
|
|
9845
|
-
|
|
9858
|
+
const explicitEnv = options.env !== void 0;
|
|
9859
|
+
if (appEnv !== "dev" && appEnv !== "prod" || !explicitEnv && cfg && !cfg.envs.includes(appEnv)) {
|
|
9860
|
+
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}`);
|
|
9846
9861
|
}
|
|
9847
9862
|
if (process.platform !== "darwin" && process.platform !== "linux") {
|
|
9848
9863
|
throw new Error("odla Code hosts require macOS or Linux");
|
|
@@ -9939,16 +9954,15 @@ async function runCodeRuntime(input) {
|
|
|
9939
9954
|
const control = createCodeRuntimeControlClient({
|
|
9940
9955
|
endpoint: input.endpoint,
|
|
9941
9956
|
token: input.token,
|
|
9942
|
-
signal,
|
|
9943
9957
|
fetch: input.fetch
|
|
9944
9958
|
});
|
|
9945
|
-
const commandEngine = new
|
|
9959
|
+
const commandEngine = new TheseusRuntimeEngine({
|
|
9946
9960
|
control,
|
|
9947
9961
|
engine: input.engine,
|
|
9948
9962
|
recipes: CODE_BUILD_RECIPES,
|
|
9949
9963
|
recipeAuthorization: "registered_recipe",
|
|
9950
9964
|
localSource: input.localSource,
|
|
9951
|
-
onDiagnostic: (message2) => input.stdout.error(`
|
|
9965
|
+
onDiagnostic: (message2) => input.stdout.error(`Theseus runtime failed \xB7 ${message2}`)
|
|
9952
9966
|
});
|
|
9953
9967
|
const reconciler = new CodeRuntimeReconciler(control, commandEngine);
|
|
9954
9968
|
try {
|
|
@@ -10700,7 +10714,7 @@ Commands:
|
|
|
10700
10714
|
their own credentials for the shared db (the live one included)
|
|
10701
10715
|
\u2014 no secret is ever copied between people.
|
|
10702
10716
|
capabilities Show what the CLI automates vs agent edits and human checkpoints.
|
|
10703
|
-
code Enroll this Mac/Linux host for the current Studio-connected repository and run
|
|
10717
|
+
code Enroll this Mac/Linux host for the current Studio-connected repository and run Theseus.
|
|
10704
10718
|
"code repository show" reports the repository an app works on (Studio or a
|
|
10705
10719
|
human session connects one); "code grant request|list|approve|revoke" then
|
|
10706
10720
|
governs unattended access: an agent may request, only a human may approve.
|
|
@@ -15797,4 +15811,4 @@ export {
|
|
|
15797
15811
|
isTerminalHostedSecurityStatus,
|
|
15798
15812
|
runCli
|
|
15799
15813
|
};
|
|
15800
|
-
//# sourceMappingURL=chunk-
|
|
15814
|
+
//# sourceMappingURL=chunk-74DXL2MT.js.map
|