@kitman-sh/cli 0.14.5 → 0.14.7
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-s6bcx409.js → chunk-64zvzv63.js} +6 -6
- package/dist/{chunk-4qpmjrd2.js → chunk-79g5zh2p.js} +2 -2
- package/dist/{chunk-c80dvhxf.js → chunk-8k6adfg7.js} +1 -1
- package/dist/{chunk-me5hk67r.js → chunk-9yenzg12.js} +18 -18
- package/dist/{chunk-cs0b1w4z.js → chunk-ag19ejy7.js} +9 -9
- package/dist/{chunk-mwdgz2s2.js → chunk-aj2608jz.js} +413 -146
- package/dist/{chunk-77jk3v8v.js → chunk-b009hdm0.js} +5 -5
- package/dist/{chunk-vt8aqeby.js → chunk-bbf0jzsc.js} +1 -1
- package/dist/{chunk-rbbh4f56.js → chunk-bdd62njv.js} +36 -178
- package/dist/{chunk-fch7pjzh.js → chunk-bpx2zjh7.js} +4 -2
- package/dist/{chunk-reb6rftm.js → chunk-bty0mbn4.js} +203 -31
- package/dist/{chunk-vt5p65jd.js → chunk-c9j28q63.js} +22 -22
- package/dist/{chunk-p2p3k2d5.js → chunk-cn86thbx.js} +4 -4
- package/dist/{chunk-zdfrtydr.js → chunk-d2bqqd9t.js} +5 -5
- package/dist/{chunk-07xpz8bh.js → chunk-gnhfwa99.js} +1 -1
- package/dist/{chunk-4ywn8fya.js → chunk-htxs2z8d.js} +6 -6
- package/dist/{chunk-jp7cjnng.js → chunk-hz4t408c.js} +4 -4
- package/dist/{chunk-4vrfpwcr.js → chunk-jv4p85q5.js} +32 -9
- package/dist/{chunk-hbfwyjak.js → chunk-qkh0dhad.js} +3 -3
- package/dist/{chunk-d2x7y78c.js → chunk-rjz0pnf9.js} +4 -4
- package/dist/{chunk-k32w2t9h.js → chunk-s7rhz991.js} +6 -6
- package/dist/{chunk-93xj74qp.js → chunk-w8pevmva.js} +3 -3
- package/dist/{chunk-mz803qps.js → chunk-xxx61cda.js} +34 -30
- package/dist/{chunk-cwdrhsvk.js → chunk-y6njjend.js} +2 -2
- package/dist/{chunk-wttgq85b.js → chunk-zpp4jg4a.js} +60 -60
- package/dist/index.js +4 -4
- package/package.json +1 -1
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
getOrElse,
|
|
17
17
|
getOrUndefined,
|
|
18
18
|
liftThrowable,
|
|
19
|
+
map4,
|
|
19
20
|
flatMap,
|
|
20
21
|
toArray,
|
|
21
22
|
filter2,
|
|
@@ -41,7 +42,7 @@ import {
|
|
|
41
42
|
isFailure2,
|
|
42
43
|
hasInterrupts,
|
|
43
44
|
makeUnsafe5,
|
|
44
|
-
|
|
45
|
+
make15,
|
|
45
46
|
_await,
|
|
46
47
|
fail5,
|
|
47
48
|
isDoneUnsafe,
|
|
@@ -168,14 +169,13 @@ import {
|
|
|
168
169
|
decodeJsonStringSync,
|
|
169
170
|
encodeUnknownJsonStringSync,
|
|
170
171
|
storable
|
|
171
|
-
} from "./chunk-
|
|
172
|
+
} from "./chunk-zpp4jg4a.js";
|
|
172
173
|
import {
|
|
173
174
|
Id,
|
|
174
175
|
secretReference,
|
|
175
176
|
secretPlaceholder
|
|
176
|
-
} from "./chunk-
|
|
177
|
+
} from "./chunk-8k6adfg7.js";
|
|
177
178
|
import {
|
|
178
|
-
currentTimeMillis,
|
|
179
179
|
SecureRandom,
|
|
180
180
|
layerWebCrypto,
|
|
181
181
|
layer,
|
|
@@ -254,8 +254,9 @@ import {
|
|
|
254
254
|
checkServicesFile,
|
|
255
255
|
checkServices,
|
|
256
256
|
serviceChecks
|
|
257
|
-
} from "./chunk-
|
|
257
|
+
} from "./chunk-aj2608jz.js";
|
|
258
258
|
import {
|
|
259
|
+
currentTimeMillis,
|
|
259
260
|
join,
|
|
260
261
|
interrupt,
|
|
261
262
|
unbounded,
|
|
@@ -263,7 +264,7 @@ import {
|
|
|
263
264
|
unbounded2,
|
|
264
265
|
offer,
|
|
265
266
|
makeUnsafe3,
|
|
266
|
-
|
|
267
|
+
make10,
|
|
267
268
|
fromQueue,
|
|
268
269
|
fromPubSub,
|
|
269
270
|
map2,
|
|
@@ -285,6 +286,7 @@ import {
|
|
|
285
286
|
operatorConfigHome,
|
|
286
287
|
tempDirectoryScoped,
|
|
287
288
|
harnessesUnsupportedInSrt2,
|
|
289
|
+
harnessesUnsupportedInDocker2,
|
|
288
290
|
compiled2,
|
|
289
291
|
pinnedSrtCommand2,
|
|
290
292
|
pinnedSrtStepCommand2,
|
|
@@ -298,7 +300,7 @@ import {
|
|
|
298
300
|
writeSrtSettings2,
|
|
299
301
|
srtStepArgv2,
|
|
300
302
|
srtArgv2
|
|
301
|
-
} from "./chunk-
|
|
303
|
+
} from "./chunk-bdd62njv.js";
|
|
302
304
|
import {
|
|
303
305
|
writeAgentEnvironmentConfigFile2,
|
|
304
306
|
readManifestSkillPaths2,
|
|
@@ -314,8 +316,8 @@ import {
|
|
|
314
316
|
applyAgentEnvironmentMaterialization2,
|
|
315
317
|
isPathWithin2,
|
|
316
318
|
skillIdentity2
|
|
317
|
-
} from "./chunk-
|
|
318
|
-
import"./chunk-
|
|
319
|
+
} from "./chunk-cn86thbx.js";
|
|
320
|
+
import"./chunk-qkh0dhad.js";
|
|
319
321
|
import {
|
|
320
322
|
egressAllowed,
|
|
321
323
|
writeSecretRegistry,
|
|
@@ -325,7 +327,7 @@ import {
|
|
|
325
327
|
secretFilter2,
|
|
326
328
|
opaqueTunnelRefusal2,
|
|
327
329
|
isOpaqueConnectReason2
|
|
328
|
-
} from "./chunk-
|
|
330
|
+
} from "./chunk-y6njjend.js";
|
|
329
331
|
import {
|
|
330
332
|
sliceBytes2,
|
|
331
333
|
maxLineBytes2,
|
|
@@ -333,23 +335,23 @@ import {
|
|
|
333
335
|
decodedOption2,
|
|
334
336
|
decoded2,
|
|
335
337
|
readOpencode2
|
|
336
|
-
} from "./chunk-
|
|
338
|
+
} from "./chunk-b009hdm0.js";
|
|
337
339
|
import {
|
|
338
340
|
uploadRunFile,
|
|
339
341
|
programLease,
|
|
340
342
|
rpcRunFiles,
|
|
341
343
|
programHostsEnv,
|
|
342
344
|
undeclaredHostsEnv
|
|
343
|
-
} from "./chunk-
|
|
344
|
-
import"./chunk-
|
|
345
|
+
} from "./chunk-d2bqqd9t.js";
|
|
346
|
+
import"./chunk-s7rhz991.js";
|
|
345
347
|
import {
|
|
346
348
|
nextInt
|
|
347
|
-
} from "./chunk-
|
|
349
|
+
} from "./chunk-bbf0jzsc.js";
|
|
348
350
|
import {
|
|
349
351
|
ChildProcessSpawner,
|
|
350
352
|
make3
|
|
351
|
-
} from "./chunk-
|
|
352
|
-
import"./chunk-
|
|
353
|
+
} from "./chunk-79g5zh2p.js";
|
|
354
|
+
import"./chunk-9yenzg12.js";
|
|
353
355
|
|
|
354
356
|
// packages/core/src/sync-kit.ts
|
|
355
357
|
import { createHash } from "crypto";
|
|
@@ -1895,12 +1897,42 @@ var HarnessAdapters = [
|
|
|
1895
1897
|
login: { source: ".local/share/opencode/auth.json", path: "data/opencode/auth.json" },
|
|
1896
1898
|
configHomeDirectory: "opencode"
|
|
1897
1899
|
}
|
|
1900
|
+
},
|
|
1901
|
+
{
|
|
1902
|
+
id: "antigravity",
|
|
1903
|
+
binary: "agy",
|
|
1904
|
+
form: "interactive",
|
|
1905
|
+
modelFlag: "--model",
|
|
1906
|
+
auth: ["~/.gemini"],
|
|
1907
|
+
providerHosts: ["cloudcode-pa.googleapis.com", "oauth2.googleapis.com"],
|
|
1908
|
+
effortArgs: ["--effort", "{effort}"],
|
|
1909
|
+
autoPermissionArgs: ["--dangerously-skip-permissions"],
|
|
1910
|
+
ownHome: {
|
|
1911
|
+
own: [".gemini", ".agents"],
|
|
1912
|
+
copies: [".gemini/antigravity-cli/cache/onboarding.json", ".gemini/antigravity-cli/jetski_state.pbtxt"]
|
|
1913
|
+
},
|
|
1914
|
+
settings: {
|
|
1915
|
+
path: ".gemini/antigravity-cli/settings.json",
|
|
1916
|
+
values: {
|
|
1917
|
+
agentMode: "accept-edits",
|
|
1918
|
+
toolPermission: "always-proceed",
|
|
1919
|
+
enableTerminalSandbox: false,
|
|
1920
|
+
artifactReviewPolicy: "always-proceed",
|
|
1921
|
+
showTips: false,
|
|
1922
|
+
showFeedbackSurvey: false
|
|
1923
|
+
},
|
|
1924
|
+
trustKey: "trustedWorkspaces"
|
|
1925
|
+
},
|
|
1926
|
+
mcp: { kind: "config_dir_file", path: ".gemini/config/mcp_config.json", inheritsEnv: true },
|
|
1927
|
+
mcpToolTimeout: { kind: "server_field", field: "timeoutSeconds", unit: "s" },
|
|
1928
|
+
skills: { kind: "found", root: ".agents/skills" },
|
|
1929
|
+
session: { location: { root: ".gemini/antigravity-cli/brain", layout: "per_conversation", inConfigDir: true } }
|
|
1898
1930
|
}
|
|
1899
1931
|
];
|
|
1900
1932
|
var sessionArgs = (adapter, session) => {
|
|
1901
1933
|
if (adapter.session === undefined || session === undefined)
|
|
1902
1934
|
return [];
|
|
1903
|
-
const args = session.transcript === undefined ? adapter.session.start ?? [] : adapter.session.resume;
|
|
1935
|
+
const args = session.transcript === undefined ? adapter.session.start ?? [] : adapter.session.resume ?? [];
|
|
1904
1936
|
return args.map((arg) => arg.replace("{session}", session.id).replace("{transcript}", session.transcript ?? ""));
|
|
1905
1937
|
};
|
|
1906
1938
|
var kitmanMcpToolTimeoutSeconds = 24 * 60 * 60;
|
|
@@ -1941,7 +1973,33 @@ function resolveHarnessLaunch(input) {
|
|
|
1941
1973
|
...temporary,
|
|
1942
1974
|
args: [...temporary.args, ...input.adapter.effortArgs.map((arg) => arg.replace("{effort}", effort))]
|
|
1943
1975
|
};
|
|
1944
|
-
return flagProbedLaunch(input.adapter, globalConfigLaunch(input, sandboxHomeLaunch(input, effortful)));
|
|
1976
|
+
return flagProbedLaunch(input.adapter, settingsLaunch(input, ownHomeLaunch(input, globalConfigLaunch(input, sandboxHomeLaunch(input, effortful)))));
|
|
1977
|
+
}
|
|
1978
|
+
function settingsLaunch(input, launch) {
|
|
1979
|
+
const { settings } = input.adapter;
|
|
1980
|
+
if (settings === undefined)
|
|
1981
|
+
return launch;
|
|
1982
|
+
const values = input.workspace === undefined ? settings.values : { ...settings.values, [settings.trustKey]: [input.workspace] };
|
|
1983
|
+
return {
|
|
1984
|
+
...launch,
|
|
1985
|
+
files: [...launch.files, { path: `${input.configDir}/${settings.path}`, content: JSON.stringify(values) }]
|
|
1986
|
+
};
|
|
1987
|
+
}
|
|
1988
|
+
function ownHomeLaunch(input, launch) {
|
|
1989
|
+
const own = input.adapter.ownHome;
|
|
1990
|
+
if (own === undefined)
|
|
1991
|
+
return launch;
|
|
1992
|
+
const home = input.home ?? homedir();
|
|
1993
|
+
return {
|
|
1994
|
+
...launch,
|
|
1995
|
+
env: { ...launch.env, HOME: input.configDir },
|
|
1996
|
+
ownHome: {
|
|
1997
|
+
path: input.configDir,
|
|
1998
|
+
source: home,
|
|
1999
|
+
own: own.own,
|
|
2000
|
+
copies: own.copies.map((file) => ({ path: `${input.configDir}/${file}`, source: `${home}/${file}` }))
|
|
2001
|
+
}
|
|
2002
|
+
};
|
|
1945
2003
|
}
|
|
1946
2004
|
var sandboxedLaunch = (launch, backend) => {
|
|
1947
2005
|
const sandboxed = launch.sandboxed;
|
|
@@ -2175,6 +2233,7 @@ function skillsLaunch(input) {
|
|
|
2175
2233
|
case "flag":
|
|
2176
2234
|
return names.flatMap((name) => [loading.flag, `${root}/${name}`]);
|
|
2177
2235
|
case "config_paths":
|
|
2236
|
+
case "found":
|
|
2178
2237
|
return [];
|
|
2179
2238
|
}
|
|
2180
2239
|
})();
|
|
@@ -2267,7 +2326,12 @@ function mcpLaunch(input, skillsDir) {
|
|
|
2267
2326
|
binary: adapter.binary,
|
|
2268
2327
|
args: [...session, ...accessArgs, ...model],
|
|
2269
2328
|
env: { ...timeoutEnv, ...browserEnv },
|
|
2270
|
-
files: [
|
|
2329
|
+
files: [
|
|
2330
|
+
{
|
|
2331
|
+
path: `${input.configDir}/${delivery.path}`,
|
|
2332
|
+
content: delivery.inheritsEnv === true ? JSON.stringify({ mcpServers: { kitman: { ...server, ...serverFields }, ...kitServers } }) : fileConfig()
|
|
2333
|
+
}
|
|
2334
|
+
]
|
|
2271
2335
|
};
|
|
2272
2336
|
case "config_env":
|
|
2273
2337
|
return {
|
|
@@ -2634,6 +2698,7 @@ var prepareHarness = (input) => gen(function* () {
|
|
|
2634
2698
|
`),
|
|
2635
2699
|
home: input.home,
|
|
2636
2700
|
configHome: yield* operatorConfigHome(input.home),
|
|
2701
|
+
workspace: input.workspace,
|
|
2637
2702
|
...input.agent.session === undefined ? undefined : {
|
|
2638
2703
|
session: {
|
|
2639
2704
|
id: input.agent.session.id,
|
|
@@ -3043,7 +3108,8 @@ var writeHarnessFiles = (input) => gen(function* () {
|
|
|
3043
3108
|
const globalConfig = input.carryOperatorFiles ? input.launch.globalConfig : undefined;
|
|
3044
3109
|
const globalConfigFiles = globalConfig === undefined ? [] : yield* carriedGlobalConfig(globalConfig, input.loginReference).pipe(mapError2(() => unwritable));
|
|
3045
3110
|
const files = [...input.launch.files, ...settings, ...providers, ...globalConfigFiles];
|
|
3046
|
-
const
|
|
3111
|
+
const ownHome = input.carryOperatorFiles ? input.launch.ownHome : undefined;
|
|
3112
|
+
const copies = [...carried?.copies ?? [], ...ownHome?.copies ?? []];
|
|
3047
3113
|
const links = renewed === undefined ? [] : [renewed];
|
|
3048
3114
|
const globalConfigLinks = globalConfig?.links ?? [];
|
|
3049
3115
|
if ([...files, ...copies, ...links, ...globalConfigLinks].some((file) => !isPathWithin2(path, input.configDir, file.path)))
|
|
@@ -3058,6 +3124,16 @@ var writeHarnessFiles = (input) => gen(function* () {
|
|
|
3058
3124
|
}
|
|
3059
3125
|
for (const link of globalConfigLinks)
|
|
3060
3126
|
yield* fs.makeDirectory(link.target, { recursive: true }).pipe(andThen2(fs.makeDirectory(path.dirname(link.path), { recursive: true })), andThen2(fs.symlink(link.target, link.path)), mapError2(() => unwritable));
|
|
3127
|
+
if (ownHome !== undefined) {
|
|
3128
|
+
if (!isPathWithin2(path, input.configDir, ownHome.path))
|
|
3129
|
+
return yield* unwritable;
|
|
3130
|
+
for (const entry of yield* fs.readDirectory(ownHome.source).pipe(mapError2(() => unwritable))) {
|
|
3131
|
+
const link = path.join(ownHome.path, entry);
|
|
3132
|
+
if (ownHome.own.includes(entry) || (yield* fs.exists(link).pipe(orElseSucceed(() => true))))
|
|
3133
|
+
continue;
|
|
3134
|
+
yield* fs.symlink(path.join(ownHome.source, entry), link).pipe(mapError2(() => unwritable));
|
|
3135
|
+
}
|
|
3136
|
+
}
|
|
3061
3137
|
if (input.carryOperatorFiles && input.launch.homeDirectory !== undefined)
|
|
3062
3138
|
yield* fs.makeDirectory(input.launch.homeDirectory, { recursive: true }).pipe(mapError2(() => unwritable));
|
|
3063
3139
|
if (renewed === undefined || login === undefined || !login.isPublished())
|
|
@@ -3576,6 +3652,9 @@ var worktreeSessionDirectory = (adapter, home, worktree) => {
|
|
|
3576
3652
|
return `${home}/${location.root}/${stampedDirectory(worktree)}`;
|
|
3577
3653
|
return;
|
|
3578
3654
|
};
|
|
3655
|
+
var uuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
|
|
3656
|
+
var conversationTranscript = ".system_generated/logs/transcript_full.jsonl";
|
|
3657
|
+
var toMillis2 = (date) => date.getTime();
|
|
3579
3658
|
var rolloutId = /([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.jsonl$/;
|
|
3580
3659
|
var filesIn = (directory) => gen(function* () {
|
|
3581
3660
|
const fs = yield* FileSystem;
|
|
@@ -3636,6 +3715,23 @@ var findSession = (adapter, place) => gen(function* () {
|
|
|
3636
3715
|
const path = (yield* fs.exists(own)) ? own : (yield* sessionFiles(root, 1, confined?.confinedTo)).find((file) => file.endsWith(`/${name}`));
|
|
3637
3716
|
return path === undefined ? undefined : { id: place.id, name, path, ...confined };
|
|
3638
3717
|
}
|
|
3718
|
+
if (location.layout === "per_conversation") {
|
|
3719
|
+
const fs = yield* FileSystem;
|
|
3720
|
+
const conversations = (yield* sessionFiles(root, 0, confined?.confinedTo)).flatMap((directory) => {
|
|
3721
|
+
const id = directory.slice(directory.lastIndexOf("/") + 1);
|
|
3722
|
+
return uuid.test(id) && (place.id === undefined || id === place.id) ? [{ id, path: `${directory}/${conversationTranscript}` }] : [];
|
|
3723
|
+
});
|
|
3724
|
+
let newest;
|
|
3725
|
+
for (const conversation of conversations) {
|
|
3726
|
+
const stat = yield* fs.stat(conversation.path).pipe(option2);
|
|
3727
|
+
if (isNone(stat) || stat.value.type !== "File")
|
|
3728
|
+
continue;
|
|
3729
|
+
const changed = getOrElse(map4(stat.value.mtime, toMillis2), () => 0);
|
|
3730
|
+
if (newest === undefined || changed > newest.changed)
|
|
3731
|
+
newest = { ...conversation, changed };
|
|
3732
|
+
}
|
|
3733
|
+
return newest === undefined ? undefined : { id: newest.id, name: conversationTranscript, path: newest.path, ...confined };
|
|
3734
|
+
}
|
|
3639
3735
|
if (location.layout === "per_directory_stamped") {
|
|
3640
3736
|
if (place.id === undefined)
|
|
3641
3737
|
return;
|
|
@@ -3736,10 +3832,11 @@ var restoreSession = (adapter, place) => gen(function* () {
|
|
|
3736
3832
|
const directory = {
|
|
3737
3833
|
per_directory: `${root}/${projectDirectory(place.worktree)}`,
|
|
3738
3834
|
per_directory_stamped: `${root}/${stampedDirectory(place.worktree)}`,
|
|
3739
|
-
by_date: `${root}/${today}
|
|
3835
|
+
by_date: `${root}/${today}`,
|
|
3836
|
+
per_conversation: `${root}/${place.session.id}`
|
|
3740
3837
|
}[location.layout];
|
|
3741
3838
|
const path = `${directory}/${place.session.name}`;
|
|
3742
|
-
yield* fs.makeDirectory(
|
|
3839
|
+
yield* fs.makeDirectory(path.slice(0, path.lastIndexOf("/")), { recursive: true });
|
|
3743
3840
|
const content = yield* tryPromise(() => gunzipped(place.session.content));
|
|
3744
3841
|
yield* fs.writeFile(path, new Uint8Array(content));
|
|
3745
3842
|
return {
|
|
@@ -4044,6 +4141,7 @@ var systemStepProcessesLayer = effect(StepProcesses, gen(function* () {
|
|
|
4044
4141
|
|
|
4045
4142
|
// packages/agent-runtime/src/herdr-core-agent-backend.ts
|
|
4046
4143
|
var launchTimeout = "120 seconds";
|
|
4144
|
+
var startupBlockedMs = 5000;
|
|
4047
4145
|
var briefTries = 3;
|
|
4048
4146
|
var reconnectWindowMs = 30000;
|
|
4049
4147
|
var reconnectDelay = "250 millis";
|
|
@@ -4272,7 +4370,7 @@ var runAttempt = (request, options) => gen(function* () {
|
|
|
4272
4370
|
if (harnessesUnsupportedInSrt2.includes(adapter.id))
|
|
4273
4371
|
return yield* new AgentStepFailure({
|
|
4274
4372
|
reason: "harness_unsupported_in_sandbox",
|
|
4275
|
-
summary: "Codex cannot run in srt yet, because it writes to ~/.codex. Run this Step with another Harness, or set the sandbox of a personal Runner to host in its settings."
|
|
4373
|
+
summary: adapter.id === "codex" ? "Codex cannot run in srt yet, because it writes to ~/.codex. Run this Step with another Harness, or set the sandbox of a personal Runner to host in its settings." : `${adapter.id} cannot run in srt yet, because its login is in the OS keyring. Run this Step with another Harness, or set the sandbox of a personal Runner to host in its settings.`
|
|
4276
4374
|
});
|
|
4277
4375
|
const sessions = worktreeSessionDirectory(adapter, options.home, workspace);
|
|
4278
4376
|
const loginValues = yield* inheritedEnvironment2(adapter.loginSecrets ?? []);
|
|
@@ -4310,6 +4408,11 @@ var runAttempt = (request, options) => gen(function* () {
|
|
|
4310
4408
|
};
|
|
4311
4409
|
}
|
|
4312
4410
|
case "docker": {
|
|
4411
|
+
if (harnessesUnsupportedInDocker2.includes(adapter.id))
|
|
4412
|
+
return yield* new AgentStepFailure({
|
|
4413
|
+
reason: "harness_unsupported_in_sandbox",
|
|
4414
|
+
summary: `${adapter.id} cannot run in docker yet, because its login is in the OS keyring. Run this Step with another Harness, or set the sandbox of a personal Runner to host in its settings.`
|
|
4415
|
+
});
|
|
4313
4416
|
if (options.docker === undefined)
|
|
4314
4417
|
return yield* new AgentStepFailure({ reason: "sandbox_unavailable", summary: "`docker` is not available." });
|
|
4315
4418
|
const registry = referenced === undefined || Object.keys(referenced.registry).length === 0 ? undefined : yield* holdSecrets(referenced.registry);
|
|
@@ -4444,7 +4547,7 @@ var runAttempt = (request, options) => gen(function* () {
|
|
|
4444
4547
|
});
|
|
4445
4548
|
const ended = (signal) => (outcome) => ({ signal, outcome });
|
|
4446
4549
|
const ending = gen(function* () {
|
|
4447
|
-
const ready = yield* until(seen, (last) => last.end !== undefined || last.status !== null && last.status
|
|
4550
|
+
const ready = yield* raceFirst(until(seen, (last) => last.end !== undefined || last.status !== null && !["working", "blocked"].includes(last.status)), lastingStatus(seen, "blocked", Math.min(options.blockedGraceMs, startupBlockedMs))).pipe(timeoutOption(launchTimeout));
|
|
4448
4551
|
if (isNone(ready)) {
|
|
4449
4552
|
const shown = yield* readScreen;
|
|
4450
4553
|
yield* logWarning("agent_launch_timeout", { attempt: attempt.id, address, screen: shown });
|
|
@@ -5358,11 +5461,42 @@ var piProviderRefusal = (line) => {
|
|
|
5358
5461
|
return { summary, kind: "login_refused" };
|
|
5359
5462
|
return rateLimitError.test(said) ? { summary, kind: "rate_limited", retried: true } : undefined;
|
|
5360
5463
|
};
|
|
5464
|
+
var antigravityWait = (said) => {
|
|
5465
|
+
const delay = /quotaResetDelay\W{0,4}(\d+(?:\.\d+)?)s/i.exec(said)?.[1];
|
|
5466
|
+
if (delay !== undefined)
|
|
5467
|
+
return Number(delay) * 1000;
|
|
5468
|
+
const span = /reset(?:s)?\s+(?:after|in)\s+((?:\d+h)?(?:\d+m)?(?:\d+(?:\.\d+)?s)?)/i.exec(said)?.[1];
|
|
5469
|
+
if (span === undefined || span === "")
|
|
5470
|
+
return;
|
|
5471
|
+
const [, hours, minutes, seconds] = /^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+(?:\.\d+)?)s)?$/.exec(span) ?? [];
|
|
5472
|
+
return (Number(hours ?? 0) * 3600 + Number(minutes ?? 0) * 60 + Number(seconds ?? 0)) * 1000;
|
|
5473
|
+
};
|
|
5474
|
+
var antigravityProviderRefusal = (line) => {
|
|
5475
|
+
if (!isJsonObject(line) || line.source === "USER_EXPLICIT")
|
|
5476
|
+
return;
|
|
5477
|
+
if (line.type !== "ERROR_MESSAGE" && (line.status !== "ERROR" || line.type === "GENERIC"))
|
|
5478
|
+
return;
|
|
5479
|
+
const said = [line.error, line.content].find(isString2) ?? "";
|
|
5480
|
+
const summary = bounded(said);
|
|
5481
|
+
if (quotaError.test(said)) {
|
|
5482
|
+
const wait = antigravityWait(said);
|
|
5483
|
+
const at = isString2(line.created_at) ? Date.parse(line.created_at) : Number.NaN;
|
|
5484
|
+
return {
|
|
5485
|
+
summary,
|
|
5486
|
+
kind: "out_of_quota",
|
|
5487
|
+
...wait === undefined || wait <= 0 || Number.isNaN(at) ? undefined : { until: toIso(at + wait) }
|
|
5488
|
+
};
|
|
5489
|
+
}
|
|
5490
|
+
if (loginError.test(said))
|
|
5491
|
+
return { summary, kind: "login_refused" };
|
|
5492
|
+
return rateLimitError.test(said) ? { summary, kind: "rate_limited", retried: true } : undefined;
|
|
5493
|
+
};
|
|
5361
5494
|
var piReplied = (line) => isJsonObject(line) && line.type === "message" && isJsonObject(line.message) && line.message.role === "assistant";
|
|
5362
5495
|
var sessionRefusals = new Map([
|
|
5363
5496
|
["claude", claudeProviderRefusal],
|
|
5364
5497
|
["codex", codexProviderRefusal],
|
|
5365
|
-
["pi", piProviderRefusal]
|
|
5498
|
+
["pi", piProviderRefusal],
|
|
5499
|
+
["antigravity", antigravityProviderRefusal]
|
|
5366
5500
|
]);
|
|
5367
5501
|
var count = (value) => isNumber2(value) && value > 0 ? Math.floor(value) : 0;
|
|
5368
5502
|
var tokenCounter = (harness) => {
|
|
@@ -5432,10 +5566,19 @@ var tokenCounter = (harness) => {
|
|
|
5432
5566
|
cached: count(usage.cacheRead)
|
|
5433
5567
|
});
|
|
5434
5568
|
};
|
|
5569
|
+
const antigravity = (line) => {
|
|
5570
|
+
if (line.source !== "MODEL" || line.type !== "PLANNER_RESPONSE")
|
|
5571
|
+
return;
|
|
5572
|
+
ran(line.model);
|
|
5573
|
+
const fields = [line.input_tokens, line.output_tokens, line.cache_read_tokens];
|
|
5574
|
+
if (fields.some(isNumber2))
|
|
5575
|
+
add({ input: count(line.input_tokens), output: count(line.output_tokens), cached: count(line.cache_read_tokens) });
|
|
5576
|
+
};
|
|
5435
5577
|
const readers = new Map([
|
|
5436
5578
|
["claude", claude],
|
|
5437
5579
|
["codex", codex],
|
|
5438
|
-
["pi", pi]
|
|
5580
|
+
["pi", pi],
|
|
5581
|
+
["antigravity", antigravity]
|
|
5439
5582
|
]);
|
|
5440
5583
|
const read = readers.get(harness);
|
|
5441
5584
|
return {
|
|
@@ -5590,11 +5733,39 @@ var sessionNormalizer = (harness) => {
|
|
|
5590
5733
|
...stage === "settled" ? answered(part.callID, output, state.status === "error") : []
|
|
5591
5734
|
];
|
|
5592
5735
|
};
|
|
5736
|
+
const antigravityCalls = [];
|
|
5737
|
+
const antigravity = (line) => {
|
|
5738
|
+
if (line.source !== "MODEL")
|
|
5739
|
+
return [];
|
|
5740
|
+
if (line.type === "PLANNER_RESPONSE") {
|
|
5741
|
+
const step = isNumber2(line.step_index) ? line.step_index : 0;
|
|
5742
|
+
const said = isString2(line.content) && line.content.trim() !== "" ? line.content : undefined;
|
|
5743
|
+
return [
|
|
5744
|
+
...said === undefined ? [] : [{ kind: "message", role: "assistant", text: bounded(said) }],
|
|
5745
|
+
...(Array.isArray(line.tool_calls) ? line.tool_calls : []).flatMap((call, index) => {
|
|
5746
|
+
if (!isJsonObject(call) || !isString2(call.name))
|
|
5747
|
+
return [];
|
|
5748
|
+
const args = isJsonObject(call.args) ? call.args : {};
|
|
5749
|
+
const callId = `${step}.${index}`;
|
|
5750
|
+
if (antigravityCalls.length >= maxOpenParts)
|
|
5751
|
+
antigravityCalls.shift();
|
|
5752
|
+
antigravityCalls.push(callId);
|
|
5753
|
+
return call.name === "call_mcp_tool" && isString2(args.ServerName) && isString2(args.ToolName) ? called(callId, `mcp__${args.ServerName}__${args.ToolName}`, args.Arguments ?? {}) : called(callId, call.name, args);
|
|
5754
|
+
})
|
|
5755
|
+
];
|
|
5756
|
+
}
|
|
5757
|
+
const callId = line.type === "GENERIC" ? antigravityCalls.shift() : undefined;
|
|
5758
|
+
if (callId === undefined)
|
|
5759
|
+
return [];
|
|
5760
|
+
const output = (isString2(line.content) ? line.content : "").replace(/^(?:(?:Created|Completed) At: .*\n)+/, "");
|
|
5761
|
+
return answered(callId, output, line.status === "ERROR");
|
|
5762
|
+
};
|
|
5593
5763
|
const readers = new Map([
|
|
5594
5764
|
["claude", claude],
|
|
5595
5765
|
["codex", codex],
|
|
5596
5766
|
["pi", pi],
|
|
5597
|
-
["opencode", opencode]
|
|
5767
|
+
["opencode", opencode],
|
|
5768
|
+
["antigravity", antigravity]
|
|
5598
5769
|
]);
|
|
5599
5770
|
return (value) => isJsonObject(value) ? readers.get(harness)?.(value) ?? [] : [];
|
|
5600
5771
|
};
|
|
@@ -6368,7 +6539,7 @@ var stepAttempt = (input, resending) => (work) => gen(function* () {
|
|
|
6368
6539
|
yield* freshDirectory(writableSessions);
|
|
6369
6540
|
const sessions = adapter?.session?.location.inConfigDir === true ? { home: configDir } : backend === "docker" ? { home: dockerHome(configDir), confinedTo: configDir } : backend === "srt" && writableSessions !== undefined ? { home, confinedTo: writableSessions } : { home };
|
|
6370
6541
|
const storedSession = point?.session;
|
|
6371
|
-
const transcript = storedSession === undefined || adapter?.session === undefined || storedSession.harness !== adapter.id ? undefined : yield* restoreSession(adapter, { ...sessions, worktree, session: storedSession }).pipe(catch_((error) => as(logWarning("runner_session_not_restored", error.message), undefined)));
|
|
6542
|
+
const transcript = storedSession === undefined || adapter?.session?.resume === undefined || storedSession.harness !== adapter.id ? undefined : yield* restoreSession(adapter, { ...sessions, worktree, session: storedSession }).pipe(catch_((error) => as(logWarning("runner_session_not_restored", error.message), undefined)));
|
|
6372
6543
|
const session = {
|
|
6373
6544
|
id: transcript?.id ?? (yield* newSessionId),
|
|
6374
6545
|
...transcript === undefined ? undefined : { transcript: transcript.path },
|
|
@@ -7175,7 +7346,7 @@ var codexAppServer = (binary = "codex") => (env) => gen(function* () {
|
|
|
7175
7346
|
return {
|
|
7176
7347
|
request: (method, params) => gen(function* () {
|
|
7177
7348
|
const id = ++lastId;
|
|
7178
|
-
const deferred = yield*
|
|
7349
|
+
const deferred = yield* make15();
|
|
7179
7350
|
pending.set(id, deferred);
|
|
7180
7351
|
yield* send({ id, method, params });
|
|
7181
7352
|
return yield* _await(deferred).pipe(mapError2((error) => new CodexAppServerFailed({ reason: `${method}: ${error.message}` })));
|
|
@@ -7318,7 +7489,7 @@ var kitmanMcpPreflight = (mcp) => gen(function* () {
|
|
|
7318
7489
|
const server = yield* spawner.spawn(make3(mcp.command, [...mcp.args], {
|
|
7319
7490
|
extendEnv: true,
|
|
7320
7491
|
env: mcp.env,
|
|
7321
|
-
stdin: { stream:
|
|
7492
|
+
stdin: { stream: make10(new TextEncoder().encode(handshake)), endOnDone: false },
|
|
7322
7493
|
stderr: "ignore"
|
|
7323
7494
|
}));
|
|
7324
7495
|
const reply = yield* server.stdout.pipe(decodeText, splitLines, map2((line) => getOrUndefined(decodeJsonStringOption(line))), filter((message) => isJsonObject(message) && message.id === 2), runHead);
|
|
@@ -7392,7 +7563,7 @@ var programProcessExecutor = (input) => (work) => gen(function* () {
|
|
|
7392
7563
|
const exitCode = sandbox === undefined ? yield* gen(function* () {
|
|
7393
7564
|
const spawner = yield* ChildProcessSpawner;
|
|
7394
7565
|
const handle = yield* spawner.spawn(make3(input.bun ?? process.execPath, [file], {
|
|
7395
|
-
stdin:
|
|
7566
|
+
stdin: make10(new TextEncoder().encode(stdin)),
|
|
7396
7567
|
stdout: "inherit",
|
|
7397
7568
|
stderr: "inherit",
|
|
7398
7569
|
extendEnv: false,
|
|
@@ -8442,6 +8613,7 @@ export {
|
|
|
8442
8613
|
harnessConfigUnwritable,
|
|
8443
8614
|
harnessNetworkHosts,
|
|
8444
8615
|
harnessesInSrt,
|
|
8616
|
+
harnessesUnsupportedInDocker2 as harnessesUnsupportedInDocker,
|
|
8445
8617
|
harnessesUnsupportedInSrt2 as harnessesUnsupportedInSrt,
|
|
8446
8618
|
herdrAttemptLeased,
|
|
8447
8619
|
herdrCoreAgentBackendLayer,
|