@p4code/cli 0.4.12 → 0.4.13
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/bin.mjs +158 -89
- package/dist/client/assets/{DiffPanel-Bm0q47ri.js → DiffPanel-DWdPV3K3.js} +2 -2
- package/dist/client/assets/{FilePreviewPanel-BHjHHjcL.js → FilePreviewPanel-Djvz8ttF.js} +2 -2
- package/dist/client/assets/{PreviewPanel-zj6J-JNa.js → PreviewPanel-DbeIwgC3.js} +2 -2
- package/dist/client/assets/{PullRequestCodeTab-CmKkBGPQ.js → PullRequestCodeTab-cFyorjex.js} +2 -2
- package/dist/client/assets/{fileCommentAnnotations-C0bQJBDi.js → fileCommentAnnotations-Ddmzci4v.js} +2 -2
- package/dist/client/assets/{index-BvhnZNuc.js → index-CBqRo4NV.js} +11 -6
- package/dist/client/assets/{renderFileChildren-C0wGDpTp.js → renderFileChildren--IZ7ujV7.js} +2 -2
- package/dist/client/assets/{toggle-group-RD3apHNe.js → toggle-group-U3M0YUkk.js} +2 -2
- package/dist/client/index.html +1 -1
- package/package.json +1 -1
package/dist/bin.mjs
CHANGED
|
@@ -240,7 +240,7 @@ const make$93 = () => {
|
|
|
240
240
|
const layer$82 = Layer.sync(NetService, make$93);
|
|
241
241
|
//#endregion
|
|
242
242
|
//#region package.json
|
|
243
|
-
var version = "0.4.
|
|
243
|
+
var version = "0.4.13";
|
|
244
244
|
//#endregion
|
|
245
245
|
//#region src/config.ts
|
|
246
246
|
/**
|
|
@@ -100200,7 +100200,7 @@ const CURSOR_PRESENTATION = {
|
|
|
100200
100200
|
badgeLabel: "Early Access",
|
|
100201
100201
|
showInteractionModeToggle: true
|
|
100202
100202
|
};
|
|
100203
|
-
const EMPTY_CAPABILITIES$
|
|
100203
|
+
const EMPTY_CAPABILITIES$1 = createModelCapabilities({ optionDescriptors: [] });
|
|
100204
100204
|
const CURSOR_ACP_MODEL_DISCOVERY_TIMEOUT_MS = 15e3;
|
|
100205
100205
|
const CURSOR_PARAMETERIZED_MODEL_PICKER_MIN_VERSION_DATE = 20260408;
|
|
100206
100206
|
const CURSOR_CLI_INSTALLATION_DOCS_URL = "https://cursor.com/docs/cli/installation";
|
|
@@ -100308,7 +100308,7 @@ function getBooleanCurrentValue(option) {
|
|
|
100308
100308
|
if (normalized === "false") return false;
|
|
100309
100309
|
}
|
|
100310
100310
|
function buildCursorCapabilitiesFromConfigOptions(configOptions) {
|
|
100311
|
-
if (!configOptions || configOptions.length === 0) return EMPTY_CAPABILITIES$
|
|
100311
|
+
if (!configOptions || configOptions.length === 0) return EMPTY_CAPABILITIES$1;
|
|
100312
100312
|
const reasoningConfig = findCursorEffortConfigOption(configOptions);
|
|
100313
100313
|
const reasoningEffortLevels = reasoningConfig?.type === "select" ? flattenSessionConfigSelectOptions(reasoningConfig).flatMap((entry) => {
|
|
100314
100314
|
const normalizedValue = normalizeCursorReasoningValue(entry.value);
|
|
@@ -100477,7 +100477,7 @@ const discoverCursorModelsViaListAvailableModels = (cursorSettings, environment)
|
|
|
100477
100477
|
}), environment);
|
|
100478
100478
|
const discoverCursorModelsViaAcp = (cursorSettings, environment) => discoverCursorModelsViaListAvailableModels(cursorSettings, environment);
|
|
100479
100479
|
function getCursorFallbackModels(cursorSettings) {
|
|
100480
|
-
return providerModelsFromSettings([], cursorSettings.customModels, EMPTY_CAPABILITIES$
|
|
100480
|
+
return providerModelsFromSettings([], cursorSettings.customModels, EMPTY_CAPABILITIES$1);
|
|
100481
100481
|
}
|
|
100482
100482
|
/** Timeout for `agent about` — it's slower than a simple `--version` probe. */
|
|
100483
100483
|
const ABOUT_TIMEOUT_MS = 8e3;
|
|
@@ -100513,7 +100513,7 @@ function buildCursorProviderSnapshot(input) {
|
|
|
100513
100513
|
presentation: CURSOR_PRESENTATION,
|
|
100514
100514
|
enabled: input.cursorSettings.enabled,
|
|
100515
100515
|
checkedAt: input.checkedAt,
|
|
100516
|
-
models: providerModelsFromSettings(input.discoveredModels ?? [], input.cursorSettings.customModels, EMPTY_CAPABILITIES$
|
|
100516
|
+
models: providerModelsFromSettings(input.discoveredModels ?? [], input.cursorSettings.customModels, EMPTY_CAPABILITIES$1),
|
|
100517
100517
|
probe: {
|
|
100518
100518
|
installed: true,
|
|
100519
100519
|
version: input.parsed.version,
|
|
@@ -103346,14 +103346,14 @@ const GROK_PRESENTATION = {
|
|
|
103346
103346
|
showInteractionModeToggle: false,
|
|
103347
103347
|
requiresNewThreadForModelChange: true
|
|
103348
103348
|
};
|
|
103349
|
-
const EMPTY_CAPABILITIES
|
|
103349
|
+
const EMPTY_CAPABILITIES = createModelCapabilities({ optionDescriptors: [] });
|
|
103350
103350
|
const VERSION_PROBE_TIMEOUT_MS$1 = 4e3;
|
|
103351
103351
|
const GROK_ACP_MODEL_DISCOVERY_TIMEOUT_MS = 15e3;
|
|
103352
103352
|
const GROK_BUILT_IN_MODELS = [{
|
|
103353
103353
|
slug: "grok-build",
|
|
103354
103354
|
name: "Grok Build",
|
|
103355
103355
|
isCustom: false,
|
|
103356
|
-
capabilities: EMPTY_CAPABILITIES
|
|
103356
|
+
capabilities: EMPTY_CAPABILITIES
|
|
103357
103357
|
}];
|
|
103358
103358
|
function buildInitialGrokProviderSnapshot(grokSettings) {
|
|
103359
103359
|
return Effect.gen(function* () {
|
|
@@ -103388,7 +103388,7 @@ function buildInitialGrokProviderSnapshot(grokSettings) {
|
|
|
103388
103388
|
});
|
|
103389
103389
|
}
|
|
103390
103390
|
function grokModelsFromSettings(customModels, builtInModels = GROK_BUILT_IN_MODELS) {
|
|
103391
|
-
return providerModelsFromSettings(builtInModels, customModels ?? [], EMPTY_CAPABILITIES
|
|
103391
|
+
return providerModelsFromSettings(builtInModels, customModels ?? [], EMPTY_CAPABILITIES);
|
|
103392
103392
|
}
|
|
103393
103393
|
function buildGrokDiscoveredModelsFromSessionModelState(modelState) {
|
|
103394
103394
|
if (!modelState || modelState.availableModels.length === 0) return [];
|
|
@@ -103401,7 +103401,7 @@ function buildGrokDiscoveredModelsFromSessionModelState(modelState) {
|
|
|
103401
103401
|
slug,
|
|
103402
103402
|
name: model.name.trim() || slug,
|
|
103403
103403
|
isCustom: false,
|
|
103404
|
-
capabilities: EMPTY_CAPABILITIES
|
|
103404
|
+
capabilities: EMPTY_CAPABILITIES
|
|
103405
103405
|
};
|
|
103406
103406
|
}).filter((model) => model !== void 0);
|
|
103407
103407
|
}
|
|
@@ -103641,20 +103641,52 @@ const GrokDriver = {
|
|
|
103641
103641
|
})
|
|
103642
103642
|
};
|
|
103643
103643
|
/**
|
|
103644
|
+
* Reasoning levels `muse exec --reasoning-effort` accepts, in the CLI's own
|
|
103645
|
+
* order (`muse exec --help`, Muse Code 1.1.1). `high` is the CLI default, so
|
|
103646
|
+
* it is the default here too.
|
|
103647
|
+
*/
|
|
103648
|
+
const MUSE_REASONING_EFFORTS = [
|
|
103649
|
+
"none",
|
|
103650
|
+
"minimal",
|
|
103651
|
+
"low",
|
|
103652
|
+
"medium",
|
|
103653
|
+
"high",
|
|
103654
|
+
"xhigh",
|
|
103655
|
+
"max",
|
|
103656
|
+
"ultra"
|
|
103657
|
+
];
|
|
103658
|
+
const MUSE_DEFAULT_REASONING_EFFORT = "high";
|
|
103659
|
+
/**
|
|
103660
|
+
* Keep a selection Muse cannot parse out of the argv. `reasoningEffort` is a
|
|
103661
|
+
* shared option id — Codex publishes one too — so a selection left over from
|
|
103662
|
+
* another provider can reach this driver, and an unknown level makes
|
|
103663
|
+
* `muse exec` reject the whole invocation.
|
|
103664
|
+
*/
|
|
103665
|
+
function museReasoningEffort(value) {
|
|
103666
|
+
return value !== void 0 && MUSE_REASONING_EFFORTS.includes(value) ? value : void 0;
|
|
103667
|
+
}
|
|
103668
|
+
/**
|
|
103644
103669
|
* Build the argument vector for one turn.
|
|
103645
103670
|
*
|
|
103646
|
-
* Approval policy is the load-bearing decision here.
|
|
103647
|
-
*
|
|
103648
|
-
* `--
|
|
103649
|
-
*
|
|
103650
|
-
*
|
|
103671
|
+
* Approval policy is the load-bearing decision here. Muse Code 1.1.1 does
|
|
103672
|
+
* express approval as a policy — `--approval-mode untrusted|on-request|never`,
|
|
103673
|
+
* plus named `--permission-profile` documents — but a headless `exec` run
|
|
103674
|
+
* still has no channel to answer a prompt: approvals are served over MSP
|
|
103675
|
+
* (`muse serve`), not on the `exec` stream. So the only two postures `exec`
|
|
103676
|
+
* can honour end to end are `--disable-approval` (keep the OS sandbox) and
|
|
103677
|
+
* `--yolo` (drop approval and the sandbox, and trust the workspace). P4Code
|
|
103678
|
+
* owns the user-facing runtime mode, so it maps onto those two:
|
|
103651
103679
|
*
|
|
103652
103680
|
* - `full-access` → `--yolo`
|
|
103653
103681
|
* - everything else → `--disable-approval --trust-workspace`, leaving the
|
|
103654
103682
|
* sandbox to contain what runs.
|
|
103655
103683
|
*
|
|
103656
|
-
* `approval-required` cannot be honoured
|
|
103657
|
-
* `config.warning` for it rather than silently pretending otherwise.
|
|
103684
|
+
* `approval-required` cannot be honoured over `exec`; the adapter emits a
|
|
103685
|
+
* `config.warning` for it rather than silently pretending otherwise. Serving
|
|
103686
|
+
* a real approval prompt means moving the driver onto MSP.
|
|
103687
|
+
*
|
|
103688
|
+
* Flags here were verified against Muse Code 1.1.1-R2514.1 (`muse exec
|
|
103689
|
+
* --help`).
|
|
103658
103690
|
*/
|
|
103659
103691
|
function buildMuseExecArgs(input) {
|
|
103660
103692
|
const args = [
|
|
@@ -103698,10 +103730,15 @@ function museApprovalsUnsupported(runtimeMode) {
|
|
|
103698
103730
|
* MuseExecEvents — pure translation of `muse exec --json` JSONL records into
|
|
103699
103731
|
* canonical `ProviderRuntimeEvent`s.
|
|
103700
103732
|
*
|
|
103701
|
-
* Muse
|
|
103702
|
-
*
|
|
103703
|
-
*
|
|
103704
|
-
*
|
|
103733
|
+
* P4Code drives Muse through `muse exec --json`, which runs one prompt to
|
|
103734
|
+
* completion and prints one JSON object per line; multi-turn threads are
|
|
103735
|
+
* rebuilt by re-invoking with `--session-id`. Muse Code 1.1.1 also serves a
|
|
103736
|
+
* session host over stdio (`muse serve`, the MSP wire protocol, exported by
|
|
103737
|
+
* `muse schema`) with approval, user-input and steering methods that `exec`
|
|
103738
|
+
* has no channel for. Moving onto MSP is the way to lift those limits; the
|
|
103739
|
+
* mapping below stays on the `exec` stream until then.
|
|
103740
|
+
*
|
|
103741
|
+
* Record shapes here were re-verified against CLI 1.1.1-R2514.1.
|
|
103705
103742
|
*
|
|
103706
103743
|
* Everything here is a pure function over a caller-owned state record so the
|
|
103707
103744
|
* mapping can be tested against captured CLI output without spawning a
|
|
@@ -103995,21 +104032,19 @@ function toolCallIdFromIdempotencyKey(key) {
|
|
|
103995
104032
|
const callId = key.slice(5).trim();
|
|
103996
104033
|
return callId.length > 0 ? callId : void 0;
|
|
103997
104034
|
}
|
|
104035
|
+
/**
|
|
104036
|
+
* Muse's tool names, as the CLI itself reports them (Muse Code 1.1.1). Names
|
|
104037
|
+
* it does not have are not listed: an unknown tool still maps to
|
|
104038
|
+
* `dynamic_tool_call`, which is the right answer for the memory, goal, cron,
|
|
104039
|
+
* skill and todo tools that have no canonical item type here.
|
|
104040
|
+
*/
|
|
103998
104041
|
function itemTypeForToolName(toolName) {
|
|
103999
104042
|
switch (toolName) {
|
|
104000
104043
|
case "bash":
|
|
104001
|
-
case "
|
|
104002
|
-
case "run_command":
|
|
104003
|
-
case "unified_exec": return "command_execution";
|
|
104044
|
+
case "bash_input": return "command_execution";
|
|
104004
104045
|
case "write_file":
|
|
104005
|
-
case "edit_file":
|
|
104006
|
-
case "
|
|
104007
|
-
case "apply_patch":
|
|
104008
|
-
case "delete_file":
|
|
104009
|
-
case "move_file": return "file_change";
|
|
104010
|
-
case "web_search":
|
|
104011
|
-
case "web_fetch": return "web_search";
|
|
104012
|
-
case "view_image": return "image_view";
|
|
104046
|
+
case "edit_file": return "file_change";
|
|
104047
|
+
case "web_search": return "web_search";
|
|
104013
104048
|
default:
|
|
104014
104049
|
if (toolName?.startsWith("subagent_")) return "collab_agent_tool_call";
|
|
104015
104050
|
if (toolName?.startsWith("mcp__")) return "mcp_tool_call";
|
|
@@ -104225,11 +104260,12 @@ const makeMuseTextGeneration = (museSettings, environment = process.env) => Effe
|
|
|
104225
104260
|
/**
|
|
104226
104261
|
* MuseExecRuntime — one `muse exec --json` child process per turn.
|
|
104227
104262
|
*
|
|
104228
|
-
*
|
|
104229
|
-
*
|
|
104230
|
-
*
|
|
104231
|
-
*
|
|
104232
|
-
*
|
|
104263
|
+
* On the `exec` path a turn is a process, and the thread is rebuilt from the
|
|
104264
|
+
* CLI's own event-sourced session log when the next turn passes
|
|
104265
|
+
* `--session-id`. (Muse Code 1.1.1 does have a long-lived surface —
|
|
104266
|
+
* `muse serve`, the MSP session host — which this driver does not use yet.)
|
|
104267
|
+
* This module owns spawning, line framing, interruption, and exit
|
|
104268
|
+
* classification; it knows nothing about canonical runtime events.
|
|
104233
104269
|
*
|
|
104234
104270
|
* @module provider/muse/MuseExecRuntime
|
|
104235
104271
|
*/
|
|
@@ -104473,11 +104509,12 @@ function nonNegativeInt(value) {
|
|
|
104473
104509
|
*
|
|
104474
104510
|
* Consequences that are visible to users, and deliberate:
|
|
104475
104511
|
*
|
|
104476
|
-
* - **No interactive approvals.**
|
|
104477
|
-
* approval prompt
|
|
104478
|
-
*
|
|
104479
|
-
*
|
|
104480
|
-
* a
|
|
104512
|
+
* - **No interactive approvals.** `muse exec` has no channel to answer an
|
|
104513
|
+
* approval prompt — Muse Code 1.1.1 serves approvals over MSP
|
|
104514
|
+
* (`muse serve`), which this adapter does not speak — so the adapter runs
|
|
104515
|
+
* with approval disabled and lets Muse's OS sandbox do the containing.
|
|
104516
|
+
* `respondToRequest` fails rather than pretending to route a decision, and
|
|
104517
|
+
* `approval-required` threads get a `config.warning`.
|
|
104481
104518
|
* - **No provider-side rollback.** Muse can fork a session interactively but
|
|
104482
104519
|
* exposes nothing headless.
|
|
104483
104520
|
* - **Tool arguments are not streamed.** They exist only in the on-disk
|
|
@@ -104617,10 +104654,12 @@ function makeMuseAdapter(museSettings, options) {
|
|
|
104617
104654
|
}
|
|
104618
104655
|
const turnId = TurnId.make(yield* randomUUIDv4);
|
|
104619
104656
|
const model = input.modelSelection?.model ?? ctx.session.model;
|
|
104657
|
+
const reasoningEffort = input.modelSelection?.instanceId === boundInstanceId ? museReasoningEffort(getModelSelectionStringOptionValue(input.modelSelection, "reasoningEffort")) : void 0;
|
|
104620
104658
|
const args = buildMuseExecArgs({
|
|
104621
104659
|
sessionId: ctx.museSessionId,
|
|
104622
104660
|
prompt,
|
|
104623
104661
|
model,
|
|
104662
|
+
reasoningEffort,
|
|
104624
104663
|
baseUrl: museSettings.baseUrl || void 0,
|
|
104625
104664
|
runtimeMode: ctx.session.runtimeMode,
|
|
104626
104665
|
imagePaths
|
|
@@ -104655,54 +104694,74 @@ function makeMuseAdapter(museSettings, options) {
|
|
|
104655
104694
|
...model ? { model } : {}
|
|
104656
104695
|
};
|
|
104657
104696
|
const turnScope = yield* Scope.make();
|
|
104658
|
-
|
|
104697
|
+
let runStarted = false;
|
|
104698
|
+
let settled = false;
|
|
104699
|
+
let outcome;
|
|
104700
|
+
/**
|
|
104701
|
+
* Release everything the turn holds, exactly once, whatever ended it:
|
|
104702
|
+
* a clean exit, a typed failure, a defect, or an interrupt from a
|
|
104703
|
+
* stopped thread. Leaving `activeTurn` or a `running` session behind
|
|
104704
|
+
* would wedge the thread — every later `sendTurn` would refuse with
|
|
104705
|
+
* "a Muse turn is already running" until the server restarted — so
|
|
104706
|
+
* this runs from an `ensuring` finalizer rather than the happy path.
|
|
104707
|
+
*/
|
|
104708
|
+
const finishTurn = Effect.suspend(() => {
|
|
104709
|
+
if (settled) return Effect.void;
|
|
104710
|
+
settled = true;
|
|
104711
|
+
return Effect.gen(function* () {
|
|
104712
|
+
ctx.activeTurn = void 0;
|
|
104713
|
+
yield* Scope.close(turnScope, Exit.void);
|
|
104714
|
+
if (runStarted && state.terminal === void 0) if (outcome === void 0 || outcome.kind === "interrupted") yield* publish({
|
|
104715
|
+
type: "turn.aborted",
|
|
104716
|
+
...yield* makeEventStamp(),
|
|
104717
|
+
provider: PROVIDER$1,
|
|
104718
|
+
providerInstanceId: boundInstanceId,
|
|
104719
|
+
threadId: input.threadId,
|
|
104720
|
+
turnId,
|
|
104721
|
+
payload: { reason: "interrupted" }
|
|
104722
|
+
});
|
|
104723
|
+
else {
|
|
104724
|
+
const detail = outcome.kind === "failed" ? outcome.stderr || `\`muse exec\` exited with code ${outcome.exitCode}.` : "`muse exec` ended without a terminal event.";
|
|
104725
|
+
yield* publish({
|
|
104726
|
+
type: "turn.completed",
|
|
104727
|
+
...yield* makeEventStamp(),
|
|
104728
|
+
provider: PROVIDER$1,
|
|
104729
|
+
providerInstanceId: boundInstanceId,
|
|
104730
|
+
threadId: input.threadId,
|
|
104731
|
+
turnId,
|
|
104732
|
+
payload: {
|
|
104733
|
+
state: "failed",
|
|
104734
|
+
errorMessage: detail
|
|
104735
|
+
}
|
|
104736
|
+
});
|
|
104737
|
+
}
|
|
104738
|
+
if (runStarted) yield* publishTokenUsage(ctx, turnId);
|
|
104739
|
+
const updatedAt = yield* nowIso;
|
|
104740
|
+
const { activeTurnId: _activeTurnId, ...readySession } = ctx.session;
|
|
104741
|
+
ctx.session = {
|
|
104742
|
+
...readySession,
|
|
104743
|
+
status: "ready",
|
|
104744
|
+
updatedAt
|
|
104745
|
+
};
|
|
104746
|
+
});
|
|
104747
|
+
}).pipe(Effect.ignore);
|
|
104748
|
+
yield* Effect.acquireUseRelease(runMuseExec({
|
|
104659
104749
|
threadId: input.threadId,
|
|
104660
104750
|
binaryPath: museSettings.binaryPath || "muse",
|
|
104661
104751
|
args,
|
|
104662
104752
|
cwd: ctx.cwd,
|
|
104663
104753
|
environment,
|
|
104664
104754
|
onLine: handleLine
|
|
104665
|
-
}).pipe(Effect.provideService(Scope.Scope, turnScope), Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner), Effect.tapError(() =>
|
|
104666
|
-
|
|
104667
|
-
|
|
104668
|
-
run,
|
|
104669
|
-
state
|
|
104670
|
-
};
|
|
104671
|
-
const outcome = yield* run.awaitOutcome;
|
|
104672
|
-
yield* Scope.close(turnScope, Exit.void);
|
|
104673
|
-
ctx.activeTurn = void 0;
|
|
104674
|
-
if (state.terminal === void 0) if (outcome.kind === "interrupted") yield* publish({
|
|
104675
|
-
type: "turn.aborted",
|
|
104676
|
-
...yield* makeEventStamp(),
|
|
104677
|
-
provider: PROVIDER$1,
|
|
104678
|
-
providerInstanceId: boundInstanceId,
|
|
104679
|
-
threadId: input.threadId,
|
|
104680
|
-
turnId,
|
|
104681
|
-
payload: { reason: "interrupted" }
|
|
104682
|
-
});
|
|
104683
|
-
else {
|
|
104684
|
-
const detail = outcome.kind === "failed" ? outcome.stderr || `\`muse exec\` exited with code ${outcome.exitCode}.` : "`muse exec` ended without a terminal event.";
|
|
104685
|
-
yield* publish({
|
|
104686
|
-
type: "turn.completed",
|
|
104687
|
-
...yield* makeEventStamp(),
|
|
104688
|
-
provider: PROVIDER$1,
|
|
104689
|
-
providerInstanceId: boundInstanceId,
|
|
104690
|
-
threadId: input.threadId,
|
|
104755
|
+
}).pipe(Effect.provideService(Scope.Scope, turnScope), Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner), Effect.tapError(() => finishTurn), Effect.tap((run) => Effect.sync(() => {
|
|
104756
|
+
runStarted = true;
|
|
104757
|
+
ctx.activeTurn = {
|
|
104691
104758
|
turnId,
|
|
104692
|
-
|
|
104693
|
-
|
|
104694
|
-
|
|
104695
|
-
|
|
104696
|
-
|
|
104697
|
-
}
|
|
104698
|
-
yield* publishTokenUsage(ctx, turnId);
|
|
104699
|
-
const updatedAt = yield* nowIso;
|
|
104700
|
-
const { activeTurnId: _activeTurnId, ...readySession } = ctx.session;
|
|
104701
|
-
ctx.session = {
|
|
104702
|
-
...readySession,
|
|
104703
|
-
status: "ready",
|
|
104704
|
-
updatedAt
|
|
104705
|
-
};
|
|
104759
|
+
run,
|
|
104760
|
+
state
|
|
104761
|
+
};
|
|
104762
|
+
}))), (run) => Effect.gen(function* () {
|
|
104763
|
+
outcome = yield* run.awaitOutcome;
|
|
104764
|
+
}), () => finishTurn);
|
|
104706
104765
|
return {
|
|
104707
104766
|
threadId: input.threadId,
|
|
104708
104767
|
turnId,
|
|
@@ -104831,7 +104890,17 @@ const MUSE_PRESENTATION = {
|
|
|
104831
104890
|
requiresNewThreadForModelChange: false,
|
|
104832
104891
|
supportedRuntimeModes: ["auto", "full-access"]
|
|
104833
104892
|
};
|
|
104834
|
-
const
|
|
104893
|
+
const MUSE_CAPABILITIES = createModelCapabilities({ optionDescriptors: [{
|
|
104894
|
+
id: "reasoningEffort",
|
|
104895
|
+
label: "Reasoning",
|
|
104896
|
+
type: "select",
|
|
104897
|
+
options: MUSE_REASONING_EFFORTS.map((effort) => ({
|
|
104898
|
+
id: effort,
|
|
104899
|
+
label: effort.charAt(0).toUpperCase() + effort.slice(1),
|
|
104900
|
+
...effort === "high" ? { isDefault: true } : {}
|
|
104901
|
+
})),
|
|
104902
|
+
currentValue: MUSE_DEFAULT_REASONING_EFFORT
|
|
104903
|
+
}] });
|
|
104835
104904
|
const VERSION_PROBE_TIMEOUT_MS = 4e3;
|
|
104836
104905
|
/** Models Meta documents for Muse Code; used until the CLI caches a catalog. */
|
|
104837
104906
|
const MUSE_BUILT_IN_MODELS = [
|
|
@@ -104839,30 +104908,30 @@ const MUSE_BUILT_IN_MODELS = [
|
|
|
104839
104908
|
slug: "muse-spark-1.3",
|
|
104840
104909
|
name: "Muse Spark 1.3",
|
|
104841
104910
|
isCustom: false,
|
|
104842
|
-
capabilities:
|
|
104911
|
+
capabilities: MUSE_CAPABILITIES
|
|
104843
104912
|
},
|
|
104844
104913
|
{
|
|
104845
104914
|
slug: "muse-spark-1.3-contributor",
|
|
104846
104915
|
name: "Muse Spark 1.3 (contributor)",
|
|
104847
104916
|
isCustom: false,
|
|
104848
104917
|
isDefault: true,
|
|
104849
|
-
capabilities:
|
|
104918
|
+
capabilities: MUSE_CAPABILITIES
|
|
104850
104919
|
},
|
|
104851
104920
|
{
|
|
104852
104921
|
slug: "muse-spark-1.2",
|
|
104853
104922
|
name: "Muse Spark 1.2",
|
|
104854
104923
|
isCustom: false,
|
|
104855
|
-
capabilities:
|
|
104924
|
+
capabilities: MUSE_CAPABILITIES
|
|
104856
104925
|
},
|
|
104857
104926
|
{
|
|
104858
104927
|
slug: "muse-spark-1.2-contributor",
|
|
104859
104928
|
name: "Muse Spark 1.2 (contributor)",
|
|
104860
104929
|
isCustom: false,
|
|
104861
|
-
capabilities:
|
|
104930
|
+
capabilities: MUSE_CAPABILITIES
|
|
104862
104931
|
}
|
|
104863
104932
|
];
|
|
104864
104933
|
function museModelsFromSettings(customModels, builtInModels = MUSE_BUILT_IN_MODELS) {
|
|
104865
|
-
return providerModelsFromSettings(builtInModels, customModels ?? [],
|
|
104934
|
+
return providerModelsFromSettings(builtInModels, customModels ?? [], MUSE_CAPABILITIES);
|
|
104866
104935
|
}
|
|
104867
104936
|
const discoverMuseModels = Effect.fn("discoverMuseModels")(function* (environment) {
|
|
104868
104937
|
return (yield* readMuseModelCatalog(environment)).map((model) => ({
|
|
@@ -104870,7 +104939,7 @@ const discoverMuseModels = Effect.fn("discoverMuseModels")(function* (environmen
|
|
|
104870
104939
|
name: model.name,
|
|
104871
104940
|
isCustom: false,
|
|
104872
104941
|
...model.isDefault ? { isDefault: true } : {},
|
|
104873
|
-
capabilities:
|
|
104942
|
+
capabilities: MUSE_CAPABILITIES
|
|
104874
104943
|
}));
|
|
104875
104944
|
});
|
|
104876
104945
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{n as t,r as n,t as r}from"./compiler-runtime-CLAvuQ-D.js";import{Dl as i,Et as a,Fa as o,Ga as s,Gr as c,Ha as l,Ia as ee,Oa as te,Ou as u,Pr as ne,Ua as d,Ul as f,Va as p,Wa as m,Yl as h,_n as g,au as _,b as v,cl as y,eu as re,gt as b,h as x,ht as S,ja as ie,ll as C,sl as ae,st as w,ul as T,vt as E,xn as D,zr as oe}from"./previewAssetResource-CVDZ-YAw.js";import{a as O,c as se,i as k,n as A,o as j,r as M,s as ce,t as le}from"./toggle-group-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{n as t,r as n,t as r}from"./compiler-runtime-CLAvuQ-D.js";import{Dl as i,Et as a,Fa as o,Ga as s,Gr as c,Ha as l,Ia as ee,Oa as te,Ou as u,Pr as ne,Ua as d,Ul as f,Va as p,Wa as m,Yl as h,_n as g,au as _,b as v,cl as y,eu as re,gt as b,h as x,ht as S,ja as ie,ll as C,sl as ae,st as w,ul as T,vt as E,xn as D,zr as oe}from"./previewAssetResource-CVDZ-YAw.js";import{a as O,c as se,i as k,n as A,o as j,r as M,s as ce,t as le}from"./toggle-group-U3M0YUkk.js";import{F as ue,Fr as de,I as fe,J as pe,L as me,Lr as he,Mr as ge,Nr as _e,R as N,Y as ve,_ as ye,_r as be,at as xe,cr as Se,ct as Ce,dr as we,fr as Te,h as Ee,hr as De,it as Oe,jr as ke,lr as Ae,lt as P,oi as je,or as Me,ot as Ne,pr as Pe,rt as Fe,si as Ie,sr as Le,st as Re,ur as ze,yr as Be,zr as Ve}from"./index-CBqRo4NV.js";import{a as He,n as Ue}from"./fileCommentAnnotations-Ddmzci4v.js";var We=T(`pilcrow`,[[`path`,{d:`M13 4v16`,key:`8vvj80`}],[`path`,{d:`M17 4v16`,key:`7dpous`}],[`path`,{d:`M19 4H9.5a4.5 4.5 0 0 0 0 9H13`,key:`sh4n9v`}]]),F=e(n(),1);function Ge({threadRef:e,filePath:t,activeCwd:n,openInEditor:r,openFileSurface:i}){if(e){if(i){i(t);return}w.getState().openFile(e,t);return}r(n?x(t,n):t)}var I=r();function Ke(e,t){let n=(0,I.c)(4),r=De(e,t),i;return n[0]!==r.data||n[1]!==r.error||n[2]!==r.isPending?(i={data:r.data,error:r.error,isPending:r.isPending},n[0]=r.data,n[1]=r.error,n[2]=r.isPending,n[3]=i):i=n[3],i}var L=t(),qe=[];function Je(e){return(e.endSide??e.side)===`deletions`?`deletions`:`additions`}function R(e,t,n){let r=Je(t),i=e.findIndex(e=>e.side===r&&e.lineNumber===t.end);return i<0?[...e,{side:r,lineNumber:t.end,metadata:{entries:[n]}}]:e.map((e,t)=>t===i?{...e,metadata:{entries:[...e.metadata.entries,n]}}:e)}function Ye(e){let t=(0,I.c)(50),{files:n,sectionId:r,sectionTitle:i,composerDraftTarget:a,options:o,viewerRef:s,className:l,renderHeaderPrefix:ee}=e,te=ne(Qe),u=ne(B),d;t[0]===a?d=t[1]:(d=e=>e.getComposerDraft(a)?.reviewComments??qe,t[0]=a,t[1]=d);let f=ne(d),[p,m]=(0,F.useState)(null),[h,g]=(0,F.useState)(null),_;t[2]===n?_=t[3]:(_=new Map(n.map(Ze)),t[2]=n,t[3]=_);let v=_,y;if(t[4]!==h||t[5]!==n||t[6]!==f||t[7]!==r){let e;t[9]!==h||t[10]!==f||t[11]!==r?(e=e=>{let{fileDiff:t,filePath:n,fileKey:i,collapsed:a}=e,o=f.filter(e=>e.sectionId===r&&e.filePath===n&&(e.fenceLanguage??`diff`)===`diff`).reduce((e,n)=>{let r=c(t,n);return r?R(e,r,{id:n.id,kind:`comment`,range:r,rangeLabel:n.rangeLabel,text:n.text}):e},[]),s=h?.fileKey===i?[...o,h.annotation]:o;return{id:i,type:`diff`,fileDiff:t,annotations:s,collapsed:a,version:Oe(`${a?`1`:`0`}:${s.flatMap(z).join(`:`)}`)}},t[9]=h,t[10]=f,t[11]=r,t[12]=e):e=t[12],y=n.map(e),t[4]=h,t[5]=n,t[6]=f,t[7]=r,t[8]=y}else y=t[8];let re=y,b;t[13]!==a||t[14]!==h?.annotation||t[15]!==u?(b=e=>{m(null),h?.annotation.metadata.entries.some(t=>t.id===e)?g(null):u(a,e)},t[13]=a,t[14]=h?.annotation,t[15]=u,t[16]=b):b=t[16];let x=b,S;t[17]!==te||t[18]!==a||t[19]!==h||t[20]!==v||t[21]!==r||t[22]!==i?(S=(e,t)=>{let n=h?.annotation.metadata.entries.find(t=>t.id===e),o=h?v.get(h.fileKey):void 0;if(!n||!o)return;let s=oe({id:n.id,sectionId:r,sectionTitle:i,filePath:o.filePath,fileDiff:o.fileDiff,range:n.range,text:t});s&&te(a,s),m(null),g(null)},t[17]=te,t[18]=a,t[19]=h,t[20]=v,t[21]=r,t[22]=i,t[23]=S):S=t[23];let ie=S,C;t[24]!==v||t[25]!==r||t[26]!==i?(C=(e,t)=>{if(!e)return;let n=t.item;if(n.type!==`diff`)return;let a=v.get(n.id);if(!a)return;let o=Ue(),s=oe({id:o,sectionId:r,sectionTitle:i,filePath:a.filePath,fileDiff:a.fileDiff,range:e,text:``});s&&g({fileKey:n.id,annotation:{side:Je(e),lineNumber:e.end,metadata:{entries:[{id:o,kind:`draft`,range:e,rangeLabel:s.rangeLabel,text:``}]}}})},t[24]=v,t[25]=r,t[26]=i,t[27]=C):C=t[27];let ae=C,w=h!==null,T;t[28]===s?T=t[29]:(T=s?{ref:s}:{},t[28]=s,t[29]=T);let E;t[30]===l?E=t[31]:(E=l?{className:l}:{},t[30]=l,t[31]=E);let D=!w,se=!w,k;t[32]!==ae||t[33]!==o||t[34]!==se||t[35]!==D?(k={...o,enableGutterUtility:D,enableLineSelection:se,onLineSelectionEnd:ae},t[32]=ae,t[33]=o,t[34]=se,t[35]=D,t[36]=k):k=t[36];let A;t[37]===ee?A=t[38]:(A=e=>e.type===`diff`?ee(e.fileDiff,e.id,e.collapsed===!0):null,t[37]=ee,t[38]=A);let j;t[39]!==x||t[40]!==ie?(j=e=>(0,L.jsx)(`div`,{className:`py-1`,children:e.metadata.entries.map(e=>(0,L.jsx)(He,{kind:e.kind,rangeLabel:e.rangeLabel,text:e.text,onCancel:()=>x(e.id),onComment:t=>ie(e.id,t),onDelete:()=>x(e.id)},e.id))}),t[39]=x,t[40]=ie,t[41]=j):j=t[41];let M;return t[42]!==re||t[43]!==p||t[44]!==k||t[45]!==A||t[46]!==j||t[47]!==T||t[48]!==E?(M=(0,L.jsx)(O,{...T,...E,items:re,selectedLines:p,onSelectedLinesChange:m,options:k,renderHeaderPrefix:A,renderAnnotation:j}),t[42]=re,t[43]=p,t[44]=k,t[45]=A,t[46]=j,t[47]=T,t[48]=E,t[49]=M):M=t[49],M}function z(e){return e.metadata.entries.map(Xe)}function Xe(e){return`${e.id}:${e.rangeLabel}:${e.text}`}function Ze(e){return[e.fileKey,e]}function B(e){return e.removeReviewComment}function Qe(e){return e.addReviewComment}function $e(e){return{diffPreview:f(e,{label:`environment-data:review:diff-preview`,tag:u.reviewGetDiffPreview,staleTimeMs:5e3})}}var et=$e(D);function V(e){return e.remoteName&&e.name.startsWith(`${e.remoteName}/`)?e.name.slice(e.remoteName.length+1):e.name}function tt(e,t){let n=new Set(t),r=e.map(e=>{let r=t.filter(t=>n.has(t)&&V(t)===e.name),i=r.find(e=>e.remoteName===`origin`)??r[0]??null;return i&&n.delete(i),{id:`local:${e.name}`,label:e.name,local:e,remote:i}}),i=t.filter(e=>n.has(e)).map(e=>({id:`remote:${e.name}`,label:e.name,local:null,remote:e}));return[...r,...i]}function nt(e,t){let n=t.trim().toLocaleLowerCase();return n.length===0?e:e.filter(e=>e.label.toLocaleLowerCase().includes(n)||e.local?.name.toLocaleLowerCase().includes(n)===!0||e.remote?.name.toLocaleLowerCase().includes(n)===!0)}var H=`__automatic_base_ref__`,rt=new Set,it=`
|
|
2
2
|
[data-diffs-header],
|
|
3
3
|
[data-diff],
|
|
4
4
|
[data-file],
|
|
@@ -95,4 +95,4 @@ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{n as t,r as n,t as r}f
|
|
|
95
95
|
text-decoration-color: currentColor;
|
|
96
96
|
}
|
|
97
97
|
`;function U({mode:e=`inline`,composerDraftTarget:t,initialGitScope:n,threadRef:r}){let{resolvedTheme:c}=v(),u=de(),[ne]=(0,F.useState)(n),[f,x]=(0,F.useState)(`stacked`),[w,T]=(0,F.useState)(u.wordWrap),[D,oe]=(0,F.useState)(u.diffIgnoreWhitespace),[O,ye]=(0,F.useState)(``),[De,Oe]=(0,F.useState)(()=>({scopeKey:null,fileKeys:rt})),He=(0,F.useRef)(null),Ue=r.threadId,I=_e(r),qe=I?.projectId??null,Je=ge(I&&qe?{environmentId:I.environmentId,projectId:qe}:null),R=I?.worktreePath??Je?.workspaceRoot,z=i(g.configValueAtom(I?.environmentId??null)),Xe=be(I?.environmentId??null,z?.availableEditors??[]),Ze=a(I!=null&&R!=null?ke.status({environmentId:I.environmentId,input:{cwd:R}}):null),B=N(e=>me(e.byThreadKey,r,ne===`unstaged`)),Qe=Ze.data?.isRepo??!0,{turnDiffSummaries:$e,inferredCheckpointTurnCountByTurnId:V}=fe(I),U=(0,F.useMemo)(()=>[...$e].toSorted((e,t)=>{let n=e.checkpointTurnCount??V[e.turnId]??0,r=t.checkpointTurnCount??V[t.turnId]??0;return n===r?t.completedAt.localeCompare(e.completedAt):r-n}),[V,$e]);(0,F.useEffect)(()=>{B.kind===`turn`&&N.getState().reconcileTurnSelection(r,U.map(e=>e.turnId))},[B,U,r]);let W=B.kind===`turn`?B.turnId:null,G=B.kind===`unstaged`?`unstaged`:`branch`,K=B.kind===`branch`?B.baseRef:null,at=B.kind===`turn`?B.filePath:null,ot=B.kind===`turn`?B.revealRequestId:0,q=W===null?void 0:U.find(e=>e.turnId===W)??U[0],J=q&&(q.checkpointTurnCount??V[q.turnId]),st=U[0],ct=W===null?G===`unstaged`?`Working tree`:`Branch changes`:q?.turnId===st?.turnId?`Latest turn`:`Turn ${J??`?`}`,lt=q?`turn:${q.turnId}`:G,Y=`${r.environmentId}:${r.threadId}:${lt}`,ut=De.scopeKey===Y?De.fileKeys:rt,dt=q?`Turn ${J??`?`}`:G===`unstaged`?`Working tree`:`Branch changes`,ft=(0,F.useMemo)(()=>typeof J==`number`?{fromTurnCount:Math.max(0,J-1),toTurnCount:J}:null,[J]),pt=Ke({environmentId:I?.environmentId??null,threadId:Ue,fromTurnCount:ft?.fromTurnCount??null,toTurnCount:ft?.toTurnCount??null,ignoreWhitespace:D,cacheScope:q?`turn:${q.turnId}`:null},{enabled:Qe&&q!==void 0}),mt=a(W===null&&I&&R?et.diffPreview({environmentId:I.environmentId,input:{cwd:R,...K?{baseRef:K}:{},ignoreWhitespace:D}}):null),ht=W===null&&mt.error?.includes(`configured workspace root`)===!0&&z?.cwd!==void 0&&z.cwd!==R,gt=a(ht&&I&&z?et.diffPreview({environmentId:I.environmentId,input:{cwd:z.cwd,...K?{baseRef:K}:{},ignoreWhitespace:D}}):null),X=ht?gt:mt,Z=X.data?.sources.find(e=>e.kind===(G===`unstaged`?`working-tree`:`branch-range`)),_t=a(W===null&&G===`branch`&&I&&X.data?.cwd?ke.listRefs({environmentId:I.environmentId,input:{cwd:X.data.cwd,includeMatchingRemoteRefs:!0,refKind:`local`,...O.trim().length>0?{query:O.trim()}:{},limit:100}}):null),vt=a(W===null&&G===`branch`&&I&&X.data?.cwd?ke.listRefs({environmentId:I.environmentId,input:{cwd:X.data.cwd,includeMatchingRemoteRefs:!0,refKind:`remote`,...O.trim().length>0?{query:O.trim()}:{},limit:100}}):null),yt=tt(_t.data?.refs.filter(e=>e.name!==Z?.headRef)??[],vt.data?.refs??[]),bt=nt(yt,O),xt=e=>K&&K===e.remote?.name?K:e.local?.name??e.remote?.name??e.id,St=[H,...yt.map(xt)],Ct=[...O.trim().length===0?[H]:[],...bt.map(xt)],wt=Z?.diff,Tt=q?pt.data?.diff:wt,Et=!q&&Z?.truncated===!0,Dt=q?pt.isPending:X.isPending,Ot=q?pt.error:X.error,kt=typeof Tt==`string`&&Tt.trim().length===0,Q=(0,F.useMemo)(()=>Re(Tt,`diff-panel:${c}`,{compactPartialHunkOffsets:W===null}),[c,Tt,W]),At=(0,F.useMemo)(()=>!Q||Q.kind!==`files`?[]:Q.files.toSorted((e,t)=>P(e).localeCompare(P(t),void 0,{numeric:!0,sensitivity:`base`})),[Q]),$=(0,F.useMemo)(()=>At.map(e=>{let t=Fe(e);return{fileDiff:e,filePath:P(e),fileKey:t,collapsed:ut.has(t)}}),[ut,At]),jt=(0,F.useMemo)(()=>$.map(e=>e.fileKey),[$]),Mt=M(jt,ut),Nt=(0,F.useMemo)(()=>Ne(At),[At]);(0,F.useEffect)(()=>{if(!at)return;let e=$.find(e=>e.filePath===at);e&&He.current?.scrollTo({type:`item`,id:e.fileKey,align:`start`})},[$,at,ot]);let Pt=ue({threadRef:r,workspaceRoot:R??null}),Ft=(0,F.useCallback)(e=>{Ge({threadRef:r,filePath:e,activeCwd:R,openFileSurface:Pt,openInEditor:e=>{(async()=>{let t=await Xe(e);t._tag===`Failure`&&!h(t)&&console.warn(`Failed to open diff file in editor.`,{operation:`open-diff-file`,environmentId:r.environmentId,threadId:r.threadId,..._(re(t))})})()}})},[R,Pt,Xe,r]),It=(0,F.useCallback)(e=>{Oe(t=>{let n=new Set(t.scopeKey===Y?t.fileKeys:[]);return n.has(e)?n.delete(e):n.add(e),{scopeKey:Y,fileKeys:n}})},[Y]),Lt=(0,F.useCallback)(()=>{Oe(e=>{let t=e.scopeKey===Y?e.fileKeys:rt;return{scopeKey:Y,fileKeys:k(jt,t)}})},[Y,jt]),Rt=e=>{N.getState().selectTurn(r,e)},zt=e=>{N.getState().selectGitScope(r,e)},Bt=e=>{N.getState().selectBranchBaseRef(r,e)};return(0,L.jsx)(ve,{mode:e,header:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3 [-webkit-app-region:no-drag]`,children:[(0,L.jsxs)(ie,{children:[(0,L.jsxs)(m,{className:`inline-flex h-6 max-w-full items-center gap-1 rounded-md bg-muted/70 px-2 text-xs font-medium text-foreground outline-none transition-colors hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring`,"aria-label":`Diff scope: ${ct}`,children:[(0,L.jsx)(`span`,{className:`truncate`,children:ct}),(0,L.jsx)(y,{className:`size-3.5 shrink-0 text-muted-foreground`})]}),(0,L.jsxs)(ee,{align:`start`,className:`w-60`,children:[(0,L.jsx)(o,{className:W===null&&G===`unstaged`?`bg-foreground/[0.08]`:void 0,onClick:()=>zt(`unstaged`),children:(0,L.jsx)(`span`,{children:`Working tree`})}),(0,L.jsx)(o,{className:W===null&&G===`branch`?`bg-foreground/[0.08]`:void 0,onClick:()=>zt(`branch`),children:(0,L.jsx)(`span`,{children:`Branch changes`})}),(0,L.jsx)(o,{className:W!==null&&q?.turnId===st?.turnId?`bg-foreground/[0.08]`:void 0,onClick:()=>{st&&Rt(st.turnId)},children:(0,L.jsx)(`span`,{children:`Latest turn`})}),(0,L.jsxs)(p,{children:[(0,L.jsx)(d,{children:`Turn`}),(0,L.jsx)(l,{className:`w-64`,children:U.map(e=>{let t=e.checkpointTurnCount??V[e.turnId]??`?`;return(0,L.jsxs)(o,{className:e.turnId===q?.turnId?`bg-foreground/[0.08]`:void 0,onClick:()=>Rt(e.turnId),children:[(0,L.jsxs)(`span`,{children:[`Turn `,t]}),(0,L.jsx)(`span`,{className:`ml-auto text-xs tabular-nums text-muted-foreground`,children:Be(e.completedAt,u.timestampFormat)})]},e.turnId)})})]})]})]}),W===null&&G===`branch`&&Z?.baseRef&&(0,L.jsxs)(`div`,{className:`flex min-w-0 max-w-full items-center gap-2 overflow-hidden text-xs text-muted-foreground`,title:`${Z.headRef??`HEAD`} → ${Z.baseRef}`,"aria-label":`Comparing ${Z.headRef??`HEAD`} against ${Z.baseRef}`,children:[(0,L.jsx)(`span`,{className:`min-w-0 max-w-48 truncate`,children:Z.headRef??`HEAD`}),(0,L.jsx)(Ie,{className:`size-3.5 shrink-0 opacity-70`}),(0,L.jsxs)(Le,{items:St,filteredItems:Ct,value:K??H,onOpenChange:e=>{e||ye(``)},onValueChange:e=>{e&&Bt(e===H?null:e)},children:[(0,L.jsxs)(Pe,{className:`inline-flex min-w-0 max-w-48 items-center gap-1 overflow-hidden rounded-md px-1.5 py-1 outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,"aria-label":`Change comparison target. Currently ${Z.baseRef}`,children:[(0,L.jsx)(`span`,{className:`min-w-0 truncate`,children:Z.baseRef}),(0,L.jsx)(y,{className:`size-3.5 shrink-0 opacity-70`})]}),(0,L.jsxs)(Te,{align:`start`,className:`w-72 min-w-0 max-w-[calc(100vw-1rem)] overflow-hidden [&>[data-slot=combobox-popup]]:min-w-0 [&>[data-slot=combobox-popup]]:overflow-hidden`,children:[(0,L.jsx)(`div`,{className:`min-w-0 shrink-0 px-3 pt-2.5`,children:(0,L.jsxs)(`div`,{className:`relative -translate-y-px border-b border-border/70 pb-1.5 transition-colors focus-within:border-ring`,children:[(0,L.jsx)(Ve,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1.5 left-0 size-4 shrink-0 text-muted-foreground/55`}),(0,L.jsx)(Ae,{className:`[&_input]:h-6.5 [&_input]:ps-5 [&_input]:font-sans [&_input]:leading-6.5`,inputClassName:`rounded-none bg-transparent text-sm`,placeholder:`Search refs...`,showTrigger:!1,size:`sm`,unstyled:!0,value:O,onChange:e=>ye(e.target.value)})]})}),(0,L.jsxs)(`div`,{className:`grid shrink-0 grid-cols-[1rem_minmax(0,1fr)] items-center gap-2 border-b border-border/70 ps-3 pe-6.5 pt-2 pb-1.5 font-medium text-[10px] text-muted-foreground uppercase tracking-wide`,children:[(0,L.jsx)(`span`,{"aria-hidden":`true`}),(0,L.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[minmax(0,1fr)_2rem] items-center`,children:[(0,L.jsx)(`span`,{children:`Branch`}),(0,L.jsx)(`span`,{className:`text-right`,children:`Remote`})]})]}),(0,L.jsx)(Se,{children:`No matching refs.`}),(0,L.jsxs)(we,{className:`max-h-64 min-w-0 overflow-x-hidden`,children:[(0,L.jsx)(ze,{className:`h-8 w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)] py-0`,contentClassName:`w-full min-w-0 overflow-hidden`,value:H,children:(0,L.jsx)(`span`,{className:`block min-w-0 truncate`,children:`Automatic`})}),yt.map(e=>{let t=xt(e),n=e.local!==null&&e.remote!==null,r=e.remote?.name===t;return(0,L.jsx)(ze,{className:`h-8 w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)] py-0`,contentClassName:`w-full min-w-0 overflow-hidden`,value:t,children:(0,L.jsxs)(`div`,{className:`grid w-full min-w-0 grid-cols-[minmax(0,1fr)_2rem] items-center overflow-hidden`,children:[(0,L.jsx)(`span`,{className:`block min-w-0 truncate pe-2`,children:e.label}),n?(0,L.jsx)(`div`,{className:`flex justify-end`,onClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),children:(0,L.jsx)(Me,{"aria-label":`Use remote version of ${e.label}`,checked:r,className:`[--thumb-size:--spacing(3)]`,onCheckedChange:t=>{let n=t?e.remote?.name:e.local?.name;n&&Bt(n)}})}):e.remote?(0,L.jsx)(`span`,{className:`flex justify-end text-muted-foreground`,title:`Remote only`,children:(0,L.jsx)(C,{"aria-hidden":`true`,className:`size-3`})}):null]})},e.id)})]})]})]})]})]}),(0,L.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 [-webkit-app-region:no-drag]`,children:[$.length>0&&(0,L.jsx)(Ee,{additions:Nt.additions,deletions:Nt.deletions,className:`mr-1 text-[11px]`,layout:`inline`}),$.length>0&&(0,L.jsxs)(S,{children:[(0,L.jsx)(E,{render:(0,L.jsx)(te,{type:`button`,size:`icon-xs`,variant:`outline`,"aria-label":Mt?`Expand all files`:`Collapse all files`,onClick:Lt}),children:Mt?(0,L.jsx)(je,{className:`size-3`}):(0,L.jsx)(se,{className:`size-3`})}),(0,L.jsx)(b,{side:`top`,children:Mt?`Expand all files`:`Collapse all files`})]}),(0,L.jsxs)(A,{className:`shrink-0`,variant:`outline`,size:`xs`,value:[f],onValueChange:e=>{let t=e[0];(t===`stacked`||t===`split`)&&x(t)},children:[(0,L.jsx)(le,{"aria-label":`Stacked diff view`,value:`stacked`,children:(0,L.jsx)(j,{className:`size-3`})}),(0,L.jsx)(le,{"aria-label":`Split diff view`,value:`split`,children:(0,L.jsx)(ce,{className:`size-3`})})]}),(0,L.jsxs)(S,{children:[(0,L.jsx)(E,{render:(0,L.jsx)(le,{"aria-label":w?`Disable diff line wrapping`:`Enable diff line wrapping`,variant:`outline`,size:`xs`,pressed:w,onPressedChange:e=>{T(!!e)}}),children:(0,L.jsx)(he,{className:`size-3`})}),(0,L.jsx)(b,{side:`top`,children:w?`Disable line wrapping`:`Enable line wrapping`})]}),(0,L.jsxs)(S,{children:[(0,L.jsx)(E,{render:(0,L.jsx)(le,{"aria-label":D?`Show whitespace changes`:`Hide whitespace changes`,variant:`outline`,size:`xs`,pressed:D,onPressedChange:e=>{oe(!!e)}}),children:(0,L.jsx)(We,{className:`size-3`})}),(0,L.jsx)(b,{side:`top`,children:D?`Show whitespace changes`:`Hide whitespace changes`})]})]})]}),children:I?Qe?W!==null&&U.length===0?(0,L.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`No completed turns yet.`}):(0,L.jsx)(L.Fragment,{children:(0,L.jsxs)(`div`,{className:`diff-panel-viewport flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:[Et&&(0,L.jsx)(`p`,{className:`shrink-0 border-b border-border/70 bg-muted/40 px-3 py-1.5 text-[11px] text-muted-foreground`,children:`This diff was truncated because it exceeded the preview limit. The changes shown are incomplete.`}),Ot&&!Q&&(0,L.jsx)(`div`,{className:`px-3`,children:(0,L.jsx)(`p`,{className:`mb-2 text-[11px] text-red-500/80`,children:Ot})}),Q?Q.kind===`files`?(0,L.jsx)(`div`,{className:`min-h-0 flex-1`,onClickCapture:e=>{let t=(e.nativeEvent.composedPath?.()??[]).find(e=>e instanceof HTMLElement&&e.hasAttribute(`data-title`))?.textContent?.trim();t&&Ft(t)},children:(0,L.jsx)(Ye,{viewerRef:He,className:`diff-render-surface h-full min-h-0 overflow-auto`,files:$,sectionId:lt,sectionTitle:dt,composerDraftTarget:t,renderHeaderPrefix:(e,t,n)=>{let r=P(e);return(0,L.jsxs)(S,{children:[(0,L.jsx)(E,{render:(0,L.jsx)(`button`,{type:`button`,className:s(`inline-flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-sm border-0 bg-transparent p-0 transition-colors hover:bg-foreground/10 focus-visible:outline-hidden`,xe(e)),"aria-label":n?`Expand ${r}`:`Collapse ${r}`,"aria-expanded":!n,onClick:e=>{e.stopPropagation(),It(t)}}),children:n?(0,L.jsx)(ae,{className:`size-4`}):(0,L.jsx)(y,{className:`size-4`})}),(0,L.jsx)(b,{side:`top`,children:n?`Expand diff`:`Collapse diff`})]})},options:{diffStyle:f===`split`?`split`:`unified`,lineDiffType:`none`,overflow:w?`wrap`:`scroll`,theme:Ce(c),themeType:c,unsafeCSS:it,stickyHeaders:!0,itemMetrics:{diffHeaderHeight:33},layout:{paddingTop:0,paddingBottom:8,gap:8}}},Y??lt)}):(0,L.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-2`,children:(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(`p`,{className:`text-[11px] text-muted-foreground/75`,children:Q.reason}),(0,L.jsx)(`pre`,{className:s(`max-h-[72vh] rounded-md border border-border/70 bg-background/70 p-3 font-mono text-[11px] leading-relaxed text-muted-foreground/90`,w?`overflow-auto whitespace-pre-wrap wrap-break-word`:`overflow-auto`),children:Q.text})]})}):Dt?(0,L.jsx)(pe,{label:q?`Loading checkpoint diff...`:G===`unstaged`?`Loading working tree diff...`:`Loading branch diff...`}):(0,L.jsx)(`div`,{className:`flex h-full items-center justify-center px-3 py-2 text-xs text-muted-foreground/70`,children:(0,L.jsx)(`p`,{children:kt?`No net changes in this selection.`:`No patch available for this selection.`})})]})}):(0,L.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`Turn diffs are unavailable because this project is not a git repository.`}):(0,L.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`Select a thread to inspect turn diffs.`})})}export{ye as DiffWorkerPoolProvider,U as default};
|
|
98
|
-
//# sourceMappingURL=DiffPanel-
|
|
98
|
+
//# sourceMappingURL=DiffPanel-DWdPV3K3.js.map
|