wildcrane-runner 0.6.87 → 0.6.88
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/akb/dist/kanban.mjs +763 -658
- package/dist/akb/package.json +1 -1
- package/dist/akb-proxy.mjs +1 -1
- package/dist/codex-proxy.mjs +1 -1
- package/dist/codex-retained.mjs +1 -1
- package/dist/flow-worker-main.mjs +473 -371
- package/dist/launcher.mjs +333 -243
- package/dist/plugin.mjs +388 -298
- package/dist/runner.mjs +807 -701
- package/dist/settings.mjs +344 -254
- package/package.json +1 -1
package/dist/launcher.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// wildcrane-runner 0.6.
|
|
1
|
+
// wildcrane-runner 0.6.88 — built by runner/scripts/build.mjs. Do not edit.
|
|
2
2
|
import { createRequire as __ai4kanbanRequire } from 'node:module'
|
|
3
3
|
const require = __ai4kanbanRequire(import.meta.url)
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1146,14 +1146,14 @@ var require_util = __commonJS({
|
|
|
1146
1146
|
}
|
|
1147
1147
|
const port = url.port != null ? url.port : url.protocol === "https:" ? 443 : 80;
|
|
1148
1148
|
let origin = url.origin != null ? url.origin : `${url.protocol || ""}//${url.hostname || ""}:${port}`;
|
|
1149
|
-
let
|
|
1149
|
+
let path36 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`;
|
|
1150
1150
|
if (origin[origin.length - 1] === "/") {
|
|
1151
1151
|
origin = origin.slice(0, origin.length - 1);
|
|
1152
1152
|
}
|
|
1153
|
-
if (
|
|
1154
|
-
|
|
1153
|
+
if (path36 && path36[0] !== "/") {
|
|
1154
|
+
path36 = `/${path36}`;
|
|
1155
1155
|
}
|
|
1156
|
-
return new URL(`${origin}${
|
|
1156
|
+
return new URL(`${origin}${path36}`);
|
|
1157
1157
|
}
|
|
1158
1158
|
if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {
|
|
1159
1159
|
throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`.");
|
|
@@ -1988,9 +1988,9 @@ var require_diagnostics = __commonJS({
|
|
|
1988
1988
|
"undici:client:sendHeaders",
|
|
1989
1989
|
(evt) => {
|
|
1990
1990
|
const {
|
|
1991
|
-
request: { method, path:
|
|
1991
|
+
request: { method, path: path36, origin }
|
|
1992
1992
|
} = evt;
|
|
1993
|
-
debugLog("sending request to %s %s%s", method, origin,
|
|
1993
|
+
debugLog("sending request to %s %s%s", method, origin, path36);
|
|
1994
1994
|
}
|
|
1995
1995
|
);
|
|
1996
1996
|
}
|
|
@@ -2008,14 +2008,14 @@ var require_diagnostics = __commonJS({
|
|
|
2008
2008
|
"undici:request:headers",
|
|
2009
2009
|
(evt) => {
|
|
2010
2010
|
const {
|
|
2011
|
-
request: { method, path:
|
|
2011
|
+
request: { method, path: path36, origin },
|
|
2012
2012
|
response: { statusCode }
|
|
2013
2013
|
} = evt;
|
|
2014
2014
|
debugLog(
|
|
2015
2015
|
"received response to %s %s%s - HTTP %d",
|
|
2016
2016
|
method,
|
|
2017
2017
|
origin,
|
|
2018
|
-
|
|
2018
|
+
path36,
|
|
2019
2019
|
statusCode
|
|
2020
2020
|
);
|
|
2021
2021
|
}
|
|
@@ -2024,23 +2024,23 @@ var require_diagnostics = __commonJS({
|
|
|
2024
2024
|
"undici:request:trailers",
|
|
2025
2025
|
(evt) => {
|
|
2026
2026
|
const {
|
|
2027
|
-
request: { method, path:
|
|
2027
|
+
request: { method, path: path36, origin }
|
|
2028
2028
|
} = evt;
|
|
2029
|
-
debugLog("trailers received from %s %s%s", method, origin,
|
|
2029
|
+
debugLog("trailers received from %s %s%s", method, origin, path36);
|
|
2030
2030
|
}
|
|
2031
2031
|
);
|
|
2032
2032
|
diagnosticsChannel.subscribe(
|
|
2033
2033
|
"undici:request:error",
|
|
2034
2034
|
(evt) => {
|
|
2035
2035
|
const {
|
|
2036
|
-
request: { method, path:
|
|
2036
|
+
request: { method, path: path36, origin },
|
|
2037
2037
|
error
|
|
2038
2038
|
} = evt;
|
|
2039
2039
|
debugLog(
|
|
2040
2040
|
"request to %s %s%s errored - %s",
|
|
2041
2041
|
method,
|
|
2042
2042
|
origin,
|
|
2043
|
-
|
|
2043
|
+
path36,
|
|
2044
2044
|
error.message
|
|
2045
2045
|
);
|
|
2046
2046
|
}
|
|
@@ -2155,7 +2155,7 @@ var require_request = __commonJS({
|
|
|
2155
2155
|
var kHandler = /* @__PURE__ */ Symbol("handler");
|
|
2156
2156
|
var Request = class {
|
|
2157
2157
|
constructor(origin, {
|
|
2158
|
-
path:
|
|
2158
|
+
path: path36,
|
|
2159
2159
|
method,
|
|
2160
2160
|
body,
|
|
2161
2161
|
headers,
|
|
@@ -2172,11 +2172,11 @@ var require_request = __commonJS({
|
|
|
2172
2172
|
maxRedirections,
|
|
2173
2173
|
typeOfService
|
|
2174
2174
|
}, handler) {
|
|
2175
|
-
if (typeof
|
|
2175
|
+
if (typeof path36 !== "string") {
|
|
2176
2176
|
throw new InvalidArgumentError("path must be a string");
|
|
2177
|
-
} else if (
|
|
2177
|
+
} else if (path36[0] !== "/" && !(path36.startsWith("http://") || path36.startsWith("https://")) && method !== "CONNECT") {
|
|
2178
2178
|
throw new InvalidArgumentError("path must be an absolute URL or start with a slash");
|
|
2179
|
-
} else if (invalidPathRegex.test(
|
|
2179
|
+
} else if (invalidPathRegex.test(path36)) {
|
|
2180
2180
|
throw new InvalidArgumentError("invalid request path");
|
|
2181
2181
|
}
|
|
2182
2182
|
if (typeof method !== "string") {
|
|
@@ -2251,7 +2251,7 @@ var require_request = __commonJS({
|
|
|
2251
2251
|
this.completed = false;
|
|
2252
2252
|
this.aborted = false;
|
|
2253
2253
|
this.upgrade = upgrade || null;
|
|
2254
|
-
this.path = query ? serializePathWithQuery(
|
|
2254
|
+
this.path = query ? serializePathWithQuery(path36, query) : path36;
|
|
2255
2255
|
this.origin = origin;
|
|
2256
2256
|
this.protocol = getProtocolFromUrlString(origin);
|
|
2257
2257
|
this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
|
|
@@ -7495,7 +7495,7 @@ var require_client_h1 = __commonJS({
|
|
|
7495
7495
|
}
|
|
7496
7496
|
}
|
|
7497
7497
|
function writeH1(client, request2) {
|
|
7498
|
-
const { method, path:
|
|
7498
|
+
const { method, path: path36, host, upgrade, blocking, reset } = request2;
|
|
7499
7499
|
let { body, headers, contentLength } = request2;
|
|
7500
7500
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
|
|
7501
7501
|
if (util.isFormDataLike(body)) {
|
|
@@ -7571,7 +7571,7 @@ var require_client_h1 = __commonJS({
|
|
|
7571
7571
|
socket[kBlocking] = true;
|
|
7572
7572
|
}
|
|
7573
7573
|
setTypeOfService(socket, request2);
|
|
7574
|
-
let header = `${method} ${
|
|
7574
|
+
let header = `${method} ${path36} HTTP/1.1\r
|
|
7575
7575
|
`;
|
|
7576
7576
|
if (typeof host === "string") {
|
|
7577
7577
|
header += `host: ${host}\r
|
|
@@ -8248,7 +8248,7 @@ var require_client_h2 = __commonJS({
|
|
|
8248
8248
|
const headersTimeout = request2.headersTimeout ?? client[kHeadersTimeout];
|
|
8249
8249
|
const bodyTimeout = request2.bodyTimeout ?? client[kBodyTimeout];
|
|
8250
8250
|
const session = client[kHTTP2Session];
|
|
8251
|
-
const { method, path:
|
|
8251
|
+
const { method, path: path36, host, upgrade, expectContinue, signal, protocol, headers: reqHeaders } = request2;
|
|
8252
8252
|
let { body } = request2;
|
|
8253
8253
|
if (upgrade != null && upgrade !== "websocket") {
|
|
8254
8254
|
util.errorRequest(client, request2, new InvalidArgumentError(`Custom upgrade "${upgrade}" not supported over HTTP/2`));
|
|
@@ -8317,7 +8317,7 @@ var require_client_h2 = __commonJS({
|
|
|
8317
8317
|
}
|
|
8318
8318
|
headers[HTTP2_HEADER_METHOD] = "CONNECT";
|
|
8319
8319
|
headers[HTTP2_HEADER_PROTOCOL] = "websocket";
|
|
8320
|
-
headers[HTTP2_HEADER_PATH] =
|
|
8320
|
+
headers[HTTP2_HEADER_PATH] = path36;
|
|
8321
8321
|
if (protocol === "ws:" || protocol === "wss:") {
|
|
8322
8322
|
headers[HTTP2_HEADER_SCHEME] = protocol === "ws:" ? "http" : "https";
|
|
8323
8323
|
} else {
|
|
@@ -8369,7 +8369,7 @@ var require_client_h2 = __commonJS({
|
|
|
8369
8369
|
stream.setTimeout(headersTimeout);
|
|
8370
8370
|
return true;
|
|
8371
8371
|
}
|
|
8372
|
-
headers[HTTP2_HEADER_PATH] =
|
|
8372
|
+
headers[HTTP2_HEADER_PATH] = path36;
|
|
8373
8373
|
headers[HTTP2_HEADER_SCHEME] = protocol === "http:" ? "http" : "https";
|
|
8374
8374
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
|
|
8375
8375
|
if (body && typeof body.read === "function") {
|
|
@@ -10725,10 +10725,10 @@ var require_proxy_agent = __commonJS({
|
|
|
10725
10725
|
};
|
|
10726
10726
|
const {
|
|
10727
10727
|
origin,
|
|
10728
|
-
path:
|
|
10728
|
+
path: path36 = "/",
|
|
10729
10729
|
headers = {}
|
|
10730
10730
|
} = opts;
|
|
10731
|
-
opts.path = origin +
|
|
10731
|
+
opts.path = origin + path36;
|
|
10732
10732
|
if (!("host" in headers) && !("Host" in headers)) {
|
|
10733
10733
|
const { host } = new URL(origin);
|
|
10734
10734
|
headers.host = host;
|
|
@@ -12888,20 +12888,20 @@ var require_mock_utils = __commonJS({
|
|
|
12888
12888
|
}
|
|
12889
12889
|
return normalizedQp;
|
|
12890
12890
|
}
|
|
12891
|
-
function safeUrl(
|
|
12892
|
-
if (typeof
|
|
12893
|
-
return
|
|
12891
|
+
function safeUrl(path36) {
|
|
12892
|
+
if (typeof path36 !== "string") {
|
|
12893
|
+
return path36;
|
|
12894
12894
|
}
|
|
12895
|
-
const pathSegments =
|
|
12895
|
+
const pathSegments = path36.split("?", 3);
|
|
12896
12896
|
if (pathSegments.length !== 2) {
|
|
12897
|
-
return
|
|
12897
|
+
return path36;
|
|
12898
12898
|
}
|
|
12899
12899
|
const qp = new URLSearchParams(pathSegments.pop());
|
|
12900
12900
|
qp.sort();
|
|
12901
12901
|
return [...pathSegments, qp.toString()].join("?");
|
|
12902
12902
|
}
|
|
12903
|
-
function matchKey(mockDispatch2, { path:
|
|
12904
|
-
const pathMatch = matchValue(mockDispatch2.path,
|
|
12903
|
+
function matchKey(mockDispatch2, { path: path36, method, body, headers }) {
|
|
12904
|
+
const pathMatch = matchValue(mockDispatch2.path, path36);
|
|
12905
12905
|
const methodMatch = matchValue(mockDispatch2.method, method);
|
|
12906
12906
|
const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true;
|
|
12907
12907
|
const headersMatch = matchHeaders(mockDispatch2, headers);
|
|
@@ -12926,8 +12926,8 @@ var require_mock_utils = __commonJS({
|
|
|
12926
12926
|
const basePath = key.query ? serializePathWithQuery(key.path, key.query) : key.path;
|
|
12927
12927
|
const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath;
|
|
12928
12928
|
const resolvedPathWithoutTrailingSlash = removeTrailingSlash(resolvedPath);
|
|
12929
|
-
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path:
|
|
12930
|
-
return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(
|
|
12929
|
+
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path36, ignoreTrailingSlash }) => {
|
|
12930
|
+
return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(path36)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path36), resolvedPath);
|
|
12931
12931
|
});
|
|
12932
12932
|
if (matchedMockDispatches.length === 0) {
|
|
12933
12933
|
throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
|
|
@@ -12966,19 +12966,19 @@ var require_mock_utils = __commonJS({
|
|
|
12966
12966
|
mockDispatches.splice(index, 1);
|
|
12967
12967
|
}
|
|
12968
12968
|
}
|
|
12969
|
-
function removeTrailingSlash(
|
|
12970
|
-
while (
|
|
12971
|
-
|
|
12969
|
+
function removeTrailingSlash(path36) {
|
|
12970
|
+
while (path36.endsWith("/")) {
|
|
12971
|
+
path36 = path36.slice(0, -1);
|
|
12972
12972
|
}
|
|
12973
|
-
if (
|
|
12974
|
-
|
|
12973
|
+
if (path36.length === 0) {
|
|
12974
|
+
path36 = "/";
|
|
12975
12975
|
}
|
|
12976
|
-
return
|
|
12976
|
+
return path36;
|
|
12977
12977
|
}
|
|
12978
12978
|
function buildKey(opts) {
|
|
12979
|
-
const { path:
|
|
12979
|
+
const { path: path36, method, body, headers, query } = opts;
|
|
12980
12980
|
return {
|
|
12981
|
-
path:
|
|
12981
|
+
path: path36,
|
|
12982
12982
|
method,
|
|
12983
12983
|
body,
|
|
12984
12984
|
headers,
|
|
@@ -13668,10 +13668,10 @@ var require_pending_interceptors_formatter = __commonJS({
|
|
|
13668
13668
|
}
|
|
13669
13669
|
format(pendingInterceptors) {
|
|
13670
13670
|
const withPrettyHeaders = pendingInterceptors.map(
|
|
13671
|
-
({ method, path:
|
|
13671
|
+
({ method, path: path36, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
|
|
13672
13672
|
Method: method,
|
|
13673
13673
|
Origin: origin,
|
|
13674
|
-
Path:
|
|
13674
|
+
Path: path36,
|
|
13675
13675
|
"Status code": statusCode,
|
|
13676
13676
|
Persistent: persist ? PERSISTENT : NOT_PERSISTENT,
|
|
13677
13677
|
Invocations: timesInvoked,
|
|
@@ -13753,9 +13753,9 @@ var require_mock_agent = __commonJS({
|
|
|
13753
13753
|
const acceptNonStandardSearchParameters = this[kMockAgentAcceptsNonStandardSearchParameters];
|
|
13754
13754
|
const dispatchOpts = { ...opts };
|
|
13755
13755
|
if (acceptNonStandardSearchParameters && dispatchOpts.path) {
|
|
13756
|
-
const [
|
|
13756
|
+
const [path36, searchParams] = dispatchOpts.path.split("?");
|
|
13757
13757
|
const normalizedSearchParams = normalizeSearchParams(searchParams, acceptNonStandardSearchParameters);
|
|
13758
|
-
dispatchOpts.path = `${
|
|
13758
|
+
dispatchOpts.path = `${path36}?${normalizedSearchParams}`;
|
|
13759
13759
|
}
|
|
13760
13760
|
return this[kAgent].dispatch(dispatchOpts, handler);
|
|
13761
13761
|
}
|
|
@@ -14156,12 +14156,12 @@ var require_snapshot_recorder = __commonJS({
|
|
|
14156
14156
|
* @return {Promise<void>} - Resolves when snapshots are loaded
|
|
14157
14157
|
*/
|
|
14158
14158
|
async loadSnapshots(filePath) {
|
|
14159
|
-
const
|
|
14160
|
-
if (!
|
|
14159
|
+
const path36 = filePath || this.#snapshotPath;
|
|
14160
|
+
if (!path36) {
|
|
14161
14161
|
throw new InvalidArgumentError("Snapshot path is required");
|
|
14162
14162
|
}
|
|
14163
14163
|
try {
|
|
14164
|
-
const data = await readFile(resolve2(
|
|
14164
|
+
const data = await readFile(resolve2(path36), "utf8");
|
|
14165
14165
|
const parsed = JSON.parse(data);
|
|
14166
14166
|
if (Array.isArray(parsed)) {
|
|
14167
14167
|
this.#snapshots.clear();
|
|
@@ -14175,7 +14175,7 @@ var require_snapshot_recorder = __commonJS({
|
|
|
14175
14175
|
if (error.code === "ENOENT") {
|
|
14176
14176
|
this.#snapshots.clear();
|
|
14177
14177
|
} else {
|
|
14178
|
-
throw new UndiciError(`Failed to load snapshots from ${
|
|
14178
|
+
throw new UndiciError(`Failed to load snapshots from ${path36}`, { cause: error });
|
|
14179
14179
|
}
|
|
14180
14180
|
}
|
|
14181
14181
|
}
|
|
@@ -14186,11 +14186,11 @@ var require_snapshot_recorder = __commonJS({
|
|
|
14186
14186
|
* @returns {Promise<void>} - Resolves when snapshots are saved
|
|
14187
14187
|
*/
|
|
14188
14188
|
async saveSnapshots(filePath) {
|
|
14189
|
-
const
|
|
14190
|
-
if (!
|
|
14189
|
+
const path36 = filePath || this.#snapshotPath;
|
|
14190
|
+
if (!path36) {
|
|
14191
14191
|
throw new InvalidArgumentError("Snapshot path is required");
|
|
14192
14192
|
}
|
|
14193
|
-
const resolvedPath = resolve2(
|
|
14193
|
+
const resolvedPath = resolve2(path36);
|
|
14194
14194
|
await mkdir(dirname(resolvedPath), { recursive: true });
|
|
14195
14195
|
const data = Array.from(this.#snapshots.entries()).map(([hash, snapshot]) => ({
|
|
14196
14196
|
hash,
|
|
@@ -14831,15 +14831,15 @@ var require_redirect_handler = __commonJS({
|
|
|
14831
14831
|
receivedAt: Date.now()
|
|
14832
14832
|
});
|
|
14833
14833
|
const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
|
|
14834
|
-
const
|
|
14835
|
-
const redirectUrlString = `${origin}${
|
|
14834
|
+
const path36 = search ? `${pathname}${search}` : pathname;
|
|
14835
|
+
const redirectUrlString = `${origin}${path36}`;
|
|
14836
14836
|
for (const historyUrl of this.history) {
|
|
14837
14837
|
if (historyUrl.toString() === redirectUrlString) {
|
|
14838
14838
|
throw new InvalidArgumentError(`Redirect loop detected. Cannot redirect to ${origin}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`);
|
|
14839
14839
|
}
|
|
14840
14840
|
}
|
|
14841
14841
|
this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);
|
|
14842
|
-
this.opts.path =
|
|
14842
|
+
this.opts.path = path36;
|
|
14843
14843
|
this.opts.origin = origin;
|
|
14844
14844
|
this.opts.query = null;
|
|
14845
14845
|
}
|
|
@@ -16656,10 +16656,10 @@ var require_cache_handler = __commonJS({
|
|
|
16656
16656
|
}
|
|
16657
16657
|
return locationUrl.pathname + locationUrl.search;
|
|
16658
16658
|
}
|
|
16659
|
-
function deleteCachedUri(store, cacheKey,
|
|
16659
|
+
function deleteCachedUri(store, cacheKey, path36) {
|
|
16660
16660
|
deleteCachedValue(store, {
|
|
16661
16661
|
...cacheKey,
|
|
16662
|
-
path:
|
|
16662
|
+
path: path36
|
|
16663
16663
|
});
|
|
16664
16664
|
for (let i = 0; i < util.safeHTTPMethods.length; i++) {
|
|
16665
16665
|
const method = util.safeHTTPMethods[i];
|
|
@@ -16667,7 +16667,7 @@ var require_cache_handler = __commonJS({
|
|
|
16667
16667
|
deleteCachedValue(store, {
|
|
16668
16668
|
...cacheKey,
|
|
16669
16669
|
method,
|
|
16670
|
-
path:
|
|
16670
|
+
path: path36
|
|
16671
16671
|
});
|
|
16672
16672
|
}
|
|
16673
16673
|
}
|
|
@@ -16678,9 +16678,9 @@ var require_cache_handler = __commonJS({
|
|
|
16678
16678
|
}
|
|
16679
16679
|
const values = Array.isArray(headerValue) ? headerValue : [headerValue];
|
|
16680
16680
|
for (let i = 0; i < values.length; i++) {
|
|
16681
|
-
const
|
|
16682
|
-
if (
|
|
16683
|
-
deleteCachedUri(store, cacheKey,
|
|
16681
|
+
const path36 = getSameOriginPath(cacheKey, values[i]);
|
|
16682
|
+
if (path36 !== void 0) {
|
|
16683
|
+
deleteCachedUri(store, cacheKey, path36);
|
|
16684
16684
|
}
|
|
16685
16685
|
}
|
|
16686
16686
|
}
|
|
@@ -22168,11 +22168,11 @@ var require_fetch = __commonJS({
|
|
|
22168
22168
|
function dispatch({ body }) {
|
|
22169
22169
|
const url = requestCurrentURL(request2);
|
|
22170
22170
|
const agent = fetchParams.controller.dispatcher;
|
|
22171
|
-
const
|
|
22171
|
+
const path36 = url.pathname + url.search;
|
|
22172
22172
|
const hasTrailingQuestionMark = url.search.length === 0 && url.href[url.href.length - url.hash.length - 1] === "?";
|
|
22173
22173
|
return new Promise((resolve2, reject) => agent.dispatch(
|
|
22174
22174
|
{
|
|
22175
|
-
path: hasTrailingQuestionMark ? `${
|
|
22175
|
+
path: hasTrailingQuestionMark ? `${path36}?` : path36,
|
|
22176
22176
|
origin: url.origin,
|
|
22177
22177
|
method: request2.method,
|
|
22178
22178
|
body: agent.isMockActive ? request2.body && (request2.body.source || request2.body.stream) : body,
|
|
@@ -23119,9 +23119,9 @@ var require_util4 = __commonJS({
|
|
|
23119
23119
|
}
|
|
23120
23120
|
}
|
|
23121
23121
|
}
|
|
23122
|
-
function validateCookiePath(
|
|
23123
|
-
for (let i = 0; i <
|
|
23124
|
-
const code =
|
|
23122
|
+
function validateCookiePath(path36) {
|
|
23123
|
+
for (let i = 0; i < path36.length; ++i) {
|
|
23124
|
+
const code = path36.charCodeAt(i);
|
|
23125
23125
|
if (code < 32 || // exclude CTLs (0-31)
|
|
23126
23126
|
code > 126 || // exclude DEL and non-ascii
|
|
23127
23127
|
code === 59) {
|
|
@@ -26557,11 +26557,11 @@ var require_undici = __commonJS({
|
|
|
26557
26557
|
if (typeof opts.path !== "string") {
|
|
26558
26558
|
throw new InvalidArgumentError("invalid opts.path");
|
|
26559
26559
|
}
|
|
26560
|
-
let
|
|
26560
|
+
let path36 = opts.path;
|
|
26561
26561
|
if (!opts.path.startsWith("/")) {
|
|
26562
|
-
|
|
26562
|
+
path36 = `/${path36}`;
|
|
26563
26563
|
}
|
|
26564
|
-
url = new URL(util.parseOrigin(url).origin +
|
|
26564
|
+
url = new URL(util.parseOrigin(url).origin + path36);
|
|
26565
26565
|
} else {
|
|
26566
26566
|
if (!opts) {
|
|
26567
26567
|
opts = typeof url === "object" ? url : {};
|
|
@@ -26680,7 +26680,7 @@ try {
|
|
|
26680
26680
|
}
|
|
26681
26681
|
|
|
26682
26682
|
// src/launcher-main.ts
|
|
26683
|
-
import
|
|
26683
|
+
import path35 from "node:path";
|
|
26684
26684
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
26685
26685
|
|
|
26686
26686
|
// src/home.ts
|
|
@@ -26903,8 +26903,8 @@ function saveAlphaUpdates(value) {
|
|
|
26903
26903
|
}
|
|
26904
26904
|
|
|
26905
26905
|
// src/protocol.ts
|
|
26906
|
-
var VERSION = true ? "0.6.
|
|
26907
|
-
var AKB_VERSION = true ? "0.11.
|
|
26906
|
+
var VERSION = true ? "0.6.88" : "0.0.0";
|
|
26907
|
+
var AKB_VERSION = true ? "0.11.71" : "0.0.0";
|
|
26908
26908
|
var EXIT_REFUSED = 10;
|
|
26909
26909
|
var EXIT_OUTDATED = 11;
|
|
26910
26910
|
var EXIT_UPDATE = 12;
|
|
@@ -28396,7 +28396,7 @@ var FILE_TIMEOUT_MS = 10 * 6e4;
|
|
|
28396
28396
|
var readRunner = () => request("GET", "/v1/runner");
|
|
28397
28397
|
var q = encodeURIComponent;
|
|
28398
28398
|
var listFolders = (machineId2) => request("GET", `/v1/runner/folders?machine=${q(machineId2)}`);
|
|
28399
|
-
var addFolder = (machineId2, name,
|
|
28399
|
+
var addFolder = (machineId2, name, path36, project) => request("POST", "/v1/runner/folders", { machineId: machineId2, name, path: path36, ...project ? { project } : {} });
|
|
28400
28400
|
async function createProject(name, workspace, key) {
|
|
28401
28401
|
const sent = await send("POST", "/v1/projects", { name, workspace }, true, TIMEOUT_MS2, void 0, { "idempotency-key": key });
|
|
28402
28402
|
return sent.ok ? answerOf(sent.value) : sent;
|
|
@@ -29072,7 +29072,7 @@ async function startSettingsServer(action, port = 0) {
|
|
|
29072
29072
|
// src/settings.ts
|
|
29073
29073
|
import crypto9 from "node:crypto";
|
|
29074
29074
|
import fs29 from "node:fs";
|
|
29075
|
-
import
|
|
29075
|
+
import path34 from "node:path";
|
|
29076
29076
|
|
|
29077
29077
|
// src/kanban-skill.ts
|
|
29078
29078
|
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
@@ -29131,11 +29131,11 @@ function retireKanbanSkill(dir) {
|
|
|
29131
29131
|
import { spawn as spawn5 } from "node:child_process";
|
|
29132
29132
|
import fs27 from "node:fs";
|
|
29133
29133
|
import os6 from "node:os";
|
|
29134
|
-
import
|
|
29134
|
+
import path31 from "node:path";
|
|
29135
29135
|
|
|
29136
29136
|
// ../cli/src/lib/agent/harnesses/antigravity.ts
|
|
29137
29137
|
import fs22 from "node:fs";
|
|
29138
|
-
import
|
|
29138
|
+
import path25 from "node:path";
|
|
29139
29139
|
import { createHash as createHash3 } from "node:crypto";
|
|
29140
29140
|
import { spawnSync as spawnSync4 } from "node:child_process";
|
|
29141
29141
|
|
|
@@ -29545,6 +29545,55 @@ function machineFile(name, text3) {
|
|
|
29545
29545
|
return file2;
|
|
29546
29546
|
}
|
|
29547
29547
|
|
|
29548
|
+
// ../cli/src/lib/agent/harnesses/transient.ts
|
|
29549
|
+
var MANUAL = [
|
|
29550
|
+
/\b(401|403)\b/,
|
|
29551
|
+
/unauthorized|forbidden|permission (?:denied|required|check failed)|permission_denied|soft.denied|auto-denied|权限拒绝/,
|
|
29552
|
+
/authenticat|invalid api key|api[_ ]key|not (?:logged|signed) in|please (?:log|sign) in|\/login|oauth/,
|
|
29553
|
+
/\b429\b/,
|
|
29554
|
+
/rate[ _-]?limit|usage limit|quota|credits?|insufficient|out of tokens|resource[ _-]?exhausted/,
|
|
29555
|
+
/cancell?ed|aborted by|interrupted by the user/,
|
|
29556
|
+
/maximum budget|max(imum)? turns|exceeded the budget/,
|
|
29557
|
+
/model not found|unknown model|invalid model|model (?:is )?unavailable|model[^\n]+ is (?:unavailable|not recognized)|unsupported|invalid[_ ]request/
|
|
29558
|
+
];
|
|
29559
|
+
var PASSING = [
|
|
29560
|
+
// 502/503/529 are distinctive enough to read as a status wherever they appear. A bare
|
|
29561
|
+
// 500 is not — a failure line counting something would match it — so it is left to the
|
|
29562
|
+
// words below, which is how that status is actually written out.
|
|
29563
|
+
/\b(502|503|529)\b/,
|
|
29564
|
+
/overloaded|service unavailable|bad gateway|internal server error|server_error/,
|
|
29565
|
+
/connection (lost|dropped|reset|error|closed)|socket hang up|stream (error|disconnected)/,
|
|
29566
|
+
/econnreset|econnrefused|etimedout|enetunreach|enotfound|eai_again/,
|
|
29567
|
+
/fetch failed|request timed out|network error/,
|
|
29568
|
+
/rpc error: code = (?:unavailable|deadlineexceeded)\b|deadline_exceeded|dial tcp[^\n]*(?:timeout|refused|no such host)/
|
|
29569
|
+
];
|
|
29570
|
+
var RETRY_AFTER = /retry[-_\s]?after["':=\s]+(\d+)/i;
|
|
29571
|
+
var REASON_MAX = 140;
|
|
29572
|
+
function reasonLine(text3, rule) {
|
|
29573
|
+
const line = text3.split("\n").find((l) => rule.test(l.toLowerCase())) ?? text3;
|
|
29574
|
+
const said = line.trim().replace(/\s+/g, " ");
|
|
29575
|
+
return said.length > REASON_MAX ? `${said.slice(0, REASON_MAX - 1)}\u2026` : said;
|
|
29576
|
+
}
|
|
29577
|
+
function manualFailure(text3) {
|
|
29578
|
+
return MANUAL.some((rule) => rule.test(text3.toLowerCase()));
|
|
29579
|
+
}
|
|
29580
|
+
function providerBlip(...said) {
|
|
29581
|
+
for (const text3 of said) {
|
|
29582
|
+
if (!text3?.trim()) continue;
|
|
29583
|
+
const lower = text3.toLowerCase();
|
|
29584
|
+
if (manualFailure(text3)) return void 0;
|
|
29585
|
+
const hit = PASSING.find((rule) => rule.test(lower));
|
|
29586
|
+
if (!hit) continue;
|
|
29587
|
+
const asked = RETRY_AFTER.exec(text3);
|
|
29588
|
+
const seconds = asked ? Number(asked[1]) : NaN;
|
|
29589
|
+
return {
|
|
29590
|
+
reason: reasonLine(text3, hit),
|
|
29591
|
+
...Number.isFinite(seconds) && seconds > 0 ? { retryAfterMs: seconds * 1e3 } : {}
|
|
29592
|
+
};
|
|
29593
|
+
}
|
|
29594
|
+
return void 0;
|
|
29595
|
+
}
|
|
29596
|
+
|
|
29548
29597
|
// ../cli/src/lib/machine/settings.ts
|
|
29549
29598
|
import fs21 from "node:fs";
|
|
29550
29599
|
import path23 from "node:path";
|
|
@@ -29589,6 +29638,58 @@ function runLanguage() {
|
|
|
29589
29638
|
}
|
|
29590
29639
|
var translating = () => runLanguage() === "zh";
|
|
29591
29640
|
|
|
29641
|
+
// ../cli/src/lib/agent/wire/antigravity.ts
|
|
29642
|
+
import path24 from "node:path";
|
|
29643
|
+
|
|
29644
|
+
// ../cli/src/lib/agent/prices.ts
|
|
29645
|
+
var OPENAI = {
|
|
29646
|
+
"gpt-6.1-sol": { input: 2, cachedInput: 0.1, output: 10 },
|
|
29647
|
+
"gpt-6-astra": { input: 10, cachedInput: 1, output: 50 },
|
|
29648
|
+
"gpt-6-sol": { input: 2, cachedInput: 0.2, output: 10 },
|
|
29649
|
+
"gpt-6-luna": { input: 0.1, cachedInput: 0.01, output: 0.5 },
|
|
29650
|
+
"gpt-5.6-sol": { input: 4, cachedInput: 0.4, output: 20 },
|
|
29651
|
+
"gpt-5.6-terra": { input: 2, cachedInput: 0.2, output: 12 },
|
|
29652
|
+
"gpt-5.6-luna": { input: 0.2, cachedInput: 0.02, output: 1.2 },
|
|
29653
|
+
"gpt-5.5": { input: 5, cachedInput: 0.5, output: 30 },
|
|
29654
|
+
"gpt-5.5-pro": { input: 30, cachedInput: 30, output: 180 },
|
|
29655
|
+
"gpt-5.4": { input: 2.5, cachedInput: 0.25, output: 15 },
|
|
29656
|
+
"gpt-5.4-mini": { input: 0.75, cachedInput: 0.075, output: 4.5 },
|
|
29657
|
+
"gpt-5.4-nano": { input: 0.2, cachedInput: 0.02, output: 1.25 },
|
|
29658
|
+
"gpt-5.4-pro": { input: 30, cachedInput: 30, output: 180 },
|
|
29659
|
+
"gpt-5.3-codex": { input: 1.75, cachedInput: 0.175, output: 14 },
|
|
29660
|
+
"gpt-5.2": { input: 1.75, cachedInput: 0.175, output: 14 },
|
|
29661
|
+
"gpt-5.2-pro": { input: 21, cachedInput: 21, output: 168 },
|
|
29662
|
+
"gpt-5.1": { input: 1.25, cachedInput: 0.125, output: 10 },
|
|
29663
|
+
"gpt-5": { input: 1.25, cachedInput: 0.125, output: 10 },
|
|
29664
|
+
"gpt-5-mini": { input: 0.25, cachedInput: 0.025, output: 2 },
|
|
29665
|
+
"gpt-5-nano": { input: 0.05, cachedInput: 5e-3, output: 0.4 },
|
|
29666
|
+
"gpt-5-pro": { input: 15, cachedInput: 15, output: 120 }
|
|
29667
|
+
};
|
|
29668
|
+
function antigravityPrices(at) {
|
|
29669
|
+
const pro = at < Date.parse("2026-12-01T00:00:00Z") ? 2 : 4;
|
|
29670
|
+
const flash = at < Date.parse("2027-01-01T00:00:00Z") ? 0.75 : 1.5;
|
|
29671
|
+
return {
|
|
29672
|
+
"gemini-4-carbon": { input: pro, cachedInput: pro / 20, output: pro * 5 },
|
|
29673
|
+
"gemini-4-argon": { input: pro, cachedInput: pro / 20, output: pro * 5 },
|
|
29674
|
+
"gemini-4-hydrogen": { input: 1.5, cachedInput: 0.075, output: 7.5 },
|
|
29675
|
+
"gemini-3.8-flash": { input: flash, cachedInput: flash / 10, output: flash * 5 }
|
|
29676
|
+
};
|
|
29677
|
+
}
|
|
29678
|
+
var PRICES = { openai: OPENAI, "openai-api": OPENAI };
|
|
29679
|
+
function lookUp(table, model) {
|
|
29680
|
+
const id = model.trim().toLowerCase().replace(/^[^/]+\//, "");
|
|
29681
|
+
return table[id] ?? table[id.replace(/-\d{4}-\d{2}-\d{2}$/, "")];
|
|
29682
|
+
}
|
|
29683
|
+
function priceUsd(provider, model, usage, at = Date.now()) {
|
|
29684
|
+
if (!provider || !model || !usage) return void 0;
|
|
29685
|
+
const agy = provider.trim().toLowerCase() === "antigravity";
|
|
29686
|
+
const table = agy ? antigravityPrices(at) : PRICES[provider.trim().toLowerCase()];
|
|
29687
|
+
const price = table && (agy ? table[model.trim().toLowerCase().replace(/-(?:low|medium|high|xhigh|max)$/, "")] : lookUp(table, model));
|
|
29688
|
+
if (!price) return void 0;
|
|
29689
|
+
const usd = ((usage.input + usage.cacheCreation) * price.input + usage.cacheRead * price.cachedInput + usage.output * price.output) / 1e6;
|
|
29690
|
+
return Number.isFinite(usd) && usd >= 0 ? usd : void 0;
|
|
29691
|
+
}
|
|
29692
|
+
|
|
29592
29693
|
// ../cli/src/lib/agent/wire/events.ts
|
|
29593
29694
|
var TOOL_KINDS = ["read", "edit", "delete", "move", "search", "execute", "fetch", "other"];
|
|
29594
29695
|
var toolKind = (v) => TOOL_KINDS.includes(str2(v)) ? v : "other";
|
|
@@ -29777,6 +29878,7 @@ var KINDS = {
|
|
|
29777
29878
|
run_command: "execute",
|
|
29778
29879
|
command_status: "execute",
|
|
29779
29880
|
send_command_input: "execute",
|
|
29881
|
+
read_file: "read",
|
|
29780
29882
|
view_file: "read",
|
|
29781
29883
|
list_dir: "read",
|
|
29782
29884
|
grep_search: "search",
|
|
@@ -29800,14 +29902,39 @@ function failureHint(reason) {
|
|
|
29800
29902
|
return hint2 ? `${reason}
|
|
29801
29903
|
${hint2}` : reason;
|
|
29802
29904
|
}
|
|
29803
|
-
|
|
29905
|
+
var limited = (reason) => /\b429\b|rate[ _-]?limit|resource[ _-]?exhausted|quota[^\n]*\b(?:exceeded|exhausted|depleted|reached)\b|(?:exceed|exhaust|deplet)[^\n]*quota|(?:insufficient|exhausted|out of|no remaining) (?:credits?|quota)|credits?[^\n]*(?:exhaust|deplet|exceed)/i.test(reason);
|
|
29906
|
+
var imagePath = (target) => /\.(?:png|jpe?g|gif|webp|bmp|tiff?|svg)$/i.test(target);
|
|
29907
|
+
function createAntigravityRenderer(expectedSession, cwd = process.cwd()) {
|
|
29804
29908
|
let session = expectedSession;
|
|
29805
29909
|
let model;
|
|
29910
|
+
let partial = "";
|
|
29806
29911
|
let final;
|
|
29807
29912
|
let failure2;
|
|
29913
|
+
let rateLimit;
|
|
29914
|
+
let imageFailure;
|
|
29915
|
+
let requiredImages = [];
|
|
29916
|
+
const readImages = /* @__PURE__ */ new Set();
|
|
29917
|
+
const imageErrors = /* @__PURE__ */ new Map();
|
|
29918
|
+
const imageError = (target, reason) => translating() ? `Antigravity \u65E0\u6CD5\u8BFB\u53D6\u56FE\u7247 ${target}\uFF1A${reason}` : `Antigravity could not read image ${target}: ${reason}`;
|
|
29808
29919
|
let terminal = false;
|
|
29809
29920
|
let offStream;
|
|
29810
29921
|
let stderr = "";
|
|
29922
|
+
let context;
|
|
29923
|
+
let contextStep = -1;
|
|
29924
|
+
const started = Date.now();
|
|
29925
|
+
let cost;
|
|
29926
|
+
let incomplete = false;
|
|
29927
|
+
const priced = /* @__PURE__ */ new Set();
|
|
29928
|
+
const countCost = (step) => {
|
|
29929
|
+
const index = step.step_index;
|
|
29930
|
+
if (typeof index !== "number" || !Number.isSafeInteger(index) || index < 0 || priced.has(index)) return;
|
|
29931
|
+
priced.add(index);
|
|
29932
|
+
const u = obj(step.usage);
|
|
29933
|
+
const valid = [u.input_tokens, u.output_tokens, u.cache_read_tokens].every((n) => typeof n === "number" && Number.isFinite(n) && n >= 0);
|
|
29934
|
+
const usd = valid ? priceUsd("antigravity", model, usageOf(u), started) : void 0;
|
|
29935
|
+
if (usd === void 0) incomplete = true;
|
|
29936
|
+
else cost = (cost ?? 0) + usd;
|
|
29937
|
+
};
|
|
29811
29938
|
let used;
|
|
29812
29939
|
let turnUsage = zero();
|
|
29813
29940
|
let previous;
|
|
@@ -29816,6 +29943,8 @@ function createAntigravityRenderer(expectedSession) {
|
|
|
29816
29943
|
const closed = /* @__PURE__ */ new Set();
|
|
29817
29944
|
const events = createEventCollector();
|
|
29818
29945
|
const fail = (reason) => {
|
|
29946
|
+
if (limited(reason)) rateLimit = failureHint(reason);
|
|
29947
|
+
if (failure2 && manualFailure(failure2) && !(limited(failure2) && limited(reason))) return;
|
|
29819
29948
|
failure2 = failureHint(reason);
|
|
29820
29949
|
events.error(failure2);
|
|
29821
29950
|
};
|
|
@@ -29823,6 +29952,7 @@ function createAntigravityRenderer(expectedSession) {
|
|
|
29823
29952
|
const e = frame(line);
|
|
29824
29953
|
if (!e) {
|
|
29825
29954
|
offStream = line.trim() || offStream;
|
|
29955
|
+
if (/^(?:error:|rpc error:)/i.test(line.trim()) && limited(line)) fail(line.trim());
|
|
29826
29956
|
return `${line}
|
|
29827
29957
|
`;
|
|
29828
29958
|
}
|
|
@@ -29841,10 +29971,19 @@ function createAntigravityRenderer(expectedSession) {
|
|
|
29841
29971
|
if (expectedSession && str2(step.conversation_id) !== expectedSession) return "";
|
|
29842
29972
|
session = str2(step.conversation_id) || session;
|
|
29843
29973
|
const id = String(step.step_index ?? "");
|
|
29974
|
+
if (step.state === "DONE" && ["agent_response", "checkpoint"].includes(str2(step.step_type))) countCost(step);
|
|
29844
29975
|
if (step.step_type === "agent_response") {
|
|
29845
29976
|
const text3 = str2(step.text_delta);
|
|
29977
|
+
partial += text3;
|
|
29846
29978
|
if (text3) events.update({ sessionUpdate: "agent_message_chunk", content: { text: text3 } });
|
|
29847
29979
|
const index = num(step.step_index);
|
|
29980
|
+
if (step.state === "DONE" && Number.isSafeInteger(index) && step.step_index === index && index > contextStep) {
|
|
29981
|
+
contextStep = index;
|
|
29982
|
+
const u = obj(step.usage);
|
|
29983
|
+
const counts = [u.input_tokens, u.cache_read_tokens];
|
|
29984
|
+
const prompt = counts.every((n) => typeof n === "number" && Number.isFinite(n) && n >= 0) ? num(u.input_tokens) + num(u.cache_read_tokens) : 0;
|
|
29985
|
+
context = prompt > 0 && Number.isFinite(prompt) ? { used: prompt } : void 0;
|
|
29986
|
+
}
|
|
29848
29987
|
if (step.state === "DONE" && step.usage && !counted.has(index)) {
|
|
29849
29988
|
counted.add(index);
|
|
29850
29989
|
turnUsage = add(turnUsage, usageOf(step.usage));
|
|
@@ -29870,7 +30009,20 @@ function createAntigravityRenderer(expectedSession) {
|
|
|
29870
30009
|
if (reason && /permission|denied|soft.den/i.test(reason)) fail(reason);
|
|
29871
30010
|
if (["DONE", "ERROR", "CANCELED", "INTERRUPTED"].includes(str2(step.state)) && !closed.has(id)) {
|
|
29872
30011
|
closed.add(id);
|
|
29873
|
-
|
|
30012
|
+
const failed = !!reason || step.state !== "DONE";
|
|
30013
|
+
if (["read_file", "view_file"].includes(name) && imagePath(target)) {
|
|
30014
|
+
const file2 = path24.resolve(cwd, target);
|
|
30015
|
+
if (failed) {
|
|
30016
|
+
imageErrors.set(file2, reason || str2(step.state));
|
|
30017
|
+
out += `
|
|
30018
|
+
${imageError(target, reason || str2(step.state))}
|
|
30019
|
+
`;
|
|
30020
|
+
} else {
|
|
30021
|
+
readImages.add(file2);
|
|
30022
|
+
imageErrors.delete(file2);
|
|
30023
|
+
}
|
|
30024
|
+
}
|
|
30025
|
+
events.toolResult(id, failed ? "failed" : "completed", str2(tool.output) || reason);
|
|
29874
30026
|
}
|
|
29875
30027
|
return out;
|
|
29876
30028
|
}
|
|
@@ -29890,36 +30042,55 @@ function createAntigravityRenderer(expectedSession) {
|
|
|
29890
30042
|
used = previous ? { input: Math.max(0, total.input - previous.input), output: Math.max(0, total.output - previous.output), cacheRead: Math.max(0, total.cacheRead - previous.cacheRead), cacheCreation: 0 } : num(result.num_turns) === 1 ? total : turnUsage;
|
|
29891
30043
|
previous = total;
|
|
29892
30044
|
if (!Object.values(used).some((n) => n > 0)) used = void 0;
|
|
30045
|
+
const missing = requiredImages.length ? requiredImages.filter((file2) => !readImages.has(file2)) : [...imageErrors.keys()];
|
|
30046
|
+
imageFailure = missing.length ? missing.map((file2) => imageError(file2, imageErrors.get(file2) || (translating() ? "\u672C\u8F6E\u672A\u6210\u529F\u8BFB\u53D6\u6240\u9700\u56FE\u7247\u3002" : "Required image was not successfully read this turn."))).join("\n") : void 0;
|
|
30047
|
+
if (imageFailure) events.error(imageFailure);
|
|
30048
|
+
readImages.clear();
|
|
30049
|
+
imageErrors.clear();
|
|
29893
30050
|
if (Array.isArray(result.denied_actions) && result.denied_actions.length) fail(translating() ? "Antigravity \u6743\u9650\u62D2\u7EDD\uFF0C\u8BF7\u68C0\u67E5\u6743\u9650\u89C4\u5219\u540E\u91CD\u8BD5\u3002" : "Antigravity permission denied. Check permission rules, then retry.");
|
|
29894
30051
|
if (typeof result.response !== "string" || result.status !== "SUCCESS" || str2(result.error) || result.finished_reason && result.finished_reason !== "completed" && result.finished_reason !== "success") {
|
|
29895
|
-
fail(str2(result.error) || `Antigravity: ${str2(result.status) || "missing status"}`);
|
|
30052
|
+
fail(result.status === "CANCELED" ? `Antigravity: CANCELED${result.error ? `: ${str2(result.error)}` : ""}` : str2(result.error) || `Antigravity: ${str2(result.status) || "missing status"}`);
|
|
29896
30053
|
}
|
|
29897
30054
|
events.end();
|
|
29898
30055
|
turnUsage = zero();
|
|
29899
30056
|
counted.clear();
|
|
29900
|
-
return failure2 ? `
|
|
29901
|
-
[error] ${failure2}
|
|
30057
|
+
return failure2 || imageFailure ? `
|
|
30058
|
+
[error] ${failure2 || imageFailure}
|
|
29902
30059
|
` : "";
|
|
29903
30060
|
}
|
|
29904
30061
|
return "";
|
|
29905
30062
|
});
|
|
29906
30063
|
return {
|
|
29907
30064
|
push: reader.push,
|
|
30065
|
+
setRequiredImages(files) {
|
|
30066
|
+
requiredImages = files.filter(imagePath).map((file2) => path24.resolve(cwd, file2));
|
|
30067
|
+
},
|
|
29908
30068
|
flush() {
|
|
29909
30069
|
const text3 = reader.flush();
|
|
29910
|
-
if (!terminal)
|
|
30070
|
+
if (!terminal) {
|
|
30071
|
+
incomplete = true;
|
|
30072
|
+
const diagnostics = [stderr.trim(), offStream?.match(/^(?:error:|rpc error:)/i) ? offStream : void 0];
|
|
30073
|
+
const diagnostic = diagnostics.find((text4) => text4 && manualFailure(text4)) ?? diagnostics.find((text4) => text4 && providerBlip(text4));
|
|
30074
|
+
if (diagnostic) fail(diagnostic);
|
|
30075
|
+
if (!failure2) fail(translating() ? "Antigravity \u672A\u8FD4\u56DE\u6700\u7EC8\u7ED3\u679C\uFF0C\u8BF7\u68C0\u67E5\u65E5\u5FD7\u540E\u91CD\u8BD5\u3002" : "Antigravity returned no final result. Check the log, then retry.");
|
|
30076
|
+
}
|
|
29911
30077
|
events.end();
|
|
29912
30078
|
return text3;
|
|
29913
30079
|
},
|
|
29914
30080
|
stderr(chunk) {
|
|
29915
30081
|
stderr = (stderr + chunk).slice(-16e3);
|
|
30082
|
+
if (limited(stderr)) fail(stderr.trim());
|
|
29916
30083
|
if (/soft.denied|auto-denied|permission (?:denied|required)|denied by.*(?:policy|rule)|requires? (?:user )?(?:approval|permission)/i.test(stderr)) fail(stderr.trim());
|
|
29917
30084
|
},
|
|
29918
|
-
result: () => final,
|
|
30085
|
+
result: () => final || (failure2 ? partial || void 0 : final),
|
|
29919
30086
|
resumeId: () => session,
|
|
29920
30087
|
model: () => model,
|
|
29921
30088
|
usage: () => used,
|
|
29922
|
-
|
|
30089
|
+
costUsd: () => cost,
|
|
30090
|
+
costIncomplete: () => incomplete || void 0,
|
|
30091
|
+
context: () => context,
|
|
30092
|
+
failure: () => failure2 || imageFailure,
|
|
30093
|
+
rateLimit: () => rateLimit,
|
|
29923
30094
|
offStream: () => offStream,
|
|
29924
30095
|
events: events.events
|
|
29925
30096
|
};
|
|
@@ -29992,18 +30163,19 @@ var ANTIGRAVITY = {
|
|
|
29992
30163
|
return result.status === 0 ? antigravityModels(result.stdout ?? "").map((m) => m.id) : [];
|
|
29993
30164
|
},
|
|
29994
30165
|
env: () => ({ ...process.env }),
|
|
29995
|
-
|
|
30166
|
+
images: { as: "message" },
|
|
30167
|
+
renderer: (cwd, _binary, argv = []) => {
|
|
29996
30168
|
const at = argv.indexOf("--conversation");
|
|
29997
|
-
return createAntigravityRenderer(at >= 0 ? argv[at + 1] : argv.find((a) => a.startsWith("--conversation="))?.slice(15));
|
|
30169
|
+
return createAntigravityRenderer(at >= 0 ? argv[at + 1] : argv.find((a) => a.startsWith("--conversation="))?.slice(15), cwd);
|
|
29998
30170
|
},
|
|
29999
30171
|
systemPrompt(text3, _argv, env2) {
|
|
30000
30172
|
const rule = `${text3}
|
|
30001
30173
|
|
|
30002
30174
|
The task working directory is ${env2.PWD ?? process.cwd()}. Use it as the base for project files and commands. This additional workspace contains only language rules; do not write task output here.`;
|
|
30003
30175
|
const hash = createHash3("sha256").update(rule).digest("hex").slice(0, 16);
|
|
30004
|
-
const root2 =
|
|
30005
|
-
const file2 =
|
|
30006
|
-
fs22.mkdirSync(
|
|
30176
|
+
const root2 = path25.join(machineHome(), "prompts", `antigravity-${hash}`);
|
|
30177
|
+
const file2 = path25.join(root2, ".agents", "rules", "language.md");
|
|
30178
|
+
fs22.mkdirSync(path25.dirname(file2), { recursive: true });
|
|
30007
30179
|
fs22.writeFileSync(file2, `---
|
|
30008
30180
|
trigger: always_on
|
|
30009
30181
|
---
|
|
@@ -30012,10 +30184,11 @@ ${rule}
|
|
|
30012
30184
|
`);
|
|
30013
30185
|
return { args: ["--add-dir", root2] };
|
|
30014
30186
|
},
|
|
30015
|
-
|
|
30187
|
+
transient: ({ failure: failure2 }) => providerBlip(failure2),
|
|
30188
|
+
reports: ["cost", "tokens", "model", "context"],
|
|
30016
30189
|
adoptsSessionId: false,
|
|
30017
|
-
savesSessionAtOpen:
|
|
30018
|
-
stopsOnRateLimit:
|
|
30190
|
+
savesSessionAtOpen: true,
|
|
30191
|
+
stopsOnRateLimit: true,
|
|
30019
30192
|
// `models` is read-only. Only explicit authentication errors mean signed out.
|
|
30020
30193
|
login: {
|
|
30021
30194
|
args: ["models"],
|
|
@@ -30106,7 +30279,7 @@ function checkHarnesses(harnesses) {
|
|
|
30106
30279
|
}
|
|
30107
30280
|
|
|
30108
30281
|
// ../cli/src/lib/agent/harnesses/claude-code.ts
|
|
30109
|
-
import
|
|
30282
|
+
import path28 from "node:path";
|
|
30110
30283
|
|
|
30111
30284
|
// ../cli/src/lib/agent/wire/claude-stream.ts
|
|
30112
30285
|
var ARG_KEYS = ["command", "file_path", "path", "pattern", "description", "prompt", "query", "url"];
|
|
@@ -30351,44 +30524,6 @@ function createBackgroundWait(milliseconds, expired) {
|
|
|
30351
30524
|
}
|
|
30352
30525
|
var backgroundWaitMessage = (minutes) => `the agent's background tasks did not finish within ${minutes / 60} hours, so the run was ended.`;
|
|
30353
30526
|
|
|
30354
|
-
// ../cli/src/lib/agent/prices.ts
|
|
30355
|
-
var OPENAI = {
|
|
30356
|
-
"gpt-6.1-sol": { input: 2, cachedInput: 0.1, output: 10 },
|
|
30357
|
-
"gpt-6-astra": { input: 10, cachedInput: 1, output: 50 },
|
|
30358
|
-
"gpt-6-sol": { input: 2, cachedInput: 0.2, output: 10 },
|
|
30359
|
-
"gpt-6-luna": { input: 0.1, cachedInput: 0.01, output: 0.5 },
|
|
30360
|
-
"gpt-5.6-sol": { input: 4, cachedInput: 0.4, output: 20 },
|
|
30361
|
-
"gpt-5.6-terra": { input: 2, cachedInput: 0.2, output: 12 },
|
|
30362
|
-
"gpt-5.6-luna": { input: 0.2, cachedInput: 0.02, output: 1.2 },
|
|
30363
|
-
"gpt-5.5": { input: 5, cachedInput: 0.5, output: 30 },
|
|
30364
|
-
"gpt-5.5-pro": { input: 30, cachedInput: 30, output: 180 },
|
|
30365
|
-
"gpt-5.4": { input: 2.5, cachedInput: 0.25, output: 15 },
|
|
30366
|
-
"gpt-5.4-mini": { input: 0.75, cachedInput: 0.075, output: 4.5 },
|
|
30367
|
-
"gpt-5.4-nano": { input: 0.2, cachedInput: 0.02, output: 1.25 },
|
|
30368
|
-
"gpt-5.4-pro": { input: 30, cachedInput: 30, output: 180 },
|
|
30369
|
-
"gpt-5.3-codex": { input: 1.75, cachedInput: 0.175, output: 14 },
|
|
30370
|
-
"gpt-5.2": { input: 1.75, cachedInput: 0.175, output: 14 },
|
|
30371
|
-
"gpt-5.2-pro": { input: 21, cachedInput: 21, output: 168 },
|
|
30372
|
-
"gpt-5.1": { input: 1.25, cachedInput: 0.125, output: 10 },
|
|
30373
|
-
"gpt-5": { input: 1.25, cachedInput: 0.125, output: 10 },
|
|
30374
|
-
"gpt-5-mini": { input: 0.25, cachedInput: 0.025, output: 2 },
|
|
30375
|
-
"gpt-5-nano": { input: 0.05, cachedInput: 5e-3, output: 0.4 },
|
|
30376
|
-
"gpt-5-pro": { input: 15, cachedInput: 15, output: 120 }
|
|
30377
|
-
};
|
|
30378
|
-
var PRICES = { openai: OPENAI, "openai-api": OPENAI };
|
|
30379
|
-
function lookUp(table, model) {
|
|
30380
|
-
const id = model.trim().toLowerCase().replace(/^[^/]+\//, "");
|
|
30381
|
-
return table[id] ?? table[id.replace(/-\d{4}-\d{2}-\d{2}$/, "")];
|
|
30382
|
-
}
|
|
30383
|
-
function priceUsd(provider, model, usage) {
|
|
30384
|
-
if (!provider || !model || !usage) return void 0;
|
|
30385
|
-
const table = PRICES[provider.trim().toLowerCase()];
|
|
30386
|
-
const price = table && lookUp(table, model);
|
|
30387
|
-
if (!price) return void 0;
|
|
30388
|
-
const usd = ((usage.input + usage.cacheCreation) * price.input + usage.cacheRead * price.cachedInput + usage.output * price.output) / 1e6;
|
|
30389
|
-
return Number.isFinite(usd) && usd >= 0 ? usd : void 0;
|
|
30390
|
-
}
|
|
30391
|
-
|
|
30392
30527
|
// ../cli/src/lib/agent/wire/codex-session.ts
|
|
30393
30528
|
import { readFileSync as readFileSync2, readdirSync, statSync as statSync2 } from "node:fs";
|
|
30394
30529
|
import { homedir as homedir2 } from "node:os";
|
|
@@ -30452,10 +30587,10 @@ function findRollout(threadId) {
|
|
|
30452
30587
|
}
|
|
30453
30588
|
for (const name of names2) {
|
|
30454
30589
|
if (!name.startsWith("rollout-") || !name.endsWith(tail)) continue;
|
|
30455
|
-
const
|
|
30590
|
+
const path36 = join2(dir, name);
|
|
30456
30591
|
try {
|
|
30457
|
-
const at = statSync2(
|
|
30458
|
-
if (!newest2 || at > newest2.at) newest2 = { path:
|
|
30592
|
+
const at = statSync2(path36).mtimeMs;
|
|
30593
|
+
if (!newest2 || at > newest2.at) newest2 = { path: path36, at };
|
|
30459
30594
|
} catch {
|
|
30460
30595
|
}
|
|
30461
30596
|
}
|
|
@@ -30463,11 +30598,11 @@ function findRollout(threadId) {
|
|
|
30463
30598
|
return newest2?.path;
|
|
30464
30599
|
}
|
|
30465
30600
|
function readCodexRunFacts(threadId) {
|
|
30466
|
-
const
|
|
30467
|
-
if (!
|
|
30601
|
+
const path36 = findRollout(threadId);
|
|
30602
|
+
if (!path36) return void 0;
|
|
30468
30603
|
let raw;
|
|
30469
30604
|
try {
|
|
30470
|
-
raw = readFileSync2(
|
|
30605
|
+
raw = readFileSync2(path36, "utf8");
|
|
30471
30606
|
} catch {
|
|
30472
30607
|
return void 0;
|
|
30473
30608
|
}
|
|
@@ -30579,8 +30714,8 @@ function renderCompleted(item) {
|
|
|
30579
30714
|
const changes = Array.isArray(item.changes) ? item.changes : [];
|
|
30580
30715
|
return changes.map((raw) => {
|
|
30581
30716
|
const change = obj(raw);
|
|
30582
|
-
const
|
|
30583
|
-
return
|
|
30717
|
+
const path36 = str2(change.path);
|
|
30718
|
+
return path36 ? `\u23FA ${str2(change.kind) || "change"}(${path36})
|
|
30584
30719
|
` : "";
|
|
30585
30720
|
}).join("");
|
|
30586
30721
|
}
|
|
@@ -30896,10 +31031,10 @@ function readKimiRunFacts(sessionId) {
|
|
|
30896
31031
|
const total = { input: 0, cacheCreation: 0, cacheRead: 0, output: 0 };
|
|
30897
31032
|
let model;
|
|
30898
31033
|
let holding = 0;
|
|
30899
|
-
for (const { path:
|
|
31034
|
+
for (const { path: path36, main } of wireFiles(entry2.sessionDir)) {
|
|
30900
31035
|
let raw;
|
|
30901
31036
|
try {
|
|
30902
|
-
raw = readFileSync3(
|
|
31037
|
+
raw = readFileSync3(path36, "utf8");
|
|
30903
31038
|
} catch {
|
|
30904
31039
|
continue;
|
|
30905
31040
|
}
|
|
@@ -31057,11 +31192,11 @@ function createKimiStreamRenderer(cwd, resumeId) {
|
|
|
31057
31192
|
|
|
31058
31193
|
// ../cli/src/lib/agent/wire/acp-cost.ts
|
|
31059
31194
|
import fs23 from "node:fs";
|
|
31060
|
-
import
|
|
31195
|
+
import path26 from "node:path";
|
|
31061
31196
|
import { createHash as createHash4 } from "node:crypto";
|
|
31062
31197
|
function acpCostFile(tool, cwd, session) {
|
|
31063
31198
|
const key = createHash4("sha256").update(JSON.stringify([tool, cwd, session])).digest("hex");
|
|
31064
|
-
return
|
|
31199
|
+
return path26.join(machineHome(), "usage", "acp", `${key}.json`);
|
|
31065
31200
|
}
|
|
31066
31201
|
function readAcpCost(file2) {
|
|
31067
31202
|
try {
|
|
@@ -31074,7 +31209,7 @@ function readAcpCost(file2) {
|
|
|
31074
31209
|
function saveAcpCost(file2, cost) {
|
|
31075
31210
|
if (cost === void 0) return;
|
|
31076
31211
|
try {
|
|
31077
|
-
fs23.mkdirSync(
|
|
31212
|
+
fs23.mkdirSync(path26.dirname(file2), { recursive: true, mode: 448 });
|
|
31078
31213
|
const tmp = `${file2}.${process.pid}.tmp`;
|
|
31079
31214
|
fs23.writeFileSync(tmp, JSON.stringify(cost), { mode: 384 });
|
|
31080
31215
|
fs23.renameSync(tmp, file2);
|
|
@@ -31135,7 +31270,7 @@ function createTail(log) {
|
|
|
31135
31270
|
// ../cli/package.json
|
|
31136
31271
|
var package_default = {
|
|
31137
31272
|
name: "wildcrane",
|
|
31138
|
-
version: "0.11.
|
|
31273
|
+
version: "0.11.71",
|
|
31139
31274
|
akbContract: 17,
|
|
31140
31275
|
description: "WildCrane's `akb` command \u2014 scaffold the Markdown board under docs/kanban/, put an agent on a card, and carry the flows the agent works by.",
|
|
31141
31276
|
keywords: [
|
|
@@ -31209,8 +31344,8 @@ var CLIENT_CAPABILITIES = {
|
|
|
31209
31344
|
};
|
|
31210
31345
|
function whereHint(update3, title) {
|
|
31211
31346
|
const locations = Array.isArray(update3.locations) ? update3.locations : [];
|
|
31212
|
-
const
|
|
31213
|
-
return
|
|
31347
|
+
const path36 = str2(obj(locations[0]).path);
|
|
31348
|
+
return path36 && !title.includes(path36) ? hint(path36) : "";
|
|
31214
31349
|
}
|
|
31215
31350
|
function saidBy(update3) {
|
|
31216
31351
|
const content = Array.isArray(update3.content) ? update3.content : [];
|
|
@@ -31483,7 +31618,7 @@ function decide(params, tail, events) {
|
|
|
31483
31618
|
}
|
|
31484
31619
|
|
|
31485
31620
|
// ../cli/src/lib/agent/wire/zcode.ts
|
|
31486
|
-
import
|
|
31621
|
+
import path27 from "node:path";
|
|
31487
31622
|
function whereHint2(input, title) {
|
|
31488
31623
|
const named = obj(input);
|
|
31489
31624
|
for (const key of ["command", "file_path", "path", "url", "pattern"]) {
|
|
@@ -31649,7 +31784,7 @@ async function oneTurn2(io, options) {
|
|
|
31649
31784
|
{ stringIds: true }
|
|
31650
31785
|
);
|
|
31651
31786
|
try {
|
|
31652
|
-
const workspacePath =
|
|
31787
|
+
const workspacePath = path27.resolve(io.cwd);
|
|
31653
31788
|
const workspace = { workspacePath, workspaceKey: workspacePath };
|
|
31654
31789
|
let opened;
|
|
31655
31790
|
if (io.resumeId) {
|
|
@@ -32172,7 +32307,7 @@ async function run(io, options, count2) {
|
|
|
32172
32307
|
startupTimer = setTimeout(() => {
|
|
32173
32308
|
if (!started) io.event?.({ kind: "log", data: { text: "[conversation] start_unconfirmed" } });
|
|
32174
32309
|
}, CONVERSATION_MS.start);
|
|
32175
|
-
await bounded(rpc.call("turn/start", { threadId, input: [{ type: "text", text: text3 }, ...images.map((
|
|
32310
|
+
await bounded(rpc.call("turn/start", { threadId, input: [{ type: "text", text: text3 }, ...images.map((path36) => ({ type: "localImage", path: path36 }))] }), CONVERSATION_MS.start, "Codex turn/start timed out; submission outcome is unknown.").catch((error) => {
|
|
32176
32311
|
if (!started) throw error;
|
|
32177
32312
|
});
|
|
32178
32313
|
};
|
|
@@ -32423,51 +32558,6 @@ async function run(io, options, count2) {
|
|
|
32423
32558
|
return done;
|
|
32424
32559
|
}
|
|
32425
32560
|
|
|
32426
|
-
// ../cli/src/lib/agent/harnesses/transient.ts
|
|
32427
|
-
var MANUAL = [
|
|
32428
|
-
/\b(401|403)\b/,
|
|
32429
|
-
/unauthorized|forbidden|permission denied/,
|
|
32430
|
-
/authenticat|invalid api key|api[_ ]key|not logged in|\/login|oauth/,
|
|
32431
|
-
/\b429\b/,
|
|
32432
|
-
/rate[_ ]limit|usage limit|quota|credit balance|insufficient|out of tokens/,
|
|
32433
|
-
/cancell?ed|aborted by|interrupted by the user/,
|
|
32434
|
-
/maximum budget|max(imum)? turns|exceeded the budget/,
|
|
32435
|
-
/model not found|unknown model|unsupported|invalid[_ ]request/
|
|
32436
|
-
];
|
|
32437
|
-
var PASSING = [
|
|
32438
|
-
// 502/503/529 are distinctive enough to read as a status wherever they appear. A bare
|
|
32439
|
-
// 500 is not — a failure line counting something would match it — so it is left to the
|
|
32440
|
-
// words below, which is how that status is actually written out.
|
|
32441
|
-
/\b(502|503|529)\b/,
|
|
32442
|
-
/overloaded|service unavailable|bad gateway|internal server error|server_error/,
|
|
32443
|
-
/connection (lost|dropped|reset|error|closed)|socket hang up|stream (error|disconnected)/,
|
|
32444
|
-
/econnreset|econnrefused|etimedout|enetunreach|enotfound|eai_again/,
|
|
32445
|
-
/fetch failed|request timed out|network error/
|
|
32446
|
-
];
|
|
32447
|
-
var RETRY_AFTER = /retry[-_\s]?after["':=\s]+(\d+)/i;
|
|
32448
|
-
var REASON_MAX = 140;
|
|
32449
|
-
function reasonLine(text3, rule) {
|
|
32450
|
-
const line = text3.split("\n").find((l) => rule.test(l.toLowerCase())) ?? text3;
|
|
32451
|
-
const said = line.trim().replace(/\s+/g, " ");
|
|
32452
|
-
return said.length > REASON_MAX ? `${said.slice(0, REASON_MAX - 1)}\u2026` : said;
|
|
32453
|
-
}
|
|
32454
|
-
function providerBlip(...said) {
|
|
32455
|
-
for (const text3 of said) {
|
|
32456
|
-
if (!text3?.trim()) continue;
|
|
32457
|
-
const lower = text3.toLowerCase();
|
|
32458
|
-
if (MANUAL.some((rule) => rule.test(lower))) return void 0;
|
|
32459
|
-
const hit = PASSING.find((rule) => rule.test(lower));
|
|
32460
|
-
if (!hit) continue;
|
|
32461
|
-
const asked = RETRY_AFTER.exec(text3);
|
|
32462
|
-
const seconds = asked ? Number(asked[1]) : NaN;
|
|
32463
|
-
return {
|
|
32464
|
-
reason: reasonLine(text3, hit),
|
|
32465
|
-
...Number.isFinite(seconds) && seconds > 0 ? { retryAfterMs: seconds * 1e3 } : {}
|
|
32466
|
-
};
|
|
32467
|
-
}
|
|
32468
|
-
return void 0;
|
|
32469
|
-
}
|
|
32470
|
-
|
|
32471
32561
|
// ../cli/src/lib/agent/harnesses/claude-code.ts
|
|
32472
32562
|
var cliSaid = (said) => /^\s*API Error\b/i.test(said ?? "") ? said : void 0;
|
|
32473
32563
|
var MODEL_ALIASES = ["opus", "sonnet", "haiku", "fable"];
|
|
@@ -32480,15 +32570,15 @@ var userMessage = (prompt) => `${JSON.stringify({ type: "user", message: { role:
|
|
|
32480
32570
|
`;
|
|
32481
32571
|
function claudeOnWindows() {
|
|
32482
32572
|
const [local, roaming] = [process.env.LOCALAPPDATA?.trim(), process.env.APPDATA?.trim()];
|
|
32483
|
-
const packages = local ?
|
|
32573
|
+
const packages = local ? path28.join(local, "Packages") : "";
|
|
32484
32574
|
const data = [
|
|
32485
|
-
...folders(packages).filter((name) => /^(\w+\.)?Claude_/i.test(name)).sort().map((name) =>
|
|
32486
|
-
...roaming ? [
|
|
32575
|
+
...folders(packages).filter((name) => /^(\w+\.)?Claude_/i.test(name)).sort().map((name) => path28.join(packages, name, "LocalCache", "Roaming", "Claude")),
|
|
32576
|
+
...roaming ? [path28.join(roaming, "Claude")] : []
|
|
32487
32577
|
];
|
|
32488
32578
|
return data.flatMap(
|
|
32489
|
-
(dir) => latestIn(
|
|
32490
|
-
|
|
32491
|
-
...folders(version).map((build) =>
|
|
32579
|
+
(dir) => latestIn(path28.join(dir, "claude-code")).flatMap((version) => [
|
|
32580
|
+
path28.join(version, "claude.exe"),
|
|
32581
|
+
...folders(version).map((build) => path28.join(version, build, "claude.exe"))
|
|
32492
32582
|
])
|
|
32493
32583
|
);
|
|
32494
32584
|
}
|
|
@@ -32744,7 +32834,7 @@ var CLAUDE_CODE = {
|
|
|
32744
32834
|
...latestIn(home(".local", "share", "claude", "versions")),
|
|
32745
32835
|
// The copy Claude Desktop carries.
|
|
32746
32836
|
...process.platform === "win32" ? claudeOnWindows() : latestIn(home("Library", "Application Support", "Claude", "claude-code")).flatMap(
|
|
32747
|
-
(version) => folders(version).map((build) =>
|
|
32837
|
+
(version) => folders(version).map((build) => path28.join(version, build, "claude.app", "Contents", "MacOS", "claude"))
|
|
32748
32838
|
)
|
|
32749
32839
|
],
|
|
32750
32840
|
install: "npm install -g @anthropic-ai/claude-code"
|
|
@@ -32752,7 +32842,7 @@ var CLAUDE_CODE = {
|
|
|
32752
32842
|
|
|
32753
32843
|
// ../cli/src/lib/agent/harnesses/codex.ts
|
|
32754
32844
|
import fs25 from "node:fs";
|
|
32755
|
-
import
|
|
32845
|
+
import path29 from "node:path";
|
|
32756
32846
|
|
|
32757
32847
|
// ../cli/src/lib/agent/worktree.ts
|
|
32758
32848
|
import { spawnSync as spawnSync5 } from "node:child_process";
|
|
@@ -32799,10 +32889,10 @@ function codexExtraArgs(argv, cwd = REPO_ROOT) {
|
|
|
32799
32889
|
}
|
|
32800
32890
|
const flags = [...argv, ...extra];
|
|
32801
32891
|
const workspaceWrite = flags.some((arg, i) => arg === "--full-auto" || arg === "--sandbox=workspace-write" || (arg === "--sandbox" || arg === "-s") && flags[i + 1] === "workspace-write");
|
|
32802
|
-
if (workspaceWrite &&
|
|
32892
|
+
if (workspaceWrite && path29.resolve(cwd) !== path29.resolve(REPO_ROOT)) {
|
|
32803
32893
|
for (const dir of [KANBAN, AKB_DIR]) {
|
|
32804
|
-
const relative =
|
|
32805
|
-
if (relative === ".." || relative.startsWith(`..${
|
|
32894
|
+
const relative = path29.relative(cwd, dir);
|
|
32895
|
+
if (relative === ".." || relative.startsWith(`..${path29.sep}`) || path29.isAbsolute(relative)) {
|
|
32806
32896
|
extra.push("--add-dir", dir);
|
|
32807
32897
|
}
|
|
32808
32898
|
}
|
|
@@ -32851,28 +32941,28 @@ function codexOnWindows() {
|
|
|
32851
32941
|
const local = envRoot("LOCALAPPDATA");
|
|
32852
32942
|
const profile = envRoot("USERPROFILE");
|
|
32853
32943
|
const programs = envRoot("ProgramFiles");
|
|
32854
|
-
const cache = local ?
|
|
32855
|
-
const releases = profile ?
|
|
32856
|
-
const packages = programs ?
|
|
32944
|
+
const cache = local ? path29.join(local, "OpenAI", "Codex", "bin") : "";
|
|
32945
|
+
const releases = profile ? path29.join(profile, ".codex", "packages", "standalone", "releases") : "";
|
|
32946
|
+
const packages = programs ? path29.join(programs, "WindowsApps") : "";
|
|
32857
32947
|
return [
|
|
32858
32948
|
// Desktop's relocated CLI cache: a folder per build hash, newest file first.
|
|
32859
|
-
...byNewest(folders(cache).map((name) =>
|
|
32949
|
+
...byNewest(folders(cache).map((name) => path29.join(cache, name, "codex.exe"))),
|
|
32860
32950
|
// The separate standalone launcher, at a path with nothing variable in it.
|
|
32861
|
-
...local ? [
|
|
32951
|
+
...local ? [path29.join(local, "Programs", "OpenAI", "Codex", "bin", "codex.exe")] : [],
|
|
32862
32952
|
// That launcher's release payload: a folder per version and target.
|
|
32863
32953
|
...byVersion(folders(releases).filter(ourArch)).map(
|
|
32864
|
-
(name) =>
|
|
32954
|
+
(name) => path29.join(releases, name, "bin", "codex.exe")
|
|
32865
32955
|
),
|
|
32866
32956
|
// Desktop's own MSIX package.
|
|
32867
32957
|
...byVersion(folders(packages).filter((name) => name.startsWith("OpenAI.Codex_")).filter(ourArch)).map(
|
|
32868
|
-
(name) =>
|
|
32958
|
+
(name) => path29.join(packages, name, "app", "resources", "codex.exe")
|
|
32869
32959
|
)
|
|
32870
32960
|
];
|
|
32871
32961
|
}
|
|
32872
32962
|
function codexInstalls() {
|
|
32873
32963
|
const chosen = process.env.CODEX_INSTALL_DIR?.trim();
|
|
32874
32964
|
return [
|
|
32875
|
-
...chosen ? [
|
|
32965
|
+
...chosen ? [path29.join(chosen, "codex")] : [],
|
|
32876
32966
|
...process.platform === "win32" ? codexOnWindows() : [
|
|
32877
32967
|
// macOS, where Codex now lives in the merged app — `codex-cli/bin/` since 26.928…
|
|
32878
32968
|
"/Applications/ChatGPT.app/Contents/Resources/codex-cli/bin/codex",
|
|
@@ -32918,7 +33008,7 @@ var CODEX = {
|
|
|
32918
33008
|
systemPrompt(text3, argv) {
|
|
32919
33009
|
if (namesFlag(argv, ["developer_instructions", "model_instructions_file"])) return {};
|
|
32920
33010
|
try {
|
|
32921
|
-
const config = fs25.readFileSync(
|
|
33011
|
+
const config = fs25.readFileSync(path29.join(process.env.CODEX_HOME || home(".codex"), "config.toml"), "utf8");
|
|
32922
33012
|
if (/^\s*(?:developer_instructions|model_instructions_file)\s*=/m.test(config)) return {};
|
|
32923
33013
|
} catch {
|
|
32924
33014
|
}
|
|
@@ -33160,23 +33250,23 @@ var CURSOR = {
|
|
|
33160
33250
|
|
|
33161
33251
|
// ../cli/src/lib/agent/harnesses/dsh.ts
|
|
33162
33252
|
import fs26 from "node:fs";
|
|
33163
|
-
import
|
|
33253
|
+
import path30 from "node:path";
|
|
33164
33254
|
function dshHome(argv) {
|
|
33165
33255
|
const binary = argv[0];
|
|
33166
33256
|
if (!binary) return void 0;
|
|
33167
|
-
const names2 = process.platform === "win32" && !
|
|
33168
|
-
const candidates2 = binary.includes("/") || binary.includes("\\") ? names2 : (process.env.PATH ?? "").split(
|
|
33257
|
+
const names2 = process.platform === "win32" && !path30.extname(binary) ? [".exe", ".cmd"].map((ext) => binary + ext) : [binary];
|
|
33258
|
+
const candidates2 = binary.includes("/") || binary.includes("\\") ? names2 : (process.env.PATH ?? "").split(path30.delimiter).filter(Boolean).flatMap((dir2) => names2.map((name) => path30.join(dir2, name)));
|
|
33169
33259
|
let dir;
|
|
33170
33260
|
try {
|
|
33171
33261
|
const found = candidates2.find((candidate) => fs26.existsSync(candidate));
|
|
33172
33262
|
if (!found) return void 0;
|
|
33173
33263
|
const script = /\.cmd$/i.test(found) ? shimTarget(fs26.readFileSync(found, "utf8"), found)?.script : void 0;
|
|
33174
|
-
dir =
|
|
33264
|
+
dir = path30.dirname(fs26.realpathSync(script ?? found));
|
|
33175
33265
|
} catch {
|
|
33176
33266
|
return void 0;
|
|
33177
33267
|
}
|
|
33178
|
-
for (let up =
|
|
33179
|
-
if (fs26.existsSync(
|
|
33268
|
+
for (let up = path30.dirname(dir); dir !== up; up = path30.dirname(dir)) {
|
|
33269
|
+
if (fs26.existsSync(path30.join(dir, "package.json"))) return dir;
|
|
33180
33270
|
dir = up;
|
|
33181
33271
|
}
|
|
33182
33272
|
return void 0;
|
|
@@ -33874,8 +33964,8 @@ var sources2 = Object.fromEntries(
|
|
|
33874
33964
|
])
|
|
33875
33965
|
);
|
|
33876
33966
|
Object.assign(sources2, {
|
|
33877
|
-
"claude-code": () => claudeModels(
|
|
33878
|
-
codex: () => codexModels(
|
|
33967
|
+
"claude-code": () => claudeModels(path31.join(process.env.CLAUDE_CONFIG_DIR || path31.join(os6.homedir(), ".claude"), "cache", "model-catalog")),
|
|
33968
|
+
codex: () => codexModels(path31.join(process.env.CODEX_HOME || path31.join(os6.homedir(), ".codex"), "models_cache.json")),
|
|
33879
33969
|
opencode: async (signal) => opencodeModels(await output(commandOf(HARNESSES2.opencode)[0], ["models"], signal)),
|
|
33880
33970
|
cursor: (signal) => cursorModels(signal),
|
|
33881
33971
|
antigravity: async (signal) => antigravityModels(await output(commandOf(HARNESSES2.antigravity)[0], ["models"], signal))
|
|
@@ -33963,7 +34053,7 @@ function claudeModels(dir) {
|
|
|
33963
34053
|
}
|
|
33964
34054
|
const catalogs = files.flatMap((f) => {
|
|
33965
34055
|
try {
|
|
33966
|
-
const data = obj(JSON.parse(fs27.readFileSync(
|
|
34056
|
+
const data = obj(JSON.parse(fs27.readFileSync(path31.join(dir, f), "utf8")));
|
|
33967
34057
|
const catalog = obj(data.catalog);
|
|
33968
34058
|
const surface = str2(catalog.surface);
|
|
33969
34059
|
return surface === "cc" || surface === "ccd" ? [{ surface, at: Number(data.fetchedAt) || 0, config: obj(catalog.config) }] : [];
|
|
@@ -34010,33 +34100,33 @@ function probeLogin(binary, harness) {
|
|
|
34010
34100
|
|
|
34011
34101
|
// src/akb.ts
|
|
34012
34102
|
import fs28 from "node:fs";
|
|
34013
|
-
import
|
|
34103
|
+
import path32 from "node:path";
|
|
34014
34104
|
import { fileURLToPath as fileURLToPath2, pathToFileURL } from "node:url";
|
|
34015
|
-
var akbHome = () =>
|
|
34105
|
+
var akbHome = () => path32.join(runnerHome(), "bin", "akb");
|
|
34016
34106
|
var BUNDLED_SHIM = `bundled-${AKB_VERSION}`;
|
|
34017
|
-
var HERE =
|
|
34107
|
+
var HERE = path32.dirname(fileURLToPath2(import.meta.url));
|
|
34018
34108
|
function akbArgs(entry2, dist = HERE) {
|
|
34019
|
-
const preload =
|
|
34109
|
+
const preload = path32.join(dist, "akb-proxy.mjs");
|
|
34020
34110
|
return fs28.existsSync(preload) ? ["--import", pathToFileURL(preload).href, entry2] : [entry2];
|
|
34021
34111
|
}
|
|
34022
34112
|
var bundledAkb = (dist = HERE) => ({
|
|
34023
34113
|
command: process.execPath,
|
|
34024
|
-
args: akbArgs(
|
|
34114
|
+
args: akbArgs(path32.join(dist, "akb", "bin", "ai4kanban.mjs"), dist),
|
|
34025
34115
|
version: AKB_VERSION,
|
|
34026
|
-
shim:
|
|
34116
|
+
shim: path32.join(akbHome(), BUNDLED_SHIM)
|
|
34027
34117
|
});
|
|
34028
34118
|
var quote = (s) => /^[\w./:@=-]+$/.test(s) ? s : `"${s}"`;
|
|
34029
34119
|
function shimDir(akb) {
|
|
34030
34120
|
const dir = akb.shim;
|
|
34031
34121
|
const line = [akb.command, ...akb.args].map(quote).join(" ");
|
|
34032
|
-
const [file2, text3] = process.platform === "win32" ? [
|
|
34033
|
-
`] : [
|
|
34122
|
+
const [file2, text3] = process.platform === "win32" ? [path32.join(dir, "akb.cmd"), `@${line} %*\r
|
|
34123
|
+
`] : [path32.join(dir, "akb"), `#!/bin/sh
|
|
34034
34124
|
exec ${line} "$@"
|
|
34035
34125
|
`];
|
|
34036
34126
|
if (process.platform === "win32") {
|
|
34037
34127
|
fs28.mkdirSync(dir, { recursive: true });
|
|
34038
34128
|
const shellLine = [akb.command, ...akb.args].map((s) => `'${s.replaceAll("\\", "/").replaceAll("'", "'\\''")}'`).join(" ");
|
|
34039
|
-
fs28.writeFileSync(
|
|
34129
|
+
fs28.writeFileSync(path32.join(dir, "akb"), `#!/bin/sh
|
|
34040
34130
|
exec ${shellLine} "$@"
|
|
34041
34131
|
`, { mode: 493 });
|
|
34042
34132
|
}
|
|
@@ -34053,11 +34143,11 @@ var KEEP2 = 256 * 1024;
|
|
|
34053
34143
|
// src/lock.ts
|
|
34054
34144
|
import crypto7 from "node:crypto";
|
|
34055
34145
|
import net from "node:net";
|
|
34056
|
-
import
|
|
34146
|
+
import path33 from "node:path";
|
|
34057
34147
|
function lockPath() {
|
|
34058
34148
|
const home3 = runnerHome();
|
|
34059
34149
|
if (process.platform === "win32") return `\\\\.\\pipe\\wildcrane-${crypto7.createHash("sha256").update(home3).digest("hex").slice(0, 16)}`;
|
|
34060
|
-
return
|
|
34150
|
+
return path33.join(home3, "runner.sock");
|
|
34061
34151
|
}
|
|
34062
34152
|
function runnerSettingsSupport() {
|
|
34063
34153
|
return new Promise((resolve2) => {
|
|
@@ -34241,9 +34331,9 @@ async function exchange(code, verifier, generation, signal) {
|
|
|
34241
34331
|
writeSession(session);
|
|
34242
34332
|
return null;
|
|
34243
34333
|
}
|
|
34244
|
-
var authCall = (
|
|
34334
|
+
var authCall = (path36, body) => {
|
|
34245
34335
|
const { api, anonKey } = cloudEndpoints();
|
|
34246
|
-
return fetch(`${api}/auth/v1/${
|
|
34336
|
+
return fetch(`${api}/auth/v1/${path36}`, {
|
|
34247
34337
|
method: "POST",
|
|
34248
34338
|
headers: { apikey: anonKey, "content-type": "application/json" },
|
|
34249
34339
|
body: JSON.stringify(body),
|
|
@@ -34304,7 +34394,7 @@ var callback = () => {
|
|
|
34304
34394
|
};
|
|
34305
34395
|
var notify = () => {
|
|
34306
34396
|
fs29.mkdirSync(runnerHome(), { recursive: true, mode: 448 });
|
|
34307
|
-
fs29.writeFileSync(
|
|
34397
|
+
fs29.writeFileSync(path34.join(runnerHome(), "settings-refresh"), crypto9.randomUUID(), { mode: 384 });
|
|
34308
34398
|
callback();
|
|
34309
34399
|
};
|
|
34310
34400
|
var onSettingsChange = (next) => {
|
|
@@ -34365,7 +34455,7 @@ async function addFolder2(dir, bind, strict = false) {
|
|
|
34365
34455
|
let project = found.folder?.project;
|
|
34366
34456
|
if (found.folder && (bind ? bind !== project : strict)) return { error: "folder_taken", message: "taken", name: found.folder.name };
|
|
34367
34457
|
if (!project) {
|
|
34368
|
-
const added = await addFolder(machineId(),
|
|
34458
|
+
const added = await addFolder(machineId(), path34.basename(real) || real, real, bind);
|
|
34369
34459
|
if (!added.ok) return failure(added);
|
|
34370
34460
|
project = added.value.folder.project;
|
|
34371
34461
|
}
|
|
@@ -34400,7 +34490,7 @@ async function removeFolder2(project) {
|
|
|
34400
34490
|
}
|
|
34401
34491
|
function akbFile() {
|
|
34402
34492
|
try {
|
|
34403
|
-
return
|
|
34493
|
+
return path34.join(shimDir(bundledAkb()), process.platform === "win32" ? "akb.cmd" : "akb");
|
|
34404
34494
|
} catch {
|
|
34405
34495
|
return null;
|
|
34406
34496
|
}
|
|
@@ -34485,7 +34575,7 @@ async function settingsAction(action, body, context) {
|
|
|
34485
34575
|
if (why) return { error: why };
|
|
34486
34576
|
const real = fs29.realpathSync(dir);
|
|
34487
34577
|
selected.set(context, { path: real, subject: readSession().subject });
|
|
34488
|
-
return { path: real, name:
|
|
34578
|
+
return { path: real, name: path34.basename(real) };
|
|
34489
34579
|
} catch {
|
|
34490
34580
|
return { error: "picker_unavailable" };
|
|
34491
34581
|
}
|
|
@@ -34559,7 +34649,7 @@ async function terminalSettings(entry2) {
|
|
|
34559
34649
|
|
|
34560
34650
|
// src/launcher-main.ts
|
|
34561
34651
|
useRunnerHome();
|
|
34562
|
-
var entry =
|
|
34652
|
+
var entry = path35.join(path35.dirname(fileURLToPath3(import.meta.url)), "runner.mjs");
|
|
34563
34653
|
if (process.argv.includes("--settings")) {
|
|
34564
34654
|
terminalSettings(entry).catch(() => {
|
|
34565
34655
|
process.stderr.write("\u65E0\u6CD5\u6253\u5F00\u672C\u673A\u8BBE\u7F6E\uFF0C\u8BF7\u91CD\u8BD5\u3002\n");
|