lody 0.67.3 → 0.68.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.
|
@@ -3,7 +3,7 @@ import { readFile, mkdir, writeFile, rename } from "node:fs/promises";
|
|
|
3
3
|
import os__default from "node:os";
|
|
4
4
|
import path__default from "node:path";
|
|
5
5
|
import process from "node:process";
|
|
6
|
-
const reviewViewerVersion = "0.
|
|
6
|
+
const reviewViewerVersion = "0.68.0";
|
|
7
7
|
const reviewViewerSha256 = "50ab599b652bdf4b959b539ea948454dd588703039bd4c5c037c7877ce10696f";
|
|
8
8
|
const reviewViewerFileName = "standalone.html";
|
|
9
9
|
const DEFAULT_CDN_BASES = ["https://cdn.jsdelivr.net/npm", "https://unpkg.com"];
|
package/dist/claude-acp.js
CHANGED
|
@@ -28,7 +28,6 @@ import { promisify as promisify$1 } from "node:util";
|
|
|
28
28
|
import * as fs$3 from "node:fs";
|
|
29
29
|
import { WritableStream as WritableStream$1, ReadableStream as ReadableStream$1 } from "node:stream/web";
|
|
30
30
|
import * as require$$1 from "https";
|
|
31
|
-
import { MODE_CONFIG_ID, FAST_MODE_CONFIG_ID, resolveFastModeEnabled, MODEL_CONFIG_ID, buildAvailableModes, EFFORT_CONFIG_ID, buildConfigOptions, clientSupportsBooleanConfigOptions, AGENT_CONFIG_ID, DEFAULT_AGENT_ID, createFastModeConfigOption, fastModeStateEnabled, BUILTIN_AGENT_NAMES } from "./chunks/baseline-config-CcYq1mUH.js";
|
|
32
31
|
(async () => {
|
|
33
32
|
var jz = Object.create;
|
|
34
33
|
var { getPrototypeOf: Uz, defineProperty: $g, getOwnPropertyNames: zz } = Object;
|
|
@@ -63038,6 +63037,186 @@ ${content.text}
|
|
|
63038
63037
|
req.end();
|
|
63039
63038
|
});
|
|
63040
63039
|
}
|
|
63040
|
+
const BUILTIN_AGENT_NAMES = /* @__PURE__ */ new Set([
|
|
63041
|
+
"claude",
|
|
63042
|
+
"general-purpose",
|
|
63043
|
+
"Explore",
|
|
63044
|
+
"Plan",
|
|
63045
|
+
"statusline-setup"
|
|
63046
|
+
]);
|
|
63047
|
+
const DEFAULT_AGENT_ID = "default";
|
|
63048
|
+
const MODE_CONFIG_ID = "mode";
|
|
63049
|
+
const MODEL_CONFIG_ID = "model";
|
|
63050
|
+
const EFFORT_CONFIG_ID = "effort";
|
|
63051
|
+
const AGENT_CONFIG_ID = "agent";
|
|
63052
|
+
const FAST_MODE_CONFIG_ID = "fast";
|
|
63053
|
+
const FAST_MODE_ON = "on";
|
|
63054
|
+
const FAST_MODE_OFF = "off";
|
|
63055
|
+
const FAST_MODE_DESCRIPTION = "Faster responses on supported models";
|
|
63056
|
+
function buildAvailableModes(modelInfo, options = {}) {
|
|
63057
|
+
const modes = [];
|
|
63058
|
+
if (modelInfo?.supportsAutoMode === true) {
|
|
63059
|
+
modes.push({
|
|
63060
|
+
id: "auto",
|
|
63061
|
+
name: "Auto",
|
|
63062
|
+
description: "Use a model classifier to approve/deny permission prompts"
|
|
63063
|
+
});
|
|
63064
|
+
}
|
|
63065
|
+
modes.push({
|
|
63066
|
+
id: "default",
|
|
63067
|
+
name: "Default",
|
|
63068
|
+
description: "Standard behavior, prompts for dangerous operations"
|
|
63069
|
+
}, {
|
|
63070
|
+
id: "acceptEdits",
|
|
63071
|
+
name: "Accept Edits",
|
|
63072
|
+
description: "Auto-accept file edit operations"
|
|
63073
|
+
}, {
|
|
63074
|
+
id: "plan",
|
|
63075
|
+
name: "Plan Mode",
|
|
63076
|
+
description: "Planning mode, no actual tool execution"
|
|
63077
|
+
}, {
|
|
63078
|
+
id: "dontAsk",
|
|
63079
|
+
name: "Don't Ask",
|
|
63080
|
+
description: "Don't prompt for permissions, deny if not pre-approved"
|
|
63081
|
+
});
|
|
63082
|
+
if (options.allowBypass === true) {
|
|
63083
|
+
modes.push({
|
|
63084
|
+
id: "bypassPermissions",
|
|
63085
|
+
name: "Bypass Permissions",
|
|
63086
|
+
description: "Bypass all permission checks"
|
|
63087
|
+
});
|
|
63088
|
+
}
|
|
63089
|
+
return modes;
|
|
63090
|
+
}
|
|
63091
|
+
function fastModeStateEnabled(state) {
|
|
63092
|
+
return state !== "off";
|
|
63093
|
+
}
|
|
63094
|
+
function clientSupportsBooleanConfigOptions(clientCapabilities) {
|
|
63095
|
+
return clientCapabilities?.session?.configOptions?.boolean != null;
|
|
63096
|
+
}
|
|
63097
|
+
function createFastModeConfigOption(enabled, useBooleanOption) {
|
|
63098
|
+
const base = {
|
|
63099
|
+
id: FAST_MODE_CONFIG_ID,
|
|
63100
|
+
name: "Fast mode",
|
|
63101
|
+
description: FAST_MODE_DESCRIPTION,
|
|
63102
|
+
category: "model_config"
|
|
63103
|
+
};
|
|
63104
|
+
if (useBooleanOption) {
|
|
63105
|
+
return {
|
|
63106
|
+
...base,
|
|
63107
|
+
type: "boolean",
|
|
63108
|
+
currentValue: enabled
|
|
63109
|
+
};
|
|
63110
|
+
}
|
|
63111
|
+
return {
|
|
63112
|
+
...base,
|
|
63113
|
+
type: "select",
|
|
63114
|
+
currentValue: enabled ? FAST_MODE_ON : FAST_MODE_OFF,
|
|
63115
|
+
options: [
|
|
63116
|
+
{
|
|
63117
|
+
value: FAST_MODE_ON,
|
|
63118
|
+
name: "On"
|
|
63119
|
+
},
|
|
63120
|
+
{
|
|
63121
|
+
value: FAST_MODE_OFF,
|
|
63122
|
+
name: "Off"
|
|
63123
|
+
}
|
|
63124
|
+
]
|
|
63125
|
+
};
|
|
63126
|
+
}
|
|
63127
|
+
function resolveFastModeEnabled(params) {
|
|
63128
|
+
const value = params.value;
|
|
63129
|
+
if (typeof value === "boolean") {
|
|
63130
|
+
return value;
|
|
63131
|
+
}
|
|
63132
|
+
if (value === FAST_MODE_ON) {
|
|
63133
|
+
return true;
|
|
63134
|
+
}
|
|
63135
|
+
if (value === FAST_MODE_OFF) {
|
|
63136
|
+
return false;
|
|
63137
|
+
}
|
|
63138
|
+
throw new Error(`Invalid value for config option ${FAST_MODE_CONFIG_ID}: ${value}`);
|
|
63139
|
+
}
|
|
63140
|
+
function buildConfigOptions(modes, models, modelInfos, currentEffortLevel, agents = [], currentAgent = DEFAULT_AGENT_ID, fastMode) {
|
|
63141
|
+
const options = [
|
|
63142
|
+
{
|
|
63143
|
+
id: MODE_CONFIG_ID,
|
|
63144
|
+
name: "Mode",
|
|
63145
|
+
description: "Session permission mode",
|
|
63146
|
+
category: "mode",
|
|
63147
|
+
type: "select",
|
|
63148
|
+
currentValue: modes.currentModeId,
|
|
63149
|
+
options: modes.availableModes.map((mode) => ({
|
|
63150
|
+
value: mode.id,
|
|
63151
|
+
name: mode.name,
|
|
63152
|
+
description: mode.description
|
|
63153
|
+
}))
|
|
63154
|
+
},
|
|
63155
|
+
{
|
|
63156
|
+
id: MODEL_CONFIG_ID,
|
|
63157
|
+
name: "Model",
|
|
63158
|
+
description: "AI model to use",
|
|
63159
|
+
category: "model",
|
|
63160
|
+
type: "select",
|
|
63161
|
+
currentValue: models.currentModelId,
|
|
63162
|
+
options: models.availableModels.map((model) => ({
|
|
63163
|
+
value: model.modelId,
|
|
63164
|
+
name: model.name,
|
|
63165
|
+
description: model.description ?? void 0
|
|
63166
|
+
}))
|
|
63167
|
+
}
|
|
63168
|
+
];
|
|
63169
|
+
const currentModelInfo = modelInfos.find((model) => model.value === models.currentModelId);
|
|
63170
|
+
const supportedLevels = currentModelInfo?.supportsEffort ? currentModelInfo.supportedEffortLevels ?? [] : [];
|
|
63171
|
+
if (supportedLevels.length > 0) {
|
|
63172
|
+
const effortOptions = [
|
|
63173
|
+
{
|
|
63174
|
+
value: "default",
|
|
63175
|
+
name: "Default"
|
|
63176
|
+
},
|
|
63177
|
+
...supportedLevels.map((level) => ({
|
|
63178
|
+
value: level,
|
|
63179
|
+
name: level.split(/[_-]/).map((part) => part ? part.charAt(0).toUpperCase() + part.slice(1) : part).join(" ")
|
|
63180
|
+
}))
|
|
63181
|
+
];
|
|
63182
|
+
const includes = (level) => level === "default" || supportedLevels.includes(level);
|
|
63183
|
+
const validEffort = currentEffortLevel && includes(currentEffortLevel) ? currentEffortLevel : "default";
|
|
63184
|
+
options.push({
|
|
63185
|
+
id: EFFORT_CONFIG_ID,
|
|
63186
|
+
name: "Effort",
|
|
63187
|
+
description: "Available effort levels for this model",
|
|
63188
|
+
category: "thought_level",
|
|
63189
|
+
type: "select",
|
|
63190
|
+
currentValue: validEffort,
|
|
63191
|
+
options: effortOptions
|
|
63192
|
+
});
|
|
63193
|
+
}
|
|
63194
|
+
if (fastMode?.supported) {
|
|
63195
|
+
options.push(createFastModeConfigOption(fastMode.enabled, fastMode.useBooleanOption));
|
|
63196
|
+
}
|
|
63197
|
+
if (agents.length > 0) {
|
|
63198
|
+
options.push({
|
|
63199
|
+
id: AGENT_CONFIG_ID,
|
|
63200
|
+
name: "Agent",
|
|
63201
|
+
description: "Main-thread agent persona",
|
|
63202
|
+
type: "select",
|
|
63203
|
+
currentValue: currentAgent,
|
|
63204
|
+
options: [
|
|
63205
|
+
{
|
|
63206
|
+
value: DEFAULT_AGENT_ID,
|
|
63207
|
+
name: "Default",
|
|
63208
|
+
description: "Standard Claude Code agent"
|
|
63209
|
+
},
|
|
63210
|
+
...agents.map((agent2) => ({
|
|
63211
|
+
value: agent2.name,
|
|
63212
|
+
name: agent2.name,
|
|
63213
|
+
description: agent2.description || void 0
|
|
63214
|
+
}))
|
|
63215
|
+
]
|
|
63216
|
+
});
|
|
63217
|
+
}
|
|
63218
|
+
return options;
|
|
63219
|
+
}
|
|
63041
63220
|
const CLAUDE_CONFIG_DIR = process.env.CLAUDE_CONFIG_DIR ?? path$1.join(os$3.homedir(), ".claude");
|
|
63042
63221
|
const execFileAsync = promisify$1(execFile$1);
|
|
63043
63222
|
const MAX_TITLE_LENGTH = 256;
|