@duheso/zerocli 0.7.9 → 0.8.1
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.mjs +666 -757
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -119193,7 +119193,7 @@ function buildProviderInfoLines() {
|
|
|
119193
119193
|
const sLen = ` ● ${sL} ${sReady}`.length;
|
|
119194
119194
|
out.push(boxRow(sRow, W2, sLen));
|
|
119195
119195
|
out.push(`${rgb(...BORDER)}╚${"═".repeat(W2 - 2)}╝${RESET}`);
|
|
119196
|
-
out.push(` ${DIM}${rgb(...DIMCOL)}zero ${RESET}${rgb(...ACCENT)}v${"0.
|
|
119196
|
+
out.push(` ${DIM}${rgb(...DIMCOL)}zero ${RESET}${rgb(...ACCENT)}v${"0.8.1"}${RESET}`);
|
|
119197
119197
|
return out;
|
|
119198
119198
|
}
|
|
119199
119199
|
function printStartupScreen() {}
|
|
@@ -151704,7 +151704,7 @@ function getAttributionHeader(fingerprint) {
|
|
|
151704
151704
|
if (!isAttributionHeaderEnabled()) {
|
|
151705
151705
|
return "";
|
|
151706
151706
|
}
|
|
151707
|
-
const version2 = `${"0.
|
|
151707
|
+
const version2 = `${"0.8.1"}.${fingerprint}`;
|
|
151708
151708
|
const entrypoint = process.env.CLAUDE_CODE_ENTRYPOINT ?? "unknown";
|
|
151709
151709
|
const cch = "";
|
|
151710
151710
|
const workload = getWorkload();
|
|
@@ -194680,7 +194680,7 @@ var init_imageValidation = __esm(() => {
|
|
|
194680
194680
|
|
|
194681
194681
|
// src/utils/userAgent.ts
|
|
194682
194682
|
function getClaudeCodeUserAgent() {
|
|
194683
|
-
return `claude-code/${"0.
|
|
194683
|
+
return `claude-code/${"0.8.1"}`;
|
|
194684
194684
|
}
|
|
194685
194685
|
|
|
194686
194686
|
// src/utils/http.ts
|
|
@@ -194689,7 +194689,7 @@ function getUserAgent() {
|
|
|
194689
194689
|
const clientApp = process.env.CLAUDE_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}` : "";
|
|
194690
194690
|
const workload = getWorkload();
|
|
194691
194691
|
const workloadSuffix = workload ? `, workload/${workload}` : "";
|
|
194692
|
-
return `claude-cli/${"0.
|
|
194692
|
+
return `claude-cli/${"0.8.1"} (${process.env.USER_TYPE}, ${process.env.CLAUDE_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
|
|
194693
194693
|
}
|
|
194694
194694
|
function getMCPUserAgent() {
|
|
194695
194695
|
const parts = [];
|
|
@@ -194703,7 +194703,7 @@ function getMCPUserAgent() {
|
|
|
194703
194703
|
parts.push(`client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}`);
|
|
194704
194704
|
}
|
|
194705
194705
|
const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
|
|
194706
|
-
return `claude-code/${"0.
|
|
194706
|
+
return `claude-code/${"0.8.1"}${suffix}`;
|
|
194707
194707
|
}
|
|
194708
194708
|
function getWebFetchUserAgent() {
|
|
194709
194709
|
const supportUrl = getAPIProvider() === "firstParty" ? "https://support.anthropic.com/" : "https://github.com/Duheso/ZeroCLI";
|
|
@@ -249132,7 +249132,7 @@ function getTelemetryAttributes() {
|
|
|
249132
249132
|
attributes["session.id"] = sessionId;
|
|
249133
249133
|
}
|
|
249134
249134
|
if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
|
|
249135
|
-
attributes["app.version"] = "0.
|
|
249135
|
+
attributes["app.version"] = "0.8.1";
|
|
249136
249136
|
}
|
|
249137
249137
|
const oauthAccount = getOauthAccountInfo();
|
|
249138
249138
|
if (oauthAccount) {
|
|
@@ -261371,7 +261371,7 @@ function computeFingerprint(messageText, version2) {
|
|
|
261371
261371
|
}
|
|
261372
261372
|
function computeFingerprintFromMessages(messages) {
|
|
261373
261373
|
const firstMessageText = extractFirstMessageText(messages);
|
|
261374
|
-
return computeFingerprint(firstMessageText, "0.
|
|
261374
|
+
return computeFingerprint(firstMessageText, "0.8.1");
|
|
261375
261375
|
}
|
|
261376
261376
|
var FINGERPRINT_SALT = "59cf53e54c78";
|
|
261377
261377
|
var init_fingerprint = () => {};
|
|
@@ -261413,7 +261413,7 @@ async function sideQuery(opts) {
|
|
|
261413
261413
|
betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
|
|
261414
261414
|
}
|
|
261415
261415
|
const messageText = extractFirstUserMessageText(messages);
|
|
261416
|
-
const fingerprint = computeFingerprint(messageText, "0.
|
|
261416
|
+
const fingerprint = computeFingerprint(messageText, "0.8.1");
|
|
261417
261417
|
const attributionHeader = getAttributionHeader(fingerprint);
|
|
261418
261418
|
const systemBlocks = [
|
|
261419
261419
|
attributionHeader ? { type: "text", text: attributionHeader } : null,
|
|
@@ -270315,7 +270315,7 @@ var init_user = __esm(() => {
|
|
|
270315
270315
|
deviceId,
|
|
270316
270316
|
sessionId: getSessionId(),
|
|
270317
270317
|
email: getEmail(),
|
|
270318
|
-
appVersion: "0.
|
|
270318
|
+
appVersion: "0.8.1",
|
|
270319
270319
|
platform: getHostPlatformForAnalytics(),
|
|
270320
270320
|
organizationUuid,
|
|
270321
270321
|
accountUuid,
|
|
@@ -270709,7 +270709,7 @@ async function initializeBetaTracing(resource) {
|
|
|
270709
270709
|
});
|
|
270710
270710
|
logs.setGlobalLoggerProvider(loggerProvider);
|
|
270711
270711
|
setLoggerProvider(loggerProvider);
|
|
270712
|
-
const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "0.
|
|
270712
|
+
const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "0.8.1");
|
|
270713
270713
|
setEventLogger(eventLogger);
|
|
270714
270714
|
process.on("beforeExit", async () => {
|
|
270715
270715
|
await loggerProvider?.forceFlush();
|
|
@@ -270749,7 +270749,7 @@ async function initializeTelemetry() {
|
|
|
270749
270749
|
const platform3 = getPlatform();
|
|
270750
270750
|
const baseAttributes = {
|
|
270751
270751
|
[ATTR_SERVICE_NAME3]: "claude-code",
|
|
270752
|
-
[ATTR_SERVICE_VERSION3]: "0.
|
|
270752
|
+
[ATTR_SERVICE_VERSION3]: "0.8.1"
|
|
270753
270753
|
};
|
|
270754
270754
|
if (platform3 === "wsl") {
|
|
270755
270755
|
const wslVersion = getWslVersion();
|
|
@@ -270794,7 +270794,7 @@ async function initializeTelemetry() {
|
|
|
270794
270794
|
} catch {}
|
|
270795
270795
|
};
|
|
270796
270796
|
registerCleanup(shutdownTelemetry2);
|
|
270797
|
-
return meterProvider2.getMeter("com.anthropic.claude_code", "0.
|
|
270797
|
+
return meterProvider2.getMeter("com.anthropic.claude_code", "0.8.1");
|
|
270798
270798
|
}
|
|
270799
270799
|
const meterProvider = new MeterProvider3({
|
|
270800
270800
|
resource,
|
|
@@ -270814,7 +270814,7 @@ async function initializeTelemetry() {
|
|
|
270814
270814
|
});
|
|
270815
270815
|
logs.setGlobalLoggerProvider(loggerProvider);
|
|
270816
270816
|
setLoggerProvider(loggerProvider);
|
|
270817
|
-
const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "0.
|
|
270817
|
+
const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "0.8.1");
|
|
270818
270818
|
setEventLogger(eventLogger);
|
|
270819
270819
|
logForDebugging("[3P telemetry] Event logger set successfully");
|
|
270820
270820
|
process.on("beforeExit", async () => {
|
|
@@ -270876,7 +270876,7 @@ Current timeout: ${timeoutMs}ms
|
|
|
270876
270876
|
}
|
|
270877
270877
|
};
|
|
270878
270878
|
registerCleanup(shutdownTelemetry);
|
|
270879
|
-
return meterProvider.getMeter("com.anthropic.claude_code", "0.
|
|
270879
|
+
return meterProvider.getMeter("com.anthropic.claude_code", "0.8.1");
|
|
270880
270880
|
}
|
|
270881
270881
|
async function flushTelemetry() {
|
|
270882
270882
|
const meterProvider = getMeterProvider();
|
|
@@ -272168,7 +272168,7 @@ function detectLinuxGlobPatternWarnings() {
|
|
|
272168
272168
|
}
|
|
272169
272169
|
async function getDoctorDiagnostic() {
|
|
272170
272170
|
const installationType = await getCurrentInstallationType();
|
|
272171
|
-
const version2 = typeof MACRO !== "undefined" ? "0.
|
|
272171
|
+
const version2 = typeof MACRO !== "undefined" ? "0.8.1" : "unknown";
|
|
272172
272172
|
const installationPath = await getInstallationPath();
|
|
272173
272173
|
const invokedBinary = getInvokedBinary();
|
|
272174
272174
|
const multipleInstallations = await detectMultipleInstallations();
|
|
@@ -273653,7 +273653,7 @@ function getInstallationEnv() {
|
|
|
273653
273653
|
return;
|
|
273654
273654
|
}
|
|
273655
273655
|
function getClaudeCodeVersion() {
|
|
273656
|
-
return "0.
|
|
273656
|
+
return "0.8.1";
|
|
273657
273657
|
}
|
|
273658
273658
|
async function getInstalledVSCodeExtensionVersion(command) {
|
|
273659
273659
|
const { stdout } = await execFileNoThrow(command, ["--list-extensions", "--show-versions"], {
|
|
@@ -275020,8 +275020,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
275020
275020
|
const maxVersion = await getMaxVersion();
|
|
275021
275021
|
if (maxVersion && gt(version2, maxVersion)) {
|
|
275022
275022
|
logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version2} to ${maxVersion}`);
|
|
275023
|
-
if (gte("0.
|
|
275024
|
-
logForDebugging(`Native installer: current version ${"0.
|
|
275023
|
+
if (gte("0.8.1", maxVersion)) {
|
|
275024
|
+
logForDebugging(`Native installer: current version ${"0.8.1"} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
275025
275025
|
logEvent("tengu_native_update_skipped_max_version", {
|
|
275026
275026
|
latency_ms: Date.now() - startTime,
|
|
275027
275027
|
max_version: maxVersion,
|
|
@@ -275032,7 +275032,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
275032
275032
|
version2 = maxVersion;
|
|
275033
275033
|
}
|
|
275034
275034
|
}
|
|
275035
|
-
if (!forceReinstall && version2 === "0.
|
|
275035
|
+
if (!forceReinstall && version2 === "0.8.1" && await versionIsAvailable(version2) && await isPossibleClaudeBinary(executablePath)) {
|
|
275036
275036
|
logForDebugging(`Found ${version2} at ${executablePath}, skipping install`);
|
|
275037
275037
|
logEvent("tengu_native_update_complete", {
|
|
275038
275038
|
latency_ms: Date.now() - startTime,
|
|
@@ -380238,7 +380238,7 @@ function getAnthropicEnvMetadata() {
|
|
|
380238
380238
|
function getBuildAgeMinutes() {
|
|
380239
380239
|
if (false)
|
|
380240
380240
|
;
|
|
380241
|
-
const buildTime = new Date("2026-05-
|
|
380241
|
+
const buildTime = new Date("2026-05-05T02:00:44.916Z").getTime();
|
|
380242
380242
|
if (isNaN(buildTime))
|
|
380243
380243
|
return;
|
|
380244
380244
|
return Math.floor((Date.now() - buildTime) / 60000);
|
|
@@ -406416,6 +406416,14 @@ var init_stdio4 = __esm(() => {
|
|
|
406416
406416
|
});
|
|
406417
406417
|
|
|
406418
406418
|
// src/utils/claudeInChrome/zeroCLIMcpServer.ts
|
|
406419
|
+
var exports_zeroCLIMcpServer = {};
|
|
406420
|
+
__export(exports_zeroCLIMcpServer, {
|
|
406421
|
+
runZeroCLIChromeMcpServer: () => runZeroCLIChromeMcpServer,
|
|
406422
|
+
createZeroCLIChromeMcpServer: () => createZeroCLIChromeMcpServer,
|
|
406423
|
+
ZEROCLI_BROWSER_TOOLS: () => ZEROCLI_BROWSER_TOOLS,
|
|
406424
|
+
MCP_SERVER_VERSION: () => MCP_SERVER_VERSION,
|
|
406425
|
+
MCP_SERVER_NAME: () => MCP_SERVER_NAME
|
|
406426
|
+
});
|
|
406419
406427
|
import { createConnection as createConnection2 } from "net";
|
|
406420
406428
|
async function sendToolRequest(method, params) {
|
|
406421
406429
|
const socketPaths = getAllSocketPaths();
|
|
@@ -406747,119 +406755,6 @@ var init_zeroCLIMcpServer = __esm(() => {
|
|
|
406747
406755
|
MAX_MESSAGE_SIZE = 1024 * 1024;
|
|
406748
406756
|
});
|
|
406749
406757
|
|
|
406750
|
-
// src/utils/claudeInChrome/mcpServer.ts
|
|
406751
|
-
var exports_mcpServer = {};
|
|
406752
|
-
__export(exports_mcpServer, {
|
|
406753
|
-
runClaudeInChromeMcpServer: () => runClaudeInChromeMcpServer
|
|
406754
|
-
});
|
|
406755
|
-
async function runClaudeInChromeMcpServer() {
|
|
406756
|
-
enableConfigs();
|
|
406757
|
-
logForDebugging("[ZeroCLI Chrome] Starting MCP server");
|
|
406758
|
-
await runZeroCLIChromeMcpServer();
|
|
406759
|
-
}
|
|
406760
|
-
var init_mcpServer = __esm(() => {
|
|
406761
|
-
init_config();
|
|
406762
|
-
init_debug();
|
|
406763
|
-
init_zeroCLIMcpServer();
|
|
406764
|
-
});
|
|
406765
|
-
|
|
406766
|
-
// native-stub:@ant/claude-for-chrome-mcp
|
|
406767
|
-
var exports_claude_for_chrome_mcp = {};
|
|
406768
|
-
__export(exports_claude_for_chrome_mcp, {
|
|
406769
|
-
trace: () => trace5,
|
|
406770
|
-
resourceFromAttributes: () => resourceFromAttributes5,
|
|
406771
|
-
plot: () => plot4,
|
|
406772
|
-
getSyntaxTheme: () => getSyntaxTheme6,
|
|
406773
|
-
getMcpConfigForManifest: () => getMcpConfigForManifest4,
|
|
406774
|
-
default: () => claude_for_chrome_mcp_default,
|
|
406775
|
-
createClaudeForChromeMcpServer: () => createClaudeForChromeMcpServer4,
|
|
406776
|
-
context: () => context4,
|
|
406777
|
-
__stub: () => __stub4,
|
|
406778
|
-
SpanStatusCode: () => SpanStatusCode4,
|
|
406779
|
-
SimpleSpanProcessor: () => SimpleSpanProcessor4,
|
|
406780
|
-
SimpleLogRecordProcessor: () => SimpleLogRecordProcessor4,
|
|
406781
|
-
SeverityNumber: () => SeverityNumber4,
|
|
406782
|
-
SandboxViolationStore: () => SandboxViolationStore5,
|
|
406783
|
-
SandboxRuntimeConfigSchema: () => SandboxRuntimeConfigSchema5,
|
|
406784
|
-
SandboxManager: () => SandboxManager6,
|
|
406785
|
-
SEMRESATTRS_SERVICE_VERSION: () => SEMRESATTRS_SERVICE_VERSION4,
|
|
406786
|
-
SEMRESATTRS_SERVICE_NAME: () => SEMRESATTRS_SERVICE_NAME4,
|
|
406787
|
-
Resource: () => Resource4,
|
|
406788
|
-
PushMetricExporter: () => PushMetricExporter4,
|
|
406789
|
-
PrometheusExporter: () => PrometheusExporter4,
|
|
406790
|
-
PeriodicExportingMetricReader: () => PeriodicExportingMetricReader5,
|
|
406791
|
-
OTLPTraceExporter: () => OTLPTraceExporter4,
|
|
406792
|
-
OTLPMetricExporter: () => OTLPMetricExporter4,
|
|
406793
|
-
OTLPLogExporter: () => OTLPLogExporter4,
|
|
406794
|
-
NodeTracerProvider: () => NodeTracerProvider4,
|
|
406795
|
-
MeterProvider: () => MeterProvider5,
|
|
406796
|
-
LoggerProvider: () => LoggerProvider5,
|
|
406797
|
-
InstrumentType: () => InstrumentType4,
|
|
406798
|
-
ExportResultCode: () => ExportResultCode4,
|
|
406799
|
-
DataPointType: () => DataPointType4,
|
|
406800
|
-
ColorFile: () => ColorFile5,
|
|
406801
|
-
ColorDiff: () => ColorDiff5,
|
|
406802
|
-
BatchSpanProcessor: () => BatchSpanProcessor5,
|
|
406803
|
-
BatchLogRecordProcessor: () => BatchLogRecordProcessor5,
|
|
406804
|
-
BasicTracerProvider: () => BasicTracerProvider5,
|
|
406805
|
-
BROWSER_TOOLS: () => BROWSER_TOOLS4,
|
|
406806
|
-
AggregationTemporality: () => AggregationTemporality4,
|
|
406807
|
-
ATTR_SERVICE_VERSION: () => ATTR_SERVICE_VERSION5,
|
|
406808
|
-
ATTR_SERVICE_NAME: () => ATTR_SERVICE_NAME5
|
|
406809
|
-
});
|
|
406810
|
-
var noop18 = () => null, noopClass4 = class {
|
|
406811
|
-
}, handler5, stub5, claude_for_chrome_mcp_default, __stub4 = true, SandboxViolationStore5 = null, SandboxManager6, SandboxRuntimeConfigSchema5, BROWSER_TOOLS4, getMcpConfigForManifest4, ColorDiff5 = null, ColorFile5 = null, getSyntaxTheme6, plot4, createClaudeForChromeMcpServer4, ExportResultCode4, resourceFromAttributes5, Resource4, SimpleSpanProcessor4, BatchSpanProcessor5, NodeTracerProvider4, BasicTracerProvider5, OTLPTraceExporter4, OTLPLogExporter4, OTLPMetricExporter4, PrometheusExporter4, LoggerProvider5, SimpleLogRecordProcessor4, BatchLogRecordProcessor5, MeterProvider5, PeriodicExportingMetricReader5, trace5, context4, SpanStatusCode4, ATTR_SERVICE_NAME5 = "service.name", ATTR_SERVICE_VERSION5 = "service.version", SEMRESATTRS_SERVICE_NAME4 = "service.name", SEMRESATTRS_SERVICE_VERSION4 = "service.version", AggregationTemporality4, DataPointType4, InstrumentType4, PushMetricExporter4, SeverityNumber4;
|
|
406812
|
-
var init_claude_for_chrome_mcp = __esm(() => {
|
|
406813
|
-
handler5 = {
|
|
406814
|
-
get(_, prop) {
|
|
406815
|
-
if (prop === "__esModule")
|
|
406816
|
-
return true;
|
|
406817
|
-
if (prop === "default")
|
|
406818
|
-
return new Proxy({}, handler5);
|
|
406819
|
-
if (prop === "ExportResultCode")
|
|
406820
|
-
return { SUCCESS: 0, FAILED: 1 };
|
|
406821
|
-
if (prop === "resourceFromAttributes")
|
|
406822
|
-
return () => ({});
|
|
406823
|
-
if (prop === "SandboxRuntimeConfigSchema")
|
|
406824
|
-
return { parse: () => ({}) };
|
|
406825
|
-
return noop18;
|
|
406826
|
-
}
|
|
406827
|
-
};
|
|
406828
|
-
stub5 = new Proxy(noop18, handler5);
|
|
406829
|
-
claude_for_chrome_mcp_default = stub5;
|
|
406830
|
-
SandboxManager6 = new Proxy({}, { get: () => noop18 });
|
|
406831
|
-
SandboxRuntimeConfigSchema5 = { parse: () => ({}) };
|
|
406832
|
-
BROWSER_TOOLS4 = [];
|
|
406833
|
-
getMcpConfigForManifest4 = noop18;
|
|
406834
|
-
getSyntaxTheme6 = noop18;
|
|
406835
|
-
plot4 = noop18;
|
|
406836
|
-
createClaudeForChromeMcpServer4 = noop18;
|
|
406837
|
-
ExportResultCode4 = { SUCCESS: 0, FAILED: 1 };
|
|
406838
|
-
resourceFromAttributes5 = noop18;
|
|
406839
|
-
Resource4 = noopClass4;
|
|
406840
|
-
SimpleSpanProcessor4 = noopClass4;
|
|
406841
|
-
BatchSpanProcessor5 = noopClass4;
|
|
406842
|
-
NodeTracerProvider4 = noopClass4;
|
|
406843
|
-
BasicTracerProvider5 = noopClass4;
|
|
406844
|
-
OTLPTraceExporter4 = noopClass4;
|
|
406845
|
-
OTLPLogExporter4 = noopClass4;
|
|
406846
|
-
OTLPMetricExporter4 = noopClass4;
|
|
406847
|
-
PrometheusExporter4 = noopClass4;
|
|
406848
|
-
LoggerProvider5 = noopClass4;
|
|
406849
|
-
SimpleLogRecordProcessor4 = noopClass4;
|
|
406850
|
-
BatchLogRecordProcessor5 = noopClass4;
|
|
406851
|
-
MeterProvider5 = noopClass4;
|
|
406852
|
-
PeriodicExportingMetricReader5 = noopClass4;
|
|
406853
|
-
trace5 = { getTracer: () => ({ startSpan: () => ({ end: noop18, setAttribute: noop18, setStatus: noop18, recordException: noop18 }) }) };
|
|
406854
|
-
context4 = { active: noop18, with: (_, fn) => fn() };
|
|
406855
|
-
SpanStatusCode4 = { OK: 0, ERROR: 1, UNSET: 2 };
|
|
406856
|
-
AggregationTemporality4 = { CUMULATIVE: 0, DELTA: 1 };
|
|
406857
|
-
DataPointType4 = { HISTOGRAM: 0, SUM: 1, GAUGE: 2 };
|
|
406858
|
-
InstrumentType4 = { COUNTER: 0, HISTOGRAM: 1, UP_DOWN_COUNTER: 2 };
|
|
406859
|
-
PushMetricExporter4 = noopClass4;
|
|
406860
|
-
SeverityNumber4 = {};
|
|
406861
|
-
});
|
|
406862
|
-
|
|
406863
406758
|
// src/services/mcp/InProcessTransport.ts
|
|
406864
406759
|
var exports_InProcessTransport = {};
|
|
406865
406760
|
__export(exports_InProcessTransport, {
|
|
@@ -407760,7 +407655,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
|
|
|
407760
407655
|
const client2 = new Client({
|
|
407761
407656
|
name: "claude-code",
|
|
407762
407657
|
title: "ZeroCLI",
|
|
407763
|
-
version: "0.
|
|
407658
|
+
version: "0.8.1",
|
|
407764
407659
|
description: "Anthropic's agentic coding tool",
|
|
407765
407660
|
websiteUrl: PRODUCT_URL
|
|
407766
407661
|
}, {
|
|
@@ -408072,15 +407967,13 @@ var init_client7 = __esm(() => {
|
|
|
408072
407967
|
transport = new StreamableHTTPClientTransport(new URL(proxyUrl), transportOptions);
|
|
408073
407968
|
logMCPDebug(name, `claude.ai proxy transport created successfully`);
|
|
408074
407969
|
} else if ((serverRef.type === "stdio" || !serverRef.type) && isClaudeInChromeMCPServer(name)) {
|
|
408075
|
-
const {
|
|
408076
|
-
const { createClaudeForChromeMcpServer: createClaudeForChromeMcpServer5 } = await Promise.resolve().then(() => (init_claude_for_chrome_mcp(), exports_claude_for_chrome_mcp));
|
|
407970
|
+
const { createZeroCLIChromeMcpServer: createZeroCLIChromeMcpServer2 } = await Promise.resolve().then(() => (init_zeroCLIMcpServer(), exports_zeroCLIMcpServer));
|
|
408077
407971
|
const { createLinkedTransportPair: createLinkedTransportPair2 } = await Promise.resolve().then(() => exports_InProcessTransport);
|
|
408078
|
-
|
|
408079
|
-
inProcessServer = createClaudeForChromeMcpServer5(context5);
|
|
407972
|
+
inProcessServer = createZeroCLIChromeMcpServer2();
|
|
408080
407973
|
const [clientTransport, serverTransport] = createLinkedTransportPair2();
|
|
408081
407974
|
await inProcessServer.connect(serverTransport);
|
|
408082
407975
|
transport = clientTransport;
|
|
408083
|
-
logMCPDebug(name, `In-process Chrome MCP server started`);
|
|
407976
|
+
logMCPDebug(name, `In-process ZeroCLI Chrome MCP server started`);
|
|
408084
407977
|
} else if (false) {} else if (serverRef.type === "stdio" || !serverRef.type) {
|
|
408085
407978
|
const finalCommand = process.env.CLAUDE_CODE_SHELL_PREFIX || serverRef.command;
|
|
408086
407979
|
const finalArgs = process.env.CLAUDE_CODE_SHELL_PREFIX ? [[serverRef.command, ...serverRef.args].join(" ")] : serverRef.args;
|
|
@@ -408114,7 +408007,7 @@ var init_client7 = __esm(() => {
|
|
|
408114
408007
|
const client2 = new Client({
|
|
408115
408008
|
name: "claude-code",
|
|
408116
408009
|
title: "ZeroCLI",
|
|
408117
|
-
version: "0.
|
|
408010
|
+
version: "0.8.1",
|
|
408118
408011
|
description: "Anthropic's agentic coding tool",
|
|
408119
408012
|
websiteUrl: PRODUCT_URL
|
|
408120
408013
|
}, {
|
|
@@ -408592,7 +408485,7 @@ var init_client7 = __esm(() => {
|
|
|
408592
408485
|
]
|
|
408593
408486
|
};
|
|
408594
408487
|
},
|
|
408595
|
-
async call(args,
|
|
408488
|
+
async call(args, context4, _canUseTool, parentMessage, onProgress) {
|
|
408596
408489
|
const toolUseId = extractToolUseId(parentMessage);
|
|
408597
408490
|
const meta = toolUseId ? { "claudecode/toolUseId": toolUseId } : {};
|
|
408598
408491
|
if (onProgress && toolUseId) {
|
|
@@ -408617,15 +408510,15 @@ var init_client7 = __esm(() => {
|
|
|
408617
408510
|
tool: tool.name,
|
|
408618
408511
|
args,
|
|
408619
408512
|
meta,
|
|
408620
|
-
signal:
|
|
408621
|
-
setAppState:
|
|
408513
|
+
signal: context4.abortController.signal,
|
|
408514
|
+
setAppState: context4.setAppState,
|
|
408622
408515
|
onProgress: onProgress && toolUseId ? (progressData) => {
|
|
408623
408516
|
onProgress({
|
|
408624
408517
|
toolUseID: toolUseId,
|
|
408625
408518
|
data: progressData
|
|
408626
408519
|
});
|
|
408627
408520
|
} : undefined,
|
|
408628
|
-
handleElicitation:
|
|
408521
|
+
handleElicitation: context4.handleElicitation
|
|
408629
408522
|
});
|
|
408630
408523
|
if (onProgress && toolUseId) {
|
|
408631
408524
|
onProgress({
|
|
@@ -408994,23 +408887,23 @@ function splitSysPromptPrefix(systemPrompt, options2) {
|
|
|
408994
408887
|
result.push({ text: restJoined, cacheScope: "org" });
|
|
408995
408888
|
return result;
|
|
408996
408889
|
}
|
|
408997
|
-
function appendSystemContext(systemPrompt,
|
|
408890
|
+
function appendSystemContext(systemPrompt, context4) {
|
|
408998
408891
|
return [
|
|
408999
408892
|
...systemPrompt,
|
|
409000
|
-
Object.entries(
|
|
408893
|
+
Object.entries(context4).map(([key, value]) => `${key}: ${value}`).join(`
|
|
409001
408894
|
`)
|
|
409002
408895
|
].filter(Boolean);
|
|
409003
408896
|
}
|
|
409004
|
-
function prependUserContext(messages,
|
|
408897
|
+
function prependUserContext(messages, context4) {
|
|
409005
408898
|
if (false) {}
|
|
409006
|
-
if (Object.entries(
|
|
408899
|
+
if (Object.entries(context4).length === 0) {
|
|
409007
408900
|
return messages;
|
|
409008
408901
|
}
|
|
409009
408902
|
return [
|
|
409010
408903
|
createUserMessage({
|
|
409011
408904
|
content: `<system-reminder>
|
|
409012
408905
|
As you answer the user's questions, you can use the following context:
|
|
409013
|
-
${Object.entries(
|
|
408906
|
+
${Object.entries(context4).map(([key, value]) => `# ${key}
|
|
409014
408907
|
${value}`).join(`
|
|
409015
408908
|
`)}
|
|
409016
408909
|
|
|
@@ -409591,9 +409484,9 @@ async function* executeNonStreamingRequest(clientOptions, retryOptions, paramsFr
|
|
|
409591
409484
|
fetchOverride: clientOptions.fetchOverride,
|
|
409592
409485
|
source: clientOptions.source,
|
|
409593
409486
|
providerOverride: clientOptions.providerOverride
|
|
409594
|
-
}), async (anthropic, attempt,
|
|
409487
|
+
}), async (anthropic, attempt, context4) => {
|
|
409595
409488
|
const start = Date.now();
|
|
409596
|
-
const retryParams = paramsFromContext(
|
|
409489
|
+
const retryParams = paramsFromContext(context4);
|
|
409597
409490
|
captureRequest(retryParams);
|
|
409598
409491
|
onAttempt(attempt, start, retryParams.max_tokens);
|
|
409599
409492
|
const adjustedParams = adjustParamsForNonStreaming(retryParams, MAX_NON_STREAMING_TOKENS);
|
|
@@ -410116,13 +410009,13 @@ ${deferredToolList}
|
|
|
410116
410009
|
fetchOverride: options2.fetchOverride,
|
|
410117
410010
|
source: options2.querySource,
|
|
410118
410011
|
providerOverride: options2.providerOverride
|
|
410119
|
-
}), async (anthropic, attempt,
|
|
410012
|
+
}), async (anthropic, attempt, context4) => {
|
|
410120
410013
|
attemptNumber = attempt;
|
|
410121
|
-
isFastModeRequest =
|
|
410014
|
+
isFastModeRequest = context4.fastMode ?? false;
|
|
410122
410015
|
start = Date.now();
|
|
410123
410016
|
attemptStartTimes.push(start);
|
|
410124
410017
|
queryCheckpoint("query_client_creation_end");
|
|
410125
|
-
const params = paramsFromContext(
|
|
410018
|
+
const params = paramsFromContext(context4);
|
|
410126
410019
|
captureAPIRequest(params, options2.querySource);
|
|
410127
410020
|
maxOutputTokens = params.max_tokens;
|
|
410128
410021
|
queryCheckpoint("query_api_request_sent");
|
|
@@ -412035,9 +411928,9 @@ var exports_constants = {};
|
|
|
412035
411928
|
__export(exports_constants, {
|
|
412036
411929
|
default: () => constants_default
|
|
412037
411930
|
});
|
|
412038
|
-
var
|
|
411931
|
+
var noop18 = () => null, constants_default;
|
|
412039
411932
|
var init_constants6 = __esm(() => {
|
|
412040
|
-
constants_default =
|
|
411933
|
+
constants_default = noop18;
|
|
412041
411934
|
});
|
|
412042
411935
|
|
|
412043
411936
|
// src/utils/permissions/classifierDecision.ts
|
|
@@ -412091,8 +411984,8 @@ var init_classifierDecision = __esm(() => {
|
|
|
412091
411984
|
function permissionRuleSourceDisplayString(source) {
|
|
412092
411985
|
return getSettingSourceDisplayNameLowercase(source);
|
|
412093
411986
|
}
|
|
412094
|
-
function getAllowRules(
|
|
412095
|
-
return PERMISSION_RULE_SOURCES.flatMap((source) => (
|
|
411987
|
+
function getAllowRules(context4) {
|
|
411988
|
+
return PERMISSION_RULE_SOURCES.flatMap((source) => (context4.alwaysAllowRules[source] || []).map((ruleString) => ({
|
|
412096
411989
|
source,
|
|
412097
411990
|
ruleBehavior: "allow",
|
|
412098
411991
|
ruleValue: permissionRuleValueFromString(ruleString)
|
|
@@ -412152,15 +412045,15 @@ function createPermissionRequestMessage2(toolName, decisionReason) {
|
|
|
412152
412045
|
const message = `Claude requested permissions to use ${toolName}, but you haven't granted it yet.`;
|
|
412153
412046
|
return message;
|
|
412154
412047
|
}
|
|
412155
|
-
function getDenyRules(
|
|
412156
|
-
return PERMISSION_RULE_SOURCES.flatMap((source) => (
|
|
412048
|
+
function getDenyRules(context4) {
|
|
412049
|
+
return PERMISSION_RULE_SOURCES.flatMap((source) => (context4.alwaysDenyRules[source] || []).map((ruleString) => ({
|
|
412157
412050
|
source,
|
|
412158
412051
|
ruleBehavior: "deny",
|
|
412159
412052
|
ruleValue: permissionRuleValueFromString(ruleString)
|
|
412160
412053
|
})));
|
|
412161
412054
|
}
|
|
412162
|
-
function getAskRules(
|
|
412163
|
-
return PERMISSION_RULE_SOURCES.flatMap((source) => (
|
|
412055
|
+
function getAskRules(context4) {
|
|
412056
|
+
return PERMISSION_RULE_SOURCES.flatMap((source) => (context4.alwaysAskRules[source] || []).map((ruleString) => ({
|
|
412164
412057
|
source,
|
|
412165
412058
|
ruleBehavior: "ask",
|
|
412166
412059
|
ruleValue: permissionRuleValueFromString(ruleString)
|
|
@@ -412178,42 +412071,42 @@ function toolMatchesRule(tool, rule) {
|
|
|
412178
412071
|
const toolInfo = mcpInfoFromString(nameForRuleMatch);
|
|
412179
412072
|
return ruleInfo !== null && toolInfo !== null && (ruleInfo.toolName === undefined || ruleInfo.toolName === "*") && ruleInfo.serverName === toolInfo.serverName;
|
|
412180
412073
|
}
|
|
412181
|
-
function toolAlwaysAllowedRule(
|
|
412182
|
-
return getAllowRules(
|
|
412074
|
+
function toolAlwaysAllowedRule(context4, tool) {
|
|
412075
|
+
return getAllowRules(context4).find((rule) => toolMatchesRule(tool, rule)) || null;
|
|
412183
412076
|
}
|
|
412184
|
-
function getDenyRuleForTool(
|
|
412185
|
-
return getDenyRules(
|
|
412077
|
+
function getDenyRuleForTool(context4, tool) {
|
|
412078
|
+
return getDenyRules(context4).find((rule) => toolMatchesRule(tool, rule)) || null;
|
|
412186
412079
|
}
|
|
412187
|
-
function getAskRuleForTool(
|
|
412188
|
-
return getAskRules(
|
|
412080
|
+
function getAskRuleForTool(context4, tool) {
|
|
412081
|
+
return getAskRules(context4).find((rule) => toolMatchesRule(tool, rule)) || null;
|
|
412189
412082
|
}
|
|
412190
|
-
function getDenyRuleForAgent(
|
|
412191
|
-
return getDenyRules(
|
|
412083
|
+
function getDenyRuleForAgent(context4, agentToolName, agentType) {
|
|
412084
|
+
return getDenyRules(context4).find((rule) => rule.ruleValue.toolName === agentToolName && rule.ruleValue.ruleContent === agentType) || null;
|
|
412192
412085
|
}
|
|
412193
|
-
function filterDeniedAgents(agents,
|
|
412086
|
+
function filterDeniedAgents(agents, context4, agentToolName) {
|
|
412194
412087
|
const deniedAgentTypes = new Set;
|
|
412195
|
-
for (const rule of getDenyRules(
|
|
412088
|
+
for (const rule of getDenyRules(context4)) {
|
|
412196
412089
|
if (rule.ruleValue.toolName === agentToolName && rule.ruleValue.ruleContent !== undefined) {
|
|
412197
412090
|
deniedAgentTypes.add(rule.ruleValue.ruleContent);
|
|
412198
412091
|
}
|
|
412199
412092
|
}
|
|
412200
412093
|
return agents.filter((agent2) => !deniedAgentTypes.has(agent2.agentType));
|
|
412201
412094
|
}
|
|
412202
|
-
function getRuleByContentsForTool(
|
|
412203
|
-
return getRuleByContentsForToolName(
|
|
412095
|
+
function getRuleByContentsForTool(context4, tool, behavior) {
|
|
412096
|
+
return getRuleByContentsForToolName(context4, getToolNameForPermissionCheck(tool), behavior);
|
|
412204
412097
|
}
|
|
412205
|
-
function getRuleByContentsForToolName(
|
|
412098
|
+
function getRuleByContentsForToolName(context4, toolName, behavior) {
|
|
412206
412099
|
const ruleByContents = new Map;
|
|
412207
412100
|
let rules = [];
|
|
412208
412101
|
switch (behavior) {
|
|
412209
412102
|
case "allow":
|
|
412210
|
-
rules = getAllowRules(
|
|
412103
|
+
rules = getAllowRules(context4);
|
|
412211
412104
|
break;
|
|
412212
412105
|
case "deny":
|
|
412213
|
-
rules = getDenyRules(
|
|
412106
|
+
rules = getDenyRules(context4);
|
|
412214
412107
|
break;
|
|
412215
412108
|
case "ask":
|
|
412216
|
-
rules = getAskRules(
|
|
412109
|
+
rules = getAskRules(context4);
|
|
412217
412110
|
break;
|
|
412218
412111
|
}
|
|
412219
412112
|
for (const rule of rules) {
|
|
@@ -412223,9 +412116,9 @@ function getRuleByContentsForToolName(context5, toolName, behavior) {
|
|
|
412223
412116
|
}
|
|
412224
412117
|
return ruleByContents;
|
|
412225
412118
|
}
|
|
412226
|
-
async function runPermissionRequestHooksForHeadlessAgent(tool, input, toolUseID,
|
|
412119
|
+
async function runPermissionRequestHooksForHeadlessAgent(tool, input, toolUseID, context4, permissionMode, suggestions) {
|
|
412227
412120
|
try {
|
|
412228
|
-
for await (const hookResult of executePermissionRequestHooks(tool.name, toolUseID, input,
|
|
412121
|
+
for await (const hookResult of executePermissionRequestHooks(tool.name, toolUseID, input, context4, permissionMode, suggestions, context4.abortController.signal)) {
|
|
412229
412122
|
if (!hookResult.permissionRequestResult) {
|
|
412230
412123
|
continue;
|
|
412231
412124
|
}
|
|
@@ -412234,7 +412127,7 @@ async function runPermissionRequestHooksForHeadlessAgent(tool, input, toolUseID,
|
|
|
412234
412127
|
const finalInput = decision.updatedInput ?? input;
|
|
412235
412128
|
if (decision.updatedPermissions?.length) {
|
|
412236
412129
|
persistPermissionUpdates(decision.updatedPermissions);
|
|
412237
|
-
|
|
412130
|
+
context4.setAppState((prev) => ({
|
|
412238
412131
|
...prev,
|
|
412239
412132
|
toolPermissionContext: applyPermissionUpdates(prev.toolPermissionContext, decision.updatedPermissions)
|
|
412240
412133
|
}));
|
|
@@ -412251,7 +412144,7 @@ async function runPermissionRequestHooksForHeadlessAgent(tool, input, toolUseID,
|
|
|
412251
412144
|
if (decision.behavior === "deny") {
|
|
412252
412145
|
if (decision.interrupt) {
|
|
412253
412146
|
logForDebugging(`Hook interrupt: tool=${tool.name} hookMessage=${decision.message}`);
|
|
412254
|
-
|
|
412147
|
+
context4.abortController.abort();
|
|
412255
412148
|
}
|
|
412256
412149
|
return {
|
|
412257
412150
|
behavior: "deny",
|
|
@@ -412271,18 +412164,18 @@ async function runPermissionRequestHooksForHeadlessAgent(tool, input, toolUseID,
|
|
|
412271
412164
|
}
|
|
412272
412165
|
return null;
|
|
412273
412166
|
}
|
|
412274
|
-
function persistDenialState(
|
|
412275
|
-
if (
|
|
412276
|
-
Object.assign(
|
|
412167
|
+
function persistDenialState(context4, newState) {
|
|
412168
|
+
if (context4.localDenialTracking) {
|
|
412169
|
+
Object.assign(context4.localDenialTracking, newState);
|
|
412277
412170
|
} else {
|
|
412278
|
-
|
|
412171
|
+
context4.setAppState((prev) => {
|
|
412279
412172
|
if (prev.denialTracking === newState)
|
|
412280
412173
|
return prev;
|
|
412281
412174
|
return { ...prev, denialTracking: newState };
|
|
412282
412175
|
});
|
|
412283
412176
|
}
|
|
412284
412177
|
}
|
|
412285
|
-
function handleDenialLimitExceeded(denialState, appState, classifierReason, assistantMessage, tool, result,
|
|
412178
|
+
function handleDenialLimitExceeded(denialState, appState, classifierReason, assistantMessage, tool, result, context4) {
|
|
412286
412179
|
if (!shouldFallbackToPrompting(denialState)) {
|
|
412287
412180
|
return null;
|
|
412288
412181
|
}
|
|
@@ -412304,7 +412197,7 @@ function handleDenialLimitExceeded(denialState, appState, classifierReason, assi
|
|
|
412304
412197
|
}
|
|
412305
412198
|
logForDebugging(`Classifier denial limit exceeded, falling back to prompting: ${warning}`, { level: "warn" });
|
|
412306
412199
|
if (hitTotalLimit) {
|
|
412307
|
-
persistDenialState(
|
|
412200
|
+
persistDenialState(context4, {
|
|
412308
412201
|
...denialState,
|
|
412309
412202
|
totalDenials: 0,
|
|
412310
412203
|
consecutiveDenials: 0
|
|
@@ -412322,8 +412215,8 @@ Latest blocked action: ${classifierReason}`
|
|
|
412322
412215
|
}
|
|
412323
412216
|
};
|
|
412324
412217
|
}
|
|
412325
|
-
async function checkRuleBasedPermissions(tool, input,
|
|
412326
|
-
const appState =
|
|
412218
|
+
async function checkRuleBasedPermissions(tool, input, context4) {
|
|
412219
|
+
const appState = context4.getAppState();
|
|
412327
412220
|
const denyRule = getDenyRuleForTool(appState.toolPermissionContext, tool);
|
|
412328
412221
|
if (denyRule) {
|
|
412329
412222
|
return {
|
|
@@ -412355,7 +412248,7 @@ async function checkRuleBasedPermissions(tool, input, context5) {
|
|
|
412355
412248
|
};
|
|
412356
412249
|
try {
|
|
412357
412250
|
const parsedInput = tool.inputSchema.parse(input);
|
|
412358
|
-
toolPermissionResult = await tool.checkPermissions(parsedInput,
|
|
412251
|
+
toolPermissionResult = await tool.checkPermissions(parsedInput, context4);
|
|
412359
412252
|
} catch (e2) {
|
|
412360
412253
|
if (e2 instanceof AbortError || e2 instanceof APIUserAbortError) {
|
|
412361
412254
|
throw e2;
|
|
@@ -412373,11 +412266,11 @@ async function checkRuleBasedPermissions(tool, input, context5) {
|
|
|
412373
412266
|
}
|
|
412374
412267
|
return null;
|
|
412375
412268
|
}
|
|
412376
|
-
async function hasPermissionsToUseToolInner(tool, input,
|
|
412377
|
-
if (
|
|
412269
|
+
async function hasPermissionsToUseToolInner(tool, input, context4) {
|
|
412270
|
+
if (context4.abortController.signal.aborted) {
|
|
412378
412271
|
throw new AbortError;
|
|
412379
412272
|
}
|
|
412380
|
-
let appState =
|
|
412273
|
+
let appState = context4.getAppState();
|
|
412381
412274
|
const denyRule = getDenyRuleForTool(appState.toolPermissionContext, tool);
|
|
412382
412275
|
if (denyRule) {
|
|
412383
412276
|
return {
|
|
@@ -412409,7 +412302,7 @@ async function hasPermissionsToUseToolInner(tool, input, context5) {
|
|
|
412409
412302
|
};
|
|
412410
412303
|
try {
|
|
412411
412304
|
const parsedInput = tool.inputSchema.parse(input);
|
|
412412
|
-
toolPermissionResult = await tool.checkPermissions(parsedInput,
|
|
412305
|
+
toolPermissionResult = await tool.checkPermissions(parsedInput, context4);
|
|
412413
412306
|
} catch (e2) {
|
|
412414
412307
|
if (e2 instanceof AbortError || e2 instanceof APIUserAbortError) {
|
|
412415
412308
|
throw e2;
|
|
@@ -412428,7 +412321,7 @@ async function hasPermissionsToUseToolInner(tool, input, context5) {
|
|
|
412428
412321
|
if (toolPermissionResult?.behavior === "ask" && toolPermissionResult.decisionReason?.type === "safetyCheck" && appState.toolPermissionContext.mode !== "autopilot") {
|
|
412429
412322
|
return toolPermissionResult;
|
|
412430
412323
|
}
|
|
412431
|
-
appState =
|
|
412324
|
+
appState = context4.getAppState();
|
|
412432
412325
|
const shouldBypassPermissions = appState.toolPermissionContext.mode === "bypassPermissions" || appState.toolPermissionContext.mode === "autopilot" || appState.toolPermissionContext.mode === "plan" && appState.toolPermissionContext.isBypassPermissionsModeAvailable;
|
|
412433
412326
|
if (shouldBypassPermissions) {
|
|
412434
412327
|
return {
|
|
@@ -412516,7 +412409,7 @@ function applyPermissionRulesToPermissionContext(toolPermissionContext, rules) {
|
|
|
412516
412409
|
return applyPermissionUpdates(toolPermissionContext, updates);
|
|
412517
412410
|
}
|
|
412518
412411
|
function syncPermissionRulesFromDisk(toolPermissionContext, rules) {
|
|
412519
|
-
let
|
|
412412
|
+
let context4 = toolPermissionContext;
|
|
412520
412413
|
if (shouldAllowManagedPermissionRulesOnly()) {
|
|
412521
412414
|
const sourcesToClear = [
|
|
412522
412415
|
"userSettings",
|
|
@@ -412528,7 +412421,7 @@ function syncPermissionRulesFromDisk(toolPermissionContext, rules) {
|
|
|
412528
412421
|
const behaviors = ["allow", "deny", "ask"];
|
|
412529
412422
|
for (const source of sourcesToClear) {
|
|
412530
412423
|
for (const behavior of behaviors) {
|
|
412531
|
-
|
|
412424
|
+
context4 = applyPermissionUpdate(context4, {
|
|
412532
412425
|
type: "replaceRules",
|
|
412533
412426
|
rules: [],
|
|
412534
412427
|
behavior,
|
|
@@ -412544,7 +412437,7 @@ function syncPermissionRulesFromDisk(toolPermissionContext, rules) {
|
|
|
412544
412437
|
];
|
|
412545
412438
|
for (const diskSource of diskSources) {
|
|
412546
412439
|
for (const behavior of ["allow", "deny", "ask"]) {
|
|
412547
|
-
|
|
412440
|
+
context4 = applyPermissionUpdate(context4, {
|
|
412548
412441
|
type: "replaceRules",
|
|
412549
412442
|
rules: [],
|
|
412550
412443
|
behavior,
|
|
@@ -412553,26 +412446,26 @@ function syncPermissionRulesFromDisk(toolPermissionContext, rules) {
|
|
|
412553
412446
|
}
|
|
412554
412447
|
}
|
|
412555
412448
|
const updates = convertRulesToUpdates(rules, "replaceRules");
|
|
412556
|
-
return applyPermissionUpdates(
|
|
412449
|
+
return applyPermissionUpdates(context4, updates);
|
|
412557
412450
|
}
|
|
412558
412451
|
function getUpdatedInputOrFallback(permissionResult, fallback) {
|
|
412559
412452
|
return ("updatedInput" in permissionResult ? permissionResult.updatedInput : undefined) ?? fallback;
|
|
412560
412453
|
}
|
|
412561
|
-
var classifierDecisionModule, autoModeStateModule4, CLASSIFIER_FAIL_CLOSED_REFRESH_MS, PERMISSION_RULE_SOURCES, hasPermissionsToUseTool = async (tool, input,
|
|
412562
|
-
const result = await hasPermissionsToUseToolInner(tool, input,
|
|
412454
|
+
var classifierDecisionModule, autoModeStateModule4, CLASSIFIER_FAIL_CLOSED_REFRESH_MS, PERMISSION_RULE_SOURCES, hasPermissionsToUseTool = async (tool, input, context4, assistantMessage, toolUseID) => {
|
|
412455
|
+
const result = await hasPermissionsToUseToolInner(tool, input, context4);
|
|
412563
412456
|
if (result.behavior === "allow") {
|
|
412564
|
-
const appState =
|
|
412457
|
+
const appState = context4.getAppState();
|
|
412565
412458
|
if (true) {
|
|
412566
|
-
const currentDenialState =
|
|
412459
|
+
const currentDenialState = context4.localDenialTracking ?? appState.denialTracking;
|
|
412567
412460
|
if (appState.toolPermissionContext.mode === "auto" && currentDenialState && currentDenialState.consecutiveDenials > 0) {
|
|
412568
412461
|
const newDenialState = recordSuccess(currentDenialState);
|
|
412569
|
-
persistDenialState(
|
|
412462
|
+
persistDenialState(context4, newDenialState);
|
|
412570
412463
|
}
|
|
412571
412464
|
}
|
|
412572
412465
|
return result;
|
|
412573
412466
|
}
|
|
412574
412467
|
if (result.behavior === "ask") {
|
|
412575
|
-
const appState =
|
|
412468
|
+
const appState = context4.getAppState();
|
|
412576
412469
|
if (appState.toolPermissionContext.mode === "dontAsk") {
|
|
412577
412470
|
return {
|
|
412578
412471
|
behavior: "deny",
|
|
@@ -412600,7 +412493,7 @@ var classifierDecisionModule, autoModeStateModule4, CLASSIFIER_FAIL_CLOSED_REFRE
|
|
|
412600
412493
|
if (tool.requiresUserInteraction?.() && result.behavior === "ask") {
|
|
412601
412494
|
return result;
|
|
412602
412495
|
}
|
|
412603
|
-
const denialState =
|
|
412496
|
+
const denialState = context4.localDenialTracking ?? appState.denialTracking ?? createDenialTrackingState();
|
|
412604
412497
|
if (tool.name === POWERSHELL_TOOL_NAME && true) {
|
|
412605
412498
|
if (appState.toolPermissionContext.shouldAvoidPermissionPrompts) {
|
|
412606
412499
|
return {
|
|
@@ -412619,9 +412512,9 @@ var classifierDecisionModule, autoModeStateModule4, CLASSIFIER_FAIL_CLOSED_REFRE
|
|
|
412619
412512
|
try {
|
|
412620
412513
|
const parsedInput = tool.inputSchema.parse(input);
|
|
412621
412514
|
const acceptEditsResult = await tool.checkPermissions(parsedInput, {
|
|
412622
|
-
...
|
|
412515
|
+
...context4,
|
|
412623
412516
|
getAppState: () => {
|
|
412624
|
-
const state =
|
|
412517
|
+
const state = context4.getAppState();
|
|
412625
412518
|
return {
|
|
412626
412519
|
...state,
|
|
412627
412520
|
toolPermissionContext: {
|
|
@@ -412633,7 +412526,7 @@ var classifierDecisionModule, autoModeStateModule4, CLASSIFIER_FAIL_CLOSED_REFRE
|
|
|
412633
412526
|
});
|
|
412634
412527
|
if (acceptEditsResult.behavior === "allow") {
|
|
412635
412528
|
const newDenialState2 = recordSuccess(denialState);
|
|
412636
|
-
persistDenialState(
|
|
412529
|
+
persistDenialState(context4, newDenialState2);
|
|
412637
412530
|
logForDebugging(`Skipping auto mode classifier for ${tool.name}: would be allowed in acceptEdits mode`);
|
|
412638
412531
|
logEvent("tengu_auto_mode_decision", {
|
|
412639
412532
|
decision: "allowed",
|
|
@@ -412660,7 +412553,7 @@ var classifierDecisionModule, autoModeStateModule4, CLASSIFIER_FAIL_CLOSED_REFRE
|
|
|
412660
412553
|
}
|
|
412661
412554
|
if (classifierDecisionModule.isAutoModeAllowlistedTool(tool.name)) {
|
|
412662
412555
|
const newDenialState2 = recordSuccess(denialState);
|
|
412663
|
-
persistDenialState(
|
|
412556
|
+
persistDenialState(context4, newDenialState2);
|
|
412664
412557
|
logForDebugging(`Skipping auto mode classifier for ${tool.name}: tool is on the safe allowlist`);
|
|
412665
412558
|
logEvent("tengu_auto_mode_decision", {
|
|
412666
412559
|
decision: "allowed",
|
|
@@ -412683,12 +412576,12 @@ var classifierDecisionModule, autoModeStateModule4, CLASSIFIER_FAIL_CLOSED_REFRE
|
|
|
412683
412576
|
setClassifierChecking(toolUseID);
|
|
412684
412577
|
let classifierResult;
|
|
412685
412578
|
try {
|
|
412686
|
-
classifierResult = await classifyYoloAction(
|
|
412579
|
+
classifierResult = await classifyYoloAction(context4.messages, action2, context4.options.tools, appState.toolPermissionContext, context4.abortController.signal);
|
|
412687
412580
|
} finally {
|
|
412688
412581
|
clearClassifierChecking(toolUseID);
|
|
412689
412582
|
}
|
|
412690
|
-
if (process.env.USER_TYPE === "ant" && classifierResult.errorDumpPath &&
|
|
412691
|
-
|
|
412583
|
+
if (process.env.USER_TYPE === "ant" && classifierResult.errorDumpPath && context4.addNotification) {
|
|
412584
|
+
context4.addNotification({
|
|
412692
412585
|
key: "auto-mode-error-dump",
|
|
412693
412586
|
text: `Auto mode classifier error — prompts dumped to ${classifierResult.errorDumpPath} (included in /share)`,
|
|
412694
412587
|
priority: "immediate",
|
|
@@ -412770,9 +412663,9 @@ var classifierDecisionModule, autoModeStateModule4, CLASSIFIER_FAIL_CLOSED_REFRE
|
|
|
412770
412663
|
return result;
|
|
412771
412664
|
}
|
|
412772
412665
|
const newDenialState2 = recordDenial(denialState);
|
|
412773
|
-
persistDenialState(
|
|
412666
|
+
persistDenialState(context4, newDenialState2);
|
|
412774
412667
|
logForDebugging(`Auto mode classifier blocked action: ${classifierResult.reason}`, { level: "warn" });
|
|
412775
|
-
const denialLimitResult = handleDenialLimitExceeded(newDenialState2, appState, classifierResult.reason, assistantMessage, tool, result,
|
|
412668
|
+
const denialLimitResult = handleDenialLimitExceeded(newDenialState2, appState, classifierResult.reason, assistantMessage, tool, result, context4);
|
|
412776
412669
|
if (denialLimitResult) {
|
|
412777
412670
|
return denialLimitResult;
|
|
412778
412671
|
}
|
|
@@ -412787,7 +412680,7 @@ var classifierDecisionModule, autoModeStateModule4, CLASSIFIER_FAIL_CLOSED_REFRE
|
|
|
412787
412680
|
};
|
|
412788
412681
|
}
|
|
412789
412682
|
const newDenialState = recordSuccess(denialState);
|
|
412790
|
-
persistDenialState(
|
|
412683
|
+
persistDenialState(context4, newDenialState);
|
|
412791
412684
|
return {
|
|
412792
412685
|
behavior: "allow",
|
|
412793
412686
|
updatedInput: input,
|
|
@@ -412799,7 +412692,7 @@ var classifierDecisionModule, autoModeStateModule4, CLASSIFIER_FAIL_CLOSED_REFRE
|
|
|
412799
412692
|
};
|
|
412800
412693
|
}
|
|
412801
412694
|
if (appState.toolPermissionContext.shouldAvoidPermissionPrompts) {
|
|
412802
|
-
const hookDecision = await runPermissionRequestHooksForHeadlessAgent(tool, input, toolUseID,
|
|
412695
|
+
const hookDecision = await runPermissionRequestHooksForHeadlessAgent(tool, input, toolUseID, context4, appState.toolPermissionContext.mode, result.suggestions);
|
|
412803
412696
|
if (hookDecision) {
|
|
412804
412697
|
return hookDecision;
|
|
412805
412698
|
}
|
|
@@ -413100,7 +412993,7 @@ function isPermissionUpdateDestination(source) {
|
|
|
413100
412993
|
"cliArg"
|
|
413101
412994
|
].includes(source);
|
|
413102
412995
|
}
|
|
413103
|
-
function removeDangerousPermissions(
|
|
412996
|
+
function removeDangerousPermissions(context4, dangerousPermissions) {
|
|
413104
412997
|
const rulesBySource = new Map;
|
|
413105
412998
|
for (const perm of dangerousPermissions) {
|
|
413106
412999
|
if (!isPermissionUpdateDestination(perm.source)) {
|
|
@@ -413111,7 +413004,7 @@ function removeDangerousPermissions(context5, dangerousPermissions) {
|
|
|
413111
413004
|
existing.push(perm.ruleValue);
|
|
413112
413005
|
rulesBySource.set(destination, existing);
|
|
413113
413006
|
}
|
|
413114
|
-
let updatedContext =
|
|
413007
|
+
let updatedContext = context4;
|
|
413115
413008
|
for (const [destination, rules] of rulesBySource) {
|
|
413116
413009
|
updatedContext = applyPermissionUpdate(updatedContext, {
|
|
413117
413010
|
type: "removeRules",
|
|
@@ -413122,9 +413015,9 @@ function removeDangerousPermissions(context5, dangerousPermissions) {
|
|
|
413122
413015
|
}
|
|
413123
413016
|
return updatedContext;
|
|
413124
413017
|
}
|
|
413125
|
-
function stripDangerousPermissionsForAutoMode(
|
|
413018
|
+
function stripDangerousPermissionsForAutoMode(context4) {
|
|
413126
413019
|
const rules = [];
|
|
413127
|
-
for (const [source, ruleStrings] of Object.entries(
|
|
413020
|
+
for (const [source, ruleStrings] of Object.entries(context4.alwaysAllowRules)) {
|
|
413128
413021
|
if (!ruleStrings) {
|
|
413129
413022
|
continue;
|
|
413130
413023
|
}
|
|
@@ -413140,8 +413033,8 @@ function stripDangerousPermissionsForAutoMode(context5) {
|
|
|
413140
413033
|
const dangerousPermissions = findDangerousClassifierPermissions(rules, []);
|
|
413141
413034
|
if (dangerousPermissions.length === 0) {
|
|
413142
413035
|
return {
|
|
413143
|
-
...
|
|
413144
|
-
strippedDangerousRules:
|
|
413036
|
+
...context4,
|
|
413037
|
+
strippedDangerousRules: context4.strippedDangerousRules ?? {}
|
|
413145
413038
|
};
|
|
413146
413039
|
}
|
|
413147
413040
|
for (const permission of dangerousPermissions) {
|
|
@@ -413154,16 +413047,16 @@ function stripDangerousPermissionsForAutoMode(context5) {
|
|
|
413154
413047
|
(stripped[perm.source] ??= []).push(permissionRuleValueToString(perm.ruleValue));
|
|
413155
413048
|
}
|
|
413156
413049
|
return {
|
|
413157
|
-
...removeDangerousPermissions(
|
|
413050
|
+
...removeDangerousPermissions(context4, dangerousPermissions),
|
|
413158
413051
|
strippedDangerousRules: stripped
|
|
413159
413052
|
};
|
|
413160
413053
|
}
|
|
413161
|
-
function restoreDangerousPermissions(
|
|
413162
|
-
const stash =
|
|
413054
|
+
function restoreDangerousPermissions(context4) {
|
|
413055
|
+
const stash = context4.strippedDangerousRules;
|
|
413163
413056
|
if (!stash) {
|
|
413164
|
-
return
|
|
413057
|
+
return context4;
|
|
413165
413058
|
}
|
|
413166
|
-
let result =
|
|
413059
|
+
let result = context4;
|
|
413167
413060
|
for (const [source, ruleStrings] of Object.entries(stash)) {
|
|
413168
413061
|
if (!ruleStrings || ruleStrings.length === 0)
|
|
413169
413062
|
continue;
|
|
@@ -413176,9 +413069,9 @@ function restoreDangerousPermissions(context5) {
|
|
|
413176
413069
|
}
|
|
413177
413070
|
return { ...result, strippedDangerousRules: undefined };
|
|
413178
413071
|
}
|
|
413179
|
-
function transitionPermissionMode(fromMode, toMode,
|
|
413072
|
+
function transitionPermissionMode(fromMode, toMode, context4) {
|
|
413180
413073
|
if (fromMode === toMode)
|
|
413181
|
-
return
|
|
413074
|
+
return context4;
|
|
413182
413075
|
handlePlanModeTransition(fromMode, toMode);
|
|
413183
413076
|
handleAutoModeTransition(fromMode, toMode);
|
|
413184
413077
|
if (fromMode === "plan" && toMode !== "plan") {
|
|
@@ -413186,7 +413079,7 @@ function transitionPermissionMode(fromMode, toMode, context5) {
|
|
|
413186
413079
|
}
|
|
413187
413080
|
if (true) {
|
|
413188
413081
|
if (toMode === "plan" && fromMode !== "plan") {
|
|
413189
|
-
return prepareContextForPlanMode(
|
|
413082
|
+
return prepareContextForPlanMode(context4);
|
|
413190
413083
|
}
|
|
413191
413084
|
const fromUsesClassifier = fromMode === "auto" || fromMode === "plan" && (autoModeStateModule5?.isAutoModeActive() ?? false);
|
|
413192
413085
|
const toUsesClassifier = toMode === "auto";
|
|
@@ -413195,17 +413088,17 @@ function transitionPermissionMode(fromMode, toMode, context5) {
|
|
|
413195
413088
|
throw new Error("Cannot transition to auto mode: gate is not enabled");
|
|
413196
413089
|
}
|
|
413197
413090
|
autoModeStateModule5?.setAutoModeActive(true);
|
|
413198
|
-
|
|
413091
|
+
context4 = stripDangerousPermissionsForAutoMode(context4);
|
|
413199
413092
|
} else if (fromUsesClassifier && !toUsesClassifier) {
|
|
413200
413093
|
autoModeStateModule5?.setAutoModeActive(false);
|
|
413201
413094
|
setNeedsAutoModeExitAttachment(true);
|
|
413202
|
-
|
|
413095
|
+
context4 = restoreDangerousPermissions(context4);
|
|
413203
413096
|
}
|
|
413204
413097
|
}
|
|
413205
|
-
if (fromMode === "plan" && toMode !== "plan" &&
|
|
413206
|
-
return { ...
|
|
413098
|
+
if (fromMode === "plan" && toMode !== "plan" && context4.prePlanMode) {
|
|
413099
|
+
return { ...context4, prePlanMode: undefined };
|
|
413207
413100
|
}
|
|
413208
|
-
return
|
|
413101
|
+
return context4;
|
|
413209
413102
|
}
|
|
413210
413103
|
function parseBaseToolsFromCLI(baseTools) {
|
|
413211
413104
|
const joinedInput = baseTools.join(" ").trim();
|
|
@@ -413604,57 +413497,57 @@ function shouldPlanUseAutoMode() {
|
|
|
413604
413497
|
}
|
|
413605
413498
|
return false;
|
|
413606
413499
|
}
|
|
413607
|
-
function prepareContextForPlanMode(
|
|
413608
|
-
const currentMode =
|
|
413500
|
+
function prepareContextForPlanMode(context4) {
|
|
413501
|
+
const currentMode = context4.mode;
|
|
413609
413502
|
if (currentMode === "plan")
|
|
413610
|
-
return
|
|
413503
|
+
return context4;
|
|
413611
413504
|
if (true) {
|
|
413612
413505
|
const planAutoMode = shouldPlanUseAutoMode();
|
|
413613
413506
|
if (currentMode === "auto") {
|
|
413614
413507
|
if (planAutoMode) {
|
|
413615
|
-
return { ...
|
|
413508
|
+
return { ...context4, prePlanMode: "auto" };
|
|
413616
413509
|
}
|
|
413617
413510
|
autoModeStateModule5?.setAutoModeActive(false);
|
|
413618
413511
|
setNeedsAutoModeExitAttachment(true);
|
|
413619
413512
|
return {
|
|
413620
|
-
...restoreDangerousPermissions(
|
|
413513
|
+
...restoreDangerousPermissions(context4),
|
|
413621
413514
|
prePlanMode: "auto"
|
|
413622
413515
|
};
|
|
413623
413516
|
}
|
|
413624
413517
|
if (planAutoMode && currentMode !== "bypassPermissions") {
|
|
413625
413518
|
autoModeStateModule5?.setAutoModeActive(true);
|
|
413626
413519
|
return {
|
|
413627
|
-
...stripDangerousPermissionsForAutoMode(
|
|
413520
|
+
...stripDangerousPermissionsForAutoMode(context4),
|
|
413628
413521
|
prePlanMode: currentMode
|
|
413629
413522
|
};
|
|
413630
413523
|
}
|
|
413631
413524
|
}
|
|
413632
413525
|
logForDebugging(`[prepareContextForPlanMode] plain plan entry, prePlanMode=${currentMode}`, { level: "info" });
|
|
413633
|
-
return { ...
|
|
413526
|
+
return { ...context4, prePlanMode: currentMode };
|
|
413634
413527
|
}
|
|
413635
|
-
function transitionPlanAutoMode(
|
|
413528
|
+
function transitionPlanAutoMode(context4) {
|
|
413636
413529
|
if (false)
|
|
413637
413530
|
;
|
|
413638
|
-
if (
|
|
413639
|
-
return
|
|
413640
|
-
if (
|
|
413641
|
-
return
|
|
413531
|
+
if (context4.mode !== "plan")
|
|
413532
|
+
return context4;
|
|
413533
|
+
if (context4.prePlanMode === "bypassPermissions") {
|
|
413534
|
+
return context4;
|
|
413642
413535
|
}
|
|
413643
413536
|
const want = shouldPlanUseAutoMode();
|
|
413644
413537
|
const have = autoModeStateModule5?.isAutoModeActive() ?? false;
|
|
413645
413538
|
if (want && have) {
|
|
413646
|
-
return stripDangerousPermissionsForAutoMode(
|
|
413539
|
+
return stripDangerousPermissionsForAutoMode(context4);
|
|
413647
413540
|
}
|
|
413648
413541
|
if (!want && !have)
|
|
413649
|
-
return
|
|
413542
|
+
return context4;
|
|
413650
413543
|
if (want) {
|
|
413651
413544
|
autoModeStateModule5?.setAutoModeActive(true);
|
|
413652
413545
|
setNeedsAutoModeExitAttachment(false);
|
|
413653
|
-
return stripDangerousPermissionsForAutoMode(
|
|
413546
|
+
return stripDangerousPermissionsForAutoMode(context4);
|
|
413654
413547
|
}
|
|
413655
413548
|
autoModeStateModule5?.setAutoModeActive(false);
|
|
413656
413549
|
setNeedsAutoModeExitAttachment(true);
|
|
413657
|
-
return restoreDangerousPermissions(
|
|
413550
|
+
return restoreDangerousPermissions(context4);
|
|
413658
413551
|
}
|
|
413659
413552
|
var autoModeStateModule5, AUTO_MODE_ENABLED_DEFAULT = "disabled", NO_CACHED_AUTO_MODE_CONFIG;
|
|
413660
413553
|
var init_permissionSetup = __esm(() => {
|
|
@@ -414449,7 +414342,7 @@ function markBackslashReturnUsed() {
|
|
|
414449
414342
|
}));
|
|
414450
414343
|
}
|
|
414451
414344
|
}
|
|
414452
|
-
async function call5(onDone,
|
|
414345
|
+
async function call5(onDone, context4, _args) {
|
|
414453
414346
|
if (env2.terminal && env2.terminal in NATIVE_CSIU_TERMINALS) {
|
|
414454
414347
|
const message = `Shift+Enter is natively supported in ${NATIVE_CSIU_TERMINALS[env2.terminal]}.
|
|
414455
414348
|
|
|
@@ -414484,7 +414377,7 @@ ${source_default.dim("Note: iTerm2, WezTerm, Ghostty, Kitty, and Warp support Sh
|
|
|
414484
414377
|
onDone(message);
|
|
414485
414378
|
return null;
|
|
414486
414379
|
}
|
|
414487
|
-
const result = await setupTerminal(
|
|
414380
|
+
const result = await setupTerminal(context4.options.theme);
|
|
414488
414381
|
onDone(result);
|
|
414489
414382
|
return null;
|
|
414490
414383
|
}
|
|
@@ -418031,9 +417924,9 @@ function AddDirError(t0) {
|
|
|
418031
417924
|
}
|
|
418032
417925
|
return t5;
|
|
418033
417926
|
}
|
|
418034
|
-
async function call6(onDone,
|
|
417927
|
+
async function call6(onDone, context4, args) {
|
|
418035
417928
|
const directoryPath = (args ?? "").trim();
|
|
418036
|
-
const appState =
|
|
417929
|
+
const appState = context4.getAppState();
|
|
418037
417930
|
const handleAddDirectory = async (path17, remember = false) => {
|
|
418038
417931
|
const destination = remember ? "localSettings" : "session";
|
|
418039
417932
|
const permissionUpdate = {
|
|
@@ -418041,9 +417934,9 @@ async function call6(onDone, context5, args) {
|
|
|
418041
417934
|
directories: [path17],
|
|
418042
417935
|
destination
|
|
418043
417936
|
};
|
|
418044
|
-
const latestAppState =
|
|
417937
|
+
const latestAppState = context4.getAppState();
|
|
418045
417938
|
const updatedContext = applyPermissionUpdate(latestAppState.toolPermissionContext, permissionUpdate);
|
|
418046
|
-
|
|
417939
|
+
context4.setAppState((prev) => ({
|
|
418047
417940
|
...prev,
|
|
418048
417941
|
toolPermissionContext: updatedContext
|
|
418049
417942
|
}));
|
|
@@ -418372,7 +418265,7 @@ function BtwSideQuestion(t0) {
|
|
|
418372
418265
|
const $2 = import_react_compiler_runtime125.c(25);
|
|
418373
418266
|
const {
|
|
418374
418267
|
question,
|
|
418375
|
-
context:
|
|
418268
|
+
context: context4,
|
|
418376
418269
|
onDone
|
|
418377
418270
|
} = t0;
|
|
418378
418271
|
const [response, setResponse] = import_react98.useState(null);
|
|
@@ -418417,12 +418310,12 @@ function BtwSideQuestion(t0) {
|
|
|
418417
418310
|
const handleKeyDown = t2;
|
|
418418
418311
|
let t3;
|
|
418419
418312
|
let t4;
|
|
418420
|
-
if ($2[3] !==
|
|
418313
|
+
if ($2[3] !== context4 || $2[4] !== question) {
|
|
418421
418314
|
t3 = () => {
|
|
418422
418315
|
const abortController = createAbortController();
|
|
418423
418316
|
const fetchResponse = async function fetchResponse2() {
|
|
418424
418317
|
try {
|
|
418425
|
-
const cacheSafeParams = await buildCacheSafeParams(
|
|
418318
|
+
const cacheSafeParams = await buildCacheSafeParams(context4);
|
|
418426
418319
|
const result = await runSideQuestion({
|
|
418427
418320
|
question,
|
|
418428
418321
|
cacheSafeParams
|
|
@@ -418446,8 +418339,8 @@ function BtwSideQuestion(t0) {
|
|
|
418446
418339
|
abortController.abort();
|
|
418447
418340
|
};
|
|
418448
418341
|
};
|
|
418449
|
-
t4 = [question,
|
|
418450
|
-
$2[3] =
|
|
418342
|
+
t4 = [question, context4];
|
|
418343
|
+
$2[3] = context4;
|
|
418451
418344
|
$2[4] = question;
|
|
418452
418345
|
$2[5] = t3;
|
|
418453
418346
|
$2[6] = t4;
|
|
@@ -418587,28 +418480,28 @@ function stripInProgressAssistantMessage(messages) {
|
|
|
418587
418480
|
}
|
|
418588
418481
|
return messages;
|
|
418589
418482
|
}
|
|
418590
|
-
async function buildCacheSafeParams(
|
|
418591
|
-
const forkContextMessages = getMessagesAfterCompactBoundary(stripInProgressAssistantMessage(
|
|
418483
|
+
async function buildCacheSafeParams(context4) {
|
|
418484
|
+
const forkContextMessages = getMessagesAfterCompactBoundary(stripInProgressAssistantMessage(context4.messages));
|
|
418592
418485
|
const saved = getLastCacheSafeParams();
|
|
418593
418486
|
if (saved) {
|
|
418594
418487
|
return {
|
|
418595
418488
|
systemPrompt: saved.systemPrompt,
|
|
418596
418489
|
userContext: saved.userContext,
|
|
418597
418490
|
systemContext: saved.systemContext,
|
|
418598
|
-
toolUseContext:
|
|
418491
|
+
toolUseContext: context4,
|
|
418599
418492
|
forkContextMessages
|
|
418600
418493
|
};
|
|
418601
418494
|
}
|
|
418602
|
-
const [rawSystemPrompt, userContext, systemContext] = await Promise.all([getSystemPrompt(
|
|
418495
|
+
const [rawSystemPrompt, userContext, systemContext] = await Promise.all([getSystemPrompt(context4.options.tools, context4.options.mainLoopModel, [], context4.options.mcpClients), getUserContext(), getSystemContext()]);
|
|
418603
418496
|
return {
|
|
418604
418497
|
systemPrompt: asSystemPrompt(rawSystemPrompt),
|
|
418605
418498
|
userContext,
|
|
418606
418499
|
systemContext,
|
|
418607
|
-
toolUseContext:
|
|
418500
|
+
toolUseContext: context4,
|
|
418608
418501
|
forkContextMessages
|
|
418609
418502
|
};
|
|
418610
418503
|
}
|
|
418611
|
-
async function call7(onDone,
|
|
418504
|
+
async function call7(onDone, context4, args) {
|
|
418612
418505
|
const question = args?.trim();
|
|
418613
418506
|
if (!question) {
|
|
418614
418507
|
onDone(t("cmd_btw_usage"), {
|
|
@@ -418622,7 +418515,7 @@ async function call7(onDone, context5, args) {
|
|
|
418622
418515
|
}));
|
|
418623
418516
|
return /* @__PURE__ */ jsx_dev_runtime165.jsxDEV(BtwSideQuestion, {
|
|
418624
418517
|
question,
|
|
418625
|
-
context:
|
|
418518
|
+
context: context4,
|
|
418626
418519
|
onDone
|
|
418627
418520
|
}, undefined, false, undefined, this);
|
|
418628
418521
|
}
|
|
@@ -418777,7 +418670,7 @@ function Feedback({
|
|
|
418777
418670
|
platform: env2.platform,
|
|
418778
418671
|
gitRepo: envInfo.isGit,
|
|
418779
418672
|
terminal: env2.terminal,
|
|
418780
|
-
version: "0.
|
|
418673
|
+
version: "0.8.1",
|
|
418781
418674
|
transcript: normalizeMessagesForAPI(messages),
|
|
418782
418675
|
errors: sanitizedErrors,
|
|
418783
418676
|
lastApiRequest: getLastAPIRequest(),
|
|
@@ -418970,7 +418863,7 @@ function Feedback({
|
|
|
418970
418863
|
", ",
|
|
418971
418864
|
env2.terminal,
|
|
418972
418865
|
", v",
|
|
418973
|
-
"0.
|
|
418866
|
+
"0.8.1"
|
|
418974
418867
|
]
|
|
418975
418868
|
}, undefined, true, undefined, this)
|
|
418976
418869
|
]
|
|
@@ -419078,7 +418971,7 @@ ${sanitizedDescription}
|
|
|
419078
418971
|
` + `**Environment Info**
|
|
419079
418972
|
` + `- Platform: ${env2.platform}
|
|
419080
418973
|
` + `- Terminal: ${env2.terminal}
|
|
419081
|
-
` + `- Version: ${"0.
|
|
418974
|
+
` + `- Version: ${"0.8.1"}
|
|
419082
418975
|
` + feedbackIdLine + `
|
|
419083
418976
|
**Errors**
|
|
419084
418977
|
\`\`\`json
|
|
@@ -419291,9 +419184,9 @@ function renderFeedbackComponent(onDone, abortSignal, messages, initialDescripti
|
|
|
419291
419184
|
backgroundTasks
|
|
419292
419185
|
}, undefined, false, undefined, this);
|
|
419293
419186
|
}
|
|
419294
|
-
async function call8(onDone,
|
|
419187
|
+
async function call8(onDone, context4, args) {
|
|
419295
419188
|
const initialDescription = args || "";
|
|
419296
|
-
return renderFeedbackComponent(onDone,
|
|
419189
|
+
return renderFeedbackComponent(onDone, context4.abortController.signal, context4.messages, initialDescription);
|
|
419297
419190
|
}
|
|
419298
419191
|
var jsx_dev_runtime167;
|
|
419299
419192
|
var init_feedback = __esm(() => {
|
|
@@ -420125,8 +420018,8 @@ function getMagicDocsAgent() {
|
|
|
420125
420018
|
getSystemPrompt: () => ""
|
|
420126
420019
|
};
|
|
420127
420020
|
}
|
|
420128
|
-
async function updateMagicDoc(docInfo,
|
|
420129
|
-
const { messages, systemPrompt, userContext, systemContext, toolUseContext } =
|
|
420021
|
+
async function updateMagicDoc(docInfo, context4) {
|
|
420022
|
+
const { messages, systemPrompt, userContext, systemContext, toolUseContext } = context4;
|
|
420130
420023
|
const clonedReadFileState = cloneFileStateCache(toolUseContext.readFileState);
|
|
420131
420024
|
clonedReadFileState.delete(docInfo.path);
|
|
420132
420025
|
const clonedToolUseContext = {
|
|
@@ -420208,8 +420101,8 @@ var init_magicDocs = __esm(() => {
|
|
|
420208
420101
|
MAGIC_DOC_HEADER_PATTERN = /^#\s*MAGIC\s+DOC:\s*(.+)$/im;
|
|
420209
420102
|
ITALICS_PATTERN = /^[_*](.+?)[_*]\s*$/m;
|
|
420210
420103
|
trackedMagicDocs = new Map;
|
|
420211
|
-
updateMagicDocs = sequential(async function(
|
|
420212
|
-
const { messages, querySource } =
|
|
420104
|
+
updateMagicDocs = sequential(async function(context4) {
|
|
420105
|
+
const { messages, querySource } = context4;
|
|
420213
420106
|
if (querySource !== "repl_main_thread") {
|
|
420214
420107
|
return;
|
|
420215
420108
|
}
|
|
@@ -420222,7 +420115,7 @@ var init_magicDocs = __esm(() => {
|
|
|
420222
420115
|
return;
|
|
420223
420116
|
}
|
|
420224
420117
|
for (const docInfo of Array.from(trackedMagicDocs.values())) {
|
|
420225
|
-
await updateMagicDoc(docInfo,
|
|
420118
|
+
await updateMagicDoc(docInfo, context4);
|
|
420226
420119
|
}
|
|
420227
420120
|
});
|
|
420228
420121
|
});
|
|
@@ -420455,8 +420348,8 @@ var exports_clear = {};
|
|
|
420455
420348
|
__export(exports_clear, {
|
|
420456
420349
|
call: () => call9
|
|
420457
420350
|
});
|
|
420458
|
-
var call9 = async (_,
|
|
420459
|
-
await clearConversation(
|
|
420351
|
+
var call9 = async (_, context4) => {
|
|
420352
|
+
await clearConversation(context4);
|
|
420460
420353
|
return { type: "text", value: "" };
|
|
420461
420354
|
};
|
|
420462
420355
|
var init_clear = __esm(() => {
|
|
@@ -420483,7 +420376,7 @@ var exports_color = {};
|
|
|
420483
420376
|
__export(exports_color, {
|
|
420484
420377
|
call: () => call10
|
|
420485
420378
|
});
|
|
420486
|
-
async function call10(onDone,
|
|
420379
|
+
async function call10(onDone, context4, args) {
|
|
420487
420380
|
if (isTeammate()) {
|
|
420488
420381
|
onDone(t("cmd_color_teammate"), { display: "system" });
|
|
420489
420382
|
return null;
|
|
@@ -420500,7 +420393,7 @@ async function call10(onDone, context5, args) {
|
|
|
420500
420393
|
const sessionId2 = getSessionId();
|
|
420501
420394
|
const fullPath2 = getTranscriptPath();
|
|
420502
420395
|
await saveAgentColor(sessionId2, "default", fullPath2);
|
|
420503
|
-
|
|
420396
|
+
context4.setAppState((prev) => ({
|
|
420504
420397
|
...prev,
|
|
420505
420398
|
standaloneAgentContext: {
|
|
420506
420399
|
...prev.standaloneAgentContext,
|
|
@@ -420519,7 +420412,7 @@ async function call10(onDone, context5, args) {
|
|
|
420519
420412
|
const sessionId = getSessionId();
|
|
420520
420413
|
const fullPath = getTranscriptPath();
|
|
420521
420414
|
await saveAgentColor(sessionId, colorArg, fullPath);
|
|
420522
|
-
|
|
420415
|
+
context4.setAppState((prev) => ({
|
|
420523
420416
|
...prev,
|
|
420524
420417
|
standaloneAgentContext: {
|
|
420525
420418
|
...prev.standaloneAgentContext,
|
|
@@ -420619,12 +420512,12 @@ var init_commit = __esm(() => {
|
|
|
420619
420512
|
contentLength: 0,
|
|
420620
420513
|
progressMessage: t("progress_creating_commit"),
|
|
420621
420514
|
source: "builtin",
|
|
420622
|
-
async getPromptForCommand(_args,
|
|
420515
|
+
async getPromptForCommand(_args, context4) {
|
|
420623
420516
|
const promptContent = getPromptContent();
|
|
420624
420517
|
const finalContent = await executeShellCommandsInPrompt(promptContent, {
|
|
420625
|
-
...
|
|
420518
|
+
...context4,
|
|
420626
420519
|
getAppState() {
|
|
420627
|
-
const appState =
|
|
420520
|
+
const appState = context4.getAppState();
|
|
420628
420521
|
return {
|
|
420629
420522
|
...appState,
|
|
420630
420523
|
toolPermissionContext: {
|
|
@@ -420989,8 +420882,8 @@ function _temp58(block2, index) {
|
|
|
420989
420882
|
description: [block2.lang, blockLines > 1 ? `${blockLines} lines` : undefined].filter(Boolean).join(", ") || undefined
|
|
420990
420883
|
};
|
|
420991
420884
|
}
|
|
420992
|
-
var import_react_compiler_runtime126, import_react100, jsx_dev_runtime168, COPY_DIR, RESPONSE_FILENAME = "response.md", MAX_LOOKBACK = 20, call11 = async (onDone,
|
|
420993
|
-
const texts = collectRecentAssistantTexts(
|
|
420885
|
+
var import_react_compiler_runtime126, import_react100, jsx_dev_runtime168, COPY_DIR, RESPONSE_FILENAME = "response.md", MAX_LOOKBACK = 20, call11 = async (onDone, context4, args) => {
|
|
420886
|
+
const texts = collectRecentAssistantTexts(context4.messages);
|
|
420994
420887
|
if (texts.length === 0) {
|
|
420995
420888
|
onDone(t("cmd_copy_no_message"));
|
|
420996
420889
|
return null;
|
|
@@ -421669,10 +421562,10 @@ var init_commit_push_pr = __esm(() => {
|
|
|
421669
421562
|
},
|
|
421670
421563
|
progressMessage: "creating commit and PR",
|
|
421671
421564
|
source: "builtin",
|
|
421672
|
-
async getPromptForCommand(args,
|
|
421565
|
+
async getPromptForCommand(args, context4) {
|
|
421673
421566
|
const [defaultBranch, prAttribution] = await Promise.all([
|
|
421674
421567
|
getDefaultBranch(),
|
|
421675
|
-
getEnhancedPRAttribution(
|
|
421568
|
+
getEnhancedPRAttribution(context4.getAppState)
|
|
421676
421569
|
]);
|
|
421677
421570
|
let promptContent = getPromptContent2(defaultBranch, prAttribution);
|
|
421678
421571
|
const trimmedArgs = args?.trim();
|
|
@@ -421684,9 +421577,9 @@ var init_commit_push_pr = __esm(() => {
|
|
|
421684
421577
|
${trimmedArgs}`;
|
|
421685
421578
|
}
|
|
421686
421579
|
const finalContent = await executeShellCommandsInPrompt(promptContent, {
|
|
421687
|
-
...
|
|
421580
|
+
...context4,
|
|
421688
421581
|
getAppState() {
|
|
421689
|
-
const appState =
|
|
421582
|
+
const appState = context4.getAppState();
|
|
421690
421583
|
return {
|
|
421691
421584
|
...appState,
|
|
421692
421585
|
toolPermissionContext: {
|
|
@@ -421710,21 +421603,21 @@ var exports_compact = {};
|
|
|
421710
421603
|
__export(exports_compact, {
|
|
421711
421604
|
call: () => call13
|
|
421712
421605
|
});
|
|
421713
|
-
async function compactViaReactive(messages,
|
|
421714
|
-
|
|
421606
|
+
async function compactViaReactive(messages, context4, customInstructions, reactive) {
|
|
421607
|
+
context4.onCompactProgress?.({
|
|
421715
421608
|
type: "hooks_start",
|
|
421716
421609
|
hookType: "pre_compact"
|
|
421717
421610
|
});
|
|
421718
|
-
|
|
421611
|
+
context4.setSDKStatus?.("compacting");
|
|
421719
421612
|
try {
|
|
421720
421613
|
const [hookResult, cacheSafeParams] = await Promise.all([
|
|
421721
|
-
executePreCompactHooks({ trigger: "manual", customInstructions: customInstructions || null },
|
|
421722
|
-
getCacheSharingParams(
|
|
421614
|
+
executePreCompactHooks({ trigger: "manual", customInstructions: customInstructions || null }, context4.abortController.signal),
|
|
421615
|
+
getCacheSharingParams(context4, messages)
|
|
421723
421616
|
]);
|
|
421724
421617
|
const mergedInstructions = mergeHookInstructions(customInstructions, hookResult.newCustomInstructions);
|
|
421725
|
-
|
|
421726
|
-
|
|
421727
|
-
|
|
421618
|
+
context4.setStreamMode?.("requesting");
|
|
421619
|
+
context4.setResponseLength?.(() => 0);
|
|
421620
|
+
context4.onCompactProgress?.({ type: "compact_start" });
|
|
421728
421621
|
const outcome = await reactive.reactiveCompactOnPromptTooLong(messages, cacheSafeParams, { customInstructions: mergedInstructions, trigger: "manual" });
|
|
421729
421622
|
if (!outcome.ok) {
|
|
421730
421623
|
switch (outcome.reason) {
|
|
@@ -421750,35 +421643,35 @@ async function compactViaReactive(messages, context5, customInstructions, reacti
|
|
|
421750
421643
|
...outcome.result,
|
|
421751
421644
|
userDisplayMessage: combinedMessage
|
|
421752
421645
|
},
|
|
421753
|
-
displayText: buildDisplayText(
|
|
421646
|
+
displayText: buildDisplayText(context4, combinedMessage)
|
|
421754
421647
|
};
|
|
421755
421648
|
} finally {
|
|
421756
|
-
|
|
421757
|
-
|
|
421758
|
-
|
|
421759
|
-
|
|
421649
|
+
context4.setStreamMode?.("requesting");
|
|
421650
|
+
context4.setResponseLength?.(() => 0);
|
|
421651
|
+
context4.onCompactProgress?.({ type: "compact_end" });
|
|
421652
|
+
context4.setSDKStatus?.(null);
|
|
421760
421653
|
}
|
|
421761
421654
|
}
|
|
421762
|
-
function buildDisplayText(
|
|
421655
|
+
function buildDisplayText(context4, userDisplayMessage) {
|
|
421763
421656
|
const upgradeMessage = getUpgradeMessage("tip");
|
|
421764
421657
|
const expandShortcut = getShortcutDisplay("app:toggleTranscript", "Global", "ctrl+o");
|
|
421765
421658
|
const dimmed = [
|
|
421766
|
-
...
|
|
421659
|
+
...context4.options.verbose ? [] : [t("cmd_compact_full_summary")(expandShortcut)],
|
|
421767
421660
|
...userDisplayMessage ? [userDisplayMessage] : [],
|
|
421768
421661
|
...upgradeMessage ? [upgradeMessage] : []
|
|
421769
421662
|
];
|
|
421770
421663
|
return source_default.dim(t("cmd_compact_compacted") + " " + dimmed.join(`
|
|
421771
421664
|
`));
|
|
421772
421665
|
}
|
|
421773
|
-
async function getCacheSharingParams(
|
|
421774
|
-
const appState =
|
|
421775
|
-
const defaultSysPrompt = await getSystemPrompt(
|
|
421666
|
+
async function getCacheSharingParams(context4, forkContextMessages) {
|
|
421667
|
+
const appState = context4.getAppState();
|
|
421668
|
+
const defaultSysPrompt = await getSystemPrompt(context4.options.tools, context4.options.mainLoopModel, Array.from(appState.toolPermissionContext.additionalWorkingDirectories.keys()), context4.options.mcpClients);
|
|
421776
421669
|
const systemPrompt = buildEffectiveSystemPrompt({
|
|
421777
421670
|
mainThreadAgentDefinition: undefined,
|
|
421778
|
-
toolUseContext:
|
|
421779
|
-
customSystemPrompt:
|
|
421671
|
+
toolUseContext: context4,
|
|
421672
|
+
customSystemPrompt: context4.options.customSystemPrompt,
|
|
421780
421673
|
defaultSystemPrompt: defaultSysPrompt,
|
|
421781
|
-
appendSystemPrompt:
|
|
421674
|
+
appendSystemPrompt: context4.options.appendSystemPrompt
|
|
421782
421675
|
});
|
|
421783
421676
|
const [userContext, systemContext] = await Promise.all([
|
|
421784
421677
|
getUserContext(),
|
|
@@ -421788,13 +421681,13 @@ async function getCacheSharingParams(context5, forkContextMessages) {
|
|
|
421788
421681
|
systemPrompt,
|
|
421789
421682
|
userContext,
|
|
421790
421683
|
systemContext,
|
|
421791
|
-
toolUseContext:
|
|
421684
|
+
toolUseContext: context4,
|
|
421792
421685
|
forkContextMessages
|
|
421793
421686
|
};
|
|
421794
421687
|
}
|
|
421795
|
-
var reactiveCompact2 = null, call13 = async (args,
|
|
421796
|
-
const { abortController } =
|
|
421797
|
-
let { messages } =
|
|
421688
|
+
var reactiveCompact2 = null, call13 = async (args, context4) => {
|
|
421689
|
+
const { abortController } = context4;
|
|
421690
|
+
let { messages } = context4;
|
|
421798
421691
|
messages = getMessagesAfterCompactBoundary(messages);
|
|
421799
421692
|
if (messages.length === 0) {
|
|
421800
421693
|
throw new Error("No messages to compact");
|
|
@@ -421802,28 +421695,28 @@ var reactiveCompact2 = null, call13 = async (args, context5) => {
|
|
|
421802
421695
|
const customInstructions = args.trim();
|
|
421803
421696
|
try {
|
|
421804
421697
|
if (!customInstructions) {
|
|
421805
|
-
const sessionMemoryResult = await trySessionMemoryCompaction(messages,
|
|
421698
|
+
const sessionMemoryResult = await trySessionMemoryCompaction(messages, context4.agentId);
|
|
421806
421699
|
if (sessionMemoryResult) {
|
|
421807
421700
|
getUserContext.cache.clear?.();
|
|
421808
421701
|
runPostCompactCleanup();
|
|
421809
421702
|
if (true) {
|
|
421810
|
-
notifyCompaction(
|
|
421703
|
+
notifyCompaction(context4.options.querySource ?? "compact", context4.agentId);
|
|
421811
421704
|
}
|
|
421812
421705
|
markPostCompaction();
|
|
421813
421706
|
suppressCompactWarning();
|
|
421814
421707
|
return {
|
|
421815
421708
|
type: "compact",
|
|
421816
421709
|
compactionResult: sessionMemoryResult,
|
|
421817
|
-
displayText: buildDisplayText(
|
|
421710
|
+
displayText: buildDisplayText(context4)
|
|
421818
421711
|
};
|
|
421819
421712
|
}
|
|
421820
421713
|
}
|
|
421821
421714
|
if (reactiveCompact2?.isReactiveOnlyMode()) {
|
|
421822
|
-
return await compactViaReactive(messages,
|
|
421715
|
+
return await compactViaReactive(messages, context4, customInstructions, reactiveCompact2);
|
|
421823
421716
|
}
|
|
421824
|
-
const microcompactResult = await microcompactMessages(messages,
|
|
421717
|
+
const microcompactResult = await microcompactMessages(messages, context4);
|
|
421825
421718
|
const messagesForCompact = microcompactResult.messages;
|
|
421826
|
-
const result = await compactConversation(messagesForCompact,
|
|
421719
|
+
const result = await compactConversation(messagesForCompact, context4, await getCacheSharingParams(context4, messagesForCompact), false, customInstructions, false);
|
|
421827
421720
|
setLastSummarizedMessageId(undefined);
|
|
421828
421721
|
suppressCompactWarning();
|
|
421829
421722
|
getUserContext.cache.clear?.();
|
|
@@ -421831,7 +421724,7 @@ var reactiveCompact2 = null, call13 = async (args, context5) => {
|
|
|
421831
421724
|
return {
|
|
421832
421725
|
type: "compact",
|
|
421833
421726
|
compactionResult: result,
|
|
421834
|
-
displayText: buildDisplayText(
|
|
421727
|
+
displayText: buildDisplayText(context4, result.userDisplayMessage)
|
|
421835
421728
|
};
|
|
421836
421729
|
} catch (error42) {
|
|
421837
421730
|
if (abortController.signal.aborted) {
|
|
@@ -422233,7 +422126,7 @@ function buildPrimarySection() {
|
|
|
422233
422126
|
}, undefined, false, undefined, this);
|
|
422234
422127
|
return [{
|
|
422235
422128
|
label: "Version",
|
|
422236
|
-
value: "0.
|
|
422129
|
+
value: "0.8.1"
|
|
422237
422130
|
}, {
|
|
422238
422131
|
label: "Session name",
|
|
422239
422132
|
value: nameValue
|
|
@@ -422249,13 +422142,13 @@ function buildSecondarySection({
|
|
|
422249
422142
|
mainLoopModel,
|
|
422250
422143
|
mcp,
|
|
422251
422144
|
theme,
|
|
422252
|
-
context:
|
|
422145
|
+
context: context4
|
|
422253
422146
|
}) {
|
|
422254
422147
|
const modelLabel = getModelDisplayLabel(mainLoopModel);
|
|
422255
422148
|
return [{
|
|
422256
422149
|
label: "Model",
|
|
422257
422150
|
value: modelLabel
|
|
422258
|
-
}, ...buildIDEProperties(mcp.clients,
|
|
422151
|
+
}, ...buildIDEProperties(mcp.clients, context4.options.ideInstallationStatus, theme), ...buildMcpProperties(mcp.clients, theme), ...buildSandboxProperties(), ...buildSettingSourcesProperties()];
|
|
422259
422152
|
}
|
|
422260
422153
|
async function buildDiagnostics() {
|
|
422261
422154
|
return [...await buildInstallationDiagnostics(), ...await buildInstallationHealthDiagnostics(), ...await buildMemoryDiagnostics()];
|
|
@@ -422320,7 +422213,7 @@ function PropertyValue(t0) {
|
|
|
422320
422213
|
function Status(t0) {
|
|
422321
422214
|
const $2 = import_react_compiler_runtime130.c(20);
|
|
422322
422215
|
const {
|
|
422323
|
-
context:
|
|
422216
|
+
context: context4,
|
|
422324
422217
|
diagnosticsPromise
|
|
422325
422218
|
} = t0;
|
|
422326
422219
|
const mainLoopModel = useAppState(_temp61);
|
|
@@ -422334,14 +422227,14 @@ function Status(t0) {
|
|
|
422334
422227
|
t1 = $2[0];
|
|
422335
422228
|
}
|
|
422336
422229
|
let t2;
|
|
422337
|
-
if ($2[1] !==
|
|
422230
|
+
if ($2[1] !== context4 || $2[2] !== mainLoopModel || $2[3] !== mcp || $2[4] !== theme) {
|
|
422338
422231
|
t2 = buildSecondarySection({
|
|
422339
422232
|
mainLoopModel,
|
|
422340
422233
|
mcp,
|
|
422341
422234
|
theme,
|
|
422342
|
-
context:
|
|
422235
|
+
context: context4
|
|
422343
422236
|
});
|
|
422344
|
-
$2[1] =
|
|
422237
|
+
$2[1] = context4;
|
|
422345
422238
|
$2[2] = mainLoopModel;
|
|
422346
422239
|
$2[3] = mcp;
|
|
422347
422240
|
$2[4] = theme;
|
|
@@ -425481,7 +425374,7 @@ var init_useSearchInput = __esm(() => {
|
|
|
425481
425374
|
// src/components/Settings/Config.tsx
|
|
425482
425375
|
function Config({
|
|
425483
425376
|
onClose,
|
|
425484
|
-
context:
|
|
425377
|
+
context: context4,
|
|
425485
425378
|
setTabsHidden,
|
|
425486
425379
|
onIsSearchModeChange,
|
|
425487
425380
|
contentHeight
|
|
@@ -425559,7 +425452,7 @@ function Config({
|
|
|
425559
425452
|
React57.useEffect(() => {
|
|
425560
425453
|
onIsSearchModeChange?.(ownsEsc);
|
|
425561
425454
|
}, [ownsEsc, onIsSearchModeChange]);
|
|
425562
|
-
const isConnectedToIde = hasAccessToIDEExtensionDiffFeature(
|
|
425455
|
+
const isConnectedToIde = hasAccessToIDEExtensionDiffFeature(context4.options.mcpClients);
|
|
425563
425456
|
const isFileCheckpointingAvailable = !isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING);
|
|
425564
425457
|
const memoryFiles = React57.use(getMemoryFiles(true));
|
|
425565
425458
|
const shouldShowExternalIncludesToggle = hasExternalClaudeMdIncludes(memoryFiles);
|
|
@@ -426574,7 +426467,7 @@ function Config({
|
|
|
426574
426467
|
const backToInitial = newValue === initialThinkingEnabled.current;
|
|
426575
426468
|
if (backToInitial) {
|
|
426576
426469
|
setShowThinkingWarning(false);
|
|
426577
|
-
} else if (
|
|
426470
|
+
} else if (context4.messages.some((m_0) => m_0.type === "assistant")) {
|
|
426578
426471
|
setShowThinkingWarning(true);
|
|
426579
426472
|
}
|
|
426580
426473
|
}
|
|
@@ -427003,7 +426896,7 @@ function Config({
|
|
|
427003
426896
|
}
|
|
427004
426897
|
}, undefined, false, undefined, this)
|
|
427005
426898
|
}, undefined, false, undefined, this) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_dev_runtime181.jsxDEV(ChannelDowngradeDialog, {
|
|
427006
|
-
currentVersion: "0.
|
|
426899
|
+
currentVersion: "0.8.1",
|
|
427007
426900
|
onChoice: (choice) => {
|
|
427008
426901
|
setShowSubmenu(null);
|
|
427009
426902
|
setTabsHidden(false);
|
|
@@ -427015,7 +426908,7 @@ function Config({
|
|
|
427015
426908
|
autoUpdatesChannel: "stable"
|
|
427016
426909
|
};
|
|
427017
426910
|
if (choice === "stay") {
|
|
427018
|
-
newSettings.minimumVersion = "0.
|
|
426911
|
+
newSettings.minimumVersion = "0.8.1";
|
|
427019
426912
|
}
|
|
427020
426913
|
updateSettingsForSource("userSettings", newSettings);
|
|
427021
426914
|
setSettingsData((prev_27) => ({
|
|
@@ -428533,7 +428426,7 @@ function Settings(t0) {
|
|
|
428533
428426
|
const $2 = import_react_compiler_runtime140.c(25);
|
|
428534
428427
|
const {
|
|
428535
428428
|
onClose,
|
|
428536
|
-
context:
|
|
428429
|
+
context: context4,
|
|
428537
428430
|
defaultTab
|
|
428538
428431
|
} = t0;
|
|
428539
428432
|
const [selectedTab, setSelectedTab] = import_react113.useState(defaultTab);
|
|
@@ -428578,28 +428471,28 @@ function Settings(t0) {
|
|
|
428578
428471
|
}
|
|
428579
428472
|
useKeybinding("confirm:no", handleEscape, t3);
|
|
428580
428473
|
let t4;
|
|
428581
|
-
if ($2[5] !==
|
|
428474
|
+
if ($2[5] !== context4 || $2[6] !== diagnosticsPromise) {
|
|
428582
428475
|
t4 = /* @__PURE__ */ jsx_dev_runtime185.jsxDEV(Tab, {
|
|
428583
428476
|
title: "Status",
|
|
428584
428477
|
children: /* @__PURE__ */ jsx_dev_runtime185.jsxDEV(Status, {
|
|
428585
|
-
context:
|
|
428478
|
+
context: context4,
|
|
428586
428479
|
diagnosticsPromise
|
|
428587
428480
|
}, undefined, false, undefined, this)
|
|
428588
428481
|
}, "status", false, undefined, this);
|
|
428589
|
-
$2[5] =
|
|
428482
|
+
$2[5] = context4;
|
|
428590
428483
|
$2[6] = diagnosticsPromise;
|
|
428591
428484
|
$2[7] = t4;
|
|
428592
428485
|
} else {
|
|
428593
428486
|
t4 = $2[7];
|
|
428594
428487
|
}
|
|
428595
428488
|
let t5;
|
|
428596
|
-
if ($2[8] !== contentHeight || $2[9] !==
|
|
428489
|
+
if ($2[8] !== contentHeight || $2[9] !== context4 || $2[10] !== onClose) {
|
|
428597
428490
|
t5 = /* @__PURE__ */ jsx_dev_runtime185.jsxDEV(Tab, {
|
|
428598
428491
|
title: "Config",
|
|
428599
428492
|
children: /* @__PURE__ */ jsx_dev_runtime185.jsxDEV(import_react113.Suspense, {
|
|
428600
428493
|
fallback: null,
|
|
428601
428494
|
children: /* @__PURE__ */ jsx_dev_runtime185.jsxDEV(Config, {
|
|
428602
|
-
context:
|
|
428495
|
+
context: context4,
|
|
428603
428496
|
onClose,
|
|
428604
428497
|
setTabsHidden,
|
|
428605
428498
|
onIsSearchModeChange: setConfigOwnsEsc,
|
|
@@ -428608,7 +428501,7 @@ function Settings(t0) {
|
|
|
428608
428501
|
}, undefined, false, undefined, this)
|
|
428609
428502
|
}, "config", false, undefined, this);
|
|
428610
428503
|
$2[8] = contentHeight;
|
|
428611
|
-
$2[9] =
|
|
428504
|
+
$2[9] = context4;
|
|
428612
428505
|
$2[10] = onClose;
|
|
428613
428506
|
$2[11] = t5;
|
|
428614
428507
|
} else {
|
|
@@ -428697,10 +428590,10 @@ var exports_config2 = {};
|
|
|
428697
428590
|
__export(exports_config2, {
|
|
428698
428591
|
call: () => call14
|
|
428699
428592
|
});
|
|
428700
|
-
var jsx_dev_runtime186, call14 = async (onDone,
|
|
428593
|
+
var jsx_dev_runtime186, call14 = async (onDone, context4) => {
|
|
428701
428594
|
return /* @__PURE__ */ jsx_dev_runtime186.jsxDEV(Settings, {
|
|
428702
428595
|
onClose: onDone,
|
|
428703
|
-
context:
|
|
428596
|
+
context: context4,
|
|
428704
428597
|
defaultTab: "Config"
|
|
428705
428598
|
}, undefined, false, undefined, this);
|
|
428706
428599
|
};
|
|
@@ -429869,7 +429762,7 @@ function toApiView(messages) {
|
|
|
429869
429762
|
if (false) {}
|
|
429870
429763
|
return view;
|
|
429871
429764
|
}
|
|
429872
|
-
async function call15(onDone,
|
|
429765
|
+
async function call15(onDone, context4) {
|
|
429873
429766
|
const {
|
|
429874
429767
|
messages,
|
|
429875
429768
|
getAppState,
|
|
@@ -429877,14 +429770,14 @@ async function call15(onDone, context5) {
|
|
|
429877
429770
|
mainLoopModel,
|
|
429878
429771
|
tools
|
|
429879
429772
|
}
|
|
429880
|
-
} =
|
|
429773
|
+
} = context4;
|
|
429881
429774
|
const apiView = toApiView(messages);
|
|
429882
429775
|
const {
|
|
429883
429776
|
messages: compactedMessages
|
|
429884
429777
|
} = await microcompactMessages(apiView);
|
|
429885
429778
|
const terminalWidth = process.stdout.columns || 80;
|
|
429886
429779
|
const appState = getAppState();
|
|
429887
|
-
const data = await analyzeContextUsage(compactedMessages, mainLoopModel, async () => appState.toolPermissionContext, tools, appState.agentDefinitions, terminalWidth,
|
|
429780
|
+
const data = await analyzeContextUsage(compactedMessages, mainLoopModel, async () => appState.toolPermissionContext, tools, appState.agentDefinitions, terminalWidth, context4, undefined, apiView);
|
|
429888
429781
|
const output = await renderToAnsiString(/* @__PURE__ */ jsx_dev_runtime191.jsxDEV(ContextVisualization, {
|
|
429889
429782
|
data
|
|
429890
429783
|
}, undefined, false, undefined, this));
|
|
@@ -429907,7 +429800,7 @@ __export(exports_context_noninteractive, {
|
|
|
429907
429800
|
collectContextData: () => collectContextData,
|
|
429908
429801
|
call: () => call16
|
|
429909
429802
|
});
|
|
429910
|
-
async function collectContextData(
|
|
429803
|
+
async function collectContextData(context4) {
|
|
429911
429804
|
const {
|
|
429912
429805
|
messages,
|
|
429913
429806
|
getAppState,
|
|
@@ -429918,15 +429811,15 @@ async function collectContextData(context5) {
|
|
|
429918
429811
|
customSystemPrompt,
|
|
429919
429812
|
appendSystemPrompt
|
|
429920
429813
|
}
|
|
429921
|
-
} =
|
|
429814
|
+
} = context4;
|
|
429922
429815
|
let apiView = getMessagesAfterCompactBoundary(messages);
|
|
429923
429816
|
if (false) {}
|
|
429924
429817
|
const { messages: compactedMessages } = await microcompactMessages(apiView);
|
|
429925
429818
|
const appState = getAppState();
|
|
429926
429819
|
return analyzeContextUsage(compactedMessages, mainLoopModel, async () => appState.toolPermissionContext, tools, agentDefinitions, undefined, { options: { customSystemPrompt, appendSystemPrompt } }, undefined, apiView);
|
|
429927
429820
|
}
|
|
429928
|
-
async function call16(_args,
|
|
429929
|
-
const data = await collectContextData(
|
|
429821
|
+
async function call16(_args, context4) {
|
|
429822
|
+
const data = await collectContextData(context4);
|
|
429930
429823
|
return {
|
|
429931
429824
|
type: "text",
|
|
429932
429825
|
value: formatContextAsMarkdownTable(data)
|
|
@@ -430165,11 +430058,11 @@ var init_context_noninteractive = __esm(() => {
|
|
|
430165
430058
|
});
|
|
430166
430059
|
|
|
430167
430060
|
// src/commands/context/index.ts
|
|
430168
|
-
var
|
|
430061
|
+
var context4, contextNonInteractive;
|
|
430169
430062
|
var init_context4 = __esm(() => {
|
|
430170
430063
|
init_state();
|
|
430171
430064
|
init_i18n();
|
|
430172
|
-
|
|
430065
|
+
context4 = {
|
|
430173
430066
|
name: "context",
|
|
430174
430067
|
description: t("cmd_context"),
|
|
430175
430068
|
isEnabled: () => !getIsNonInteractiveSession(),
|
|
@@ -431696,12 +431589,12 @@ var exports_diff = {};
|
|
|
431696
431589
|
__export(exports_diff, {
|
|
431697
431590
|
call: () => call18
|
|
431698
431591
|
});
|
|
431699
|
-
var jsx_dev_runtime195, call18 = async (onDone,
|
|
431592
|
+
var jsx_dev_runtime195, call18 = async (onDone, context5) => {
|
|
431700
431593
|
const {
|
|
431701
431594
|
DiffDialog: DiffDialog2
|
|
431702
431595
|
} = await Promise.resolve().then(() => (init_DiffDialog(), exports_DiffDialog));
|
|
431703
431596
|
return /* @__PURE__ */ jsx_dev_runtime195.jsxDEV(DiffDialog2, {
|
|
431704
|
-
messages:
|
|
431597
|
+
messages: context5.messages,
|
|
431705
431598
|
onDone
|
|
431706
431599
|
}, undefined, false, undefined, this);
|
|
431707
431600
|
};
|
|
@@ -431722,9 +431615,9 @@ var init_diff4 = __esm(() => {
|
|
|
431722
431615
|
});
|
|
431723
431616
|
|
|
431724
431617
|
// missing-module-stub:./dream.js
|
|
431725
|
-
var
|
|
431618
|
+
var noop19 = () => null, dream_default;
|
|
431726
431619
|
var init_dream = __esm(() => {
|
|
431727
|
-
dream_default =
|
|
431620
|
+
dream_default = noop19;
|
|
431728
431621
|
});
|
|
431729
431622
|
|
|
431730
431623
|
// src/commands/dream/index.ts
|
|
@@ -432712,11 +432605,11 @@ function isAllowRuleShadowedByDenyRule(allowRule, denyRules) {
|
|
|
432712
432605
|
}
|
|
432713
432606
|
return { shadowed: true, shadowedBy: shadowingDenyRule, shadowType: "deny" };
|
|
432714
432607
|
}
|
|
432715
|
-
function detectUnreachableRules(
|
|
432608
|
+
function detectUnreachableRules(context5, options2) {
|
|
432716
432609
|
const unreachable = [];
|
|
432717
|
-
const allowRules = getAllowRules(
|
|
432718
|
-
const askRules = getAskRules(
|
|
432719
|
-
const denyRules = getDenyRules(
|
|
432610
|
+
const allowRules = getAllowRules(context5);
|
|
432611
|
+
const askRules = getAskRules(context5);
|
|
432612
|
+
const denyRules = getDenyRules(context5);
|
|
432720
432613
|
for (const allowRule of allowRules) {
|
|
432721
432614
|
const denyResult = isAllowRuleShadowedByDenyRule(allowRule, denyRules);
|
|
432722
432615
|
if (denyResult.shadowed) {
|
|
@@ -432862,9 +432755,9 @@ async function checkMcpTools(tools, getToolPermissionContext, agentInfo) {
|
|
|
432862
432755
|
}
|
|
432863
432756
|
}
|
|
432864
432757
|
async function checkUnreachableRules(getToolPermissionContext) {
|
|
432865
|
-
const
|
|
432758
|
+
const context5 = await getToolPermissionContext();
|
|
432866
432759
|
const sandboxAutoAllowEnabled = SandboxManager2.isSandboxingEnabled() && SandboxManager2.isAutoAllowBashIfSandboxedEnabled();
|
|
432867
|
-
const unreachable = detectUnreachableRules(
|
|
432760
|
+
const unreachable = detectUnreachableRules(context5, {
|
|
432868
432761
|
sandboxAutoAllowEnabled
|
|
432869
432762
|
});
|
|
432870
432763
|
if (unreachable.length === 0) {
|
|
@@ -434194,11 +434087,11 @@ function OnboardGithub(props) {
|
|
|
434194
434087
|
]
|
|
434195
434088
|
}, undefined, true, undefined, this);
|
|
434196
434089
|
}
|
|
434197
|
-
var import_react120, jsx_dev_runtime203, DEFAULT_MODEL = "github:copilot", FORCE_RELOGIN_ARGS, PROVIDER_SPECIFIC_KEYS, GITHUB_PAT_PREFIXES2, call20 = async (onDone,
|
|
434090
|
+
var import_react120, jsx_dev_runtime203, DEFAULT_MODEL = "github:copilot", FORCE_RELOGIN_ARGS, PROVIDER_SPECIFIC_KEYS, GITHUB_PAT_PREFIXES2, call20 = async (onDone, context5, args) => {
|
|
434198
434091
|
const forceRelogin = shouldForceGithubRelogin(args);
|
|
434199
434092
|
if (hasExistingGithubModelsLoginToken() && !forceRelogin) {
|
|
434200
434093
|
const activated = activateGithubOnboardingMode(DEFAULT_MODEL, {
|
|
434201
|
-
onChangeAPIKey:
|
|
434094
|
+
onChangeAPIKey: context5.onChangeAPIKey
|
|
434202
434095
|
});
|
|
434203
434096
|
if (!activated.ok) {
|
|
434204
434097
|
onDone(`GitHub token detected, but settings activation failed: ${activated.detail ?? "unknown error"}. ` + "Set CLAUDE_CODE_USE_GITHUB=1 and OPENAI_MODEL=github:copilot in user settings manually.", { display: "system" });
|
|
@@ -434209,7 +434102,7 @@ var import_react120, jsx_dev_runtime203, DEFAULT_MODEL = "github:copilot", FORCE
|
|
|
434209
434102
|
}
|
|
434210
434103
|
return /* @__PURE__ */ jsx_dev_runtime203.jsxDEV(OnboardGithub, {
|
|
434211
434104
|
onDone,
|
|
434212
|
-
onChangeAPIKey:
|
|
434105
|
+
onChangeAPIKey: context5.onChangeAPIKey
|
|
434213
434106
|
}, undefined, false, undefined, this);
|
|
434214
434107
|
};
|
|
434215
434108
|
var init_onboard_github = __esm(() => {
|
|
@@ -435911,7 +435804,7 @@ function HelpV2(t0) {
|
|
|
435911
435804
|
let t6;
|
|
435912
435805
|
if ($2[31] !== tabs) {
|
|
435913
435806
|
t6 = /* @__PURE__ */ jsx_dev_runtime210.jsxDEV(Tabs, {
|
|
435914
|
-
title: `ZeroCLI v${"0.
|
|
435807
|
+
title: `ZeroCLI v${"0.8.1"}`,
|
|
435915
435808
|
color: "professionalBlue",
|
|
435916
435809
|
defaultTab: "general",
|
|
435917
435810
|
children: tabs
|
|
@@ -436702,14 +436595,14 @@ function InstallOnMount(t0) {
|
|
|
436702
436595
|
import_react122.useEffect(t1, t2);
|
|
436703
436596
|
return null;
|
|
436704
436597
|
}
|
|
436705
|
-
async function call23(onDone,
|
|
436598
|
+
async function call23(onDone, context5, args) {
|
|
436706
436599
|
logEvent("tengu_ext_ide_command", {});
|
|
436707
436600
|
const {
|
|
436708
436601
|
options: {
|
|
436709
436602
|
dynamicMcpConfig
|
|
436710
436603
|
},
|
|
436711
436604
|
onChangeDynamicMcpConfig
|
|
436712
|
-
} =
|
|
436605
|
+
} = context5;
|
|
436713
436606
|
if (args?.trim() === "open") {
|
|
436714
436607
|
const worktreeSession = getCurrentWorktreeSession();
|
|
436715
436608
|
const targetPath = worktreeSession ? worktreeSession.worktreePath : getCwd();
|
|
@@ -436749,11 +436642,11 @@ async function call23(onDone, context6, args) {
|
|
|
436749
436642
|
}, undefined, false, undefined, this);
|
|
436750
436643
|
}
|
|
436751
436644
|
const detectedIDEs = await detectIDEs(true);
|
|
436752
|
-
if (detectedIDEs.length === 0 &&
|
|
436645
|
+
if (detectedIDEs.length === 0 && context5.onInstallIDEExtension && !isSupportedTerminal()) {
|
|
436753
436646
|
const runningIDEs = await detectRunningIDEs();
|
|
436754
436647
|
const onInstall = (ide) => {
|
|
436755
|
-
if (
|
|
436756
|
-
|
|
436648
|
+
if (context5.onInstallIDEExtension) {
|
|
436649
|
+
context5.onInstallIDEExtension(ide);
|
|
436757
436650
|
if (isJetBrainsIde(ide)) {
|
|
436758
436651
|
onDone(t("ide_installed_plugin")(source_default.bold(toIDEDisplayName(ide))));
|
|
436759
436652
|
} else {
|
|
@@ -439917,7 +439810,7 @@ var init_SuccessStep = __esm(() => {
|
|
|
439917
439810
|
});
|
|
439918
439811
|
|
|
439919
439812
|
// src/commands/install-github-app/setupGitHubActions.ts
|
|
439920
|
-
async function createWorkflowFile(repoName, branchName, workflowPath, workflowContent, secretName, message,
|
|
439813
|
+
async function createWorkflowFile(repoName, branchName, workflowPath, workflowContent, secretName, message, context5) {
|
|
439921
439814
|
const checkFileResult = await execFileNoThrow("gh", [
|
|
439922
439815
|
"api",
|
|
439923
439816
|
`repos/${repoName}/contents/${workflowPath}`,
|
|
@@ -439956,14 +439849,14 @@ async function createWorkflowFile(repoName, branchName, workflowPath, workflowCo
|
|
|
439956
439849
|
logEvent("tengu_setup_github_actions_failed", {
|
|
439957
439850
|
reason: "failed_to_create_workflow_file",
|
|
439958
439851
|
exit_code: createFileResult.code,
|
|
439959
|
-
...
|
|
439852
|
+
...context5
|
|
439960
439853
|
});
|
|
439961
439854
|
throw new Error(`Failed to create workflow file ${workflowPath}: A Claude workflow file already exists in this repository. Please remove it first or update it manually.`);
|
|
439962
439855
|
}
|
|
439963
439856
|
logEvent("tengu_setup_github_actions_failed", {
|
|
439964
439857
|
reason: "failed_to_create_workflow_file",
|
|
439965
439858
|
exit_code: createFileResult.code,
|
|
439966
|
-
...
|
|
439859
|
+
...context5
|
|
439967
439860
|
});
|
|
439968
439861
|
const helpText = `
|
|
439969
439862
|
|
|
@@ -439974,7 +439867,7 @@ Need help? Common issues:
|
|
|
439974
439867
|
throw new Error(`Failed to create workflow file ${workflowPath}: ${createFileResult.stderr}${helpText}`);
|
|
439975
439868
|
}
|
|
439976
439869
|
}
|
|
439977
|
-
async function setupGitHubActions(repoName, apiKeyOrOAuthToken, secretName, updateProgress, skipWorkflow = false, selectedWorkflows, authType,
|
|
439870
|
+
async function setupGitHubActions(repoName, apiKeyOrOAuthToken, secretName, updateProgress, skipWorkflow = false, selectedWorkflows, authType, context5) {
|
|
439978
439871
|
try {
|
|
439979
439872
|
logEvent("tengu_setup_github_actions_started", {
|
|
439980
439873
|
skip_workflow: skipWorkflow,
|
|
@@ -439982,7 +439875,7 @@ async function setupGitHubActions(repoName, apiKeyOrOAuthToken, secretName, upda
|
|
|
439982
439875
|
using_default_secret_name: secretName === "ANTHROPIC_API_KEY",
|
|
439983
439876
|
selected_claude_workflow: selectedWorkflows.includes("claude"),
|
|
439984
439877
|
selected_claude_review_workflow: selectedWorkflows.includes("claude-review"),
|
|
439985
|
-
...
|
|
439878
|
+
...context5
|
|
439986
439879
|
});
|
|
439987
439880
|
const repoCheckResult = await execFileNoThrow("gh", [
|
|
439988
439881
|
"api",
|
|
@@ -439994,7 +439887,7 @@ async function setupGitHubActions(repoName, apiKeyOrOAuthToken, secretName, upda
|
|
|
439994
439887
|
logEvent("tengu_setup_github_actions_failed", {
|
|
439995
439888
|
reason: "repo_not_found",
|
|
439996
439889
|
exit_code: repoCheckResult.code,
|
|
439997
|
-
...
|
|
439890
|
+
...context5
|
|
439998
439891
|
});
|
|
439999
439892
|
throw new Error(`Failed to access repository ${repoName}: ${repoCheckResult.stderr}`);
|
|
440000
439893
|
}
|
|
@@ -440008,7 +439901,7 @@ async function setupGitHubActions(repoName, apiKeyOrOAuthToken, secretName, upda
|
|
|
440008
439901
|
logEvent("tengu_setup_github_actions_failed", {
|
|
440009
439902
|
reason: "failed_to_get_default_branch",
|
|
440010
439903
|
exit_code: defaultBranchResult.code,
|
|
440011
|
-
...
|
|
439904
|
+
...context5
|
|
440012
439905
|
});
|
|
440013
439906
|
throw new Error(`Failed to get default branch: ${defaultBranchResult.stderr}`);
|
|
440014
439907
|
}
|
|
@@ -440023,7 +439916,7 @@ async function setupGitHubActions(repoName, apiKeyOrOAuthToken, secretName, upda
|
|
|
440023
439916
|
logEvent("tengu_setup_github_actions_failed", {
|
|
440024
439917
|
reason: "failed_to_get_branch_sha",
|
|
440025
439918
|
exit_code: shaResult.code,
|
|
440026
|
-
...
|
|
439919
|
+
...context5
|
|
440027
439920
|
});
|
|
440028
439921
|
throw new Error(`Failed to get branch SHA: ${shaResult.stderr}`);
|
|
440029
439922
|
}
|
|
@@ -440046,7 +439939,7 @@ async function setupGitHubActions(repoName, apiKeyOrOAuthToken, secretName, upda
|
|
|
440046
439939
|
logEvent("tengu_setup_github_actions_failed", {
|
|
440047
439940
|
reason: "failed_to_create_branch",
|
|
440048
439941
|
exit_code: createBranchResult.code,
|
|
440049
|
-
...
|
|
439942
|
+
...context5
|
|
440050
439943
|
});
|
|
440051
439944
|
throw new Error(`Failed to create branch: ${createBranchResult.stderr}`);
|
|
440052
439945
|
}
|
|
@@ -440067,7 +439960,7 @@ async function setupGitHubActions(repoName, apiKeyOrOAuthToken, secretName, upda
|
|
|
440067
439960
|
});
|
|
440068
439961
|
}
|
|
440069
439962
|
for (const workflow of workflows) {
|
|
440070
|
-
await createWorkflowFile(repoName, branchName, workflow.path, workflow.content, secretName, workflow.message,
|
|
439963
|
+
await createWorkflowFile(repoName, branchName, workflow.path, workflow.content, secretName, workflow.message, context5);
|
|
440071
439964
|
}
|
|
440072
439965
|
}
|
|
440073
439966
|
updateProgress();
|
|
@@ -440085,7 +439978,7 @@ async function setupGitHubActions(repoName, apiKeyOrOAuthToken, secretName, upda
|
|
|
440085
439978
|
logEvent("tengu_setup_github_actions_failed", {
|
|
440086
439979
|
reason: "failed_to_set_api_key_secret",
|
|
440087
439980
|
exit_code: setSecretResult.code,
|
|
440088
|
-
...
|
|
439981
|
+
...context5
|
|
440089
439982
|
});
|
|
440090
439983
|
const helpText = `
|
|
440091
439984
|
|
|
@@ -440108,7 +440001,7 @@ Need help? Common issues:
|
|
|
440108
440001
|
using_default_secret_name: secretName === "ANTHROPIC_API_KEY",
|
|
440109
440002
|
selected_claude_workflow: selectedWorkflows.includes("claude"),
|
|
440110
440003
|
selected_claude_review_workflow: selectedWorkflows.includes("claude-review"),
|
|
440111
|
-
...
|
|
440004
|
+
...context5
|
|
440112
440005
|
});
|
|
440113
440006
|
saveGlobalConfig((current) => ({
|
|
440114
440007
|
...current,
|
|
@@ -440118,7 +440011,7 @@ Need help? Common issues:
|
|
|
440118
440011
|
if (!error42 || !(error42 instanceof Error) || !error42.message.includes("Failed to")) {
|
|
440119
440012
|
logEvent("tengu_setup_github_actions_failed", {
|
|
440120
440013
|
reason: "unexpected_error",
|
|
440121
|
-
...
|
|
440014
|
+
...context5
|
|
440122
440015
|
});
|
|
440123
440016
|
}
|
|
440124
440017
|
if (error42 instanceof Error) {
|
|
@@ -443072,18 +442965,18 @@ var init_useManageMCPConnections = __esm(() => {
|
|
|
443072
442965
|
|
|
443073
442966
|
// src/services/mcp/MCPConnectionManager.tsx
|
|
443074
442967
|
function useMcpReconnect() {
|
|
443075
|
-
const
|
|
443076
|
-
if (!
|
|
442968
|
+
const context5 = import_react132.useContext(MCPConnectionContext);
|
|
442969
|
+
if (!context5) {
|
|
443077
442970
|
throw new Error("useMcpReconnect must be used within MCPConnectionManager");
|
|
443078
442971
|
}
|
|
443079
|
-
return
|
|
442972
|
+
return context5.reconnectMcpServer;
|
|
443080
442973
|
}
|
|
443081
442974
|
function useMcpToggleEnabled() {
|
|
443082
|
-
const
|
|
443083
|
-
if (!
|
|
442975
|
+
const context5 = import_react132.useContext(MCPConnectionContext);
|
|
442976
|
+
if (!context5) {
|
|
443084
442977
|
throw new Error("useMcpToggleEnabled must be used within MCPConnectionManager");
|
|
443085
442978
|
}
|
|
443086
|
-
return
|
|
442979
|
+
return context5.toggleMcpServer;
|
|
443087
442980
|
}
|
|
443088
442981
|
function MCPConnectionManager(t0) {
|
|
443089
442982
|
const $2 = import_react_compiler_runtime173.c(6);
|
|
@@ -460556,7 +460449,7 @@ function createMovedToPluginCommand({
|
|
|
460556
460449
|
return name;
|
|
460557
460450
|
},
|
|
460558
460451
|
source: "builtin",
|
|
460559
|
-
async getPromptForCommand(args,
|
|
460452
|
+
async getPromptForCommand(args, context5) {
|
|
460560
460453
|
if (process.env.USER_TYPE === "ant") {
|
|
460561
460454
|
return [
|
|
460562
460455
|
{
|
|
@@ -460574,7 +460467,7 @@ Do not attempt to run the command. Simply inform the user about the plugin insta
|
|
|
460574
460467
|
}
|
|
460575
460468
|
];
|
|
460576
460469
|
}
|
|
460577
|
-
return getPromptWhileMarketplaceIsPrivate(args,
|
|
460470
|
+
return getPromptWhileMarketplaceIsPrivate(args, context5);
|
|
460578
460471
|
}
|
|
460579
460472
|
};
|
|
460580
460473
|
}
|
|
@@ -460755,7 +460648,7 @@ function getAllReleaseNotes(changelogContent = getStoredChangelogFromMemory()) {
|
|
|
460755
460648
|
return [];
|
|
460756
460649
|
}
|
|
460757
460650
|
}
|
|
460758
|
-
async function checkForReleaseNotes(lastSeenVersion, currentVersion = "0.
|
|
460651
|
+
async function checkForReleaseNotes(lastSeenVersion, currentVersion = "0.8.1") {
|
|
460759
460652
|
if (process.env.USER_TYPE === "ant") {
|
|
460760
460653
|
const changelog = MACRO.VERSION_CHANGELOG;
|
|
460761
460654
|
if (changelog) {
|
|
@@ -461334,14 +461227,14 @@ var exports_rename = {};
|
|
|
461334
461227
|
__export(exports_rename, {
|
|
461335
461228
|
call: () => call31
|
|
461336
461229
|
});
|
|
461337
|
-
async function call31(onDone,
|
|
461230
|
+
async function call31(onDone, context5, args) {
|
|
461338
461231
|
if (isTeammate()) {
|
|
461339
461232
|
onDone("Cannot rename: This session is a swarm teammate. Teammate names are set by the team leader.", { display: "system" });
|
|
461340
461233
|
return null;
|
|
461341
461234
|
}
|
|
461342
461235
|
let newName;
|
|
461343
461236
|
if (!args || args.trim() === "") {
|
|
461344
|
-
const generated = await generateSessionName(getMessagesAfterCompactBoundary(
|
|
461237
|
+
const generated = await generateSessionName(getMessagesAfterCompactBoundary(context5.messages), context5.abortController.signal);
|
|
461345
461238
|
if (!generated) {
|
|
461346
461239
|
onDone("Could not generate a name: no conversation context yet. Usage: /rename <name>", { display: "system" });
|
|
461347
461240
|
return null;
|
|
@@ -461353,7 +461246,7 @@ async function call31(onDone, context6, args) {
|
|
|
461353
461246
|
const sessionId = getSessionId();
|
|
461354
461247
|
const fullPath = getTranscriptPath();
|
|
461355
461248
|
await saveCustomTitle(sessionId, newName, fullPath);
|
|
461356
|
-
const appState =
|
|
461249
|
+
const appState = context5.getAppState();
|
|
461357
461250
|
const bridgeSessionId = appState.replBridgeSessionId;
|
|
461358
461251
|
if (bridgeSessionId) {
|
|
461359
461252
|
const tokenOverride = getBridgeTokenOverride();
|
|
@@ -461363,7 +461256,7 @@ async function call31(onDone, context6, args) {
|
|
|
461363
461256
|
}).catch(() => {}));
|
|
461364
461257
|
}
|
|
461365
461258
|
await saveAgentName(sessionId, newName, fullPath);
|
|
461366
|
-
|
|
461259
|
+
context5.setAppState((prev) => ({
|
|
461367
461260
|
...prev,
|
|
461368
461261
|
standaloneAgentContext: {
|
|
461369
461262
|
...prev.standaloneAgentContext,
|
|
@@ -462452,8 +462345,8 @@ var init_nullRenderingAttachments = __esm(() => {
|
|
|
462452
462345
|
|
|
462453
462346
|
// src/utils/statusNoticeDefinitions.tsx
|
|
462454
462347
|
import { relative as relative25 } from "path";
|
|
462455
|
-
function getActiveNotices(
|
|
462456
|
-
return statusNoticeDefinitions.filter((notice) => notice.isActive(
|
|
462348
|
+
function getActiveNotices(context5) {
|
|
462349
|
+
return statusNoticeDefinitions.filter((notice) => notice.isActive(context5));
|
|
462457
462350
|
}
|
|
462458
462351
|
var jsx_dev_runtime256, largeMemoryFilesNotice, claudeAiSubscriberExternalTokenNotice, apiKeyConflictNotice, bothAuthMethodsNotice, largeAgentDescriptionsNotice, jetbrainsPluginNotice, statusNoticeDefinitions;
|
|
462459
462352
|
var init_statusNoticeDefinitions = __esm(() => {
|
|
@@ -462655,12 +462548,12 @@ var init_statusNoticeDefinitions = __esm(() => {
|
|
|
462655
462548
|
largeAgentDescriptionsNotice = {
|
|
462656
462549
|
id: "large-agent-descriptions",
|
|
462657
462550
|
type: "warning",
|
|
462658
|
-
isActive: (
|
|
462659
|
-
const totalTokens = getAgentDescriptionsTotalTokens(
|
|
462551
|
+
isActive: (context5) => {
|
|
462552
|
+
const totalTokens = getAgentDescriptionsTotalTokens(context5.agentDefinitions);
|
|
462660
462553
|
return totalTokens > AGENT_DESCRIPTIONS_THRESHOLD;
|
|
462661
462554
|
},
|
|
462662
|
-
render: (
|
|
462663
|
-
const totalTokens = getAgentDescriptionsTotalTokens(
|
|
462555
|
+
render: (context5) => {
|
|
462556
|
+
const totalTokens = getAgentDescriptionsTotalTokens(context5.agentDefinitions);
|
|
462664
462557
|
return /* @__PURE__ */ jsx_dev_runtime256.jsxDEV(ThemedBox_default, {
|
|
462665
462558
|
flexDirection: "row",
|
|
462666
462559
|
children: [
|
|
@@ -462690,11 +462583,11 @@ var init_statusNoticeDefinitions = __esm(() => {
|
|
|
462690
462583
|
jetbrainsPluginNotice = {
|
|
462691
462584
|
id: "jetbrains-plugin-install",
|
|
462692
462585
|
type: "info",
|
|
462693
|
-
isActive: (
|
|
462586
|
+
isActive: (context5) => {
|
|
462694
462587
|
if (!isSupportedJetBrainsTerminal()) {
|
|
462695
462588
|
return false;
|
|
462696
462589
|
}
|
|
462697
|
-
const shouldAutoInstall =
|
|
462590
|
+
const shouldAutoInstall = context5.config.autoInstallIdeExtension ?? true;
|
|
462698
462591
|
if (!shouldAutoInstall) {
|
|
462699
462592
|
return false;
|
|
462700
462593
|
}
|
|
@@ -462770,12 +462663,12 @@ function StatusNotices(t0) {
|
|
|
462770
462663
|
}
|
|
462771
462664
|
React81.useEffect(t1, [t1]);
|
|
462772
462665
|
const t2 = getGlobalConfig();
|
|
462773
|
-
const
|
|
462666
|
+
const context5 = {
|
|
462774
462667
|
config: t2,
|
|
462775
462668
|
agentDefinitions,
|
|
462776
462669
|
memoryFiles
|
|
462777
462670
|
};
|
|
462778
|
-
const activeNotices = getActiveNotices(
|
|
462671
|
+
const activeNotices = getActiveNotices(context5);
|
|
462779
462672
|
if (activeNotices.length === 0) {
|
|
462780
462673
|
return null;
|
|
462781
462674
|
}
|
|
@@ -462783,7 +462676,7 @@ function StatusNotices(t0) {
|
|
|
462783
462676
|
const t3 = "column";
|
|
462784
462677
|
const t4 = 1;
|
|
462785
462678
|
const t5 = activeNotices.map((notice) => /* @__PURE__ */ jsx_dev_runtime257.jsxDEV(React81.Fragment, {
|
|
462786
|
-
children: notice.render(
|
|
462679
|
+
children: notice.render(context5)
|
|
462787
462680
|
}, notice.id, false, undefined, this));
|
|
462788
462681
|
let t6;
|
|
462789
462682
|
if ($2[1] !== T0 || $2[2] !== t5) {
|
|
@@ -468046,10 +467939,10 @@ function ResumeCommand({
|
|
|
468046
467939
|
function filterResumableSessions(logs2, currentSessionId) {
|
|
468047
467940
|
return logs2.filter((l) => !l.isSidechain && getSessionIdFromLog(l) !== currentSessionId);
|
|
468048
467941
|
}
|
|
468049
|
-
var import_react_compiler_runtime200, React88, jsx_dev_runtime266, call32 = async (onDone,
|
|
467942
|
+
var import_react_compiler_runtime200, React88, jsx_dev_runtime266, call32 = async (onDone, context5, args) => {
|
|
468050
467943
|
const onResume = async (sessionId, log, entrypoint) => {
|
|
468051
467944
|
try {
|
|
468052
|
-
await
|
|
467945
|
+
await context5.resume?.(sessionId, log, entrypoint);
|
|
468053
467946
|
onDone(undefined, {
|
|
468054
467947
|
display: "skip"
|
|
468055
467948
|
});
|
|
@@ -468244,7 +468137,7 @@ async function checkOverageGate() {
|
|
|
468244
468137
|
billingNote: " This review bills as Extra Usage."
|
|
468245
468138
|
};
|
|
468246
468139
|
}
|
|
468247
|
-
async function launchRemoteReview(args,
|
|
468140
|
+
async function launchRemoteReview(args, context5, billingNote) {
|
|
468248
468141
|
const eligibility = await checkRemoteAgentEligibility();
|
|
468249
468142
|
if (!eligibility.eligible) {
|
|
468250
468143
|
const blockers = eligibility.errors.filter((e2) => e2.type !== "no_remote_environment");
|
|
@@ -468298,7 +468191,7 @@ ${reasons}`
|
|
|
468298
468191
|
session = await teleportToRemote({
|
|
468299
468192
|
initialMessage: null,
|
|
468300
468193
|
description: `ultrareview: ${repo.owner}/${repo.name}#${prNumber}`,
|
|
468301
|
-
signal:
|
|
468194
|
+
signal: context5.abortController.signal,
|
|
468302
468195
|
branchName: `refs/pull/${prNumber}/head`,
|
|
468303
468196
|
environmentId: CODE_REVIEW_ENV_ID,
|
|
468304
468197
|
environmentVariables: {
|
|
@@ -468335,7 +468228,7 @@ ${reasons}`
|
|
|
468335
468228
|
session = await teleportToRemote({
|
|
468336
468229
|
initialMessage: null,
|
|
468337
468230
|
description: `ultrareview: ${baseBranch}`,
|
|
468338
|
-
signal:
|
|
468231
|
+
signal: context5.abortController.signal,
|
|
468339
468232
|
useBundle: true,
|
|
468340
468233
|
environmentId: CODE_REVIEW_ENV_ID,
|
|
468341
468234
|
environmentVariables: {
|
|
@@ -468363,7 +468256,7 @@ ${reasons}`
|
|
|
468363
468256
|
remoteTaskType: "ultrareview",
|
|
468364
468257
|
session,
|
|
468365
468258
|
command: command5,
|
|
468366
|
-
context:
|
|
468259
|
+
context: context5,
|
|
468367
468260
|
isRemoteReview: true
|
|
468368
468261
|
});
|
|
468369
468262
|
logEvent("tengu_review_remote_launched", {});
|
|
@@ -468515,8 +468408,8 @@ function contentBlocksToString(blocks) {
|
|
|
468515
468408
|
return blocks.map((b) => b.type === "text" ? b.text : "").filter(Boolean).join(`
|
|
468516
468409
|
`);
|
|
468517
468410
|
}
|
|
468518
|
-
async function launchAndDone(args,
|
|
468519
|
-
const result = await launchRemoteReview(args,
|
|
468411
|
+
async function launchAndDone(args, context5, onDone, billingNote, signal) {
|
|
468412
|
+
const result = await launchRemoteReview(args, context5, billingNote);
|
|
468520
468413
|
if (signal?.aborted)
|
|
468521
468414
|
return;
|
|
468522
468415
|
if (result) {
|
|
@@ -468529,7 +468422,7 @@ async function launchAndDone(args, context6, onDone, billingNote, signal) {
|
|
|
468529
468422
|
});
|
|
468530
468423
|
}
|
|
468531
468424
|
}
|
|
468532
|
-
var jsx_dev_runtime268, call33 = async (onDone,
|
|
468425
|
+
var jsx_dev_runtime268, call33 = async (onDone, context5, args) => {
|
|
468533
468426
|
const gate = await checkOverageGate();
|
|
468534
468427
|
if (gate.kind === "not-enabled") {
|
|
468535
468428
|
onDone("Free ultrareviews used. Enable Extra Usage at https://claude.ai/settings/billing to continue.", {
|
|
@@ -468546,7 +468439,7 @@ var jsx_dev_runtime268, call33 = async (onDone, context6, args) => {
|
|
|
468546
468439
|
if (gate.kind === "needs-confirm") {
|
|
468547
468440
|
return /* @__PURE__ */ jsx_dev_runtime268.jsxDEV(UltrareviewOverageDialog, {
|
|
468548
468441
|
onProceed: async (signal) => {
|
|
468549
|
-
await launchAndDone(args,
|
|
468442
|
+
await launchAndDone(args, context5, onDone, " This review bills as Extra Usage.", signal);
|
|
468550
468443
|
if (!signal.aborted)
|
|
468551
468444
|
confirmOverage();
|
|
468552
468445
|
},
|
|
@@ -468555,7 +468448,7 @@ var jsx_dev_runtime268, call33 = async (onDone, context6, args) => {
|
|
|
468555
468448
|
})
|
|
468556
468449
|
}, undefined, false, undefined, this);
|
|
468557
468450
|
}
|
|
468558
|
-
await launchAndDone(args,
|
|
468451
|
+
await launchAndDone(args, context5, onDone, gate.billingNote);
|
|
468559
468452
|
return null;
|
|
468560
468453
|
};
|
|
468561
468454
|
var init_ultrareviewCommand = __esm(() => {
|
|
@@ -469159,10 +469052,10 @@ var exports_skills2 = {};
|
|
|
469159
469052
|
__export(exports_skills2, {
|
|
469160
469053
|
call: () => call35
|
|
469161
469054
|
});
|
|
469162
|
-
async function call35(onDone,
|
|
469055
|
+
async function call35(onDone, context5) {
|
|
469163
469056
|
return /* @__PURE__ */ jsx_dev_runtime271.jsxDEV(SkillsMenu, {
|
|
469164
469057
|
onExit: onDone,
|
|
469165
|
-
commands:
|
|
469058
|
+
commands: context5.options.commands
|
|
469166
469059
|
}, undefined, false, undefined, this);
|
|
469167
469060
|
}
|
|
469168
469061
|
var jsx_dev_runtime271;
|
|
@@ -469189,10 +469082,10 @@ var exports_status = {};
|
|
|
469189
469082
|
__export(exports_status, {
|
|
469190
469083
|
call: () => call36
|
|
469191
469084
|
});
|
|
469192
|
-
async function call36(onDone,
|
|
469085
|
+
async function call36(onDone, context5) {
|
|
469193
469086
|
return /* @__PURE__ */ jsx_dev_runtime272.jsxDEV(Settings, {
|
|
469194
469087
|
onClose: onDone,
|
|
469195
|
-
context:
|
|
469088
|
+
context: context5,
|
|
469196
469089
|
defaultTab: "Status"
|
|
469197
469090
|
}, undefined, false, undefined, this);
|
|
469198
469091
|
}
|
|
@@ -469807,14 +469700,14 @@ ${reasons}`,
|
|
|
469807
469700
|
} : prev);
|
|
469808
469701
|
}
|
|
469809
469702
|
}
|
|
469810
|
-
var ULTRAPLAN_TIMEOUT_MS, CCR_TERMS_URL = "https://code.claude.com/docs/en/claude-code-on-the-web", _rawPrompt, DEFAULT_INSTRUCTIONS, ULTRAPLAN_INSTRUCTIONS, call37 = async (onDone,
|
|
469703
|
+
var ULTRAPLAN_TIMEOUT_MS, CCR_TERMS_URL = "https://code.claude.com/docs/en/claude-code-on-the-web", _rawPrompt, DEFAULT_INSTRUCTIONS, ULTRAPLAN_INSTRUCTIONS, call37 = async (onDone, context5, args) => {
|
|
469811
469704
|
const blurb = args.trim();
|
|
469812
469705
|
if (!blurb) {
|
|
469813
469706
|
const msg = await launchUltraplan({
|
|
469814
469707
|
blurb,
|
|
469815
|
-
getAppState:
|
|
469816
|
-
setAppState:
|
|
469817
|
-
signal:
|
|
469708
|
+
getAppState: context5.getAppState,
|
|
469709
|
+
setAppState: context5.setAppState,
|
|
469710
|
+
signal: context5.abortController.signal
|
|
469818
469711
|
});
|
|
469819
469712
|
onDone(msg, {
|
|
469820
469713
|
display: "system"
|
|
@@ -469824,7 +469717,7 @@ var ULTRAPLAN_TIMEOUT_MS, CCR_TERMS_URL = "https://code.claude.com/docs/en/claud
|
|
|
469824
469717
|
const {
|
|
469825
469718
|
ultraplanSessionUrl: active,
|
|
469826
469719
|
ultraplanLaunching
|
|
469827
|
-
} =
|
|
469720
|
+
} = context5.getAppState();
|
|
469828
469721
|
if (active || ultraplanLaunching) {
|
|
469829
469722
|
logEvent("tengu_ultraplan_create_failed", {
|
|
469830
469723
|
reason: active ? "already_polling" : "already_launching"
|
|
@@ -469834,7 +469727,7 @@ var ULTRAPLAN_TIMEOUT_MS, CCR_TERMS_URL = "https://code.claude.com/docs/en/claud
|
|
|
469834
469727
|
});
|
|
469835
469728
|
return null;
|
|
469836
469729
|
}
|
|
469837
|
-
|
|
469730
|
+
context5.setAppState((prev) => ({
|
|
469838
469731
|
...prev,
|
|
469839
469732
|
ultraplanLaunchPending: {
|
|
469840
469733
|
blurb
|
|
@@ -473864,9 +473757,9 @@ var exports_MonitorMcpDetailDialog = {};
|
|
|
473864
473757
|
__export(exports_MonitorMcpDetailDialog, {
|
|
473865
473758
|
default: () => MonitorMcpDetailDialog_default
|
|
473866
473759
|
});
|
|
473867
|
-
var
|
|
473760
|
+
var noop20 = () => null, MonitorMcpDetailDialog_default;
|
|
473868
473761
|
var init_MonitorMcpDetailDialog = __esm(() => {
|
|
473869
|
-
MonitorMcpDetailDialog_default =
|
|
473762
|
+
MonitorMcpDetailDialog_default = noop20;
|
|
473870
473763
|
});
|
|
473871
473764
|
|
|
473872
473765
|
// src/components/tasks/BackgroundTasksDialog.tsx
|
|
@@ -474661,9 +474554,9 @@ var exports_tasks = {};
|
|
|
474661
474554
|
__export(exports_tasks, {
|
|
474662
474555
|
call: () => call38
|
|
474663
474556
|
});
|
|
474664
|
-
async function call38(onDone,
|
|
474557
|
+
async function call38(onDone, context5) {
|
|
474665
474558
|
return /* @__PURE__ */ jsx_dev_runtime283.jsxDEV(BackgroundTasksDialog, {
|
|
474666
|
-
toolUseContext:
|
|
474559
|
+
toolUseContext: context5,
|
|
474667
474560
|
onDone
|
|
474668
474561
|
}, undefined, false, undefined, this);
|
|
474669
474562
|
}
|
|
@@ -474896,13 +474789,13 @@ var init_security_review = __esm(() => {
|
|
|
474896
474789
|
progressMessage: t("progress_analyzing_security"),
|
|
474897
474790
|
pluginName: "security-review",
|
|
474898
474791
|
pluginCommand: "security-review",
|
|
474899
|
-
async getPromptWhileMarketplaceIsPrivate(_args,
|
|
474792
|
+
async getPromptWhileMarketplaceIsPrivate(_args, context5) {
|
|
474900
474793
|
const parsed = parseFrontmatter(SECURITY_REVIEW_MARKDOWN);
|
|
474901
474794
|
const allowedTools = parseSlashCommandToolsFromFrontmatter(parsed.frontmatter["allowed-tools"]);
|
|
474902
474795
|
const processedContent = await executeShellCommandsInPrompt(parsed.content, {
|
|
474903
|
-
...
|
|
474796
|
+
...context5,
|
|
474904
474797
|
getAppState() {
|
|
474905
|
-
const appState =
|
|
474798
|
+
const appState = context5.getAppState();
|
|
474906
474799
|
return {
|
|
474907
474800
|
...appState,
|
|
474908
474801
|
toolPermissionContext: {
|
|
@@ -474957,10 +474850,10 @@ var exports_usage = {};
|
|
|
474957
474850
|
__export(exports_usage, {
|
|
474958
474851
|
call: () => call39
|
|
474959
474852
|
});
|
|
474960
|
-
var jsx_dev_runtime284, call39 = async (onDone,
|
|
474853
|
+
var jsx_dev_runtime284, call39 = async (onDone, context5) => {
|
|
474961
474854
|
return /* @__PURE__ */ jsx_dev_runtime284.jsxDEV(Settings, {
|
|
474962
474855
|
onClose: onDone,
|
|
474963
|
-
context:
|
|
474856
|
+
context: context5,
|
|
474964
474857
|
defaultTab: "Usage"
|
|
474965
474858
|
}, undefined, false, undefined, this);
|
|
474966
474859
|
};
|
|
@@ -478205,11 +478098,11 @@ var exports_permissions = {};
|
|
|
478205
478098
|
__export(exports_permissions, {
|
|
478206
478099
|
call: () => call44
|
|
478207
478100
|
});
|
|
478208
|
-
var jsx_dev_runtime294, call44 = async (onDone,
|
|
478101
|
+
var jsx_dev_runtime294, call44 = async (onDone, context5) => {
|
|
478209
478102
|
return /* @__PURE__ */ jsx_dev_runtime294.jsxDEV(PermissionRuleList, {
|
|
478210
478103
|
onExit: onDone,
|
|
478211
478104
|
onRetryDenials: (commands) => {
|
|
478212
|
-
|
|
478105
|
+
context5.setMessages((prev) => [...prev, createPermissionRetryMessage(commands)]);
|
|
478213
478106
|
}
|
|
478214
478107
|
}, undefined, false, undefined, this);
|
|
478215
478108
|
};
|
|
@@ -478324,11 +478217,11 @@ function PlanDisplay(t0) {
|
|
|
478324
478217
|
}
|
|
478325
478218
|
return t5;
|
|
478326
478219
|
}
|
|
478327
|
-
async function call45(onDone,
|
|
478220
|
+
async function call45(onDone, context5, args) {
|
|
478328
478221
|
const {
|
|
478329
478222
|
getAppState,
|
|
478330
478223
|
setAppState
|
|
478331
|
-
} =
|
|
478224
|
+
} = context5;
|
|
478332
478225
|
const appState = getAppState();
|
|
478333
478226
|
const currentMode = appState.toolPermissionContext.mode;
|
|
478334
478227
|
if (currentMode !== "plan") {
|
|
@@ -478774,14 +478667,14 @@ async function handleFastModeShortcut(enable, getAppState, setAppState) {
|
|
|
478774
478667
|
return `Fast mode OFF`;
|
|
478775
478668
|
}
|
|
478776
478669
|
}
|
|
478777
|
-
async function call46(onDone,
|
|
478670
|
+
async function call46(onDone, context5, args) {
|
|
478778
478671
|
if (!isFastModeEnabled()) {
|
|
478779
478672
|
return null;
|
|
478780
478673
|
}
|
|
478781
478674
|
await prefetchFastModeStatus();
|
|
478782
478675
|
const arg = args?.trim().toLowerCase();
|
|
478783
478676
|
if (arg === "on" || arg === "off") {
|
|
478784
|
-
const result = await handleFastModeShortcut(arg === "on",
|
|
478677
|
+
const result = await handleFastModeShortcut(arg === "on", context5.getAppState, context5.setAppState);
|
|
478785
478678
|
onDone(result);
|
|
478786
478679
|
return null;
|
|
478787
478680
|
}
|
|
@@ -483136,9 +483029,9 @@ var exports_hooks = {};
|
|
|
483136
483029
|
__export(exports_hooks, {
|
|
483137
483030
|
call: () => call50
|
|
483138
483031
|
});
|
|
483139
|
-
var jsx_dev_runtime308, call50 = async (onDone,
|
|
483032
|
+
var jsx_dev_runtime308, call50 = async (onDone, context5) => {
|
|
483140
483033
|
logEvent("tengu_hooks_command", {});
|
|
483141
|
-
const appState =
|
|
483034
|
+
const appState = context5.getAppState();
|
|
483142
483035
|
const permissionContext = appState.toolPermissionContext;
|
|
483143
483036
|
const toolNames = getTools(permissionContext).map((tool) => tool.name);
|
|
483144
483037
|
return /* @__PURE__ */ jsx_dev_runtime308.jsxDEV(HooksConfigMenu, {
|
|
@@ -483172,8 +483065,8 @@ __export(exports_files2, {
|
|
|
483172
483065
|
call: () => call51
|
|
483173
483066
|
});
|
|
483174
483067
|
import { relative as relative26 } from "path";
|
|
483175
|
-
async function call51(_args,
|
|
483176
|
-
const files =
|
|
483068
|
+
async function call51(_args, context5) {
|
|
483069
|
+
const files = context5.readFileState ? cacheKeys(context5.readFileState) : [];
|
|
483177
483070
|
if (files.length === 0) {
|
|
483178
483071
|
return { type: "text", value: "No files in context" };
|
|
483179
483072
|
}
|
|
@@ -483312,7 +483205,7 @@ async function getUniqueForkName(baseName) {
|
|
|
483312
483205
|
}
|
|
483313
483206
|
return `${baseName} (Branch ${nextNumber})`;
|
|
483314
483207
|
}
|
|
483315
|
-
async function call52(onDone,
|
|
483208
|
+
async function call52(onDone, context5, args) {
|
|
483316
483209
|
const customTitle = args?.trim() || undefined;
|
|
483317
483210
|
const originalSessionId = getSessionId();
|
|
483318
483211
|
try {
|
|
@@ -483349,8 +483242,8 @@ async function call52(onDone, context6, args) {
|
|
|
483349
483242
|
const titleInfo = title ? ` "${title}"` : "";
|
|
483350
483243
|
const resumeHint = t("cmd_branch_resume_hint")(originalSessionId);
|
|
483351
483244
|
const successMessage = t("cmd_branch_success")(titleInfo, resumeHint);
|
|
483352
|
-
if (
|
|
483353
|
-
await
|
|
483245
|
+
if (context5.resume) {
|
|
483246
|
+
await context5.resume(sessionId, forkLog, "fork");
|
|
483354
483247
|
onDone(successMessage, { display: "system" });
|
|
483355
483248
|
} else {
|
|
483356
483249
|
onDone(t("cmd_branch_success_fallback")(titleInfo, sessionId));
|
|
@@ -486019,11 +485912,11 @@ var init_WizardProvider = __esm(() => {
|
|
|
486019
485912
|
|
|
486020
485913
|
// src/components/wizard/useWizard.ts
|
|
486021
485914
|
function useWizard() {
|
|
486022
|
-
const
|
|
486023
|
-
if (!
|
|
485915
|
+
const context5 = import_react178.useContext(WizardContext);
|
|
485916
|
+
if (!context5) {
|
|
486024
485917
|
throw new Error("useWizard must be used within a WizardProvider");
|
|
486025
485918
|
}
|
|
486026
|
-
return
|
|
485919
|
+
return context5;
|
|
486027
485920
|
}
|
|
486028
485921
|
var import_react178;
|
|
486029
485922
|
var init_useWizard = __esm(() => {
|
|
@@ -489374,8 +489267,8 @@ var exports_agents = {};
|
|
|
489374
489267
|
__export(exports_agents, {
|
|
489375
489268
|
call: () => call53
|
|
489376
489269
|
});
|
|
489377
|
-
async function call53(onDone,
|
|
489378
|
-
const appState =
|
|
489270
|
+
async function call53(onDone, context5) {
|
|
489271
|
+
const appState = context5.getAppState();
|
|
489379
489272
|
const permissionContext = appState.toolPermissionContext;
|
|
489380
489273
|
const tools = getTools(permissionContext);
|
|
489381
489274
|
return /* @__PURE__ */ jsx_dev_runtime333.jsxDEV(AgentsMenu, {
|
|
@@ -489631,9 +489524,9 @@ __export(exports_reload_plugins, {
|
|
|
489631
489524
|
function n2(count4, noun) {
|
|
489632
489525
|
return `${count4} ${plural(count4, noun)}`;
|
|
489633
489526
|
}
|
|
489634
|
-
var call55 = async (_args,
|
|
489527
|
+
var call55 = async (_args, context5) => {
|
|
489635
489528
|
if (false) {}
|
|
489636
|
-
const r = await refreshActivePlugins(
|
|
489529
|
+
const r = await refreshActivePlugins(context5.setAppState);
|
|
489637
489530
|
const parts = [
|
|
489638
489531
|
n2(r.enabled_count, "plugin"),
|
|
489639
489532
|
n2(r.command_count, "skill"),
|
|
@@ -489677,9 +489570,9 @@ var exports_rewind = {};
|
|
|
489677
489570
|
__export(exports_rewind, {
|
|
489678
489571
|
call: () => call56
|
|
489679
489572
|
});
|
|
489680
|
-
async function call56(_args,
|
|
489681
|
-
if (
|
|
489682
|
-
|
|
489573
|
+
async function call56(_args, context5) {
|
|
489574
|
+
if (context5.openMessageSelector) {
|
|
489575
|
+
context5.openMessageSelector();
|
|
489683
489576
|
}
|
|
489684
489577
|
return { type: "skip" };
|
|
489685
489578
|
}
|
|
@@ -489793,7 +489686,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
|
|
|
489793
489686
|
smapsRollup,
|
|
489794
489687
|
platform: process.platform,
|
|
489795
489688
|
nodeVersion: process.version,
|
|
489796
|
-
ccVersion: "0.
|
|
489689
|
+
ccVersion: "0.8.1"
|
|
489797
489690
|
};
|
|
489798
489691
|
}
|
|
489799
489692
|
async function performHeapDump(trigger = "manual", dumpNumber = 0) {
|
|
@@ -489938,28 +489831,28 @@ function createBridgeApiClient(deps) {
|
|
|
489938
489831
|
}
|
|
489939
489832
|
return accessToken;
|
|
489940
489833
|
}
|
|
489941
|
-
async function withOAuthRetry(fn,
|
|
489834
|
+
async function withOAuthRetry(fn, context5) {
|
|
489942
489835
|
const accessToken = resolveAuth();
|
|
489943
489836
|
const response = await fn(accessToken);
|
|
489944
489837
|
if (response.status !== 401) {
|
|
489945
489838
|
return response;
|
|
489946
489839
|
}
|
|
489947
489840
|
if (!deps.onAuth401) {
|
|
489948
|
-
debug(`[bridge:api] ${
|
|
489841
|
+
debug(`[bridge:api] ${context5}: 401 received, no refresh handler`);
|
|
489949
489842
|
return response;
|
|
489950
489843
|
}
|
|
489951
|
-
debug(`[bridge:api] ${
|
|
489844
|
+
debug(`[bridge:api] ${context5}: 401 received, attempting token refresh`);
|
|
489952
489845
|
const refreshed = await deps.onAuth401(accessToken);
|
|
489953
489846
|
if (refreshed) {
|
|
489954
|
-
debug(`[bridge:api] ${
|
|
489847
|
+
debug(`[bridge:api] ${context5}: Token refreshed, retrying request`);
|
|
489955
489848
|
const newToken = resolveAuth();
|
|
489956
489849
|
const retryResponse = await fn(newToken);
|
|
489957
489850
|
if (retryResponse.status !== 401) {
|
|
489958
489851
|
return retryResponse;
|
|
489959
489852
|
}
|
|
489960
|
-
debug(`[bridge:api] ${
|
|
489853
|
+
debug(`[bridge:api] ${context5}: Retry after refresh also got 401`);
|
|
489961
489854
|
} else {
|
|
489962
|
-
debug(`[bridge:api] ${
|
|
489855
|
+
debug(`[bridge:api] ${context5}: Token refresh failed`);
|
|
489963
489856
|
}
|
|
489964
489857
|
return response;
|
|
489965
489858
|
}
|
|
@@ -490100,7 +489993,7 @@ function createBridgeApiClient(deps) {
|
|
|
490100
489993
|
}
|
|
490101
489994
|
};
|
|
490102
489995
|
}
|
|
490103
|
-
function handleErrorStatus(status2, data,
|
|
489996
|
+
function handleErrorStatus(status2, data, context5) {
|
|
490104
489997
|
if (status2 === 200 || status2 === 204) {
|
|
490105
489998
|
return;
|
|
490106
489999
|
}
|
|
@@ -490108,17 +490001,17 @@ function handleErrorStatus(status2, data, context6) {
|
|
|
490108
490001
|
const errorType = extractErrorTypeFromData(data);
|
|
490109
490002
|
switch (status2) {
|
|
490110
490003
|
case 401:
|
|
490111
|
-
throw new BridgeFatalError(`${
|
|
490004
|
+
throw new BridgeFatalError(`${context5}: Authentication failed (401)${detail ? `: ${detail}` : ""}. ${BRIDGE_LOGIN_INSTRUCTION}`, 401, errorType);
|
|
490112
490005
|
case 403:
|
|
490113
|
-
throw new BridgeFatalError(isExpiredErrorType(errorType) ? "Remote Control session has expired. Please restart with `claude remote-control` or /remote-control." : `${
|
|
490006
|
+
throw new BridgeFatalError(isExpiredErrorType(errorType) ? "Remote Control session has expired. Please restart with `claude remote-control` or /remote-control." : `${context5}: Access denied (403)${detail ? `: ${detail}` : ""}. Check your organization permissions.`, 403, errorType);
|
|
490114
490007
|
case 404:
|
|
490115
|
-
throw new BridgeFatalError(detail ?? `${
|
|
490008
|
+
throw new BridgeFatalError(detail ?? `${context5}: Not found (404). Remote Control may not be available for this organization.`, 404, errorType);
|
|
490116
490009
|
case 410:
|
|
490117
490010
|
throw new BridgeFatalError(detail ?? "Remote Control session has expired. Please restart with `claude remote-control` or /remote-control.", 410, errorType ?? "environment_expired");
|
|
490118
490011
|
case 429:
|
|
490119
|
-
throw new Error(`${
|
|
490012
|
+
throw new Error(`${context5}: Rate limited (429). Polling too frequently.`);
|
|
490120
490013
|
default:
|
|
490121
|
-
throw new Error(`${
|
|
490014
|
+
throw new Error(`${context5}: Failed with status ${status2}${detail ? `: ${detail}` : ""}`);
|
|
490122
490015
|
}
|
|
490123
490016
|
}
|
|
490124
490017
|
function isExpiredErrorType(errorType) {
|
|
@@ -490185,12 +490078,12 @@ function wrapApiForFaultInjection(api2) {
|
|
|
490185
490078
|
faultQueue.splice(idx, 1);
|
|
490186
490079
|
return fault;
|
|
490187
490080
|
}
|
|
490188
|
-
function throwFault(fault,
|
|
490189
|
-
logForDebugging(`[bridge:debug] Injecting ${fault.kind} fault into ${
|
|
490081
|
+
function throwFault(fault, context5) {
|
|
490082
|
+
logForDebugging(`[bridge:debug] Injecting ${fault.kind} fault into ${context5}: status=${fault.status} errorType=${fault.errorType ?? "none"}`);
|
|
490190
490083
|
if (fault.kind === "fatal") {
|
|
490191
|
-
throw new BridgeFatalError(`[injected] ${
|
|
490084
|
+
throw new BridgeFatalError(`[injected] ${context5} ${fault.status}`, fault.status, fault.errorType);
|
|
490192
490085
|
}
|
|
490193
|
-
throw new Error(`[injected transient] ${
|
|
490086
|
+
throw new Error(`[injected transient] ${context5} ${fault.status}`);
|
|
490194
490087
|
}
|
|
490195
490088
|
return {
|
|
490196
490089
|
...api2,
|
|
@@ -490380,7 +490273,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
490380
490273
|
var call59 = async () => {
|
|
490381
490274
|
return {
|
|
490382
490275
|
type: "text",
|
|
490383
|
-
value: `${"0.
|
|
490276
|
+
value: `${"0.8.1"} (built ${"2026-05-05T02:00:44.916Z"})`
|
|
490384
490277
|
};
|
|
490385
490278
|
}, version2, version_default;
|
|
490386
490279
|
var init_version = __esm(() => {
|
|
@@ -490890,11 +490783,11 @@ var init_summary = __esm(() => {
|
|
|
490890
490783
|
});
|
|
490891
490784
|
|
|
490892
490785
|
// src/commands/reset-limits/index.js
|
|
490893
|
-
var
|
|
490786
|
+
var stub5, resetLimits, resetLimitsNonInteractive;
|
|
490894
490787
|
var init_reset_limits = __esm(() => {
|
|
490895
|
-
|
|
490896
|
-
resetLimits =
|
|
490897
|
-
resetLimitsNonInteractive =
|
|
490788
|
+
stub5 = { isEnabled: () => false, isHidden: true, name: "stub" };
|
|
490789
|
+
resetLimits = stub5;
|
|
490790
|
+
resetLimitsNonInteractive = stub5;
|
|
490898
490791
|
});
|
|
490899
490792
|
|
|
490900
490793
|
// src/commands/ant-trace/index.js
|
|
@@ -492231,7 +492124,7 @@ function shouldAutoEnableClaudeInChrome() {
|
|
|
492231
492124
|
}
|
|
492232
492125
|
function setupClaudeInChrome() {
|
|
492233
492126
|
const isNativeBuild = isInBundledMode();
|
|
492234
|
-
const allowedTools =
|
|
492127
|
+
const allowedTools = ZEROCLI_BROWSER_TOOLS.map((toolName) => `mcp__claude-in-chrome__${toolName}`);
|
|
492235
492128
|
const env4 = {};
|
|
492236
492129
|
if (getSessionBypassPermissionsMode()) {
|
|
492237
492130
|
env4.CLAUDE_CHROME_PERMISSION_MODE = "skip_all_permission_checks";
|
|
@@ -492402,7 +492295,7 @@ async function isChromeExtensionInstalled() {
|
|
|
492402
492295
|
}
|
|
492403
492296
|
var CHROME_EXTENSION_RECONNECT_URL = "https://clau.de/chrome/reconnect", ZEROCLI_EXTENSION_ID2 = "ccmaidbdaocjoeceanhlkafcokhmiolf", NATIVE_HOST_IDENTIFIER = "com.duheso.zerocli_browser_extension", NATIVE_HOST_MANIFEST_NAME, shouldAutoEnable = undefined;
|
|
492404
492297
|
var init_setup2 = __esm(() => {
|
|
492405
|
-
|
|
492298
|
+
init_zeroCLIMcpServer();
|
|
492406
492299
|
init_state();
|
|
492407
492300
|
init_growthbook();
|
|
492408
492301
|
init_config();
|
|
@@ -493024,11 +492917,11 @@ var init_validateModel = __esm(() => {
|
|
|
493024
492917
|
});
|
|
493025
492918
|
|
|
493026
492919
|
// src/commands/advisor.ts
|
|
493027
|
-
var call64 = async (args,
|
|
492920
|
+
var call64 = async (args, context5) => {
|
|
493028
492921
|
const arg = args.trim().toLowerCase();
|
|
493029
|
-
const baseModel = parseUserSpecifiedModel(
|
|
492922
|
+
const baseModel = parseUserSpecifiedModel(context5.getAppState().mainLoopModel ?? getDefaultMainLoopModelSetting());
|
|
493030
492923
|
if (!arg) {
|
|
493031
|
-
const current =
|
|
492924
|
+
const current = context5.getAppState().advisorModel;
|
|
493032
492925
|
if (!current) {
|
|
493033
492926
|
return {
|
|
493034
492927
|
type: "text",
|
|
@@ -493050,8 +492943,8 @@ Use "/advisor unset" to disable or "/advisor <model>" to change.`
|
|
|
493050
492943
|
};
|
|
493051
492944
|
}
|
|
493052
492945
|
if (arg === "unset" || arg === "off") {
|
|
493053
|
-
const prev =
|
|
493054
|
-
|
|
492946
|
+
const prev = context5.getAppState().advisorModel;
|
|
492947
|
+
context5.setAppState((s) => {
|
|
493055
492948
|
if (s.advisorModel === undefined)
|
|
493056
492949
|
return s;
|
|
493057
492950
|
return { ...s, advisorModel: undefined };
|
|
@@ -493077,7 +492970,7 @@ Use "/advisor unset" to disable or "/advisor <model>" to change.`
|
|
|
493077
492970
|
value: `The model ${arg} (${resolvedModel}) cannot be used as an advisor`
|
|
493078
492971
|
};
|
|
493079
492972
|
}
|
|
493080
|
-
|
|
492973
|
+
context5.setAppState((s) => {
|
|
493081
492974
|
if (s.advisorModel === normalizedModel)
|
|
493082
492975
|
return s;
|
|
493083
492976
|
return { ...s, advisorModel: normalizedModel };
|
|
@@ -493861,12 +493754,12 @@ function extractFirstPrompt(messages) {
|
|
|
493861
493754
|
function sanitizeFilename(text) {
|
|
493862
493755
|
return text.toLowerCase().replace(/[^a-z0-9\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
493863
493756
|
}
|
|
493864
|
-
async function exportWithReactRenderer(
|
|
493865
|
-
const tools =
|
|
493866
|
-
return renderMessagesToPlainText(
|
|
493757
|
+
async function exportWithReactRenderer(context5) {
|
|
493758
|
+
const tools = context5.options.tools || [];
|
|
493759
|
+
return renderMessagesToPlainText(context5.messages, tools);
|
|
493867
493760
|
}
|
|
493868
|
-
async function call66(onDone,
|
|
493869
|
-
const content = await exportWithReactRenderer(
|
|
493761
|
+
async function call66(onDone, context5, args) {
|
|
493762
|
+
const content = await exportWithReactRenderer(context5);
|
|
493870
493763
|
const filename = args.trim();
|
|
493871
493764
|
if (filename) {
|
|
493872
493765
|
const finalFilename = filename.endsWith(".txt") ? filename : filename.replace(/\.[^.]+$/, "") + ".txt";
|
|
@@ -493883,7 +493776,7 @@ async function call66(onDone, context6, args) {
|
|
|
493883
493776
|
return null;
|
|
493884
493777
|
}
|
|
493885
493778
|
}
|
|
493886
|
-
const firstPrompt = extractFirstPrompt(
|
|
493779
|
+
const firstPrompt = extractFirstPrompt(context5.messages);
|
|
493887
493780
|
const timestamp = formatTimestamp(new Date);
|
|
493888
493781
|
let defaultFilename;
|
|
493889
493782
|
if (firstPrompt) {
|
|
@@ -495231,7 +495124,7 @@ var exports_upgrade = {};
|
|
|
495231
495124
|
__export(exports_upgrade, {
|
|
495232
495125
|
call: () => call71
|
|
495233
495126
|
});
|
|
495234
|
-
async function call71(onDone,
|
|
495127
|
+
async function call71(onDone, context5) {
|
|
495235
495128
|
try {
|
|
495236
495129
|
if (isClaudeAISubscriber()) {
|
|
495237
495130
|
const tokens = getClaudeAIOAuthTokens();
|
|
@@ -495252,7 +495145,7 @@ async function call71(onDone, context6) {
|
|
|
495252
495145
|
return /* @__PURE__ */ jsx_dev_runtime351.jsxDEV(Login, {
|
|
495253
495146
|
startingMessage: "Starting new login following /upgrade. Exit with Ctrl-C to use existing account.",
|
|
495254
495147
|
onDone: (success2) => {
|
|
495255
|
-
|
|
495148
|
+
context5.onChangeAPIKey();
|
|
495256
495149
|
onDone(success2 ? "Login successful" : "Login interrupted");
|
|
495257
495150
|
}
|
|
495258
495151
|
}, undefined, false, undefined, this);
|
|
@@ -495298,7 +495191,7 @@ function RateLimitOptionsMenu(t0) {
|
|
|
495298
495191
|
const $2 = import_react_compiler_runtime260.c(25);
|
|
495299
495192
|
const {
|
|
495300
495193
|
onDone,
|
|
495301
|
-
context:
|
|
495194
|
+
context: context5
|
|
495302
495195
|
} = t0;
|
|
495303
495196
|
const [subCommandJSX, setSubCommandJSX] = import_react190.useState(null);
|
|
495304
495197
|
const claudeAiLimits = useClaudeAiLimits();
|
|
@@ -495422,11 +495315,11 @@ function RateLimitOptionsMenu(t0) {
|
|
|
495422
495315
|
}
|
|
495423
495316
|
const handleCancel = t4;
|
|
495424
495317
|
let t5;
|
|
495425
|
-
if ($2[15] !==
|
|
495318
|
+
if ($2[15] !== context5 || $2[16] !== handleCancel || $2[17] !== onDone) {
|
|
495426
495319
|
t5 = function handleSelect2(value) {
|
|
495427
495320
|
if (value === "upgrade") {
|
|
495428
495321
|
logEvent("tengu_rate_limit_options_menu_select_upgrade", {});
|
|
495429
|
-
call71(onDone,
|
|
495322
|
+
call71(onDone, context5).then((jsx) => {
|
|
495430
495323
|
if (jsx) {
|
|
495431
495324
|
setSubCommandJSX(jsx);
|
|
495432
495325
|
}
|
|
@@ -495434,7 +495327,7 @@ function RateLimitOptionsMenu(t0) {
|
|
|
495434
495327
|
} else {
|
|
495435
495328
|
if (value === "extra-usage") {
|
|
495436
495329
|
logEvent("tengu_rate_limit_options_menu_select_extra_usage", {});
|
|
495437
|
-
call3(onDone,
|
|
495330
|
+
call3(onDone, context5).then((jsx_0) => {
|
|
495438
495331
|
if (jsx_0) {
|
|
495439
495332
|
setSubCommandJSX(jsx_0);
|
|
495440
495333
|
}
|
|
@@ -495446,7 +495339,7 @@ function RateLimitOptionsMenu(t0) {
|
|
|
495446
495339
|
}
|
|
495447
495340
|
}
|
|
495448
495341
|
};
|
|
495449
|
-
$2[15] =
|
|
495342
|
+
$2[15] = context5;
|
|
495450
495343
|
$2[16] = handleCancel;
|
|
495451
495344
|
$2[17] = onDone;
|
|
495452
495345
|
$2[18] = t5;
|
|
@@ -495486,10 +495379,10 @@ function RateLimitOptionsMenu(t0) {
|
|
|
495486
495379
|
}
|
|
495487
495380
|
return t7;
|
|
495488
495381
|
}
|
|
495489
|
-
async function call72(onDone,
|
|
495382
|
+
async function call72(onDone, context5) {
|
|
495490
495383
|
return /* @__PURE__ */ jsx_dev_runtime352.jsxDEV(RateLimitOptionsMenu, {
|
|
495491
495384
|
onDone,
|
|
495492
|
-
context:
|
|
495385
|
+
context: context5
|
|
495493
495386
|
}, undefined, false, undefined, this);
|
|
495494
495387
|
}
|
|
495495
495388
|
var import_react_compiler_runtime260, import_react190, jsx_dev_runtime352;
|
|
@@ -495942,26 +495835,26 @@ var init_effort3 = __esm(() => {
|
|
|
495942
495835
|
});
|
|
495943
495836
|
|
|
495944
495837
|
// native-stub:asciichart
|
|
495945
|
-
var
|
|
495838
|
+
var noop21 = () => null, handler5, stub6, SandboxManager6, plot4;
|
|
495946
495839
|
var init_asciichart = __esm(() => {
|
|
495947
|
-
|
|
495840
|
+
handler5 = {
|
|
495948
495841
|
get(_, prop) {
|
|
495949
495842
|
if (prop === "__esModule")
|
|
495950
495843
|
return true;
|
|
495951
495844
|
if (prop === "default")
|
|
495952
|
-
return new Proxy({},
|
|
495845
|
+
return new Proxy({}, handler5);
|
|
495953
495846
|
if (prop === "ExportResultCode")
|
|
495954
495847
|
return { SUCCESS: 0, FAILED: 1 };
|
|
495955
495848
|
if (prop === "resourceFromAttributes")
|
|
495956
495849
|
return () => ({});
|
|
495957
495850
|
if (prop === "SandboxRuntimeConfigSchema")
|
|
495958
495851
|
return { parse: () => ({}) };
|
|
495959
|
-
return
|
|
495852
|
+
return noop21;
|
|
495960
495853
|
}
|
|
495961
495854
|
};
|
|
495962
|
-
|
|
495963
|
-
|
|
495964
|
-
|
|
495855
|
+
stub6 = new Proxy(noop21, handler5);
|
|
495856
|
+
SandboxManager6 = new Proxy({}, { get: () => noop21 });
|
|
495857
|
+
plot4 = noop21;
|
|
495965
495858
|
});
|
|
495966
495859
|
|
|
495967
495860
|
// src/utils/statsCache.ts
|
|
@@ -498528,7 +498421,7 @@ function generateTokenChart(dailyTokens, models, terminalWidth) {
|
|
|
498528
498421
|
if (series.length === 0) {
|
|
498529
498422
|
return null;
|
|
498530
498423
|
}
|
|
498531
|
-
const chart =
|
|
498424
|
+
const chart = plot4(series, {
|
|
498532
498425
|
height: 8,
|
|
498533
498426
|
colors: colors.slice(0, series.length),
|
|
498534
498427
|
format: (x3) => {
|
|
@@ -498898,9 +498791,9 @@ var exports_fork = {};
|
|
|
498898
498791
|
__export(exports_fork, {
|
|
498899
498792
|
default: () => fork_default
|
|
498900
498793
|
});
|
|
498901
|
-
var
|
|
498794
|
+
var noop22 = () => null, fork_default;
|
|
498902
498795
|
var init_fork = __esm(() => {
|
|
498903
|
-
fork_default =
|
|
498796
|
+
fork_default = noop22;
|
|
498904
498797
|
});
|
|
498905
498798
|
|
|
498906
498799
|
// src/commands/buddy/buddy.tsx
|
|
@@ -498934,8 +498827,8 @@ function createStoredCompanion() {
|
|
|
498934
498827
|
hatchedAt: Date.now()
|
|
498935
498828
|
};
|
|
498936
498829
|
}
|
|
498937
|
-
function setCompanionReaction(
|
|
498938
|
-
|
|
498830
|
+
function setCompanionReaction(context5, reaction, pet = false) {
|
|
498831
|
+
context5.setAppState((prev) => ({
|
|
498939
498832
|
...prev,
|
|
498940
498833
|
companionReaction: reaction,
|
|
498941
498834
|
companionPetAt: pet ? Date.now() : prev.companionPetAt
|
|
@@ -498944,7 +498837,7 @@ function setCompanionReaction(context6, reaction, pet = false) {
|
|
|
498944
498837
|
function showHelp(onDone) {
|
|
498945
498838
|
onDone(t("cmd_buddy_usage"), { display: "system" });
|
|
498946
498839
|
}
|
|
498947
|
-
async function call75(onDone,
|
|
498840
|
+
async function call75(onDone, context5, args) {
|
|
498948
498841
|
const arg = args?.trim().toLowerCase() ?? "";
|
|
498949
498842
|
if (COMMON_HELP_ARGS.includes(arg) || arg === "") {
|
|
498950
498843
|
const existing = getCompanion();
|
|
@@ -498977,7 +498870,7 @@ async function call75(onDone, context6, args) {
|
|
|
498977
498870
|
companionMuted: muted
|
|
498978
498871
|
}));
|
|
498979
498872
|
if (muted) {
|
|
498980
|
-
setCompanionReaction(
|
|
498873
|
+
setCompanionReaction(context5, undefined);
|
|
498981
498874
|
}
|
|
498982
498875
|
onDone(muted ? t("cmd_buddy_muted") : t("cmd_buddy_unmuted"), { display: "system" });
|
|
498983
498876
|
return null;
|
|
@@ -498998,12 +498891,12 @@ async function call75(onDone, context6, args) {
|
|
|
498998
498891
|
...rollWithSeed(`${companionUserId()}:buddy`).bones,
|
|
498999
498892
|
...stored
|
|
499000
498893
|
};
|
|
499001
|
-
setCompanionReaction(
|
|
498894
|
+
setCompanionReaction(context5, `${companion.name} the ${companion.species} has hatched.`, true);
|
|
499002
498895
|
onDone(`${companion.name} the ${companion.species} is now your buddy. Run /buddy again to pet them.`, { display: "system" });
|
|
499003
498896
|
return null;
|
|
499004
498897
|
}
|
|
499005
498898
|
const reaction = `${companion.name} ${pickDeterministic(PET_REACTIONS, `${Date.now()}:${companion.name}`)}`;
|
|
499006
|
-
setCompanionReaction(
|
|
498899
|
+
setCompanionReaction(context5, reaction, true);
|
|
499007
498900
|
onDone(undefined, { display: "skip" });
|
|
499008
498901
|
return null;
|
|
499009
498902
|
}
|
|
@@ -500542,7 +500435,7 @@ function generateHtmlReport(data, insights) {
|
|
|
500542
500435
|
</html>`;
|
|
500543
500436
|
}
|
|
500544
500437
|
function buildExportData(data, insights, facets) {
|
|
500545
|
-
const version3 = typeof MACRO !== "undefined" ? "0.
|
|
500438
|
+
const version3 = typeof MACRO !== "undefined" ? "0.8.1" : "unknown";
|
|
500546
500439
|
const facets_summary = {
|
|
500547
500440
|
total: facets.size,
|
|
500548
500441
|
goal_categories: {},
|
|
@@ -501398,11 +501291,11 @@ var init_commands2 = __esm(() => {
|
|
|
501398
501291
|
contentLength: 0,
|
|
501399
501292
|
progressMessage: "analyzing your sessions",
|
|
501400
501293
|
source: "builtin",
|
|
501401
|
-
async getPromptForCommand(args,
|
|
501294
|
+
async getPromptForCommand(args, context5) {
|
|
501402
501295
|
const real = (await Promise.resolve().then(() => (init_insights(), exports_insights))).default;
|
|
501403
501296
|
if (real.type !== "prompt")
|
|
501404
501297
|
throw new Error("unreachable");
|
|
501405
|
-
return real.getPromptForCommand(args,
|
|
501298
|
+
return real.getPromptForCommand(args, context5);
|
|
501406
501299
|
}
|
|
501407
501300
|
};
|
|
501408
501301
|
INTERNAL_ONLY_COMMANDS2 = [
|
|
@@ -501450,7 +501343,7 @@ var init_commands2 = __esm(() => {
|
|
|
501450
501343
|
config_default,
|
|
501451
501344
|
copy_default,
|
|
501452
501345
|
desktop_default,
|
|
501453
|
-
|
|
501346
|
+
context4,
|
|
501454
501347
|
contextNonInteractive,
|
|
501455
501348
|
cost_default,
|
|
501456
501349
|
diff_default,
|
|
@@ -504732,7 +504625,7 @@ var init_sessionStorage = __esm(() => {
|
|
|
504732
504625
|
init_settings2();
|
|
504733
504626
|
init_slowOperations();
|
|
504734
504627
|
init_uuid();
|
|
504735
|
-
VERSION7 = typeof MACRO !== "undefined" ? "0.
|
|
504628
|
+
VERSION7 = typeof MACRO !== "undefined" ? "0.8.1" : "unknown";
|
|
504736
504629
|
MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
|
|
504737
504630
|
SKIP_FIRST_PROMPT_PATTERN = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
|
|
504738
504631
|
EPHEMERAL_PROGRESS_TYPES = new Set([
|
|
@@ -505385,10 +505278,10 @@ function checkPathSafetyForAutoEdit(path21, precomputedPathsToCheck) {
|
|
|
505385
505278
|
}
|
|
505386
505279
|
return { safe: true };
|
|
505387
505280
|
}
|
|
505388
|
-
function allWorkingDirectories(
|
|
505281
|
+
function allWorkingDirectories(context5) {
|
|
505389
505282
|
return new Set([
|
|
505390
505283
|
getOriginalCwd(),
|
|
505391
|
-
...
|
|
505284
|
+
...context5.additionalWorkingDirectories.keys()
|
|
505392
505285
|
]);
|
|
505393
505286
|
}
|
|
505394
505287
|
function pathInAllowedWorkingPath(path21, toolPermissionContext, precomputedPathsToCheck) {
|
|
@@ -506042,7 +505935,7 @@ var init_filesystem = __esm(() => {
|
|
|
506042
505935
|
});
|
|
506043
505936
|
getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
|
|
506044
505937
|
const nonce = randomBytes17(16).toString("hex");
|
|
506045
|
-
return join136(getClaudeTempDir(), "bundled-skills", "0.
|
|
505938
|
+
return join136(getClaudeTempDir(), "bundled-skills", "0.8.1", nonce);
|
|
506046
505939
|
});
|
|
506047
505940
|
getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
|
|
506048
505941
|
});
|
|
@@ -507311,12 +507204,12 @@ var init_ssrfGuard2 = () => {};
|
|
|
507311
507204
|
|
|
507312
507205
|
// src/utils/hooks/execHttpHook.ts
|
|
507313
507206
|
async function getSandboxProxyConfig() {
|
|
507314
|
-
const { SandboxManager:
|
|
507315
|
-
if (!
|
|
507207
|
+
const { SandboxManager: SandboxManager7 } = await Promise.resolve().then(() => (init_sandbox_adapter(), exports_sandbox_adapter));
|
|
507208
|
+
if (!SandboxManager7.isSandboxingEnabled()) {
|
|
507316
507209
|
return;
|
|
507317
507210
|
}
|
|
507318
|
-
await
|
|
507319
|
-
const proxyPort =
|
|
507211
|
+
await SandboxManager7.waitForNetworkInitialization();
|
|
507212
|
+
const proxyPort = SandboxManager7.getProxyPort();
|
|
507320
507213
|
if (!proxyPort) {
|
|
507321
507214
|
return;
|
|
507322
507215
|
}
|
|
@@ -509587,13 +509480,13 @@ async function* executeHooks({
|
|
|
509587
509480
|
});
|
|
509588
509481
|
} else {
|
|
509589
509482
|
const batchStartTime2 = Date.now();
|
|
509590
|
-
const
|
|
509483
|
+
const context5 = toolUseContext ? {
|
|
509591
509484
|
getAppState: toolUseContext.getAppState,
|
|
509592
509485
|
updateAttributionState: toolUseContext.updateAttributionState
|
|
509593
509486
|
} : undefined;
|
|
509594
509487
|
for (const [i3, { hook }] of matchingHooks.entries()) {
|
|
509595
509488
|
if (hook.type === "callback") {
|
|
509596
|
-
await hook.callback(hookInput, toolUseID, signal, i3,
|
|
509489
|
+
await hook.callback(hookInput, toolUseID, signal, i3, context5);
|
|
509597
509490
|
}
|
|
509598
509491
|
}
|
|
509599
509492
|
const totalDurationMs2 = Date.now() - batchStartTime2;
|
|
@@ -511316,11 +511209,11 @@ async function executeHookCallback({
|
|
|
511316
511209
|
hookIndex,
|
|
511317
511210
|
toolUseContext
|
|
511318
511211
|
}) {
|
|
511319
|
-
const
|
|
511212
|
+
const context5 = toolUseContext ? {
|
|
511320
511213
|
getAppState: toolUseContext.getAppState,
|
|
511321
511214
|
updateAttributionState: toolUseContext.updateAttributionState
|
|
511322
511215
|
} : undefined;
|
|
511323
|
-
const json2 = await hook.callback(hookInput, toolUseID, signal, hookIndex,
|
|
511216
|
+
const json2 = await hook.callback(hookInput, toolUseID, signal, hookIndex, context5);
|
|
511324
511217
|
if (isLocalAsyncHook(json2)) {
|
|
511325
511218
|
return {
|
|
511326
511219
|
outcome: "success",
|
|
@@ -512358,9 +512251,9 @@ var exports_cachedMCConfig = {};
|
|
|
512358
512251
|
__export(exports_cachedMCConfig, {
|
|
512359
512252
|
default: () => cachedMCConfig_default
|
|
512360
512253
|
});
|
|
512361
|
-
var
|
|
512254
|
+
var noop23 = () => null, cachedMCConfig_default;
|
|
512362
512255
|
var init_cachedMCConfig = __esm(() => {
|
|
512363
|
-
cachedMCConfig_default =
|
|
512256
|
+
cachedMCConfig_default = noop23;
|
|
512364
512257
|
});
|
|
512365
512258
|
|
|
512366
512259
|
// src/constants/prompts.ts
|
|
@@ -512824,6 +512717,22 @@ var init_prompts4 = __esm(() => {
|
|
|
512824
512717
|
};
|
|
512825
512718
|
});
|
|
512826
512719
|
|
|
512720
|
+
// src/utils/claudeInChrome/mcpServer.ts
|
|
512721
|
+
var exports_mcpServer = {};
|
|
512722
|
+
__export(exports_mcpServer, {
|
|
512723
|
+
runClaudeInChromeMcpServer: () => runClaudeInChromeMcpServer
|
|
512724
|
+
});
|
|
512725
|
+
async function runClaudeInChromeMcpServer() {
|
|
512726
|
+
enableConfigs();
|
|
512727
|
+
logForDebugging("[ZeroCLI Chrome] Starting MCP server");
|
|
512728
|
+
await runZeroCLIChromeMcpServer();
|
|
512729
|
+
}
|
|
512730
|
+
var init_mcpServer = __esm(() => {
|
|
512731
|
+
init_config();
|
|
512732
|
+
init_debug();
|
|
512733
|
+
init_zeroCLIMcpServer();
|
|
512734
|
+
});
|
|
512735
|
+
|
|
512827
512736
|
// src/utils/claudeInChrome/chromeNativeHost.ts
|
|
512828
512737
|
var exports_chromeNativeHost = {};
|
|
512829
512738
|
__export(exports_chromeNativeHost, {
|
|
@@ -514876,16 +514785,16 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
514876
514785
|
}
|
|
514877
514786
|
_getHelpContext(contextOptions) {
|
|
514878
514787
|
contextOptions = contextOptions || {};
|
|
514879
|
-
const
|
|
514788
|
+
const context5 = { error: !!contextOptions.error };
|
|
514880
514789
|
let write;
|
|
514881
|
-
if (
|
|
514790
|
+
if (context5.error) {
|
|
514882
514791
|
write = (arg) => this._outputConfiguration.writeErr(arg);
|
|
514883
514792
|
} else {
|
|
514884
514793
|
write = (arg) => this._outputConfiguration.writeOut(arg);
|
|
514885
514794
|
}
|
|
514886
|
-
|
|
514887
|
-
|
|
514888
|
-
return
|
|
514795
|
+
context5.write = contextOptions.write || write;
|
|
514796
|
+
context5.command = this;
|
|
514797
|
+
return context5;
|
|
514889
514798
|
}
|
|
514890
514799
|
outputHelp(contextOptions) {
|
|
514891
514800
|
let deprecatedCallback;
|
|
@@ -514893,22 +514802,22 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
514893
514802
|
deprecatedCallback = contextOptions;
|
|
514894
514803
|
contextOptions = undefined;
|
|
514895
514804
|
}
|
|
514896
|
-
const
|
|
514897
|
-
this._getCommandAndAncestors().reverse().forEach((command9) => command9.emit("beforeAllHelp",
|
|
514898
|
-
this.emit("beforeHelp",
|
|
514899
|
-
let helpInformation = this.helpInformation(
|
|
514805
|
+
const context5 = this._getHelpContext(contextOptions);
|
|
514806
|
+
this._getCommandAndAncestors().reverse().forEach((command9) => command9.emit("beforeAllHelp", context5));
|
|
514807
|
+
this.emit("beforeHelp", context5);
|
|
514808
|
+
let helpInformation = this.helpInformation(context5);
|
|
514900
514809
|
if (deprecatedCallback) {
|
|
514901
514810
|
helpInformation = deprecatedCallback(helpInformation);
|
|
514902
514811
|
if (typeof helpInformation !== "string" && !Buffer.isBuffer(helpInformation)) {
|
|
514903
514812
|
throw new Error("outputHelp callback must return a string or a Buffer");
|
|
514904
514813
|
}
|
|
514905
514814
|
}
|
|
514906
|
-
|
|
514815
|
+
context5.write(helpInformation);
|
|
514907
514816
|
if (this._getHelpOption()?.long) {
|
|
514908
514817
|
this.emit(this._getHelpOption().long);
|
|
514909
514818
|
}
|
|
514910
|
-
this.emit("afterHelp",
|
|
514911
|
-
this._getCommandAndAncestors().forEach((command9) => command9.emit("afterAllHelp",
|
|
514819
|
+
this.emit("afterHelp", context5);
|
|
514820
|
+
this._getCommandAndAncestors().forEach((command9) => command9.emit("afterAllHelp", context5));
|
|
514912
514821
|
}
|
|
514913
514822
|
helpOption(flags, description) {
|
|
514914
514823
|
if (typeof flags === "boolean") {
|
|
@@ -514949,15 +514858,15 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
514949
514858
|
Expecting one of '${allowedValues.join("', '")}'`);
|
|
514950
514859
|
}
|
|
514951
514860
|
const helpEvent = `${position}Help`;
|
|
514952
|
-
this.on(helpEvent, (
|
|
514861
|
+
this.on(helpEvent, (context5) => {
|
|
514953
514862
|
let helpStr;
|
|
514954
514863
|
if (typeof text === "function") {
|
|
514955
|
-
helpStr = text({ error:
|
|
514864
|
+
helpStr = text({ error: context5.error, command: context5.command });
|
|
514956
514865
|
} else {
|
|
514957
514866
|
helpStr = text;
|
|
514958
514867
|
}
|
|
514959
514868
|
if (helpStr) {
|
|
514960
|
-
|
|
514869
|
+
context5.write(`${helpStr}
|
|
514961
514870
|
`);
|
|
514962
514871
|
}
|
|
514963
514872
|
});
|
|
@@ -517045,7 +516954,7 @@ function buildSystemInitMessage(inputs) {
|
|
|
517045
516954
|
slash_commands: inputs.commands.filter((c6) => c6.userInvocable !== false).map((c6) => c6.name),
|
|
517046
516955
|
apiKeySource: getAnthropicApiKeyWithSource().source,
|
|
517047
516956
|
betas: getSdkBetas(),
|
|
517048
|
-
claude_code_version: "0.
|
|
516957
|
+
claude_code_version: "0.8.1",
|
|
517049
516958
|
output_style: outputStyle2,
|
|
517050
516959
|
agents: inputs.agents.map((agent2) => agent2.agentType),
|
|
517051
516960
|
skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill) => skill.name),
|
|
@@ -523712,8 +523621,8 @@ function useFilePermissionDialog({
|
|
|
523712
523621
|
toolUseConfirm.onAllow = (_input, permissionUpdates, feedback3) => {
|
|
523713
523622
|
originalOnAllow(input, permissionUpdates, feedback3);
|
|
523714
523623
|
};
|
|
523715
|
-
const
|
|
523716
|
-
|
|
523624
|
+
const handler6 = PERMISSION_HANDLERS[option.type];
|
|
523625
|
+
handler6(params, {
|
|
523717
523626
|
feedback: feedback2,
|
|
523718
523627
|
hasFeedback: !!feedback2,
|
|
523719
523628
|
enteredFeedbackMode: option.type === "accept-once" ? yesFeedbackModeEntered : noFeedbackModeEntered,
|
|
@@ -532360,7 +532269,7 @@ var init_useVoiceEnabled = __esm(() => {
|
|
|
532360
532269
|
function getSemverPart(version3) {
|
|
532361
532270
|
return `${import_semver10.major(version3, { loose: true })}.${import_semver10.minor(version3, { loose: true })}.${import_semver10.patch(version3, { loose: true })}`;
|
|
532362
532271
|
}
|
|
532363
|
-
function useUpdateNotification(updatedVersion, initialVersion = "0.
|
|
532272
|
+
function useUpdateNotification(updatedVersion, initialVersion = "0.8.1") {
|
|
532364
532273
|
const [lastNotifiedSemver, setLastNotifiedSemver] = import_react225.useState(() => getSemverPart(initialVersion));
|
|
532365
532274
|
if (!updatedVersion) {
|
|
532366
532275
|
return null;
|
|
@@ -532400,7 +532309,7 @@ function AutoUpdater({
|
|
|
532400
532309
|
return;
|
|
532401
532310
|
}
|
|
532402
532311
|
if (false) {}
|
|
532403
|
-
const currentVersion = "0.
|
|
532312
|
+
const currentVersion = "0.8.1";
|
|
532404
532313
|
const channel = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
532405
532314
|
let latestVersion = await getLatestVersion(channel);
|
|
532406
532315
|
const isDisabled = isAutoUpdaterDisabled();
|
|
@@ -532614,12 +532523,12 @@ function NativeAutoUpdater({
|
|
|
532614
532523
|
logEvent("tengu_native_auto_updater_start", {});
|
|
532615
532524
|
try {
|
|
532616
532525
|
const maxVersion = await getMaxVersion();
|
|
532617
|
-
if (maxVersion && gt("0.
|
|
532526
|
+
if (maxVersion && gt("0.8.1", maxVersion)) {
|
|
532618
532527
|
const msg = await getMaxVersionMessage();
|
|
532619
532528
|
setMaxVersionIssue(msg ?? "affects your version");
|
|
532620
532529
|
}
|
|
532621
532530
|
const result = await installLatest(channel);
|
|
532622
|
-
const currentVersion = "0.
|
|
532531
|
+
const currentVersion = "0.8.1";
|
|
532623
532532
|
const latencyMs = Date.now() - startTime;
|
|
532624
532533
|
if (result.lockFailed) {
|
|
532625
532534
|
logEvent("tengu_native_auto_updater_lock_contention", {
|
|
@@ -532753,17 +532662,17 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
532753
532662
|
const maxVersion = await getMaxVersion();
|
|
532754
532663
|
if (maxVersion && latest && gt(latest, maxVersion)) {
|
|
532755
532664
|
logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
|
|
532756
|
-
if (gte("0.
|
|
532757
|
-
logForDebugging(`PackageManagerAutoUpdater: current version ${"0.
|
|
532665
|
+
if (gte("0.8.1", maxVersion)) {
|
|
532666
|
+
logForDebugging(`PackageManagerAutoUpdater: current version ${"0.8.1"} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
532758
532667
|
setUpdateAvailable(false);
|
|
532759
532668
|
return;
|
|
532760
532669
|
}
|
|
532761
532670
|
latest = maxVersion;
|
|
532762
532671
|
}
|
|
532763
|
-
const hasUpdate = latest && !gte("0.
|
|
532672
|
+
const hasUpdate = latest && !gte("0.8.1", latest) && !shouldSkipVersion(latest);
|
|
532764
532673
|
setUpdateAvailable(!!hasUpdate);
|
|
532765
532674
|
if (hasUpdate) {
|
|
532766
|
-
logForDebugging(`PackageManagerAutoUpdater: Update available ${"0.
|
|
532675
|
+
logForDebugging(`PackageManagerAutoUpdater: Update available ${"0.8.1"} -> ${latest}`);
|
|
532767
532676
|
}
|
|
532768
532677
|
};
|
|
532769
532678
|
$2[0] = t1;
|
|
@@ -532797,7 +532706,7 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
532797
532706
|
wrap: "truncate",
|
|
532798
532707
|
children: [
|
|
532799
532708
|
"currentVersion: ",
|
|
532800
|
-
"0.
|
|
532709
|
+
"0.8.1"
|
|
532801
532710
|
]
|
|
532802
532711
|
}, undefined, true, undefined, this);
|
|
532803
532712
|
$2[3] = verbose;
|
|
@@ -540471,12 +540380,12 @@ function sendModeChangeToTeammate(teammateName, teamName, targetMode) {
|
|
|
540471
540380
|
}
|
|
540472
540381
|
function cycleTeammateMode(teammate, teamName, isBypassAvailable) {
|
|
540473
540382
|
const currentMode = teammate.mode ? permissionModeFromString(teammate.mode) : "default";
|
|
540474
|
-
const
|
|
540383
|
+
const context5 = {
|
|
540475
540384
|
...getEmptyToolPermissionContext(),
|
|
540476
540385
|
mode: currentMode,
|
|
540477
540386
|
isBypassPermissionsModeAvailable: isBypassAvailable
|
|
540478
540387
|
};
|
|
540479
|
-
const nextMode = getNextPermissionMode(
|
|
540388
|
+
const nextMode = getNextPermissionMode(context5);
|
|
540480
540389
|
sendModeChangeToTeammate(teammate.name, teamName, nextMode);
|
|
540481
540390
|
}
|
|
540482
540391
|
function cycleAllTeammateModes(teammates, teamName, isBypassAvailable) {
|
|
@@ -541827,7 +541736,7 @@ function buildStatusLineCommandInput(permissionMode, exceeds200kTokens, settings
|
|
|
541827
541736
|
project_dir: getOriginalCwd(),
|
|
541828
541737
|
added_dirs: addedDirs
|
|
541829
541738
|
},
|
|
541830
|
-
version: "0.
|
|
541739
|
+
version: "0.8.1",
|
|
541831
541740
|
output_style: {
|
|
541832
541741
|
name: outputStyleName
|
|
541833
541742
|
},
|
|
@@ -548255,98 +548164,98 @@ function useMoreRight(_args) {
|
|
|
548255
548164
|
// native-stub:cacache
|
|
548256
548165
|
var exports_cacache = {};
|
|
548257
548166
|
__export(exports_cacache, {
|
|
548258
|
-
trace: () =>
|
|
548259
|
-
resourceFromAttributes: () =>
|
|
548260
|
-
plot: () =>
|
|
548261
|
-
getSyntaxTheme: () =>
|
|
548262
|
-
getMcpConfigForManifest: () =>
|
|
548167
|
+
trace: () => trace5,
|
|
548168
|
+
resourceFromAttributes: () => resourceFromAttributes5,
|
|
548169
|
+
plot: () => plot5,
|
|
548170
|
+
getSyntaxTheme: () => getSyntaxTheme6,
|
|
548171
|
+
getMcpConfigForManifest: () => getMcpConfigForManifest4,
|
|
548263
548172
|
default: () => cacache_default,
|
|
548264
|
-
createClaudeForChromeMcpServer: () =>
|
|
548265
|
-
context: () =>
|
|
548266
|
-
__stub: () =>
|
|
548267
|
-
SpanStatusCode: () =>
|
|
548268
|
-
SimpleSpanProcessor: () =>
|
|
548269
|
-
SimpleLogRecordProcessor: () =>
|
|
548270
|
-
SeverityNumber: () =>
|
|
548271
|
-
SandboxViolationStore: () =>
|
|
548272
|
-
SandboxRuntimeConfigSchema: () =>
|
|
548273
|
-
SandboxManager: () =>
|
|
548274
|
-
SEMRESATTRS_SERVICE_VERSION: () =>
|
|
548275
|
-
SEMRESATTRS_SERVICE_NAME: () =>
|
|
548276
|
-
Resource: () =>
|
|
548277
|
-
PushMetricExporter: () =>
|
|
548278
|
-
PrometheusExporter: () =>
|
|
548279
|
-
PeriodicExportingMetricReader: () =>
|
|
548280
|
-
OTLPTraceExporter: () =>
|
|
548281
|
-
OTLPMetricExporter: () =>
|
|
548282
|
-
OTLPLogExporter: () =>
|
|
548283
|
-
NodeTracerProvider: () =>
|
|
548284
|
-
MeterProvider: () =>
|
|
548285
|
-
LoggerProvider: () =>
|
|
548286
|
-
InstrumentType: () =>
|
|
548287
|
-
ExportResultCode: () =>
|
|
548288
|
-
DataPointType: () =>
|
|
548289
|
-
ColorFile: () =>
|
|
548290
|
-
ColorDiff: () =>
|
|
548291
|
-
BatchSpanProcessor: () =>
|
|
548292
|
-
BatchLogRecordProcessor: () =>
|
|
548293
|
-
BasicTracerProvider: () =>
|
|
548294
|
-
BROWSER_TOOLS: () =>
|
|
548295
|
-
AggregationTemporality: () =>
|
|
548296
|
-
ATTR_SERVICE_VERSION: () =>
|
|
548297
|
-
ATTR_SERVICE_NAME: () =>
|
|
548298
|
-
});
|
|
548299
|
-
var
|
|
548300
|
-
},
|
|
548173
|
+
createClaudeForChromeMcpServer: () => createClaudeForChromeMcpServer4,
|
|
548174
|
+
context: () => context5,
|
|
548175
|
+
__stub: () => __stub4,
|
|
548176
|
+
SpanStatusCode: () => SpanStatusCode4,
|
|
548177
|
+
SimpleSpanProcessor: () => SimpleSpanProcessor4,
|
|
548178
|
+
SimpleLogRecordProcessor: () => SimpleLogRecordProcessor4,
|
|
548179
|
+
SeverityNumber: () => SeverityNumber4,
|
|
548180
|
+
SandboxViolationStore: () => SandboxViolationStore5,
|
|
548181
|
+
SandboxRuntimeConfigSchema: () => SandboxRuntimeConfigSchema5,
|
|
548182
|
+
SandboxManager: () => SandboxManager7,
|
|
548183
|
+
SEMRESATTRS_SERVICE_VERSION: () => SEMRESATTRS_SERVICE_VERSION4,
|
|
548184
|
+
SEMRESATTRS_SERVICE_NAME: () => SEMRESATTRS_SERVICE_NAME4,
|
|
548185
|
+
Resource: () => Resource4,
|
|
548186
|
+
PushMetricExporter: () => PushMetricExporter4,
|
|
548187
|
+
PrometheusExporter: () => PrometheusExporter4,
|
|
548188
|
+
PeriodicExportingMetricReader: () => PeriodicExportingMetricReader5,
|
|
548189
|
+
OTLPTraceExporter: () => OTLPTraceExporter4,
|
|
548190
|
+
OTLPMetricExporter: () => OTLPMetricExporter4,
|
|
548191
|
+
OTLPLogExporter: () => OTLPLogExporter4,
|
|
548192
|
+
NodeTracerProvider: () => NodeTracerProvider4,
|
|
548193
|
+
MeterProvider: () => MeterProvider5,
|
|
548194
|
+
LoggerProvider: () => LoggerProvider5,
|
|
548195
|
+
InstrumentType: () => InstrumentType4,
|
|
548196
|
+
ExportResultCode: () => ExportResultCode4,
|
|
548197
|
+
DataPointType: () => DataPointType4,
|
|
548198
|
+
ColorFile: () => ColorFile5,
|
|
548199
|
+
ColorDiff: () => ColorDiff5,
|
|
548200
|
+
BatchSpanProcessor: () => BatchSpanProcessor5,
|
|
548201
|
+
BatchLogRecordProcessor: () => BatchLogRecordProcessor5,
|
|
548202
|
+
BasicTracerProvider: () => BasicTracerProvider5,
|
|
548203
|
+
BROWSER_TOOLS: () => BROWSER_TOOLS4,
|
|
548204
|
+
AggregationTemporality: () => AggregationTemporality4,
|
|
548205
|
+
ATTR_SERVICE_VERSION: () => ATTR_SERVICE_VERSION5,
|
|
548206
|
+
ATTR_SERVICE_NAME: () => ATTR_SERVICE_NAME5
|
|
548207
|
+
});
|
|
548208
|
+
var noop24 = () => null, noopClass4 = class {
|
|
548209
|
+
}, handler6, stub7, cacache_default, __stub4 = true, SandboxViolationStore5 = null, SandboxManager7, SandboxRuntimeConfigSchema5, BROWSER_TOOLS4, getMcpConfigForManifest4, ColorDiff5 = null, ColorFile5 = null, getSyntaxTheme6, plot5, createClaudeForChromeMcpServer4, ExportResultCode4, resourceFromAttributes5, Resource4, SimpleSpanProcessor4, BatchSpanProcessor5, NodeTracerProvider4, BasicTracerProvider5, OTLPTraceExporter4, OTLPLogExporter4, OTLPMetricExporter4, PrometheusExporter4, LoggerProvider5, SimpleLogRecordProcessor4, BatchLogRecordProcessor5, MeterProvider5, PeriodicExportingMetricReader5, trace5, context5, SpanStatusCode4, ATTR_SERVICE_NAME5 = "service.name", ATTR_SERVICE_VERSION5 = "service.version", SEMRESATTRS_SERVICE_NAME4 = "service.name", SEMRESATTRS_SERVICE_VERSION4 = "service.version", AggregationTemporality4, DataPointType4, InstrumentType4, PushMetricExporter4, SeverityNumber4;
|
|
548301
548210
|
var init_cacache = __esm(() => {
|
|
548302
|
-
|
|
548211
|
+
handler6 = {
|
|
548303
548212
|
get(_, prop) {
|
|
548304
548213
|
if (prop === "__esModule")
|
|
548305
548214
|
return true;
|
|
548306
548215
|
if (prop === "default")
|
|
548307
|
-
return new Proxy({},
|
|
548216
|
+
return new Proxy({}, handler6);
|
|
548308
548217
|
if (prop === "ExportResultCode")
|
|
548309
548218
|
return { SUCCESS: 0, FAILED: 1 };
|
|
548310
548219
|
if (prop === "resourceFromAttributes")
|
|
548311
548220
|
return () => ({});
|
|
548312
548221
|
if (prop === "SandboxRuntimeConfigSchema")
|
|
548313
548222
|
return { parse: () => ({}) };
|
|
548314
|
-
return
|
|
548315
|
-
}
|
|
548316
|
-
};
|
|
548317
|
-
|
|
548318
|
-
cacache_default =
|
|
548319
|
-
|
|
548320
|
-
|
|
548321
|
-
|
|
548322
|
-
|
|
548323
|
-
|
|
548324
|
-
|
|
548325
|
-
|
|
548326
|
-
|
|
548327
|
-
|
|
548328
|
-
|
|
548329
|
-
|
|
548330
|
-
|
|
548331
|
-
|
|
548332
|
-
|
|
548333
|
-
|
|
548334
|
-
|
|
548335
|
-
|
|
548336
|
-
|
|
548337
|
-
|
|
548338
|
-
|
|
548339
|
-
|
|
548340
|
-
|
|
548341
|
-
|
|
548342
|
-
|
|
548343
|
-
|
|
548344
|
-
|
|
548345
|
-
|
|
548346
|
-
|
|
548347
|
-
|
|
548348
|
-
|
|
548349
|
-
|
|
548223
|
+
return noop24;
|
|
548224
|
+
}
|
|
548225
|
+
};
|
|
548226
|
+
stub7 = new Proxy(noop24, handler6);
|
|
548227
|
+
cacache_default = stub7;
|
|
548228
|
+
SandboxManager7 = new Proxy({}, { get: () => noop24 });
|
|
548229
|
+
SandboxRuntimeConfigSchema5 = { parse: () => ({}) };
|
|
548230
|
+
BROWSER_TOOLS4 = [];
|
|
548231
|
+
getMcpConfigForManifest4 = noop24;
|
|
548232
|
+
getSyntaxTheme6 = noop24;
|
|
548233
|
+
plot5 = noop24;
|
|
548234
|
+
createClaudeForChromeMcpServer4 = noop24;
|
|
548235
|
+
ExportResultCode4 = { SUCCESS: 0, FAILED: 1 };
|
|
548236
|
+
resourceFromAttributes5 = noop24;
|
|
548237
|
+
Resource4 = noopClass4;
|
|
548238
|
+
SimpleSpanProcessor4 = noopClass4;
|
|
548239
|
+
BatchSpanProcessor5 = noopClass4;
|
|
548240
|
+
NodeTracerProvider4 = noopClass4;
|
|
548241
|
+
BasicTracerProvider5 = noopClass4;
|
|
548242
|
+
OTLPTraceExporter4 = noopClass4;
|
|
548243
|
+
OTLPLogExporter4 = noopClass4;
|
|
548244
|
+
OTLPMetricExporter4 = noopClass4;
|
|
548245
|
+
PrometheusExporter4 = noopClass4;
|
|
548246
|
+
LoggerProvider5 = noopClass4;
|
|
548247
|
+
SimpleLogRecordProcessor4 = noopClass4;
|
|
548248
|
+
BatchLogRecordProcessor5 = noopClass4;
|
|
548249
|
+
MeterProvider5 = noopClass4;
|
|
548250
|
+
PeriodicExportingMetricReader5 = noopClass4;
|
|
548251
|
+
trace5 = { getTracer: () => ({ startSpan: () => ({ end: noop24, setAttribute: noop24, setStatus: noop24, recordException: noop24 }) }) };
|
|
548252
|
+
context5 = { active: noop24, with: (_, fn) => fn() };
|
|
548253
|
+
SpanStatusCode4 = { OK: 0, ERROR: 1, UNSET: 2 };
|
|
548254
|
+
AggregationTemporality4 = { CUMULATIVE: 0, DELTA: 1 };
|
|
548255
|
+
DataPointType4 = { HISTOGRAM: 0, SUM: 1, GAUGE: 2 };
|
|
548256
|
+
InstrumentType4 = { COUNTER: 0, HISTOGRAM: 1, UP_DOWN_COUNTER: 2 };
|
|
548257
|
+
PushMetricExporter4 = noopClass4;
|
|
548258
|
+
SeverityNumber4 = {};
|
|
548350
548259
|
});
|
|
548351
548260
|
|
|
548352
548261
|
// src/utils/cleanup.ts
|
|
@@ -549515,12 +549424,12 @@ var init_useBackgroundTaskNavigation = __esm(() => {
|
|
|
549515
549424
|
|
|
549516
549425
|
// src/utils/swarm/reconnection.ts
|
|
549517
549426
|
function computeInitialTeamContext() {
|
|
549518
|
-
const
|
|
549519
|
-
if (!
|
|
549427
|
+
const context6 = getDynamicTeamContext();
|
|
549428
|
+
if (!context6?.teamName || !context6?.agentName) {
|
|
549520
549429
|
logForDebugging("[Reconnection] computeInitialTeamContext: No teammate context set (not a teammate)");
|
|
549521
549430
|
return;
|
|
549522
549431
|
}
|
|
549523
|
-
const { teamName, agentId, agentName } =
|
|
549432
|
+
const { teamName, agentId, agentName } = context6;
|
|
549524
549433
|
const teamFile = readTeamFile(teamName);
|
|
549525
549434
|
if (!teamFile) {
|
|
549526
549435
|
logError2(new Error(`[computeInitialTeamContext] Could not read team file for ${teamName}`));
|
|
@@ -549658,12 +549567,12 @@ function useSwarmInitialization(setAppState, initialMessages, { enabled = true }
|
|
|
549658
549567
|
});
|
|
549659
549568
|
}
|
|
549660
549569
|
} else {
|
|
549661
|
-
const
|
|
549662
|
-
if (
|
|
549570
|
+
const context6 = getDynamicTeamContext?.();
|
|
549571
|
+
if (context6?.teamName && context6?.agentId && context6?.agentName) {
|
|
549663
549572
|
initializeTeammateHooks(setAppState, getSessionId(), {
|
|
549664
|
-
teamName:
|
|
549665
|
-
agentId:
|
|
549666
|
-
agentName:
|
|
549573
|
+
teamName: context6.teamName,
|
|
549574
|
+
agentId: context6.agentId,
|
|
549575
|
+
agentName: context6.agentName
|
|
549667
549576
|
});
|
|
549668
549577
|
}
|
|
549669
549578
|
}
|
|
@@ -550488,7 +550397,7 @@ __export(exports_processBashCommand, {
|
|
|
550488
550397
|
processBashCommand: () => processBashCommand
|
|
550489
550398
|
});
|
|
550490
550399
|
import { randomUUID as randomUUID41 } from "crypto";
|
|
550491
|
-
async function processBashCommand(inputString, precedingInputBlocks, attachmentMessages,
|
|
550400
|
+
async function processBashCommand(inputString, precedingInputBlocks, attachmentMessages, context6, setToolJSX) {
|
|
550492
550401
|
const usePowerShell = isPowerShellToolEnabled() && resolveDefaultShell() === "powershell";
|
|
550493
550402
|
logEvent("tengu_input_bash", {
|
|
550494
550403
|
powershell: usePowerShell
|
|
@@ -550504,13 +550413,13 @@ async function processBashCommand(inputString, precedingInputBlocks, attachmentM
|
|
|
550504
550413
|
jsx: /* @__PURE__ */ jsx_dev_runtime439.jsxDEV(BashModeProgress, {
|
|
550505
550414
|
input: inputString,
|
|
550506
550415
|
progress: null,
|
|
550507
|
-
verbose:
|
|
550416
|
+
verbose: context6.options.verbose
|
|
550508
550417
|
}, undefined, false, undefined, this),
|
|
550509
550418
|
shouldHidePromptInput: false
|
|
550510
550419
|
});
|
|
550511
550420
|
try {
|
|
550512
550421
|
const bashModeContext = {
|
|
550513
|
-
...
|
|
550422
|
+
...context6,
|
|
550514
550423
|
setToolJSX: (_) => {
|
|
550515
550424
|
jsx = _?.jsx;
|
|
550516
550425
|
}
|
|
@@ -550522,7 +550431,7 @@ async function processBashCommand(inputString, precedingInputBlocks, attachmentM
|
|
|
550522
550431
|
/* @__PURE__ */ jsx_dev_runtime439.jsxDEV(BashModeProgress, {
|
|
550523
550432
|
input: inputString,
|
|
550524
550433
|
progress: progress.data,
|
|
550525
|
-
verbose:
|
|
550434
|
+
verbose: context6.options.verbose
|
|
550526
550435
|
}, undefined, false, undefined, this),
|
|
550527
550436
|
jsx
|
|
550528
550437
|
]
|
|
@@ -550607,7 +550516,7 @@ async function processUserInput({
|
|
|
550607
550516
|
preExpansionInput,
|
|
550608
550517
|
mode,
|
|
550609
550518
|
setToolJSX,
|
|
550610
|
-
context:
|
|
550519
|
+
context: context6,
|
|
550611
550520
|
pastedContents,
|
|
550612
550521
|
ideSelection,
|
|
550613
550522
|
messages,
|
|
@@ -550626,15 +550535,15 @@ async function processUserInput({
|
|
|
550626
550535
|
setUserInputOnProcessing?.(inputString);
|
|
550627
550536
|
}
|
|
550628
550537
|
queryCheckpoint("query_process_user_input_base_start");
|
|
550629
|
-
const appState =
|
|
550630
|
-
const result = await processUserInputBase(input, mode, setToolJSX,
|
|
550538
|
+
const appState = context6.getAppState();
|
|
550539
|
+
const result = await processUserInputBase(input, mode, setToolJSX, context6, pastedContents, ideSelection, messages, uuid3, isAlreadyProcessing, querySource, canUseTool, appState.toolPermissionContext.mode, skipSlashCommands, bridgeOrigin, isMeta, skipAttachments, preExpansionInput);
|
|
550631
550540
|
queryCheckpoint("query_process_user_input_base_end");
|
|
550632
550541
|
if (!result.shouldQuery) {
|
|
550633
550542
|
return result;
|
|
550634
550543
|
}
|
|
550635
550544
|
queryCheckpoint("query_hooks_start");
|
|
550636
550545
|
const inputMessage = getContentText(input) || "";
|
|
550637
|
-
for await (const hookResult of executeUserPromptSubmitHooks(inputMessage, appState.toolPermissionContext.mode,
|
|
550546
|
+
for await (const hookResult of executeUserPromptSubmitHooks(inputMessage, appState.toolPermissionContext.mode, context6, context6.requestPrompt)) {
|
|
550638
550547
|
if (hookResult.message?.type === "progress") {
|
|
550639
550548
|
continue;
|
|
550640
550549
|
}
|
|
@@ -550696,7 +550605,7 @@ function applyTruncation(content) {
|
|
|
550696
550605
|
}
|
|
550697
550606
|
return content;
|
|
550698
550607
|
}
|
|
550699
|
-
async function processUserInputBase(input, mode, setToolJSX,
|
|
550608
|
+
async function processUserInputBase(input, mode, setToolJSX, context6, pastedContents, ideSelection, messages, uuid3, isAlreadyProcessing, querySource, canUseTool, permissionMode, skipSlashCommands, bridgeOrigin, isMeta, skipAttachments, preExpansionInput) {
|
|
550700
550609
|
let inputString = null;
|
|
550701
550610
|
let precedingInputBlocks = [];
|
|
550702
550611
|
const imageMetadataTexts = [];
|
|
@@ -550781,7 +550690,7 @@ async function processUserInputBase(input, mode, setToolJSX, context7, pastedCon
|
|
|
550781
550690
|
let effectiveSkipSlash = skipSlashCommands;
|
|
550782
550691
|
if (bridgeOrigin && inputString !== null && inputString.startsWith("/")) {
|
|
550783
550692
|
const parsed = parseSlashCommand(inputString);
|
|
550784
|
-
const cmd = parsed ? findCommand(parsed.commandName,
|
|
550693
|
+
const cmd = parsed ? findCommand(parsed.commandName, context6.options.commands) : undefined;
|
|
550785
550694
|
if (cmd) {
|
|
550786
550695
|
if (isBridgeSafeCommand(cmd)) {
|
|
550787
550696
|
effectiveSkipSlash = false;
|
|
@@ -550801,15 +550710,15 @@ async function processUserInputBase(input, mode, setToolJSX, context7, pastedCon
|
|
|
550801
550710
|
if (false) {}
|
|
550802
550711
|
const shouldExtractAttachments = !skipAttachments && inputString !== null && (mode !== "prompt" || effectiveSkipSlash || !inputString.startsWith("/"));
|
|
550803
550712
|
queryCheckpoint("query_attachment_loading_start");
|
|
550804
|
-
const attachmentMessages = shouldExtractAttachments ? await toArray2(getAttachmentMessages(inputString,
|
|
550713
|
+
const attachmentMessages = shouldExtractAttachments ? await toArray2(getAttachmentMessages(inputString, context6, ideSelection ?? null, [], messages, querySource)) : [];
|
|
550805
550714
|
queryCheckpoint("query_attachment_loading_end");
|
|
550806
550715
|
if (inputString !== null && mode === "bash") {
|
|
550807
550716
|
const { processBashCommand: processBashCommand2 } = await Promise.resolve().then(() => (init_processBashCommand(), exports_processBashCommand));
|
|
550808
|
-
return addImageMetadataMessage(await processBashCommand2(inputString, precedingInputBlocks, attachmentMessages,
|
|
550717
|
+
return addImageMetadataMessage(await processBashCommand2(inputString, precedingInputBlocks, attachmentMessages, context6, setToolJSX), imageMetadataTexts);
|
|
550809
550718
|
}
|
|
550810
550719
|
if (inputString !== null && !effectiveSkipSlash && inputString.startsWith("/")) {
|
|
550811
550720
|
const { processSlashCommand: processSlashCommand2 } = await Promise.resolve().then(() => (init_processSlashCommand(), exports_processSlashCommand));
|
|
550812
|
-
const slashResult = await processSlashCommand2(inputString, precedingInputBlocks, imageContentBlocks, attachmentMessages,
|
|
550721
|
+
const slashResult = await processSlashCommand2(inputString, precedingInputBlocks, imageContentBlocks, attachmentMessages, context6, setToolJSX, uuid3, isAlreadyProcessing, canUseTool);
|
|
550813
550722
|
return addImageMetadataMessage(slashResult, imageMetadataTexts);
|
|
550814
550723
|
}
|
|
550815
550724
|
if (inputString !== null && mode === "prompt") {
|
|
@@ -550942,7 +550851,7 @@ async function handlePromptSubmit(params) {
|
|
|
550942
550851
|
setCursorOffset(0);
|
|
550943
550852
|
setPastedContents({});
|
|
550944
550853
|
clearBuffer();
|
|
550945
|
-
const
|
|
550854
|
+
const context6 = getToolUseContext(messages, [], createAbortController(), mainLoopModel);
|
|
550946
550855
|
let doneWasCalled = false;
|
|
550947
550856
|
const onDone = (result, options2) => {
|
|
550948
550857
|
doneWasCalled = true;
|
|
@@ -550967,7 +550876,7 @@ async function handlePromptSubmit(params) {
|
|
|
550967
550876
|
}
|
|
550968
550877
|
};
|
|
550969
550878
|
const impl = await immediateCommand.load();
|
|
550970
|
-
const jsx = await impl.call(onDone,
|
|
550879
|
+
const jsx = await impl.call(onDone, context6, commandArgs);
|
|
550971
550880
|
if (jsx && !doneWasCalled) {
|
|
550972
550881
|
setToolJSX({
|
|
550973
550882
|
jsx,
|
|
@@ -552110,10 +552019,10 @@ function exitRestoredWorktree() {
|
|
|
552110
552019
|
setCwd(current.originalCwd);
|
|
552111
552020
|
setOriginalCwd(getCwd());
|
|
552112
552021
|
}
|
|
552113
|
-
async function processResumedConversation(result, opts,
|
|
552022
|
+
async function processResumedConversation(result, opts, context6) {
|
|
552114
552023
|
let modeWarning;
|
|
552115
552024
|
if (true) {
|
|
552116
|
-
modeWarning =
|
|
552025
|
+
modeWarning = context6.modeApi?.matchSessionMode(result.mode);
|
|
552117
552026
|
if (modeWarning) {
|
|
552118
552027
|
result.messages.push(createSystemMessage(modeWarning, "warning"));
|
|
552119
552028
|
}
|
|
@@ -552135,14 +552044,14 @@ async function processResumedConversation(result, opts, context7) {
|
|
|
552135
552044
|
adoptResumedSessionFile();
|
|
552136
552045
|
}
|
|
552137
552046
|
if (false) {}
|
|
552138
|
-
const { agentDefinition: restoredAgent, agentType: resumedAgentType } = restoreAgentFromSession(result.agentSetting,
|
|
552047
|
+
const { agentDefinition: restoredAgent, agentType: resumedAgentType } = restoreAgentFromSession(result.agentSetting, context6.mainThreadAgentDefinition, context6.agentDefinitions);
|
|
552139
552048
|
if (true) {
|
|
552140
|
-
saveMode(
|
|
552049
|
+
saveMode(context6.modeApi?.isCoordinatorMode() ? "coordinator" : "normal");
|
|
552141
552050
|
}
|
|
552142
552051
|
const restoredAttribution = opts.includeAttribution ? computeRestoredAttributionState(result) : undefined;
|
|
552143
552052
|
const standaloneAgentContext = computeStandaloneAgentContext(result.agentName, result.agentColor);
|
|
552144
552053
|
updateSessionName(result.agentName);
|
|
552145
|
-
const refreshedAgentDefs = await refreshAgentDefinitionsForModeSwitch(!!modeWarning,
|
|
552054
|
+
const refreshedAgentDefs = await refreshAgentDefinitionsForModeSwitch(!!modeWarning, context6.currentCwd, context6.cliAgents, context6.agentDefinitions);
|
|
552146
552055
|
return {
|
|
552147
552056
|
messages: result.messages,
|
|
552148
552057
|
fileHistorySnapshots: result.fileHistorySnapshots,
|
|
@@ -552151,7 +552060,7 @@ async function processResumedConversation(result, opts, context7) {
|
|
|
552151
552060
|
agentColor: result.agentColor === "default" ? undefined : result.agentColor,
|
|
552152
552061
|
restoredAgentDef: restoredAgent,
|
|
552153
552062
|
initialState: {
|
|
552154
|
-
...
|
|
552063
|
+
...context6.initialState,
|
|
552155
552064
|
...resumedAgentType && { agent: resumedAgentType },
|
|
552156
552065
|
...restoredAttribution && { attribution: restoredAttribution },
|
|
552157
552066
|
...standaloneAgentContext && { standaloneAgentContext },
|
|
@@ -555436,21 +555345,21 @@ async function isOfficialMarketplaceInstalled() {
|
|
|
555436
555345
|
_isOfficialMarketplaceInstalledCache = OFFICIAL_MARKETPLACE_NAME in config3;
|
|
555437
555346
|
return _isOfficialMarketplaceInstalledCache;
|
|
555438
555347
|
}
|
|
555439
|
-
async function isMarketplacePluginRelevant(pluginName,
|
|
555348
|
+
async function isMarketplacePluginRelevant(pluginName, context6, signals2) {
|
|
555440
555349
|
if (!await isOfficialMarketplaceInstalled()) {
|
|
555441
555350
|
return false;
|
|
555442
555351
|
}
|
|
555443
555352
|
if (isPluginInstalled(`${pluginName}@${OFFICIAL_MARKETPLACE_NAME}`)) {
|
|
555444
555353
|
return false;
|
|
555445
555354
|
}
|
|
555446
|
-
const { bashTools } =
|
|
555355
|
+
const { bashTools } = context6 ?? {};
|
|
555447
555356
|
if (signals2.cli && bashTools?.size) {
|
|
555448
555357
|
if (signals2.cli.some((cmd) => bashTools.has(cmd))) {
|
|
555449
555358
|
return true;
|
|
555450
555359
|
}
|
|
555451
555360
|
}
|
|
555452
|
-
if (signals2.filePath &&
|
|
555453
|
-
const readFiles = cacheKeys(
|
|
555361
|
+
if (signals2.filePath && context6?.readFileState) {
|
|
555362
|
+
const readFiles = cacheKeys(context6.readFileState);
|
|
555454
555363
|
if (readFiles.some((fp) => signals2.filePath.test(fp))) {
|
|
555455
555364
|
return true;
|
|
555456
555365
|
}
|
|
@@ -555469,7 +555378,7 @@ function getCustomTips() {
|
|
|
555469
555378
|
isRelevant: async () => true
|
|
555470
555379
|
}));
|
|
555471
555380
|
}
|
|
555472
|
-
async function getRelevantTips(
|
|
555381
|
+
async function getRelevantTips(context6) {
|
|
555473
555382
|
const settings = getInitialSettings();
|
|
555474
555383
|
const override = settings.spinnerTipsOverride;
|
|
555475
555384
|
const customTips = getCustomTips();
|
|
@@ -555477,7 +555386,7 @@ async function getRelevantTips(context7) {
|
|
|
555477
555386
|
return customTips;
|
|
555478
555387
|
}
|
|
555479
555388
|
const tips = [...externalTips, ...internalOnlyTips];
|
|
555480
|
-
const isRelevant = await Promise.all(tips.map((_) => _.isRelevant ? _.isRelevant(
|
|
555389
|
+
const isRelevant = await Promise.all(tips.map((_) => _.isRelevant ? _.isRelevant(context6) : Promise.resolve(true)));
|
|
555481
555390
|
const filtered = tips.filter((_, index) => isRelevant[index]).filter((_) => getSessionsSinceLastShown(_.id) >= _.cooldownSessions);
|
|
555482
555391
|
return [...filtered, ...customTips];
|
|
555483
555392
|
}
|
|
@@ -555847,7 +555756,7 @@ var init_tipRegistry = __esm(() => {
|
|
|
555847
555756
|
${blue2(`/plugin install frontend-design@${OFFICIAL_MARKETPLACE_NAME}`)}`;
|
|
555848
555757
|
},
|
|
555849
555758
|
cooldownSessions: 3,
|
|
555850
|
-
isRelevant: async (
|
|
555759
|
+
isRelevant: async (context6) => isMarketplacePluginRelevant("frontend-design", context6, {
|
|
555851
555760
|
filePath: /\.(html|css|htm)$/i
|
|
555852
555761
|
})
|
|
555853
555762
|
},
|
|
@@ -555859,7 +555768,7 @@ ${blue2(`/plugin install frontend-design@${OFFICIAL_MARKETPLACE_NAME}`)}`;
|
|
|
555859
555768
|
${blue2(`/plugin install vercel@${OFFICIAL_MARKETPLACE_NAME}`)}`;
|
|
555860
555769
|
},
|
|
555861
555770
|
cooldownSessions: 3,
|
|
555862
|
-
isRelevant: async (
|
|
555771
|
+
isRelevant: async (context6) => isMarketplacePluginRelevant("vercel", context6, {
|
|
555863
555772
|
filePath: /(?:^|[/\\])vercel\.json$/i,
|
|
555864
555773
|
cli: ["vercel"]
|
|
555865
555774
|
})
|
|
@@ -555977,11 +555886,11 @@ function selectTipWithLongestTimeSinceShown(availableTips) {
|
|
|
555977
555886
|
tipsWithSessions.sort((a2, b) => b.sessions - a2.sessions);
|
|
555978
555887
|
return tipsWithSessions[0]?.tip;
|
|
555979
555888
|
}
|
|
555980
|
-
async function getTipToShowOnSpinner(
|
|
555889
|
+
async function getTipToShowOnSpinner(context6) {
|
|
555981
555890
|
if (getSettings_DEPRECATED().spinnerTipsEnabled === false) {
|
|
555982
555891
|
return;
|
|
555983
555892
|
}
|
|
555984
|
-
const tips = await getRelevantTips(
|
|
555893
|
+
const tips = await getRelevantTips(context6);
|
|
555985
555894
|
if (tips.length === 0) {
|
|
555986
555895
|
return;
|
|
555987
555896
|
}
|
|
@@ -562780,12 +562689,12 @@ Error: sandbox required but unavailable: ${reason}
|
|
|
562780
562689
|
gracefulShutdownSync(1, "other");
|
|
562781
562690
|
});
|
|
562782
562691
|
}
|
|
562783
|
-
const setToolPermissionContext = import_react317.useCallback((
|
|
562692
|
+
const setToolPermissionContext = import_react317.useCallback((context6, options2) => {
|
|
562784
562693
|
setAppState((prev) => ({
|
|
562785
562694
|
...prev,
|
|
562786
562695
|
toolPermissionContext: {
|
|
562787
|
-
...
|
|
562788
|
-
mode: options2?.preserveMode ? prev.toolPermissionContext.mode :
|
|
562696
|
+
...context6,
|
|
562697
|
+
mode: options2?.preserveMode ? prev.toolPermissionContext.mode : context6.mode
|
|
562789
562698
|
}
|
|
562790
562699
|
}));
|
|
562791
562700
|
setImmediate((setToolUseConfirmQueue2) => {
|
|
@@ -563370,9 +563279,9 @@ Error: sandbox required but unavailable: ${reason}
|
|
|
563370
563279
|
setStashedPrompt(undefined);
|
|
563371
563280
|
}
|
|
563372
563281
|
};
|
|
563373
|
-
const
|
|
563282
|
+
const context6 = getToolUseContext(messagesRef.current, [], createAbortController(), mainLoopModel);
|
|
563374
563283
|
const mod = await matchingCommand.load();
|
|
563375
|
-
const jsx = await mod.call(onDone,
|
|
563284
|
+
const jsx = await mod.call(onDone, context6, commandArgs);
|
|
563376
563285
|
if (jsx && !doneWasCalled) {
|
|
563377
563286
|
setToolJSX({
|
|
563378
563287
|
jsx,
|
|
@@ -564836,22 +564745,22 @@ Note: ctrl + z now suspends ZeroCLI, ctrl + _ undoes input.
|
|
|
564836
564745
|
return;
|
|
564837
564746
|
}
|
|
564838
564747
|
const newAbortController = createAbortController();
|
|
564839
|
-
const
|
|
564840
|
-
const appState =
|
|
564841
|
-
const defaultSysPrompt = await getSystemPrompt(
|
|
564748
|
+
const context6 = getToolUseContext(compactMessages, [], newAbortController, mainLoopModel);
|
|
564749
|
+
const appState = context6.getAppState();
|
|
564750
|
+
const defaultSysPrompt = await getSystemPrompt(context6.options.tools, context6.options.mainLoopModel, Array.from(appState.toolPermissionContext.additionalWorkingDirectories.keys()), context6.options.mcpClients);
|
|
564842
564751
|
const systemPrompt = buildEffectiveSystemPrompt({
|
|
564843
564752
|
mainThreadAgentDefinition: undefined,
|
|
564844
|
-
toolUseContext:
|
|
564845
|
-
customSystemPrompt:
|
|
564753
|
+
toolUseContext: context6,
|
|
564754
|
+
customSystemPrompt: context6.options.customSystemPrompt,
|
|
564846
564755
|
defaultSystemPrompt: defaultSysPrompt,
|
|
564847
|
-
appendSystemPrompt:
|
|
564756
|
+
appendSystemPrompt: context6.options.appendSystemPrompt
|
|
564848
564757
|
});
|
|
564849
564758
|
const [userContext, systemContext] = await Promise.all([getUserContext(), getSystemContext()]);
|
|
564850
|
-
const result = await partialCompactConversation(compactMessages, messageIndex,
|
|
564759
|
+
const result = await partialCompactConversation(compactMessages, messageIndex, context6, {
|
|
564851
564760
|
systemPrompt,
|
|
564852
564761
|
userContext,
|
|
564853
564762
|
systemContext,
|
|
564854
|
-
toolUseContext:
|
|
564763
|
+
toolUseContext: context6,
|
|
564855
564764
|
forkContextMessages: compactMessages
|
|
564856
564765
|
}, feedback2, direction);
|
|
564857
564766
|
const kept = result.messagesToKeep ?? [];
|
|
@@ -564867,7 +564776,7 @@ Note: ctrl + z now suspends ZeroCLI, ctrl + _ undoes input.
|
|
|
564867
564776
|
}
|
|
564868
564777
|
if (false) {}
|
|
564869
564778
|
setConversationId(randomUUID46());
|
|
564870
|
-
runPostCompactCleanup(
|
|
564779
|
+
runPostCompactCleanup(context6.options.querySource);
|
|
564871
564780
|
if (direction === "from") {
|
|
564872
564781
|
const r = textForResubmit(message);
|
|
564873
564782
|
if (r) {
|
|
@@ -566358,7 +566267,7 @@ function WelcomeV2() {
|
|
|
566358
566267
|
dimColor: true,
|
|
566359
566268
|
children: [
|
|
566360
566269
|
"v",
|
|
566361
|
-
"0.
|
|
566270
|
+
"0.8.1",
|
|
566362
566271
|
" "
|
|
566363
566272
|
]
|
|
566364
566273
|
}, undefined, true, undefined, this)
|
|
@@ -566592,7 +566501,7 @@ function WelcomeV2() {
|
|
|
566592
566501
|
dimColor: true,
|
|
566593
566502
|
children: [
|
|
566594
566503
|
"v",
|
|
566595
|
-
"0.
|
|
566504
|
+
"0.8.1",
|
|
566596
566505
|
" "
|
|
566597
566506
|
]
|
|
566598
566507
|
}, undefined, true, undefined, this)
|
|
@@ -566839,7 +566748,7 @@ function AppleTerminalWelcomeV2(t0) {
|
|
|
566839
566748
|
dimColor: true,
|
|
566840
566749
|
children: [
|
|
566841
566750
|
"v",
|
|
566842
|
-
"0.
|
|
566751
|
+
"0.8.1",
|
|
566843
566752
|
" "
|
|
566844
566753
|
]
|
|
566845
566754
|
}, undefined, true, undefined, this);
|
|
@@ -567112,7 +567021,7 @@ function AppleTerminalWelcomeV2(t0) {
|
|
|
567112
567021
|
dimColor: true,
|
|
567113
567022
|
children: [
|
|
567114
567023
|
"v",
|
|
567115
|
-
"0.
|
|
567024
|
+
"0.8.1",
|
|
567116
567025
|
" "
|
|
567117
567026
|
]
|
|
567118
567027
|
}, undefined, true, undefined, this);
|
|
@@ -568624,7 +568533,7 @@ function completeOnboarding() {
|
|
|
568624
568533
|
saveGlobalConfig((current) => ({
|
|
568625
568534
|
...current,
|
|
568626
568535
|
hasCompletedOnboarding: true,
|
|
568627
|
-
lastOnboardingVersion: "0.
|
|
568536
|
+
lastOnboardingVersion: "0.8.1"
|
|
568628
568537
|
}));
|
|
568629
568538
|
}
|
|
568630
568539
|
function showDialog(root2, renderer) {
|
|
@@ -570888,8 +570797,8 @@ function generateActionsTable() {
|
|
|
570888
570797
|
return markdownTable(["Action", "Default Key(s)", "Context"], KEYBINDING_ACTIONS.map((action2) => {
|
|
570889
570798
|
const info = actionInfo[action2];
|
|
570890
570799
|
const keys2 = info ? info.keys.map((k) => `\`${k}\``).join(", ") : "(none)";
|
|
570891
|
-
const
|
|
570892
|
-
return [`\`${action2}\``, keys2,
|
|
570800
|
+
const context6 = info ? info.context : inferContextFromAction(action2);
|
|
570801
|
+
return [`\`${action2}\``, keys2, context6];
|
|
570893
570802
|
}));
|
|
570894
570803
|
}
|
|
570895
570804
|
function inferContextFromAction(action2) {
|
|
@@ -572875,7 +572784,7 @@ function appendToLog(path24, message) {
|
|
|
572875
572784
|
cwd: getFsImplementation().cwd(),
|
|
572876
572785
|
userType: process.env.USER_TYPE,
|
|
572877
572786
|
sessionId: getSessionId(),
|
|
572878
|
-
version: "0.
|
|
572787
|
+
version: "0.8.1"
|
|
572879
572788
|
};
|
|
572880
572789
|
getLogWriter(path24).write(messageWithTimestamp);
|
|
572881
572790
|
}
|
|
@@ -572896,7 +572805,7 @@ function extractServerMessage(data) {
|
|
|
572896
572805
|
}
|
|
572897
572806
|
function logErrorImpl(error42) {
|
|
572898
572807
|
const errorStr = error42.stack || error42.message;
|
|
572899
|
-
let
|
|
572808
|
+
let context6 = "";
|
|
572900
572809
|
if (axios_default.isAxiosError(error42) && error42.config?.url) {
|
|
572901
572810
|
const parts = [`url=${error42.config.url}`];
|
|
572902
572811
|
if (error42.response?.status !== undefined) {
|
|
@@ -572906,11 +572815,11 @@ function logErrorImpl(error42) {
|
|
|
572906
572815
|
if (serverMessage) {
|
|
572907
572816
|
parts.push(`body=${serverMessage}`);
|
|
572908
572817
|
}
|
|
572909
|
-
|
|
572818
|
+
context6 = `[${parts.join(",")}] `;
|
|
572910
572819
|
}
|
|
572911
|
-
logForDebugging(`${error42.name}: ${
|
|
572820
|
+
logForDebugging(`${error42.name}: ${context6}${errorStr}`, { level: "error" });
|
|
572912
572821
|
appendToLog(getErrorsPath(), {
|
|
572913
|
-
error: `${
|
|
572822
|
+
error: `${context6}${errorStr}`
|
|
572914
572823
|
});
|
|
572915
572824
|
}
|
|
572916
572825
|
function logMCPErrorImpl(serverName, error42) {
|
|
@@ -573123,8 +573032,8 @@ var init_sessionMemory = __esm(() => {
|
|
|
573123
573032
|
};
|
|
573124
573033
|
setSessionMemoryConfig(config3);
|
|
573125
573034
|
});
|
|
573126
|
-
extractSessionMemory = sequential(async function(
|
|
573127
|
-
const { messages, toolUseContext, querySource } =
|
|
573035
|
+
extractSessionMemory = sequential(async function(context6) {
|
|
573036
|
+
const { messages, toolUseContext, querySource } = context6;
|
|
573128
573037
|
if (querySource !== "repl_main_thread") {
|
|
573129
573038
|
return;
|
|
573130
573039
|
}
|
|
@@ -573145,7 +573054,7 @@ var init_sessionMemory = __esm(() => {
|
|
|
573145
573054
|
const userPrompt = await buildSessionMemoryUpdatePrompt(currentMemory, memoryPath);
|
|
573146
573055
|
await runForkedAgent({
|
|
573147
573056
|
promptMessages: [createUserMessage({ content: userPrompt })],
|
|
573148
|
-
cacheSafeParams: createCacheSafeParams(
|
|
573057
|
+
cacheSafeParams: createCacheSafeParams(context6),
|
|
573149
573058
|
canUseTool: createMemoryFileCanUseTool(memoryPath),
|
|
573150
573059
|
querySource: "session_memory",
|
|
573151
573060
|
forkLabel: "session_memory",
|
|
@@ -573481,7 +573390,7 @@ async function startMCPServer(cwd2, debug, verbose) {
|
|
|
573481
573390
|
setCwd(cwd2);
|
|
573482
573391
|
const server = new Server({
|
|
573483
573392
|
name: "claude/tengu",
|
|
573484
|
-
version: "0.
|
|
573393
|
+
version: "0.8.1"
|
|
573485
573394
|
}, {
|
|
573486
573395
|
capabilities: {
|
|
573487
573396
|
tools: {}
|
|
@@ -574667,9 +574576,9 @@ var exports_eventLoopStallDetector = {};
|
|
|
574667
574576
|
__export(exports_eventLoopStallDetector, {
|
|
574668
574577
|
default: () => eventLoopStallDetector_default
|
|
574669
574578
|
});
|
|
574670
|
-
var
|
|
574579
|
+
var noop25 = () => null, eventLoopStallDetector_default;
|
|
574671
574580
|
var init_eventLoopStallDetector = __esm(() => {
|
|
574672
|
-
eventLoopStallDetector_default =
|
|
574581
|
+
eventLoopStallDetector_default = noop25;
|
|
574673
574582
|
});
|
|
574674
574583
|
|
|
574675
574584
|
// missing-module-stub:./utils/sdkHeapDumpMonitor.js
|
|
@@ -574677,9 +574586,9 @@ var exports_sdkHeapDumpMonitor = {};
|
|
|
574677
574586
|
__export(exports_sdkHeapDumpMonitor, {
|
|
574678
574587
|
default: () => sdkHeapDumpMonitor_default
|
|
574679
574588
|
});
|
|
574680
|
-
var
|
|
574589
|
+
var noop26 = () => null, sdkHeapDumpMonitor_default;
|
|
574681
574590
|
var init_sdkHeapDumpMonitor = __esm(() => {
|
|
574682
|
-
sdkHeapDumpMonitor_default =
|
|
574591
|
+
sdkHeapDumpMonitor_default = noop26;
|
|
574683
574592
|
});
|
|
574684
574593
|
|
|
574685
574594
|
// src/bridge/pollConfigDefaults.ts
|
|
@@ -575496,7 +575405,7 @@ class CCRClient {
|
|
|
575496
575405
|
async readSubagentInternalEvents() {
|
|
575497
575406
|
return this.paginatedGet("/worker/internal-events", { subagents: "true" }, "subagent_events");
|
|
575498
575407
|
}
|
|
575499
|
-
async paginatedGet(path24, params,
|
|
575408
|
+
async paginatedGet(path24, params, context6) {
|
|
575500
575409
|
const authHeaders = this.getAuthHeaders();
|
|
575501
575410
|
if (Object.keys(authHeaders).length === 0)
|
|
575502
575411
|
return null;
|
|
@@ -575510,7 +575419,7 @@ class CCRClient {
|
|
|
575510
575419
|
if (cursor) {
|
|
575511
575420
|
url4.searchParams.set("cursor", cursor);
|
|
575512
575421
|
}
|
|
575513
|
-
const page = await this.getWithRetry(url4.toString(), authHeaders,
|
|
575422
|
+
const page = await this.getWithRetry(url4.toString(), authHeaders, context6);
|
|
575514
575423
|
if (!page)
|
|
575515
575424
|
return null;
|
|
575516
575425
|
allEvents.push(...page.data ?? []);
|
|
@@ -575519,7 +575428,7 @@ class CCRClient {
|
|
|
575519
575428
|
logForDebugging(`CCRClient: Read ${allEvents.length} internal events from ${path24}${params.subagents ? " (subagents)" : ""}`);
|
|
575520
575429
|
return allEvents;
|
|
575521
575430
|
}
|
|
575522
|
-
async getWithRetry(url4, authHeaders,
|
|
575431
|
+
async getWithRetry(url4, authHeaders, context6) {
|
|
575523
575432
|
for (let attempt = 1;attempt <= 10; attempt++) {
|
|
575524
575433
|
let response;
|
|
575525
575434
|
try {
|
|
@@ -575554,7 +575463,7 @@ class CCRClient {
|
|
|
575554
575463
|
}
|
|
575555
575464
|
logForDebugging("CCRClient: GET retries exhausted", { level: "error" });
|
|
575556
575465
|
logForDiagnosticsNoPII("error", "cli_worker_get_retries_exhausted", {
|
|
575557
|
-
context:
|
|
575466
|
+
context: context6
|
|
575558
575467
|
});
|
|
575559
575468
|
return null;
|
|
575560
575469
|
}
|
|
@@ -578120,8 +578029,8 @@ async function getEnvLessBridgeConfig() {
|
|
|
578120
578029
|
}
|
|
578121
578030
|
async function checkEnvLessBridgeMinVersion() {
|
|
578122
578031
|
const cfg = await getEnvLessBridgeConfig();
|
|
578123
|
-
if (cfg.min_version && lt("0.
|
|
578124
|
-
return `Your version of ZeroCLI (${"0.
|
|
578032
|
+
if (cfg.min_version && lt("0.8.1", cfg.min_version)) {
|
|
578033
|
+
return `Your version of ZeroCLI (${"0.8.1"}) is too old for Remote Control.
|
|
578125
578034
|
Version ${cfg.min_version} or higher is required. Run \`claude update\` to update.`;
|
|
578126
578035
|
}
|
|
578127
578036
|
return null;
|
|
@@ -578596,7 +578505,7 @@ async function initBridgeCore(params) {
|
|
|
578596
578505
|
const rawApi = createBridgeApiClient({
|
|
578597
578506
|
baseUrl,
|
|
578598
578507
|
getAccessToken,
|
|
578599
|
-
runnerVersion: "0.
|
|
578508
|
+
runnerVersion: "0.8.1",
|
|
578600
578509
|
onDebug: logForDebugging,
|
|
578601
578510
|
onAuth401,
|
|
578602
578511
|
getTrustedDeviceToken
|
|
@@ -583684,9 +583593,9 @@ var exports_ccshareResume = {};
|
|
|
583684
583593
|
__export(exports_ccshareResume, {
|
|
583685
583594
|
default: () => ccshareResume_default
|
|
583686
583595
|
});
|
|
583687
|
-
var
|
|
583596
|
+
var noop27 = () => null, ccshareResume_default;
|
|
583688
583597
|
var init_ccshareResume = __esm(() => {
|
|
583689
|
-
ccshareResume_default =
|
|
583598
|
+
ccshareResume_default = noop27;
|
|
583690
583599
|
});
|
|
583691
583600
|
|
|
583692
583601
|
// src/cli/handlers/plugins.ts
|
|
@@ -584884,7 +584793,7 @@ __export(exports_update, {
|
|
|
584884
584793
|
});
|
|
584885
584794
|
async function update() {
|
|
584886
584795
|
logEvent("tengu_update_check", {});
|
|
584887
|
-
writeToStdout(`Current version: ${"0.
|
|
584796
|
+
writeToStdout(`Current version: ${"0.8.1"}
|
|
584888
584797
|
`);
|
|
584889
584798
|
const channel = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
584890
584799
|
writeToStdout(`Checking for updates to ${channel} version...
|
|
@@ -584959,8 +584868,8 @@ async function update() {
|
|
|
584959
584868
|
writeToStdout(`Claude is managed by Homebrew.
|
|
584960
584869
|
`);
|
|
584961
584870
|
const latest = await getLatestVersion(channel);
|
|
584962
|
-
if (latest && !gte("0.
|
|
584963
|
-
writeToStdout(`Update available: ${"0.
|
|
584871
|
+
if (latest && !gte("0.8.1", latest)) {
|
|
584872
|
+
writeToStdout(`Update available: ${"0.8.1"} → ${latest}
|
|
584964
584873
|
`);
|
|
584965
584874
|
writeToStdout(`
|
|
584966
584875
|
`);
|
|
@@ -584976,8 +584885,8 @@ async function update() {
|
|
|
584976
584885
|
writeToStdout(`Claude is managed by winget.
|
|
584977
584886
|
`);
|
|
584978
584887
|
const latest = await getLatestVersion(channel);
|
|
584979
|
-
if (latest && !gte("0.
|
|
584980
|
-
writeToStdout(`Update available: ${"0.
|
|
584888
|
+
if (latest && !gte("0.8.1", latest)) {
|
|
584889
|
+
writeToStdout(`Update available: ${"0.8.1"} → ${latest}
|
|
584981
584890
|
`);
|
|
584982
584891
|
writeToStdout(`
|
|
584983
584892
|
`);
|
|
@@ -584993,8 +584902,8 @@ async function update() {
|
|
|
584993
584902
|
writeToStdout(`Claude is managed by apk.
|
|
584994
584903
|
`);
|
|
584995
584904
|
const latest = await getLatestVersion(channel);
|
|
584996
|
-
if (latest && !gte("0.
|
|
584997
|
-
writeToStdout(`Update available: ${"0.
|
|
584905
|
+
if (latest && !gte("0.8.1", latest)) {
|
|
584906
|
+
writeToStdout(`Update available: ${"0.8.1"} → ${latest}
|
|
584998
584907
|
`);
|
|
584999
584908
|
writeToStdout(`
|
|
585000
584909
|
`);
|
|
@@ -585059,11 +584968,11 @@ async function update() {
|
|
|
585059
584968
|
`);
|
|
585060
584969
|
await gracefulShutdown(1);
|
|
585061
584970
|
}
|
|
585062
|
-
if (result.latestVersion === "0.
|
|
585063
|
-
writeToStdout(source_default.green(`Zero CLI is up to date (${"0.
|
|
584971
|
+
if (result.latestVersion === "0.8.1") {
|
|
584972
|
+
writeToStdout(source_default.green(`Zero CLI is up to date (${"0.8.1"})`) + `
|
|
585064
584973
|
`);
|
|
585065
584974
|
} else {
|
|
585066
|
-
writeToStdout(source_default.green(`Successfully updated from ${"0.
|
|
584975
|
+
writeToStdout(source_default.green(`Successfully updated from ${"0.8.1"} to version ${result.latestVersion}`) + `
|
|
585067
584976
|
`);
|
|
585068
584977
|
await regenerateCompletionCache();
|
|
585069
584978
|
}
|
|
@@ -585123,12 +585032,12 @@ async function update() {
|
|
|
585123
585032
|
`);
|
|
585124
585033
|
await gracefulShutdown(1);
|
|
585125
585034
|
}
|
|
585126
|
-
if (latestVersion === "0.
|
|
585127
|
-
writeToStdout(source_default.green(`Zero CLI is up to date (${"0.
|
|
585035
|
+
if (latestVersion === "0.8.1") {
|
|
585036
|
+
writeToStdout(source_default.green(`Zero CLI is up to date (${"0.8.1"})`) + `
|
|
585128
585037
|
`);
|
|
585129
585038
|
await gracefulShutdown(0);
|
|
585130
585039
|
}
|
|
585131
|
-
writeToStdout(`New version available: ${latestVersion} (current: ${"0.
|
|
585040
|
+
writeToStdout(`New version available: ${latestVersion} (current: ${"0.8.1"})
|
|
585132
585041
|
`);
|
|
585133
585042
|
writeToStdout(`Installing update...
|
|
585134
585043
|
`);
|
|
@@ -585173,7 +585082,7 @@ async function update() {
|
|
|
585173
585082
|
logForDebugging(`update: Installation status: ${status2}`);
|
|
585174
585083
|
switch (status2) {
|
|
585175
585084
|
case "success":
|
|
585176
|
-
writeToStdout(source_default.green(`Successfully updated from ${"0.
|
|
585085
|
+
writeToStdout(source_default.green(`Successfully updated from ${"0.8.1"} to version ${latestVersion}`) + `
|
|
585177
585086
|
`);
|
|
585178
585087
|
await regenerateCompletionCache();
|
|
585179
585088
|
break;
|
|
@@ -585257,9 +585166,9 @@ var exports_ant = {};
|
|
|
585257
585166
|
__export(exports_ant, {
|
|
585258
585167
|
default: () => ant_default
|
|
585259
585168
|
});
|
|
585260
|
-
var
|
|
585169
|
+
var noop28 = () => null, ant_default;
|
|
585261
585170
|
var init_ant = __esm(() => {
|
|
585262
|
-
ant_default =
|
|
585171
|
+
ant_default = noop28;
|
|
585263
585172
|
});
|
|
585264
585173
|
|
|
585265
585174
|
// src/main.tsx
|
|
@@ -586473,7 +586382,7 @@ ${customInstructions}` : customInstructions;
|
|
|
586473
586382
|
}
|
|
586474
586383
|
}
|
|
586475
586384
|
logForDiagnosticsNoPII("info", "started", {
|
|
586476
|
-
version: "0.
|
|
586385
|
+
version: "0.8.1",
|
|
586477
586386
|
is_native_binary: isInBundledMode()
|
|
586478
586387
|
});
|
|
586479
586388
|
registerCleanup(async () => {
|
|
@@ -587356,7 +587265,7 @@ Usage: claude --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
587356
587265
|
pendingHookMessages
|
|
587357
587266
|
}, renderAndRun);
|
|
587358
587267
|
}
|
|
587359
|
-
}).version("0.
|
|
587268
|
+
}).version("0.8.1", "-v, --version", "Output the version number");
|
|
587360
587269
|
program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
|
|
587361
587270
|
program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
|
|
587362
587271
|
if (canUserConfigureAdvisor()) {
|
|
@@ -588021,7 +587930,7 @@ if (false) {}
|
|
|
588021
587930
|
async function main2() {
|
|
588022
587931
|
const args = process.argv.slice(2);
|
|
588023
587932
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
|
|
588024
|
-
console.log(`${"0.
|
|
587933
|
+
console.log(`${"0.8.1"} (ZeroCLI)`);
|
|
588025
587934
|
return;
|
|
588026
587935
|
}
|
|
588027
587936
|
if (args.includes("--provider")) {
|
|
@@ -588163,4 +588072,4 @@ async function main2() {
|
|
|
588163
588072
|
}
|
|
588164
588073
|
main2();
|
|
588165
588074
|
|
|
588166
|
-
//# debugId=
|
|
588075
|
+
//# debugId=E6ACFE5970CAC60E64756E2164756E21
|