@kitman-sh/cli 0.15.1 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-8wpg3rph.js → chunk-1scjh42j.js} +2 -2
- package/dist/{chunk-69xka6ew.js → chunk-23nvmnkp.js} +1 -1
- package/dist/{chunk-zy4sv70r.js → chunk-4g7cj90y.js} +6 -6
- package/dist/{chunk-k2wd9r6t.js → chunk-4pq5vq59.js} +2 -2
- package/dist/{chunk-91tmbf95.js → chunk-4v691rg5.js} +18 -18
- package/dist/{chunk-ygx2pda7.js → chunk-5jt8b98c.js} +4 -4
- package/dist/{chunk-xrjt25ns.js → chunk-9n6hd7es.js} +10 -10
- package/dist/{chunk-60fhzjx3.js → chunk-cqejv8e6.js} +107 -24
- package/dist/{chunk-fzaecdgv.js → chunk-djdhep8n.js} +3 -3
- package/dist/{chunk-2vxb3q01.js → chunk-f02v4cdn.js} +1 -1
- package/dist/{chunk-csxxwscf.js → chunk-f2y0z04q.js} +1 -1
- package/dist/{chunk-fggwdr03.js → chunk-g6nhny28.js} +18 -18
- package/dist/{chunk-kskb0hkb.js → chunk-gpcrp0tc.js} +3 -3
- package/dist/{chunk-wh4bpc4w.js → chunk-gt7gk0d4.js} +4 -4
- package/dist/{chunk-3ns4sbfb.js → chunk-gwzzacep.js} +1 -1
- package/dist/{chunk-xx711t5r.js → chunk-hbm0hybe.js} +4 -4
- package/dist/{chunk-dv4v0tbn.js → chunk-n9fhwgzm.js} +34 -30
- package/dist/{chunk-vg78dz3w.js → chunk-ppdf5m4j.js} +34 -177
- package/dist/{chunk-tgt9a3yz.js → chunk-r58fc2x9.js} +6 -6
- package/dist/{chunk-dx792s4w.js → chunk-rfnasm3c.js} +61 -61
- package/dist/{chunk-d40233pm.js → chunk-rv6d2r5v.js} +9 -9
- package/dist/{chunk-0ws25xvg.js → chunk-sd8b4k1t.js} +2 -2
- package/dist/{chunk-5hkdgzh4.js → chunk-x83q18w0.js} +1 -1
- package/dist/{chunk-6h70kent.js → chunk-xc76s9kk.js} +7 -7
- package/dist/{chunk-39ykbhq8.js → chunk-yg34g1m8.js} +5 -5
- package/dist/{chunk-f36s9s1g.js → chunk-zgbjha6j.js} +274 -119
- package/dist/index.js +4 -4
- package/package.json +1 -1
|
@@ -15,8 +15,8 @@ import {
|
|
|
15
15
|
writeSrtSettings2,
|
|
16
16
|
srtStepArgv2,
|
|
17
17
|
srtArgv2
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import"./chunk-
|
|
18
|
+
} from "./chunk-ppdf5m4j.js";
|
|
19
|
+
import"./chunk-rfnasm3c.js";
|
|
20
20
|
export {
|
|
21
21
|
compiled2 as compiled,
|
|
22
22
|
harnessesUnsupportedInDocker2 as harnessesUnsupportedInDocker,
|
|
@@ -6,10 +6,7 @@ import {
|
|
|
6
6
|
gen,
|
|
7
7
|
flatMap3,
|
|
8
8
|
provideContext2
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import {
|
|
11
|
-
runForEach
|
|
12
|
-
} from "./chunk-vg78dz3w.js";
|
|
9
|
+
} from "./chunk-rfnasm3c.js";
|
|
13
10
|
import {
|
|
14
11
|
WebSocketConstructor,
|
|
15
12
|
layerWebSocketConstructorGlobal,
|
|
@@ -19,13 +16,16 @@ import {
|
|
|
19
16
|
RunnerReplicaRpcs,
|
|
20
17
|
RunnerRunFileRpcs,
|
|
21
18
|
ProgramRpcs
|
|
22
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-zgbjha6j.js";
|
|
20
|
+
import {
|
|
21
|
+
runForEach
|
|
22
|
+
} from "./chunk-ppdf5m4j.js";
|
|
23
23
|
import {
|
|
24
24
|
layerJson,
|
|
25
25
|
make4,
|
|
26
26
|
withHeaders,
|
|
27
27
|
layerProtocolSocket
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-4v691rg5.js";
|
|
29
29
|
|
|
30
30
|
// packages/live/src/rpc/runner-client.ts
|
|
31
31
|
var proxiedWebSocket = (proxy) => succeed5(WebSocketConstructor)((target) => {
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
map9,
|
|
23
23
|
raceFirst,
|
|
24
24
|
scoped
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-rfnasm3c.js";
|
|
26
26
|
import {
|
|
27
27
|
unwrap,
|
|
28
28
|
drainFork,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
runCollect,
|
|
32
32
|
runDrain,
|
|
33
33
|
mkString
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-ppdf5m4j.js";
|
|
35
35
|
|
|
36
36
|
// node_modules/.bun/effect@4.1.2/node_modules/effect/dist/internal/redacted.js
|
|
37
37
|
var redactedRegistry = /* @__PURE__ */ new WeakMap;
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
add,
|
|
13
13
|
getOrUndefinedUnsafe,
|
|
14
14
|
getUnsafe,
|
|
15
|
-
|
|
15
|
+
get3,
|
|
16
16
|
Reference,
|
|
17
17
|
toMillis,
|
|
18
18
|
isSuccess,
|
|
@@ -96,21 +96,8 @@ import {
|
|
|
96
96
|
Defect,
|
|
97
97
|
Exit,
|
|
98
98
|
toCodecJson
|
|
99
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-rfnasm3c.js";
|
|
100
100
|
import {
|
|
101
|
-
interrupt,
|
|
102
|
-
getCurrent,
|
|
103
|
-
makeUnsafe2,
|
|
104
|
-
bounded,
|
|
105
|
-
offerAll,
|
|
106
|
-
failCause,
|
|
107
|
-
end,
|
|
108
|
-
shutdownUnsafe,
|
|
109
|
-
fromQueue,
|
|
110
|
-
unwrap
|
|
111
|
-
} from "./chunk-vg78dz3w.js";
|
|
112
|
-
import {
|
|
113
|
-
Clock,
|
|
114
101
|
empty,
|
|
115
102
|
fromInput,
|
|
116
103
|
merge,
|
|
@@ -123,7 +110,20 @@ import {
|
|
|
123
110
|
ParseOptions,
|
|
124
111
|
RpcClientDefect,
|
|
125
112
|
RpcClientError
|
|
126
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-zgbjha6j.js";
|
|
114
|
+
import {
|
|
115
|
+
Clock,
|
|
116
|
+
interrupt,
|
|
117
|
+
getCurrent,
|
|
118
|
+
makeUnsafe2,
|
|
119
|
+
bounded,
|
|
120
|
+
offerAll,
|
|
121
|
+
failCause,
|
|
122
|
+
end,
|
|
123
|
+
shutdownUnsafe,
|
|
124
|
+
fromQueue,
|
|
125
|
+
unwrap
|
|
126
|
+
} from "./chunk-ppdf5m4j.js";
|
|
127
127
|
|
|
128
128
|
// node_modules/.bun/effect@4.1.2/node_modules/effect/dist/workers/Transferable.js
|
|
129
129
|
class Collector extends (/* @__PURE__ */ Service2()("effect/workers/Transferable/Collector")) {
|
|
@@ -237,7 +237,7 @@ var makeNoSerialization = /* @__PURE__ */ fnUntraced(function* (group, options)
|
|
|
237
237
|
const disableTracing = options?.disableTracing ?? false;
|
|
238
238
|
const generateRequestId = options?.generateRequestId ?? (() => requestIdCounter++);
|
|
239
239
|
const services = yield* context();
|
|
240
|
-
const scope =
|
|
240
|
+
const scope = get3(services, Scope);
|
|
241
241
|
const entries = new Map;
|
|
242
242
|
let isShutdown = false;
|
|
243
243
|
yield* addFinalizer(scope, withFiber2((parent) => {
|
|
@@ -643,7 +643,7 @@ var makeRpcSchemas = (codecFor) => {
|
|
|
643
643
|
return entry;
|
|
644
644
|
}
|
|
645
645
|
const streamSchemas = getStreamSchemas(rpc.successSchema);
|
|
646
|
-
const parseOptions =
|
|
646
|
+
const parseOptions = get3(rpc.annotations, ParseOptions);
|
|
647
647
|
const exitSchema2 = exitSchema(rpc);
|
|
648
648
|
let decodeDiscardExit;
|
|
649
649
|
entry = {
|
|
@@ -25,21 +25,21 @@ import {
|
|
|
25
25
|
isString2,
|
|
26
26
|
encodePrettyJsonString,
|
|
27
27
|
decodeJsonStringSync
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-rfnasm3c.js";
|
|
29
29
|
import {
|
|
30
30
|
FileSystem,
|
|
31
31
|
Path,
|
|
32
32
|
optionalEnv,
|
|
33
33
|
tempDirectoryScoped
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-ppdf5m4j.js";
|
|
35
35
|
import {
|
|
36
36
|
AgentHarnessIds,
|
|
37
37
|
sha2562,
|
|
38
38
|
runCommand2
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-zgbjha6j.js";
|
|
40
40
|
import {
|
|
41
41
|
NpmRegistry
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-gpcrp0tc.js";
|
|
43
43
|
|
|
44
44
|
// packages/agent-runtime/src/config-convergence.ts
|
|
45
45
|
var writeAgentEnvironmentConfigFile2 = fnUntraced(function* (file, content, keep = {}) {
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
toCodecJson,
|
|
36
36
|
Json,
|
|
37
37
|
encodePrettyJsonString
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-rfnasm3c.js";
|
|
39
39
|
import {
|
|
40
40
|
SecureRandom,
|
|
41
41
|
layerWebCrypto,
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
KitDeclarations,
|
|
53
53
|
kitmanMcpServer,
|
|
54
54
|
RunnerRpcProtocolVersion
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-zgbjha6j.js";
|
|
56
56
|
import {
|
|
57
57
|
decodeText,
|
|
58
58
|
mkString,
|
|
@@ -60,26 +60,26 @@ import {
|
|
|
60
60
|
Path,
|
|
61
61
|
withDefault,
|
|
62
62
|
String2
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-ppdf5m4j.js";
|
|
64
64
|
import {
|
|
65
65
|
Packument,
|
|
66
66
|
tarballMatches
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-gpcrp0tc.js";
|
|
68
68
|
import {
|
|
69
69
|
stepDefinedTwice,
|
|
70
70
|
hostSteps,
|
|
71
71
|
exports_activities,
|
|
72
72
|
describeFlag,
|
|
73
73
|
Described
|
|
74
|
-
} from "./chunk-
|
|
75
|
-
import"./chunk-
|
|
76
|
-
import"./chunk-
|
|
74
|
+
} from "./chunk-rv6d2r5v.js";
|
|
75
|
+
import"./chunk-4g7cj90y.js";
|
|
76
|
+
import"./chunk-f2y0z04q.js";
|
|
77
77
|
import {
|
|
78
78
|
ChildProcessSpawner,
|
|
79
79
|
make3
|
|
80
|
-
} from "./chunk-
|
|
81
|
-
import"./chunk-
|
|
82
|
-
import"./chunk-
|
|
80
|
+
} from "./chunk-4pq5vq59.js";
|
|
81
|
+
import"./chunk-4v691rg5.js";
|
|
82
|
+
import"./chunk-x83q18w0.js";
|
|
83
83
|
|
|
84
84
|
// packages/sdk/src/build/outline/graph.ts
|
|
85
85
|
import {
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
isFailure2,
|
|
44
44
|
hasInterrupts,
|
|
45
45
|
makeUnsafe5,
|
|
46
|
-
|
|
46
|
+
make15,
|
|
47
47
|
_await,
|
|
48
48
|
fail5,
|
|
49
49
|
isDoneUnsafe,
|
|
@@ -170,9 +170,8 @@ import {
|
|
|
170
170
|
decodeJsonStringSync,
|
|
171
171
|
encodeUnknownJsonStringSync,
|
|
172
172
|
storable
|
|
173
|
-
} from "./chunk-
|
|
173
|
+
} from "./chunk-rfnasm3c.js";
|
|
174
174
|
import {
|
|
175
|
-
currentTimeMillis,
|
|
176
175
|
SecureRandom,
|
|
177
176
|
layerWebCrypto,
|
|
178
177
|
layer,
|
|
@@ -200,6 +199,7 @@ import {
|
|
|
200
199
|
failedTestsOf,
|
|
201
200
|
testOutcomes,
|
|
202
201
|
checkTests,
|
|
202
|
+
loopSafeTextMaxLength,
|
|
203
203
|
reportedModelName,
|
|
204
204
|
calverNumbers,
|
|
205
205
|
compareCalver,
|
|
@@ -257,8 +257,9 @@ import {
|
|
|
257
257
|
checkServicesFile,
|
|
258
258
|
checkServices,
|
|
259
259
|
serviceChecks
|
|
260
|
-
} from "./chunk-
|
|
260
|
+
} from "./chunk-zgbjha6j.js";
|
|
261
261
|
import {
|
|
262
|
+
currentTimeMillis,
|
|
262
263
|
join,
|
|
263
264
|
interrupt,
|
|
264
265
|
unbounded,
|
|
@@ -266,7 +267,7 @@ import {
|
|
|
266
267
|
unbounded2,
|
|
267
268
|
offer,
|
|
268
269
|
makeUnsafe3,
|
|
269
|
-
|
|
270
|
+
make10,
|
|
270
271
|
fromQueue,
|
|
271
272
|
fromPubSub,
|
|
272
273
|
map2,
|
|
@@ -303,7 +304,7 @@ import {
|
|
|
303
304
|
writeSrtSettings2,
|
|
304
305
|
srtStepArgv2,
|
|
305
306
|
srtArgv2
|
|
306
|
-
} from "./chunk-
|
|
307
|
+
} from "./chunk-ppdf5m4j.js";
|
|
307
308
|
import {
|
|
308
309
|
writeAgentEnvironmentConfigFile2,
|
|
309
310
|
readManifestSkillPaths2,
|
|
@@ -319,8 +320,8 @@ import {
|
|
|
319
320
|
applyAgentEnvironmentMaterialization2,
|
|
320
321
|
isPathWithin2,
|
|
321
322
|
skillIdentity2
|
|
322
|
-
} from "./chunk-
|
|
323
|
-
import"./chunk-
|
|
323
|
+
} from "./chunk-5jt8b98c.js";
|
|
324
|
+
import"./chunk-gpcrp0tc.js";
|
|
324
325
|
import {
|
|
325
326
|
egressAllowed,
|
|
326
327
|
writeSecretRegistry,
|
|
@@ -330,7 +331,7 @@ import {
|
|
|
330
331
|
secretFilter2,
|
|
331
332
|
opaqueTunnelRefusal2,
|
|
332
333
|
isOpaqueConnectReason2
|
|
333
|
-
} from "./chunk-
|
|
334
|
+
} from "./chunk-sd8b4k1t.js";
|
|
334
335
|
import {
|
|
335
336
|
sliceBytes2,
|
|
336
337
|
maxLineBytes2,
|
|
@@ -338,29 +339,29 @@ import {
|
|
|
338
339
|
decodedOption2,
|
|
339
340
|
decoded2,
|
|
340
341
|
readOpencode2
|
|
341
|
-
} from "./chunk-
|
|
342
|
+
} from "./chunk-yg34g1m8.js";
|
|
342
343
|
import {
|
|
343
344
|
uploadRunFile,
|
|
344
345
|
programLease,
|
|
345
346
|
rpcRunFiles,
|
|
346
347
|
programHostsEnv,
|
|
347
348
|
undeclaredHostsEnv
|
|
348
|
-
} from "./chunk-
|
|
349
|
-
import"./chunk-
|
|
349
|
+
} from "./chunk-rv6d2r5v.js";
|
|
350
|
+
import"./chunk-4g7cj90y.js";
|
|
350
351
|
import {
|
|
351
352
|
nextInt
|
|
352
|
-
} from "./chunk-
|
|
353
|
-
import"./chunk-
|
|
353
|
+
} from "./chunk-gwzzacep.js";
|
|
354
|
+
import"./chunk-f2y0z04q.js";
|
|
354
355
|
import {
|
|
355
356
|
ChildProcessSpawner,
|
|
356
357
|
make3
|
|
357
|
-
} from "./chunk-
|
|
358
|
-
import"./chunk-
|
|
358
|
+
} from "./chunk-4pq5vq59.js";
|
|
359
|
+
import"./chunk-4v691rg5.js";
|
|
359
360
|
import {
|
|
360
361
|
Id,
|
|
361
362
|
secretReference,
|
|
362
363
|
secretPlaceholder
|
|
363
|
-
} from "./chunk-
|
|
364
|
+
} from "./chunk-x83q18w0.js";
|
|
364
365
|
|
|
365
366
|
// packages/core/src/sync-kit.ts
|
|
366
367
|
import { createHash } from "crypto";
|
|
@@ -5904,12 +5905,22 @@ var antigravityWait = (said) => {
|
|
|
5904
5905
|
const [, hours, minutes, seconds] = /^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+(?:\.\d+)?)s)?$/.exec(span) ?? [];
|
|
5905
5906
|
return (Number(hours ?? 0) * 3600 + Number(minutes ?? 0) * 60 + Number(seconds ?? 0)) * 1000;
|
|
5906
5907
|
};
|
|
5907
|
-
var
|
|
5908
|
+
var antigravityErrorSaid = (line) => {
|
|
5908
5909
|
if (!isJsonObject(line) || line.source === "USER_EXPLICIT")
|
|
5909
5910
|
return;
|
|
5910
5911
|
if (line.type !== "ERROR_MESSAGE" && (line.status !== "ERROR" || line.type === "GENERIC"))
|
|
5911
5912
|
return;
|
|
5912
|
-
|
|
5913
|
+
return [line.error, line.content].find((said) => isString2(said) && said.trim() !== "") ?? "";
|
|
5914
|
+
};
|
|
5915
|
+
var antigravityError = (line) => {
|
|
5916
|
+
const said = antigravityErrorSaid(line)?.trim();
|
|
5917
|
+
return said === undefined || said === "" ? undefined : said;
|
|
5918
|
+
};
|
|
5919
|
+
var antigravityWentOn = (line) => isJsonObject(line) && (line.source === "USER_EXPLICIT" || line.source === "MODEL" && line.type === "PLANNER_RESPONSE");
|
|
5920
|
+
var antigravityProviderRefusal = (line) => {
|
|
5921
|
+
const said = antigravityErrorSaid(line);
|
|
5922
|
+
if (!isJsonObject(line) || said === undefined)
|
|
5923
|
+
return;
|
|
5913
5924
|
const summary = bounded(said);
|
|
5914
5925
|
if (quotaError.test(said)) {
|
|
5915
5926
|
const wait = antigravityWait(said);
|
|
@@ -5931,6 +5942,7 @@ var sessionRefusals = new Map([
|
|
|
5931
5942
|
["pi", piProviderRefusal],
|
|
5932
5943
|
["antigravity", antigravityProviderRefusal]
|
|
5933
5944
|
]);
|
|
5945
|
+
var sessionErrors = new Map([["antigravity", { said: antigravityError, wentOn: antigravityWentOn }]]);
|
|
5934
5946
|
var count = (value) => isNumber2(value) && value > 0 ? Math.floor(value) : 0;
|
|
5935
5947
|
var tokenCounter = (harness) => {
|
|
5936
5948
|
const counted = { input: 0, output: 0, cached: 0 };
|
|
@@ -6273,6 +6285,7 @@ var transcriptRelay = (input) => {
|
|
|
6273
6285
|
const asking = new Set;
|
|
6274
6286
|
let loginLost;
|
|
6275
6287
|
let refusal;
|
|
6288
|
+
let harnessError;
|
|
6276
6289
|
let codexLimits;
|
|
6277
6290
|
let errorReadAt;
|
|
6278
6291
|
let opencodeModel;
|
|
@@ -6379,6 +6392,12 @@ var transcriptRelay = (input) => {
|
|
|
6379
6392
|
heard(refused);
|
|
6380
6393
|
else if (events.length > 0 || input.harness === "pi" && piReplied(value))
|
|
6381
6394
|
refusal = undefined;
|
|
6395
|
+
const errors = sessionErrors.get(input.harness);
|
|
6396
|
+
const errored = errors?.said(value);
|
|
6397
|
+
if (errored !== undefined)
|
|
6398
|
+
harnessError = errored;
|
|
6399
|
+
else if (errors?.wentOn(value) === true)
|
|
6400
|
+
harnessError = undefined;
|
|
6382
6401
|
return events.slice(0, maxEventsPerLine);
|
|
6383
6402
|
}))).pipe(uninterruptible);
|
|
6384
6403
|
yield* yieldNow;
|
|
@@ -6496,6 +6515,7 @@ var transcriptRelay = (input) => {
|
|
|
6496
6515
|
asking: sync2(() => asking.size > 0),
|
|
6497
6516
|
loginLost: sync2(() => loginLost),
|
|
6498
6517
|
refusal: sync2(() => refusal),
|
|
6518
|
+
harnessError: sync2(() => harnessError),
|
|
6499
6519
|
ranModel: sync2(() => opencodeModel ?? tokens.model()),
|
|
6500
6520
|
tokens: (source) => gen(function* () {
|
|
6501
6521
|
const own = tokens.tokens();
|
|
@@ -6564,6 +6584,55 @@ var sessionLines = (file) => gen(function* () {
|
|
|
6564
6584
|
}
|
|
6565
6585
|
});
|
|
6566
6586
|
|
|
6587
|
+
// packages/agent-runtime/src/harness-error-diagnosis.ts
|
|
6588
|
+
var harnessLogs = new Map([["antigravity", ".gemini/antigravity-cli/log"]]);
|
|
6589
|
+
var logTailBytes = 256 * 1024;
|
|
6590
|
+
var loggedErrorsKept = 8;
|
|
6591
|
+
var glogLine = /^([IWEF])\d{4} \d{2}:\d{2}:\d{2}\.\d+\s+\d+ [^\]]+\] (.+)$/;
|
|
6592
|
+
var loggedErrors = (log) => {
|
|
6593
|
+
const errors = log.split(`
|
|
6594
|
+
`).flatMap((line) => {
|
|
6595
|
+
const [, level, said] = glogLine.exec(line.trim()) ?? [];
|
|
6596
|
+
return said !== undefined && (level === "E" || level === "F" || /error ID:/i.test(said)) ? [said.trim()] : [];
|
|
6597
|
+
});
|
|
6598
|
+
return [...new Set(errors.toReversed())].slice(0, loggedErrorsKept).toReversed();
|
|
6599
|
+
};
|
|
6600
|
+
var pieceChars = 2000;
|
|
6601
|
+
var diagnosisChars = 8000;
|
|
6602
|
+
var whole = (said) => {
|
|
6603
|
+
const redacted = redactCredentials(said);
|
|
6604
|
+
return redacted.length <= pieceChars ? redacted : `[${redacted.length} characters left out]`;
|
|
6605
|
+
};
|
|
6606
|
+
var harnessErrorDiagnosis = (said) => {
|
|
6607
|
+
const session = said.sessionError === undefined ? [] : [`Its session's last error: ${whole(said.sessionError)}`];
|
|
6608
|
+
const logged = said.loggedErrors.map((error) => `- ${whole(error)}`);
|
|
6609
|
+
while (logged.length > 0 && [...session, "Its log ended with these errors:", ...logged].join(`
|
|
6610
|
+
`).length > diagnosisChars)
|
|
6611
|
+
logged.shift();
|
|
6612
|
+
const lines = [...session, ...logged.length === 0 ? [] : ["Its log ended with these errors:", ...logged]];
|
|
6613
|
+
return lines.length === 0 ? undefined : lines.join(`
|
|
6614
|
+
`);
|
|
6615
|
+
};
|
|
6616
|
+
var harnessLogErrors = (harness, home) => gen(function* () {
|
|
6617
|
+
const directory = harnessLogs.get(harness);
|
|
6618
|
+
if (directory === undefined)
|
|
6619
|
+
return [];
|
|
6620
|
+
const fs = yield* FileSystem;
|
|
6621
|
+
const path = yield* Path;
|
|
6622
|
+
const logs = path.join(home, directory);
|
|
6623
|
+
if (!(yield* fs.exists(logs)))
|
|
6624
|
+
return [];
|
|
6625
|
+
const latest = (yield* fs.readDirectory(logs)).filter((name) => name.endsWith(".log")).toSorted().at(-1);
|
|
6626
|
+
if (latest === undefined)
|
|
6627
|
+
return [];
|
|
6628
|
+
const place = { path: path.join(logs, latest), confinedTo: home };
|
|
6629
|
+
const size = yield* sessionFileSize(place);
|
|
6630
|
+
const from = Math.max(0, size - logTailBytes);
|
|
6631
|
+
const text = new TextDecoder().decode(yield* readSessionRange(place, from, logTailBytes));
|
|
6632
|
+
return loggedErrors(from === 0 ? text : text.slice(text.indexOf(`
|
|
6633
|
+
`) + 1));
|
|
6634
|
+
}).pipe(catch_((error) => as(logWarning("runner_harness_log_unread", error.message), Array.of())));
|
|
6635
|
+
|
|
6567
6636
|
// packages/agent-runtime/src/agent-step-executor.ts
|
|
6568
6637
|
import { DANGEROUS_DIRECTORIES, DANGEROUS_FILES } from "@anthropic-ai/sandbox-runtime/dist/sandbox/sandbox-utils.js";
|
|
6569
6638
|
var newSessionId = SecureRandom.pipe(flatMap3((random) => random.uuidV4()), provide3(layerWebCrypto));
|
|
@@ -7157,6 +7226,7 @@ ${afterMergeFailed}`];
|
|
|
7157
7226
|
let tokens;
|
|
7158
7227
|
let ranModel;
|
|
7159
7228
|
let launched = false;
|
|
7229
|
+
let harnessErrorSaid;
|
|
7160
7230
|
const attemptScope = yield* scope2;
|
|
7161
7231
|
const relayed = relay === undefined || adapter === undefined ? void_3 : gen(function* () {
|
|
7162
7232
|
source ??= yield* transcriptSource(adapter, {
|
|
@@ -7261,6 +7331,18 @@ ${afterMergeFailed}`];
|
|
|
7261
7331
|
yield* interrupt(relaying);
|
|
7262
7332
|
const state = isSuccess2(exit) ? exit.value.status : hasInterrupts(exit) ? "canceled" : "failed";
|
|
7263
7333
|
yield* relayed.pipe(timeout("5 seconds"), ignore);
|
|
7334
|
+
if (isSuccess2(exit) && "restart" in exit.value && exit.value.restart?.reason === "harness_error") {
|
|
7335
|
+
const sessionError = yield* relay.harnessError;
|
|
7336
|
+
const logged = yield* harnessLogErrors(adapter?.id ?? "", sessions.home);
|
|
7337
|
+
harnessErrorSaid = harnessErrorDiagnosis({
|
|
7338
|
+
...sessionError === undefined ? undefined : { sessionError },
|
|
7339
|
+
loggedErrors: logged
|
|
7340
|
+
});
|
|
7341
|
+
if (harnessErrorSaid !== undefined) {
|
|
7342
|
+
yield* logWarning("agent_harness_error", { attempt: work.id, said: harnessErrorSaid });
|
|
7343
|
+
yield* relay.record([{ kind: "harness_error", text: harnessErrorSaid }]);
|
|
7344
|
+
}
|
|
7345
|
+
}
|
|
7264
7346
|
const spentNow = yield* relay.tokens(source).pipe(timeoutOrElse({ duration: "5 seconds", orElse: () => relay.tokens(undefined) }));
|
|
7265
7347
|
tokens = spentNow;
|
|
7266
7348
|
ranModel = yield* relay.ranModel;
|
|
@@ -7291,16 +7373,17 @@ ${afterMergeFailed}`];
|
|
|
7291
7373
|
harnessHold: refusalHold(refused),
|
|
7292
7374
|
...spent
|
|
7293
7375
|
};
|
|
7294
|
-
if (backend === "docker" && "restart" in ran && ran.restart
|
|
7376
|
+
if (backend === "docker" && "restart" in ran && ran.restart?.reason === "login_revoked")
|
|
7295
7377
|
return {
|
|
7296
7378
|
status: "failed",
|
|
7297
7379
|
failureSummary: ran.summary,
|
|
7298
7380
|
harnessHold: refusalHold({ summary: ran.summary, kind: "login_refused" }),
|
|
7299
7381
|
...spent
|
|
7300
7382
|
};
|
|
7383
|
+
const recordedWhy = " Its Transcript records what the Harness said of the error.";
|
|
7301
7384
|
return {
|
|
7302
7385
|
status: ran.status,
|
|
7303
|
-
failureSummary: ran.summary
|
|
7386
|
+
failureSummary: harnessErrorSaid === undefined || ran.summary.length + recordedWhy.length > loopSafeTextMaxLength ? ran.summary : `${ran.summary}${recordedWhy}`,
|
|
7304
7387
|
..."harnessHold" in ran && ran.harnessHold !== undefined ? { harnessHold: ran.harnessHold } : undefined,
|
|
7305
7388
|
..."restart" in ran && ran.restart !== undefined ? { restart: ran.restart } : undefined,
|
|
7306
7389
|
...spent
|
|
@@ -7927,7 +8010,7 @@ var codexAppServer = (binary = "codex") => (env) => gen(function* () {
|
|
|
7927
8010
|
return {
|
|
7928
8011
|
request: (method, params) => gen(function* () {
|
|
7929
8012
|
const id = ++lastId;
|
|
7930
|
-
const deferred = yield*
|
|
8013
|
+
const deferred = yield* make15();
|
|
7931
8014
|
pending.set(id, deferred);
|
|
7932
8015
|
yield* send({ id, method, params });
|
|
7933
8016
|
return yield* _await(deferred).pipe(mapError2((error) => new CodexAppServerFailed({ reason: `${method}: ${error.message}` })));
|
|
@@ -8070,7 +8153,7 @@ var kitmanMcpPreflight = (mcp) => gen(function* () {
|
|
|
8070
8153
|
const server = yield* spawner.spawn(make3(mcp.command, [...mcp.args], {
|
|
8071
8154
|
extendEnv: true,
|
|
8072
8155
|
env: mcp.env,
|
|
8073
|
-
stdin: { stream:
|
|
8156
|
+
stdin: { stream: make10(new TextEncoder().encode(handshake)), endOnDone: false },
|
|
8074
8157
|
stderr: "ignore"
|
|
8075
8158
|
}));
|
|
8076
8159
|
const reply = yield* server.stdout.pipe(decodeText, splitLines, map2((line) => getOrUndefined(decodeJsonStringOption(line))), filter((message) => isJsonObject(message) && message.id === 2), runHead);
|
|
@@ -8144,7 +8227,7 @@ var programProcessExecutor = (input) => (work) => gen(function* () {
|
|
|
8144
8227
|
const exitCode = sandbox === undefined ? yield* gen(function* () {
|
|
8145
8228
|
const spawner = yield* ChildProcessSpawner;
|
|
8146
8229
|
const handle = yield* spawner.spawn(make3(input.bun ?? process.execPath, [file], {
|
|
8147
|
-
stdin:
|
|
8230
|
+
stdin: make10(new TextEncoder().encode(stdin)),
|
|
8148
8231
|
stdout: "inherit",
|
|
8149
8232
|
stderr: "inherit",
|
|
8150
8233
|
extendEnv: false,
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
opaqueTunnelRefusal2,
|
|
5
5
|
isOpaqueConnectReason2,
|
|
6
6
|
runSrtStep2
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import"./chunk-
|
|
9
|
-
import"./chunk-
|
|
7
|
+
} from "./chunk-sd8b4k1t.js";
|
|
8
|
+
import"./chunk-x83q18w0.js";
|
|
9
|
+
import"./chunk-rfnasm3c.js";
|
|
10
10
|
export {
|
|
11
11
|
isOpaqueConnectReason2 as isOpaqueConnectReason,
|
|
12
12
|
opaqueTunnelRefusal2 as opaqueTunnelRefusal,
|
|
@@ -2195,7 +2195,7 @@ var pathOfLink = (link) => {
|
|
|
2195
2195
|
return page === null ? link : page[1] || "index";
|
|
2196
2196
|
};
|
|
2197
2197
|
var UnpinnedSdkLink = "https://cdn.jsdelivr.net/npm/@kitman-sh/sdk/";
|
|
2198
|
-
var pinnedLink2 = (link, version = "0.
|
|
2198
|
+
var pinnedLink2 = (link, version = "0.16.0") => version === undefined || !link.startsWith(UnpinnedSdkLink) ? link : link.replace(UnpinnedSdkLink, `https://cdn.jsdelivr.net/npm/@kitman-sh/sdk@${version}/`);
|
|
2199
2199
|
var pageOf = (path) => path.split("#")[0];
|
|
2200
2200
|
var exportName = (section) => section.path.startsWith("sdk/") ? section.path.split("#")[1] ?? "" : "";
|
|
2201
2201
|
function excerpt(text, queryTerms) {
|