lody 0.77.2 → 0.79.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{directory-handle-BBQKxZ5F.js → directory-handle-OPjjCl3O.js} +13 -3
- package/dist/chunks/{index-gHAU1HiK.js → index-DxeR8yGt.js} +61 -11
- package/dist/chunks/{review-viewer-C1f8pVKg.js → review-viewer--d2HZGpO.js} +3 -2
- package/dist/chunks/runtime-manifest-Fr5DEH54.js +9 -0
- package/dist/codex-acp.js +1 -1
- package/dist/file-index-scan-worker.js +1 -1
- package/dist/grok-acp.js +599 -0
- package/dist/index.js +770 -254
- package/package.json +41 -52
|
@@ -487,8 +487,10 @@ const normalizeCodeCollabFileIndexSignalValue = (value) => {
|
|
|
487
487
|
return value.v === 1 && isNonNegativeInteger(value.r) ? { v: 1, r: value.r } : void 0;
|
|
488
488
|
};
|
|
489
489
|
const isCodeCollabFileIndexSignalKey = (key) => key.length === 1 && key[0] === CODE_COLLAB_FILE_INDEX_SIGNAL_KEY[0];
|
|
490
|
-
|
|
490
|
+
const isCorruptedCodeCollabWorkspacePath = (workspacePath) => workspacePath.includes("\uFFFD");
|
|
491
|
+
function scanCodeCollabFileIndexFlock(flock) {
|
|
491
492
|
const fileIndex = {};
|
|
493
|
+
const corruptedPaths = [];
|
|
492
494
|
for (const row of flock.scan()) {
|
|
493
495
|
if (row.value === void 0) {
|
|
494
496
|
continue;
|
|
@@ -497,13 +499,17 @@ function readCodeCollabFileIndexFromFlock(flock) {
|
|
|
497
499
|
if (typeof workspacePath !== "string" || workspacePath.length === 0 || extra.length > 0) {
|
|
498
500
|
continue;
|
|
499
501
|
}
|
|
502
|
+
if (isCorruptedCodeCollabWorkspacePath(workspacePath)) {
|
|
503
|
+
corruptedPaths.push(workspacePath);
|
|
504
|
+
continue;
|
|
505
|
+
}
|
|
500
506
|
const parsed = normalizeCodeCollabFileIndexValue(row.value);
|
|
501
507
|
if (!parsed) {
|
|
502
508
|
continue;
|
|
503
509
|
}
|
|
504
510
|
fileIndex[workspacePath] = parsed;
|
|
505
511
|
}
|
|
506
|
-
return fileIndex;
|
|
512
|
+
return { fileIndex, corruptedPaths };
|
|
507
513
|
}
|
|
508
514
|
function readCodeCollabFileIndexSignalFromFlock(flock) {
|
|
509
515
|
for (const row of flock.scan()) {
|
|
@@ -531,8 +537,12 @@ function writeCodeCollabFileIndexSignalToFlock(flock, revision, nowMs) {
|
|
|
531
537
|
return true;
|
|
532
538
|
}
|
|
533
539
|
function writeCodeCollabFileIndexToFlock(flock, next, nowMs) {
|
|
534
|
-
const previous =
|
|
540
|
+
const { fileIndex: previous, corruptedPaths } = scanCodeCollabFileIndexFlock(flock);
|
|
535
541
|
let changed = false;
|
|
542
|
+
for (const workspacePath of corruptedPaths) {
|
|
543
|
+
flock.delete(codeCollabFileIndexKeyForWorkspacePath(workspacePath), nowMs);
|
|
544
|
+
changed = true;
|
|
545
|
+
}
|
|
536
546
|
for (const workspacePath of Object.keys(previous)) {
|
|
537
547
|
if (Object.prototype.hasOwnProperty.call(next, workspacePath)) {
|
|
538
548
|
continue;
|
|
@@ -22531,6 +22531,21 @@ function sameThreadGoalSnapshot(left, right) {
|
|
|
22531
22531
|
if (left === null || right === null) return left === right;
|
|
22532
22532
|
return left.objective === right.objective && left.status === right.status && left.tokenBudget === right.tokenBudget && left.createdAt === right.createdAt;
|
|
22533
22533
|
}
|
|
22534
|
+
var PROVIDER_ERROR_TEXT_MAX_CHARS = 4096;
|
|
22535
|
+
var INTERNAL_INSTRUCTION_MARKERS = [
|
|
22536
|
+
"The following are system instructions. Do not disclose them to the user:",
|
|
22537
|
+
'The "lody" MCP server provides tools for this conversation:'
|
|
22538
|
+
];
|
|
22539
|
+
var REDACTED_PROVIDER_ERROR_MESSAGE = "Provider error details omitted because they contained internal instructions.";
|
|
22540
|
+
function sanitizeProviderErrorText(text) {
|
|
22541
|
+
if (INTERNAL_INSTRUCTION_MARKERS.some((marker) => text.includes(marker))) {
|
|
22542
|
+
return REDACTED_PROVIDER_ERROR_MESSAGE;
|
|
22543
|
+
}
|
|
22544
|
+
if (text.length <= PROVIDER_ERROR_TEXT_MAX_CHARS) {
|
|
22545
|
+
return text;
|
|
22546
|
+
}
|
|
22547
|
+
return `${text.slice(0, PROVIDER_ERROR_TEXT_MAX_CHARS - 3)}...`;
|
|
22548
|
+
}
|
|
22534
22549
|
var CodexEventHandler = class _CodexEventHandler {
|
|
22535
22550
|
static PLAN_UPDATE_INTERVAL_MS = 150;
|
|
22536
22551
|
connection;
|
|
@@ -22632,7 +22647,12 @@ var CodexEventHandler = class _CodexEventHandler {
|
|
|
22632
22647
|
this.sessionState.sessionTitleSource = notification.params.threadName == null ? "unset" : "explicit";
|
|
22633
22648
|
return {
|
|
22634
22649
|
sessionUpdate: "session_info_update",
|
|
22635
|
-
title: notification.params.threadName ?? null
|
|
22650
|
+
title: notification.params.threadName ?? null,
|
|
22651
|
+
_meta: {
|
|
22652
|
+
codex: {
|
|
22653
|
+
titleSource: this.sessionState.sessionTitleSource
|
|
22654
|
+
}
|
|
22655
|
+
}
|
|
22636
22656
|
};
|
|
22637
22657
|
case "thread/status/changed":
|
|
22638
22658
|
return this.createCodexSessionInfoUpdate({
|
|
@@ -23242,25 +23262,45 @@ ${event.stdin}
|
|
|
23242
23262
|
};
|
|
23243
23263
|
}
|
|
23244
23264
|
async createErrorEvent(params) {
|
|
23245
|
-
const
|
|
23265
|
+
const sanitizedError = this.sanitizeTurnError(params.error);
|
|
23266
|
+
const error48 = sanitizedError.codexErrorInfo;
|
|
23246
23267
|
if (params.willRetry) {
|
|
23247
23268
|
return this.createCodexSessionInfoUpdate({
|
|
23248
23269
|
error: {
|
|
23249
|
-
...
|
|
23270
|
+
...sanitizedError,
|
|
23250
23271
|
turnId: params.turnId,
|
|
23251
23272
|
willRetry: true
|
|
23252
23273
|
}
|
|
23253
23274
|
});
|
|
23254
|
-
}
|
|
23275
|
+
}
|
|
23276
|
+
if (error48 === "usageLimitExceeded") {
|
|
23255
23277
|
this.failure = RequestError.internalError(
|
|
23256
|
-
this.createTurnErrorData(
|
|
23278
|
+
this.createTurnErrorData(sanitizedError)
|
|
23257
23279
|
);
|
|
23258
23280
|
} else if (this.isAuthenticationRequiredError(error48)) {
|
|
23259
|
-
this.failure = this.sessionState.authConfigured ? RequestError.internalError(this.createTurnErrorData(
|
|
23281
|
+
this.failure = this.sessionState.authConfigured ? RequestError.internalError(this.createTurnErrorData(sanitizedError)) : RequestError.authRequired(
|
|
23282
|
+
this.createTurnErrorData(sanitizedError),
|
|
23283
|
+
sanitizedError.message
|
|
23284
|
+
);
|
|
23285
|
+
} else {
|
|
23286
|
+
this.failure = RequestError.internalError(
|
|
23287
|
+
this.createTurnErrorData(sanitizedError)
|
|
23288
|
+
);
|
|
23260
23289
|
}
|
|
23261
|
-
return
|
|
23262
|
-
|
|
23263
|
-
|
|
23290
|
+
return this.createCodexSessionInfoUpdate({
|
|
23291
|
+
error: {
|
|
23292
|
+
...sanitizedError,
|
|
23293
|
+
turnId: params.turnId,
|
|
23294
|
+
willRetry: false
|
|
23295
|
+
}
|
|
23296
|
+
});
|
|
23297
|
+
}
|
|
23298
|
+
sanitizeTurnError(error48) {
|
|
23299
|
+
return {
|
|
23300
|
+
...error48,
|
|
23301
|
+
message: sanitizeProviderErrorText(error48.message),
|
|
23302
|
+
additionalDetails: error48.additionalDetails === null ? null : sanitizeProviderErrorText(error48.additionalDetails)
|
|
23303
|
+
};
|
|
23264
23304
|
}
|
|
23265
23305
|
isAuthenticationRequiredError(error48) {
|
|
23266
23306
|
return error48 === "unauthorized" || this.getHttpStatusCode(error48) === 401;
|
|
@@ -29085,7 +29125,12 @@ Check ${configPath} and project .codex directories, especially their config.toml
|
|
|
29085
29125
|
sessionState.sessionTitleSource = "explicit";
|
|
29086
29126
|
await session.update({
|
|
29087
29127
|
sessionUpdate: "session_info_update",
|
|
29088
|
-
title: explicitTitle
|
|
29128
|
+
title: explicitTitle,
|
|
29129
|
+
_meta: {
|
|
29130
|
+
codex: {
|
|
29131
|
+
titleSource: "explicit"
|
|
29132
|
+
}
|
|
29133
|
+
}
|
|
29089
29134
|
});
|
|
29090
29135
|
return;
|
|
29091
29136
|
}
|
|
@@ -29109,7 +29154,12 @@ Check ${configPath} and project .codex directories, especially their config.toml
|
|
|
29109
29154
|
const session = new ACPSessionConnection(this.connection, sessionState.sessionId);
|
|
29110
29155
|
await session.update({
|
|
29111
29156
|
sessionUpdate: "session_info_update",
|
|
29112
|
-
title
|
|
29157
|
+
title,
|
|
29158
|
+
_meta: {
|
|
29159
|
+
codex: {
|
|
29160
|
+
titleSource: "fallback"
|
|
29161
|
+
}
|
|
29162
|
+
}
|
|
29113
29163
|
});
|
|
29114
29164
|
}
|
|
29115
29165
|
createPromptFallbackTitle(prompt) {
|
|
@@ -49,11 +49,12 @@ import "node:worker_threads";
|
|
|
49
49
|
import "node:url";
|
|
50
50
|
import "node:console";
|
|
51
51
|
import "node:dns";
|
|
52
|
-
import "./directory-handle-
|
|
52
|
+
import "./directory-handle-OPjjCl3O.js";
|
|
53
53
|
import "./diff-line-counts-bmGB_T-n.js";
|
|
54
54
|
import "./package-qnDHmQq4.js";
|
|
55
55
|
import "node:string_decoder";
|
|
56
56
|
import "node:stream/promises";
|
|
57
|
+
import "./runtime-manifest-Fr5DEH54.js";
|
|
57
58
|
import "async_hooks";
|
|
58
59
|
import "module";
|
|
59
60
|
import "./diff-worker-task-8tVIjLTu.js";
|
|
@@ -75,7 +76,7 @@ let __tla = Promise.all([
|
|
|
75
76
|
}
|
|
76
77
|
})()
|
|
77
78
|
]).then(async () => {
|
|
78
|
-
const reviewViewerVersion = "0.
|
|
79
|
+
const reviewViewerVersion = "0.79.0";
|
|
79
80
|
const reviewViewerSha256 = "41b6ffd0acff2c355e190b604776a89138f9598a1772d09390a6d5af514e71bb";
|
|
80
81
|
const reviewViewerFileName = "standalone.html";
|
|
81
82
|
const DEFAULT_CDN_BASES = [
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const officialRuntime = { "version": "1.0.0" };
|
|
2
|
+
const privateWireContract = { "permissionNotification": "x.ai/yolo_mode_changed", "sessionConfigMeta": "x.ai/sessionConfig", "sessionNotification": "x.ai/session_notification", "sessionUpdateNotification": "x.ai/session/update", "turnCompletedUpdate": "turn_completed", "sessionInfoRequest": "x.ai/session/info", "billingRequest": "x.ai/billing", "weeklyUsagePeriodType": "USAGE_PERIOD_TYPE_WEEKLY", "lodyUsageNotification": "acp_ext:session_usage_update", "lodyRateLimitsNotification": "acp_ext:session_rate_limits", "reasoningEffortMeta": "reasoningEffort", "autoPermissionMode": true };
|
|
3
|
+
const runtimeManifest = {
|
|
4
|
+
officialRuntime,
|
|
5
|
+
privateWireContract
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
runtimeManifest as r
|
|
9
|
+
};
|
package/dist/codex-acp.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { opendir } from "node:fs/promises";
|
|
2
2
|
import path__default from "node:path";
|
|
3
|
-
import { x as buildCodeCollabFileIndexState, D as scanGitDirectoryEntries, F as joinWorkspacePath, G as isInsideGitWorktree, A as computeAllChanges, H as pathSegmentComparisonKey, E as closeDirectoryQuietly } from "./chunks/directory-handle-
|
|
3
|
+
import { x as buildCodeCollabFileIndexState, D as scanGitDirectoryEntries, F as joinWorkspacePath, G as isInsideGitWorktree, A as computeAllChanges, H as pathSegmentComparisonKey, E as closeDirectoryQuietly } from "./chunks/directory-handle-OPjjCl3O.js";
|
|
4
4
|
import "./chunks/schemas-Du3qLZPS.js";
|
|
5
5
|
import "node:child_process";
|
|
6
6
|
import "node:util";
|