@moxt-ai/mobius 0.0.467 → 0.0.468
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/{chunk-KOLL57ZM.js → chunk-EQCEQBVF.js} +156 -63
- package/dist/{chunk-KOLL57ZM.js.map → chunk-EQCEQBVF.js.map} +3 -3
- package/dist/{chunk-X64YZNBY.js → chunk-F2UGQLBO.js} +2 -2
- package/dist/{chunk-X64YZNBY.js.map → chunk-F2UGQLBO.js.map} +1 -1
- package/dist/{cli-AYBTKEFI.js → cli-CMAJVOVM.js} +3 -3
- package/dist/cli.js +2 -2
- package/dist/engine/acp/adapter/codex/agent-connection.d.ts.map +1 -1
- package/dist/engine/acp/adapter/codex/agent-connection.js +1 -0
- package/dist/engine/acp/adapter/codex/agent-connection.js.map +1 -1
- package/dist/engine/acp/adapter/execution-connections.d.ts.map +1 -1
- package/dist/engine/acp/adapter/execution-connections.js +1 -0
- package/dist/engine/acp/adapter/execution-connections.js.map +1 -1
- package/dist/engine/acp/adapter/session-events.d.ts +3 -1
- package/dist/engine/acp/adapter/session-events.d.ts.map +1 -1
- package/dist/engine/acp/adapter/session-events.js +1 -0
- package/dist/engine/acp/adapter/session-events.js.map +1 -1
- package/dist/engine/acp/agent/in-process-endpoint.d.ts +5 -0
- package/dist/engine/acp/agent/in-process-endpoint.d.ts.map +1 -1
- package/dist/engine/acp/connection/agent-connection.d.ts +2 -1
- package/dist/engine/acp/connection/agent-connection.d.ts.map +1 -1
- package/dist/engine/acp/harness/codex/agent.d.ts.map +1 -1
- package/dist/engine/acp/harness/codex/agent.js +10 -7
- package/dist/engine/acp/harness/codex/agent.js.map +1 -1
- package/dist/engine/acp/harness/codex/app-server-protocol.d.ts +8 -0
- package/dist/engine/acp/harness/codex/app-server-protocol.d.ts.map +1 -1
- package/dist/engine/acp/harness/codex/app-server-protocol.js +5 -2
- package/dist/engine/acp/harness/codex/app-server-protocol.js.map +1 -1
- package/dist/engine/acp/harness/codex/owned-agent.d.ts +2 -1
- package/dist/engine/acp/harness/codex/owned-agent.d.ts.map +1 -1
- package/dist/engine/acp/harness/codex/owned-agent.js +100 -31
- package/dist/engine/acp/harness/codex/owned-agent.js.map +1 -1
- package/dist/engine/acp/harness/codex/session-update.d.ts +2 -1
- package/dist/engine/acp/harness/codex/session-update.d.ts.map +1 -1
- package/dist/engine/acp/harness/codex/session-update.js.map +1 -1
- package/dist/engine/session/live/agent-session.d.ts.map +1 -1
- package/dist/engine/session/live/agent-session.js +29 -10
- package/dist/engine/session/live/agent-session.js.map +1 -1
- package/dist/engine.js +2 -2
- package/package.json +1 -1
- /package/dist/{cli-AYBTKEFI.js.map → cli-CMAJVOVM.js.map} +0 -0
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
__toESM,
|
|
6
6
|
__using,
|
|
7
7
|
package_default
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-F2UGQLBO.js";
|
|
9
9
|
|
|
10
10
|
// ../../node_modules/.pnpm/ignore@7.0.9/node_modules/ignore/index.js
|
|
11
11
|
var require_ignore = __commonJS({
|
|
@@ -77808,12 +77808,16 @@ var threadTurnsSchema = external_exports.array(threadTurnSchema).max(1e5);
|
|
|
77808
77808
|
var collaborationModeSchema = external_exports.object({
|
|
77809
77809
|
mode: external_exports.enum(["default", "plan"])
|
|
77810
77810
|
});
|
|
77811
|
+
var threadTitleSchema = external_exports.string().transform((value) => value.slice(0, 500));
|
|
77812
|
+
var threadNameResponseSchema = external_exports.object({
|
|
77813
|
+
thread: external_exports.object({ id: boundedText(256), name: threadTitleSchema.nullish() })
|
|
77814
|
+
});
|
|
77811
77815
|
var threadLifecycleResponseSchema = external_exports.object({
|
|
77812
77816
|
collaborationMode: collaborationModeSchema.nullish(),
|
|
77813
77817
|
model: boundedText(256).nullish(),
|
|
77814
77818
|
reasoningEffort: boundedText(256).nullish(),
|
|
77815
77819
|
serviceTier: boundedText(256).nullish(),
|
|
77816
|
-
thread:
|
|
77820
|
+
thread: threadNameResponseSchema.shape.thread.extend({ turns: threadTurnsSchema })
|
|
77817
77821
|
});
|
|
77818
77822
|
var CODEX_HISTORY_TURN_PAGE_LIMIT = 20;
|
|
77819
77823
|
var threadTurnsPageSchema = external_exports.object({
|
|
@@ -77822,7 +77826,6 @@ var threadTurnsPageSchema = external_exports.object({
|
|
|
77822
77826
|
});
|
|
77823
77827
|
var threadResumeResponseSchema = threadLifecycleResponseSchema;
|
|
77824
77828
|
var threadForkResponseSchema = threadLifecycleResponseSchema;
|
|
77825
|
-
var threadTitleSchema = external_exports.string().transform((value) => value.slice(0, 500));
|
|
77826
77829
|
var threadSummarySchema = external_exports.object({
|
|
77827
77830
|
cwd: boundedText(2048),
|
|
77828
77831
|
id: boundedText(256),
|
|
@@ -78401,6 +78404,8 @@ var APPROVAL_TIMEOUT_MILLISECONDS = 36e5;
|
|
|
78401
78404
|
var COMPACT_TIMEOUT_MILLISECONDS = 36e5;
|
|
78402
78405
|
var COMPACT_ITEM_WAIT_MILLISECONDS = 6e5;
|
|
78403
78406
|
var NEXT_PROMPT_INSTRUCTION = "Predict the next message the user will send in this conversation. Reply with only that message, written in the user's own voice as they would type it, in one short sentence. Do not use tools. If there is no clear next step, reply with nothing.";
|
|
78407
|
+
var TITLE_INSTRUCTION = "Generate a concise title for this conversation based on what the user wants to accomplish. Ignore setup instructions and tool output. Use the user's language and at most 10 words. Return only the title on one line, without quotes or markdown. Do not use tools.";
|
|
78408
|
+
var TITLE_CHARACTER_LIMIT2 = 80;
|
|
78404
78409
|
var HOOK_EVENTS_A_SAMPLE_SKIPS = /* @__PURE__ */ new Set([
|
|
78405
78410
|
"permissionRequest",
|
|
78406
78411
|
"postToolUse",
|
|
@@ -78555,6 +78560,7 @@ var CodexOwnedAcpAgent = class {
|
|
|
78555
78560
|
#turnSettledCompaction = false;
|
|
78556
78561
|
/** The next-prompt sample running for the latest completed turn; a later turn or closing cancels it. */
|
|
78557
78562
|
#sampling = null;
|
|
78563
|
+
#title = { kind: "untitled" };
|
|
78558
78564
|
constructor(context) {
|
|
78559
78565
|
this.#context = context;
|
|
78560
78566
|
this.#appServer = context.client;
|
|
@@ -78563,6 +78569,7 @@ var CodexOwnedAcpAgent = class {
|
|
|
78563
78569
|
nativeTurnId = () => this.#nativeTurnId;
|
|
78564
78570
|
onTerminated = (termination) => {
|
|
78565
78571
|
this.#cancelSampling();
|
|
78572
|
+
this.#settleTitle();
|
|
78566
78573
|
if (this.#turn !== null) {
|
|
78567
78574
|
this.#turn.steeringContent.clear();
|
|
78568
78575
|
}
|
|
@@ -78571,6 +78578,7 @@ var CodexOwnedAcpAgent = class {
|
|
|
78571
78578
|
};
|
|
78572
78579
|
close = async () => {
|
|
78573
78580
|
this.#cancelSampling();
|
|
78581
|
+
this.#settleTitle();
|
|
78574
78582
|
if (this.#turn !== null) {
|
|
78575
78583
|
this.#turn.steeringContent.clear();
|
|
78576
78584
|
}
|
|
@@ -78629,6 +78637,7 @@ var CodexOwnedAcpAgent = class {
|
|
|
78629
78637
|
"session_busy"
|
|
78630
78638
|
);
|
|
78631
78639
|
}
|
|
78640
|
+
this.#cancelTitleSample();
|
|
78632
78641
|
const completion = Promise.withResolvers();
|
|
78633
78642
|
void completion.promise.catch(() => {
|
|
78634
78643
|
});
|
|
@@ -78739,7 +78748,8 @@ var CodexOwnedAcpAgent = class {
|
|
|
78739
78748
|
}
|
|
78740
78749
|
if (method === "thread/name/updated") {
|
|
78741
78750
|
const threadName = params.threadName;
|
|
78742
|
-
if (typeof threadName === "string" && threadName.length > 0) {
|
|
78751
|
+
if (typeof threadName === "string" && threadName.trim().length > 0) {
|
|
78752
|
+
this.#settleTitle();
|
|
78743
78753
|
await this.#enqueue(async () => {
|
|
78744
78754
|
await this.#context.emit({ sessionUpdate: "session_info_update", title: threadName });
|
|
78745
78755
|
});
|
|
@@ -79039,6 +79049,7 @@ var CodexOwnedAcpAgent = class {
|
|
|
79039
79049
|
throw new AcpExecutionError("Another prompt is already running in this conversation", {}, "session_busy");
|
|
79040
79050
|
}
|
|
79041
79051
|
this.#cancelSampling();
|
|
79052
|
+
this.#cancelTitleSample();
|
|
79042
79053
|
const completion = Promise.withResolvers();
|
|
79043
79054
|
void completion.promise.catch(() => {
|
|
79044
79055
|
});
|
|
@@ -79080,8 +79091,11 @@ var CodexOwnedAcpAgent = class {
|
|
|
79080
79091
|
}
|
|
79081
79092
|
try {
|
|
79082
79093
|
const result = await completion.promise;
|
|
79083
|
-
if (
|
|
79084
|
-
this.#
|
|
79094
|
+
if (result.stopReason === "end_turn") {
|
|
79095
|
+
this.#maybeGenerateTitle(turn.turn.id);
|
|
79096
|
+
if (promptSuggestionTurnId !== void 0) {
|
|
79097
|
+
this.#sampleNextPrompt(promptSuggestionTurnId, turn.turn.id);
|
|
79098
|
+
}
|
|
79085
79099
|
}
|
|
79086
79100
|
return turn.input.kind === "identified" ? await promptResultWithMessageId2(Promise.resolve(result), turn.input.messageId) : result;
|
|
79087
79101
|
} catch (cause) {
|
|
@@ -79180,51 +79194,107 @@ var CodexOwnedAcpAgent = class {
|
|
|
79180
79194
|
const sampling = new AbortController();
|
|
79181
79195
|
this.#sampling = sampling;
|
|
79182
79196
|
const signal = AbortSignal.any([sampling.signal, AbortSignal.timeout(SAMPLE_TIMEOUT_MILLISECONDS)]);
|
|
79183
|
-
|
|
79184
|
-
if (sourceTurnId.length === 0) {
|
|
79185
|
-
return { kind: "failed" };
|
|
79186
|
-
}
|
|
79187
|
-
try {
|
|
79188
|
-
const configured = hooksListResponseSchema.parse(
|
|
79189
|
-
await this.#appServer.request("hooks/list", { cwds: [this.#context.cwd()] }, signal)
|
|
79190
|
-
);
|
|
79191
|
-
if (configured.data.some(
|
|
79192
|
-
(entry) => entry.hooks.some((hook) => hook.enabled && !HOOK_EVENTS_A_SAMPLE_SKIPS.has(hook.eventName))
|
|
79193
|
-
)) {
|
|
79194
|
-
return { kind: "unsupported" };
|
|
79195
|
-
}
|
|
79196
|
-
const response = threadSampleResponseSchema.parse(
|
|
79197
|
-
await this.#appServer.request(
|
|
79198
|
-
"thread/sample",
|
|
79199
|
-
{
|
|
79200
|
-
effort: "low",
|
|
79201
|
-
expectedTurnId: sourceTurnId,
|
|
79202
|
-
prompt: NEXT_PROMPT_INSTRUCTION,
|
|
79203
|
-
threadId: this.#context.threadId()
|
|
79204
|
-
},
|
|
79205
|
-
signal,
|
|
79206
|
-
(requestId) => {
|
|
79207
|
-
void this.#appServer.request(
|
|
79208
|
-
"thread/sample/cancel",
|
|
79209
|
-
{ requestId },
|
|
79210
|
-
AbortSignal.timeout(SAMPLE_CANCEL_TIMEOUT_MILLISECONDS)
|
|
79211
|
-
).catch(() => void 0);
|
|
79212
|
-
}
|
|
79213
|
-
)
|
|
79214
|
-
);
|
|
79215
|
-
const text2 = response.text?.trim() ?? "";
|
|
79216
|
-
return text2.length === 0 ? { kind: "none" } : { kind: "suggested", text: text2 };
|
|
79217
|
-
} catch {
|
|
79218
|
-
return { kind: "failed" };
|
|
79219
|
-
}
|
|
79220
|
-
};
|
|
79221
|
-
void sample().then((outcome) => {
|
|
79197
|
+
void this.#sampleText(NEXT_PROMPT_INSTRUCTION, sourceTurnId, signal).then((outcome) => {
|
|
79222
79198
|
if (this.#sampling === sampling) {
|
|
79223
79199
|
this.#sampling = null;
|
|
79224
79200
|
this.#context.onPromptSuggestion?.({ outcome, turnId });
|
|
79225
79201
|
}
|
|
79226
79202
|
});
|
|
79227
79203
|
};
|
|
79204
|
+
#sampleText = async (instruction, sourceTurnId, signal) => {
|
|
79205
|
+
if (sourceTurnId.length === 0) {
|
|
79206
|
+
return { kind: "failed" };
|
|
79207
|
+
}
|
|
79208
|
+
try {
|
|
79209
|
+
const configured = hooksListResponseSchema.parse(
|
|
79210
|
+
await this.#appServer.request("hooks/list", { cwds: [this.#context.cwd()] }, signal)
|
|
79211
|
+
);
|
|
79212
|
+
if (configured.data.some(
|
|
79213
|
+
(entry) => entry.hooks.some((hook) => hook.enabled && !HOOK_EVENTS_A_SAMPLE_SKIPS.has(hook.eventName))
|
|
79214
|
+
)) {
|
|
79215
|
+
return { kind: "unsupported" };
|
|
79216
|
+
}
|
|
79217
|
+
const response = threadSampleResponseSchema.parse(
|
|
79218
|
+
await this.#appServer.request(
|
|
79219
|
+
"thread/sample",
|
|
79220
|
+
{
|
|
79221
|
+
effort: "low",
|
|
79222
|
+
expectedTurnId: sourceTurnId,
|
|
79223
|
+
prompt: instruction,
|
|
79224
|
+
threadId: this.#context.threadId()
|
|
79225
|
+
},
|
|
79226
|
+
signal,
|
|
79227
|
+
(requestId) => {
|
|
79228
|
+
void this.#appServer.request(
|
|
79229
|
+
"thread/sample/cancel",
|
|
79230
|
+
{ requestId },
|
|
79231
|
+
AbortSignal.timeout(SAMPLE_CANCEL_TIMEOUT_MILLISECONDS)
|
|
79232
|
+
).catch(() => void 0);
|
|
79233
|
+
}
|
|
79234
|
+
)
|
|
79235
|
+
);
|
|
79236
|
+
const text2 = response.text?.trim() ?? "";
|
|
79237
|
+
return text2.length === 0 ? { kind: "none" } : { kind: "suggested", text: text2 };
|
|
79238
|
+
} catch {
|
|
79239
|
+
return { kind: "failed" };
|
|
79240
|
+
}
|
|
79241
|
+
};
|
|
79242
|
+
#cancelTitleSample = () => {
|
|
79243
|
+
if (this.#title.kind === "pending") {
|
|
79244
|
+
this.#title.request.abort();
|
|
79245
|
+
this.#title = { kind: "untitled" };
|
|
79246
|
+
}
|
|
79247
|
+
};
|
|
79248
|
+
#settleTitle = () => {
|
|
79249
|
+
this.#cancelTitleSample();
|
|
79250
|
+
this.#title = { kind: "settled" };
|
|
79251
|
+
};
|
|
79252
|
+
#maybeGenerateTitle = (sourceTurnId) => {
|
|
79253
|
+
const target = this.#context.automaticTitle?.();
|
|
79254
|
+
if (target === void 0 || target.signal.aborted || this.#title.kind !== "untitled") {
|
|
79255
|
+
return;
|
|
79256
|
+
}
|
|
79257
|
+
const request = new AbortController();
|
|
79258
|
+
this.#title = { kind: "pending", request };
|
|
79259
|
+
const signal = AbortSignal.any([
|
|
79260
|
+
target.signal,
|
|
79261
|
+
request.signal,
|
|
79262
|
+
AbortSignal.timeout(SAMPLE_TIMEOUT_MILLISECONDS)
|
|
79263
|
+
]);
|
|
79264
|
+
const threadId = this.#context.threadId();
|
|
79265
|
+
const generate = async () => {
|
|
79266
|
+
const outcome = await this.#sampleText(TITLE_INSTRUCTION, sourceTurnId, signal);
|
|
79267
|
+
if (outcome.kind === "unsupported" && !signal.aborted) {
|
|
79268
|
+
this.#settleTitle();
|
|
79269
|
+
}
|
|
79270
|
+
if (outcome.kind !== "suggested") {
|
|
79271
|
+
return;
|
|
79272
|
+
}
|
|
79273
|
+
const name2 = Array.from(outcome.text.replace(/\s+/gu, " ")).slice(0, TITLE_CHARACTER_LIMIT2).join("").trim();
|
|
79274
|
+
const saved = threadNameResponseSchema.parse(
|
|
79275
|
+
await this.#appServer.request("thread/read", { threadId, includeTurns: false }, signal)
|
|
79276
|
+
);
|
|
79277
|
+
signal.throwIfAborted();
|
|
79278
|
+
if (saved.thread.id !== threadId) {
|
|
79279
|
+
throw new AcpExecutionError("Codex returned a different thread", {}, "invalid_agent_session");
|
|
79280
|
+
}
|
|
79281
|
+
if (!saved.thread.name?.trim()) {
|
|
79282
|
+
await target.publish(name2);
|
|
79283
|
+
}
|
|
79284
|
+
if (this.#title.kind === "pending" && this.#title.request === request) {
|
|
79285
|
+
this.#settleTitle();
|
|
79286
|
+
}
|
|
79287
|
+
};
|
|
79288
|
+
void generate().catch(() => {
|
|
79289
|
+
if (!signal.aborted) {
|
|
79290
|
+
console.warn("Codex could not publish the automatic session title");
|
|
79291
|
+
}
|
|
79292
|
+
}).finally(() => {
|
|
79293
|
+
if (this.#title.kind === "pending" && this.#title.request === request) {
|
|
79294
|
+
this.#title = { kind: "untitled" };
|
|
79295
|
+
}
|
|
79296
|
+
});
|
|
79297
|
+
};
|
|
79228
79298
|
#completeTurn = async (turn) => {
|
|
79229
79299
|
const active = this.#turn;
|
|
79230
79300
|
if (active === null || active.turn.id !== turn.id) {
|
|
@@ -80716,8 +80786,9 @@ var CodexAcpAgent = class {
|
|
|
80716
80786
|
#onPromptDelegation;
|
|
80717
80787
|
#onPromptSuggestion;
|
|
80718
80788
|
#onUsageQuota;
|
|
80719
|
-
/** Whether this app-server serves `thread/sample
|
|
80720
|
-
#
|
|
80789
|
+
/** Whether this app-server serves `thread/sample` for background title and prompt generation. */
|
|
80790
|
+
#threadSampling = false;
|
|
80791
|
+
#nativeTitlePresent = false;
|
|
80721
80792
|
#nativeSessionId = "";
|
|
80722
80793
|
#threadCwd = "";
|
|
80723
80794
|
#sessionAgent;
|
|
@@ -80753,6 +80824,7 @@ var CodexAcpAgent = class {
|
|
|
80753
80824
|
settings: this.#settings,
|
|
80754
80825
|
threadId: () => this.#nativeSessionId,
|
|
80755
80826
|
cwd: () => this.#threadCwd,
|
|
80827
|
+
automaticTitle: () => this.#threadSampling && !this.#nativeTitlePresent ? options.automaticTitle : void 0,
|
|
80756
80828
|
connection: () => this.#connection,
|
|
80757
80829
|
emit: this.#emit,
|
|
80758
80830
|
onBackgroundActivity: (activity) => {
|
|
@@ -80779,7 +80851,7 @@ var CodexAcpAgent = class {
|
|
|
80779
80851
|
this.#app = agent({ name: "mobius-codex" }).onConnect((connection) => {
|
|
80780
80852
|
this.#connection = connection;
|
|
80781
80853
|
}).onRequest(methods.agent.initialize, async () => ({
|
|
80782
|
-
_meta: { promptSuggestions: { supported: this.#
|
|
80854
|
+
_meta: { promptSuggestions: { supported: this.#threadSampling }, steering: { supported: true } },
|
|
80783
80855
|
agentCapabilities: {
|
|
80784
80856
|
loadSession: true,
|
|
80785
80857
|
promptCapabilities: { embeddedContext: true, image: true },
|
|
@@ -80846,7 +80918,7 @@ var CodexAcpAgent = class {
|
|
|
80846
80918
|
};
|
|
80847
80919
|
}).onRequest(methods.agent.session.prompt, async (context) => {
|
|
80848
80920
|
const promptSuggestionTurnId = promptSuggestionTurn2(context.params._meta);
|
|
80849
|
-
const samples = this.#
|
|
80921
|
+
const samples = this.#threadSampling && this.#sessionAgent.runsTurns && !isCompactCommand(context.params.prompt);
|
|
80850
80922
|
if (promptSuggestionTurnId !== void 0 && !samples) {
|
|
80851
80923
|
this.#onPromptSuggestion?.({ outcome: { kind: "unsupported" }, turnId: promptSuggestionTurnId });
|
|
80852
80924
|
}
|
|
@@ -80903,13 +80975,13 @@ var CodexAcpAgent = class {
|
|
|
80903
80975
|
initialize = async (signal) => {
|
|
80904
80976
|
await this.#appServer.initialize(signal);
|
|
80905
80977
|
await this.#settings.loadModels(signal);
|
|
80906
|
-
this.#
|
|
80978
|
+
this.#threadSampling = await this.#probeThreadSampling(signal);
|
|
80907
80979
|
};
|
|
80908
80980
|
/**
|
|
80909
80981
|
* Asks the app-server itself whether it serves `thread/sample`: cancelling a sample that does not exist succeeds
|
|
80910
80982
|
* there and fails as an unknown method on a release without sampling.
|
|
80911
80983
|
*/
|
|
80912
|
-
#
|
|
80984
|
+
#probeThreadSampling = async (signal) => {
|
|
80913
80985
|
try {
|
|
80914
80986
|
await this.#appServer.request(
|
|
80915
80987
|
"thread/sample/cancel",
|
|
@@ -80992,13 +81064,14 @@ var CodexAcpAgent = class {
|
|
|
80992
81064
|
return;
|
|
80993
81065
|
}
|
|
80994
81066
|
this.#nativeSessionId = resumed.thread.id;
|
|
81067
|
+
this.#nativeTitlePresent = Boolean(resumed.thread.name?.trim());
|
|
80995
81068
|
this.#threadCwd = cwd;
|
|
80996
81069
|
this.#settings.selectRestoredThread(resumed);
|
|
80997
81070
|
await this.#settings.probeCollaborationMode(this.#nativeSessionId, signal);
|
|
80998
81071
|
};
|
|
80999
81072
|
/** What the session response tells Mobius about the session behavior selected while opening it. */
|
|
81000
81073
|
#sessionMeta = () => ({
|
|
81001
|
-
promptSuggestions: { supported: this.#
|
|
81074
|
+
promptSuggestions: { supported: this.#threadSampling && this.#sessionAgent.runsTurns },
|
|
81002
81075
|
steering: { supported: this.#sessionAgent.steeringSupported },
|
|
81003
81076
|
codex: { runsTurns: this.#sessionAgent.runsTurns }
|
|
81004
81077
|
});
|
|
@@ -81045,6 +81118,7 @@ var CodexAgentConnection = class extends EndpointAgentConnection {
|
|
|
81045
81118
|
command: options.command,
|
|
81046
81119
|
cwd: options.cwd,
|
|
81047
81120
|
environment: options.environment,
|
|
81121
|
+
...options.automaticTitle === void 0 ? {} : { automaticTitle: options.automaticTitle },
|
|
81048
81122
|
...options.sessionEnvironment && { sessionEnvironment: options.sessionEnvironment },
|
|
81049
81123
|
onSessionUpdate: options.client.onUpdate,
|
|
81050
81124
|
onBackgroundActivity: (activity) => options.onBackgroundActivity?.(activity),
|
|
@@ -87160,6 +87234,7 @@ var AdapterSessionConnection = class {
|
|
|
87160
87234
|
this.#connection = options.agent.createConnection({
|
|
87161
87235
|
cwd: options.cwd,
|
|
87162
87236
|
client: client2,
|
|
87237
|
+
...options.automaticTitle === void 0 ? {} : { automaticTitle: options.automaticTitle },
|
|
87163
87238
|
onBackgroundActivity: (activity) => {
|
|
87164
87239
|
if (this.#lifetime.signal.aborted) {
|
|
87165
87240
|
return;
|
|
@@ -87366,6 +87441,7 @@ var AcpExecutionConnections = class {
|
|
|
87366
87441
|
const connection = new AdapterSessionConnection(
|
|
87367
87442
|
{
|
|
87368
87443
|
agent: params.scope.agent,
|
|
87444
|
+
...params.automaticTitle === void 0 ? {} : { automaticTitle: params.automaticTitle },
|
|
87369
87445
|
cwd: params.scope.cwd,
|
|
87370
87446
|
...params.scope.externalizeUpdate === void 0 ? {} : { externalizeUpdate: params.scope.externalizeUpdate },
|
|
87371
87447
|
onEvent: (event) => params.onSessionEvent(connection.events.sessionId(), event),
|
|
@@ -96976,6 +97052,7 @@ var AgentSession = class _AgentSession {
|
|
|
96976
97052
|
#restored = false;
|
|
96977
97053
|
#sessionTitle = null;
|
|
96978
97054
|
#generateTitle;
|
|
97055
|
+
#automaticTitle = new AbortController();
|
|
96979
97056
|
#sessionUpdatedAt = "";
|
|
96980
97057
|
constructor(agent2, cwd, additionalDirectories, mobiusSessionId, getObserver, agentCommand, store, metrics, adapter, externalize, promptSuggestions, timer, titlePolicy) {
|
|
96981
97058
|
this.#agentCommand = () => agentCommand(this.#mobiusSessionId);
|
|
@@ -97008,6 +97085,7 @@ var AgentSession = class _AgentSession {
|
|
|
97008
97085
|
...externalize === void 0 ? {} : { externalizeUpdate: (update, signal) => externalize(this.#mobiusSessionId, update, signal) }
|
|
97009
97086
|
};
|
|
97010
97087
|
this.#subscriber = {
|
|
97088
|
+
...this.#generateTitle ? { automaticTitle: { signal: this.#automaticTitle.signal, publish: this.#publishAutomaticTitle } } : {},
|
|
97011
97089
|
onSessionEvent: async (nativeSessionId, event) => {
|
|
97012
97090
|
if (this.#nativeSessionId.length === 0) {
|
|
97013
97091
|
this.selectNativeSession(nativeSessionId);
|
|
@@ -97653,7 +97731,29 @@ var AgentSession = class _AgentSession {
|
|
|
97653
97731
|
this.#nativeIdentity = { kind: "bound", nativeSessionId: sessionId };
|
|
97654
97732
|
this.#nativeHistoryOwnership = { kind: "agent-owned" };
|
|
97655
97733
|
};
|
|
97734
|
+
#publishAutomaticTitle = async (title) => {
|
|
97735
|
+
if (this.#automaticTitle.signal.aborted) {
|
|
97736
|
+
return;
|
|
97737
|
+
}
|
|
97738
|
+
await this.#processEvent({
|
|
97739
|
+
kind: "info",
|
|
97740
|
+
changes: [{ kind: "title", value: title }],
|
|
97741
|
+
payload: { sessionUpdate: "session_info_update", title }
|
|
97742
|
+
});
|
|
97743
|
+
};
|
|
97656
97744
|
#processEvent = async (event) => {
|
|
97745
|
+
if (event.kind === "info") {
|
|
97746
|
+
for (const change of event.changes) {
|
|
97747
|
+
switch (change.kind) {
|
|
97748
|
+
case "title":
|
|
97749
|
+
this.setSessionTitle(change.value);
|
|
97750
|
+
break;
|
|
97751
|
+
case "updated-at":
|
|
97752
|
+
this.#sessionUpdatedAt = change.value;
|
|
97753
|
+
break;
|
|
97754
|
+
}
|
|
97755
|
+
}
|
|
97756
|
+
}
|
|
97657
97757
|
if (event.kind === "configuration" || event.kind === "mode") {
|
|
97658
97758
|
this.#configOptions = event.kind === "configuration" ? event.configOptions : this.#configOptions.map(
|
|
97659
97759
|
(option) => option.category === "mode" ? { ...option, currentValue: event.modeId } : option
|
|
@@ -97684,16 +97784,6 @@ var AgentSession = class _AgentSession {
|
|
|
97684
97784
|
await this.emitConfigUpdate();
|
|
97685
97785
|
return;
|
|
97686
97786
|
case "info":
|
|
97687
|
-
for (const change of event.changes) {
|
|
97688
|
-
switch (change.kind) {
|
|
97689
|
-
case "title":
|
|
97690
|
-
this.#sessionTitle = change.value;
|
|
97691
|
-
break;
|
|
97692
|
-
case "updated-at":
|
|
97693
|
-
this.#sessionUpdatedAt = change.value;
|
|
97694
|
-
break;
|
|
97695
|
-
}
|
|
97696
|
-
}
|
|
97697
97787
|
if (this.#nativeSessionId.length > 0) {
|
|
97698
97788
|
this.writeStoredSession((/* @__PURE__ */ new Date()).toISOString());
|
|
97699
97789
|
}
|
|
@@ -98067,6 +98157,9 @@ var AgentSession = class _AgentSession {
|
|
|
98067
98157
|
}
|
|
98068
98158
|
setSessionTitle(title) {
|
|
98069
98159
|
this.#sessionTitle = title;
|
|
98160
|
+
if (title.trim().length > 0) {
|
|
98161
|
+
this.#automaticTitle.abort();
|
|
98162
|
+
}
|
|
98070
98163
|
}
|
|
98071
98164
|
assertNativeSession = (sessionId) => {
|
|
98072
98165
|
if (sessionId !== this.#nativeSessionId) {
|
|
@@ -106108,4 +106201,4 @@ export {
|
|
|
106108
106201
|
* MIT Licensed
|
|
106109
106202
|
*)
|
|
106110
106203
|
*/
|
|
106111
|
-
//# sourceMappingURL=chunk-
|
|
106204
|
+
//# sourceMappingURL=chunk-EQCEQBVF.js.map
|