@cnwenf/occ 2.1.318 → 2.1.319
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/cli.js +66 -5
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
globalThis.MACRO={"VERSION":"2.1.
|
|
2
|
+
globalThis.MACRO={"VERSION":"2.1.319","BINARY_NAME":"occ","BUILD_TIME":"2026-09-01T21:40:58.418Z","FEEDBACK_CHANNEL":"","ISSUES_EXPLAINER":"","NATIVE_PACKAGE_URL":"","PACKAGE_URL":"@cnwenf/occ","VERSION_CHANGELOG":""};
|
|
3
3
|
// @bun
|
|
4
4
|
var __create = Object.create;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
@@ -380449,7 +380449,8 @@ function createPathChecker(command4, operationTypeOverride) {
|
|
|
380449
380449
|
});
|
|
380450
380450
|
}
|
|
380451
380451
|
}
|
|
380452
|
-
|
|
380452
|
+
const planFromElevatedPrePlanMode = context4.mode === "plan" && (context4.prePlanMode === "auto" || context4.prePlanMode === "bypassPermissions" || context4.prePlanMode === "acceptEdits" || context4.prePlanMode === "dontAsk");
|
|
380453
|
+
if ((operationType === "write" || operationType === "create") && (context4.mode === "default" || context4.mode === "plan") && !planFromElevatedPrePlanMode) {
|
|
380453
380454
|
suggestions.push({
|
|
380454
380455
|
type: "setMode",
|
|
380455
380456
|
mode: "acceptEdits",
|
|
@@ -617910,6 +617911,55 @@ function objectGroupBy(items, keySelector) {
|
|
|
617910
617911
|
return result;
|
|
617911
617912
|
}
|
|
617912
617913
|
|
|
617914
|
+
// src/utils/truncateMiddle.ts
|
|
617915
|
+
function truncationMarker(chars) {
|
|
617916
|
+
return `
|
|
617917
|
+
|
|
617918
|
+
... [${chars} characters truncated] ...
|
|
617919
|
+
|
|
617920
|
+
`;
|
|
617921
|
+
}
|
|
617922
|
+
function sliceHead(value, length) {
|
|
617923
|
+
if (length <= 0)
|
|
617924
|
+
return "";
|
|
617925
|
+
if (value.length <= length)
|
|
617926
|
+
return value;
|
|
617927
|
+
const head = value.slice(0, length);
|
|
617928
|
+
const lastUnit = head.charCodeAt(length - 1);
|
|
617929
|
+
return lastUnit >= 55296 && lastUnit <= 56319 ? head.slice(0, -1) : head;
|
|
617930
|
+
}
|
|
617931
|
+
function sliceTail(value, length) {
|
|
617932
|
+
if (length <= 0)
|
|
617933
|
+
return "";
|
|
617934
|
+
if (value.length <= length)
|
|
617935
|
+
return value;
|
|
617936
|
+
const tail = value.slice(-length);
|
|
617937
|
+
const firstUnit = tail.charCodeAt(0);
|
|
617938
|
+
return firstUnit >= 56320 && firstUnit <= 57343 ? tail.slice(1) : tail;
|
|
617939
|
+
}
|
|
617940
|
+
function truncateMiddleWithMarker(value, cap) {
|
|
617941
|
+
if (value.length <= cap + TRUNCATION_SLACK) {
|
|
617942
|
+
return value;
|
|
617943
|
+
}
|
|
617944
|
+
const headLength = Math.floor(cap / 2);
|
|
617945
|
+
const tailLength = cap - headLength;
|
|
617946
|
+
const head = sliceHead(value, headLength);
|
|
617947
|
+
const tail = sliceTail(value, tailLength);
|
|
617948
|
+
const removedMiddle = value.slice(headLength, value.length - tailLength);
|
|
617949
|
+
let removedChars = value.length - head.length - tail.length;
|
|
617950
|
+
for (const match of removedMiddle.matchAll(NESTED_MARKER_PATTERN)) {
|
|
617951
|
+
const claimed = match[1].length <= 15 ? Number(match[1]) : Number.NaN;
|
|
617952
|
+
if (Number.isSafeInteger(claimed) && claimed >= match[0].length) {
|
|
617953
|
+
removedChars += claimed - match[0].length;
|
|
617954
|
+
}
|
|
617955
|
+
}
|
|
617956
|
+
return `${head}${truncationMarker(removedChars)}${tail}`;
|
|
617957
|
+
}
|
|
617958
|
+
var TRUNCATION_SLACK = 1024, TASK_NOTIFICATION_CHAR_CAP = 1e5, NESTED_MARKER_PATTERN;
|
|
617959
|
+
var init_truncateMiddle = __esm(() => {
|
|
617960
|
+
NESTED_MARKER_PATTERN = /\n\n\.\.\. \[(\d+) characters truncated\] \.\.\.\n\n/g;
|
|
617961
|
+
});
|
|
617962
|
+
|
|
617913
617963
|
// src/utils/messageQueueManager.ts
|
|
617914
617964
|
function logOperation(operation, content) {
|
|
617915
617965
|
const sessionId = getSessionId();
|
|
@@ -617944,9 +617994,17 @@ function enqueue(command5) {
|
|
|
617944
617994
|
logOperation("enqueue", typeof command5.value === "string" ? command5.value : undefined);
|
|
617945
617995
|
}
|
|
617946
617996
|
function enqueuePendingNotification(command5) {
|
|
617947
|
-
|
|
617997
|
+
let toQueue = command5;
|
|
617998
|
+
if (command5.mode === "task-notification" && typeof command5.value === "string") {
|
|
617999
|
+
const cappedValue = truncateMiddleWithMarker(command5.value, TASK_NOTIFICATION_CHAR_CAP);
|
|
618000
|
+
if (cappedValue !== command5.value) {
|
|
618001
|
+
logForDebugging(`enqueuePendingNotification: task-notification capped from ${command5.value.length} to ${cappedValue.length} chars`, { level: "warn" });
|
|
618002
|
+
toQueue = { ...command5, value: cappedValue };
|
|
618003
|
+
}
|
|
618004
|
+
}
|
|
618005
|
+
commandQueue.push({ ...toQueue, priority: toQueue.priority ?? "later" });
|
|
617948
618006
|
notifySubscribers();
|
|
617949
|
-
logOperation("enqueue", typeof
|
|
618007
|
+
logOperation("enqueue", typeof toQueue.value === "string" ? toQueue.value : undefined);
|
|
617950
618008
|
}
|
|
617951
618009
|
function dequeue(filter3) {
|
|
617952
618010
|
if (commandQueue.length === 0) {
|
|
@@ -618132,8 +618190,10 @@ var commandQueue, snapshot, queueChanged, subscribeToCommandQueue, PRIORITY_ORDE
|
|
|
618132
618190
|
var init_messageQueueManager = __esm(() => {
|
|
618133
618191
|
init_featureFlags();
|
|
618134
618192
|
init_state();
|
|
618193
|
+
init_debug();
|
|
618135
618194
|
init_messages3();
|
|
618136
618195
|
init_sessionStorage();
|
|
618196
|
+
init_truncateMiddle();
|
|
618137
618197
|
commandQueue = [];
|
|
618138
618198
|
snapshot = Object.freeze([]);
|
|
618139
618199
|
queueChanged = createSignal();
|
|
@@ -754772,7 +754832,8 @@ function BashPermissionRequestInner({
|
|
|
754772
754832
|
}
|
|
754773
754833
|
case "yes-apply-suggestions": {
|
|
754774
754834
|
logUnaryPermissionEvent("tool_use_single", toolUseConfirm, "accept");
|
|
754775
|
-
const
|
|
754835
|
+
const rawSuggestions = "suggestions" in toolUseConfirm.permissionResult ? toolUseConfirm.permissionResult.suggestions || [] : [];
|
|
754836
|
+
const permissionUpdates_0 = rawSuggestions.filter((update_0) => update_0.type === "addRules" || update_0.type === "addDirectories");
|
|
754776
754837
|
toolUseConfirm.onAllow(toolUseConfirm.input, permissionUpdates_0);
|
|
754777
754838
|
onDone();
|
|
754778
754839
|
break;
|