@odla-ai/cli 0.16.0 → 0.16.2
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/README.md +2 -2
- package/dist/bin.cjs +47 -17
- package/dist/bin.cjs.map +1 -1
- package/dist/bin.js +1 -1
- package/dist/{chunk-S3OYXHDG.js → chunk-PQX6SKYJ.js} +48 -18
- package/dist/chunk-PQX6SKYJ.js.map +1 -0
- package/dist/index.cjs +47 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/skills/odla-migrate/references/phase-2-db.md +2 -2
- package/dist/chunk-S3OYXHDG.js.map +0 -1
package/dist/bin.js
CHANGED
|
@@ -1800,10 +1800,10 @@ import { existsSync as existsSync4 } from "fs";
|
|
|
1800
1800
|
import { cpus, hostname, totalmem } from "os";
|
|
1801
1801
|
import { resolve as resolve5 } from "path";
|
|
1802
1802
|
|
|
1803
|
-
// ../harness/dist/chunk-
|
|
1803
|
+
// ../harness/dist/chunk-7SN5SG4N.js
|
|
1804
1804
|
var HARNESS_PROTOCOL_VERSION = 1;
|
|
1805
1805
|
|
|
1806
|
-
// ../harness/dist/chunk-
|
|
1806
|
+
// ../harness/dist/chunk-HX4QYGWE.js
|
|
1807
1807
|
var CONTROL = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/;
|
|
1808
1808
|
var HarnessProtocolError = class extends Error {
|
|
1809
1809
|
name = "HarnessProtocolError";
|
|
@@ -1881,7 +1881,7 @@ function encodeAgentInput(message2) {
|
|
|
1881
1881
|
`;
|
|
1882
1882
|
}
|
|
1883
1883
|
|
|
1884
|
-
// ../harness/dist/chunk-
|
|
1884
|
+
// ../harness/dist/chunk-QWWRL7M4.js
|
|
1885
1885
|
import { execFile as execFile2, spawn as spawn2 } from "child_process";
|
|
1886
1886
|
import { constants } from "fs";
|
|
1887
1887
|
import { access } from "fs/promises";
|
|
@@ -2398,7 +2398,7 @@ async function stageWorkspacePair(baselineSource, workspaceSource, options = {})
|
|
|
2398
2398
|
}
|
|
2399
2399
|
}
|
|
2400
2400
|
|
|
2401
|
-
// ../harness/dist/chunk-
|
|
2401
|
+
// ../harness/dist/chunk-T2RD6ZAW.js
|
|
2402
2402
|
import { createHash } from "crypto";
|
|
2403
2403
|
import { readFile, readdir as readdir2 } from "fs/promises";
|
|
2404
2404
|
import { relative as relative3, resolve as resolve4 } from "path";
|
|
@@ -2735,7 +2735,7 @@ function validateSnapshot(snapshot, limits) {
|
|
|
2735
2735
|
}
|
|
2736
2736
|
}
|
|
2737
2737
|
|
|
2738
|
-
// ../harness/dist/chunk-
|
|
2738
|
+
// ../harness/dist/chunk-T2RD6ZAW.js
|
|
2739
2739
|
import { spawn as spawn4 } from "child_process";
|
|
2740
2740
|
import { lstat as lstat2 } from "fs/promises";
|
|
2741
2741
|
import { resolve as resolve23, sep as sep3 } from "path";
|
|
@@ -3028,7 +3028,7 @@ function looksLikeDestination(value) {
|
|
|
3028
3028
|
return /^(?:[a-z][a-z0-9+.-]*:\/\/|\/|\\\\)/i.test(text) || /^[\w.-]+\.[a-z]{2,}(?:[/:]|$)/i.test(text);
|
|
3029
3029
|
}
|
|
3030
3030
|
|
|
3031
|
-
// ../harness/dist/chunk-
|
|
3031
|
+
// ../harness/dist/chunk-T2RD6ZAW.js
|
|
3032
3032
|
import { createHash as createHash3 } from "crypto";
|
|
3033
3033
|
async function digestStagedWorkspace(root, limits) {
|
|
3034
3034
|
const files = [];
|
|
@@ -3143,9 +3143,13 @@ function createCodeRuntimeControlClient(options) {
|
|
|
3143
3143
|
if (!Number.isSafeInteger(requestTimeoutMs) || requestTimeoutMs < 1e3 || requestTimeoutMs > 12e4) {
|
|
3144
3144
|
throw new TypeError("requestTimeoutMs must be an integer from 1000 to 120000");
|
|
3145
3145
|
}
|
|
3146
|
+
const modelRequestTimeoutMs = options.modelRequestTimeoutMs ?? 15 * 6e4;
|
|
3147
|
+
if (!Number.isSafeInteger(modelRequestTimeoutMs) || modelRequestTimeoutMs < 3e4 || modelRequestTimeoutMs > 30 * 6e4) {
|
|
3148
|
+
throw new TypeError("modelRequestTimeoutMs must be an integer from 30000 to 1800000");
|
|
3149
|
+
}
|
|
3146
3150
|
const request = options.fetch ?? fetch;
|
|
3147
|
-
const call = async (path, body) => {
|
|
3148
|
-
const timeout = AbortSignal.timeout(
|
|
3151
|
+
const call = async (path, body, timeoutMs = requestTimeoutMs) => {
|
|
3152
|
+
const timeout = AbortSignal.timeout(timeoutMs);
|
|
3149
3153
|
const signal = options.signal ? AbortSignal.any([options.signal, timeout]) : timeout;
|
|
3150
3154
|
let response2;
|
|
3151
3155
|
try {
|
|
@@ -3184,14 +3188,18 @@ function createCodeRuntimeControlClient(options) {
|
|
|
3184
3188
|
await call(`/registry/code/runtime/sessions/${validSessionId(sessionId)}/source`, {})
|
|
3185
3189
|
),
|
|
3186
3190
|
infer: async (sessionId, inference) => {
|
|
3187
|
-
const value = record3(await call(
|
|
3191
|
+
const value = record3(await call(
|
|
3192
|
+
`/registry/code/runtime/sessions/${validSessionId(sessionId)}/inference`,
|
|
3193
|
+
inference,
|
|
3194
|
+
modelRequestTimeoutMs
|
|
3195
|
+
));
|
|
3188
3196
|
if (!value || value.requestId !== inference.requestId || !record3(value.response) || !record3(value.receipt)) {
|
|
3189
3197
|
throw new CodeRuntimeControlError("invalid Code inference response", 502, "invalid_response");
|
|
3190
3198
|
}
|
|
3191
3199
|
return value;
|
|
3192
3200
|
},
|
|
3193
3201
|
review: async (sessionId, review) => parseReview(
|
|
3194
|
-
await call(`/registry/code/runtime/sessions/${validSessionId(sessionId)}/review`, review)
|
|
3202
|
+
await call(`/registry/code/runtime/sessions/${validSessionId(sessionId)}/review`, review, modelRequestTimeoutMs)
|
|
3195
3203
|
),
|
|
3196
3204
|
submitCandidate: async (sessionId, checkpointId, verification) => {
|
|
3197
3205
|
if (!/^cpoint_[0-9a-f]{32}$/.test(checkpointId)) throw new TypeError("invalid Code checkpoint id");
|
|
@@ -4319,7 +4327,13 @@ var safeRuntimeJson = (value) => {
|
|
|
4319
4327
|
};
|
|
4320
4328
|
function runtimeResultText(value) {
|
|
4321
4329
|
const record32 = runtimeRecord(value);
|
|
4322
|
-
|
|
4330
|
+
if (record32 && typeof record32.text === "string") return record32.text.slice(0, 2e4);
|
|
4331
|
+
if (record32 && typeof record32.error === "string") return `Pi failed: ${record32.error.slice(0, 19989)}`;
|
|
4332
|
+
return null;
|
|
4333
|
+
}
|
|
4334
|
+
function runtimeResultError(value) {
|
|
4335
|
+
const record32 = runtimeRecord(value);
|
|
4336
|
+
return record32 && typeof record32.error === "string" && record32.error.trim() ? record32.error.trim().slice(0, 2e3) : null;
|
|
4323
4337
|
}
|
|
4324
4338
|
var CodePiRuntimeEngine = class {
|
|
4325
4339
|
constructor(options) {
|
|
@@ -4427,9 +4441,11 @@ var CodePiRuntimeEngine = class {
|
|
|
4427
4441
|
}, conversationRefs);
|
|
4428
4442
|
}
|
|
4429
4443
|
active.done = this.#runAttempt(command, metadata2, active).catch(async (cause) => {
|
|
4430
|
-
|
|
4444
|
+
const detail = runtimeErrorMessage(cause);
|
|
4445
|
+
await this.#event(command, { type: "message", actor: "system", body: `Pi failed: ${detail}` }, conversationRefs).catch(() => void 0);
|
|
4446
|
+
await this.#diagnostic(command, active, detail);
|
|
4431
4447
|
await this.#event(command, { type: "status", status: "failed" }, conversationRefs).catch(() => void 0);
|
|
4432
|
-
await this.#failure(command, active,
|
|
4448
|
+
await this.#failure(command, active, detail);
|
|
4433
4449
|
return null;
|
|
4434
4450
|
});
|
|
4435
4451
|
return { status: "running", message: resume ? "Pi resumed from a portable checkpoint" : "Pi started" };
|
|
@@ -4454,13 +4470,15 @@ var CodePiRuntimeEngine = class {
|
|
|
4454
4470
|
baseCommitSha: active.baseCommitSha,
|
|
4455
4471
|
sourceTreeDigest: active.sourceTreeDigest
|
|
4456
4472
|
}, active).catch(async (cause) => {
|
|
4473
|
+
const detail = runtimeErrorMessage(cause);
|
|
4457
4474
|
await this.#event(
|
|
4458
4475
|
command,
|
|
4459
|
-
{ type: "message", actor: "system", body: `Pi failed: ${
|
|
4476
|
+
{ type: "message", actor: "system", body: `Pi failed: ${detail}` },
|
|
4460
4477
|
active.conversationRefs
|
|
4461
4478
|
).catch(() => void 0);
|
|
4479
|
+
await this.#diagnostic(command, active, detail);
|
|
4462
4480
|
await this.#event(command, { type: "status", status: "failed" }, active.conversationRefs).catch(() => void 0);
|
|
4463
|
-
await this.#failure(command, active,
|
|
4481
|
+
await this.#failure(command, active, detail);
|
|
4464
4482
|
return null;
|
|
4465
4483
|
});
|
|
4466
4484
|
return { status: "running", message: "Pi accepted the owner prompt" };
|
|
@@ -4572,7 +4590,9 @@ var CodePiRuntimeEngine = class {
|
|
|
4572
4590
|
durationMs: Date.now() - startedAt
|
|
4573
4591
|
}, active.conversationRefs).catch(() => void 0);
|
|
4574
4592
|
if (result.status === "failed") {
|
|
4575
|
-
|
|
4593
|
+
const detail = (runtimeResultError(result.result) ?? result.stderr.trim()) || "Pi container failed";
|
|
4594
|
+
await this.#diagnostic(command, active, detail);
|
|
4595
|
+
await this.#failure(command, active, detail);
|
|
4576
4596
|
}
|
|
4577
4597
|
return result;
|
|
4578
4598
|
}
|
|
@@ -4589,6 +4609,15 @@ var CodePiRuntimeEngine = class {
|
|
|
4589
4609
|
await this.options.control.reportSessionFailure(command.sessionId, active.failure).catch(() => void 0);
|
|
4590
4610
|
}
|
|
4591
4611
|
}
|
|
4612
|
+
async #diagnostic(command, active, value) {
|
|
4613
|
+
const detail = value.trim().slice(0, 2e3) || "Pi runtime failed";
|
|
4614
|
+
this.options.onDiagnostic?.(detail);
|
|
4615
|
+
await this.#event(
|
|
4616
|
+
command,
|
|
4617
|
+
{ type: "diagnostic", level: "error", message: detail },
|
|
4618
|
+
active.conversationRefs
|
|
4619
|
+
).catch(() => void 0);
|
|
4620
|
+
}
|
|
4592
4621
|
async #event(command, event, refs) {
|
|
4593
4622
|
await appendCodeRuntimeEvent(this.options.control, command, event, refs);
|
|
4594
4623
|
}
|
|
@@ -4906,7 +4935,8 @@ async function runCodeRuntime(input) {
|
|
|
4906
4935
|
image: CODE_PI_IMAGE,
|
|
4907
4936
|
recipes: CODE_BUILD_RECIPES,
|
|
4908
4937
|
recipeAuthorization: "registered_recipe",
|
|
4909
|
-
localSource: input.localSource
|
|
4938
|
+
localSource: input.localSource,
|
|
4939
|
+
onDiagnostic: (message2) => input.stdout.error(`Pi runtime failed \xB7 ${message2}`)
|
|
4910
4940
|
});
|
|
4911
4941
|
const reconciler = new CodeRuntimeReconciler(control, commandEngine);
|
|
4912
4942
|
try {
|
|
@@ -7746,4 +7776,4 @@ export {
|
|
|
7746
7776
|
exitCodeFor,
|
|
7747
7777
|
runCli
|
|
7748
7778
|
};
|
|
7749
|
-
//# sourceMappingURL=chunk-
|
|
7779
|
+
//# sourceMappingURL=chunk-PQX6SKYJ.js.map
|