@orbit-build/cli 1.9.1 → 1.9.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/dist/index.js +1632 -952
- package/package.json +1 -1
- package/skills/cumcm-draft/SKILL.md +64 -21
- package/skills/cumcm-draft/agents/openai.yaml +2 -2
- package/skills/cumcm-draft/assets/project-template/.cumcm/profile.json +3 -1
- package/skills/cumcm-draft/references/code-and-output-style.md +30 -6
- package/skills/cumcm-draft/references/cumcm-compliance.md +1 -1
- package/skills/cumcm-draft/references/modeling-quality.md +17 -0
- package/skills/cumcm-draft/references/project-architecture.md +17 -3
- package/skills/cumcm-draft/scripts/project_utils.py +5 -3
- package/skills/cumcm-draft/scripts/validate_project.py +258 -37
- package/skills/cumcm-draft/assets/project-template/code/requirements.txt +0 -1
package/dist/index.js
CHANGED
|
@@ -238103,7 +238103,7 @@ var require_src = __commonJS({
|
|
|
238103
238103
|
|
|
238104
238104
|
// src/index.ts
|
|
238105
238105
|
import { Command, Option } from "commander";
|
|
238106
|
-
import
|
|
238106
|
+
import picocolors37 from "picocolors";
|
|
238107
238107
|
|
|
238108
238108
|
// ../shared/dist/index.js
|
|
238109
238109
|
import { randomUUID } from "crypto";
|
|
@@ -248661,21 +248661,21 @@ function detectProcessSandbox(options = {}) {
|
|
|
248661
248661
|
};
|
|
248662
248662
|
}
|
|
248663
248663
|
if (platform === "win32") {
|
|
248664
|
-
const
|
|
248664
|
+
const verification = verifyWindowsSandboxHelper({
|
|
248665
248665
|
environment,
|
|
248666
248666
|
trustRoots: options.trustRoots ?? {},
|
|
248667
248667
|
fileDigest: options.fileDigest,
|
|
248668
248668
|
pathExists
|
|
248669
248669
|
});
|
|
248670
|
-
if (
|
|
248670
|
+
if (verification.ok) {
|
|
248671
248671
|
return {
|
|
248672
248672
|
platform,
|
|
248673
248673
|
backends: ["windows-appcontainer-helper"],
|
|
248674
248674
|
selectedBackend: "windows-appcontainer-helper",
|
|
248675
248675
|
native: true,
|
|
248676
248676
|
networkIsolation: true,
|
|
248677
|
-
helperDigest: helper.digest,
|
|
248678
|
-
helperKeyId: helper.keyId
|
|
248677
|
+
helperDigest: verification.helper.digest,
|
|
248678
|
+
helperKeyId: verification.helper.keyId
|
|
248679
248679
|
};
|
|
248680
248680
|
}
|
|
248681
248681
|
return {
|
|
@@ -248684,7 +248684,7 @@ function detectProcessSandbox(options = {}) {
|
|
|
248684
248684
|
selectedBackend: "none",
|
|
248685
248685
|
native: false,
|
|
248686
248686
|
networkIsolation: false,
|
|
248687
|
-
reason:
|
|
248687
|
+
reason: `Windows OS sandbox unavailable: ${verification.reason}`
|
|
248688
248688
|
};
|
|
248689
248689
|
}
|
|
248690
248690
|
return {
|
|
@@ -248829,6 +248829,11 @@ function normalizeRoots(cwd, roots, boundaries) {
|
|
|
248829
248829
|
return [...normalized];
|
|
248830
248830
|
}
|
|
248831
248831
|
function createWindowsHelperArgs(invocation, cwd, writableRoots, readOnlyRoots, network) {
|
|
248832
|
+
if (!win32.isAbsolute(invocation.file)) {
|
|
248833
|
+
throw new Error(
|
|
248834
|
+
`Windows sandbox commands require an absolute executable path: ${invocation.file}`
|
|
248835
|
+
);
|
|
248836
|
+
}
|
|
248832
248837
|
for (const writable of writableRoots) {
|
|
248833
248838
|
if (readOnlyRoots.some((readOnly) => pathsOverlap(writable, readOnly))) {
|
|
248834
248839
|
throw new Error(
|
|
@@ -248860,24 +248865,77 @@ function verifyWindowsSandboxHelper(options) {
|
|
|
248860
248865
|
const expectedDigest = options.environment.ORBIT_WINDOWS_SANDBOX_HELPER_SHA256;
|
|
248861
248866
|
const keyId = options.environment.ORBIT_WINDOWS_SANDBOX_HELPER_KEY_ID;
|
|
248862
248867
|
const signature = options.environment.ORBIT_WINDOWS_SANDBOX_HELPER_SIGNATURE;
|
|
248863
|
-
|
|
248864
|
-
|
|
248865
|
-
|
|
248866
|
-
|
|
248867
|
-
|
|
248868
|
-
|
|
248868
|
+
const missing = [
|
|
248869
|
+
["ORBIT_WINDOWS_SANDBOX_HELPER", helperPath],
|
|
248870
|
+
["ORBIT_WINDOWS_SANDBOX_HELPER_SHA256", expectedDigest],
|
|
248871
|
+
["ORBIT_WINDOWS_SANDBOX_HELPER_KEY_ID", keyId],
|
|
248872
|
+
["ORBIT_WINDOWS_SANDBOX_HELPER_SIGNATURE", signature]
|
|
248873
|
+
].filter(([, value]) => !value).map(([name]) => name);
|
|
248874
|
+
if (!helperPath || !expectedDigest || !keyId || !signature) {
|
|
248875
|
+
return {
|
|
248876
|
+
ok: false,
|
|
248877
|
+
reason: `Windows sandbox helper contract is incomplete; missing ${missing.join(", ")}.`
|
|
248878
|
+
};
|
|
248879
|
+
}
|
|
248880
|
+
if (!win32.isAbsolute(helperPath)) {
|
|
248881
|
+
return {
|
|
248882
|
+
ok: false,
|
|
248883
|
+
reason: "Windows sandbox helper path must be absolute."
|
|
248884
|
+
};
|
|
248885
|
+
}
|
|
248886
|
+
if (!/^[a-f0-9]{64}$/i.test(expectedDigest)) {
|
|
248887
|
+
return {
|
|
248888
|
+
ok: false,
|
|
248889
|
+
reason: "Windows sandbox helper SHA-256 must contain 64 hexadecimal characters."
|
|
248890
|
+
};
|
|
248891
|
+
}
|
|
248892
|
+
if (!/^[A-Za-z0-9._-]{1,128}$/.test(keyId)) {
|
|
248893
|
+
return {
|
|
248894
|
+
ok: false,
|
|
248895
|
+
reason: "Windows sandbox helper key id is invalid."
|
|
248896
|
+
};
|
|
248897
|
+
}
|
|
248898
|
+
if (!/^[A-Za-z0-9+/]+={0,2}$/.test(signature)) {
|
|
248899
|
+
return {
|
|
248900
|
+
ok: false,
|
|
248901
|
+
reason: "Windows sandbox helper signature is not valid base64."
|
|
248902
|
+
};
|
|
248903
|
+
}
|
|
248904
|
+
if (!options.pathExists(helperPath)) {
|
|
248905
|
+
return {
|
|
248906
|
+
ok: false,
|
|
248907
|
+
reason: "Windows sandbox helper file does not exist."
|
|
248908
|
+
};
|
|
248909
|
+
}
|
|
248869
248910
|
let actualDigest;
|
|
248870
248911
|
try {
|
|
248871
248912
|
const stat = lstatSync32(helperPath);
|
|
248872
|
-
if (!stat.isFile() || stat.isSymbolicLink())
|
|
248913
|
+
if (!stat.isFile() || stat.isSymbolicLink()) {
|
|
248914
|
+
return {
|
|
248915
|
+
ok: false,
|
|
248916
|
+
reason: "Windows sandbox helper must be a regular, non-symlink file."
|
|
248917
|
+
};
|
|
248918
|
+
}
|
|
248873
248919
|
actualDigest = options.fileDigest?.(helperPath) ?? createHash5("sha256").update(readFileSync2(helperPath)).digest("hex");
|
|
248874
248920
|
} catch {
|
|
248875
|
-
return
|
|
248921
|
+
return {
|
|
248922
|
+
ok: false,
|
|
248923
|
+
reason: "Windows sandbox helper could not be read for verification."
|
|
248924
|
+
};
|
|
248925
|
+
}
|
|
248926
|
+
if (actualDigest.toLowerCase() !== expectedDigest.toLowerCase()) {
|
|
248927
|
+
return {
|
|
248928
|
+
ok: false,
|
|
248929
|
+
reason: "Windows sandbox helper digest does not match the signed contract."
|
|
248930
|
+
};
|
|
248876
248931
|
}
|
|
248877
|
-
if (actualDigest.toLowerCase() !== expectedDigest.toLowerCase())
|
|
248878
|
-
return void 0;
|
|
248879
248932
|
const trustRoot = options.trustRoots[keyId];
|
|
248880
|
-
if (!trustRoot)
|
|
248933
|
+
if (!trustRoot) {
|
|
248934
|
+
return {
|
|
248935
|
+
ok: false,
|
|
248936
|
+
reason: `Windows sandbox helper key id "${keyId}" is not configured in security.windowsSandboxTrustRoots.`
|
|
248937
|
+
};
|
|
248938
|
+
}
|
|
248881
248939
|
const payload = JSON.stringify({
|
|
248882
248940
|
schemaVersion: 1,
|
|
248883
248941
|
protocol: "orbit-process-sandbox-v1",
|
|
@@ -248890,9 +248948,18 @@ function verifyWindowsSandboxHelper(options) {
|
|
|
248890
248948
|
createPublicKey3(trustRoot),
|
|
248891
248949
|
Buffer.from(signature, "base64")
|
|
248892
248950
|
);
|
|
248893
|
-
return valid ? {
|
|
248951
|
+
return valid ? {
|
|
248952
|
+
ok: true,
|
|
248953
|
+
helper: { digest: actualDigest.toLowerCase(), keyId }
|
|
248954
|
+
} : {
|
|
248955
|
+
ok: false,
|
|
248956
|
+
reason: "Windows sandbox helper signature verification failed."
|
|
248957
|
+
};
|
|
248894
248958
|
} catch {
|
|
248895
|
-
return
|
|
248959
|
+
return {
|
|
248960
|
+
ok: false,
|
|
248961
|
+
reason: "Windows sandbox helper trust root or signature is invalid."
|
|
248962
|
+
};
|
|
248896
248963
|
}
|
|
248897
248964
|
}
|
|
248898
248965
|
function createBubblewrapArgs(invocation, cwd, writableRoots, readOnlyRoots, network) {
|
|
@@ -248940,12 +249007,13 @@ import picocolors4 from "picocolors";
|
|
|
248940
249007
|
import { existsSync as existsSync12, readdirSync as readdirSync6 } from "fs";
|
|
248941
249008
|
import { createHash as createHash10 } from "crypto";
|
|
248942
249009
|
import { join as join10 } from "path";
|
|
248943
|
-
import { z as
|
|
249010
|
+
import { z as z39 } from "zod";
|
|
248944
249011
|
import { z as z213 } from "zod";
|
|
248945
249012
|
|
|
248946
249013
|
// ../tools/dist/index.js
|
|
248947
249014
|
import { z as z14 } from "zod";
|
|
248948
249015
|
import { z as z25 } from "zod";
|
|
249016
|
+
import { z as z34 } from "zod";
|
|
248949
249017
|
import { randomUUID as randomUUID4 } from "crypto";
|
|
248950
249018
|
import {
|
|
248951
249019
|
closeSync as closeSync4,
|
|
@@ -248959,11 +249027,11 @@ import {
|
|
|
248959
249027
|
} from "fs";
|
|
248960
249028
|
import { dirname as dirname5, isAbsolute as isAbsolute3, join as join7, resolve as resolve5 } from "path";
|
|
248961
249029
|
import { isAbsolute as isAbsolute22, resolve as resolve24 } from "path";
|
|
248962
|
-
import { z as
|
|
249030
|
+
import { z as z43 } from "zod";
|
|
248963
249031
|
import { isAbsolute as isAbsolute32, relative as relative4, win32 as win322 } from "path";
|
|
248964
249032
|
import glob from "fast-glob";
|
|
248965
249033
|
import { existsSync as existsSync24 } from "fs";
|
|
248966
|
-
import { z as
|
|
249034
|
+
import { z as z52 } from "zod";
|
|
248967
249035
|
|
|
248968
249036
|
// ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/index.js
|
|
248969
249037
|
var import_cross_spawn = __toESM(require_cross_spawn(), 1);
|
|
@@ -250554,68 +250622,174 @@ function create$(options) {
|
|
|
250554
250622
|
var $ = create$();
|
|
250555
250623
|
|
|
250556
250624
|
// ../tools/dist/index.js
|
|
250557
|
-
import { z as z52 } from "zod";
|
|
250558
250625
|
import { z as z62 } from "zod";
|
|
250559
250626
|
import { z as z72 } from "zod";
|
|
250627
|
+
import { z as z82 } from "zod";
|
|
250560
250628
|
import { createHash as createHash6 } from "crypto";
|
|
250561
250629
|
import { existsSync as existsSync34 } from "fs";
|
|
250562
|
-
import { z as z82 } from "zod";
|
|
250563
250630
|
import { z as z92 } from "zod";
|
|
250564
250631
|
import { z as z102 } from "zod";
|
|
250565
|
-
import { relative as relative22 } from "path";
|
|
250566
250632
|
import { z as z112 } from "zod";
|
|
250633
|
+
import { relative as relative22 } from "path";
|
|
250567
250634
|
import { z as z122 } from "zod";
|
|
250635
|
+
import { z as z132 } from "zod";
|
|
250568
250636
|
import { existsSync as existsSync42 } from "fs";
|
|
250569
250637
|
import { join as join23 } from "path";
|
|
250570
|
-
import { z as
|
|
250638
|
+
import { z as z15 } from "zod";
|
|
250571
250639
|
import { existsSync as existsSync62 } from "fs";
|
|
250572
|
-
import { z as
|
|
250640
|
+
import { z as z142 } from "zod";
|
|
250573
250641
|
import { existsSync as existsSync52 } from "fs";
|
|
250574
|
-
import { z as z15 } from "zod";
|
|
250575
|
-
import glob2 from "fast-glob";
|
|
250576
250642
|
import { z as z16 } from "zod";
|
|
250643
|
+
import glob2 from "fast-glob";
|
|
250644
|
+
import { z as z17 } from "zod";
|
|
250577
250645
|
import { lstatSync as lstatSync4, mkdtempSync, readdirSync as readdirSync4, rmSync as rmSync3, statSync as statSync2 } from "fs";
|
|
250578
250646
|
import { tmpdir } from "os";
|
|
250579
250647
|
import { basename, extname as extname3, join as join32 } from "path";
|
|
250580
|
-
import { z as
|
|
250648
|
+
import { z as z18 } from "zod";
|
|
250581
250649
|
import { lstatSync as lstatSync24, mkdtempSync as mkdtempSync2, readdirSync as readdirSync22, rmSync as rmSync23 } from "fs";
|
|
250582
250650
|
import { tmpdir as tmpdir2 } from "os";
|
|
250583
250651
|
import { basename as basename2, extname as extname22, join as join42 } from "path";
|
|
250584
|
-
import { z as
|
|
250652
|
+
import { z as z19 } from "zod";
|
|
250585
250653
|
import { mkdtempSync as mkdtempSync3, readFileSync as readFileSync4, rmSync as rmSync32, statSync as statSync22 } from "fs";
|
|
250586
250654
|
import { tmpdir as tmpdir3 } from "os";
|
|
250587
250655
|
import { join as join52 } from "path";
|
|
250588
|
-
import { z as
|
|
250656
|
+
import { z as z20 } from "zod";
|
|
250589
250657
|
import { mkdirSync as mkdirSync23, rmSync as rmSync4, statSync as statSync3 } from "fs";
|
|
250590
250658
|
import { randomUUID as randomUUID22 } from "crypto";
|
|
250591
250659
|
import { dirname as dirname23 } from "path";
|
|
250592
|
-
import { z as z20 } from "zod";
|
|
250593
250660
|
import { z as z21 } from "zod";
|
|
250594
250661
|
import { z as z222 } from "zod";
|
|
250662
|
+
import { z as z232 } from "zod";
|
|
250595
250663
|
import { existsSync as existsSync7 } from "fs";
|
|
250596
250664
|
import { win32 as win3222 } from "path";
|
|
250597
|
-
import { z as
|
|
250665
|
+
import { z as z242 } from "zod";
|
|
250598
250666
|
import { existsSync as existsSync8 } from "fs";
|
|
250599
250667
|
import { join as join62, resolve as resolve33 } from "path";
|
|
250600
|
-
import { z as
|
|
250668
|
+
import { z as z26 } from "zod";
|
|
250601
250669
|
var import_ipaddr = __toESM(require_ipaddr(), 1);
|
|
250602
250670
|
import { lookup } from "dns/promises";
|
|
250603
250671
|
import { isIP } from "net";
|
|
250604
|
-
import { z as
|
|
250672
|
+
import { z as z252 } from "zod";
|
|
250605
250673
|
var import_undici = __toESM(require_undici(), 1);
|
|
250606
250674
|
import { isIP as isIP2 } from "net";
|
|
250607
|
-
import { z as z26 } from "zod";
|
|
250608
250675
|
import { z as z27 } from "zod";
|
|
250676
|
+
import { z as z28 } from "zod";
|
|
250609
250677
|
import { spawn as spawn2 } from "child_process";
|
|
250610
250678
|
import { existsSync as existsSync9, lstatSync as lstatSync33 } from "fs";
|
|
250611
250679
|
import { resolve as resolve42 } from "path";
|
|
250612
|
-
import { z as
|
|
250680
|
+
import { z as z29 } from "zod";
|
|
250613
250681
|
import { execFile, spawn } from "child_process";
|
|
250614
250682
|
import { randomUUID as randomUUID32 } from "crypto";
|
|
250615
|
-
var
|
|
250616
|
-
|
|
250617
|
-
|
|
250618
|
-
|
|
250683
|
+
var ToolExecutionContractMetadataSchema = z14.object({
|
|
250684
|
+
version: z14.literal(2),
|
|
250685
|
+
readOnly: z14.boolean(),
|
|
250686
|
+
idempotent: z14.boolean(),
|
|
250687
|
+
concurrency: z14.enum(["exclusive", "parallel"]),
|
|
250688
|
+
cancellation: z14.enum(["boundary", "cooperative"]),
|
|
250689
|
+
timeoutMs: z14.number().int().min(1e3).max(864e5).optional(),
|
|
250690
|
+
outputSchema: z14.custom(
|
|
250691
|
+
(value) => typeof value === "object" && value !== null && typeof value.safeParse === "function",
|
|
250692
|
+
"outputSchema must expose a safeParse function."
|
|
250693
|
+
).optional(),
|
|
250694
|
+
outputJsonSchema: z14.record(z14.unknown()).optional(),
|
|
250695
|
+
presentation: z14.object({
|
|
250696
|
+
modelMaxChars: z14.number().int().positive().max(1e7).optional(),
|
|
250697
|
+
userMaxChars: z14.number().int().positive().max(1e7).optional()
|
|
250698
|
+
}).strict().optional()
|
|
250699
|
+
}).strict().superRefine((contract, context) => {
|
|
250700
|
+
if (contract.concurrency === "parallel" && !contract.readOnly) {
|
|
250701
|
+
context.addIssue({
|
|
250702
|
+
code: z14.ZodIssueCode.custom,
|
|
250703
|
+
path: ["concurrency"],
|
|
250704
|
+
message: "Parallel tools must declare readOnly: true."
|
|
250705
|
+
});
|
|
250706
|
+
}
|
|
250707
|
+
if (contract.concurrency === "parallel" && !contract.idempotent) {
|
|
250708
|
+
context.addIssue({
|
|
250709
|
+
code: z14.ZodIssueCode.custom,
|
|
250710
|
+
path: ["idempotent"],
|
|
250711
|
+
message: "Parallel tools must declare idempotent: true."
|
|
250712
|
+
});
|
|
250713
|
+
}
|
|
250714
|
+
});
|
|
250715
|
+
var LEGACY_EXECUTION_CONTRACT = {
|
|
250716
|
+
version: 2,
|
|
250717
|
+
readOnly: false,
|
|
250718
|
+
idempotent: false,
|
|
250719
|
+
concurrency: "exclusive",
|
|
250720
|
+
cancellation: "boundary"
|
|
250721
|
+
};
|
|
250722
|
+
var ToolResultEnvelopeSchema = z14.object({
|
|
250723
|
+
ok: z14.boolean(),
|
|
250724
|
+
data: z14.unknown().optional(),
|
|
250725
|
+
error: z14.string().optional(),
|
|
250726
|
+
display: z14.string().optional(),
|
|
250727
|
+
metadata: z14.record(z14.unknown()).optional(),
|
|
250728
|
+
failure: z14.object({
|
|
250729
|
+
code: z14.string().trim().min(1),
|
|
250730
|
+
message: z14.string().trim().min(1),
|
|
250731
|
+
retryable: z14.boolean(),
|
|
250732
|
+
details: z14.record(z14.unknown()).optional()
|
|
250733
|
+
}).passthrough().optional()
|
|
250734
|
+
}).passthrough();
|
|
250735
|
+
function resolveToolExecutionContract(tool) {
|
|
250736
|
+
return tool.execution ?? LEGACY_EXECUTION_CONTRACT;
|
|
250737
|
+
}
|
|
250738
|
+
function isParallelTool(tool) {
|
|
250739
|
+
const contract = resolveToolExecutionContract(tool);
|
|
250740
|
+
return contract.version === 2 && contract.readOnly && contract.idempotent && contract.concurrency === "parallel";
|
|
250741
|
+
}
|
|
250742
|
+
function validateToolResult(tool, value) {
|
|
250743
|
+
const envelope = ToolResultEnvelopeSchema.safeParse(value);
|
|
250744
|
+
if (!envelope.success) {
|
|
250745
|
+
return contractFailure(
|
|
250746
|
+
"invalid_output",
|
|
250747
|
+
`Tool "${tool.name}" returned an invalid result envelope.`
|
|
250748
|
+
);
|
|
250749
|
+
}
|
|
250750
|
+
const result = envelope.data;
|
|
250751
|
+
if (!result.ok) {
|
|
250752
|
+
const message2 = result.error?.trim() || result.failure?.message || `Tool "${tool.name}" failed.`;
|
|
250753
|
+
return {
|
|
250754
|
+
...result,
|
|
250755
|
+
error: message2,
|
|
250756
|
+
failure: result.failure ?? {
|
|
250757
|
+
code: "execution_error",
|
|
250758
|
+
message: message2,
|
|
250759
|
+
retryable: false
|
|
250760
|
+
}
|
|
250761
|
+
};
|
|
250762
|
+
}
|
|
250763
|
+
const outputSchema = tool.execution?.outputSchema;
|
|
250764
|
+
if (!outputSchema) return result;
|
|
250765
|
+
try {
|
|
250766
|
+
const parsed = outputSchema.safeParse(result.data);
|
|
250767
|
+
if (parsed.success) return { ...result, data: parsed.data };
|
|
250768
|
+
const issue = parsed.error.issues[0];
|
|
250769
|
+
const location = issue?.path.length ? issue.path.join(".") : "data";
|
|
250770
|
+
return contractFailure(
|
|
250771
|
+
"invalid_output",
|
|
250772
|
+
`Tool "${tool.name}" output validation failed at ${location}: ${issue?.message ?? "invalid value"}`
|
|
250773
|
+
);
|
|
250774
|
+
} catch {
|
|
250775
|
+
return contractFailure(
|
|
250776
|
+
"invalid_output",
|
|
250777
|
+
`Tool "${tool.name}" output validator threw an exception.`
|
|
250778
|
+
);
|
|
250779
|
+
}
|
|
250780
|
+
}
|
|
250781
|
+
function contractFailure(code, message2, retryable = false, details) {
|
|
250782
|
+
return {
|
|
250783
|
+
ok: false,
|
|
250784
|
+
error: message2,
|
|
250785
|
+
failure: { code, message: message2, retryable, ...details ? { details } : {} }
|
|
250786
|
+
};
|
|
250787
|
+
}
|
|
250788
|
+
var ToolRegistrationSchema = z25.object({
|
|
250789
|
+
name: z25.string().regex(/^[A-Za-z0-9_-]{1,64}$/),
|
|
250790
|
+
description: z25.string().trim().min(1).max(2e4),
|
|
250791
|
+
risk: z25.enum(["read", "write", "execute", "network", "dangerous"]),
|
|
250792
|
+
execution: ToolExecutionContractMetadataSchema.optional()
|
|
250619
250793
|
});
|
|
250620
250794
|
var ToolRegistry = class {
|
|
250621
250795
|
tools = /* @__PURE__ */ new Map();
|
|
@@ -250705,11 +250879,18 @@ function resolveToolPath(ctx, requestedPath) {
|
|
|
250705
250879
|
function buildToolChildEnvironment(ctx) {
|
|
250706
250880
|
return ctx.config && isFullAccessEnabled(ctx.config) ? buildInheritedChildEnvironment() : buildSanitizedChildEnvironment();
|
|
250707
250881
|
}
|
|
250708
|
-
|
|
250709
|
-
|
|
250710
|
-
|
|
250711
|
-
|
|
250712
|
-
|
|
250882
|
+
function buildToolProcessSandboxPolicy(ctx) {
|
|
250883
|
+
return {
|
|
250884
|
+
mode: ctx.config && isFullAccessEnabled(ctx.config) ? "off" : ctx.config?.tools.bash.sandbox ?? "auto",
|
|
250885
|
+
network: ctx.config?.tools.bash.network ?? "inherit",
|
|
250886
|
+
trustRoots: ctx.config?.security.windowsSandboxTrustRoots
|
|
250887
|
+
};
|
|
250888
|
+
}
|
|
250889
|
+
var EditFileInputSchema = z34.object({
|
|
250890
|
+
path: z34.string().trim().min(1).max(4096),
|
|
250891
|
+
oldText: z34.string().max(5e6),
|
|
250892
|
+
newText: z34.string().max(5e6),
|
|
250893
|
+
replaceAll: z34.boolean().optional()
|
|
250713
250894
|
});
|
|
250714
250895
|
var EditFileTool = class {
|
|
250715
250896
|
name = "edit_file";
|
|
@@ -251419,18 +251600,27 @@ function normalizedReadRoots(ctx) {
|
|
|
251419
251600
|
return { name: root.name, path: root.path };
|
|
251420
251601
|
});
|
|
251421
251602
|
}
|
|
251422
|
-
var GlobInputSchema =
|
|
251423
|
-
pattern:
|
|
251603
|
+
var GlobInputSchema = z43.object({
|
|
251604
|
+
pattern: z43.string().min(1).max(4096).refine(isReadableGlob, {
|
|
251424
251605
|
message: "Glob pattern must stay relative to the selected root or use skill://<skill-name>/<pattern>."
|
|
251425
251606
|
}),
|
|
251426
|
-
path:
|
|
251427
|
-
maxResults:
|
|
251607
|
+
path: z43.string().trim().min(1).max(4096).optional(),
|
|
251608
|
+
maxResults: z43.number().int().min(1).max(5e3).optional()
|
|
251428
251609
|
});
|
|
251429
251610
|
var GlobTool = class {
|
|
251430
251611
|
name = "glob";
|
|
251431
251612
|
description = "Find files matching a relative glob in the project, a selected host directory when unrestricted Full Access is active, or an active skill:// resource, with a configurable bounded result count.";
|
|
251432
251613
|
inputSchema = GlobInputSchema;
|
|
251433
251614
|
risk = "read";
|
|
251615
|
+
execution = {
|
|
251616
|
+
version: 2,
|
|
251617
|
+
readOnly: true,
|
|
251618
|
+
idempotent: true,
|
|
251619
|
+
concurrency: "parallel",
|
|
251620
|
+
cancellation: "boundary",
|
|
251621
|
+
timeoutMs: 12e4,
|
|
251622
|
+
outputSchema: z43.array(z43.string())
|
|
251623
|
+
};
|
|
251434
251624
|
async execute(input, ctx) {
|
|
251435
251625
|
try {
|
|
251436
251626
|
const skillUri = parseSkillUri(input.pattern);
|
|
@@ -251467,13 +251657,13 @@ function isReadableGlob(pattern) {
|
|
|
251467
251657
|
return false;
|
|
251468
251658
|
}
|
|
251469
251659
|
}
|
|
251470
|
-
var GrepInputSchema =
|
|
251471
|
-
pattern:
|
|
251472
|
-
path:
|
|
251473
|
-
include:
|
|
251660
|
+
var GrepInputSchema = z52.object({
|
|
251661
|
+
pattern: z52.string().min(1).max(4096),
|
|
251662
|
+
path: z52.string().max(4096).optional(),
|
|
251663
|
+
include: z52.string().max(4096).refine(isWorkspaceRelativeGlob, {
|
|
251474
251664
|
message: "Include glob must stay relative to the search directory."
|
|
251475
251665
|
}).optional(),
|
|
251476
|
-
maxResults:
|
|
251666
|
+
maxResults: z52.number().int().min(1).max(1e3).optional()
|
|
251477
251667
|
});
|
|
251478
251668
|
var RIPGREP_LINE_PATTERN = /^((?:[A-Za-z]:)?[^:\r\n]+):(\d+):(.*)$/;
|
|
251479
251669
|
function parseRipgrepLine(line) {
|
|
@@ -251504,6 +251694,21 @@ var GrepTool = class {
|
|
|
251504
251694
|
description = "Search for string patterns across project files, any host directory when unrestricted Full Access is active, or an active skill:// resource. Uses ripgrep if available, falling back to a Node-based search.";
|
|
251505
251695
|
inputSchema = GrepInputSchema;
|
|
251506
251696
|
risk = "read";
|
|
251697
|
+
execution = {
|
|
251698
|
+
version: 2,
|
|
251699
|
+
readOnly: true,
|
|
251700
|
+
idempotent: true,
|
|
251701
|
+
concurrency: "parallel",
|
|
251702
|
+
cancellation: "cooperative",
|
|
251703
|
+
timeoutMs: 12e4,
|
|
251704
|
+
outputSchema: z52.array(
|
|
251705
|
+
z52.object({
|
|
251706
|
+
file: z52.string(),
|
|
251707
|
+
line: z52.number().int().positive(),
|
|
251708
|
+
content: z52.string()
|
|
251709
|
+
})
|
|
251710
|
+
)
|
|
251711
|
+
};
|
|
251507
251712
|
async execute(input, ctx) {
|
|
251508
251713
|
const max = input.maxResults ?? 100;
|
|
251509
251714
|
let skillName;
|
|
@@ -251655,16 +251860,25 @@ function formatResultPath(file, root, skillName) {
|
|
|
251655
251860
|
const relativePath = toWorkspaceRelativePath(file, root);
|
|
251656
251861
|
return skillName ? skillResourceUri(skillName, relativePath) : relativePath;
|
|
251657
251862
|
}
|
|
251658
|
-
var ListFilesInputSchema =
|
|
251659
|
-
path:
|
|
251660
|
-
depth:
|
|
251661
|
-
maxResults:
|
|
251863
|
+
var ListFilesInputSchema = z62.object({
|
|
251864
|
+
path: z62.string().max(4096).optional(),
|
|
251865
|
+
depth: z62.number().int().min(1).max(100).optional(),
|
|
251866
|
+
maxResults: z62.number().int().min(1).max(5e3).optional()
|
|
251662
251867
|
});
|
|
251663
251868
|
var ListFilesTool = class {
|
|
251664
251869
|
name = "list_files";
|
|
251665
251870
|
description = "List files recursively in the project, any host directory when unrestricted Full Access is active, or an active skill:// resource with bounded depth/results, ignoring dependencies and build output folders.";
|
|
251666
251871
|
inputSchema = ListFilesInputSchema;
|
|
251667
251872
|
risk = "read";
|
|
251873
|
+
execution = {
|
|
251874
|
+
version: 2,
|
|
251875
|
+
readOnly: true,
|
|
251876
|
+
idempotent: true,
|
|
251877
|
+
concurrency: "parallel",
|
|
251878
|
+
cancellation: "boundary",
|
|
251879
|
+
timeoutMs: 12e4,
|
|
251880
|
+
outputSchema: z62.array(z62.string())
|
|
251881
|
+
};
|
|
251668
251882
|
async execute(input, ctx) {
|
|
251669
251883
|
try {
|
|
251670
251884
|
const skillUri = input.path ? parseSkillUri(input.path) : void 0;
|
|
@@ -251696,16 +251910,25 @@ var ListFilesTool = class {
|
|
|
251696
251910
|
}
|
|
251697
251911
|
}
|
|
251698
251912
|
};
|
|
251699
|
-
var ReadFileInputSchema =
|
|
251700
|
-
path:
|
|
251701
|
-
startLine:
|
|
251702
|
-
endLine:
|
|
251913
|
+
var ReadFileInputSchema = z72.object({
|
|
251914
|
+
path: z72.string().min(1).max(4096),
|
|
251915
|
+
startLine: z72.number().int().positive().optional(),
|
|
251916
|
+
endLine: z72.number().int().positive().optional()
|
|
251703
251917
|
});
|
|
251704
251918
|
var ReadFileTool = class {
|
|
251705
251919
|
name = "read_file";
|
|
251706
251920
|
description = "Read a project file, any host file when unrestricted Full Access is active, or an active Skill resource addressed as skill://<skill-name>/<path>. Defaults to at most 400 lines and bounds oversized output for the model context.";
|
|
251707
251921
|
inputSchema = ReadFileInputSchema;
|
|
251708
251922
|
risk = "read";
|
|
251923
|
+
execution = {
|
|
251924
|
+
version: 2,
|
|
251925
|
+
readOnly: true,
|
|
251926
|
+
idempotent: true,
|
|
251927
|
+
concurrency: "parallel",
|
|
251928
|
+
cancellation: "boundary",
|
|
251929
|
+
timeoutMs: 12e4,
|
|
251930
|
+
outputSchema: z72.string()
|
|
251931
|
+
};
|
|
251709
251932
|
async execute(input, ctx) {
|
|
251710
251933
|
try {
|
|
251711
251934
|
const safePath = resolveReadableFile(ctx, input.path);
|
|
@@ -251735,11 +251958,11 @@ var ReadFileTool = class {
|
|
|
251735
251958
|
}
|
|
251736
251959
|
}
|
|
251737
251960
|
};
|
|
251738
|
-
var WriteFileInputSchema =
|
|
251739
|
-
path:
|
|
251740
|
-
content:
|
|
251741
|
-
intent:
|
|
251742
|
-
expectedHash:
|
|
251961
|
+
var WriteFileInputSchema = z82.object({
|
|
251962
|
+
path: z82.string().trim().min(1).max(4096),
|
|
251963
|
+
content: z82.string().max(5e6),
|
|
251964
|
+
intent: z82.enum(["create", "overwrite", "upsert"]).optional(),
|
|
251965
|
+
expectedHash: z82.string().regex(/^[a-f0-9]{64}$/i).optional()
|
|
251743
251966
|
});
|
|
251744
251967
|
var WriteFileTool = class {
|
|
251745
251968
|
name = "write_file";
|
|
@@ -251807,8 +252030,8 @@ var WriteFileTool = class {
|
|
|
251807
252030
|
}
|
|
251808
252031
|
}
|
|
251809
252032
|
};
|
|
251810
|
-
var GitCommitInputSchema =
|
|
251811
|
-
message:
|
|
252033
|
+
var GitCommitInputSchema = z92.object({
|
|
252034
|
+
message: z92.string().trim().min(1).max(1e3).optional()
|
|
251812
252035
|
});
|
|
251813
252036
|
var GitCommitTool = class {
|
|
251814
252037
|
name = "git_commit";
|
|
@@ -251839,17 +252062,33 @@ ${redactSecrets(stdout2)}`
|
|
|
251839
252062
|
}
|
|
251840
252063
|
}
|
|
251841
252064
|
};
|
|
251842
|
-
var GitDiffInputSchema =
|
|
251843
|
-
staged:
|
|
252065
|
+
var GitDiffInputSchema = z102.object({
|
|
252066
|
+
staged: z102.boolean().optional()
|
|
251844
252067
|
});
|
|
251845
252068
|
var GitDiffTool = class {
|
|
251846
252069
|
name = "git_diff";
|
|
251847
252070
|
description = "Show working tree diff or staged diff in the git repository.";
|
|
251848
252071
|
inputSchema = GitDiffInputSchema;
|
|
251849
252072
|
risk = "read";
|
|
252073
|
+
execution = {
|
|
252074
|
+
version: 2,
|
|
252075
|
+
readOnly: true,
|
|
252076
|
+
idempotent: true,
|
|
252077
|
+
concurrency: "parallel",
|
|
252078
|
+
cancellation: "cooperative",
|
|
252079
|
+
timeoutMs: 12e4,
|
|
252080
|
+
outputSchema: z102.string()
|
|
252081
|
+
};
|
|
251850
252082
|
async execute(input, ctx) {
|
|
251851
252083
|
try {
|
|
251852
|
-
const args = [
|
|
252084
|
+
const args = [
|
|
252085
|
+
"--no-optional-locks",
|
|
252086
|
+
"-c",
|
|
252087
|
+
"core.fsmonitor=false",
|
|
252088
|
+
"diff",
|
|
252089
|
+
"--no-ext-diff",
|
|
252090
|
+
"--no-textconv"
|
|
252091
|
+
];
|
|
251853
252092
|
if (input.staged) {
|
|
251854
252093
|
args.push("--staged");
|
|
251855
252094
|
}
|
|
@@ -251878,8 +252117,8 @@ var GitDiffTool = class {
|
|
|
251878
252117
|
}
|
|
251879
252118
|
}
|
|
251880
252119
|
};
|
|
251881
|
-
var GitRestoreInputSchema =
|
|
251882
|
-
paths:
|
|
252120
|
+
var GitRestoreInputSchema = z112.object({
|
|
252121
|
+
paths: z112.array(z112.string().trim().min(1).max(4096)).min(1).max(200)
|
|
251883
252122
|
});
|
|
251884
252123
|
var GitRestoreTool = class {
|
|
251885
252124
|
name = "git_restore";
|
|
@@ -251915,15 +252154,31 @@ var GitRestoreTool = class {
|
|
|
251915
252154
|
}
|
|
251916
252155
|
}
|
|
251917
252156
|
};
|
|
251918
|
-
var GitStatusInputSchema =
|
|
252157
|
+
var GitStatusInputSchema = z122.object({});
|
|
251919
252158
|
var GitStatusTool = class {
|
|
251920
252159
|
name = "git_status";
|
|
251921
252160
|
description = "Show working tree status of git files (short format).";
|
|
251922
252161
|
inputSchema = GitStatusInputSchema;
|
|
251923
252162
|
risk = "read";
|
|
252163
|
+
execution = {
|
|
252164
|
+
version: 2,
|
|
252165
|
+
readOnly: true,
|
|
252166
|
+
idempotent: true,
|
|
252167
|
+
concurrency: "parallel",
|
|
252168
|
+
cancellation: "cooperative",
|
|
252169
|
+
timeoutMs: 12e4,
|
|
252170
|
+
outputSchema: z122.string()
|
|
252171
|
+
};
|
|
251924
252172
|
async execute(_input, ctx) {
|
|
251925
252173
|
try {
|
|
251926
|
-
const
|
|
252174
|
+
const args = [
|
|
252175
|
+
"--no-optional-locks",
|
|
252176
|
+
"-c",
|
|
252177
|
+
"core.fsmonitor=false",
|
|
252178
|
+
"status",
|
|
252179
|
+
"--short"
|
|
252180
|
+
];
|
|
252181
|
+
const { stdout: stdout2 } = await execa("git", args, {
|
|
251927
252182
|
...HIDDEN_CHILD_PROCESS_OPTIONS,
|
|
251928
252183
|
cwd: ctx.cwd,
|
|
251929
252184
|
env: buildToolChildEnvironment(ctx),
|
|
@@ -251944,7 +252199,7 @@ var GitStatusTool = class {
|
|
|
251944
252199
|
}
|
|
251945
252200
|
};
|
|
251946
252201
|
var PACKAGE_MANIFEST_MAX_BYTES = 1024 * 1024;
|
|
251947
|
-
var DetectProjectInputSchema =
|
|
252202
|
+
var DetectProjectInputSchema = z132.object({});
|
|
251948
252203
|
var DetectProjectTool = class {
|
|
251949
252204
|
name = "detect_project";
|
|
251950
252205
|
description = "Detect project profile including programming languages, frameworks, package manager, test/lint/build scripts, and main entry files.";
|
|
@@ -252055,21 +252310,21 @@ var DetectProjectTool = class {
|
|
|
252055
252310
|
}
|
|
252056
252311
|
}
|
|
252057
252312
|
};
|
|
252058
|
-
var IndexedSymbolSchema =
|
|
252059
|
-
name:
|
|
252060
|
-
type:
|
|
252061
|
-
line:
|
|
252313
|
+
var IndexedSymbolSchema = z142.object({
|
|
252314
|
+
name: z142.string().min(1),
|
|
252315
|
+
type: z142.enum(["class", "interface", "function", "constant", "type"]),
|
|
252316
|
+
line: z142.number().int().positive()
|
|
252062
252317
|
});
|
|
252063
|
-
var IndexedFileSchema =
|
|
252064
|
-
mtime:
|
|
252065
|
-
symbols:
|
|
252066
|
-
imports:
|
|
252318
|
+
var IndexedFileSchema = z142.object({
|
|
252319
|
+
mtime: z142.number().finite(),
|
|
252320
|
+
symbols: z142.array(IndexedSymbolSchema).max(5e4),
|
|
252321
|
+
imports: z142.array(z142.string().max(4096)).max(2e4).optional()
|
|
252067
252322
|
});
|
|
252068
|
-
var SymbolIndexSchema =
|
|
252069
|
-
files:
|
|
252323
|
+
var SymbolIndexSchema = z142.object({
|
|
252324
|
+
files: z142.record(IndexedFileSchema).refine((files) => Object.keys(files).length <= 1e4, {
|
|
252070
252325
|
message: "Symbol index contains too many files."
|
|
252071
252326
|
}),
|
|
252072
|
-
indexedAt:
|
|
252327
|
+
indexedAt: z142.string().min(1)
|
|
252073
252328
|
});
|
|
252074
252329
|
var MAX_SYMBOL_INDEX_BYTES = 256 * 1024 * 1024;
|
|
252075
252330
|
var MAX_SYMBOL_SOURCE_BYTES = 2 * 1024 * 1024;
|
|
@@ -252081,8 +252336,8 @@ function parseSymbolIndex(raw) {
|
|
|
252081
252336
|
return null;
|
|
252082
252337
|
}
|
|
252083
252338
|
}
|
|
252084
|
-
var SearchSymbolsInputSchema =
|
|
252085
|
-
query:
|
|
252339
|
+
var SearchSymbolsInputSchema = z142.object({
|
|
252340
|
+
query: z142.string().trim().min(1).max(512).describe("The symbol name or part of the name to search for.")
|
|
252086
252341
|
});
|
|
252087
252342
|
var SearchSymbolsTool = class {
|
|
252088
252343
|
name = "search_symbols";
|
|
@@ -252149,8 +252404,8 @@ var SearchSymbolsTool = class {
|
|
|
252149
252404
|
}
|
|
252150
252405
|
}
|
|
252151
252406
|
};
|
|
252152
|
-
var FindSymbolReferencesInputSchema =
|
|
252153
|
-
symbol:
|
|
252407
|
+
var FindSymbolReferencesInputSchema = z15.object({
|
|
252408
|
+
symbol: z15.string().trim().min(1).max(512).describe("The symbol name to search references for.")
|
|
252154
252409
|
});
|
|
252155
252410
|
function escapeRegExp(value) {
|
|
252156
252411
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
@@ -252247,7 +252502,7 @@ var FindSymbolReferencesTool = class {
|
|
|
252247
252502
|
}
|
|
252248
252503
|
}
|
|
252249
252504
|
};
|
|
252250
|
-
var InspectProjectInputSchema =
|
|
252505
|
+
var InspectProjectInputSchema = z16.object({});
|
|
252251
252506
|
var InspectProjectTool = class {
|
|
252252
252507
|
name = "inspect_project";
|
|
252253
252508
|
description = "Inspect project directory structure, returning a tree summary of top-level folders and files.";
|
|
@@ -252292,18 +252547,18 @@ ${treeLines.slice(0, 200).join("\n")}${treeLines.length > 200 ? "\n... [TRUNCATE
|
|
|
252292
252547
|
}
|
|
252293
252548
|
}
|
|
252294
252549
|
};
|
|
252295
|
-
var UpdatePlanInputSchema =
|
|
252296
|
-
explanation:
|
|
252297
|
-
plan:
|
|
252298
|
-
|
|
252299
|
-
step:
|
|
252300
|
-
status:
|
|
252550
|
+
var UpdatePlanInputSchema = z17.object({
|
|
252551
|
+
explanation: z17.string().trim().min(1).max(1e3).describe("Brief reason for changing the plan.").optional(),
|
|
252552
|
+
plan: z17.array(
|
|
252553
|
+
z17.object({
|
|
252554
|
+
step: z17.string().trim().min(1).max(1e3),
|
|
252555
|
+
status: z17.enum(["pending", "in_progress", "completed"])
|
|
252301
252556
|
})
|
|
252302
252557
|
).max(100)
|
|
252303
252558
|
}).superRefine((value, ctx) => {
|
|
252304
252559
|
if (value.plan.filter((item) => item.status === "in_progress").length > 1) {
|
|
252305
252560
|
ctx.addIssue({
|
|
252306
|
-
code:
|
|
252561
|
+
code: z17.ZodIssueCode.custom,
|
|
252307
252562
|
path: ["plan"],
|
|
252308
252563
|
message: "At most one plan item may be in progress."
|
|
252309
252564
|
});
|
|
@@ -252311,7 +252566,7 @@ var UpdatePlanInputSchema = z16.object({
|
|
|
252311
252566
|
const normalizedSteps = value.plan.map((item) => item.step.toLowerCase());
|
|
252312
252567
|
if (new Set(normalizedSteps).size !== normalizedSteps.length) {
|
|
252313
252568
|
ctx.addIssue({
|
|
252314
|
-
code:
|
|
252569
|
+
code: z17.ZodIssueCode.custom,
|
|
252315
252570
|
path: ["plan"],
|
|
252316
252571
|
message: "Plan steps must be unique."
|
|
252317
252572
|
});
|
|
@@ -252392,13 +252647,13 @@ var OCR_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
|
252392
252647
|
".tiff",
|
|
252393
252648
|
".bmp"
|
|
252394
252649
|
]);
|
|
252395
|
-
var DocumentInspectorInputSchema =
|
|
252396
|
-
path:
|
|
252397
|
-
maxChars:
|
|
252650
|
+
var DocumentInspectorInputSchema = z18.object({
|
|
252651
|
+
path: z18.string().trim().min(1).max(4096),
|
|
252652
|
+
maxChars: z18.number().int().min(1e3).max(MAX_DOCUMENT_CHARS).optional(),
|
|
252398
252653
|
/** OCR is explicit because it may send private pixels to a local binary. */
|
|
252399
|
-
ocr:
|
|
252400
|
-
ocrLanguage:
|
|
252401
|
-
ocrMaxPages:
|
|
252654
|
+
ocr: z18.boolean().optional(),
|
|
252655
|
+
ocrLanguage: z18.string().trim().regex(/^[A-Za-z0-9_-]{1,32}$/).optional(),
|
|
252656
|
+
ocrMaxPages: z18.number().int().min(1).max(20).optional()
|
|
252402
252657
|
}).strict();
|
|
252403
252658
|
var DocumentInspectorTool = class {
|
|
252404
252659
|
name = "inspect_document";
|
|
@@ -252694,10 +252949,10 @@ function sanitizedDocumentEnvironment() {
|
|
|
252694
252949
|
var MAX_AUDIO_BYTES = 64 * 1024 * 1024;
|
|
252695
252950
|
var MAX_TRANSCRIPT_CHARS = 16e4;
|
|
252696
252951
|
var TRANSCRIPTION_TIMEOUT_MS = 10 * 6e4;
|
|
252697
|
-
var AudioTranscriptionInputSchema =
|
|
252698
|
-
path:
|
|
252699
|
-
language:
|
|
252700
|
-
maxChars:
|
|
252952
|
+
var AudioTranscriptionInputSchema = z19.object({
|
|
252953
|
+
path: z19.string().trim().min(1).max(4096),
|
|
252954
|
+
language: z19.string().trim().regex(/^[A-Za-z0-9_-]{1,32}$/).optional(),
|
|
252955
|
+
maxChars: z19.number().int().min(1e3).max(MAX_TRANSCRIPT_CHARS).optional()
|
|
252701
252956
|
}).strict();
|
|
252702
252957
|
var AudioTranscriptionTool = class {
|
|
252703
252958
|
name = "transcribe_audio";
|
|
@@ -252850,8 +253105,8 @@ function sanitizedEnvironment() {
|
|
|
252850
253105
|
}
|
|
252851
253106
|
var MAX_SCREENSHOT_BYTES = 8 * 1024 * 1024;
|
|
252852
253107
|
var SCREENSHOT_TIMEOUT_MS = 3e4;
|
|
252853
|
-
var ScreenshotCaptureInputSchema =
|
|
252854
|
-
display:
|
|
253108
|
+
var ScreenshotCaptureInputSchema = z20.object({
|
|
253109
|
+
display: z20.string().trim().min(1).max(128).optional()
|
|
252855
253110
|
});
|
|
252856
253111
|
var ScreenshotCaptureTool = class {
|
|
252857
253112
|
name = "capture_screenshot";
|
|
@@ -253029,12 +253284,12 @@ function sanitizedEnvironment2(source) {
|
|
|
253029
253284
|
var MAX_AUDIO_BYTES2 = 64 * 1024 * 1024;
|
|
253030
253285
|
var MAX_DURATION_SECONDS = 120;
|
|
253031
253286
|
var CAPTURE_TIMEOUT_MS = 15e4;
|
|
253032
|
-
var AudioCaptureInputSchema =
|
|
253033
|
-
durationSeconds:
|
|
253034
|
-
format:
|
|
253287
|
+
var AudioCaptureInputSchema = z21.object({
|
|
253288
|
+
durationSeconds: z21.number().finite().min(1).max(MAX_DURATION_SECONDS),
|
|
253289
|
+
format: z21.enum(["wav", "flac", "mp3"]).default("wav"),
|
|
253035
253290
|
/** Required on Windows unless ORBIT_AUDIO_DEVICE is configured. */
|
|
253036
|
-
device:
|
|
253037
|
-
outputPath:
|
|
253291
|
+
device: z21.string().trim().min(1).max(256).optional(),
|
|
253292
|
+
outputPath: z21.string().trim().min(1).max(4096).optional()
|
|
253038
253293
|
}).strict();
|
|
253039
253294
|
var AudioCaptureTool = class {
|
|
253040
253295
|
name = "capture_audio";
|
|
@@ -253228,18 +253483,18 @@ function sanitizedAudioEnvironment(source) {
|
|
|
253228
253483
|
var MAX_TREE_BYTES = 512 * 1024;
|
|
253229
253484
|
var MAX_NODES = 2e3;
|
|
253230
253485
|
var ACCESSIBILITY_TIMEOUT_MS = 3e4;
|
|
253231
|
-
var AccessibilityTreeInputSchema =
|
|
253232
|
-
windowTitle:
|
|
253233
|
-
maxNodes:
|
|
253486
|
+
var AccessibilityTreeInputSchema = z222.object({
|
|
253487
|
+
windowTitle: z222.string().trim().min(1).max(256).optional(),
|
|
253488
|
+
maxNodes: z222.number().int().min(1).max(MAX_NODES).optional()
|
|
253234
253489
|
});
|
|
253235
|
-
var AccessibilityNodeSchema =
|
|
253236
|
-
() =>
|
|
253237
|
-
role:
|
|
253238
|
-
name:
|
|
253239
|
-
value:
|
|
253240
|
-
enabled:
|
|
253241
|
-
focused:
|
|
253242
|
-
children:
|
|
253490
|
+
var AccessibilityNodeSchema = z222.lazy(
|
|
253491
|
+
() => z222.object({
|
|
253492
|
+
role: z222.string().max(128),
|
|
253493
|
+
name: z222.string().max(1e3),
|
|
253494
|
+
value: z222.string().max(1e3).optional(),
|
|
253495
|
+
enabled: z222.boolean().optional(),
|
|
253496
|
+
focused: z222.boolean().optional(),
|
|
253497
|
+
children: z222.array(AccessibilityNodeSchema).max(MAX_NODES).default([])
|
|
253243
253498
|
}).strict()
|
|
253244
253499
|
);
|
|
253245
253500
|
var AccessibilityTreeTool = class {
|
|
@@ -253511,10 +253766,10 @@ function resolveCommandShellInvocation(command, options = {}) {
|
|
|
253511
253766
|
dialect: "cmd"
|
|
253512
253767
|
};
|
|
253513
253768
|
}
|
|
253514
|
-
var BashInputSchema =
|
|
253515
|
-
command:
|
|
253516
|
-
timeoutMs:
|
|
253517
|
-
background:
|
|
253769
|
+
var BashInputSchema = z232.object({
|
|
253770
|
+
command: z232.string().min(1).max(1e5),
|
|
253771
|
+
timeoutMs: z232.number().int().positive().optional(),
|
|
253772
|
+
background: z232.boolean().optional()
|
|
253518
253773
|
});
|
|
253519
253774
|
var BashTool = class {
|
|
253520
253775
|
name = "bash";
|
|
@@ -253539,11 +253794,7 @@ var BashTool = class {
|
|
|
253539
253794
|
cwd: ctx.cwd,
|
|
253540
253795
|
sessionId: ctx.sessionId,
|
|
253541
253796
|
environment: buildToolChildEnvironment(ctx),
|
|
253542
|
-
sandbox:
|
|
253543
|
-
mode: ctx.config?.tools.bash.sandbox ?? "auto",
|
|
253544
|
-
network: ctx.config?.tools.bash.network ?? "inherit",
|
|
253545
|
-
trustRoots: ctx.config?.security.windowsSandboxTrustRoots
|
|
253546
|
-
},
|
|
253797
|
+
sandbox: buildToolProcessSandboxPolicy(ctx),
|
|
253547
253798
|
...input.timeoutMs !== void 0 ? { timeoutMs: timeout } : {}
|
|
253548
253799
|
});
|
|
253549
253800
|
return {
|
|
@@ -253572,10 +253823,8 @@ var BashTool = class {
|
|
|
253572
253823
|
const invocation = resolveCommandShellInvocation(input.command);
|
|
253573
253824
|
const sandboxed = sandboxInvocation(invocation, {
|
|
253574
253825
|
cwd: ctx.cwd,
|
|
253575
|
-
|
|
253576
|
-
|
|
253577
|
-
environment: buildToolChildEnvironment(ctx),
|
|
253578
|
-
trustRoots: ctx.config?.security.windowsSandboxTrustRoots
|
|
253826
|
+
...buildToolProcessSandboxPolicy(ctx),
|
|
253827
|
+
environment: buildToolChildEnvironment(ctx)
|
|
253579
253828
|
});
|
|
253580
253829
|
const result = await execa(sandboxed.file, sandboxed.args, {
|
|
253581
253830
|
...HIDDEN_CHILD_PROCESS_OPTIONS,
|
|
@@ -253651,8 +253900,8 @@ ${displayStderr}` : "",
|
|
|
253651
253900
|
}
|
|
253652
253901
|
}
|
|
253653
253902
|
};
|
|
253654
|
-
var RunTestsInputSchema =
|
|
253655
|
-
command:
|
|
253903
|
+
var RunTestsInputSchema = z242.object({
|
|
253904
|
+
command: z242.string().trim().min(1).max(1e5).optional()
|
|
253656
253905
|
});
|
|
253657
253906
|
var ORBIT_TERMINAL_SUCCESS_MARKER = "[ORBIT_TERMINAL_SUCCESS]";
|
|
253658
253907
|
function classifyVerificationCommand(command) {
|
|
@@ -253747,10 +253996,8 @@ var RunTestsTool = class {
|
|
|
253747
253996
|
const invocation = resolveCommandShellInvocation(testCommand);
|
|
253748
253997
|
const sandboxed = sandboxInvocation(invocation, {
|
|
253749
253998
|
cwd: ctx.cwd,
|
|
253750
|
-
|
|
253751
|
-
|
|
253752
|
-
environment: buildToolChildEnvironment(ctx),
|
|
253753
|
-
trustRoots: ctx.config?.security.windowsSandboxTrustRoots
|
|
253999
|
+
...buildToolProcessSandboxPolicy(ctx),
|
|
254000
|
+
environment: buildToolChildEnvironment(ctx)
|
|
253754
254001
|
});
|
|
253755
254002
|
const result = await execa(sandboxed.file, sandboxed.args, {
|
|
253756
254003
|
...HIDDEN_CHILD_PROCESS_OPTIONS,
|
|
@@ -253868,12 +254115,12 @@ Exit code: ${exitCode}`,
|
|
|
253868
254115
|
}
|
|
253869
254116
|
};
|
|
253870
254117
|
var MAX_RESOLVED_ADDRESSES = 64;
|
|
253871
|
-
var DnsJsonResponseSchema =
|
|
253872
|
-
Status:
|
|
253873
|
-
Answer:
|
|
253874
|
-
|
|
253875
|
-
type:
|
|
253876
|
-
data:
|
|
254118
|
+
var DnsJsonResponseSchema = z252.object({
|
|
254119
|
+
Status: z252.number(),
|
|
254120
|
+
Answer: z252.array(
|
|
254121
|
+
z252.object({
|
|
254122
|
+
type: z252.number(),
|
|
254123
|
+
data: z252.string().max(1024)
|
|
253877
254124
|
})
|
|
253878
254125
|
).max(1e3).optional()
|
|
253879
254126
|
});
|
|
@@ -254078,11 +254325,11 @@ function createPinnedLookup(expectedHostname, addresses) {
|
|
|
254078
254325
|
}
|
|
254079
254326
|
var WEB_FETCH_MAX_BYTES = 1024 * 1024;
|
|
254080
254327
|
var WEB_FETCH_MAX_REDIRECTS = 5;
|
|
254081
|
-
var WebFetchInputSchema =
|
|
254082
|
-
url:
|
|
254328
|
+
var WebFetchInputSchema = z26.object({
|
|
254329
|
+
url: z26.string().url().max(8192).describe(
|
|
254083
254330
|
"HTTP(S) URL to read. Local and private targets require unrestricted Full Access."
|
|
254084
254331
|
),
|
|
254085
|
-
maxChars:
|
|
254332
|
+
maxChars: z26.number().int().min(1e3).max(5e4).describe("Maximum readable characters to return.").optional()
|
|
254086
254333
|
});
|
|
254087
254334
|
var WebFetchTool = class {
|
|
254088
254335
|
constructor(fetchImplementation = globalThis.fetch, resolveAddresses = resolveSystemAddresses, resolvePublicAddresses = createPublicDnsResolver(
|
|
@@ -254259,46 +254506,46 @@ function htmlToReadableText(html) {
|
|
|
254259
254506
|
}
|
|
254260
254507
|
var SEARCH_JSON_RESPONSE_MAX_BYTES = 1024 * 1024;
|
|
254261
254508
|
var SEARCH_PAGE_RESPONSE_MAX_BYTES = 4 * 1024 * 1024;
|
|
254262
|
-
var WebSearchInputSchema =
|
|
254263
|
-
query:
|
|
254509
|
+
var WebSearchInputSchema = z27.object({
|
|
254510
|
+
query: z27.string().trim().min(1).max(2048).describe(
|
|
254264
254511
|
"Search query. Resolve relative dates using the Runtime Context current date before adding date terms; do not add stale years from model memory."
|
|
254265
254512
|
),
|
|
254266
|
-
maxResults:
|
|
254513
|
+
maxResults: z27.number().int().min(1).max(20).describe("Maximum number of search results to return, from 1 to 20.").optional()
|
|
254267
254514
|
});
|
|
254268
|
-
var SearchApiEnvelopeSchema =
|
|
254269
|
-
results:
|
|
254515
|
+
var SearchApiEnvelopeSchema = z27.object({
|
|
254516
|
+
results: z27.array(z27.unknown()).max(1e3).catch([])
|
|
254270
254517
|
});
|
|
254271
|
-
var SearxngResultSchema =
|
|
254272
|
-
title:
|
|
254273
|
-
url:
|
|
254274
|
-
link:
|
|
254275
|
-
content:
|
|
254276
|
-
snippet:
|
|
254518
|
+
var SearxngResultSchema = z27.object({
|
|
254519
|
+
title: z27.string(),
|
|
254520
|
+
url: z27.string().optional(),
|
|
254521
|
+
link: z27.string().optional(),
|
|
254522
|
+
content: z27.string().optional(),
|
|
254523
|
+
snippet: z27.string().optional()
|
|
254277
254524
|
});
|
|
254278
|
-
var TavilyResultSchema =
|
|
254279
|
-
title:
|
|
254280
|
-
url:
|
|
254281
|
-
content:
|
|
254282
|
-
snippet:
|
|
254525
|
+
var TavilyResultSchema = z27.object({
|
|
254526
|
+
title: z27.string(),
|
|
254527
|
+
url: z27.string(),
|
|
254528
|
+
content: z27.string().optional(),
|
|
254529
|
+
snippet: z27.string().optional()
|
|
254283
254530
|
});
|
|
254284
|
-
var WeatherScalarSchema =
|
|
254285
|
-
var OpenMeteoLocationSchema =
|
|
254286
|
-
name:
|
|
254287
|
-
country:
|
|
254288
|
-
admin1:
|
|
254289
|
-
latitude:
|
|
254290
|
-
longitude:
|
|
254291
|
-
timezone:
|
|
254531
|
+
var WeatherScalarSchema = z27.union([z27.string(), z27.number(), z27.null()]);
|
|
254532
|
+
var OpenMeteoLocationSchema = z27.object({
|
|
254533
|
+
name: z27.string().optional(),
|
|
254534
|
+
country: z27.string().optional(),
|
|
254535
|
+
admin1: z27.string().optional(),
|
|
254536
|
+
latitude: z27.number().optional(),
|
|
254537
|
+
longitude: z27.number().optional(),
|
|
254538
|
+
timezone: z27.string().optional()
|
|
254292
254539
|
});
|
|
254293
|
-
var OpenMeteoGeocodingResponseSchema =
|
|
254294
|
-
results:
|
|
254540
|
+
var OpenMeteoGeocodingResponseSchema = z27.object({
|
|
254541
|
+
results: z27.array(OpenMeteoLocationSchema).max(1e3).optional()
|
|
254295
254542
|
});
|
|
254296
|
-
var OpenMeteoForecastResponseSchema =
|
|
254297
|
-
current:
|
|
254298
|
-
current_units:
|
|
254299
|
-
daily:
|
|
254300
|
-
daily_units:
|
|
254301
|
-
timezone:
|
|
254543
|
+
var OpenMeteoForecastResponseSchema = z27.object({
|
|
254544
|
+
current: z27.record(WeatherScalarSchema).optional(),
|
|
254545
|
+
current_units: z27.record(z27.string()).optional(),
|
|
254546
|
+
daily: z27.record(z27.array(WeatherScalarSchema).max(1e3)).optional(),
|
|
254547
|
+
daily_units: z27.record(z27.string()).optional(),
|
|
254548
|
+
timezone: z27.string().optional()
|
|
254302
254549
|
});
|
|
254303
254550
|
var WebSearchTool = class {
|
|
254304
254551
|
name = "web_search";
|
|
@@ -255141,16 +255388,16 @@ Diagnostics:
|
|
|
255141
255388
|
};
|
|
255142
255389
|
}
|
|
255143
255390
|
};
|
|
255144
|
-
var TaskIdSchema =
|
|
255145
|
-
var GetBackgroundTaskOutputInputSchema =
|
|
255146
|
-
taskIds:
|
|
255147
|
-
waitMs:
|
|
255148
|
-
waitFor:
|
|
255391
|
+
var TaskIdSchema = z28.string().regex(/^bg_[a-f0-9]{16}$/);
|
|
255392
|
+
var GetBackgroundTaskOutputInputSchema = z28.object({
|
|
255393
|
+
taskIds: z28.array(TaskIdSchema).min(1).max(20),
|
|
255394
|
+
waitMs: z28.number().int().min(0).transform((value) => Math.min(value, 3e4)).optional(),
|
|
255395
|
+
waitFor: z28.enum(["any", "all"]).optional()
|
|
255149
255396
|
});
|
|
255150
|
-
var KillBackgroundTaskInputSchema =
|
|
255397
|
+
var KillBackgroundTaskInputSchema = z28.object({
|
|
255151
255398
|
taskId: TaskIdSchema
|
|
255152
255399
|
});
|
|
255153
|
-
var ListBackgroundTasksInputSchema =
|
|
255400
|
+
var ListBackgroundTasksInputSchema = z28.object({}).strict();
|
|
255154
255401
|
var GetBackgroundTaskOutputTool = class {
|
|
255155
255402
|
name = "get_background_task_output";
|
|
255156
255403
|
description = "Get bounded output and status for one or more background tasks. Set waitMs to wait briefly for any or all tasks without polling or sleeping; values above 30000 are safely capped to 30000.";
|
|
@@ -255712,12 +255959,12 @@ var MAX_INPUT_BYTES = 2 * 1024 * 1024;
|
|
|
255712
255959
|
var MAX_STDERR_BYTES = 16 * 1024;
|
|
255713
255960
|
var TERMINATION_GRACE_MS = 750;
|
|
255714
255961
|
var HARD_TERMINATION_LIMIT_MS = 5e3;
|
|
255715
|
-
var ExtensionToolResultSchema =
|
|
255716
|
-
protocol:
|
|
255717
|
-
ok:
|
|
255718
|
-
data:
|
|
255719
|
-
display:
|
|
255720
|
-
error:
|
|
255962
|
+
var ExtensionToolResultSchema = z29.object({
|
|
255963
|
+
protocol: z29.literal("orbit-extension-tool-result-v1"),
|
|
255964
|
+
ok: z29.boolean(),
|
|
255965
|
+
data: z29.unknown().optional(),
|
|
255966
|
+
display: z29.string().max(1024 * 1024).optional(),
|
|
255967
|
+
error: z29.string().max(2e4).optional()
|
|
255721
255968
|
}).strict();
|
|
255722
255969
|
var ExtensionProcessTool = class {
|
|
255723
255970
|
constructor(contribution) {
|
|
@@ -256024,7 +256271,7 @@ var defaultToolRegistry = registerDefaultTools(toolRegistry);
|
|
|
256024
256271
|
// ../context-engine/dist/index.js
|
|
256025
256272
|
import { existsSync as existsSync10 } from "fs";
|
|
256026
256273
|
import { pathToFileURL } from "url";
|
|
256027
|
-
import { z as
|
|
256274
|
+
import { z as z30 } from "zod";
|
|
256028
256275
|
import { basename as basename3, join as join8 } from "path";
|
|
256029
256276
|
import { existsSync as existsSync43, writeFileSync as writeFileSync5, mkdirSync as mkdirSync4, renameSync as renameSync4, rmSync as rmSync5 } from "fs";
|
|
256030
256277
|
import { promises as fsPromises3 } from "fs";
|
|
@@ -256113,10 +256360,10 @@ function getOrbitCachePath(cwd, fileName) {
|
|
|
256113
256360
|
const relativePath = branchName ? join8(".orbit", "branches", branchName, fileName) : join8(".orbit", fileName);
|
|
256114
256361
|
return resolveSafePath(cwd, relativePath);
|
|
256115
256362
|
}
|
|
256116
|
-
var ReferenceIndexSchema =
|
|
256117
|
-
files:
|
|
256363
|
+
var ReferenceIndexSchema = z30.object({
|
|
256364
|
+
files: z30.record(z30.unknown())
|
|
256118
256365
|
});
|
|
256119
|
-
var RequestedSymbolsSchema =
|
|
256366
|
+
var RequestedSymbolsSchema = z30.array(z30.string().trim().min(1).max(512));
|
|
256120
256367
|
var MAX_REFERENCE_FILE_BYTES = 2e6;
|
|
256121
256368
|
var MAX_REFERENCE_INDEX_BYTES = 256 * 1024 * 1024;
|
|
256122
256369
|
function normalizeLimit(value, fallback, maximum) {
|
|
@@ -259374,9 +259621,9 @@ async function mapWithConcurrency(values, concurrency, mapper) {
|
|
|
259374
259621
|
// ../core/dist/index.js
|
|
259375
259622
|
import { randomUUID as randomUUID7 } from "crypto";
|
|
259376
259623
|
import { EventEmitter } from "events";
|
|
259377
|
-
import { z as
|
|
259624
|
+
import { z as z310 } from "zod";
|
|
259378
259625
|
import { z as z83 } from "zod";
|
|
259379
|
-
import
|
|
259626
|
+
import picocolors22 from "picocolors";
|
|
259380
259627
|
import path7 from "path";
|
|
259381
259628
|
import { pathToFileURL as pathToFileURL2 } from "url";
|
|
259382
259629
|
import fs32 from "fs";
|
|
@@ -259412,7 +259659,7 @@ import { spawn as spawn3 } from "child_process";
|
|
|
259412
259659
|
import { createHash as createHash8 } from "crypto";
|
|
259413
259660
|
var import_ajv = __toESM(require_ajv(), 1);
|
|
259414
259661
|
import { z as z36 } from "zod";
|
|
259415
|
-
import { z as
|
|
259662
|
+
import { z as z31 } from "zod";
|
|
259416
259663
|
import { Buffer as Buffer22 } from "buffer";
|
|
259417
259664
|
import { z as z211 } from "zod";
|
|
259418
259665
|
import { z as z45 } from "zod";
|
|
@@ -259442,14 +259689,14 @@ function createMcpInputSchema(jsonSchema, toolName) {
|
|
|
259442
259689
|
`MCP tool "${toolName}" has an invalid input schema: ${error instanceof Error ? error.message : String(error)}`
|
|
259443
259690
|
);
|
|
259444
259691
|
}
|
|
259445
|
-
return
|
|
259692
|
+
return z31.record(z31.unknown()).superRefine((value, context) => {
|
|
259446
259693
|
if (validate(value)) return;
|
|
259447
259694
|
for (const error of (validate.errors || []).slice(
|
|
259448
259695
|
0,
|
|
259449
259696
|
MAX_VALIDATION_ERRORS
|
|
259450
259697
|
)) {
|
|
259451
259698
|
context.addIssue({
|
|
259452
|
-
code:
|
|
259699
|
+
code: z31.ZodIssueCode.custom,
|
|
259453
259700
|
path: jsonPointerPath(error.instancePath),
|
|
259454
259701
|
message: formatValidationError(error)
|
|
259455
259702
|
});
|
|
@@ -262788,7 +263035,7 @@ function firstString(...values) {
|
|
|
262788
263035
|
}
|
|
262789
263036
|
|
|
262790
263037
|
// ../session/dist/index.js
|
|
262791
|
-
import { z as
|
|
263038
|
+
import { z as z37 } from "zod";
|
|
262792
263039
|
import { createHash as createHash9, randomUUID as randomUUID6 } from "crypto";
|
|
262793
263040
|
import { dirname as dirname8, isAbsolute as isAbsolute5, join as join9, relative as relative6, resolve as resolve7, sep } from "path";
|
|
262794
263041
|
import {
|
|
@@ -262816,7 +263063,7 @@ import {
|
|
|
262816
263063
|
} from "fs";
|
|
262817
263064
|
import { homedir as homedir6 } from "os";
|
|
262818
263065
|
import { basename as basename4, dirname as dirname25, isAbsolute as isAbsolute24, join as join25, parse as parse3, resolve as resolve26 } from "path";
|
|
262819
|
-
import { z as
|
|
263066
|
+
import { z as z38 } from "zod";
|
|
262820
263067
|
import {
|
|
262821
263068
|
closeSync as closeSync32,
|
|
262822
263069
|
existsSync as existsSync26,
|
|
@@ -262833,88 +263080,88 @@ import { createHash as createHash33 } from "crypto";
|
|
|
262833
263080
|
import { existsSync as existsSync36, lstatSync as lstatSync42, readdirSync as readdirSync32 } from "fs";
|
|
262834
263081
|
import { join as join44, relative as relative23, resolve as resolve44, sep as sep2 } from "path";
|
|
262835
263082
|
import { z as z64 } from "zod";
|
|
262836
|
-
var SafeObjectKeySchema =
|
|
263083
|
+
var SafeObjectKeySchema = z37.string().refine(
|
|
262837
263084
|
(key) => !["__proto__", "constructor", "prototype"].includes(key),
|
|
262838
263085
|
"Unsafe object key."
|
|
262839
263086
|
);
|
|
262840
|
-
var JsonValueSchema =
|
|
262841
|
-
() =>
|
|
262842
|
-
|
|
262843
|
-
|
|
262844
|
-
|
|
262845
|
-
|
|
262846
|
-
|
|
262847
|
-
|
|
263087
|
+
var JsonValueSchema = z37.lazy(
|
|
263088
|
+
() => z37.union([
|
|
263089
|
+
z37.string(),
|
|
263090
|
+
z37.number().finite(),
|
|
263091
|
+
z37.boolean(),
|
|
263092
|
+
z37.null(),
|
|
263093
|
+
z37.array(JsonValueSchema),
|
|
263094
|
+
z37.record(SafeObjectKeySchema, JsonValueSchema)
|
|
262848
263095
|
])
|
|
262849
263096
|
);
|
|
262850
|
-
var JsonTextSchema =
|
|
263097
|
+
var JsonTextSchema = z37.string().superRefine((value, context) => {
|
|
262851
263098
|
try {
|
|
262852
263099
|
const parsed = JSON.parse(value);
|
|
262853
263100
|
if (JsonValueSchema.safeParse(parsed).success) return;
|
|
262854
263101
|
} catch {
|
|
262855
263102
|
}
|
|
262856
263103
|
context.addIssue({
|
|
262857
|
-
code:
|
|
263104
|
+
code: z37.ZodIssueCode.custom,
|
|
262858
263105
|
message: "Expected valid, safe JSON text."
|
|
262859
263106
|
});
|
|
262860
263107
|
});
|
|
262861
|
-
var SessionIdSchema =
|
|
262862
|
-
var SessionSchema =
|
|
262863
|
-
schemaVersion:
|
|
263108
|
+
var SessionIdSchema = z37.string().regex(/^sess_[a-z]+-[a-z]+-\d{3}$/, "Invalid Orbit session id.");
|
|
263109
|
+
var SessionSchema = z37.object({
|
|
263110
|
+
schemaVersion: z37.literal(1).default(1),
|
|
262864
263111
|
id: SessionIdSchema,
|
|
262865
|
-
cwd:
|
|
262866
|
-
title:
|
|
262867
|
-
goal:
|
|
262868
|
-
status:
|
|
262869
|
-
createdAt:
|
|
262870
|
-
updatedAt:
|
|
262871
|
-
provider:
|
|
262872
|
-
model:
|
|
262873
|
-
totalInputTokens:
|
|
262874
|
-
totalOutputTokens:
|
|
262875
|
-
totalCostEstimate:
|
|
262876
|
-
costEstimateKnown:
|
|
262877
|
-
totalCacheReadTokens:
|
|
262878
|
-
archivedAt:
|
|
263112
|
+
cwd: z37.string().min(1),
|
|
263113
|
+
title: z37.string(),
|
|
263114
|
+
goal: z37.string().trim().min(1).max(4e3).optional(),
|
|
263115
|
+
status: z37.enum(["active", "completed", "failed", "aborted"]),
|
|
263116
|
+
createdAt: z37.string().datetime(),
|
|
263117
|
+
updatedAt: z37.string().datetime(),
|
|
263118
|
+
provider: z37.string().min(1),
|
|
263119
|
+
model: z37.string().min(1),
|
|
263120
|
+
totalInputTokens: z37.number().int().nonnegative(),
|
|
263121
|
+
totalOutputTokens: z37.number().int().nonnegative(),
|
|
263122
|
+
totalCostEstimate: z37.number().finite().nonnegative(),
|
|
263123
|
+
costEstimateKnown: z37.boolean().optional(),
|
|
263124
|
+
totalCacheReadTokens: z37.number().int().nonnegative().optional(),
|
|
263125
|
+
archivedAt: z37.string().datetime().optional()
|
|
262879
263126
|
});
|
|
262880
|
-
var SessionEventSchema =
|
|
262881
|
-
id:
|
|
263127
|
+
var SessionEventSchema = z37.object({
|
|
263128
|
+
id: z37.string().min(1),
|
|
262882
263129
|
sessionId: SessionIdSchema,
|
|
262883
|
-
type:
|
|
263130
|
+
type: z37.string().min(1),
|
|
262884
263131
|
payload: JsonValueSchema,
|
|
262885
|
-
createdAt:
|
|
263132
|
+
createdAt: z37.string().datetime()
|
|
262886
263133
|
});
|
|
262887
|
-
var TaskPlanItemSchema =
|
|
262888
|
-
id:
|
|
262889
|
-
text:
|
|
262890
|
-
status:
|
|
262891
|
-
createdAt:
|
|
262892
|
-
updatedAt:
|
|
263134
|
+
var TaskPlanItemSchema = z37.object({
|
|
263135
|
+
id: z37.string().regex(/^step_[a-z0-9-]+$/, "Invalid task-plan item id."),
|
|
263136
|
+
text: z37.string().trim().min(1).max(1e3),
|
|
263137
|
+
status: z37.enum(["pending", "in_progress", "completed"]),
|
|
263138
|
+
createdAt: z37.string().datetime(),
|
|
263139
|
+
updatedAt: z37.string().datetime()
|
|
262893
263140
|
});
|
|
262894
|
-
var TaskPlanSchema =
|
|
262895
|
-
schemaVersion:
|
|
263141
|
+
var TaskPlanSchema = z37.object({
|
|
263142
|
+
schemaVersion: z37.literal(1).default(1),
|
|
262896
263143
|
sessionId: SessionIdSchema,
|
|
262897
|
-
goal:
|
|
262898
|
-
items:
|
|
262899
|
-
updatedAt:
|
|
263144
|
+
goal: z37.string().trim().min(1).max(4e3).optional(),
|
|
263145
|
+
items: z37.array(TaskPlanItemSchema).max(100),
|
|
263146
|
+
updatedAt: z37.string().datetime()
|
|
262900
263147
|
});
|
|
262901
|
-
var QueuedAgentInputSchema =
|
|
262902
|
-
id:
|
|
263148
|
+
var QueuedAgentInputSchema = z37.object({
|
|
263149
|
+
id: z37.string().regex(/^input_[a-zA-Z0-9_-]+$/, "Invalid queued-input id."),
|
|
262903
263150
|
sessionId: SessionIdSchema,
|
|
262904
|
-
mode:
|
|
262905
|
-
source:
|
|
262906
|
-
text:
|
|
262907
|
-
attachments:
|
|
262908
|
-
|
|
262909
|
-
type:
|
|
262910
|
-
mediaType:
|
|
263151
|
+
mode: z37.enum(["follow_up", "steer"]),
|
|
263152
|
+
source: z37.enum(["terminal", "web", "api"]),
|
|
263153
|
+
text: z37.string().trim().min(1).max(1e5),
|
|
263154
|
+
attachments: z37.array(
|
|
263155
|
+
z37.object({
|
|
263156
|
+
type: z37.literal("image"),
|
|
263157
|
+
mediaType: z37.enum([
|
|
262911
263158
|
"image/png",
|
|
262912
263159
|
"image/jpeg",
|
|
262913
263160
|
"image/gif",
|
|
262914
263161
|
"image/webp"
|
|
262915
263162
|
]),
|
|
262916
|
-
data:
|
|
262917
|
-
name:
|
|
263163
|
+
data: z37.string().max(8e6),
|
|
263164
|
+
name: z37.string().max(255).optional()
|
|
262918
263165
|
})
|
|
262919
263166
|
).max(4).superRefine((attachments, context) => {
|
|
262920
263167
|
const encodedBytes = attachments.reduce(
|
|
@@ -262923,18 +263170,18 @@ var QueuedAgentInputSchema = z31.object({
|
|
|
262923
263170
|
);
|
|
262924
263171
|
if (encodedBytes > 3e7) {
|
|
262925
263172
|
context.addIssue({
|
|
262926
|
-
code:
|
|
263173
|
+
code: z37.ZodIssueCode.custom,
|
|
262927
263174
|
message: "Queued image attachments exceed the 30 MB encoded limit."
|
|
262928
263175
|
});
|
|
262929
263176
|
}
|
|
262930
263177
|
}).default([]),
|
|
262931
|
-
createdAt:
|
|
263178
|
+
createdAt: z37.string().datetime()
|
|
262932
263179
|
});
|
|
262933
|
-
var AgentInputQueueSchema =
|
|
262934
|
-
schemaVersion:
|
|
263180
|
+
var AgentInputQueueSchema = z37.object({
|
|
263181
|
+
schemaVersion: z37.literal(1).default(1),
|
|
262935
263182
|
sessionId: SessionIdSchema,
|
|
262936
|
-
items:
|
|
262937
|
-
updatedAt:
|
|
263183
|
+
items: z37.array(QueuedAgentInputSchema).max(12),
|
|
263184
|
+
updatedAt: z37.string().datetime()
|
|
262938
263185
|
}).superRefine((queue, context) => {
|
|
262939
263186
|
const encodedBytes = queue.items.reduce(
|
|
262940
263187
|
(total, item) => total + item.text.length + item.attachments.reduce(
|
|
@@ -262945,29 +263192,29 @@ var AgentInputQueueSchema = z31.object({
|
|
|
262945
263192
|
);
|
|
262946
263193
|
if (encodedBytes > 64e6) {
|
|
262947
263194
|
context.addIssue({
|
|
262948
|
-
code:
|
|
263195
|
+
code: z37.ZodIssueCode.custom,
|
|
262949
263196
|
message: "The queued-input snapshot exceeds the 64 MB limit."
|
|
262950
263197
|
});
|
|
262951
263198
|
}
|
|
262952
263199
|
});
|
|
262953
|
-
var SessionMetricsSchema =
|
|
263200
|
+
var SessionMetricsSchema = z37.object({
|
|
262954
263201
|
sessionId: SessionIdSchema,
|
|
262955
|
-
eventCount:
|
|
262956
|
-
toolRuns:
|
|
262957
|
-
toolFailures:
|
|
262958
|
-
deniedTools:
|
|
262959
|
-
filesChanged:
|
|
262960
|
-
modelSwitches:
|
|
262961
|
-
routingDecisions:
|
|
262962
|
-
fastRoutes:
|
|
262963
|
-
qualityRoutes:
|
|
262964
|
-
compactions:
|
|
262965
|
-
resumedCount:
|
|
263202
|
+
eventCount: z37.number().int().nonnegative(),
|
|
263203
|
+
toolRuns: z37.number().int().nonnegative(),
|
|
263204
|
+
toolFailures: z37.number().int().nonnegative(),
|
|
263205
|
+
deniedTools: z37.number().int().nonnegative(),
|
|
263206
|
+
filesChanged: z37.number().int().nonnegative(),
|
|
263207
|
+
modelSwitches: z37.number().int().nonnegative(),
|
|
263208
|
+
routingDecisions: z37.number().int().nonnegative(),
|
|
263209
|
+
fastRoutes: z37.number().int().nonnegative(),
|
|
263210
|
+
qualityRoutes: z37.number().int().nonnegative(),
|
|
263211
|
+
compactions: z37.number().int().nonnegative(),
|
|
263212
|
+
resumedCount: z37.number().int().nonnegative()
|
|
262966
263213
|
});
|
|
262967
|
-
var RunJournalSchema =
|
|
262968
|
-
schemaVersion:
|
|
263214
|
+
var RunJournalSchema = z37.object({
|
|
263215
|
+
schemaVersion: z37.literal(1).default(1),
|
|
262969
263216
|
sessionId: SessionIdSchema,
|
|
262970
|
-
state:
|
|
263217
|
+
state: z37.enum([
|
|
262971
263218
|
"running",
|
|
262972
263219
|
"awaiting_approval",
|
|
262973
263220
|
"verifying",
|
|
@@ -262976,99 +263223,99 @@ var RunJournalSchema = z31.object({
|
|
|
262976
263223
|
"aborted",
|
|
262977
263224
|
"interrupted"
|
|
262978
263225
|
]),
|
|
262979
|
-
phase:
|
|
262980
|
-
attempt:
|
|
262981
|
-
activeToolCallId:
|
|
262982
|
-
startedAt:
|
|
262983
|
-
updatedAt:
|
|
262984
|
-
recoveryCount:
|
|
263226
|
+
phase: z37.string().trim().min(1).max(200),
|
|
263227
|
+
attempt: z37.number().int().nonnegative().default(0),
|
|
263228
|
+
activeToolCallId: z37.string().min(1).max(512).optional(),
|
|
263229
|
+
startedAt: z37.string().datetime(),
|
|
263230
|
+
updatedAt: z37.string().datetime(),
|
|
263231
|
+
recoveryCount: z37.number().int().nonnegative().default(0)
|
|
262985
263232
|
});
|
|
262986
|
-
var SessionRecoveryReportSchema =
|
|
263233
|
+
var SessionRecoveryReportSchema = z37.object({
|
|
262987
263234
|
sessionId: SessionIdSchema,
|
|
262988
263235
|
previousState: RunJournalSchema.shape.state,
|
|
262989
|
-
previousPhase:
|
|
262990
|
-
attempt:
|
|
262991
|
-
recoveryCount:
|
|
262992
|
-
repairedToolCalls:
|
|
262993
|
-
resetPlanItems:
|
|
262994
|
-
recoveredAt:
|
|
263236
|
+
previousPhase: z37.string().trim().min(1).max(200),
|
|
263237
|
+
attempt: z37.number().int().nonnegative(),
|
|
263238
|
+
recoveryCount: z37.number().int().positive(),
|
|
263239
|
+
repairedToolCalls: z37.number().int().nonnegative(),
|
|
263240
|
+
resetPlanItems: z37.number().int().nonnegative(),
|
|
263241
|
+
recoveredAt: z37.string().datetime()
|
|
262995
263242
|
});
|
|
262996
|
-
var StoredToolCallSchema =
|
|
262997
|
-
id:
|
|
262998
|
-
name:
|
|
263243
|
+
var StoredToolCallSchema = z37.object({
|
|
263244
|
+
id: z37.string().min(1),
|
|
263245
|
+
name: z37.string().min(1),
|
|
262999
263246
|
arguments: JsonTextSchema
|
|
263000
263247
|
});
|
|
263001
|
-
var StoredToolResultSchema =
|
|
263002
|
-
toolCallId:
|
|
263003
|
-
name:
|
|
263004
|
-
content:
|
|
263005
|
-
isError:
|
|
263248
|
+
var StoredToolResultSchema = z37.object({
|
|
263249
|
+
toolCallId: z37.string().min(1),
|
|
263250
|
+
name: z37.string().min(1),
|
|
263251
|
+
content: z37.string(),
|
|
263252
|
+
isError: z37.boolean().optional()
|
|
263006
263253
|
});
|
|
263007
|
-
var StoredContentBlockSchema =
|
|
263008
|
-
|
|
263009
|
-
|
|
263010
|
-
type:
|
|
263011
|
-
mediaType:
|
|
263012
|
-
data:
|
|
263013
|
-
name:
|
|
263254
|
+
var StoredContentBlockSchema = z37.discriminatedUnion("type", [
|
|
263255
|
+
z37.object({ type: z37.literal("text"), text: z37.string() }),
|
|
263256
|
+
z37.object({
|
|
263257
|
+
type: z37.literal("image"),
|
|
263258
|
+
mediaType: z37.enum(["image/png", "image/jpeg", "image/gif", "image/webp"]),
|
|
263259
|
+
data: z37.string().max(8e6),
|
|
263260
|
+
name: z37.string().max(255).optional()
|
|
263014
263261
|
}),
|
|
263015
|
-
|
|
263016
|
-
|
|
263017
|
-
type:
|
|
263262
|
+
z37.object({ type: z37.literal("tool_call"), toolCall: StoredToolCallSchema }),
|
|
263263
|
+
z37.object({
|
|
263264
|
+
type: z37.literal("tool_result"),
|
|
263018
263265
|
toolResult: StoredToolResultSchema
|
|
263019
263266
|
}),
|
|
263020
|
-
|
|
263021
|
-
type:
|
|
263022
|
-
text:
|
|
263023
|
-
signature:
|
|
263267
|
+
z37.object({
|
|
263268
|
+
type: z37.literal("thinking"),
|
|
263269
|
+
text: z37.string(),
|
|
263270
|
+
signature: z37.string().optional()
|
|
263024
263271
|
})
|
|
263025
263272
|
]);
|
|
263026
|
-
var StoredHistoryMessageSchema =
|
|
263027
|
-
id:
|
|
263028
|
-
role:
|
|
263029
|
-
content:
|
|
263030
|
-
createdAt:
|
|
263031
|
-
metadata:
|
|
263273
|
+
var StoredHistoryMessageSchema = z37.object({
|
|
263274
|
+
id: z37.string().min(1),
|
|
263275
|
+
role: z37.enum(["system", "user", "assistant", "tool"]),
|
|
263276
|
+
content: z37.array(StoredContentBlockSchema).max(1e4),
|
|
263277
|
+
createdAt: z37.string().datetime(),
|
|
263278
|
+
metadata: z37.record(SafeObjectKeySchema, JsonValueSchema).optional()
|
|
263032
263279
|
});
|
|
263033
|
-
var StoredHistorySchema =
|
|
263034
|
-
var ToolCallRecordSchema =
|
|
263035
|
-
id:
|
|
263280
|
+
var StoredHistorySchema = z37.array(StoredHistoryMessageSchema).max(1e5);
|
|
263281
|
+
var ToolCallRecordSchema = z37.object({
|
|
263282
|
+
id: z37.string().min(1),
|
|
263036
263283
|
sessionId: SessionIdSchema,
|
|
263037
|
-
toolName:
|
|
263284
|
+
toolName: z37.string().min(1),
|
|
263038
263285
|
inputJson: JsonTextSchema,
|
|
263039
263286
|
outputJson: JsonTextSchema.optional(),
|
|
263040
|
-
risk:
|
|
263041
|
-
permissionDecision:
|
|
263042
|
-
status:
|
|
263043
|
-
startedAt:
|
|
263044
|
-
endedAt:
|
|
263287
|
+
risk: z37.string().min(1),
|
|
263288
|
+
permissionDecision: z37.string().min(1),
|
|
263289
|
+
status: z37.enum(["pending", "success", "failed", "denied"]),
|
|
263290
|
+
startedAt: z37.string().datetime(),
|
|
263291
|
+
endedAt: z37.string().datetime().optional()
|
|
263045
263292
|
});
|
|
263046
|
-
var FileChangeRecordSchema =
|
|
263047
|
-
id:
|
|
263293
|
+
var FileChangeRecordSchema = z37.object({
|
|
263294
|
+
id: z37.string().min(1),
|
|
263048
263295
|
sessionId: SessionIdSchema,
|
|
263049
|
-
path:
|
|
263050
|
-
beforeHash:
|
|
263051
|
-
afterHash:
|
|
263052
|
-
diff:
|
|
263053
|
-
createdAt:
|
|
263296
|
+
path: z37.string().min(1),
|
|
263297
|
+
beforeHash: z37.string().optional(),
|
|
263298
|
+
afterHash: z37.string().optional(),
|
|
263299
|
+
diff: z37.string(),
|
|
263300
|
+
createdAt: z37.string().datetime()
|
|
263054
263301
|
});
|
|
263055
|
-
var SessionTraceBundleSchema =
|
|
263056
|
-
schemaVersion:
|
|
263057
|
-
exportedAt:
|
|
263058
|
-
workspace:
|
|
263059
|
-
id:
|
|
263060
|
-
path:
|
|
263302
|
+
var SessionTraceBundleSchema = z37.object({
|
|
263303
|
+
schemaVersion: z37.literal(1),
|
|
263304
|
+
exportedAt: z37.string().datetime(),
|
|
263305
|
+
workspace: z37.object({
|
|
263306
|
+
id: z37.string().regex(/^[a-f0-9]{16}$/),
|
|
263307
|
+
path: z37.literal("<workspace>")
|
|
263061
263308
|
}),
|
|
263062
263309
|
session: SessionSchema.omit({ cwd: true }).extend({
|
|
263063
|
-
cwd:
|
|
263310
|
+
cwd: z37.literal("<workspace>")
|
|
263064
263311
|
}),
|
|
263065
263312
|
journal: RunJournalSchema.optional(),
|
|
263066
263313
|
plan: TaskPlanSchema.optional(),
|
|
263067
263314
|
metrics: SessionMetricsSchema,
|
|
263068
|
-
events:
|
|
263069
|
-
toolCalls:
|
|
263070
|
-
fileChanges:
|
|
263071
|
-
history:
|
|
263315
|
+
events: z37.array(SessionEventSchema).max(1e5),
|
|
263316
|
+
toolCalls: z37.array(ToolCallRecordSchema).max(1e5),
|
|
263317
|
+
fileChanges: z37.array(FileChangeRecordSchema).max(1e5),
|
|
263318
|
+
history: z37.array(JsonValueSchema).max(1e5).optional()
|
|
263072
263319
|
});
|
|
263073
263320
|
var SESSION_SNAPSHOT_MAX_BYTES = 256 * 1024 * 1024;
|
|
263074
263321
|
var CURRENT_SESSION_SNAPSHOT_VERSION = 1;
|
|
@@ -264275,21 +264522,21 @@ var PROJECT_REGISTRY_LOCK_RETRIES = 50;
|
|
|
264275
264522
|
var PROJECT_REGISTRY_LOCK_WAIT_MS = 10;
|
|
264276
264523
|
var PROJECT_REGISTRY_STALE_LOCK_MS = 1e4;
|
|
264277
264524
|
var PROJECT_REGISTRY_LOCK_WAIT = new Int32Array(new SharedArrayBuffer(4));
|
|
264278
|
-
var ProjectRecordSchema =
|
|
264279
|
-
id:
|
|
264280
|
-
path:
|
|
264281
|
-
name:
|
|
264282
|
-
createdAt:
|
|
264283
|
-
lastOpenedAt:
|
|
264284
|
-
lastSessionId:
|
|
264285
|
-
archivedAt:
|
|
264525
|
+
var ProjectRecordSchema = z38.object({
|
|
264526
|
+
id: z38.string().regex(/^proj_[a-f0-9]{16}$/),
|
|
264527
|
+
path: z38.string().min(1).max(4096).refine((value) => !/[\u0000-\u001f\u007f]/.test(value)),
|
|
264528
|
+
name: z38.string().trim().min(1).max(200),
|
|
264529
|
+
createdAt: z38.string().datetime(),
|
|
264530
|
+
lastOpenedAt: z38.string().datetime(),
|
|
264531
|
+
lastSessionId: z38.string().min(1).max(1e3).optional(),
|
|
264532
|
+
archivedAt: z38.string().datetime().optional()
|
|
264286
264533
|
});
|
|
264287
|
-
var ProjectRegistrySnapshotSchema =
|
|
264288
|
-
schemaVersion:
|
|
264289
|
-
projects:
|
|
264534
|
+
var ProjectRegistrySnapshotSchema = z38.object({
|
|
264535
|
+
schemaVersion: z38.literal(1),
|
|
264536
|
+
projects: z38.array(ProjectRecordSchema).max(MAX_PROJECTS)
|
|
264290
264537
|
});
|
|
264291
|
-
var LegacyProjectRegistrySnapshotSchema =
|
|
264292
|
-
projects:
|
|
264538
|
+
var LegacyProjectRegistrySnapshotSchema = z38.object({
|
|
264539
|
+
projects: z38.array(ProjectRecordSchema).max(MAX_PROJECTS)
|
|
264293
264540
|
});
|
|
264294
264541
|
var ProjectRegistryMigrations = new MigrationRegistry({
|
|
264295
264542
|
name: "Project registry",
|
|
@@ -265215,6 +265462,7 @@ import { randomUUID as randomUUID42 } from "crypto";
|
|
|
265215
265462
|
import path52 from "path";
|
|
265216
265463
|
import { z as z73 } from "zod";
|
|
265217
265464
|
import { randomUUID as randomUUID52 } from "crypto";
|
|
265465
|
+
import picocolors3 from "picocolors";
|
|
265218
265466
|
import { z as z103 } from "zod";
|
|
265219
265467
|
import { z as z93 } from "zod";
|
|
265220
265468
|
import { z as z113 } from "zod";
|
|
@@ -265223,6 +265471,8 @@ import { existsSync as existsSync37, statSync as statSync5 } from "fs";
|
|
|
265223
265471
|
import { z as z123 } from "zod";
|
|
265224
265472
|
import { z as z133 } from "zod";
|
|
265225
265473
|
import { z as z143 } from "zod";
|
|
265474
|
+
import { z as z152 } from "zod";
|
|
265475
|
+
import { z as z162 } from "zod";
|
|
265226
265476
|
function createInitialState(sessionId, task, maxAttempts = 8) {
|
|
265227
265477
|
return {
|
|
265228
265478
|
sessionId,
|
|
@@ -265409,23 +265659,23 @@ ${this.normalizeContextText(options.repoMapText)}` : "",
|
|
|
265409
265659
|
};
|
|
265410
265660
|
var PROMPT_CACHE_METADATA_MAX_BYTES = 256 * 1024;
|
|
265411
265661
|
var PROMPT_CACHE_MAX_FILES = 1e3;
|
|
265412
|
-
var PromptCacheTelemetrySampleSchema =
|
|
265413
|
-
recordedAt:
|
|
265414
|
-
inputTokens:
|
|
265415
|
-
hitTokens:
|
|
265416
|
-
missTokens:
|
|
265417
|
-
hitRate:
|
|
265418
|
-
degraded:
|
|
265662
|
+
var PromptCacheTelemetrySampleSchema = z39.object({
|
|
265663
|
+
recordedAt: z39.string().max(100),
|
|
265664
|
+
inputTokens: z39.number().int().nonnegative(),
|
|
265665
|
+
hitTokens: z39.number().int().nonnegative(),
|
|
265666
|
+
missTokens: z39.number().int().nonnegative(),
|
|
265667
|
+
hitRate: z39.number().min(0).max(1),
|
|
265668
|
+
degraded: z39.boolean()
|
|
265419
265669
|
});
|
|
265420
|
-
var PromptCacheSlabMetadataSchema =
|
|
265421
|
-
hash:
|
|
265422
|
-
provider:
|
|
265423
|
-
model:
|
|
265424
|
-
tokenEstimate:
|
|
265425
|
-
systemHash:
|
|
265426
|
-
toolSchemaHash:
|
|
265427
|
-
lastPrimedAt:
|
|
265428
|
-
telemetry:
|
|
265670
|
+
var PromptCacheSlabMetadataSchema = z39.object({
|
|
265671
|
+
hash: z39.string().max(128).optional(),
|
|
265672
|
+
provider: z39.string().max(1024).optional(),
|
|
265673
|
+
model: z39.string().max(1024).optional(),
|
|
265674
|
+
tokenEstimate: z39.number().int().nonnegative().optional(),
|
|
265675
|
+
systemHash: z39.string().max(128).optional(),
|
|
265676
|
+
toolSchemaHash: z39.string().max(128).optional(),
|
|
265677
|
+
lastPrimedAt: z39.string().max(100).optional(),
|
|
265678
|
+
telemetry: z39.array(PromptCacheTelemetrySampleSchema).max(100).optional()
|
|
265429
265679
|
}).passthrough();
|
|
265430
265680
|
function readPromptCacheSlabMetadata(path9) {
|
|
265431
265681
|
try {
|
|
@@ -266058,17 +266308,17 @@ var StepRunner = class {
|
|
|
266058
266308
|
}
|
|
266059
266309
|
async run(toolCall, abortSignal) {
|
|
266060
266310
|
if (abortSignal?.aborted) {
|
|
266061
|
-
return
|
|
266062
|
-
|
|
266063
|
-
|
|
266064
|
-
|
|
266311
|
+
return contractFailure(
|
|
266312
|
+
"cancelled",
|
|
266313
|
+
"Tool execution was cancelled before it started."
|
|
266314
|
+
);
|
|
266065
266315
|
}
|
|
266066
266316
|
const tool = this.registry.get(toolCall.name);
|
|
266067
266317
|
if (!tool) {
|
|
266068
|
-
return
|
|
266069
|
-
|
|
266070
|
-
|
|
266071
|
-
|
|
266318
|
+
return contractFailure(
|
|
266319
|
+
"unavailable",
|
|
266320
|
+
`Tool "${toolCall.name}" not found in registry.`
|
|
266321
|
+
);
|
|
266072
266322
|
}
|
|
266073
266323
|
let parsedArgs;
|
|
266074
266324
|
let validated;
|
|
@@ -266076,19 +266326,22 @@ var StepRunner = class {
|
|
|
266076
266326
|
parsedArgs = JSON.parse(toolCall.arguments);
|
|
266077
266327
|
validated = tool.inputSchema.safeParse(parsedArgs);
|
|
266078
266328
|
} catch (error) {
|
|
266079
|
-
return
|
|
266080
|
-
|
|
266081
|
-
|
|
266082
|
-
|
|
266329
|
+
return contractFailure(
|
|
266330
|
+
"invalid_input",
|
|
266331
|
+
`Tool input JSON parse failed: ${getErrorMessage(error)}`
|
|
266332
|
+
);
|
|
266083
266333
|
}
|
|
266084
266334
|
if (!validated.success) {
|
|
266085
|
-
return
|
|
266086
|
-
|
|
266087
|
-
|
|
266088
|
-
|
|
266335
|
+
return contractFailure(
|
|
266336
|
+
"invalid_input",
|
|
266337
|
+
`Tool input validation failed: ${validated.error.message}`
|
|
266338
|
+
);
|
|
266089
266339
|
}
|
|
266090
|
-
const
|
|
266091
|
-
|
|
266340
|
+
const timeoutMs = this.getExecutionTimeoutMs(
|
|
266341
|
+
toolCall.name,
|
|
266342
|
+
validated.data,
|
|
266343
|
+
resolveToolExecutionContract(tool).timeoutMs
|
|
266344
|
+
);
|
|
266092
266345
|
const executionController = new AbortController();
|
|
266093
266346
|
let cancellationCause;
|
|
266094
266347
|
let cancelExecution;
|
|
@@ -266123,35 +266376,42 @@ var StepRunner = class {
|
|
|
266123
266376
|
);
|
|
266124
266377
|
const settled = await Promise.race([execution, cancellation]);
|
|
266125
266378
|
if (settled.kind === "timeout" || cancellationCause === "timeout") {
|
|
266126
|
-
return
|
|
266127
|
-
|
|
266128
|
-
|
|
266129
|
-
|
|
266379
|
+
return contractFailure(
|
|
266380
|
+
"timeout",
|
|
266381
|
+
`Tool execution timed out after ${timeoutMs}ms. Cancellation was enforced at the Orbit boundary.`,
|
|
266382
|
+
true,
|
|
266383
|
+
{ timeoutMs }
|
|
266384
|
+
);
|
|
266130
266385
|
}
|
|
266131
266386
|
if (settled.kind === "user" || cancellationCause === "user") {
|
|
266132
|
-
return
|
|
266133
|
-
|
|
266134
|
-
|
|
266135
|
-
|
|
266387
|
+
return contractFailure(
|
|
266388
|
+
"cancelled",
|
|
266389
|
+
"Tool execution was cancelled by the user."
|
|
266390
|
+
);
|
|
266136
266391
|
}
|
|
266137
|
-
if (settled.kind === "result")
|
|
266138
|
-
|
|
266139
|
-
|
|
266140
|
-
|
|
266141
|
-
|
|
266392
|
+
if (settled.kind === "result") {
|
|
266393
|
+
return validateToolResult(tool, settled.result);
|
|
266394
|
+
}
|
|
266395
|
+
return contractFailure(
|
|
266396
|
+
"execution_error",
|
|
266397
|
+
`Tool execution threw exception: ${getErrorMessage(settled.error)}`
|
|
266398
|
+
);
|
|
266142
266399
|
} finally {
|
|
266143
266400
|
clearTimeout(timeoutId);
|
|
266144
266401
|
abortSignal?.removeEventListener("abort", onAbort);
|
|
266145
266402
|
}
|
|
266146
266403
|
}
|
|
266147
|
-
getExecutionTimeoutMs(validatedArgs) {
|
|
266404
|
+
getExecutionTimeoutMs(toolName, validatedArgs, declaredTimeoutMs) {
|
|
266148
266405
|
const configured = this.config?.tools?.bash?.timeoutMs;
|
|
266149
|
-
const
|
|
266150
|
-
const
|
|
266406
|
+
const isExecutionCommand = toolName === "bash" || toolName === "run_tests";
|
|
266407
|
+
const policyTimeout = isExecutionCommand && typeof configured === "number" && Number.isFinite(configured) ? Math.max(1e3, configured) : 12e4;
|
|
266408
|
+
const declaredTimeout = typeof declaredTimeoutMs === "number" && Number.isFinite(declaredTimeoutMs) ? Math.max(1e3, declaredTimeoutMs) : policyTimeout;
|
|
266409
|
+
const executionLimit = Math.min(policyTimeout, declaredTimeout);
|
|
266410
|
+
const requested = isExecutionCommand && typeof validatedArgs === "object" && validatedArgs !== null ? validatedArgs.timeoutMs : void 0;
|
|
266151
266411
|
if (typeof requested === "number" && Number.isFinite(requested)) {
|
|
266152
|
-
return Math.max(1e3, Math.min(requested,
|
|
266412
|
+
return Math.max(1e3, Math.min(requested, executionLimit));
|
|
266153
266413
|
}
|
|
266154
|
-
return
|
|
266414
|
+
return executionLimit;
|
|
266155
266415
|
}
|
|
266156
266416
|
};
|
|
266157
266417
|
function getErrorMessage(error) {
|
|
@@ -266271,340 +266531,340 @@ function cleanRuntimeLabel(value, fallback) {
|
|
|
266271
266531
|
return clean || fallback;
|
|
266272
266532
|
}
|
|
266273
266533
|
var ORBIT_EVENT_SCHEMA_VERSION = 1;
|
|
266274
|
-
var ModelRequestEventSchema =
|
|
266275
|
-
type:
|
|
266276
|
-
payload:
|
|
266277
|
-
model:
|
|
266278
|
-
messages:
|
|
266534
|
+
var ModelRequestEventSchema = z310.object({
|
|
266535
|
+
type: z310.literal("model_request"),
|
|
266536
|
+
payload: z310.object({
|
|
266537
|
+
model: z310.string(),
|
|
266538
|
+
messages: z310.array(z310.unknown())
|
|
266279
266539
|
})
|
|
266280
266540
|
});
|
|
266281
|
-
var ModelResponseEventSchema =
|
|
266282
|
-
type:
|
|
266283
|
-
payload:
|
|
266284
|
-
model:
|
|
266285
|
-
requestedModel:
|
|
266286
|
-
resolvedModel:
|
|
266287
|
-
providerRequestId:
|
|
266288
|
-
apiFormat:
|
|
266289
|
-
modelVersion:
|
|
266290
|
-
apiFormatFallback:
|
|
266291
|
-
from:
|
|
266292
|
-
status:
|
|
266541
|
+
var ModelResponseEventSchema = z310.object({
|
|
266542
|
+
type: z310.literal("model_response"),
|
|
266543
|
+
payload: z310.object({
|
|
266544
|
+
model: z310.string(),
|
|
266545
|
+
requestedModel: z310.string().optional(),
|
|
266546
|
+
resolvedModel: z310.string().optional(),
|
|
266547
|
+
providerRequestId: z310.string().optional(),
|
|
266548
|
+
apiFormat: z310.enum(["chat-completions", "responses", "anthropic"]).optional(),
|
|
266549
|
+
modelVersion: z310.string().optional(),
|
|
266550
|
+
apiFormatFallback: z310.object({
|
|
266551
|
+
from: z310.enum(["chat-completions", "responses", "anthropic"]),
|
|
266552
|
+
status: z310.number().int().min(100).max(599)
|
|
266293
266553
|
}).optional(),
|
|
266294
|
-
text:
|
|
266295
|
-
reasoning_content:
|
|
266296
|
-
usage:
|
|
266297
|
-
inputTokens:
|
|
266298
|
-
outputTokens:
|
|
266299
|
-
totalTokens:
|
|
266300
|
-
cacheReadTokens:
|
|
266301
|
-
cacheMissTokens:
|
|
266302
|
-
cacheWriteTokens:
|
|
266303
|
-
reasoningTokens:
|
|
266554
|
+
text: z310.string().optional(),
|
|
266555
|
+
reasoning_content: z310.string().optional(),
|
|
266556
|
+
usage: z310.object({
|
|
266557
|
+
inputTokens: z310.number(),
|
|
266558
|
+
outputTokens: z310.number(),
|
|
266559
|
+
totalTokens: z310.number().optional(),
|
|
266560
|
+
cacheReadTokens: z310.number().optional(),
|
|
266561
|
+
cacheMissTokens: z310.number().optional(),
|
|
266562
|
+
cacheWriteTokens: z310.number().optional(),
|
|
266563
|
+
reasoningTokens: z310.number().optional()
|
|
266304
266564
|
}).optional(),
|
|
266305
|
-
toolCalls:
|
|
266565
|
+
toolCalls: z310.array(z310.unknown()).optional()
|
|
266306
266566
|
})
|
|
266307
266567
|
});
|
|
266308
|
-
var AgentStartEventSchema =
|
|
266309
|
-
type:
|
|
266310
|
-
payload:
|
|
266311
|
-
taskId:
|
|
266312
|
-
task:
|
|
266568
|
+
var AgentStartEventSchema = z310.object({
|
|
266569
|
+
type: z310.literal("agent_start"),
|
|
266570
|
+
payload: z310.object({
|
|
266571
|
+
taskId: z310.string(),
|
|
266572
|
+
task: z310.string()
|
|
266313
266573
|
})
|
|
266314
266574
|
});
|
|
266315
|
-
var AgentSpawnEventSchema =
|
|
266316
|
-
type:
|
|
266317
|
-
payload:
|
|
266318
|
-
parentId:
|
|
266319
|
-
childId:
|
|
266320
|
-
role:
|
|
266321
|
-
task:
|
|
266575
|
+
var AgentSpawnEventSchema = z310.object({
|
|
266576
|
+
type: z310.literal("agent_spawn"),
|
|
266577
|
+
payload: z310.object({
|
|
266578
|
+
parentId: z310.string(),
|
|
266579
|
+
childId: z310.string(),
|
|
266580
|
+
role: z310.string(),
|
|
266581
|
+
task: z310.string()
|
|
266322
266582
|
})
|
|
266323
266583
|
});
|
|
266324
|
-
var AgentStatusEventSchema =
|
|
266325
|
-
type:
|
|
266326
|
-
payload:
|
|
266327
|
-
taskId:
|
|
266328
|
-
status:
|
|
266329
|
-
detail:
|
|
266584
|
+
var AgentStatusEventSchema = z310.object({
|
|
266585
|
+
type: z310.literal("agent_status"),
|
|
266586
|
+
payload: z310.object({
|
|
266587
|
+
taskId: z310.string(),
|
|
266588
|
+
status: z310.string(),
|
|
266589
|
+
detail: z310.string().optional()
|
|
266330
266590
|
})
|
|
266331
266591
|
});
|
|
266332
|
-
var AgentCompletedEventSchema =
|
|
266333
|
-
type:
|
|
266334
|
-
payload:
|
|
266335
|
-
taskId:
|
|
266336
|
-
success:
|
|
266337
|
-
status:
|
|
266338
|
-
result:
|
|
266339
|
-
error:
|
|
266592
|
+
var AgentCompletedEventSchema = z310.object({
|
|
266593
|
+
type: z310.literal("agent_completed"),
|
|
266594
|
+
payload: z310.object({
|
|
266595
|
+
taskId: z310.string(),
|
|
266596
|
+
success: z310.boolean(),
|
|
266597
|
+
status: z310.enum(["completed", "failed", "aborted"]).optional(),
|
|
266598
|
+
result: z310.unknown().optional(),
|
|
266599
|
+
error: z310.string().optional()
|
|
266340
266600
|
})
|
|
266341
266601
|
});
|
|
266342
|
-
var UiTurnStartedEventSchema =
|
|
266343
|
-
type:
|
|
266344
|
-
payload:
|
|
266345
|
-
turnId:
|
|
266346
|
-
source:
|
|
266347
|
-
prompt:
|
|
266602
|
+
var UiTurnStartedEventSchema = z310.object({
|
|
266603
|
+
type: z310.literal("ui_turn_started"),
|
|
266604
|
+
payload: z310.object({
|
|
266605
|
+
turnId: z310.string(),
|
|
266606
|
+
source: z310.enum(["terminal", "web"]),
|
|
266607
|
+
prompt: z310.string()
|
|
266348
266608
|
})
|
|
266349
266609
|
});
|
|
266350
|
-
var UiTurnCompletedEventSchema =
|
|
266351
|
-
type:
|
|
266352
|
-
payload:
|
|
266353
|
-
turnId:
|
|
266354
|
-
source:
|
|
266355
|
-
status:
|
|
266356
|
-
message:
|
|
266610
|
+
var UiTurnCompletedEventSchema = z310.object({
|
|
266611
|
+
type: z310.literal("ui_turn_completed"),
|
|
266612
|
+
payload: z310.object({
|
|
266613
|
+
turnId: z310.string(),
|
|
266614
|
+
source: z310.enum(["terminal", "web"]),
|
|
266615
|
+
status: z310.enum(["completed", "failed", "aborted"]),
|
|
266616
|
+
message: z310.string().optional()
|
|
266357
266617
|
})
|
|
266358
266618
|
});
|
|
266359
|
-
var AgentInputQueuePayloadSchema =
|
|
266360
|
-
inputId:
|
|
266361
|
-
sessionId:
|
|
266362
|
-
mode:
|
|
266363
|
-
source:
|
|
266364
|
-
remaining:
|
|
266619
|
+
var AgentInputQueuePayloadSchema = z310.object({
|
|
266620
|
+
inputId: z310.string(),
|
|
266621
|
+
sessionId: z310.string(),
|
|
266622
|
+
mode: z310.enum(["follow_up", "steer"]),
|
|
266623
|
+
source: z310.enum(["terminal", "web", "api"]),
|
|
266624
|
+
remaining: z310.number().int().nonnegative()
|
|
266365
266625
|
});
|
|
266366
|
-
var AgentInputQueuedEventSchema =
|
|
266367
|
-
type:
|
|
266626
|
+
var AgentInputQueuedEventSchema = z310.object({
|
|
266627
|
+
type: z310.literal("agent_input_queued"),
|
|
266368
266628
|
payload: AgentInputQueuePayloadSchema
|
|
266369
266629
|
});
|
|
266370
|
-
var AgentInputConsumedEventSchema =
|
|
266371
|
-
type:
|
|
266630
|
+
var AgentInputConsumedEventSchema = z310.object({
|
|
266631
|
+
type: z310.literal("agent_input_consumed"),
|
|
266372
266632
|
payload: AgentInputQueuePayloadSchema
|
|
266373
266633
|
});
|
|
266374
|
-
var AgentInputRemovedEventSchema =
|
|
266375
|
-
type:
|
|
266634
|
+
var AgentInputRemovedEventSchema = z310.object({
|
|
266635
|
+
type: z310.literal("agent_input_removed"),
|
|
266376
266636
|
payload: AgentInputQueuePayloadSchema
|
|
266377
266637
|
});
|
|
266378
|
-
var AgentInputUpdatedEventSchema =
|
|
266379
|
-
type:
|
|
266638
|
+
var AgentInputUpdatedEventSchema = z310.object({
|
|
266639
|
+
type: z310.literal("agent_input_updated"),
|
|
266380
266640
|
payload: AgentInputQueuePayloadSchema
|
|
266381
266641
|
});
|
|
266382
|
-
var AgentInputMovedEventSchema =
|
|
266383
|
-
type:
|
|
266642
|
+
var AgentInputMovedEventSchema = z310.object({
|
|
266643
|
+
type: z310.literal("agent_input_moved"),
|
|
266384
266644
|
payload: AgentInputQueuePayloadSchema.extend({
|
|
266385
|
-
fromIndex:
|
|
266386
|
-
toIndex:
|
|
266645
|
+
fromIndex: z310.number().int().nonnegative(),
|
|
266646
|
+
toIndex: z310.number().int().nonnegative()
|
|
266387
266647
|
})
|
|
266388
266648
|
});
|
|
266389
|
-
var AgentInputQueueClearedEventSchema =
|
|
266390
|
-
type:
|
|
266391
|
-
payload:
|
|
266392
|
-
sessionId:
|
|
266393
|
-
removed:
|
|
266649
|
+
var AgentInputQueueClearedEventSchema = z310.object({
|
|
266650
|
+
type: z310.literal("agent_input_queue_cleared"),
|
|
266651
|
+
payload: z310.object({
|
|
266652
|
+
sessionId: z310.string(),
|
|
266653
|
+
removed: z310.number().int().nonnegative()
|
|
266394
266654
|
})
|
|
266395
266655
|
});
|
|
266396
|
-
var LoopStartEventSchema =
|
|
266397
|
-
type:
|
|
266398
|
-
payload:
|
|
266399
|
-
attempt:
|
|
266656
|
+
var LoopStartEventSchema = z310.object({
|
|
266657
|
+
type: z310.literal("loop_start"),
|
|
266658
|
+
payload: z310.object({
|
|
266659
|
+
attempt: z310.number()
|
|
266400
266660
|
})
|
|
266401
266661
|
});
|
|
266402
|
-
var ModelDeltaEventSchema =
|
|
266403
|
-
type:
|
|
266404
|
-
payload:
|
|
266405
|
-
text:
|
|
266662
|
+
var ModelDeltaEventSchema = z310.object({
|
|
266663
|
+
type: z310.literal("model_delta"),
|
|
266664
|
+
payload: z310.object({
|
|
266665
|
+
text: z310.string()
|
|
266406
266666
|
})
|
|
266407
266667
|
});
|
|
266408
|
-
var ThinkingDeltaEventSchema =
|
|
266409
|
-
type:
|
|
266410
|
-
payload:
|
|
266411
|
-
text:
|
|
266668
|
+
var ThinkingDeltaEventSchema = z310.object({
|
|
266669
|
+
type: z310.literal("thinking_delta"),
|
|
266670
|
+
payload: z310.object({
|
|
266671
|
+
text: z310.string()
|
|
266412
266672
|
})
|
|
266413
266673
|
});
|
|
266414
|
-
var CostUpdateEventSchema =
|
|
266415
|
-
type:
|
|
266416
|
-
payload:
|
|
266417
|
-
turnCost:
|
|
266418
|
-
sessionCost:
|
|
266419
|
-
costKnown:
|
|
266420
|
-
totalInputTokens:
|
|
266421
|
-
totalCacheReadTokens:
|
|
266422
|
-
totalOutputTokens:
|
|
266674
|
+
var CostUpdateEventSchema = z310.object({
|
|
266675
|
+
type: z310.literal("cost_update"),
|
|
266676
|
+
payload: z310.object({
|
|
266677
|
+
turnCost: z310.number(),
|
|
266678
|
+
sessionCost: z310.number(),
|
|
266679
|
+
costKnown: z310.boolean().default(true),
|
|
266680
|
+
totalInputTokens: z310.number(),
|
|
266681
|
+
totalCacheReadTokens: z310.number(),
|
|
266682
|
+
totalOutputTokens: z310.number()
|
|
266423
266683
|
})
|
|
266424
266684
|
});
|
|
266425
|
-
var CacheUpdateEventSchema =
|
|
266426
|
-
type:
|
|
266427
|
-
payload:
|
|
266428
|
-
slabHash:
|
|
266429
|
-
slabTokenEstimate:
|
|
266430
|
-
hitTokens:
|
|
266431
|
-
missTokens:
|
|
266432
|
-
inputTokens:
|
|
266433
|
-
hitRate:
|
|
266434
|
-
degraded:
|
|
266685
|
+
var CacheUpdateEventSchema = z310.object({
|
|
266686
|
+
type: z310.literal("cache_update"),
|
|
266687
|
+
payload: z310.object({
|
|
266688
|
+
slabHash: z310.string(),
|
|
266689
|
+
slabTokenEstimate: z310.number(),
|
|
266690
|
+
hitTokens: z310.number(),
|
|
266691
|
+
missTokens: z310.number(),
|
|
266692
|
+
inputTokens: z310.number(),
|
|
266693
|
+
hitRate: z310.number(),
|
|
266694
|
+
degraded: z310.boolean()
|
|
266435
266695
|
})
|
|
266436
266696
|
});
|
|
266437
|
-
var ModelRoutingEventSchema =
|
|
266438
|
-
type:
|
|
266439
|
-
payload:
|
|
266440
|
-
model:
|
|
266441
|
-
lane:
|
|
266442
|
-
reason:
|
|
266443
|
-
confidence:
|
|
266697
|
+
var ModelRoutingEventSchema = z310.object({
|
|
266698
|
+
type: z310.literal("model_routing"),
|
|
266699
|
+
payload: z310.object({
|
|
266700
|
+
model: z310.string(),
|
|
266701
|
+
lane: z310.enum(["locked", "fallback", "fast", "balanced", "quality"]),
|
|
266702
|
+
reason: z310.string(),
|
|
266703
|
+
confidence: z310.enum(["high", "medium"])
|
|
266444
266704
|
})
|
|
266445
266705
|
});
|
|
266446
|
-
var ToolProposalEventSchema =
|
|
266447
|
-
type:
|
|
266448
|
-
payload:
|
|
266449
|
-
toolCallId:
|
|
266450
|
-
toolName:
|
|
266451
|
-
arguments:
|
|
266452
|
-
explanation:
|
|
266706
|
+
var ToolProposalEventSchema = z310.object({
|
|
266707
|
+
type: z310.literal("tool_proposal"),
|
|
266708
|
+
payload: z310.object({
|
|
266709
|
+
toolCallId: z310.string().optional(),
|
|
266710
|
+
toolName: z310.string(),
|
|
266711
|
+
arguments: z310.unknown(),
|
|
266712
|
+
explanation: z310.string().optional()
|
|
266453
266713
|
})
|
|
266454
266714
|
});
|
|
266455
|
-
var ToolApprovalEventSchema =
|
|
266456
|
-
type:
|
|
266457
|
-
payload:
|
|
266458
|
-
toolCallId:
|
|
266459
|
-
approved:
|
|
266460
|
-
reason:
|
|
266715
|
+
var ToolApprovalEventSchema = z310.object({
|
|
266716
|
+
type: z310.literal("tool_approval"),
|
|
266717
|
+
payload: z310.object({
|
|
266718
|
+
toolCallId: z310.string().optional(),
|
|
266719
|
+
approved: z310.boolean(),
|
|
266720
|
+
reason: z310.string().optional()
|
|
266461
266721
|
})
|
|
266462
266722
|
});
|
|
266463
|
-
var ToolResultEventSchema =
|
|
266464
|
-
type:
|
|
266465
|
-
payload:
|
|
266466
|
-
toolCallId:
|
|
266467
|
-
toolName:
|
|
266468
|
-
result:
|
|
266469
|
-
display:
|
|
266470
|
-
error:
|
|
266723
|
+
var ToolResultEventSchema = z310.object({
|
|
266724
|
+
type: z310.literal("tool_result"),
|
|
266725
|
+
payload: z310.object({
|
|
266726
|
+
toolCallId: z310.string().optional(),
|
|
266727
|
+
toolName: z310.string(),
|
|
266728
|
+
result: z310.unknown().optional(),
|
|
266729
|
+
display: z310.string().optional(),
|
|
266730
|
+
error: z310.string().optional()
|
|
266471
266731
|
})
|
|
266472
266732
|
});
|
|
266473
|
-
var BackgroundTaskLifecyclePayloadSchema =
|
|
266474
|
-
taskId:
|
|
266475
|
-
sessionId:
|
|
266476
|
-
command:
|
|
266477
|
-
cwd:
|
|
266478
|
-
status:
|
|
266479
|
-
startedAt:
|
|
266480
|
-
endedAt:
|
|
266481
|
-
durationMs:
|
|
266482
|
-
exitCode:
|
|
266483
|
-
outputTruncated:
|
|
266733
|
+
var BackgroundTaskLifecyclePayloadSchema = z310.object({
|
|
266734
|
+
taskId: z310.string(),
|
|
266735
|
+
sessionId: z310.string(),
|
|
266736
|
+
command: z310.string(),
|
|
266737
|
+
cwd: z310.string(),
|
|
266738
|
+
status: z310.enum(["running", "completed", "failed", "killed", "timed_out"]),
|
|
266739
|
+
startedAt: z310.string(),
|
|
266740
|
+
endedAt: z310.string().optional(),
|
|
266741
|
+
durationMs: z310.number().nonnegative(),
|
|
266742
|
+
exitCode: z310.number().int().nullable(),
|
|
266743
|
+
outputTruncated: z310.boolean()
|
|
266484
266744
|
});
|
|
266485
|
-
var BackgroundTaskStartedEventSchema =
|
|
266486
|
-
type:
|
|
266745
|
+
var BackgroundTaskStartedEventSchema = z310.object({
|
|
266746
|
+
type: z310.literal("background_task_started"),
|
|
266487
266747
|
payload: BackgroundTaskLifecyclePayloadSchema
|
|
266488
266748
|
});
|
|
266489
|
-
var BackgroundTaskCompletedEventSchema =
|
|
266490
|
-
type:
|
|
266749
|
+
var BackgroundTaskCompletedEventSchema = z310.object({
|
|
266750
|
+
type: z310.literal("background_task_completed"),
|
|
266491
266751
|
payload: BackgroundTaskLifecyclePayloadSchema
|
|
266492
266752
|
});
|
|
266493
|
-
var WebApprovalRequestedEventSchema =
|
|
266494
|
-
type:
|
|
266495
|
-
payload:
|
|
266496
|
-
approvalId:
|
|
266497
|
-
kind:
|
|
266498
|
-
title:
|
|
266499
|
-
toolCallId:
|
|
266500
|
-
agentId:
|
|
266501
|
-
agentRole:
|
|
266753
|
+
var WebApprovalRequestedEventSchema = z310.object({
|
|
266754
|
+
type: z310.literal("web_approval_requested"),
|
|
266755
|
+
payload: z310.object({
|
|
266756
|
+
approvalId: z310.string(),
|
|
266757
|
+
kind: z310.enum(["tool", "change", "action"]),
|
|
266758
|
+
title: z310.string(),
|
|
266759
|
+
toolCallId: z310.string().optional(),
|
|
266760
|
+
agentId: z310.string().regex(/^agent_[a-z0-9-]+$/).optional(),
|
|
266761
|
+
agentRole: z310.string().max(80).optional()
|
|
266502
266762
|
})
|
|
266503
266763
|
});
|
|
266504
|
-
var WebApprovalResolvedEventSchema =
|
|
266505
|
-
type:
|
|
266506
|
-
payload:
|
|
266507
|
-
approvalId:
|
|
266508
|
-
approved:
|
|
266764
|
+
var WebApprovalResolvedEventSchema = z310.object({
|
|
266765
|
+
type: z310.literal("web_approval_resolved"),
|
|
266766
|
+
payload: z310.object({
|
|
266767
|
+
approvalId: z310.string(),
|
|
266768
|
+
approved: z310.boolean()
|
|
266509
266769
|
})
|
|
266510
266770
|
});
|
|
266511
|
-
var SkillActivatedEventSchema =
|
|
266512
|
-
type:
|
|
266513
|
-
payload:
|
|
266514
|
-
name:
|
|
266515
|
-
activation:
|
|
266516
|
-
loadedBytes:
|
|
266517
|
-
truncated:
|
|
266771
|
+
var SkillActivatedEventSchema = z310.object({
|
|
266772
|
+
type: z310.literal("skill_activated"),
|
|
266773
|
+
payload: z310.object({
|
|
266774
|
+
name: z310.string(),
|
|
266775
|
+
activation: z310.enum(["explicit", "auto"]),
|
|
266776
|
+
loadedBytes: z310.number(),
|
|
266777
|
+
truncated: z310.boolean()
|
|
266518
266778
|
})
|
|
266519
266779
|
});
|
|
266520
|
-
var FileDiffEventSchema =
|
|
266521
|
-
type:
|
|
266522
|
-
payload:
|
|
266523
|
-
filePath:
|
|
266524
|
-
diff:
|
|
266780
|
+
var FileDiffEventSchema = z310.object({
|
|
266781
|
+
type: z310.literal("file_diff"),
|
|
266782
|
+
payload: z310.object({
|
|
266783
|
+
filePath: z310.string(),
|
|
266784
|
+
diff: z310.string()
|
|
266525
266785
|
})
|
|
266526
266786
|
});
|
|
266527
|
-
var FileChangeEventSchema =
|
|
266528
|
-
type:
|
|
266529
|
-
payload:
|
|
266530
|
-
filePath:
|
|
266531
|
-
type:
|
|
266532
|
-
explanation:
|
|
266787
|
+
var FileChangeEventSchema = z310.object({
|
|
266788
|
+
type: z310.literal("file_change"),
|
|
266789
|
+
payload: z310.object({
|
|
266790
|
+
filePath: z310.string(),
|
|
266791
|
+
type: z310.enum(["write", "edit", "create", "delete"]),
|
|
266792
|
+
explanation: z310.string().optional()
|
|
266533
266793
|
})
|
|
266534
266794
|
});
|
|
266535
|
-
var CheckpointCreatedEventSchema =
|
|
266536
|
-
type:
|
|
266537
|
-
payload:
|
|
266538
|
-
checkpointId:
|
|
266539
|
-
timestamp:
|
|
266540
|
-
message:
|
|
266795
|
+
var CheckpointCreatedEventSchema = z310.object({
|
|
266796
|
+
type: z310.literal("checkpoint_created"),
|
|
266797
|
+
payload: z310.object({
|
|
266798
|
+
checkpointId: z310.string(),
|
|
266799
|
+
timestamp: z310.string(),
|
|
266800
|
+
message: z310.string().optional()
|
|
266541
266801
|
})
|
|
266542
266802
|
});
|
|
266543
|
-
var VerificationStartedEventSchema =
|
|
266544
|
-
type:
|
|
266545
|
-
payload:
|
|
266546
|
-
type:
|
|
266803
|
+
var VerificationStartedEventSchema = z310.object({
|
|
266804
|
+
type: z310.literal("verification_started"),
|
|
266805
|
+
payload: z310.object({
|
|
266806
|
+
type: z310.string()
|
|
266547
266807
|
})
|
|
266548
266808
|
});
|
|
266549
|
-
var VerificationEndedEventSchema =
|
|
266550
|
-
type:
|
|
266551
|
-
payload:
|
|
266552
|
-
success:
|
|
266553
|
-
results:
|
|
266809
|
+
var VerificationEndedEventSchema = z310.object({
|
|
266810
|
+
type: z310.literal("verification_ended"),
|
|
266811
|
+
payload: z310.object({
|
|
266812
|
+
success: z310.boolean(),
|
|
266813
|
+
results: z310.unknown().optional()
|
|
266554
266814
|
})
|
|
266555
266815
|
});
|
|
266556
|
-
var HookStartedEventSchema =
|
|
266557
|
-
type:
|
|
266558
|
-
payload:
|
|
266559
|
-
hookId:
|
|
266816
|
+
var HookStartedEventSchema = z310.object({
|
|
266817
|
+
type: z310.literal("hook_started"),
|
|
266818
|
+
payload: z310.object({
|
|
266819
|
+
hookId: z310.string(),
|
|
266560
266820
|
event: LifecycleHookEventSchema,
|
|
266561
|
-
legacy:
|
|
266821
|
+
legacy: z310.boolean()
|
|
266562
266822
|
})
|
|
266563
266823
|
});
|
|
266564
|
-
var HookCompletedEventSchema =
|
|
266565
|
-
type:
|
|
266566
|
-
payload:
|
|
266567
|
-
hookId:
|
|
266824
|
+
var HookCompletedEventSchema = z310.object({
|
|
266825
|
+
type: z310.literal("hook_completed"),
|
|
266826
|
+
payload: z310.object({
|
|
266827
|
+
hookId: z310.string(),
|
|
266568
266828
|
event: LifecycleHookEventSchema,
|
|
266569
|
-
success:
|
|
266570
|
-
durationMs:
|
|
266571
|
-
action:
|
|
266572
|
-
error:
|
|
266829
|
+
success: z310.boolean(),
|
|
266830
|
+
durationMs: z310.number().nonnegative(),
|
|
266831
|
+
action: z310.enum(["continue", "warn", "blocked", "ignored"]),
|
|
266832
|
+
error: z310.string().optional()
|
|
266573
266833
|
})
|
|
266574
266834
|
});
|
|
266575
|
-
var SessionForkEventSchema =
|
|
266576
|
-
type:
|
|
266577
|
-
payload:
|
|
266578
|
-
parentSessionId:
|
|
266579
|
-
childSessionId:
|
|
266835
|
+
var SessionForkEventSchema = z310.object({
|
|
266836
|
+
type: z310.literal("session_fork"),
|
|
266837
|
+
payload: z310.object({
|
|
266838
|
+
parentSessionId: z310.string(),
|
|
266839
|
+
childSessionId: z310.string()
|
|
266580
266840
|
})
|
|
266581
266841
|
});
|
|
266582
|
-
var SessionEndedEventSchema =
|
|
266583
|
-
type:
|
|
266584
|
-
payload:
|
|
266585
|
-
sessionId:
|
|
266842
|
+
var SessionEndedEventSchema = z310.object({
|
|
266843
|
+
type: z310.literal("session_ended"),
|
|
266844
|
+
payload: z310.object({
|
|
266845
|
+
sessionId: z310.string()
|
|
266586
266846
|
})
|
|
266587
266847
|
});
|
|
266588
|
-
var InfoEventSchema =
|
|
266589
|
-
type:
|
|
266590
|
-
payload:
|
|
266591
|
-
message:
|
|
266848
|
+
var InfoEventSchema = z310.object({
|
|
266849
|
+
type: z310.literal("info"),
|
|
266850
|
+
payload: z310.object({
|
|
266851
|
+
message: z310.string()
|
|
266592
266852
|
})
|
|
266593
266853
|
});
|
|
266594
|
-
var WarningEventSchema =
|
|
266595
|
-
type:
|
|
266596
|
-
payload:
|
|
266597
|
-
message:
|
|
266854
|
+
var WarningEventSchema = z310.object({
|
|
266855
|
+
type: z310.literal("warning"),
|
|
266856
|
+
payload: z310.object({
|
|
266857
|
+
message: z310.string()
|
|
266598
266858
|
})
|
|
266599
266859
|
});
|
|
266600
|
-
var ErrorEventSchema =
|
|
266601
|
-
type:
|
|
266602
|
-
payload:
|
|
266603
|
-
message:
|
|
266604
|
-
stack:
|
|
266860
|
+
var ErrorEventSchema = z310.object({
|
|
266861
|
+
type: z310.literal("error"),
|
|
266862
|
+
payload: z310.object({
|
|
266863
|
+
message: z310.string(),
|
|
266864
|
+
stack: z310.string().optional()
|
|
266605
266865
|
})
|
|
266606
266866
|
});
|
|
266607
|
-
var OrbitEventSchema =
|
|
266867
|
+
var OrbitEventSchema = z310.discriminatedUnion("type", [
|
|
266608
266868
|
ModelRequestEventSchema,
|
|
266609
266869
|
ModelResponseEventSchema,
|
|
266610
266870
|
AgentStartEventSchema,
|
|
@@ -266646,10 +266906,10 @@ var OrbitEventSchema = z39.discriminatedUnion("type", [
|
|
|
266646
266906
|
WarningEventSchema,
|
|
266647
266907
|
ErrorEventSchema
|
|
266648
266908
|
]);
|
|
266649
|
-
var OrbitEventEnvelopeSchema =
|
|
266650
|
-
schemaVersion:
|
|
266651
|
-
eventId:
|
|
266652
|
-
timestamp:
|
|
266909
|
+
var OrbitEventEnvelopeSchema = z310.object({
|
|
266910
|
+
schemaVersion: z310.literal(ORBIT_EVENT_SCHEMA_VERSION),
|
|
266911
|
+
eventId: z310.string().min(1),
|
|
266912
|
+
timestamp: z310.string().datetime()
|
|
266653
266913
|
}).and(OrbitEventSchema);
|
|
266654
266914
|
var EventBus = class extends EventEmitter {
|
|
266655
266915
|
sequence = 0;
|
|
@@ -267404,6 +267664,16 @@ function readNullSeparatedGitPaths(cwd, args, environment) {
|
|
|
267404
267664
|
function normalizePath4(filePath) {
|
|
267405
267665
|
return filePath.replace(/\\/g, "/").replace(/^\.\//, "");
|
|
267406
267666
|
}
|
|
267667
|
+
function safeHookOutput(value) {
|
|
267668
|
+
return redactSecrets(String(value ?? "")).replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f-\u009f]/g, " ").trim().slice(0, 4e3);
|
|
267669
|
+
}
|
|
267670
|
+
function hookErrorOutput(error) {
|
|
267671
|
+
if (typeof error !== "object" || error === null) return String(error);
|
|
267672
|
+
const record2 = error;
|
|
267673
|
+
const output = `${typeof record2.stdout === "string" ? record2.stdout : ""}${typeof record2.stderr === "string" ? record2.stderr : ""}`;
|
|
267674
|
+
if (output.trim()) return output;
|
|
267675
|
+
return typeof record2.message === "string" ? record2.message : String(error);
|
|
267676
|
+
}
|
|
267407
267677
|
function extractFilePathFromLine(line) {
|
|
267408
267678
|
const windowsAbsolutePath = line.match(/([a-zA-Z]:[\\/][^`*\":#\s]+)/);
|
|
267409
267679
|
if (windowsAbsolutePath) return windowsAbsolutePath[1];
|
|
@@ -268753,6 +269023,10 @@ function parseSearchResultBlocks(content) {
|
|
|
268753
269023
|
}
|
|
268754
269024
|
return results;
|
|
268755
269025
|
}
|
|
269026
|
+
function resolveLifecycleHookSandboxMode(extension, config) {
|
|
269027
|
+
if (extension) return "required";
|
|
269028
|
+
return isFullAccessEnabled(config) ? "off" : config.tools.bash.sandbox;
|
|
269029
|
+
}
|
|
268756
269030
|
var WRITE_TOOLS = /* @__PURE__ */ new Set([
|
|
268757
269031
|
"write_file",
|
|
268758
269032
|
"edit_file",
|
|
@@ -268850,6 +269124,17 @@ async function executeLifecycleHooks(options) {
|
|
|
268850
269124
|
}
|
|
268851
269125
|
return { ok: true };
|
|
268852
269126
|
}
|
|
269127
|
+
function mergeLifecycleHooks(profile, global3) {
|
|
269128
|
+
const merged = {};
|
|
269129
|
+
for (const event of ORBIT_LIFECYCLE_HOOK_EVENTS) {
|
|
269130
|
+
const profileHooks = profile[event] ?? [];
|
|
269131
|
+
const globalHooks = global3?.[event] ?? [];
|
|
269132
|
+
if (profileHooks.length > 0 || globalHooks.length > 0) {
|
|
269133
|
+
merged[event] = [...profileHooks, ...globalHooks];
|
|
269134
|
+
}
|
|
269135
|
+
}
|
|
269136
|
+
return merged;
|
|
269137
|
+
}
|
|
268853
269138
|
function globMatches(pattern, value) {
|
|
268854
269139
|
let source = "^";
|
|
268855
269140
|
for (const character of pattern) {
|
|
@@ -268860,6 +269145,213 @@ function globMatches(pattern, value) {
|
|
|
268860
269145
|
source += "$";
|
|
268861
269146
|
return new RegExp(source, "iu").test(value);
|
|
268862
269147
|
}
|
|
269148
|
+
var MAX_PARALLEL_TOOL_CALLS = 4;
|
|
269149
|
+
async function executeParallelToolBatch(options) {
|
|
269150
|
+
if (options.toolCalls.length < 2 || options.finalResponseLocked || options.abortSignal?.aborted) {
|
|
269151
|
+
return void 0;
|
|
269152
|
+
}
|
|
269153
|
+
const prepared = [];
|
|
269154
|
+
for (const call of options.toolCalls) {
|
|
269155
|
+
if (options.protocolErrors.has(call.id)) return void 0;
|
|
269156
|
+
const tool = options.registry.get(call.name);
|
|
269157
|
+
if (!tool || tool.risk !== "read" || !isParallelTool(tool)) {
|
|
269158
|
+
return void 0;
|
|
269159
|
+
}
|
|
269160
|
+
let input;
|
|
269161
|
+
try {
|
|
269162
|
+
input = JSON.parse(call.arguments);
|
|
269163
|
+
} catch {
|
|
269164
|
+
return void 0;
|
|
269165
|
+
}
|
|
269166
|
+
const validation = tool.inputSchema.safeParse(input);
|
|
269167
|
+
if (!validation.success) return void 0;
|
|
269168
|
+
const decision2 = options.permissionEngine.evaluate(
|
|
269169
|
+
call.name,
|
|
269170
|
+
validation.data,
|
|
269171
|
+
tool.risk
|
|
269172
|
+
);
|
|
269173
|
+
if (decision2.action !== "allow" || decision2.risk !== "read") {
|
|
269174
|
+
return void 0;
|
|
269175
|
+
}
|
|
269176
|
+
const baseContext = {
|
|
269177
|
+
sessionId: options.sessionId,
|
|
269178
|
+
attempt: options.attempt,
|
|
269179
|
+
toolName: call.name
|
|
269180
|
+
};
|
|
269181
|
+
if (hasApplicableToolHook(options.hooks, baseContext)) return void 0;
|
|
269182
|
+
prepared.push({
|
|
269183
|
+
call,
|
|
269184
|
+
tool,
|
|
269185
|
+
input: validation.data,
|
|
269186
|
+
startedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
269187
|
+
});
|
|
269188
|
+
}
|
|
269189
|
+
for (const item of prepared) {
|
|
269190
|
+
options.interaction.showText(
|
|
269191
|
+
`
|
|
269192
|
+
${picocolors3.cyan("\u2726")} ${picocolors3.bold(picocolors3.white(item.call.name))} ${picocolors3.gray(summarizeToolArguments(item.call))}`
|
|
269193
|
+
);
|
|
269194
|
+
eventBus.emitEvent("tool_proposal", {
|
|
269195
|
+
toolCallId: item.call.id,
|
|
269196
|
+
toolName: item.call.name,
|
|
269197
|
+
arguments: item.input
|
|
269198
|
+
});
|
|
269199
|
+
eventBus.emitEvent("tool_approval", {
|
|
269200
|
+
toolCallId: item.call.id,
|
|
269201
|
+
approved: true,
|
|
269202
|
+
reason: "Auto-approved by policy for a parallel read batch"
|
|
269203
|
+
});
|
|
269204
|
+
}
|
|
269205
|
+
options.sessionManager.setRunState("running", "tool:parallel-read", {
|
|
269206
|
+
attempt: options.attempt,
|
|
269207
|
+
activeToolCallId: prepared[0]?.call.id
|
|
269208
|
+
});
|
|
269209
|
+
options.interaction.progress?.start(
|
|
269210
|
+
`Executing ${prepared.length} independent read tools... | Cost: ${options.sessionCostLabel}`
|
|
269211
|
+
);
|
|
269212
|
+
let results;
|
|
269213
|
+
try {
|
|
269214
|
+
results = [];
|
|
269215
|
+
for (let offset = 0; offset < prepared.length; offset += MAX_PARALLEL_TOOL_CALLS) {
|
|
269216
|
+
const chunk = prepared.slice(offset, offset + MAX_PARALLEL_TOOL_CALLS);
|
|
269217
|
+
results.push(
|
|
269218
|
+
...await Promise.all(
|
|
269219
|
+
chunk.map(
|
|
269220
|
+
(item) => options.stepRunner.run(item.call, options.abortSignal)
|
|
269221
|
+
)
|
|
269222
|
+
)
|
|
269223
|
+
);
|
|
269224
|
+
}
|
|
269225
|
+
} finally {
|
|
269226
|
+
options.interaction.progress?.stop();
|
|
269227
|
+
}
|
|
269228
|
+
const blocks = [];
|
|
269229
|
+
for (let index = 0; index < prepared.length; index += 1) {
|
|
269230
|
+
const item = prepared[index];
|
|
269231
|
+
const result = results[index];
|
|
269232
|
+
options.sessionManager.recordToolExecution(
|
|
269233
|
+
item.call.name,
|
|
269234
|
+
item.call,
|
|
269235
|
+
result,
|
|
269236
|
+
"read",
|
|
269237
|
+
"allow",
|
|
269238
|
+
result.ok ? "success" : "failed",
|
|
269239
|
+
{ startedAt: item.startedAt }
|
|
269240
|
+
);
|
|
269241
|
+
const modelVisibleToolResult = buildToolResultContent(
|
|
269242
|
+
item.call.name,
|
|
269243
|
+
result
|
|
269244
|
+
);
|
|
269245
|
+
reportResult(options.interaction, result, modelVisibleToolResult);
|
|
269246
|
+
eventBus.emitEvent("tool_result", {
|
|
269247
|
+
toolCallId: item.call.id,
|
|
269248
|
+
toolName: item.call.name,
|
|
269249
|
+
result: result.ok ? redactSensitiveValue(result.data) : void 0,
|
|
269250
|
+
display: result.ok ? redactSecrets(result.display || "") : void 0,
|
|
269251
|
+
error: result.ok ? void 0 : modelVisibleToolResult
|
|
269252
|
+
});
|
|
269253
|
+
const guardNudge = options.progressGuard.record({
|
|
269254
|
+
name: item.call.name,
|
|
269255
|
+
arguments: item.call.arguments,
|
|
269256
|
+
ok: result.ok
|
|
269257
|
+
});
|
|
269258
|
+
if (guardNudge) {
|
|
269259
|
+
options.interaction.showText(
|
|
269260
|
+
picocolors3.yellow(
|
|
269261
|
+
`\u26A0 Loop guard: "${item.call.name}" repeated ${guardNudge.repeatCount}\xD7 with identical arguments.`
|
|
269262
|
+
)
|
|
269263
|
+
);
|
|
269264
|
+
options.sessionManager.logEvent("loop_guard_nudge", {
|
|
269265
|
+
toolName: item.call.name,
|
|
269266
|
+
reason: guardNudge.reason,
|
|
269267
|
+
repeatCount: guardNudge.repeatCount
|
|
269268
|
+
});
|
|
269269
|
+
}
|
|
269270
|
+
blocks.push({
|
|
269271
|
+
type: "tool_result",
|
|
269272
|
+
toolResult: {
|
|
269273
|
+
toolCallId: item.call.id,
|
|
269274
|
+
name: item.call.name,
|
|
269275
|
+
content: modelVisibleToolResult + (guardNudge ? `
|
|
269276
|
+
|
|
269277
|
+
${guardNudge.message}` : ""),
|
|
269278
|
+
isError: !result.ok
|
|
269279
|
+
}
|
|
269280
|
+
});
|
|
269281
|
+
}
|
|
269282
|
+
options.sessionManager.logEvent("parallel_tool_batch_completed", {
|
|
269283
|
+
toolNames: prepared.map((item) => item.call.name),
|
|
269284
|
+
toolCallIds: prepared.map((item) => item.call.id),
|
|
269285
|
+
count: prepared.length
|
|
269286
|
+
});
|
|
269287
|
+
return { blocks, interrupted: Boolean(options.abortSignal?.aborted) };
|
|
269288
|
+
}
|
|
269289
|
+
function hasApplicableToolHook(hooks, context) {
|
|
269290
|
+
return selectLifecycleHooks(hooks, "preToolUse", context).length > 0 || selectLifecycleHooks(hooks, "postToolUse", {
|
|
269291
|
+
...context,
|
|
269292
|
+
status: "success"
|
|
269293
|
+
}).length > 0 || selectLifecycleHooks(hooks, "postToolFailure", {
|
|
269294
|
+
...context,
|
|
269295
|
+
status: "failure"
|
|
269296
|
+
}).length > 0;
|
|
269297
|
+
}
|
|
269298
|
+
function reportResult(interaction, result, modelVisibleResult) {
|
|
269299
|
+
if (result.ok) {
|
|
269300
|
+
const statusText = truncateToolText(
|
|
269301
|
+
redactSecrets(result.display || "Done"),
|
|
269302
|
+
TOOL_STATUS_MAX_CHARS
|
|
269303
|
+
);
|
|
269304
|
+
interaction.showText(
|
|
269305
|
+
` ${picocolors3.green("\u2714")} Success: ${picocolors3.gray(statusText)}`
|
|
269306
|
+
);
|
|
269307
|
+
return;
|
|
269308
|
+
}
|
|
269309
|
+
const statusError = truncateToolText(
|
|
269310
|
+
modelVisibleResult,
|
|
269311
|
+
TOOL_STATUS_MAX_CHARS
|
|
269312
|
+
);
|
|
269313
|
+
interaction.showText(
|
|
269314
|
+
` ${picocolors3.red("\u2716")} Failed: ${picocolors3.red(statusError)}`
|
|
269315
|
+
);
|
|
269316
|
+
}
|
|
269317
|
+
function summarizeToolArguments(toolCall) {
|
|
269318
|
+
let summary = toolCall.arguments;
|
|
269319
|
+
try {
|
|
269320
|
+
const parsed = JSON.parse(toolCall.arguments);
|
|
269321
|
+
const pathValue = firstString2(
|
|
269322
|
+
parsed.path,
|
|
269323
|
+
parsed.TargetFile,
|
|
269324
|
+
parsed.filePath,
|
|
269325
|
+
parsed.file,
|
|
269326
|
+
parsed.AbsolutePath
|
|
269327
|
+
) ?? "";
|
|
269328
|
+
if (toolCall.name === "grep") {
|
|
269329
|
+
const query = firstString2(parsed.pattern, parsed.query, parsed.Query) ?? "";
|
|
269330
|
+
const searchPath = firstString2(parsed.path, parsed.SearchPath) ?? "";
|
|
269331
|
+
summary = `"${query}" in ${searchPath}`;
|
|
269332
|
+
} else if (toolCall.name === "glob") {
|
|
269333
|
+
const pattern = firstString2(parsed.pattern, parsed.Pattern) ?? "";
|
|
269334
|
+
const directory = firstString2(parsed.path, parsed.DirectoryPath) ?? "";
|
|
269335
|
+
summary = `"${pattern}" in ${directory}`;
|
|
269336
|
+
} else {
|
|
269337
|
+
summary = pathValue || firstString2(
|
|
269338
|
+
parsed.command,
|
|
269339
|
+
parsed.CommandLine,
|
|
269340
|
+
parsed.query,
|
|
269341
|
+
parsed.pattern
|
|
269342
|
+
) || toolCall.arguments;
|
|
269343
|
+
}
|
|
269344
|
+
} catch {
|
|
269345
|
+
}
|
|
269346
|
+
const redacted = redactSecrets(summary).replace(
|
|
269347
|
+
/[\u0000-\u001f\u007f-\u009f]/g,
|
|
269348
|
+
" "
|
|
269349
|
+
);
|
|
269350
|
+
return redacted.length > 80 ? `${redacted.slice(0, 77)}...` : redacted;
|
|
269351
|
+
}
|
|
269352
|
+
function firstString2(...values) {
|
|
269353
|
+
return values.find((value) => typeof value === "string");
|
|
269354
|
+
}
|
|
268863
269355
|
var execPromise2 = promisify3(exec2);
|
|
268864
269356
|
var execFilePromise3 = promisify3(execFile3);
|
|
268865
269357
|
var DEEPSEEK_CACHE_DEGRADED_HIT_RATE = 0.85;
|
|
@@ -268926,16 +269418,6 @@ function resolveScheduledModelPrice(price, now = /* @__PURE__ */ new Date()) {
|
|
|
268926
269418
|
});
|
|
268927
269419
|
return isPeak ? scheduled.peak : scheduled.offPeak;
|
|
268928
269420
|
}
|
|
268929
|
-
function safeHookOutput(value) {
|
|
268930
|
-
return redactSecrets(String(value ?? "")).replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f-\u009f]/g, " ").trim().slice(0, 4e3);
|
|
268931
|
-
}
|
|
268932
|
-
function hookErrorOutput(error) {
|
|
268933
|
-
if (typeof error !== "object" || error === null) return String(error);
|
|
268934
|
-
const record2 = error;
|
|
268935
|
-
const output = `${typeof record2.stdout === "string" ? record2.stdout : ""}${typeof record2.stderr === "string" ? record2.stderr : ""}`;
|
|
268936
|
-
if (output.trim()) return output;
|
|
268937
|
-
return typeof record2.message === "string" ? record2.message : String(error);
|
|
268938
|
-
}
|
|
268939
269421
|
function hasSuccessfulWorkspaceFileMutations(history, cwd) {
|
|
268940
269422
|
const mutationCallIds = /* @__PURE__ */ new Set();
|
|
268941
269423
|
for (const message2 of history) {
|
|
@@ -269173,7 +269655,7 @@ var AgentLoop = class _AgentLoop {
|
|
|
269173
269655
|
model: cleanModel
|
|
269174
269656
|
});
|
|
269175
269657
|
this.interaction.showText(
|
|
269176
|
-
|
|
269658
|
+
picocolors22.yellow(
|
|
269177
269659
|
`\u26A0 Pricing is not configured for ${cleanModel}; Orbit will report token usage but cannot enforce the dollar budget. Add an entry to ~/.orbit/pricing.json to enable cost accounting.`
|
|
269178
269660
|
)
|
|
269179
269661
|
);
|
|
@@ -269588,7 +270070,7 @@ ${truncateInteractionText(messages.map((item) => item.content.map((block2) => bl
|
|
|
269588
270070
|
message: message2
|
|
269589
270071
|
});
|
|
269590
270072
|
this.interaction.showText(
|
|
269591
|
-
|
|
270073
|
+
picocolors22.red(`\u2716 Provider initialization failed: ${message2}`)
|
|
269592
270074
|
);
|
|
269593
270075
|
return this.createFailedOutcome("provider_error", message2);
|
|
269594
270076
|
}
|
|
@@ -269672,7 +270154,7 @@ ${truncateInteractionText(messages.map((item) => item.content.map((block2) => bl
|
|
|
269672
270154
|
}
|
|
269673
270155
|
if (this.sessionCostKnown && this.sessionCost > this.config.budgetLimit) {
|
|
269674
270156
|
this.interaction.showText(
|
|
269675
|
-
|
|
270157
|
+
picocolors22.red(
|
|
269676
270158
|
`
|
|
269677
270159
|
\u2716 Budget Exceeded: The session cost has reached $${this.sessionCost.toFixed(4)}, which exceeds the limit of $${this.config.budgetLimit.toFixed(2)}.`
|
|
269678
270160
|
)
|
|
@@ -269696,7 +270178,7 @@ ${truncateInteractionText(messages.map((item) => item.content.map((block2) => bl
|
|
|
269696
270178
|
this.fallbackModelForRun = null;
|
|
269697
270179
|
this.activeModelForRun = null;
|
|
269698
270180
|
this.interaction.showText(
|
|
269699
|
-
|
|
270181
|
+
picocolors22.gray(
|
|
269700
270182
|
"\u25CF Provider pressure window passed; returning to the primary model lane."
|
|
269701
270183
|
)
|
|
269702
270184
|
);
|
|
@@ -269723,7 +270205,7 @@ ${truncateInteractionText(messages.map((item) => item.content.map((block2) => bl
|
|
|
269723
270205
|
}
|
|
269724
270206
|
if (this.options.autoContinueRunaway && !fullAccess) {
|
|
269725
270207
|
this.interaction.showText(
|
|
269726
|
-
|
|
270208
|
+
picocolors22.gray(
|
|
269727
270209
|
`\u25CF Automated evaluation checkpoint: continuing after ${completedIterations} iterations within configured limits.`
|
|
269728
270210
|
)
|
|
269729
270211
|
);
|
|
@@ -270096,7 +270578,7 @@ Note: To find where a symbol (class, function, etc.) is declared or referenced,
|
|
|
270096
270578
|
delayMs: retryDelayMs
|
|
270097
270579
|
});
|
|
270098
270580
|
this.interaction.showText(
|
|
270099
|
-
|
|
270581
|
+
picocolors22.yellow(
|
|
270100
270582
|
`\u26A0 ${activeModel2} request failed transiently; retrying in ${Math.ceil(retryDelayMs / 1e3)}s (${this.providerRetriesForRun}/2).`
|
|
270101
270583
|
)
|
|
270102
270584
|
);
|
|
@@ -270127,7 +270609,7 @@ Note: To find where a symbol (class, function, etc.) is declared or referenced,
|
|
|
270127
270609
|
});
|
|
270128
270610
|
this.sessionManager.saveHistory(this.state.history);
|
|
270129
270611
|
this.interaction.showText(
|
|
270130
|
-
|
|
270612
|
+
picocolors22.yellow(
|
|
270131
270613
|
`\u26A0 ${activeModel2} exceeded its output limit; retrying with a bounded action batch (${this.outputLimitRetriesForRun}/2).`
|
|
270132
270614
|
)
|
|
270133
270615
|
);
|
|
@@ -270152,7 +270634,7 @@ Note: To find where a symbol (class, function, etc.) is declared or referenced,
|
|
|
270152
270634
|
);
|
|
270153
270635
|
if (compacted.changed) {
|
|
270154
270636
|
this.interaction.showText(
|
|
270155
|
-
|
|
270637
|
+
picocolors22.yellow(
|
|
270156
270638
|
`\u26A0 ${activeModel2} rejected the context length; Orbit compacted it and is retrying (${this.contextOverflowRetriesForRun}/2).`
|
|
270157
270639
|
)
|
|
270158
270640
|
);
|
|
@@ -270175,7 +270657,7 @@ Note: To find where a symbol (class, function, etc.) is declared or referenced,
|
|
|
270175
270657
|
this.fallbackExpiresAfterAttempt = this.state.attemptCount + 2;
|
|
270176
270658
|
this.activeModelForRun = this.config.models.fast;
|
|
270177
270659
|
this.interaction.showText(
|
|
270178
|
-
|
|
270660
|
+
picocolors22.yellow(
|
|
270179
270661
|
`\u26A0 ${activeModel2} is temporarily unavailable; retrying this turn with ${this.config.models.fast}.`
|
|
270180
270662
|
)
|
|
270181
270663
|
);
|
|
@@ -270229,7 +270711,7 @@ Note: To find where a symbol (class, function, etc.) is declared or referenced,
|
|
|
270229
270711
|
for (const toolCall of toolCallsToExecute) {
|
|
270230
270712
|
if (seenToolCallIds.has(toolCall.id)) {
|
|
270231
270713
|
const message2 = `Ignored duplicate tool call id "${toolCall.id}" from the model response.`;
|
|
270232
|
-
this.interaction.showText(
|
|
270714
|
+
this.interaction.showText(picocolors22.yellow(`\u26A0 ${message2}`));
|
|
270233
270715
|
this.sessionManager.logEvent("duplicate_tool_call_ignored", {
|
|
270234
270716
|
toolCallId: toolCall.id,
|
|
270235
270717
|
toolName: toolCall.name
|
|
@@ -270420,7 +270902,7 @@ Orbit: ${this.interaction.formatMarkdown?.(responseText) || responseText}`
|
|
|
270420
270902
|
);
|
|
270421
270903
|
if (repairAttempts >= maxRepairAttempts || !this.config.context.autoRepair) {
|
|
270422
270904
|
this.interaction.showText(
|
|
270423
|
-
|
|
270905
|
+
picocolors22.red(
|
|
270424
270906
|
`
|
|
270425
270907
|
\u2716 Verification Failed: Workspace violates contract. Rolling back all changes for safety...`
|
|
270426
270908
|
)
|
|
@@ -270436,7 +270918,7 @@ Orbit: ${this.interaction.formatMarkdown?.(responseText) || responseText}`
|
|
|
270436
270918
|
break;
|
|
270437
270919
|
}
|
|
270438
270920
|
this.interaction.showText(
|
|
270439
|
-
|
|
270921
|
+
picocolors22.red(
|
|
270440
270922
|
`\u2716 Verification failed! Entering auto-repair loop (Attempt ${repairAttempts + 1}/${maxRepairAttempts})...`
|
|
270441
270923
|
)
|
|
270442
270924
|
);
|
|
@@ -270456,7 +270938,7 @@ Please analyze this failure, fix the codebase, and ensure it passes the verifica
|
|
|
270456
270938
|
continue;
|
|
270457
270939
|
} else {
|
|
270458
270940
|
this.interaction.showText(
|
|
270459
|
-
|
|
270941
|
+
picocolors22.green(
|
|
270460
270942
|
`\u2714 Verification contract passed successfully.`
|
|
270461
270943
|
)
|
|
270462
270944
|
);
|
|
@@ -270500,7 +270982,7 @@ Please analyze this failure, fix the codebase, and ensure it passes the verifica
|
|
|
270500
270982
|
);
|
|
270501
270983
|
if (repairAttempts >= maxRepairAttempts) {
|
|
270502
270984
|
this.interaction.showText(
|
|
270503
|
-
|
|
270985
|
+
picocolors22.red(
|
|
270504
270986
|
`
|
|
270505
270987
|
\u2716 Auto-Repair: Max attempts (${maxRepairAttempts}) reached. Codebase is unstable. Rolling back all changes for safety...`
|
|
270506
270988
|
)
|
|
@@ -270516,7 +270998,7 @@ Please analyze this failure, fix the codebase, and ensure it passes the verifica
|
|
|
270516
270998
|
break;
|
|
270517
270999
|
}
|
|
270518
271000
|
this.interaction.showText(
|
|
270519
|
-
|
|
271001
|
+
picocolors22.red(
|
|
270520
271002
|
`\u2716 Tests failed! Entering auto-repair loop (Attempt ${repairAttempts + 1}/${maxRepairAttempts})...`
|
|
270521
271003
|
)
|
|
270522
271004
|
);
|
|
@@ -270558,7 +271040,7 @@ ${errLog}`;
|
|
|
270558
271040
|
if (distilledLog.trim()) {
|
|
270559
271041
|
errLog = distilledLog.trim();
|
|
270560
271042
|
this.interaction.showText(
|
|
270561
|
-
|
|
271043
|
+
picocolors22.gray(`\u25CF Compressed logs:
|
|
270562
271044
|
${errLog}`)
|
|
270563
271045
|
);
|
|
270564
271046
|
}
|
|
@@ -270581,7 +271063,7 @@ Please analyze this failure log, locate the files causing assertion or compile e
|
|
|
270581
271063
|
continue;
|
|
270582
271064
|
} else {
|
|
270583
271065
|
this.interaction.showText(
|
|
270584
|
-
|
|
271066
|
+
picocolors22.green(
|
|
270585
271067
|
`\u2714 All tests passed successfully! Verification green.`
|
|
270586
271068
|
)
|
|
270587
271069
|
);
|
|
@@ -270609,7 +271091,7 @@ Please analyze this failure log, locate the files causing assertion or compile e
|
|
|
270609
271091
|
});
|
|
270610
271092
|
this.sessionManager.saveHistory(this.state.history);
|
|
270611
271093
|
this.interaction.showText(
|
|
270612
|
-
|
|
271094
|
+
picocolors22.yellow(
|
|
270613
271095
|
"\n\u26A0 Completion gate: modified files require a verification check before Orbit can finish."
|
|
270614
271096
|
)
|
|
270615
271097
|
);
|
|
@@ -270627,7 +271109,7 @@ Please analyze this failure log, locate the files causing assertion or compile e
|
|
|
270627
271109
|
const toolResultBlocks = [];
|
|
270628
271110
|
const rejectInvalidToolCall = (toolCall, message2, risk = "read", startedAt = (/* @__PURE__ */ new Date()).toISOString()) => {
|
|
270629
271111
|
const error = safeAgentLoopErrorMessage(message2);
|
|
270630
|
-
this.interaction.showText(` ${
|
|
271112
|
+
this.interaction.showText(` ${picocolors22.red("\u2716")} ${error}`);
|
|
270631
271113
|
eventBus.emitEvent("tool_result", {
|
|
270632
271114
|
toolCallId: toolCall.id,
|
|
270633
271115
|
toolName: toolCall.name,
|
|
@@ -270653,7 +271135,48 @@ Please analyze this failure log, locate the files causing assertion or compile e
|
|
|
270653
271135
|
);
|
|
270654
271136
|
};
|
|
270655
271137
|
let terminalSuccessReachedThisBatch;
|
|
270656
|
-
|
|
271138
|
+
const parallelReadBatch = await executeParallelToolBatch({
|
|
271139
|
+
toolCalls: toolCallsToExecute,
|
|
271140
|
+
protocolErrors: toolCallProtocolErrors,
|
|
271141
|
+
finalResponseLocked: Boolean(this.finalResponseOnlyReason),
|
|
271142
|
+
abortSignal: this.abortController?.signal,
|
|
271143
|
+
registry: this.toolRegistry,
|
|
271144
|
+
permissionEngine: this.permissionEngine,
|
|
271145
|
+
hooks: this.lifecycleHookConfig(),
|
|
271146
|
+
sessionId: this.state.sessionId,
|
|
271147
|
+
attempt: this.state.attemptCount,
|
|
271148
|
+
stepRunner: this.stepRunner,
|
|
271149
|
+
interaction: this.interaction,
|
|
271150
|
+
sessionManager: this.sessionManager,
|
|
271151
|
+
progressGuard: this.progressGuard,
|
|
271152
|
+
sessionCostLabel: this.formatSessionCost()
|
|
271153
|
+
});
|
|
271154
|
+
if (parallelReadBatch) {
|
|
271155
|
+
toolResultBlocks.push(...parallelReadBatch.blocks);
|
|
271156
|
+
if (parallelReadBatch.interrupted) {
|
|
271157
|
+
const action = await this.handleInterrupt();
|
|
271158
|
+
if (action === "continue") {
|
|
271159
|
+
this.interaction.showText("\u25CF Resuming execution...");
|
|
271160
|
+
this.abortController = null;
|
|
271161
|
+
} else if (action === "rollback_exit") {
|
|
271162
|
+
await this.rollbackLastCheckpoint();
|
|
271163
|
+
this.state.done = true;
|
|
271164
|
+
return this.createAbortedOutcome(
|
|
271165
|
+
"rollback",
|
|
271166
|
+
"Execution was interrupted and the last checkpoint was rolled back."
|
|
271167
|
+
);
|
|
271168
|
+
} else {
|
|
271169
|
+
this.interaction.showText("\u25CF Aborted. Returning to REPL prompt.");
|
|
271170
|
+
this.state.done = true;
|
|
271171
|
+
return this.createAbortedOutcome(
|
|
271172
|
+
"interrupted",
|
|
271173
|
+
"Execution was interrupted by the user."
|
|
271174
|
+
);
|
|
271175
|
+
}
|
|
271176
|
+
}
|
|
271177
|
+
}
|
|
271178
|
+
const serialToolCalls = parallelReadBatch ? [] : toolCallsToExecute;
|
|
271179
|
+
for (const tc of serialToolCalls) {
|
|
270657
271180
|
const toolStartedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
270658
271181
|
if (this.finalResponseOnlyReason) {
|
|
270659
271182
|
rejectInvalidToolCall(
|
|
@@ -270664,37 +271187,10 @@ Please analyze this failure log, locate the files causing assertion or compile e
|
|
|
270664
271187
|
);
|
|
270665
271188
|
continue;
|
|
270666
271189
|
}
|
|
270667
|
-
|
|
270668
|
-
try {
|
|
270669
|
-
const parsed = JSON.parse(tc.arguments);
|
|
270670
|
-
if (tc.name === "write_file" || tc.name === "edit_file" || tc.name === "replace_file_content") {
|
|
270671
|
-
argSummary = parsed.path || parsed.TargetFile || parsed.filePath || parsed.file || "";
|
|
270672
|
-
} else if (tc.name === "multi_replace_file_content") {
|
|
270673
|
-
argSummary = parsed.TargetFile || "";
|
|
270674
|
-
} else if (tc.name === "read_file") {
|
|
270675
|
-
argSummary = parsed.path || parsed.AbsolutePath || "";
|
|
270676
|
-
} else if (tc.name === "bash") {
|
|
270677
|
-
argSummary = parsed.command || parsed.CommandLine || "";
|
|
270678
|
-
} else if (tc.name === "run_tests") {
|
|
270679
|
-
argSummary = parsed.command || "";
|
|
270680
|
-
} else if (tc.name === "grep") {
|
|
270681
|
-
argSummary = `"${parsed.query || parsed.Query}" in ${parsed.path || parsed.SearchPath || ""}`;
|
|
270682
|
-
} else if (tc.name === "glob") {
|
|
270683
|
-
argSummary = `"${parsed.pattern || parsed.Pattern}" in ${parsed.path || parsed.DirectoryPath || ""}`;
|
|
270684
|
-
} else if (tc.name === "web_search") {
|
|
270685
|
-
argSummary = parsed.query || "";
|
|
270686
|
-
} else {
|
|
270687
|
-
argSummary = tc.arguments;
|
|
270688
|
-
}
|
|
270689
|
-
} catch {
|
|
270690
|
-
argSummary = tc.arguments;
|
|
270691
|
-
}
|
|
270692
|
-
if (argSummary.length > 80) {
|
|
270693
|
-
argSummary = argSummary.substring(0, 77) + "...";
|
|
270694
|
-
}
|
|
271190
|
+
const argSummary = summarizeToolArguments(tc);
|
|
270695
271191
|
this.interaction.showText(
|
|
270696
271192
|
`
|
|
270697
|
-
${
|
|
271193
|
+
${picocolors22.cyan("\u2726")} ${picocolors22.bold(picocolors22.white(tc.name))} ${picocolors22.gray(argSummary)}`
|
|
270698
271194
|
);
|
|
270699
271195
|
const registeredTool = this.toolRegistry.get(tc.name);
|
|
270700
271196
|
if (!registeredTool) {
|
|
@@ -271044,7 +271540,7 @@ Please analyze this failure log, locate the files causing assertion or compile e
|
|
|
271044
271540
|
} catch (error) {
|
|
271045
271541
|
const commandError = hookErrorOutput(error);
|
|
271046
271542
|
this.interaction.showText(
|
|
271047
|
-
|
|
271543
|
+
picocolors22.red(
|
|
271048
271544
|
`\u2716 Pre-commit checks failed. Verification tests failed.`
|
|
271049
271545
|
)
|
|
271050
271546
|
);
|
|
@@ -271064,7 +271560,7 @@ Please analyze this failure log, locate the files causing assertion or compile e
|
|
|
271064
271560
|
);
|
|
271065
271561
|
if (fullAccess) {
|
|
271066
271562
|
this.interaction.showText(
|
|
271067
|
-
|
|
271563
|
+
picocolors22.yellow(
|
|
271068
271564
|
"\u26A0 Full Access: proceeding with the approved commit despite failed pre-commit verification."
|
|
271069
271565
|
)
|
|
271070
271566
|
);
|
|
@@ -271178,7 +271674,7 @@ ${buildCommitContextForModel(stdout2)}`
|
|
|
271178
271674
|
} catch (error) {
|
|
271179
271675
|
if (!fullAccess) throw error;
|
|
271180
271676
|
this.interaction.showText(
|
|
271181
|
-
|
|
271677
|
+
picocolors22.yellow(
|
|
271182
271678
|
`\u26A0 Full Access: checkpoint unavailable for ${targetPath}; proceeding without Orbit rollback coverage. ${safeAgentLoopErrorMessage(error)}`
|
|
271183
271679
|
)
|
|
271184
271680
|
);
|
|
@@ -271351,11 +271847,11 @@ ${buildCommitContextForModel(stdout2)}`
|
|
|
271351
271847
|
} catch (error) {
|
|
271352
271848
|
let lintError = hookErrorOutput(error);
|
|
271353
271849
|
this.interaction.showText(
|
|
271354
|
-
|
|
271850
|
+
picocolors22.yellow(
|
|
271355
271851
|
`\u26A0 Syntax/Lint validation warning for ${targetPath}:`
|
|
271356
271852
|
)
|
|
271357
271853
|
);
|
|
271358
|
-
this.interaction.showText(
|
|
271854
|
+
this.interaction.showText(picocolors22.red(lintError));
|
|
271359
271855
|
let checkPassedAfterAutoInstall = false;
|
|
271360
271856
|
const outputText = lintError;
|
|
271361
271857
|
try {
|
|
@@ -271416,7 +271912,7 @@ ${buildCommitContextForModel(stdout2)}`
|
|
|
271416
271912
|
dependenciesInstalled = true;
|
|
271417
271913
|
} catch (installError) {
|
|
271418
271914
|
this.interaction.showText(
|
|
271419
|
-
|
|
271915
|
+
picocolors22.red(
|
|
271420
271916
|
`\u2716 Failed to install "${pkg}": ${safeAgentLoopErrorMessage(installError)}`
|
|
271421
271917
|
)
|
|
271422
271918
|
);
|
|
@@ -271526,12 +272022,12 @@ ${buildCommitContextForModel(stdout2)}`
|
|
|
271526
272022
|
checkPassedAfterAutofix = true;
|
|
271527
272023
|
} catch (recheckError) {
|
|
271528
272024
|
this.interaction.showText(
|
|
271529
|
-
|
|
272025
|
+
picocolors22.yellow(
|
|
271530
272026
|
`\u26A0 Syntax/Lint validation still failed after auto-imports:`
|
|
271531
272027
|
)
|
|
271532
272028
|
);
|
|
271533
272029
|
this.interaction.showText(
|
|
271534
|
-
|
|
272030
|
+
picocolors22.red(hookErrorOutput(recheckError))
|
|
271535
272031
|
);
|
|
271536
272032
|
}
|
|
271537
272033
|
}
|
|
@@ -271584,7 +272080,10 @@ ${buildCommitContextForModel(stdout2)}`
|
|
|
271584
272080
|
value: "hunks",
|
|
271585
272081
|
label: "Review and accept by hunk/block"
|
|
271586
272082
|
},
|
|
271587
|
-
{
|
|
272083
|
+
{
|
|
272084
|
+
value: "no",
|
|
272085
|
+
label: "Reject and rollback all changes"
|
|
272086
|
+
}
|
|
271588
272087
|
]);
|
|
271589
272088
|
if (choice === "yes") {
|
|
271590
272089
|
accepted = true;
|
|
@@ -271670,19 +272169,19 @@ ${buildCommitContextForModel(stdout2)}`
|
|
|
271670
272169
|
for (let hIdx = 0; hIdx < hunks.length; hIdx++) {
|
|
271671
272170
|
const hunk = hunks[hIdx];
|
|
271672
272171
|
previewLines.push(
|
|
271673
|
-
|
|
272172
|
+
picocolors22.cyan(
|
|
271674
272173
|
`
|
|
271675
272174
|
--- Hunk #${hIdx + 1}/${hunks.length} ---`
|
|
271676
272175
|
)
|
|
271677
272176
|
);
|
|
271678
272177
|
for (const line of hunk.linesB) {
|
|
271679
|
-
previewLines.push(` ${
|
|
272178
|
+
previewLines.push(` ${picocolors22.red(`- ${line}`)}`);
|
|
271680
272179
|
}
|
|
271681
272180
|
for (const line of hunk.linesA) {
|
|
271682
|
-
previewLines.push(` ${
|
|
272181
|
+
previewLines.push(` ${picocolors22.green(`+ ${line}`)}`);
|
|
271683
272182
|
}
|
|
271684
272183
|
previewLines.push(
|
|
271685
|
-
|
|
272184
|
+
picocolors22.cyan(
|
|
271686
272185
|
"----------------------------------------"
|
|
271687
272186
|
)
|
|
271688
272187
|
);
|
|
@@ -271720,7 +272219,7 @@ ${buildCommitContextForModel(stdout2)}`
|
|
|
271720
272219
|
"utf8"
|
|
271721
272220
|
);
|
|
271722
272221
|
this.interaction.showText(
|
|
271723
|
-
|
|
272222
|
+
picocolors22.green(
|
|
271724
272223
|
`\u2714 Selected hunks merged and saved to ${targetPath}.`
|
|
271725
272224
|
)
|
|
271726
272225
|
);
|
|
@@ -271729,7 +272228,7 @@ ${buildCommitContextForModel(stdout2)}`
|
|
|
271729
272228
|
}
|
|
271730
272229
|
} catch (hunkError) {
|
|
271731
272230
|
this.interaction.showText(
|
|
271732
|
-
|
|
272231
|
+
picocolors22.red(
|
|
271733
272232
|
`\u2716 Hunk merge failed: ${safeAgentLoopErrorMessage(hunkError)}. Accepting all instead.`
|
|
271734
272233
|
)
|
|
271735
272234
|
);
|
|
@@ -271738,7 +272237,7 @@ ${buildCommitContextForModel(stdout2)}`
|
|
|
271738
272237
|
}
|
|
271739
272238
|
if (!accepted) {
|
|
271740
272239
|
this.interaction.showText(
|
|
271741
|
-
|
|
272240
|
+
picocolors22.yellow(
|
|
271742
272241
|
`\u25CF Rejected changes. Reverting ${targetPath}...`
|
|
271743
272242
|
)
|
|
271744
272243
|
);
|
|
@@ -271803,7 +272302,7 @@ ${buildCommitContextForModel(stdout2)}`
|
|
|
271803
272302
|
this.recordVerificationResult(true);
|
|
271804
272303
|
} else {
|
|
271805
272304
|
this.interaction.showText(
|
|
271806
|
-
|
|
272305
|
+
picocolors22.yellow(
|
|
271807
272306
|
" \u26A0 Command succeeded, but it is not a recognized standalone verification command and does not satisfy the completion gate."
|
|
271808
272307
|
)
|
|
271809
272308
|
);
|
|
@@ -271828,7 +272327,7 @@ ${buildCommitContextForModel(stdout2)}`
|
|
|
271828
272327
|
TOOL_STATUS_MAX_CHARS
|
|
271829
272328
|
);
|
|
271830
272329
|
this.interaction.showText(
|
|
271831
|
-
` ${
|
|
272330
|
+
` ${picocolors22.green("\u2714")} Success: ${picocolors22.gray(statusText)}`
|
|
271832
272331
|
);
|
|
271833
272332
|
if (targetPath && workspaceTargetPath) {
|
|
271834
272333
|
this.addRelevantFile(targetPath, `Modified by ${tc.name}`);
|
|
@@ -271843,7 +272342,7 @@ ${buildCommitContextForModel(stdout2)}`
|
|
|
271843
272342
|
TOOL_STATUS_MAX_CHARS
|
|
271844
272343
|
);
|
|
271845
272344
|
this.interaction.showText(
|
|
271846
|
-
` ${
|
|
272345
|
+
` ${picocolors22.red("\u2716")} Failed: ${picocolors22.red(statusError)}`
|
|
271847
272346
|
);
|
|
271848
272347
|
}
|
|
271849
272348
|
eventBus.emitEvent("tool_result", {
|
|
@@ -271860,7 +272359,7 @@ ${buildCommitContextForModel(stdout2)}`
|
|
|
271860
272359
|
});
|
|
271861
272360
|
if (guardNudge) {
|
|
271862
272361
|
this.interaction.showText(
|
|
271863
|
-
|
|
272362
|
+
picocolors22.yellow(
|
|
271864
272363
|
`\u26A0 Loop guard: "${tc.name}" repeated ${guardNudge.repeatCount}\xD7 with identical arguments.`
|
|
271865
272364
|
)
|
|
271866
272365
|
);
|
|
@@ -271981,11 +272480,11 @@ ${buildCommitContextForModel(diff)}`
|
|
|
271981
272480
|
}
|
|
271982
272481
|
const finalMsg = generatedMessage.trim().replace(/^["']|["']$/g, "") || "chore: auto-commit";
|
|
271983
272482
|
this.interaction.showText(
|
|
271984
|
-
`\u25CF Committing: "${
|
|
272483
|
+
`\u25CF Committing: "${picocolors22.green(finalMsg)}"`
|
|
271985
272484
|
);
|
|
271986
272485
|
preparedCommit.commit(finalMsg);
|
|
271987
272486
|
this.interaction.showText(
|
|
271988
|
-
`${
|
|
272487
|
+
`${picocolors22.green("\u2714")} Auto-commit created successfully without consuming user-staged changes.`
|
|
271989
272488
|
);
|
|
271990
272489
|
} else {
|
|
271991
272490
|
this.interaction.showText(
|
|
@@ -271997,7 +272496,7 @@ ${buildCommitContextForModel(diff)}`
|
|
|
271997
272496
|
}
|
|
271998
272497
|
} catch (commitError) {
|
|
271999
272498
|
this.interaction.showText(
|
|
272000
|
-
|
|
272499
|
+
picocolors22.red(
|
|
272001
272500
|
`\u2716 Auto-commit failed: ${safeAgentLoopErrorMessage(commitError)}`
|
|
272002
272501
|
)
|
|
272003
272502
|
);
|
|
@@ -272049,7 +272548,7 @@ ${buildCommitContextForModel(diff)}`
|
|
|
272049
272548
|
);
|
|
272050
272549
|
} catch (error) {
|
|
272051
272550
|
this.interaction.showText(
|
|
272052
|
-
|
|
272551
|
+
picocolors22.yellow(
|
|
272053
272552
|
`\u26A0\uFE0F Unable to persist final session status: ${safeAgentLoopErrorMessage(error)}`
|
|
272054
272553
|
)
|
|
272055
272554
|
);
|
|
@@ -272157,14 +272656,17 @@ ${buildCommitContextForModel(diff)}`
|
|
|
272157
272656
|
this.config.tools.bash.timeoutMs
|
|
272158
272657
|
);
|
|
272159
272658
|
}
|
|
272160
|
-
|
|
272161
|
-
|
|
272659
|
+
lifecycleHookConfig() {
|
|
272660
|
+
return this.options.profileHooks ? {
|
|
272162
272661
|
...this.config.hooks,
|
|
272163
272662
|
lifecycle: mergeLifecycleHooks(
|
|
272164
272663
|
this.options.profileHooks,
|
|
272165
272664
|
this.config.hooks.lifecycle
|
|
272166
272665
|
)
|
|
272167
272666
|
} : this.config.hooks;
|
|
272667
|
+
}
|
|
272668
|
+
async runLifecycleHooks(event, context) {
|
|
272669
|
+
const hooks = this.lifecycleHookConfig();
|
|
272168
272670
|
return executeLifecycleHooks({
|
|
272169
272671
|
hooks,
|
|
272170
272672
|
event,
|
|
@@ -272256,7 +272758,7 @@ ${buildCommitContextForModel(diff)}`
|
|
|
272256
272758
|
});
|
|
272257
272759
|
const sandboxed = sandboxInvocation(shell, {
|
|
272258
272760
|
cwd: extension?.root ?? this.cwd,
|
|
272259
|
-
mode: extension
|
|
272761
|
+
mode: resolveLifecycleHookSandboxMode(extension, this.config),
|
|
272260
272762
|
network: extension ? "deny" : this.config.tools.bash.network,
|
|
272261
272763
|
environment: childEnvironment,
|
|
272262
272764
|
trustRoots: this.config.security.windowsSandboxTrustRoots,
|
|
@@ -273067,7 +273569,7 @@ ${buildCommitContextForModel(diff)}`
|
|
|
273067
273569
|
}
|
|
273068
273570
|
if (this.options?.nonInteractive) return "abort";
|
|
273069
273571
|
this.interaction.showText(
|
|
273070
|
-
|
|
273572
|
+
picocolors22.yellow("\n\u25CF Execution interrupted by user.")
|
|
273071
273573
|
);
|
|
273072
273574
|
const choice = await this.askSelect("What would you like to do?", [
|
|
273073
273575
|
{ value: "continue", label: "Continue execution" },
|
|
@@ -273131,7 +273633,7 @@ ${buildCommitContextForModel(diff)}`
|
|
|
273131
273633
|
if (degraded) {
|
|
273132
273634
|
if (this.shouldShowDeepSeekCacheStatus(inputTokens, hitRate)) {
|
|
273133
273635
|
this.interaction.showText(
|
|
273134
|
-
|
|
273636
|
+
picocolors22.yellow(
|
|
273135
273637
|
`\u26A0 Prompt cache hit degraded for slab ${slab.hash.slice(0, 8)}: ${(hitRate * 100).toFixed(0)}% hit (${hitTokens}/${inputTokens} tokens).`
|
|
273136
273638
|
)
|
|
273137
273639
|
);
|
|
@@ -273213,17 +273715,6 @@ function selectProfileMcpServers(configured, selected) {
|
|
|
273213
273715
|
)
|
|
273214
273716
|
);
|
|
273215
273717
|
}
|
|
273216
|
-
function mergeLifecycleHooks(profile, global3) {
|
|
273217
|
-
const merged = {};
|
|
273218
|
-
for (const event of ORBIT_LIFECYCLE_HOOK_EVENTS) {
|
|
273219
|
-
const profileHooks = profile[event] ?? [];
|
|
273220
|
-
const globalHooks = global3?.[event] ?? [];
|
|
273221
|
-
if (profileHooks.length > 0 || globalHooks.length > 0) {
|
|
273222
|
-
merged[event] = [...profileHooks, ...globalHooks];
|
|
273223
|
-
}
|
|
273224
|
-
}
|
|
273225
|
-
return merged;
|
|
273226
|
-
}
|
|
273227
273718
|
function parseMcpSamplingMessages(value) {
|
|
273228
273719
|
if (!Array.isArray(value)) return [];
|
|
273229
273720
|
return value.slice(0, 32).flatMap((rawMessage, messageIndex) => {
|
|
@@ -274970,6 +275461,181 @@ function addRateFinding(findings, name, actual, allowed) {
|
|
|
274970
275461
|
function roundRate(value) {
|
|
274971
275462
|
return Number(value.toFixed(6));
|
|
274972
275463
|
}
|
|
275464
|
+
var ScriptedProviderTypeSchema = z152.enum([
|
|
275465
|
+
"openai",
|
|
275466
|
+
"anthropic",
|
|
275467
|
+
"openai-compatible",
|
|
275468
|
+
"anthropic-compatible",
|
|
275469
|
+
"deepseek",
|
|
275470
|
+
"ollama"
|
|
275471
|
+
]);
|
|
275472
|
+
var ScriptedFaultFields = {
|
|
275473
|
+
message: z152.string().trim().min(1).max(2e4),
|
|
275474
|
+
status: z152.number().int().min(100).max(599).optional(),
|
|
275475
|
+
code: z152.string().trim().min(1).max(120).optional(),
|
|
275476
|
+
retryable: z152.boolean().default(false)
|
|
275477
|
+
};
|
|
275478
|
+
var ScriptedActionSchema = z152.discriminatedUnion("type", [
|
|
275479
|
+
z152.object({ type: z152.literal("text_delta"), text: z152.string().max(2e5) }).strict(),
|
|
275480
|
+
z152.object({
|
|
275481
|
+
type: z152.literal("thinking_delta"),
|
|
275482
|
+
text: z152.string().max(2e5),
|
|
275483
|
+
signature: z152.string().max(2e4).optional()
|
|
275484
|
+
}).strict(),
|
|
275485
|
+
z152.object({
|
|
275486
|
+
type: z152.literal("tool_call"),
|
|
275487
|
+
id: z152.string().trim().min(1).max(200),
|
|
275488
|
+
name: z152.string().regex(/^[A-Za-z0-9_-]{1,64}$/),
|
|
275489
|
+
arguments: z152.union([z152.string().max(1e6), z152.record(z152.unknown())])
|
|
275490
|
+
}).strict(),
|
|
275491
|
+
z152.object({
|
|
275492
|
+
type: z152.literal("usage"),
|
|
275493
|
+
inputTokens: z152.number().int().nonnegative(),
|
|
275494
|
+
outputTokens: z152.number().int().nonnegative(),
|
|
275495
|
+
cacheReadTokens: z152.number().int().nonnegative().optional()
|
|
275496
|
+
}).strict(),
|
|
275497
|
+
z152.object({ type: z152.literal("done") }).strict(),
|
|
275498
|
+
z152.object({
|
|
275499
|
+
type: z152.literal("wait"),
|
|
275500
|
+
gate: z152.string().regex(/^[a-zA-Z0-9_-]{1,64}$/),
|
|
275501
|
+
honorAbort: z152.boolean().default(true)
|
|
275502
|
+
}).strict(),
|
|
275503
|
+
z152.object({ type: z152.literal("throw"), ...ScriptedFaultFields }).strict(),
|
|
275504
|
+
z152.object({ type: z152.literal("error_event"), ...ScriptedFaultFields }).strict()
|
|
275505
|
+
]);
|
|
275506
|
+
var ScriptedStepSchema = z152.object({
|
|
275507
|
+
id: z152.string().regex(/^[a-z0-9][a-z0-9_-]{0,63}$/),
|
|
275508
|
+
expect: z152.object({
|
|
275509
|
+
model: z152.string().trim().min(1).max(300).optional(),
|
|
275510
|
+
messageIncludes: z152.array(z152.string().min(1).max(2e4)).max(32).default([]),
|
|
275511
|
+
toolNames: z152.array(z152.string().regex(/^[A-Za-z0-9_-]{1,64}$/)).max(128).default([]),
|
|
275512
|
+
toolResults: z152.array(
|
|
275513
|
+
z152.object({
|
|
275514
|
+
toolCallId: z152.string().trim().min(1).max(200),
|
|
275515
|
+
name: z152.string().regex(/^[A-Za-z0-9_-]{1,64}$/),
|
|
275516
|
+
isError: z152.boolean(),
|
|
275517
|
+
contentIncludes: z152.array(z152.string().min(1).max(2e4)).max(32).default([])
|
|
275518
|
+
}).strict()
|
|
275519
|
+
).max(128).default([])
|
|
275520
|
+
}).strict().default({}),
|
|
275521
|
+
actions: z152.array(ScriptedActionSchema).min(1).max(256)
|
|
275522
|
+
}).strict();
|
|
275523
|
+
var ScriptedProviderScenarioSchema = z152.object({
|
|
275524
|
+
schemaVersion: z152.literal(1),
|
|
275525
|
+
id: z152.string().regex(/^[a-z0-9][a-z0-9_-]{0,63}$/),
|
|
275526
|
+
provider: z152.object({
|
|
275527
|
+
id: z152.string().trim().min(1).max(120).default("scripted-provider"),
|
|
275528
|
+
type: ScriptedProviderTypeSchema.default("openai-compatible")
|
|
275529
|
+
}).strict().default({}),
|
|
275530
|
+
steps: z152.array(ScriptedStepSchema).min(1).max(256).superRefine((steps, context) => {
|
|
275531
|
+
const seen = /* @__PURE__ */ new Set();
|
|
275532
|
+
steps.forEach((step, index) => {
|
|
275533
|
+
if (seen.has(step.id)) {
|
|
275534
|
+
context.addIssue({
|
|
275535
|
+
code: z152.ZodIssueCode.custom,
|
|
275536
|
+
path: [index, "id"],
|
|
275537
|
+
message: `Duplicate scripted provider step id: ${step.id}`
|
|
275538
|
+
});
|
|
275539
|
+
}
|
|
275540
|
+
seen.add(step.id);
|
|
275541
|
+
});
|
|
275542
|
+
})
|
|
275543
|
+
}).strict();
|
|
275544
|
+
var MAX_FIXTURE_BYTES = 4 * 1024 * 1024;
|
|
275545
|
+
var MAX_FILE_BYTES = 1e6;
|
|
275546
|
+
var WINDOWS_RESERVED_SEGMENT = /^(?:con|prn|aux|nul|com[1-9¹²³]|lpt[1-9¹²³])(?:\..*)?$/i;
|
|
275547
|
+
var PortableRelativePathSchema = z162.string().min(1).max(512).superRefine((value, context) => {
|
|
275548
|
+
const normalized = value.replaceAll("\\", "/");
|
|
275549
|
+
const segments = normalized.split("/");
|
|
275550
|
+
if (normalized.startsWith("/") || /^[A-Za-z]:\//.test(normalized) || segments.some(
|
|
275551
|
+
(segment) => segment === "" || segment === "." || segment === ".."
|
|
275552
|
+
)) {
|
|
275553
|
+
context.addIssue({
|
|
275554
|
+
code: z162.ZodIssueCode.custom,
|
|
275555
|
+
message: "Fixture file paths must be portable, workspace-relative paths without traversal."
|
|
275556
|
+
});
|
|
275557
|
+
}
|
|
275558
|
+
if (value !== value.trim() || /[\u0000-\u001f\u007f]/.test(value) || /[<>:"|?*]/.test(value) || segments.some(
|
|
275559
|
+
(segment) => Buffer.byteLength(segment, "utf8") > 255 || /[ .]$/.test(segment) || WINDOWS_RESERVED_SEGMENT.test(segment)
|
|
275560
|
+
)) {
|
|
275561
|
+
context.addIssue({
|
|
275562
|
+
code: z162.ZodIssueCode.custom,
|
|
275563
|
+
message: "Fixture file paths must be portable across Windows, macOS, and Linux."
|
|
275564
|
+
});
|
|
275565
|
+
}
|
|
275566
|
+
}).transform((value) => value.replaceAll("\\", "/"));
|
|
275567
|
+
var OfflineWorkspaceFileSchema = z162.object({
|
|
275568
|
+
path: PortableRelativePathSchema,
|
|
275569
|
+
content: z162.string().max(MAX_FILE_BYTES).refine((value) => Buffer.byteLength(value, "utf8") <= MAX_FILE_BYTES, {
|
|
275570
|
+
message: `Fixture file exceeds ${MAX_FILE_BYTES} UTF-8 bytes.`
|
|
275571
|
+
})
|
|
275572
|
+
}).strict();
|
|
275573
|
+
var OfflineAgentFixtureSchema = z162.object({
|
|
275574
|
+
schemaVersion: z162.literal(1),
|
|
275575
|
+
id: z162.string().regex(/^[a-z0-9][a-z0-9_-]{0,63}$/),
|
|
275576
|
+
prompt: z162.string().trim().min(1).max(2e4),
|
|
275577
|
+
workspace: z162.object({
|
|
275578
|
+
files: z162.array(OfflineWorkspaceFileSchema).max(64).default([])
|
|
275579
|
+
}).strict().default({}),
|
|
275580
|
+
providerScenario: ScriptedProviderScenarioSchema,
|
|
275581
|
+
expected: z162.object({
|
|
275582
|
+
status: z162.enum(["completed", "failed", "aborted"]),
|
|
275583
|
+
transcriptIncludes: z162.array(z162.string().min(1).max(2e4)).max(32).default([]),
|
|
275584
|
+
maxAttempts: z162.number().int().positive().max(100).optional()
|
|
275585
|
+
}).strict()
|
|
275586
|
+
}).strict().superRefine((fixture, context) => {
|
|
275587
|
+
fixture.providerScenario.steps.forEach((step, stepIndex) => {
|
|
275588
|
+
step.actions.forEach((action, actionIndex) => {
|
|
275589
|
+
if (action.type === "wait") {
|
|
275590
|
+
context.addIssue({
|
|
275591
|
+
code: z162.ZodIssueCode.custom,
|
|
275592
|
+
path: [
|
|
275593
|
+
"providerScenario",
|
|
275594
|
+
"steps",
|
|
275595
|
+
stepIndex,
|
|
275596
|
+
"actions",
|
|
275597
|
+
actionIndex
|
|
275598
|
+
],
|
|
275599
|
+
message: "Catalog fixtures cannot contain unreleased wait gates; use a controller-driven provider test for races."
|
|
275600
|
+
});
|
|
275601
|
+
}
|
|
275602
|
+
});
|
|
275603
|
+
});
|
|
275604
|
+
const paths = /* @__PURE__ */ new Set();
|
|
275605
|
+
let totalBytes = 0;
|
|
275606
|
+
fixture.workspace.files.forEach((file, index) => {
|
|
275607
|
+
const key = file.path.replaceAll("\\", "/").toLowerCase();
|
|
275608
|
+
if (paths.has(key)) {
|
|
275609
|
+
context.addIssue({
|
|
275610
|
+
code: z162.ZodIssueCode.custom,
|
|
275611
|
+
path: ["workspace", "files", index, "path"],
|
|
275612
|
+
message: `Duplicate portable fixture path: ${file.path}`
|
|
275613
|
+
});
|
|
275614
|
+
}
|
|
275615
|
+
paths.add(key);
|
|
275616
|
+
totalBytes += Buffer.byteLength(file.content, "utf8");
|
|
275617
|
+
});
|
|
275618
|
+
fixture.workspace.files.forEach((file, index) => {
|
|
275619
|
+
const segments = file.path.toLowerCase().split("/");
|
|
275620
|
+
for (let end = 1; end < segments.length; end += 1) {
|
|
275621
|
+
if (paths.has(segments.slice(0, end).join("/"))) {
|
|
275622
|
+
context.addIssue({
|
|
275623
|
+
code: z162.ZodIssueCode.custom,
|
|
275624
|
+
path: ["workspace", "files", index, "path"],
|
|
275625
|
+
message: `Fixture path has a file as its parent directory: ${file.path}`
|
|
275626
|
+
});
|
|
275627
|
+
break;
|
|
275628
|
+
}
|
|
275629
|
+
}
|
|
275630
|
+
});
|
|
275631
|
+
if (totalBytes > MAX_FIXTURE_BYTES) {
|
|
275632
|
+
context.addIssue({
|
|
275633
|
+
code: z162.ZodIssueCode.custom,
|
|
275634
|
+
path: ["workspace", "files"],
|
|
275635
|
+
message: `Fixture workspace exceeds ${MAX_FIXTURE_BYTES} bytes.`
|
|
275636
|
+
});
|
|
275637
|
+
}
|
|
275638
|
+
});
|
|
274973
275639
|
function getAutocompleteProvider(providerId, config) {
|
|
274974
275640
|
const providerConfig = config.providers?.[providerId];
|
|
274975
275641
|
if (!providerConfig) {
|
|
@@ -275990,7 +276656,7 @@ var DoctorSnapshotSchema = z49.object({
|
|
|
275990
276656
|
projectExecutablesTrusted: z49.boolean()
|
|
275991
276657
|
}),
|
|
275992
276658
|
capabilityBoundaries: z49.object({
|
|
275993
|
-
workspaceBoundary: z49.
|
|
276659
|
+
workspaceBoundary: z49.boolean(),
|
|
275994
276660
|
worktreeIsolation: z49.literal(true),
|
|
275995
276661
|
osSandbox: z49.boolean(),
|
|
275996
276662
|
networkIsolation: z49.boolean(),
|
|
@@ -276120,11 +276786,14 @@ function buildDoctorSnapshot(cwd, config = ConfigLoader.loadSync(cwd), options =
|
|
|
276120
276786
|
(diagnostic2) => diagnostic2.severity === "error"
|
|
276121
276787
|
);
|
|
276122
276788
|
const sandboxCapabilities = detectProcessSandbox({
|
|
276789
|
+
platform: options.sandboxPlatform,
|
|
276123
276790
|
environment: options.env ?? process.env,
|
|
276124
276791
|
trustRoots: config.security.windowsSandboxTrustRoots
|
|
276125
276792
|
});
|
|
276126
|
-
const
|
|
276793
|
+
const fullAccess = isFullAccessEnabled(config);
|
|
276794
|
+
const sandboxMode = fullAccess ? "off" : config.tools.bash.sandbox;
|
|
276127
276795
|
const sandboxNetwork = config.tools.bash.network;
|
|
276796
|
+
const sandboxReason = fullAccess ? "OS process sandboxing is disabled while unrestricted Full Access is active." : sandboxCapabilities.reason ?? null;
|
|
276128
276797
|
if (profileErrors.length > 0) {
|
|
276129
276798
|
issues.push({
|
|
276130
276799
|
severity: "error",
|
|
@@ -276205,6 +276874,14 @@ function buildDoctorSnapshot(cwd, config = ConfigLoader.loadSync(cwd), options =
|
|
|
276205
276874
|
remediation: "Check the endpoint, credential, model name, proxy, and network access."
|
|
276206
276875
|
});
|
|
276207
276876
|
}
|
|
276877
|
+
if (sandboxMode === "required" && !sandboxCapabilities.native) {
|
|
276878
|
+
issues.push({
|
|
276879
|
+
severity: "error",
|
|
276880
|
+
code: "sandbox.required_unavailable",
|
|
276881
|
+
message: `Required OS process sandboxing is unavailable: ${sandboxCapabilities.reason ?? "no native backend"}`,
|
|
276882
|
+
remediation: process.platform === "win32" ? "Install and configure the signed Windows AppContainer helper contract, or change tools.bash.sandbox only after reviewing the isolation requirement." : "Install a supported native sandbox backend, or change tools.bash.sandbox only after reviewing the isolation requirement."
|
|
276883
|
+
});
|
|
276884
|
+
}
|
|
276208
276885
|
const status = issues.some((issue) => issue.severity === "error") ? "error" : issues.length > 0 ? "warning" : "ok";
|
|
276209
276886
|
const probe = options.providerProbeText ? redactSecrets(stripAnsi(options.providerProbeText)).slice(0, 2e3) : null;
|
|
276210
276887
|
return DoctorSnapshotSchema.parse({
|
|
@@ -276259,7 +276936,7 @@ function buildDoctorSnapshot(cwd, config = ConfigLoader.loadSync(cwd), options =
|
|
|
276259
276936
|
projectExecutablesTrusted: config.security.trustProjectExecutables
|
|
276260
276937
|
},
|
|
276261
276938
|
capabilityBoundaries: {
|
|
276262
|
-
workspaceBoundary:
|
|
276939
|
+
workspaceBoundary: !fullAccess,
|
|
276263
276940
|
worktreeIsolation: true,
|
|
276264
276941
|
osSandbox: sandboxMode !== "off" && sandboxCapabilities.native,
|
|
276265
276942
|
networkIsolation: sandboxMode !== "off" && sandboxNetwork === "deny" && sandboxCapabilities.networkIsolation,
|
|
@@ -276268,7 +276945,7 @@ function buildDoctorSnapshot(cwd, config = ConfigLoader.loadSync(cwd), options =
|
|
|
276268
276945
|
sandboxHelperKeyId: sandboxCapabilities.helperKeyId ?? null,
|
|
276269
276946
|
sandboxMode,
|
|
276270
276947
|
sandboxNetwork,
|
|
276271
|
-
sandboxReason
|
|
276948
|
+
sandboxReason,
|
|
276272
276949
|
// This reports capability availability, not whether a daemon process is
|
|
276273
276950
|
// currently running. `orbit daemon status` is the authoritative liveness
|
|
276274
276951
|
// check and must not be hidden inside a synchronous doctor snapshot.
|
|
@@ -276401,11 +277078,14 @@ function buildDoctorReport(cwd, config = ConfigLoader.loadSync(cwd), options = {
|
|
|
276401
277078
|
const searxngConfigured = webSearch.searxngUrls.length > 0 || Boolean(env.ORBIT_SEARXNG_URL || env.SEARXNG_URL);
|
|
276402
277079
|
const isDeepSeekProfile = providerLooksLikeDeepSeek(defaultProvider, config);
|
|
276403
277080
|
const sandboxCapabilities = detectProcessSandbox({
|
|
277081
|
+
platform: options.sandboxPlatform,
|
|
276404
277082
|
environment: env,
|
|
276405
277083
|
trustRoots: config.security.windowsSandboxTrustRoots
|
|
276406
277084
|
});
|
|
276407
|
-
const
|
|
277085
|
+
const fullAccess = isFullAccessEnabled(config);
|
|
277086
|
+
const sandboxMode = fullAccess ? "off" : config.tools.bash.sandbox;
|
|
276408
277087
|
const sandboxNetwork = config.tools.bash.network;
|
|
277088
|
+
const sandboxReason = fullAccess ? "disabled while unrestricted Full Access is active" : sandboxCapabilities.reason ?? "workspace/worktree boundaries remain active";
|
|
276409
277089
|
lines.push(picocolors6.bold("Orbit Diagnostics"));
|
|
276410
277090
|
lines.push("");
|
|
276411
277091
|
lines.push(picocolors6.bold("Runtime"));
|
|
@@ -276552,7 +277232,7 @@ function buildDoctorReport(cwd, config = ConfigLoader.loadSync(cwd), options = {
|
|
|
276552
277232
|
sandboxCapabilities.native && sandboxMode !== "off" ? picocolors6.green(
|
|
276553
277233
|
`\u2714 OS process sandbox: ${sandboxCapabilities.selectedBackend} \xB7 network=${sandboxNetwork} \xB7 mode=${sandboxMode}`
|
|
276554
277234
|
) : picocolors6.yellow(
|
|
276555
|
-
`\u26A0\uFE0F OS process sandbox: ${sandboxMode === "off" ? "disabled by configuration" : "unavailable"} \xB7 ${
|
|
277235
|
+
`\u26A0\uFE0F OS process sandbox: ${sandboxMode === "off" ? fullAccess ? "disabled by Full Access" : "disabled by configuration" : "unavailable"} \xB7 ${sandboxReason}`
|
|
276556
277236
|
)
|
|
276557
277237
|
);
|
|
276558
277238
|
lines.push(
|
|
@@ -278410,7 +279090,7 @@ ${r2}
|
|
|
278410
279090
|
}).prompt();
|
|
278411
279091
|
|
|
278412
279092
|
// ../tui/dist/index.js
|
|
278413
|
-
import
|
|
279093
|
+
import picocolors23 from "picocolors";
|
|
278414
279094
|
import readline from "readline";
|
|
278415
279095
|
import picocolors32 from "picocolors";
|
|
278416
279096
|
var DiffView = class {
|
|
@@ -278792,7 +279472,7 @@ var Prompt = class {
|
|
|
278792
279472
|
}
|
|
278793
279473
|
return this.wrapPrompt(async () => {
|
|
278794
279474
|
const response = await confirm({
|
|
278795
|
-
message: `${
|
|
279475
|
+
message: `${picocolors23.yellow(message2)} Approve?`
|
|
278796
279476
|
});
|
|
278797
279477
|
if (isCancel(response)) return false;
|
|
278798
279478
|
return !!response;
|
|
@@ -278821,7 +279501,7 @@ var Prompt = class {
|
|
|
278821
279501
|
static async askTextWithAutocomplete(message2, completerFn, promptPrefix) {
|
|
278822
279502
|
if (this.screenReaderMode) return this.askPlainLine(message2);
|
|
278823
279503
|
return new Promise((resolve38) => {
|
|
278824
|
-
const promptStr = promptPrefix !== void 0 ? promptPrefix : `${
|
|
279504
|
+
const promptStr = promptPrefix !== void 0 ? promptPrefix : `${picocolors23.cyan("?")} ${message2} \u203A `;
|
|
278825
279505
|
const rl = readline.createInterface({
|
|
278826
279506
|
input: process.stdin,
|
|
278827
279507
|
output: process.stdout,
|
|
@@ -278846,7 +279526,7 @@ var Prompt = class {
|
|
|
278846
279526
|
clearSuggestions();
|
|
278847
279527
|
if (hits.length === 0) return;
|
|
278848
279528
|
const suggestionText = ` Suggestions: ${hits.slice(0, 6).join(" | ")}${hits.length > 6 ? " ..." : ""}`;
|
|
278849
|
-
process.stdout.write("\n\x1B[K" +
|
|
279529
|
+
process.stdout.write("\n\x1B[K" + picocolors23.gray(suggestionText));
|
|
278850
279530
|
readline.moveCursor(process.stdout, 0, -1);
|
|
278851
279531
|
const visiblePromptLen = promptStr.replace(
|
|
278852
279532
|
/\x1b\[[0-9;]*[a-zA-Z]/g,
|
|
@@ -278876,7 +279556,7 @@ var Prompt = class {
|
|
|
278876
279556
|
}
|
|
278877
279557
|
process.stdout.write("\x1B[K");
|
|
278878
279558
|
if (currentSuggestion) {
|
|
278879
|
-
process.stdout.write(
|
|
279559
|
+
process.stdout.write(picocolors23.dim(currentSuggestion));
|
|
278880
279560
|
readline.moveCursor(process.stdout, -currentSuggestion.length, 0);
|
|
278881
279561
|
}
|
|
278882
279562
|
}
|
|
@@ -308343,14 +309023,14 @@ async function runLogin(options = {}) {
|
|
|
308343
309023
|
}
|
|
308344
309024
|
|
|
308345
309025
|
// src/commands/mcp.ts
|
|
308346
|
-
import
|
|
309026
|
+
import picocolors24 from "picocolors";
|
|
308347
309027
|
async function runMcpLogin(serverName, options = {}) {
|
|
308348
309028
|
const cwd = options.cwd ?? process.cwd();
|
|
308349
309029
|
const config = ConfigLoader.loadSync(cwd);
|
|
308350
309030
|
const serverConfig = config.mcpServers?.[serverName];
|
|
308351
309031
|
if (!serverConfig) {
|
|
308352
309032
|
console.error(
|
|
308353
|
-
|
|
309033
|
+
picocolors24.red(
|
|
308354
309034
|
`\u2716 Unknown MCP server "${serverName}". Configure it under mcpServers first.`
|
|
308355
309035
|
)
|
|
308356
309036
|
);
|
|
@@ -308359,7 +309039,7 @@ async function runMcpLogin(serverName, options = {}) {
|
|
|
308359
309039
|
const oauth = serverConfig.oauth;
|
|
308360
309040
|
if (!oauth || oauth.mode !== "authorization_code") {
|
|
308361
309041
|
console.error(
|
|
308362
|
-
|
|
309042
|
+
picocolors24.red(
|
|
308363
309043
|
`\u2716 MCP server "${serverName}" is not configured for authorization_code OAuth. Set mcpServers.${serverName}.oauth.mode to "authorization_code" and provide authorizationUrl.`
|
|
308364
309044
|
)
|
|
308365
309045
|
);
|
|
@@ -308381,7 +309061,7 @@ async function runMcpLogin(serverName, options = {}) {
|
|
|
308381
309061
|
});
|
|
308382
309062
|
if (!result.refreshToken) {
|
|
308383
309063
|
console.error(
|
|
308384
|
-
|
|
309064
|
+
picocolors24.yellow(
|
|
308385
309065
|
"\u26A0 The authorization server returned no refresh token. Access will expire and require another login; ask the server operator to enable refresh tokens (offline_access scope)."
|
|
308386
309066
|
)
|
|
308387
309067
|
);
|
|
@@ -308389,14 +309069,14 @@ async function runMcpLogin(serverName, options = {}) {
|
|
|
308389
309069
|
}
|
|
308390
309070
|
await createMcpTokenStore(serverName).setRefreshToken(result.refreshToken);
|
|
308391
309071
|
console.log(
|
|
308392
|
-
|
|
309072
|
+
picocolors24.green(
|
|
308393
309073
|
`\u2714 Login for MCP server "${serverName}" saved. Tokens refresh automatically from now on.`
|
|
308394
309074
|
)
|
|
308395
309075
|
);
|
|
308396
309076
|
return 0;
|
|
308397
309077
|
} catch (error) {
|
|
308398
309078
|
console.error(
|
|
308399
|
-
|
|
309079
|
+
picocolors24.red(
|
|
308400
309080
|
`\u2716 MCP login failed: ${error instanceof Error ? error.message : String(error)}`
|
|
308401
309081
|
)
|
|
308402
309082
|
);
|
|
@@ -308405,7 +309085,7 @@ async function runMcpLogin(serverName, options = {}) {
|
|
|
308405
309085
|
}
|
|
308406
309086
|
|
|
308407
309087
|
// src/commands/skills.ts
|
|
308408
|
-
import
|
|
309088
|
+
import picocolors25 from "picocolors";
|
|
308409
309089
|
import { z as z78 } from "zod";
|
|
308410
309090
|
var SkillDirectoryOverrideSchema = z78.array(z78.string().trim().min(1).max(4096)).min(1).max(50);
|
|
308411
309091
|
async function runSkillsCommand(action, options = {}) {
|
|
@@ -308430,7 +309110,7 @@ async function runSkillsCommand(action, options = {}) {
|
|
|
308430
309110
|
})
|
|
308431
309111
|
);
|
|
308432
309112
|
} else {
|
|
308433
|
-
console.error(
|
|
309113
|
+
console.error(picocolors25.red(`\u2716 Invalid Skill directory: ${message2}`));
|
|
308434
309114
|
}
|
|
308435
309115
|
return 1;
|
|
308436
309116
|
}
|
|
@@ -308494,28 +309174,28 @@ async function runSkillsCommand(action, options = {}) {
|
|
|
308494
309174
|
skill.truncated ? "truncated" : ""
|
|
308495
309175
|
].filter(Boolean).join(", ");
|
|
308496
309176
|
console.log(
|
|
308497
|
-
`${
|
|
309177
|
+
`${picocolors25.green(`$${skill.name}`)}${flags ? picocolors25.gray(` (${flags})`) : ""}`
|
|
308498
309178
|
);
|
|
308499
309179
|
console.log(` ${skill.shortDescription || skill.description}`);
|
|
308500
|
-
console.log(
|
|
309180
|
+
console.log(picocolors25.gray(` ${skill.path}`));
|
|
308501
309181
|
}
|
|
308502
309182
|
if (catalog.diagnostics.length > 0) {
|
|
308503
309183
|
console.log("");
|
|
308504
309184
|
for (const diagnostic2 of catalog.diagnostics) {
|
|
308505
|
-
const paint = diagnostic2.severity === "error" ?
|
|
309185
|
+
const paint = diagnostic2.severity === "error" ? picocolors25.red : picocolors25.yellow;
|
|
308506
309186
|
console.log(
|
|
308507
309187
|
`${paint(diagnostic2.severity)} [${diagnostic2.code}] ${diagnostic2.message}`
|
|
308508
309188
|
);
|
|
308509
|
-
console.log(
|
|
309189
|
+
console.log(picocolors25.gray(` ${diagnostic2.path}`));
|
|
308510
309190
|
}
|
|
308511
309191
|
}
|
|
308512
309192
|
if (action === "validate") {
|
|
308513
309193
|
if (errors.length > 0) {
|
|
308514
|
-
console.error(
|
|
309194
|
+
console.error(picocolors25.red(`\u2716 ${errors.length} skill error(s) found.`));
|
|
308515
309195
|
return 1;
|
|
308516
309196
|
}
|
|
308517
309197
|
console.log(
|
|
308518
|
-
|
|
309198
|
+
picocolors25.green(
|
|
308519
309199
|
`\u2714 ${catalog.skills.length} skill(s) valid${options.deep ? " (deep bundle checks)" : ""}` + (catalog.diagnostics.length ? ` (${catalog.diagnostics.length} warning(s))` : "")
|
|
308520
309200
|
)
|
|
308521
309201
|
);
|
|
@@ -308524,7 +309204,7 @@ async function runSkillsCommand(action, options = {}) {
|
|
|
308524
309204
|
}
|
|
308525
309205
|
|
|
308526
309206
|
// src/commands/agents.ts
|
|
308527
|
-
import
|
|
309207
|
+
import picocolors26 from "picocolors";
|
|
308528
309208
|
function runAgentsCommand(action, options = {}) {
|
|
308529
309209
|
const cwd = options.cwd ?? process.cwd();
|
|
308530
309210
|
const config = ConfigLoader.loadSync(cwd);
|
|
@@ -308586,34 +309266,34 @@ function runAgentsCommand(action, options = {}) {
|
|
|
308586
309266
|
const parent = profile.extends ? ` \xB7 extends=${profile.extends}` : "";
|
|
308587
309267
|
const mcp = profile.mcpServers ? ` \xB7 mcp=${profile.mcpServers.length}` : "";
|
|
308588
309268
|
console.log(
|
|
308589
|
-
`${
|
|
309269
|
+
`${picocolors26.green(profile.name)}${picocolors26.gray(`${model}${mode}${effort}${parent}${mcp}`)}`
|
|
308590
309270
|
);
|
|
308591
309271
|
if (profile.description) console.log(` ${profile.description}`);
|
|
308592
|
-
console.log(
|
|
309272
|
+
console.log(picocolors26.gray(` ${profile.source} \xB7 ${profile.path}`));
|
|
308593
309273
|
}
|
|
308594
309274
|
for (const diagnostic2 of catalog.diagnostics) {
|
|
308595
|
-
const paint = diagnostic2.severity === "error" ?
|
|
309275
|
+
const paint = diagnostic2.severity === "error" ? picocolors26.red : picocolors26.yellow;
|
|
308596
309276
|
console.log(
|
|
308597
309277
|
`${paint(diagnostic2.severity)} [${diagnostic2.code}] ${diagnostic2.message}`
|
|
308598
309278
|
);
|
|
308599
|
-
console.log(
|
|
309279
|
+
console.log(picocolors26.gray(` ${diagnostic2.path}`));
|
|
308600
309280
|
}
|
|
308601
309281
|
if (action === "validate") {
|
|
308602
309282
|
if (errors.length > 0) {
|
|
308603
309283
|
console.error(
|
|
308604
|
-
|
|
309284
|
+
picocolors26.red(`\u2716 ${errors.length} Agent Profile error(s) found.`)
|
|
308605
309285
|
);
|
|
308606
309286
|
return 1;
|
|
308607
309287
|
}
|
|
308608
309288
|
console.log(
|
|
308609
|
-
|
|
309289
|
+
picocolors26.green(`\u2714 ${catalog.profiles.length} Agent Profile(s) valid.`)
|
|
308610
309290
|
);
|
|
308611
309291
|
}
|
|
308612
309292
|
return 0;
|
|
308613
309293
|
}
|
|
308614
309294
|
|
|
308615
309295
|
// src/commands/runs.ts
|
|
308616
|
-
import
|
|
309296
|
+
import picocolors27 from "picocolors";
|
|
308617
309297
|
function runRunsCommand(action, runId, options = {}) {
|
|
308618
309298
|
const cwd = options.cwd ?? process.cwd();
|
|
308619
309299
|
const store = new AgentRunStore(cwd);
|
|
@@ -308651,15 +309331,15 @@ function emitRunList(runs, json, limit) {
|
|
|
308651
309331
|
console.log("No durable Agent runs found.");
|
|
308652
309332
|
return;
|
|
308653
309333
|
}
|
|
308654
|
-
console.log(
|
|
309334
|
+
console.log(picocolors27.bold(`
|
|
308655
309335
|
Agent runs (${runs.length})
|
|
308656
309336
|
`));
|
|
308657
309337
|
for (const summary of summaries) {
|
|
308658
309338
|
console.log(
|
|
308659
|
-
`${statusColor(summary.status)(summary.status)} ${
|
|
309339
|
+
`${statusColor(summary.status)(summary.status)} ${picocolors27.cyan(summary.id)} ${summary.agentCount} agent(s) \xB7 ${formatCost(summary.costUsd)} / ${formatCost(summary.budgetUsd)}`
|
|
308660
309340
|
);
|
|
308661
309341
|
console.log(` ${summary.task}`);
|
|
308662
|
-
console.log(
|
|
309342
|
+
console.log(picocolors27.gray(` updated ${summary.updatedAt}`));
|
|
308663
309343
|
}
|
|
308664
309344
|
}
|
|
308665
309345
|
function emitInspection(run, json) {
|
|
@@ -308697,7 +309377,7 @@ function emitInspection(run, json) {
|
|
|
308697
309377
|
console.log(JSON.stringify(view, null, 2));
|
|
308698
309378
|
return;
|
|
308699
309379
|
}
|
|
308700
|
-
console.log(
|
|
309380
|
+
console.log(picocolors27.bold(`
|
|
308701
309381
|
${view.id}
|
|
308702
309382
|
`));
|
|
308703
309383
|
console.log(` Status: ${statusColor(view.status)(view.status)}`);
|
|
@@ -308708,7 +309388,7 @@ ${view.id}
|
|
|
308708
309388
|
console.log(` Updated: ${view.updatedAt}`);
|
|
308709
309389
|
if (view.owner) {
|
|
308710
309390
|
console.log(
|
|
308711
|
-
|
|
309391
|
+
picocolors27.gray(
|
|
308712
309392
|
` Lease: ${view.owner.active ? "active" : "expired"} \xB7 expires ${view.owner.expiresAt}`
|
|
308713
309393
|
)
|
|
308714
309394
|
);
|
|
@@ -308722,8 +309402,8 @@ ${view.id}
|
|
|
308722
309402
|
console.log(
|
|
308723
309403
|
` ${statusColor(agent.status)(agent.status)} ${agent.id} \xB7 ${agent.role} \xB7 ${agent.model}`
|
|
308724
309404
|
);
|
|
308725
|
-
console.log(
|
|
308726
|
-
if (agent.error) console.log(
|
|
309405
|
+
console.log(picocolors27.gray(` ${agent.task}`));
|
|
309406
|
+
if (agent.error) console.log(picocolors27.red(` ${agent.error}`));
|
|
308727
309407
|
}
|
|
308728
309408
|
}
|
|
308729
309409
|
function emitRecovery(recovered, json) {
|
|
@@ -308732,10 +309412,10 @@ function emitRecovery(recovered, json) {
|
|
|
308732
309412
|
return;
|
|
308733
309413
|
}
|
|
308734
309414
|
if (recovered === 0) {
|
|
308735
|
-
console.log(
|
|
309415
|
+
console.log(picocolors27.green("\u2714 No expired Agent run leases found."));
|
|
308736
309416
|
} else {
|
|
308737
309417
|
console.log(
|
|
308738
|
-
|
|
309418
|
+
picocolors27.yellow(
|
|
308739
309419
|
`\u26A0 Recovered ${recovered} interrupted Agent run(s). Child sessions remain available for explicit inspection/resume.`
|
|
308740
309420
|
)
|
|
308741
309421
|
);
|
|
@@ -308746,7 +309426,7 @@ function emitError(message2, options) {
|
|
|
308746
309426
|
if (options.json) {
|
|
308747
309427
|
console.log(JSON.stringify({ schemaVersion: 1, error: safe }));
|
|
308748
309428
|
} else {
|
|
308749
|
-
console.error(
|
|
309429
|
+
console.error(picocolors27.red(`\u2716 ${safe}`));
|
|
308750
309430
|
}
|
|
308751
309431
|
return 1;
|
|
308752
309432
|
}
|
|
@@ -308780,17 +309460,17 @@ function formatCost(value) {
|
|
|
308780
309460
|
return `$${value.toFixed(4)}`;
|
|
308781
309461
|
}
|
|
308782
309462
|
function statusColor(status) {
|
|
308783
|
-
if (status === "completed") return
|
|
308784
|
-
if (status === "failed" || status === "aborted") return
|
|
308785
|
-
if (status === "running") return
|
|
308786
|
-
return
|
|
309463
|
+
if (status === "completed") return picocolors27.green;
|
|
309464
|
+
if (status === "failed" || status === "aborted") return picocolors27.red;
|
|
309465
|
+
if (status === "running") return picocolors27.cyan;
|
|
309466
|
+
return picocolors27.yellow;
|
|
308787
309467
|
}
|
|
308788
309468
|
function errorMessage4(error) {
|
|
308789
309469
|
return error instanceof Error ? error.message : String(error);
|
|
308790
309470
|
}
|
|
308791
309471
|
|
|
308792
309472
|
// src/commands/acp.ts
|
|
308793
|
-
import
|
|
309473
|
+
import picocolors28 from "picocolors";
|
|
308794
309474
|
import { createHash as createHash14 } from "crypto";
|
|
308795
309475
|
import { dirname as dirname15 } from "path";
|
|
308796
309476
|
import { existsSync as existsSync29, mkdirSync as mkdirSync8 } from "fs";
|
|
@@ -313520,13 +314200,13 @@ function runAcpRegistryCommand(action, options = {}) {
|
|
|
313520
314200
|
if (options.json) console.log(JSON.stringify(result2, null, 2));
|
|
313521
314201
|
else if (result2.ok)
|
|
313522
314202
|
console.log(
|
|
313523
|
-
|
|
314203
|
+
picocolors28.green(
|
|
313524
314204
|
`\u2714 ACP registry valid (${result2.entries} ${result2.entries === 1 ? "entry" : "entries"}).`
|
|
313525
314205
|
)
|
|
313526
314206
|
);
|
|
313527
314207
|
else {
|
|
313528
314208
|
console.error(
|
|
313529
|
-
|
|
314209
|
+
picocolors28.red(`\u2716 ACP registry has ${invalid.length} invalid file(s).`)
|
|
313530
314210
|
);
|
|
313531
314211
|
for (const item of invalid)
|
|
313532
314212
|
console.error(` ${item.scope}: ${item.path} \xB7 ${item.error}`);
|
|
@@ -313553,28 +314233,28 @@ function runAcpRegistryCommand(action, options = {}) {
|
|
|
313553
314233
|
console.log("No local ACP registry entries discovered.");
|
|
313554
314234
|
for (const item of invalid)
|
|
313555
314235
|
console.error(
|
|
313556
|
-
|
|
314236
|
+
picocolors28.yellow(`\u26A0 ${item.scope}: ${item.path} \xB7 ${item.error}`)
|
|
313557
314237
|
);
|
|
313558
314238
|
} else {
|
|
313559
314239
|
console.log(
|
|
313560
|
-
|
|
314240
|
+
picocolors28.bold(`
|
|
313561
314241
|
Local ACP registry (${result.entries.length})
|
|
313562
314242
|
`)
|
|
313563
314243
|
);
|
|
313564
314244
|
for (const entry of result.entries) {
|
|
313565
|
-
const state = entry.enabled ?
|
|
313566
|
-
const trust = entry.trust === "trusted" ?
|
|
313567
|
-
const signature = entry.signatureStatus === "valid" ?
|
|
314245
|
+
const state = entry.enabled ? picocolors28.green("enabled") : picocolors28.gray("disabled");
|
|
314246
|
+
const trust = entry.trust === "trusted" ? picocolors28.green("trusted") : picocolors28.yellow("untrusted");
|
|
314247
|
+
const signature = entry.signatureStatus === "valid" ? picocolors28.green("signed") : picocolors28.gray("unsigned");
|
|
313568
314248
|
console.log(
|
|
313569
|
-
`${
|
|
314249
|
+
`${picocolors28.cyan(entry.id)} \xB7 ${state} \xB7 ${trust} \xB7 ${signature} \xB7 ${entry.title}`
|
|
313570
314250
|
);
|
|
313571
314251
|
console.log(
|
|
313572
|
-
|
|
314252
|
+
picocolors28.gray(` ${entry.scope} \xB7 ${entry.command} \xB7 ${entry.path}`)
|
|
313573
314253
|
);
|
|
313574
314254
|
}
|
|
313575
314255
|
for (const item of invalid)
|
|
313576
314256
|
console.error(
|
|
313577
|
-
|
|
314257
|
+
picocolors28.yellow(`\u26A0 ${item.scope}: ${item.path} \xB7 ${item.error}`)
|
|
313578
314258
|
);
|
|
313579
314259
|
}
|
|
313580
314260
|
return 0;
|
|
@@ -313625,11 +314305,11 @@ async function runAcpRegistryFetchCommand(options = {}) {
|
|
|
313625
314305
|
else {
|
|
313626
314306
|
const state = fetched.notModified ? "unchanged" : "updated";
|
|
313627
314307
|
console.log(
|
|
313628
|
-
|
|
314308
|
+
picocolors28.green(
|
|
313629
314309
|
`\u2714 Hosted ACP registry ${state}: ${fetched.metadata.registryId} r${fetched.metadata.revision} (${fetched.signatureStatus}).`
|
|
313630
314310
|
)
|
|
313631
314311
|
);
|
|
313632
|
-
console.log(
|
|
314312
|
+
console.log(picocolors28.gray(` ${outputPath} \xB7 ${fetched.digest}`));
|
|
313633
314313
|
}
|
|
313634
314314
|
return 0;
|
|
313635
314315
|
} catch (error) {
|
|
@@ -313673,17 +314353,17 @@ async function runAcpCommand(action, agentId, prompt, options = {}) {
|
|
|
313673
314353
|
console.log("No ACP external agents configured.");
|
|
313674
314354
|
else {
|
|
313675
314355
|
console.log(
|
|
313676
|
-
|
|
314356
|
+
picocolors28.bold(`
|
|
313677
314357
|
ACP external agents (${entries.length})
|
|
313678
314358
|
`)
|
|
313679
314359
|
);
|
|
313680
314360
|
for (const entry of entries) {
|
|
313681
|
-
const state = entry.enabled ?
|
|
314361
|
+
const state = entry.enabled ? picocolors28.green("enabled") : picocolors28.gray("disabled");
|
|
313682
314362
|
console.log(
|
|
313683
|
-
`${
|
|
314363
|
+
`${picocolors28.cyan(entry.id)} \xB7 ${state} \xB7 ${entry.command}`
|
|
313684
314364
|
);
|
|
313685
314365
|
console.log(
|
|
313686
|
-
|
|
314366
|
+
picocolors28.gray(
|
|
313687
314367
|
` timeout ${entry.requestTimeoutMs}ms \xB7 permission ${entry.permissionPolicy}`
|
|
313688
314368
|
)
|
|
313689
314369
|
);
|
|
@@ -313712,7 +314392,7 @@ ACP external agents (${entries.length})
|
|
|
313712
314392
|
);
|
|
313713
314393
|
} else {
|
|
313714
314394
|
console.log(
|
|
313715
|
-
|
|
314395
|
+
picocolors28.green(
|
|
313716
314396
|
`\u2714 Closed ACP session ${result.sessionId} on ${agentId}.`
|
|
313717
314397
|
)
|
|
313718
314398
|
);
|
|
@@ -313737,7 +314417,7 @@ ACP external agents (${entries.length})
|
|
|
313737
314417
|
console.log(`No ACP sessions exposed by ${agentId}.`);
|
|
313738
314418
|
} else {
|
|
313739
314419
|
console.log(
|
|
313740
|
-
|
|
314420
|
+
picocolors28.bold(
|
|
313741
314421
|
`
|
|
313742
314422
|
ACP sessions for ${agentId} (${result.sessions.length})
|
|
313743
314423
|
`
|
|
@@ -313745,10 +314425,10 @@ ACP sessions for ${agentId} (${result.sessions.length})
|
|
|
313745
314425
|
);
|
|
313746
314426
|
for (const session of result.sessions) {
|
|
313747
314427
|
console.log(
|
|
313748
|
-
`${
|
|
314428
|
+
`${picocolors28.cyan(session.sessionId)} \xB7 ${session.title || "untitled"}`
|
|
313749
314429
|
);
|
|
313750
314430
|
console.log(
|
|
313751
|
-
|
|
314431
|
+
picocolors28.gray(
|
|
313752
314432
|
` ${session.cwd}${session.updatedAt ? ` \xB7 ${session.updatedAt}` : ""}`
|
|
313753
314433
|
)
|
|
313754
314434
|
);
|
|
@@ -313775,13 +314455,13 @@ ACP sessions for ${agentId} (${result.sessions.length})
|
|
|
313775
314455
|
console.log(JSON.stringify({ schemaVersion: 1, ...imported }, null, 2));
|
|
313776
314456
|
} else if (imported.existing) {
|
|
313777
314457
|
console.log(
|
|
313778
|
-
|
|
314458
|
+
picocolors28.gray(
|
|
313779
314459
|
`ACP history is already imported as Orbit session ${imported.sessionId}.`
|
|
313780
314460
|
)
|
|
313781
314461
|
);
|
|
313782
314462
|
} else {
|
|
313783
314463
|
console.log(
|
|
313784
|
-
|
|
314464
|
+
picocolors28.green(
|
|
313785
314465
|
`\u2714 Imported ACP history as Orbit session ${imported.sessionId} (${imported.messageCount} message(s)).`
|
|
313786
314466
|
)
|
|
313787
314467
|
);
|
|
@@ -313804,15 +314484,15 @@ ACP sessions for ${agentId} (${result.sessions.length})
|
|
|
313804
314484
|
);
|
|
313805
314485
|
else {
|
|
313806
314486
|
console.log(
|
|
313807
|
-
|
|
314487
|
+
picocolors28.green(
|
|
313808
314488
|
`\u2714 ${agentId} negotiated ACP v${capabilities.protocolVersion}.`
|
|
313809
314489
|
)
|
|
313810
314490
|
);
|
|
313811
314491
|
console.log(
|
|
313812
|
-
` ${capabilities.title} ${
|
|
314492
|
+
` ${capabilities.title} ${picocolors28.gray(`(${capabilities.version})`)}`
|
|
313813
314493
|
);
|
|
313814
314494
|
console.log(
|
|
313815
|
-
|
|
314495
|
+
picocolors28.gray(
|
|
313816
314496
|
` sessions: load=${capabilities.loadSession} resume=${capabilities.sessionResume} close=${capabilities.sessionClose}`
|
|
313817
314497
|
)
|
|
313818
314498
|
);
|
|
@@ -313847,7 +314527,7 @@ ACP sessions for ${agentId} (${result.sessions.length})
|
|
|
313847
314527
|
if (text2) process.stdout.write(text2);
|
|
313848
314528
|
} else if (update.sessionUpdate === "tool_call") {
|
|
313849
314529
|
console.error(
|
|
313850
|
-
|
|
314530
|
+
picocolors28.gray(`
|
|
313851
314531
|
\u25CF External Agent: ${extractTitle(update.data)}`)
|
|
313852
314532
|
);
|
|
313853
314533
|
}
|
|
@@ -313865,20 +314545,20 @@ ACP sessions for ${agentId} (${result.sessions.length})
|
|
|
313865
314545
|
if (result.text && !result.text.endsWith("\n"))
|
|
313866
314546
|
process.stdout.write("\n");
|
|
313867
314547
|
console.log(
|
|
313868
|
-
|
|
314548
|
+
picocolors28.gray(
|
|
313869
314549
|
`\u2714 ACP turn completed: ${result.stopReason} \xB7 ${result.updateCount} update(s)`
|
|
313870
314550
|
)
|
|
313871
314551
|
);
|
|
313872
314552
|
if (result.restoredSession) {
|
|
313873
314553
|
console.log(
|
|
313874
|
-
|
|
314554
|
+
picocolors28.gray(
|
|
313875
314555
|
` continued ${result.sessionId} via ${result.restoredSession.strategy} \xB7 replayed ${result.restoredSession.replayedUpdateCount} update(s)`
|
|
313876
314556
|
)
|
|
313877
314557
|
);
|
|
313878
314558
|
}
|
|
313879
314559
|
if (result.stderr)
|
|
313880
314560
|
console.error(
|
|
313881
|
-
|
|
314561
|
+
picocolors28.gray(`External Agent stderr:
|
|
313882
314562
|
${result.stderr}`)
|
|
313883
314563
|
);
|
|
313884
314564
|
}
|
|
@@ -314070,7 +314750,7 @@ function emitError2(message2, options) {
|
|
|
314070
314750
|
console.log(
|
|
314071
314751
|
JSON.stringify({ schemaVersion: 1, ok: false, error: message2 })
|
|
314072
314752
|
);
|
|
314073
|
-
else console.error(
|
|
314753
|
+
else console.error(picocolors28.red(`\u2716 ${message2}`));
|
|
314074
314754
|
return 1;
|
|
314075
314755
|
}
|
|
314076
314756
|
function errorMessage5(error) {
|
|
@@ -314086,7 +314766,7 @@ function isRecord13(value) {
|
|
|
314086
314766
|
import { existsSync as existsSync30, lstatSync as lstatSync11, readdirSync as readdirSync11 } from "fs";
|
|
314087
314767
|
import { isAbsolute as isAbsolute9, join as join20, relative as relative11, sep as sep3 } from "path";
|
|
314088
314768
|
import { z as z85 } from "zod";
|
|
314089
|
-
import
|
|
314769
|
+
import picocolors29 from "picocolors";
|
|
314090
314770
|
var FindingSchema = z85.object({
|
|
314091
314771
|
id: z85.string().min(1).max(120),
|
|
314092
314772
|
severity: z85.enum(["P0", "P1", "P2", "P3"]),
|
|
@@ -314315,7 +314995,7 @@ function emitExportReceipt(result, json) {
|
|
|
314315
314995
|
console.log(JSON.stringify({ schemaVersion: 1, ...result }, null, 2));
|
|
314316
314996
|
} else {
|
|
314317
314997
|
console.log(
|
|
314318
|
-
|
|
314998
|
+
picocolors29.green(
|
|
314319
314999
|
`\u2714 Exported ${result.artifactCount} review artifact(s) as ${result.format}: ${result.out}`
|
|
314320
315000
|
)
|
|
314321
315001
|
);
|
|
@@ -314364,7 +315044,7 @@ function emit(value, json) {
|
|
|
314364
315044
|
return;
|
|
314365
315045
|
}
|
|
314366
315046
|
if (!Array.isArray(value)) {
|
|
314367
|
-
console.log(
|
|
315047
|
+
console.log(picocolors29.bold(`
|
|
314368
315048
|
${value.perspective} \xB7 ${value.verdict}
|
|
314369
315049
|
`));
|
|
314370
315050
|
console.log(redactSecrets(value.feedback));
|
|
@@ -314378,7 +315058,7 @@ ${value.perspective} \xB7 ${value.verdict}
|
|
|
314378
315058
|
if (value.length === 0) return console.log("No persisted review findings.");
|
|
314379
315059
|
for (const item of value) {
|
|
314380
315060
|
console.log(
|
|
314381
|
-
`${
|
|
315061
|
+
`${picocolors29.cyan(item.name)} \xB7 ${item.value.verdict} \xB7 ${item.value.findings.length} finding(s)`
|
|
314382
315062
|
);
|
|
314383
315063
|
}
|
|
314384
315064
|
}
|
|
@@ -314389,14 +315069,14 @@ function emitVerification(result, json) {
|
|
|
314389
315069
|
}
|
|
314390
315070
|
if (result.ok) {
|
|
314391
315071
|
console.log(
|
|
314392
|
-
|
|
315072
|
+
picocolors29.green(
|
|
314393
315073
|
`\u2714 Review gate passed (${result.artifacts.length} artifact(s)).`
|
|
314394
315074
|
)
|
|
314395
315075
|
);
|
|
314396
315076
|
return;
|
|
314397
315077
|
}
|
|
314398
315078
|
console.error(
|
|
314399
|
-
|
|
315079
|
+
picocolors29.red(
|
|
314400
315080
|
`\u2716 Review gate blocked by ${result.blockedFindings.length} open P0/P1 finding(s).`
|
|
314401
315081
|
)
|
|
314402
315082
|
);
|
|
@@ -314415,7 +315095,7 @@ function fail(message2, options) {
|
|
|
314415
315095
|
error: redactSecrets(message2)
|
|
314416
315096
|
})
|
|
314417
315097
|
);
|
|
314418
|
-
else console.error(
|
|
315098
|
+
else console.error(picocolors29.red(`\u2716 ${redactSecrets(message2)}`));
|
|
314419
315099
|
return 1;
|
|
314420
315100
|
}
|
|
314421
315101
|
|
|
@@ -314474,7 +315154,7 @@ function runTraceExport(cwd, sessionId, options = {}) {
|
|
|
314474
315154
|
|
|
314475
315155
|
// src/commands/sessionRetention.ts
|
|
314476
315156
|
import readline6 from "readline";
|
|
314477
|
-
import
|
|
315157
|
+
import picocolors30 from "picocolors";
|
|
314478
315158
|
import { z as z87 } from "zod";
|
|
314479
315159
|
var SessionRetentionCommandOptionsSchema = z87.object({
|
|
314480
315160
|
olderThanDays: z87.coerce.number().int().min(1).max(3650).optional(),
|
|
@@ -314515,7 +315195,7 @@ async function runSessionRetention(cwd, rawOptions, dependencies = {}) {
|
|
|
314515
315195
|
);
|
|
314516
315196
|
}
|
|
314517
315197
|
if (!confirmed) {
|
|
314518
|
-
if (!options.json) write(
|
|
315198
|
+
if (!options.json) write(picocolors30.yellow("\u26A0 Retention cancelled."));
|
|
314519
315199
|
return { applied: false, plan };
|
|
314520
315200
|
}
|
|
314521
315201
|
const result = applySessionRetention(cwd, plan);
|
|
@@ -314523,7 +315203,7 @@ async function runSessionRetention(cwd, rawOptions, dependencies = {}) {
|
|
|
314523
315203
|
write(JSON.stringify(result));
|
|
314524
315204
|
} else {
|
|
314525
315205
|
write(
|
|
314526
|
-
|
|
315206
|
+
picocolors30.green(
|
|
314527
315207
|
`\u2714 Retention removed ${result.deleted.length} session(s); skipped ${result.skipped.length}.`
|
|
314528
315208
|
)
|
|
314529
315209
|
);
|
|
@@ -314531,12 +315211,12 @@ async function runSessionRetention(cwd, rawOptions, dependencies = {}) {
|
|
|
314531
315211
|
return result;
|
|
314532
315212
|
}
|
|
314533
315213
|
function printPlan(plan, write) {
|
|
314534
|
-
write(
|
|
315214
|
+
write(picocolors30.bold("\nOrbit session retention preview\n"));
|
|
314535
315215
|
write(
|
|
314536
315216
|
` \u25CF ${plan.totalSessions} session(s) \xB7 ${formatBytes(plan.totalBytes)} total \xB7 ${plan.protectedActiveSessions} active protected`
|
|
314537
315217
|
);
|
|
314538
315218
|
if (plan.candidates.length === 0) {
|
|
314539
|
-
write(
|
|
315219
|
+
write(picocolors30.gray(" No sessions match the retention policy."));
|
|
314540
315220
|
} else {
|
|
314541
315221
|
for (const candidate of plan.candidates) {
|
|
314542
315222
|
write(
|
|
@@ -314545,9 +315225,9 @@ function printPlan(plan, write) {
|
|
|
314545
315225
|
}
|
|
314546
315226
|
}
|
|
314547
315227
|
for (const warning2 of plan.warnings)
|
|
314548
|
-
write(
|
|
315228
|
+
write(picocolors30.yellow(` \u26A0 ${warning2}`));
|
|
314549
315229
|
write(
|
|
314550
|
-
|
|
315230
|
+
picocolors30.gray(
|
|
314551
315231
|
"\nOnly Orbit-owned session directories are eligible. Active sessions stay protected unless --include-active is explicit."
|
|
314552
315232
|
)
|
|
314553
315233
|
);
|
|
@@ -315305,7 +315985,7 @@ import {
|
|
|
315305
315985
|
import { basename as basename8, dirname as dirname17, join as join27, relative as relative12, resolve as resolve17 } from "path";
|
|
315306
315986
|
import { createHash as createHash15, randomUUID as randomUUID15 } from "crypto";
|
|
315307
315987
|
import { promisify as promisify5 } from "util";
|
|
315308
|
-
import
|
|
315988
|
+
import picocolors31 from "picocolors";
|
|
315309
315989
|
import { parse as parseYaml5 } from "yaml";
|
|
315310
315990
|
import { z as z91 } from "zod";
|
|
315311
315991
|
var exec5 = promisify5(execCallback);
|
|
@@ -315345,7 +316025,7 @@ async function runEval(cwd, suiteFile, options = {}) {
|
|
|
315345
316025
|
const results = [];
|
|
315346
316026
|
for (const task of tasks) {
|
|
315347
316027
|
if (!value.json) {
|
|
315348
|
-
console.log(
|
|
316028
|
+
console.log(picocolors31.cyan(`\u25CF Evaluating ${task.id}...`));
|
|
315349
316029
|
}
|
|
315350
316030
|
let worktree;
|
|
315351
316031
|
const taskStartedAt = Date.now();
|
|
@@ -315507,18 +316187,18 @@ async function runEval(cwd, suiteFile, options = {}) {
|
|
|
315507
316187
|
console.log(JSON.stringify(report, null, 2));
|
|
315508
316188
|
} else {
|
|
315509
316189
|
console.log(
|
|
315510
|
-
report.passed ?
|
|
316190
|
+
report.passed ? picocolors31.green(
|
|
315511
316191
|
`\u2714 Acceptance passed: ${passedTasks}/${results.length} tasks.`
|
|
315512
|
-
) :
|
|
316192
|
+
) : picocolors31.red(
|
|
315513
316193
|
`\u2716 Acceptance failed: ${passedTasks}/${results.length} tasks passed.`
|
|
315514
316194
|
)
|
|
315515
316195
|
);
|
|
315516
|
-
console.log(
|
|
316196
|
+
console.log(picocolors31.gray(`Report: ${reportPath}`));
|
|
315517
316197
|
if (report.comparison) {
|
|
315518
316198
|
console.log(
|
|
315519
|
-
report.comparison.passed ?
|
|
316199
|
+
report.comparison.passed ? picocolors31.green(
|
|
315520
316200
|
`\u2714 Baseline regression gate passed (${report.comparison.baselineRunId}).`
|
|
315521
|
-
) :
|
|
316201
|
+
) : picocolors31.red(
|
|
315522
316202
|
`\u2716 Baseline regression gate failed: ${report.comparison.findings.join(", ")}`
|
|
315523
316203
|
)
|
|
315524
316204
|
);
|
|
@@ -315879,7 +316559,7 @@ function safeSummary(value) {
|
|
|
315879
316559
|
|
|
315880
316560
|
// src/commands/clean.ts
|
|
315881
316561
|
import readline7 from "readline";
|
|
315882
|
-
import
|
|
316562
|
+
import picocolors33 from "picocolors";
|
|
315883
316563
|
import { resolve as resolve19 } from "path";
|
|
315884
316564
|
import { z as z95 } from "zod";
|
|
315885
316565
|
|
|
@@ -316096,7 +316776,7 @@ async function runClean(cwd, rawOptions, dependencies = {}) {
|
|
|
316096
316776
|
);
|
|
316097
316777
|
}
|
|
316098
316778
|
if (!confirmed) {
|
|
316099
|
-
if (!options.json) write(
|
|
316779
|
+
if (!options.json) write(picocolors33.yellow("\u26A0 Cleanup cancelled."));
|
|
316100
316780
|
return { applied: false, plan, removed: [], skipped: [] };
|
|
316101
316781
|
}
|
|
316102
316782
|
const userTarget = plan.targets.find(
|
|
@@ -316118,7 +316798,7 @@ async function runClean(cwd, rawOptions, dependencies = {}) {
|
|
|
316118
316798
|
);
|
|
316119
316799
|
} else {
|
|
316120
316800
|
write(
|
|
316121
|
-
|
|
316801
|
+
picocolors33.green(
|
|
316122
316802
|
`\u2714 Removed ${result.removed.length} Orbit data director${result.removed.length === 1 ? "y" : "ies"}.`
|
|
316123
316803
|
)
|
|
316124
316804
|
);
|
|
@@ -316135,18 +316815,18 @@ function resolveScopes(options) {
|
|
|
316135
316815
|
return scopes;
|
|
316136
316816
|
}
|
|
316137
316817
|
function printCleanupPlan(plan, write) {
|
|
316138
|
-
write(
|
|
316818
|
+
write(picocolors33.bold("\nOrbit cleanup preview\n"));
|
|
316139
316819
|
for (const target of plan.targets) {
|
|
316140
316820
|
const scope = target.scopes.join(" + ");
|
|
316141
316821
|
const status = target.exists ? `${target.files} files \xB7 ${target.directories} directories \xB7 ${formatBytes2(target.bytes)}` : "not present";
|
|
316142
316822
|
write(` ${target.exists ? "\u25CF" : "\u25CB"} ${scope}: ${target.path}`);
|
|
316143
|
-
write(` ${
|
|
316823
|
+
write(` ${picocolors33.gray(status)}`);
|
|
316144
316824
|
for (const warning2 of target.warnings) {
|
|
316145
|
-
write(` ${
|
|
316825
|
+
write(` ${picocolors33.yellow(`\u26A0 ${warning2}`)}`);
|
|
316146
316826
|
}
|
|
316147
316827
|
}
|
|
316148
316828
|
write(
|
|
316149
|
-
|
|
316829
|
+
picocolors33.gray(
|
|
316150
316830
|
"\nOnly .orbit data directories are included. Project source, ORBIT.md, and orbit.config.yaml are preserved."
|
|
316151
316831
|
)
|
|
316152
316832
|
);
|
|
@@ -316177,11 +316857,11 @@ import { existsSync as existsSync40 } from "fs";
|
|
|
316177
316857
|
import { homedir as homedir14 } from "os";
|
|
316178
316858
|
import { join as join30, resolve as resolve21 } from "path";
|
|
316179
316859
|
import { promisify as promisify6 } from "util";
|
|
316180
|
-
import
|
|
316860
|
+
import picocolors34 from "picocolors";
|
|
316181
316861
|
|
|
316182
316862
|
// ../daemon/dist/index.js
|
|
316183
316863
|
import { z as z96 } from "zod";
|
|
316184
|
-
import { z as
|
|
316864
|
+
import { z as z311 } from "zod";
|
|
316185
316865
|
import { createHash as createHash16 } from "crypto";
|
|
316186
316866
|
import {
|
|
316187
316867
|
appendFileSync,
|
|
@@ -316628,39 +317308,39 @@ function sanitizeMetadata(input) {
|
|
|
316628
317308
|
}
|
|
316629
317309
|
var MAX_CLIENT_RESPONSE_BYTES = 16 * 1024 * 1024;
|
|
316630
317310
|
var MAX_CLIENT_SSE_FRAME_BYTES = 128 * 1024;
|
|
316631
|
-
var HealthSchema =
|
|
316632
|
-
schemaVersion:
|
|
316633
|
-
ok:
|
|
316634
|
-
protocolVersion:
|
|
316635
|
-
instanceId:
|
|
316636
|
-
accepting:
|
|
316637
|
-
activeTasks:
|
|
317311
|
+
var HealthSchema = z311.object({
|
|
317312
|
+
schemaVersion: z311.literal(1),
|
|
317313
|
+
ok: z311.literal(true),
|
|
317314
|
+
protocolVersion: z311.literal(1),
|
|
317315
|
+
instanceId: z311.string().regex(/^daemon_[a-f0-9]{24,64}$/),
|
|
317316
|
+
accepting: z311.boolean(),
|
|
317317
|
+
activeTasks: z311.number().int().nonnegative().max(32)
|
|
316638
317318
|
});
|
|
316639
|
-
var TaskEnvelopeSchema =
|
|
316640
|
-
schemaVersion:
|
|
316641
|
-
ok:
|
|
317319
|
+
var TaskEnvelopeSchema = z311.object({
|
|
317320
|
+
schemaVersion: z311.literal(1),
|
|
317321
|
+
ok: z311.literal(true),
|
|
316642
317322
|
task: DaemonTaskRecordSchema
|
|
316643
317323
|
});
|
|
316644
|
-
var TaskListSchema =
|
|
316645
|
-
schemaVersion:
|
|
316646
|
-
ok:
|
|
316647
|
-
tasks:
|
|
317324
|
+
var TaskListSchema = z311.object({
|
|
317325
|
+
schemaVersion: z311.literal(1),
|
|
317326
|
+
ok: z311.literal(true),
|
|
317327
|
+
tasks: z311.array(DaemonTaskRecordSchema).max(500)
|
|
316648
317328
|
});
|
|
316649
317329
|
var SubmitEnvelopeSchema = TaskEnvelopeSchema;
|
|
316650
|
-
var EventReadQuerySchema =
|
|
316651
|
-
after:
|
|
316652
|
-
limit:
|
|
317330
|
+
var EventReadQuerySchema = z311.object({
|
|
317331
|
+
after: z311.number().int().min(0).max(5e3).default(0),
|
|
317332
|
+
limit: z311.number().int().min(1).max(500).default(200)
|
|
316653
317333
|
});
|
|
316654
|
-
var AuditEnvelopeSchema =
|
|
316655
|
-
schemaVersion:
|
|
316656
|
-
ok:
|
|
316657
|
-
verification:
|
|
316658
|
-
valid:
|
|
316659
|
-
entries:
|
|
316660
|
-
lastDigest:
|
|
316661
|
-
error:
|
|
317334
|
+
var AuditEnvelopeSchema = z311.object({
|
|
317335
|
+
schemaVersion: z311.literal(1),
|
|
317336
|
+
ok: z311.literal(true),
|
|
317337
|
+
verification: z311.object({
|
|
317338
|
+
valid: z311.boolean(),
|
|
317339
|
+
entries: z311.number().int().nonnegative(),
|
|
317340
|
+
lastDigest: z311.string().regex(/^[a-f0-9]{64}$/),
|
|
317341
|
+
error: z311.string().optional()
|
|
316662
317342
|
}),
|
|
316663
|
-
entries:
|
|
317343
|
+
entries: z311.array(DaemonAuditEntrySchema).max(500)
|
|
316664
317344
|
});
|
|
316665
317345
|
var DaemonClient = class {
|
|
316666
317346
|
baseUrl;
|
|
@@ -316690,7 +317370,7 @@ var DaemonClient = class {
|
|
|
316690
317370
|
64 * 1024 * 1024
|
|
316691
317371
|
)
|
|
316692
317372
|
);
|
|
316693
|
-
this.requestTimeoutMs =
|
|
317373
|
+
this.requestTimeoutMs = z311.number().int().min(1e3).max(3e5).parse(options.requestTimeoutMs ?? 3e4);
|
|
316694
317374
|
}
|
|
316695
317375
|
health() {
|
|
316696
317376
|
return this.requestJson("/v1/health", HealthSchema);
|
|
@@ -316703,13 +317383,13 @@ var DaemonClient = class {
|
|
|
316703
317383
|
}).then((result) => result.task);
|
|
316704
317384
|
}
|
|
316705
317385
|
listTasks(limit = 100) {
|
|
316706
|
-
const bounded =
|
|
317386
|
+
const bounded = z311.number().int().min(1).max(500).parse(limit);
|
|
316707
317387
|
return this.requestJson(`/v1/tasks?limit=${bounded}`, TaskListSchema).then(
|
|
316708
317388
|
(result) => result.tasks
|
|
316709
317389
|
);
|
|
316710
317390
|
}
|
|
316711
317391
|
readAudit(limit = 500) {
|
|
316712
|
-
const bounded =
|
|
317392
|
+
const bounded = z311.number().int().min(1).max(500).parse(limit);
|
|
316713
317393
|
return this.requestJson(
|
|
316714
317394
|
`/v1/audit?limit=${bounded}`,
|
|
316715
317395
|
AuditEnvelopeSchema
|
|
@@ -316731,13 +317411,13 @@ var DaemonClient = class {
|
|
|
316731
317411
|
return this.taskMutation(id, "resume");
|
|
316732
317412
|
}
|
|
316733
317413
|
removeTask(id) {
|
|
316734
|
-
const RemovedSchema =
|
|
316735
|
-
schemaVersion:
|
|
316736
|
-
ok:
|
|
316737
|
-
removed:
|
|
317414
|
+
const RemovedSchema = z311.object({
|
|
317415
|
+
schemaVersion: z311.literal(1),
|
|
317416
|
+
ok: z311.literal(true),
|
|
317417
|
+
removed: z311.object({
|
|
316738
317418
|
id: DaemonTaskIdSchema,
|
|
316739
|
-
state:
|
|
316740
|
-
attempt:
|
|
317419
|
+
state: z311.string().min(1),
|
|
317420
|
+
attempt: z311.number().int().positive()
|
|
316741
317421
|
})
|
|
316742
317422
|
});
|
|
316743
317423
|
return this.requestJson(`/v1/tasks/${encodeTaskId(id)}`, RemovedSchema, {
|
|
@@ -316747,7 +317427,7 @@ var DaemonClient = class {
|
|
|
316747
317427
|
async shutdown() {
|
|
316748
317428
|
await this.requestJson(
|
|
316749
317429
|
"/v1/shutdown",
|
|
316750
|
-
|
|
317430
|
+
z311.object({ schemaVersion: z311.literal(1), ok: z311.literal(true) }),
|
|
316751
317431
|
{ method: "POST", body: "{}" }
|
|
316752
317432
|
);
|
|
316753
317433
|
}
|
|
@@ -316899,7 +317579,7 @@ function parseSseFrame2(frame) {
|
|
|
316899
317579
|
if (!data) return void 0;
|
|
316900
317580
|
const parsed = JSON.parse(data);
|
|
316901
317581
|
if (eventName === "resync_required") {
|
|
316902
|
-
const taskId =
|
|
317582
|
+
const taskId = z311.object({ taskId: DaemonTaskIdSchema }).parse(parsed).taskId;
|
|
316903
317583
|
return { type: "resync_required", taskId };
|
|
316904
317584
|
}
|
|
316905
317585
|
return DaemonEventSchema.parse(parsed);
|
|
@@ -318935,14 +319615,14 @@ function parseDaemonSseFrame(frame) {
|
|
|
318935
319615
|
}
|
|
318936
319616
|
function printDaemonEvent(value) {
|
|
318937
319617
|
if (!isRecord17(value)) {
|
|
318938
|
-
console.log(
|
|
319618
|
+
console.log(picocolors34.gray(`\u25CF ${String(value)}`));
|
|
318939
319619
|
return;
|
|
318940
319620
|
}
|
|
318941
319621
|
const sequence = typeof value.sequence === "number" ? `#${value.sequence}` : "\u25CF";
|
|
318942
319622
|
const type = typeof value.type === "string" ? value.type : "daemon_event";
|
|
318943
319623
|
const timestamp = typeof value.timestamp === "string" ? ` \xB7 ${value.timestamp}` : "";
|
|
318944
319624
|
console.log(
|
|
318945
|
-
`${
|
|
319625
|
+
`${picocolors34.cyan(sequence)} ${type}${picocolors34.gray(timestamp)}`
|
|
318946
319626
|
);
|
|
318947
319627
|
}
|
|
318948
319628
|
function isSuccess(status) {
|
|
@@ -318956,14 +319636,14 @@ function printDaemonResult(json, value) {
|
|
|
318956
319636
|
if (isRecord17(value) && value.ok === false) {
|
|
318957
319637
|
const error = isRecord17(value.error) ? value.error.message : value.error;
|
|
318958
319638
|
console.error(
|
|
318959
|
-
|
|
319639
|
+
picocolors34.red(`\u2716 ${String(error ?? "Daemon request failed.")}`)
|
|
318960
319640
|
);
|
|
318961
319641
|
return;
|
|
318962
319642
|
}
|
|
318963
319643
|
if (isRecord17(value) && value.ok === true) {
|
|
318964
319644
|
const tasks = Array.isArray(value.tasks) ? value.tasks.filter(isDaemonTaskRecord) : [];
|
|
318965
319645
|
if (tasks.length > 0) {
|
|
318966
|
-
console.log(
|
|
319646
|
+
console.log(picocolors34.green(`\u2714 ${tasks.length} daemon task(s)`));
|
|
318967
319647
|
for (const task2 of tasks) printHumanDaemonTask(task2);
|
|
318968
319648
|
return;
|
|
318969
319649
|
}
|
|
@@ -318974,28 +319654,28 @@ function printDaemonResult(json, value) {
|
|
|
318974
319654
|
}
|
|
318975
319655
|
if (typeof value.activeTasks === "number") {
|
|
318976
319656
|
console.log(
|
|
318977
|
-
|
|
319657
|
+
picocolors34.green(
|
|
318978
319658
|
`\u2714 Daemon healthy \xB7 ${value.activeTasks} active task(s)`
|
|
318979
319659
|
)
|
|
318980
319660
|
);
|
|
318981
319661
|
return;
|
|
318982
319662
|
}
|
|
318983
319663
|
}
|
|
318984
|
-
console.log(
|
|
319664
|
+
console.log(picocolors34.green(`\u2714 ${JSON.stringify(value)}`));
|
|
318985
319665
|
}
|
|
318986
319666
|
function printHumanDaemonTask(task) {
|
|
318987
319667
|
const icon = task.state === "completed" ? "\u2714" : ["failed", "aborted"].includes(task.state) ? "\u2716" : task.state === "canceled" || task.state === "orphaned" ? "\u26A0" : "\u25CF";
|
|
318988
319668
|
const summary = `${icon} ${task.id} \xB7 ${task.state} \xB7 attempt ${task.attempt}`;
|
|
318989
319669
|
console.log(
|
|
318990
|
-
task.state === "completed" ?
|
|
319670
|
+
task.state === "completed" ? picocolors34.green(summary) : task.state === "failed" || task.state === "aborted" ? picocolors34.red(summary) : picocolors34.yellow(summary)
|
|
318991
319671
|
);
|
|
318992
319672
|
if (task.failureCode) {
|
|
318993
319673
|
const retry = task.retryable ? "\u53EF\u6062\u590D" : "\u4E0D\u53EF\u81EA\u52A8\u6062\u590D";
|
|
318994
|
-
console.log(
|
|
319674
|
+
console.log(picocolors34.gray(` failure: ${task.failureCode} \xB7 ${retry}`));
|
|
318995
319675
|
}
|
|
318996
|
-
if (task.error) console.log(
|
|
319676
|
+
if (task.error) console.log(picocolors34.gray(` error: ${task.error}`));
|
|
318997
319677
|
if (task.recoveryHint)
|
|
318998
|
-
console.log(
|
|
319678
|
+
console.log(picocolors34.cyan(` next: ${task.recoveryHint}`));
|
|
318999
319679
|
}
|
|
319000
319680
|
function formatHost(host) {
|
|
319001
319681
|
return host.includes(":") && !host.startsWith("[") ? `[${host}]` : host;
|
|
@@ -319015,7 +319695,7 @@ function normalizeRootList(value) {
|
|
|
319015
319695
|
|
|
319016
319696
|
// src/commands/backup.ts
|
|
319017
319697
|
import { basename as basename10, resolve as resolve30 } from "path";
|
|
319018
|
-
import
|
|
319698
|
+
import picocolors35 from "picocolors";
|
|
319019
319699
|
import { z as z100 } from "zod";
|
|
319020
319700
|
|
|
319021
319701
|
// src/runtime/ProjectBackup.ts
|
|
@@ -319385,12 +320065,12 @@ function runBackupCreate(cwd, rawOptions = {}) {
|
|
|
319385
320065
|
);
|
|
319386
320066
|
} else {
|
|
319387
320067
|
console.log(
|
|
319388
|
-
|
|
320068
|
+
picocolors35.green(
|
|
319389
320069
|
`\u2714 Backed up ${bundle.files.length} durable project file(s) to ${outputPath}`
|
|
319390
320070
|
)
|
|
319391
320071
|
);
|
|
319392
320072
|
console.log(
|
|
319393
|
-
|
|
320073
|
+
picocolors35.gray(
|
|
319394
320074
|
" Regenerable caches, temporary state, exports, and credentials were excluded."
|
|
319395
320075
|
)
|
|
319396
320076
|
);
|
|
@@ -319408,7 +320088,7 @@ function runBackupInspect(input, options = {}) {
|
|
|
319408
320088
|
};
|
|
319409
320089
|
if (options.json) console.log(JSON.stringify(summary));
|
|
319410
320090
|
else {
|
|
319411
|
-
console.log(
|
|
320091
|
+
console.log(picocolors35.bold(`
|
|
319412
320092
|
${basename10(input)}
|
|
319413
320093
|
`));
|
|
319414
320094
|
console.log(` Project: ${summary.sourceName}`);
|
|
@@ -319416,7 +320096,7 @@ ${basename10(input)}
|
|
|
319416
320096
|
console.log(
|
|
319417
320097
|
` Content: ${summary.files} files \xB7 ${formatBytes4(summary.bytes)}`
|
|
319418
320098
|
);
|
|
319419
|
-
console.log(
|
|
320099
|
+
console.log(picocolors35.green(" \u2714 Integrity verified"));
|
|
319420
320100
|
}
|
|
319421
320101
|
}
|
|
319422
320102
|
function runBackupRestore(cwd, input, options = {}) {
|
|
@@ -319426,13 +320106,13 @@ function runBackupRestore(cwd, input, options = {}) {
|
|
|
319426
320106
|
console.log(JSON.stringify({ schemaVersion: 1, ...result }));
|
|
319427
320107
|
} else {
|
|
319428
320108
|
console.log(
|
|
319429
|
-
|
|
320109
|
+
picocolors35.green(
|
|
319430
320110
|
`\u2714 Restored ${result.restored.length} project file(s) from ${resolve30(input)}`
|
|
319431
320111
|
)
|
|
319432
320112
|
);
|
|
319433
320113
|
if (result.conflicts.length > 0) {
|
|
319434
320114
|
console.log(
|
|
319435
|
-
|
|
320115
|
+
picocolors35.yellow(
|
|
319436
320116
|
` Replaced ${result.conflicts.length} existing file(s) because --force was supplied.`
|
|
319437
320117
|
)
|
|
319438
320118
|
);
|
|
@@ -319449,7 +320129,7 @@ function formatBytes4(bytes) {
|
|
|
319449
320129
|
}
|
|
319450
320130
|
|
|
319451
320131
|
// src/commands/extension.ts
|
|
319452
|
-
import
|
|
320132
|
+
import picocolors36 from "picocolors";
|
|
319453
320133
|
|
|
319454
320134
|
// src/runtime/ExtensionManager.ts
|
|
319455
320135
|
import {
|
|
@@ -320025,12 +320705,12 @@ function validateExtension(cwd, manifestPath, options = {}) {
|
|
|
320025
320705
|
0
|
|
320026
320706
|
);
|
|
320027
320707
|
console.log(
|
|
320028
|
-
|
|
320708
|
+
picocolors36.green(
|
|
320029
320709
|
`\u2714 Extension manifest is valid: ${manifest.displayName} ${manifest.version}`
|
|
320030
320710
|
)
|
|
320031
320711
|
);
|
|
320032
320712
|
console.log(
|
|
320033
|
-
|
|
320713
|
+
picocolors36.gray(
|
|
320034
320714
|
` ${manifest.id} \xB7 ${contributionCount} contribution(s) \xB7 process=${manifest.permissions.process}`
|
|
320035
320715
|
)
|
|
320036
320716
|
);
|
|
@@ -320039,12 +320719,12 @@ function validateExtension(cwd, manifestPath, options = {}) {
|
|
|
320039
320719
|
function installExtension(cwd, manifestPath, options = {}) {
|
|
320040
320720
|
const installed = new ExtensionManager().install(cwd, manifestPath, options);
|
|
320041
320721
|
console.log(
|
|
320042
|
-
|
|
320722
|
+
picocolors36.green(
|
|
320043
320723
|
`\u2714 Installed extension: ${installed.displayName} ${installed.version}`
|
|
320044
320724
|
)
|
|
320045
320725
|
);
|
|
320046
320726
|
console.log(
|
|
320047
|
-
|
|
320727
|
+
picocolors36.gray(
|
|
320048
320728
|
` ${installed.id} \xB7 sha256:${installed.digest.slice(0, 16)}\u2026`
|
|
320049
320729
|
)
|
|
320050
320730
|
);
|
|
@@ -320056,19 +320736,19 @@ function listExtensions(options = {}) {
|
|
|
320056
320736
|
return;
|
|
320057
320737
|
}
|
|
320058
320738
|
if (!extensions.length) {
|
|
320059
|
-
console.log(
|
|
320739
|
+
console.log(picocolors36.gray("No Orbit extensions are installed."));
|
|
320060
320740
|
return;
|
|
320061
320741
|
}
|
|
320062
320742
|
for (const extension of extensions) {
|
|
320063
320743
|
console.log(
|
|
320064
|
-
`${
|
|
320744
|
+
`${picocolors36.green("\u25CF")} ${extension.displayName} ${extension.version} ${picocolors36.gray(`(${extension.id})`)}`
|
|
320065
320745
|
);
|
|
320066
320746
|
}
|
|
320067
320747
|
}
|
|
320068
320748
|
function removeExtension(id) {
|
|
320069
320749
|
const removed = new ExtensionManager().remove(id);
|
|
320070
320750
|
console.log(
|
|
320071
|
-
removed ?
|
|
320751
|
+
removed ? picocolors36.green(`\u2714 Removed extension: ${id}`) : picocolors36.yellow(`Extension is not installed: ${id}`)
|
|
320072
320752
|
);
|
|
320073
320753
|
}
|
|
320074
320754
|
|
|
@@ -320179,7 +320859,7 @@ sessionsCommand.command("retention").description("preview or apply bounded sessi
|
|
|
320179
320859
|
});
|
|
320180
320860
|
} catch (error) {
|
|
320181
320861
|
console.error(
|
|
320182
|
-
|
|
320862
|
+
picocolors37.red(
|
|
320183
320863
|
`\u2716 ${error instanceof Error ? error.message : String(error)}`
|
|
320184
320864
|
)
|
|
320185
320865
|
);
|
|
@@ -320336,7 +321016,7 @@ acpCommand.command("run <agent> <prompt>").description("run a prompt through one
|
|
|
320336
321016
|
const restore = options.restore;
|
|
320337
321017
|
if (restore !== "auto" && restore !== "resume" && restore !== "load") {
|
|
320338
321018
|
console.error(
|
|
320339
|
-
|
|
321019
|
+
picocolors37.red(
|
|
320340
321020
|
`\u2716 Invalid ACP restore strategy: ${restore || "(empty)"}.`
|
|
320341
321021
|
)
|
|
320342
321022
|
);
|
|
@@ -320379,7 +321059,7 @@ reviewCommand.command("export [artifact]").description("export review findings f
|
|
|
320379
321059
|
(artifact, options) => {
|
|
320380
321060
|
if (options.format !== "json" && options.format !== "sarif") {
|
|
320381
321061
|
console.error(
|
|
320382
|
-
|
|
321062
|
+
picocolors37.red("\u2716 Review export format must be json or sarif.")
|
|
320383
321063
|
);
|
|
320384
321064
|
process.exitCode = 1;
|
|
320385
321065
|
return;
|
|
@@ -320425,7 +321105,7 @@ reviewCommand.command("github-check [artifact]").description("dry-run or publish
|
|
|
320425
321105
|
});
|
|
320426
321106
|
} catch (error) {
|
|
320427
321107
|
console.error(
|
|
320428
|
-
|
|
321108
|
+
picocolors37.red(
|
|
320429
321109
|
`\u2716 ${error instanceof Error ? error.message : String(error)}`
|
|
320430
321110
|
)
|
|
320431
321111
|
);
|
|
@@ -320457,7 +321137,7 @@ reviewCommand.command("github-comment <pr> [artifact]").description("dry-run or
|
|
|
320457
321137
|
});
|
|
320458
321138
|
} catch (error) {
|
|
320459
321139
|
console.error(
|
|
320460
|
-
|
|
321140
|
+
picocolors37.red(
|
|
320461
321141
|
`\u2716 ${error instanceof Error ? error.message : String(error)}`
|
|
320462
321142
|
)
|
|
320463
321143
|
);
|
|
@@ -320494,7 +321174,7 @@ reviewCommand.command("github-dispatch <workflow> [ref]").description("dry-run o
|
|
|
320494
321174
|
});
|
|
320495
321175
|
} catch (error) {
|
|
320496
321176
|
console.error(
|
|
320497
|
-
|
|
321177
|
+
picocolors37.red(
|
|
320498
321178
|
`\u2716 ${error instanceof Error ? error.message : String(error)}`
|
|
320499
321179
|
)
|
|
320500
321180
|
);
|
|
@@ -320506,7 +321186,7 @@ var mcpCommand = program.command("mcp").description("manage Model Context Protoc
|
|
|
320506
321186
|
mcpCommand.command("login <server>").description("authorize an MCP server via OAuth (PKCE) and save the login").option("--port <port>", "fixed loopback port for the OAuth redirect").action(async (server2, options) => {
|
|
320507
321187
|
const port = options.port ? Number.parseInt(options.port, 10) : void 0;
|
|
320508
321188
|
if (options.port && (!Number.isInteger(port) || port < 1 || port > 65535)) {
|
|
320509
|
-
console.error(
|
|
321189
|
+
console.error(picocolors37.red("\u2716 --port must be an integer in 1-65535."));
|
|
320510
321190
|
process.exitCode = 1;
|
|
320511
321191
|
return;
|
|
320512
321192
|
}
|
|
@@ -320807,7 +321487,7 @@ try {
|
|
|
320807
321487
|
} catch (error) {
|
|
320808
321488
|
const message2 = error instanceof Error ? error.message : String(error);
|
|
320809
321489
|
console.error(
|
|
320810
|
-
|
|
321490
|
+
picocolors37.red(`\u2716 Orbit command failed: ${redactSecrets(message2)}`)
|
|
320811
321491
|
);
|
|
320812
321492
|
process.exitCode = 1;
|
|
320813
321493
|
}
|