@liberseek/boft-cli-win32-arm64 0.8.5 → 0.8.6
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/README.md +2 -2
- package/THIRD_PARTY_NOTICES.txt +6 -2
- package/app/codexhost-distribution.json +1 -1
- package/app/console-server.mjs +70 -20
- package/app/console-web.js +61 -18
- package/app/desktop-controller.mjs +1142 -69
- package/app/host-runtime.mjs +3804 -1949
- package/app/plugins/antigravity/plugin.mjs +77 -9
- package/app/plugins/claude-code/plugin.mjs +27 -6
- package/app/plugins/codebuddy/plugin.mjs +25 -0
- package/app/plugins/codex-usage/plugin.mjs +15 -0
- package/app/plugins/copilot/plugin.mjs +15 -0
- package/app/plugins/cursor-cli/plugin.mjs +43 -8
- package/app/plugins/deepseek-harness/plugin.mjs +472 -44
- package/app/plugins/devin/assets/icon.svg +1 -0
- package/app/plugins/devin/manifest.json +30 -0
- package/app/plugins/devin/plugin.mjs +23425 -0
- package/app/plugins/enabled.json +2 -0
- package/app/plugins/grok/plugin.mjs +470 -387
- package/app/plugins/hermes/plugin.mjs +468 -196
- package/app/plugins/kimi-code/plugin.mjs +65 -3
- package/app/plugins/kiro-cli/plugin.mjs +15 -0
- package/app/plugins/muse/plugin.mjs +15 -0
- package/app/plugins/omp/plugin.mjs +15 -0
- package/app/plugins/opencode/plugin.mjs +15 -0
- package/app/plugins/pi/plugin.mjs +1595 -411
- package/app/plugins/qoder/plugin.mjs +9539 -8654
- package/app/plugins/qoder-cn/plugin.mjs +9539 -8654
- package/app/plugins/qwen-code/assets/icon.svg +1 -0
- package/app/plugins/qwen-code/manifest.json +29 -0
- package/app/plugins/qwen-code/plugin.mjs +29366 -0
- package/app/plugins/workbuddy/plugin.mjs +25 -0
- package/app/plugins/zcode/plugin.mjs +157 -9
- package/app/renderer-extension.js +727 -274
- package/bin/boft.exe +0 -0
- package/libexec/boft-node-repl.exe +0 -0
- package/libexec/boft-shim.exe +0 -0
- package/libexec/boft-updater.exe +0 -0
- package/licenses/Qwen-Code-SDK-LICENSE.txt +203 -0
- package/package.json +2 -2
|
@@ -16002,6 +16002,21 @@ var threadSteeringInspectParamsSchema = external_exports.object({
|
|
|
16002
16002
|
/** The text about to be steered; a Harness command always stops and restarts. */
|
|
16003
16003
|
text: external_exports.string().optional()
|
|
16004
16004
|
}).strict();
|
|
16005
|
+
var threadSteeringContextSchema = external_exports.object({
|
|
16006
|
+
kind: external_exports.literal("application"),
|
|
16007
|
+
value: external_exports.string().transform((text, context) => {
|
|
16008
|
+
try {
|
|
16009
|
+
return JSON.parse(text);
|
|
16010
|
+
} catch {
|
|
16011
|
+
context.addIssue({ code: "custom", message: "Invalid steering context JSON" });
|
|
16012
|
+
return external_exports.NEVER;
|
|
16013
|
+
}
|
|
16014
|
+
}).pipe(external_exports.object({
|
|
16015
|
+
expectedTurnId: hostTurnIdSchema,
|
|
16016
|
+
clientUserMessageId: external_exports.string().min(1),
|
|
16017
|
+
delivery: external_exports.enum(["newTurn", "activeTurn"])
|
|
16018
|
+
}).strict())
|
|
16019
|
+
}).strict().transform((context) => context.value);
|
|
16005
16020
|
var threadSteerDeliverySchema = external_exports.enum(["activeTurn", "newTurn"]);
|
|
16006
16021
|
var threadSteeringInspectResultSchema = external_exports.object({
|
|
16007
16022
|
delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
|
|
@@ -19136,6 +19151,32 @@ function createAntigravityUsageStatistics(environment) {
|
|
|
19136
19151
|
}
|
|
19137
19152
|
|
|
19138
19153
|
// dist/antigravity-adapter.js
|
|
19154
|
+
function unstreamedReplyTail(streamed, reply) {
|
|
19155
|
+
const shown = streamed.replace(/\s+/gu, "");
|
|
19156
|
+
if (shown === "")
|
|
19157
|
+
return null;
|
|
19158
|
+
const replied = reply.replace(/\s+/gu, "");
|
|
19159
|
+
if (shown.endsWith(replied))
|
|
19160
|
+
return "";
|
|
19161
|
+
let at = 0;
|
|
19162
|
+
let matched = 0;
|
|
19163
|
+
while (matched < shown.length && at < reply.length) {
|
|
19164
|
+
const char = reply[at] ?? "";
|
|
19165
|
+
if (/\s/u.test(char)) {
|
|
19166
|
+
at += 1;
|
|
19167
|
+
continue;
|
|
19168
|
+
}
|
|
19169
|
+
if (char !== shown[matched])
|
|
19170
|
+
return null;
|
|
19171
|
+
at += 1;
|
|
19172
|
+
matched += 1;
|
|
19173
|
+
}
|
|
19174
|
+
if (matched < shown.length)
|
|
19175
|
+
return null;
|
|
19176
|
+
const tail = reply.slice(at);
|
|
19177
|
+
const shownTrailing = /\s*$/u.exec(streamed)?.[0] ?? "";
|
|
19178
|
+
return tail.startsWith(shownTrailing) ? tail.slice(shownTrailing.length) : tail;
|
|
19179
|
+
}
|
|
19139
19180
|
var antigravityHarnessId = harnessIdSchema.parse("antigravity");
|
|
19140
19181
|
var DEFAULT_INSPECT_TIMEOUT_MS = 2e4;
|
|
19141
19182
|
var DEFAULT_PRINT_TIMEOUT = "30m";
|
|
@@ -19620,6 +19661,7 @@ var AntigravitySession = class {
|
|
|
19620
19661
|
logPath,
|
|
19621
19662
|
agentItem: null,
|
|
19622
19663
|
agentText: "",
|
|
19664
|
+
turnAgentText: "",
|
|
19623
19665
|
tools: /* @__PURE__ */ new Map(),
|
|
19624
19666
|
completedItems: [],
|
|
19625
19667
|
stderr: "",
|
|
@@ -19817,19 +19859,27 @@ ${line}`).slice(-8e3);
|
|
|
19817
19859
|
const repliedThisTurn = Boolean(active.agentItem) || turnReply.trim() !== "";
|
|
19818
19860
|
if (response)
|
|
19819
19861
|
this.#lastResultResponse = response;
|
|
19820
|
-
if (turnReply.trim() !== "")
|
|
19821
|
-
|
|
19862
|
+
if (turnReply.trim() !== "") {
|
|
19863
|
+
const unshown = unstreamedReplyTail(active.turnAgentText, turnReply);
|
|
19864
|
+
if (unshown === null)
|
|
19865
|
+
this.#appendOrSyncAgentText(active, turnReply, false);
|
|
19866
|
+
else if (unshown.trim() !== "")
|
|
19867
|
+
this.#appendAgentText(active, unshown);
|
|
19868
|
+
}
|
|
19869
|
+
if (!convId) {
|
|
19870
|
+
this.#completeIdentitylessTurn(active, event);
|
|
19871
|
+
return;
|
|
19872
|
+
}
|
|
19822
19873
|
const safeTurnId = event.result.num_turns !== void 0 && event.result.num_turns !== null ? `turn:${event.result.num_turns}` : `turn:${this.#history.snapshot().length + 1}`;
|
|
19823
|
-
const safeSessionId = convId || this.#nativeRef?.nativeSessionId || "unknown-session";
|
|
19824
19874
|
const nativeTurnRef = nativeTurnRefSchema.parse({
|
|
19825
19875
|
harnessId: this.harnessId,
|
|
19826
|
-
nativeSessionId:
|
|
19876
|
+
nativeSessionId: convId,
|
|
19827
19877
|
nativeTurnKey: safeTurnId,
|
|
19828
19878
|
formatVersion: 1
|
|
19829
19879
|
});
|
|
19830
19880
|
const checkpoint = nativeCheckpointRefSchema.parse({
|
|
19831
19881
|
harnessId: this.harnessId,
|
|
19832
|
-
nativeSessionId:
|
|
19882
|
+
nativeSessionId: convId,
|
|
19833
19883
|
checkpointId: safeTurnId,
|
|
19834
19884
|
formatVersion: 1
|
|
19835
19885
|
});
|
|
@@ -19846,16 +19896,33 @@ ${line}`).slice(-8e3);
|
|
|
19846
19896
|
this.#completeTurn(active, { status: "succeeded", checkpoint }, nativeTurnRef);
|
|
19847
19897
|
}
|
|
19848
19898
|
} else {
|
|
19849
|
-
const
|
|
19850
|
-
|
|
19851
|
-
const error51 = normalizedProcessError(errorDetail, `Antigravity Turn ended with status ${event.result.status}`, nativeError !== void 0);
|
|
19852
|
-
if (repliedThisTurn && nativeError && this.#reportedEarlier(error51)) {
|
|
19899
|
+
const error51 = this.#resultError(active, event);
|
|
19900
|
+
if (repliedThisTurn && event.result.error?.trim() && this.#reportedEarlier(error51)) {
|
|
19853
19901
|
this.#completeTurn(active, { status: "succeeded", checkpoint }, nativeTurnRef);
|
|
19854
19902
|
} else {
|
|
19855
19903
|
this.#completeTurn(active, { status: "failed", error: error51, checkpoint }, nativeTurnRef);
|
|
19856
19904
|
}
|
|
19857
19905
|
}
|
|
19858
19906
|
}
|
|
19907
|
+
/** A Turn agy ended without a Conversation keeps its native outcome but no native identity. */
|
|
19908
|
+
#completeIdentitylessTurn(active, event) {
|
|
19909
|
+
if (active.cancellationRequested) {
|
|
19910
|
+
this.#completeTurn(active, { status: "cancelled", reason: "Cancelled by user" });
|
|
19911
|
+
return;
|
|
19912
|
+
}
|
|
19913
|
+
this.#completeTurn(active, {
|
|
19914
|
+
status: "failed",
|
|
19915
|
+
error: event.result.status === "SUCCESS" ? {
|
|
19916
|
+
code: "protocolError",
|
|
19917
|
+
message: "Antigravity finished the Turn without a Conversation identity",
|
|
19918
|
+
retryable: true
|
|
19919
|
+
} : this.#resultError(active, event)
|
|
19920
|
+
});
|
|
19921
|
+
}
|
|
19922
|
+
#resultError(active, event) {
|
|
19923
|
+
const nativeError = event.result.error?.trim();
|
|
19924
|
+
return normalizedProcessError(nativeError || active.stderr, `Antigravity Turn ended with status ${event.result.status}`, nativeError !== void 0);
|
|
19925
|
+
}
|
|
19859
19926
|
#reportedEarlier(error51) {
|
|
19860
19927
|
return this.#history.snapshot().some(({ outcome }) => outcome.status === "failed" && outcome.error.code === error51.code && outcome.error.message === error51.message);
|
|
19861
19928
|
}
|
|
@@ -20002,6 +20069,7 @@ ${line}`).slice(-8e3);
|
|
|
20002
20069
|
this.#appendAgentText(active, text);
|
|
20003
20070
|
}
|
|
20004
20071
|
#appendAgentText(active, text) {
|
|
20072
|
+
active.turnAgentText += text;
|
|
20005
20073
|
if (!active.agentItem) {
|
|
20006
20074
|
active.agentItem = { type: "agentMessage", itemId: this.#newItemId(), text };
|
|
20007
20075
|
active.agentText = text;
|
|
@@ -15596,6 +15596,21 @@ var threadSteeringInspectParamsSchema = external_exports.object({
|
|
|
15596
15596
|
/** The text about to be steered; a Harness command always stops and restarts. */
|
|
15597
15597
|
text: external_exports.string().optional()
|
|
15598
15598
|
}).strict();
|
|
15599
|
+
var threadSteeringContextSchema = external_exports.object({
|
|
15600
|
+
kind: external_exports.literal("application"),
|
|
15601
|
+
value: external_exports.string().transform((text2, context) => {
|
|
15602
|
+
try {
|
|
15603
|
+
return JSON.parse(text2);
|
|
15604
|
+
} catch {
|
|
15605
|
+
context.addIssue({ code: "custom", message: "Invalid steering context JSON" });
|
|
15606
|
+
return external_exports.NEVER;
|
|
15607
|
+
}
|
|
15608
|
+
}).pipe(external_exports.object({
|
|
15609
|
+
expectedTurnId: hostTurnIdSchema,
|
|
15610
|
+
clientUserMessageId: external_exports.string().min(1),
|
|
15611
|
+
delivery: external_exports.enum(["newTurn", "activeTurn"])
|
|
15612
|
+
}).strict())
|
|
15613
|
+
}).strict().transform((context) => context.value);
|
|
15599
15614
|
var threadSteerDeliverySchema = external_exports.enum(["activeTurn", "newTurn"]);
|
|
15600
15615
|
var threadSteeringInspectResultSchema = external_exports.object({
|
|
15601
15616
|
delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
|
|
@@ -55783,6 +55798,8 @@ function conversationMessages(values, sessionId) {
|
|
|
55783
55798
|
uuid: value.uuid,
|
|
55784
55799
|
message: value.message,
|
|
55785
55800
|
timestampMs: isoToMs(value.timestamp),
|
|
55801
|
+
// Failure metadata belongs to the outer SDK/transcript record, not its Message.
|
|
55802
|
+
failed: value.type === "assistant" && (typeof value.error === "string" || value.isApiErrorMessage === true),
|
|
55786
55803
|
nested: typeof value.parent_tool_use_id === "string" && value.parent_tool_use_id.length > 0,
|
|
55787
55804
|
interrupted,
|
|
55788
55805
|
startsTurn: false,
|
|
@@ -55848,7 +55865,7 @@ function turnOutcome(messages) {
|
|
|
55848
55865
|
if (messages.some(({ interrupted }) => interrupted))
|
|
55849
55866
|
return { status: "cancelled", reason: "Cancelled by user" };
|
|
55850
55867
|
const assistants = messages.filter(({ type }) => type === "assistant");
|
|
55851
|
-
const failed = assistants.some(({
|
|
55868
|
+
const failed = assistants.some(({ failed: failed2, nested }) => failed2 && !nested);
|
|
55852
55869
|
if (failed) {
|
|
55853
55870
|
return {
|
|
55854
55871
|
status: "failed",
|
|
@@ -55941,6 +55958,7 @@ function mapClaudeSnapshot(values, sessionId) {
|
|
|
55941
55958
|
}
|
|
55942
55959
|
if (message.type !== "assistant")
|
|
55943
55960
|
return [];
|
|
55961
|
+
const assistantOutcome = outcome.status === "failed" && (!message.failed || message.nested) ? { status: "succeeded" } : itemOutcome(outcome);
|
|
55944
55962
|
const content = message.message.content;
|
|
55945
55963
|
const text2 = textParts(content).join("");
|
|
55946
55964
|
const reasoning = thinkingParts(content).join("");
|
|
@@ -55953,7 +55971,7 @@ function mapClaudeSnapshot(values, sessionId) {
|
|
|
55953
55971
|
text: text2,
|
|
55954
55972
|
...recordDurationMs !== void 0 ? { durationMs: recordDurationMs } : {}
|
|
55955
55973
|
},
|
|
55956
|
-
outcome:
|
|
55974
|
+
outcome: assistantOutcome
|
|
55957
55975
|
}
|
|
55958
55976
|
] : [];
|
|
55959
55977
|
}
|
|
@@ -55971,7 +55989,7 @@ function mapClaudeSnapshot(values, sessionId) {
|
|
|
55971
55989
|
text: reasoning,
|
|
55972
55990
|
...recordDurationMs !== void 0 ? { durationMs: recordDurationMs } : {}
|
|
55973
55991
|
},
|
|
55974
|
-
outcome:
|
|
55992
|
+
outcome: assistantOutcome
|
|
55975
55993
|
});
|
|
55976
55994
|
projectedReasoning = true;
|
|
55977
55995
|
continue;
|
|
@@ -55984,7 +56002,7 @@ function mapClaudeSnapshot(values, sessionId) {
|
|
|
55984
56002
|
text: text2,
|
|
55985
56003
|
...recordDurationMs !== void 0 ? { durationMs: recordDurationMs } : {}
|
|
55986
56004
|
},
|
|
55987
|
-
outcome:
|
|
56005
|
+
outcome: assistantOutcome
|
|
55988
56006
|
});
|
|
55989
56007
|
projectedText = true;
|
|
55990
56008
|
continue;
|
|
@@ -58174,7 +58192,8 @@ var ClaudeSdkTransport = class {
|
|
|
58174
58192
|
const activeQuery = this.#query;
|
|
58175
58193
|
if (!activeQuery)
|
|
58176
58194
|
throw new Error("Claude SDK transport is not running");
|
|
58177
|
-
this.#idleAccumulator
|
|
58195
|
+
const idle = this.#idleAccumulator ??= new ClaudeNativeTurnAccumulator(this.#provider ? { provider: this.#provider } : {});
|
|
58196
|
+
idle.requestCancel();
|
|
58178
58197
|
try {
|
|
58179
58198
|
await this.#stopRequest(activeQuery.interrupt(), INTERRUPT_TIMEOUT_MESSAGE);
|
|
58180
58199
|
} catch (error52) {
|
|
@@ -60657,7 +60676,9 @@ var ClaudeHarnessSession = class {
|
|
|
60657
60676
|
active.cancellationRequested = true;
|
|
60658
60677
|
const transport = this.#transport;
|
|
60659
60678
|
const taskIds = this.#backgroundTaskIds(active);
|
|
60660
|
-
if (transport && (taskIds.length > 0 ||
|
|
60679
|
+
if (transport && (taskIds.length > 0 || // A written steer survives the interrupt and runs as Claude's next native turn, so the
|
|
60680
|
+
// Turn stays open to interrupt that turn too instead of leaking it into the next one.
|
|
60681
|
+
active.steersAwaitingNative.size > 0 || active.held && (active.rootSegmentActive || this.#occupancy.awaitingContinuation))) {
|
|
60661
60682
|
await this.#cancelBackgroundWork(active, transport, taskIds);
|
|
60662
60683
|
return { ok: true, value: { cancellationRequested: true } };
|
|
60663
60684
|
}
|
|
@@ -16072,6 +16072,21 @@ var threadSteeringInspectParamsSchema = external_exports.object({
|
|
|
16072
16072
|
/** The text about to be steered; a Harness command always stops and restarts. */
|
|
16073
16073
|
text: external_exports.string().optional()
|
|
16074
16074
|
}).strict();
|
|
16075
|
+
var threadSteeringContextSchema = external_exports.object({
|
|
16076
|
+
kind: external_exports.literal("application"),
|
|
16077
|
+
value: external_exports.string().transform((text2, context) => {
|
|
16078
|
+
try {
|
|
16079
|
+
return JSON.parse(text2);
|
|
16080
|
+
} catch {
|
|
16081
|
+
context.addIssue({ code: "custom", message: "Invalid steering context JSON" });
|
|
16082
|
+
return external_exports.NEVER;
|
|
16083
|
+
}
|
|
16084
|
+
}).pipe(external_exports.object({
|
|
16085
|
+
expectedTurnId: hostTurnIdSchema,
|
|
16086
|
+
clientUserMessageId: external_exports.string().min(1),
|
|
16087
|
+
delivery: external_exports.enum(["newTurn", "activeTurn"])
|
|
16088
|
+
}).strict())
|
|
16089
|
+
}).strict().transform((context) => context.value);
|
|
16075
16090
|
var threadSteerDeliverySchema = external_exports.enum(["activeTurn", "newTurn"]);
|
|
16076
16091
|
var threadSteeringInspectResultSchema = external_exports.object({
|
|
16077
16092
|
delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
|
|
@@ -18403,6 +18418,16 @@ function snapshotFromHistory(contents, ref, cwd, profile = CODEBUDDY_RUNTIME_PRO
|
|
|
18403
18418
|
continue;
|
|
18404
18419
|
if (supportsNativeCommands && row.type === "message" && row.role === "user" && data.agent === "compact" && !manualCompactions.has(text(row.id)))
|
|
18405
18420
|
continue;
|
|
18421
|
+
if (row.type === "message" && row.role === "user" && data.startsNewUserRequest === false && !localCommand && data.agent !== "compact" && !isNativeCompactionSummary(row)) {
|
|
18422
|
+
const contextOnly = body.trim().length > 0 && body.replace(/<system-reminder\b[^>]*\sdata-role=(["'])user-context\1[^>]*>[\s\S]*?<\/system-reminder>/gu, "").trim().length === 0;
|
|
18423
|
+
if (data.isMeta === true || contextOnly)
|
|
18424
|
+
continue;
|
|
18425
|
+
if (current) {
|
|
18426
|
+
if (body)
|
|
18427
|
+
current.input.push({ type: "text", text: body });
|
|
18428
|
+
continue;
|
|
18429
|
+
}
|
|
18430
|
+
}
|
|
18406
18431
|
if (includeCompactionHistory && isNativeCompactionSummary(row)) {
|
|
18407
18432
|
if (supportsNativeCommands && current) {
|
|
18408
18433
|
const outcome = data.isCompacted === true ? { status: "succeeded" } : {
|
|
@@ -15590,6 +15590,21 @@ var threadSteeringInspectParamsSchema = external_exports.object({
|
|
|
15590
15590
|
/** The text about to be steered; a Harness command always stops and restarts. */
|
|
15591
15591
|
text: external_exports.string().optional()
|
|
15592
15592
|
}).strict();
|
|
15593
|
+
var threadSteeringContextSchema = external_exports.object({
|
|
15594
|
+
kind: external_exports.literal("application"),
|
|
15595
|
+
value: external_exports.string().transform((text2, context) => {
|
|
15596
|
+
try {
|
|
15597
|
+
return JSON.parse(text2);
|
|
15598
|
+
} catch {
|
|
15599
|
+
context.addIssue({ code: "custom", message: "Invalid steering context JSON" });
|
|
15600
|
+
return external_exports.NEVER;
|
|
15601
|
+
}
|
|
15602
|
+
}).pipe(external_exports.object({
|
|
15603
|
+
expectedTurnId: hostTurnIdSchema,
|
|
15604
|
+
clientUserMessageId: external_exports.string().min(1),
|
|
15605
|
+
delivery: external_exports.enum(["newTurn", "activeTurn"])
|
|
15606
|
+
}).strict())
|
|
15607
|
+
}).strict().transform((context) => context.value);
|
|
15593
15608
|
var threadSteerDeliverySchema = external_exports.enum(["activeTurn", "newTurn"]);
|
|
15594
15609
|
var threadSteeringInspectResultSchema = external_exports.object({
|
|
15595
15610
|
delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
|
|
@@ -19647,6 +19647,21 @@ var threadSteeringInspectParamsSchema = external_exports.object({
|
|
|
19647
19647
|
/** The text about to be steered; a Harness command always stops and restarts. */
|
|
19648
19648
|
text: external_exports.string().optional()
|
|
19649
19649
|
}).strict();
|
|
19650
|
+
var threadSteeringContextSchema = external_exports.object({
|
|
19651
|
+
kind: external_exports.literal("application"),
|
|
19652
|
+
value: external_exports.string().transform((text, context) => {
|
|
19653
|
+
try {
|
|
19654
|
+
return JSON.parse(text);
|
|
19655
|
+
} catch {
|
|
19656
|
+
context.addIssue({ code: "custom", message: "Invalid steering context JSON" });
|
|
19657
|
+
return external_exports.NEVER;
|
|
19658
|
+
}
|
|
19659
|
+
}).pipe(external_exports.object({
|
|
19660
|
+
expectedTurnId: hostTurnIdSchema,
|
|
19661
|
+
clientUserMessageId: external_exports.string().min(1),
|
|
19662
|
+
delivery: external_exports.enum(["newTurn", "activeTurn"])
|
|
19663
|
+
}).strict())
|
|
19664
|
+
}).strict().transform((context) => context.value);
|
|
19650
19665
|
var threadSteerDeliverySchema = external_exports.enum(["activeTurn", "newTurn"]);
|
|
19651
19666
|
var threadSteeringInspectResultSchema = external_exports.object({
|
|
19652
19667
|
delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
|
|
@@ -15957,6 +15957,21 @@ var threadSteeringInspectParamsSchema = external_exports.object({
|
|
|
15957
15957
|
/** The text about to be steered; a Harness command always stops and restarts. */
|
|
15958
15958
|
text: external_exports.string().optional()
|
|
15959
15959
|
}).strict();
|
|
15960
|
+
var threadSteeringContextSchema = external_exports.object({
|
|
15961
|
+
kind: external_exports.literal("application"),
|
|
15962
|
+
value: external_exports.string().transform((text, context) => {
|
|
15963
|
+
try {
|
|
15964
|
+
return JSON.parse(text);
|
|
15965
|
+
} catch {
|
|
15966
|
+
context.addIssue({ code: "custom", message: "Invalid steering context JSON" });
|
|
15967
|
+
return external_exports.NEVER;
|
|
15968
|
+
}
|
|
15969
|
+
}).pipe(external_exports.object({
|
|
15970
|
+
expectedTurnId: hostTurnIdSchema,
|
|
15971
|
+
clientUserMessageId: external_exports.string().min(1),
|
|
15972
|
+
delivery: external_exports.enum(["newTurn", "activeTurn"])
|
|
15973
|
+
}).strict())
|
|
15974
|
+
}).strict().transform((context) => context.value);
|
|
15960
15975
|
var threadSteerDeliverySchema = external_exports.enum(["activeTurn", "newTurn"]);
|
|
15961
15976
|
var threadSteeringInspectResultSchema = external_exports.object({
|
|
15962
15977
|
delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
|
|
@@ -17095,6 +17110,16 @@ function cursorConfigDirectory(environment) {
|
|
|
17095
17110
|
const home = environment.HOME ?? environment.USERPROFILE ?? os2.homedir();
|
|
17096
17111
|
return environment.CURSOR_CONFIG_DIR?.trim() ? path6.resolve(environment.CURSOR_CONFIG_DIR) : environment.XDG_CONFIG_HOME?.trim() ? path6.resolve(environment.XDG_CONFIG_HOME, "cursor") : path6.join(home, ".cursor");
|
|
17097
17112
|
}
|
|
17113
|
+
function cursorCliApprovalModeIsUnrestricted(environment, cwd = process.cwd()) {
|
|
17114
|
+
try {
|
|
17115
|
+
const home = (process.platform === "win32" ? environment.USERPROFILE : environment.HOME) ?? os2.userInfo().homedir;
|
|
17116
|
+
const directory = environment.CURSOR_CONFIG_DIR?.trim() ? environment.CURSOR_CONFIG_DIR : environment.XDG_CONFIG_HOME?.trim() ? path6.join(environment.XDG_CONFIG_HOME, "cursor") : path6.join(home, ".cursor");
|
|
17117
|
+
const raw = JSON.parse(readFileSync(path6.resolve(cwd, directory, "cli-config.json"), "utf8"));
|
|
17118
|
+
return !!raw && typeof raw === "object" && !Array.isArray(raw) && raw.approvalMode === "unrestricted";
|
|
17119
|
+
} catch {
|
|
17120
|
+
return false;
|
|
17121
|
+
}
|
|
17122
|
+
}
|
|
17098
17123
|
function cursorSessionDirectory(sessionId, environment) {
|
|
17099
17124
|
if (!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu.test(sessionId))
|
|
17100
17125
|
throw new Error("Unsupported Cursor native session ID");
|
|
@@ -17191,7 +17216,8 @@ function readCursorNativeHistory(sessionId, cwd, environment, allowMissing = fal
|
|
|
17191
17216
|
result.push({
|
|
17192
17217
|
id,
|
|
17193
17218
|
text: one(user, 1).toString("utf8"),
|
|
17194
|
-
...rewindRoot ? { rewindRoot } : {}
|
|
17219
|
+
...rewindRoot ? { rewindRoot } : {},
|
|
17220
|
+
...user.get(15)?.length ? { notification: true } : {}
|
|
17195
17221
|
});
|
|
17196
17222
|
}
|
|
17197
17223
|
}
|
|
@@ -17465,12 +17491,17 @@ function cursorCatalog(info) {
|
|
|
17465
17491
|
const native = cursorModels(info);
|
|
17466
17492
|
const thinking = /* @__PURE__ */ new Map();
|
|
17467
17493
|
const models = native.models.map((model2) => {
|
|
17468
|
-
const
|
|
17494
|
+
const live = model2.value === native.current;
|
|
17495
|
+
const config2 = live ? info.configOptions : info.nativeModels?.find((entry) => entry.value === model2.value)?.configOptions;
|
|
17469
17496
|
const options = cursorThinking(config2);
|
|
17470
17497
|
for (const { id, label } of options)
|
|
17471
17498
|
thinking.set(id, { id, label });
|
|
17472
17499
|
return {
|
|
17473
|
-
|
|
17500
|
+
// Only the live model's parameters reflect the user's Cursor settings. The parameterized
|
|
17501
|
+
// catalog reports Cursor's built-in defaults for every other model (for example
|
|
17502
|
+
// `fast=true`), so pinning them would override the user's remembered per-model parameters.
|
|
17503
|
+
// A bare Ref selects only the model and lets Cursor apply those parameters itself.
|
|
17504
|
+
ref: live ? cursorConfiguredModelRef(model2.value, config2) : cursorModelRef(model2.value),
|
|
17474
17505
|
label: model2.name,
|
|
17475
17506
|
supportedThinkingOptionIds: options.map(({ id }) => id)
|
|
17476
17507
|
};
|
|
@@ -21769,7 +21800,8 @@ var CursorTransport = class {
|
|
|
21769
21800
|
return this.#preparation ??= this.#prepare();
|
|
21770
21801
|
}
|
|
21771
21802
|
async #prepare() {
|
|
21772
|
-
const
|
|
21803
|
+
const useForce = this.options.executionPolicy === "unattended-full-access" || cursorCliApprovalModeIsUnrestricted(this.options.environment, this.options.cwd);
|
|
21804
|
+
const invocation = cursorInvocation(this.options.environment, this.options.command, useForce ? ["--force", "acp"] : ["acp"]);
|
|
21773
21805
|
const child = spawn(invocation.command, invocation.arguments, {
|
|
21774
21806
|
cwd: this.options.cwd,
|
|
21775
21807
|
env: this.options.environment,
|
|
@@ -23858,19 +23890,22 @@ var CursorSession = class {
|
|
|
23858
23890
|
const administrative = promptText.trim().toLowerCase() === "/copy-request-id";
|
|
23859
23891
|
if (administrative && JSON.stringify(before) === JSON.stringify(after)) {
|
|
23860
23892
|
} else {
|
|
23861
|
-
|
|
23893
|
+
const prompted = added.filter((turn) => !turn.notification);
|
|
23894
|
+
const own = prompted[0];
|
|
23895
|
+
if (!own || prompted.length !== 1 || after.length !== before.length + added.length || before.some((turn, index) => after[index]?.id !== turn.id) || own.text !== promptText)
|
|
23862
23896
|
throw new Error("Cursor terminal has no unique, verified native turn identity");
|
|
23863
23897
|
nativeTurnRef = nativeTurnRefSchema.parse({
|
|
23864
23898
|
harnessId: "cursor-cli",
|
|
23865
23899
|
nativeSessionId: this.transport.sessionId,
|
|
23866
|
-
nativeTurnKey:
|
|
23900
|
+
nativeTurnKey: own.id,
|
|
23867
23901
|
formatVersion: 1
|
|
23868
23902
|
});
|
|
23869
23903
|
this.#fresh = false;
|
|
23870
|
-
|
|
23904
|
+
const ownIndex = after.findIndex((turn) => turn.id === own.id);
|
|
23905
|
+
if (outcome.status === "succeeded" && cursorForkAvailable() && (ownIndex === after.length - 1 || after[ownIndex + 1]?.rewindRoot))
|
|
23871
23906
|
outcome = {
|
|
23872
23907
|
...outcome,
|
|
23873
|
-
checkpoint: cursorCheckpoint(this.transport.sessionId,
|
|
23908
|
+
checkpoint: cursorCheckpoint(this.transport.sessionId, own.id)
|
|
23874
23909
|
};
|
|
23875
23910
|
}
|
|
23876
23911
|
} catch (error51) {
|