@moxt-ai/mobius 0.0.465 → 0.0.467
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-CPVZCCBS.js → chunk-KOLL57ZM.js} +55 -17
- package/dist/{chunk-CPVZCCBS.js.map → chunk-KOLL57ZM.js.map} +2 -2
- package/dist/{chunk-RQXSP55N.js → chunk-X64YZNBY.js} +2 -2
- package/dist/{chunk-RQXSP55N.js.map → chunk-X64YZNBY.js.map} +1 -1
- package/dist/{cli-4CH5AIPM.js → cli-AYBTKEFI.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/agent/agent-definition.d.ts +1 -0
- package/dist/engine/acp/agent/agent-definition.d.ts.map +1 -1
- package/dist/engine/acp/agent/agent-definition.js +8 -1
- package/dist/engine/acp/agent/agent-definition.js.map +1 -1
- package/dist/engine/acp/connection/agent-connection.d.ts +1 -0
- 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 +8 -2
- package/dist/engine/acp/harness/codex/agent.js.map +1 -1
- package/dist/engine/acp/harness/codex/session-update.d.ts +1 -0
- 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/runtime/relay/session-event-publisher.d.ts.map +1 -1
- package/dist/engine/runtime/relay/session-event-publisher.js +37 -14
- package/dist/engine/runtime/relay/session-event-publisher.js.map +1 -1
- package/dist/engine/runtime/run.d.ts.map +1 -1
- package/dist/engine/runtime/run.js +1 -3
- package/dist/engine/runtime/run.js.map +1 -1
- package/dist/engine.js +2 -2
- package/package.json +1 -1
- /package/dist/{cli-4CH5AIPM.js.map → cli-AYBTKEFI.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-X64YZNBY.js";
|
|
9
9
|
|
|
10
10
|
// ../../node_modules/.pnpm/ignore@7.0.9/node_modules/ignore/index.js
|
|
11
11
|
var require_ignore = __commonJS({
|
|
@@ -80705,6 +80705,7 @@ function promptSuggestionTurn2(meta3) {
|
|
|
80705
80705
|
}
|
|
80706
80706
|
var CodexAcpAgent = class {
|
|
80707
80707
|
#app;
|
|
80708
|
+
#threadOverrides;
|
|
80708
80709
|
#appServer;
|
|
80709
80710
|
terminated;
|
|
80710
80711
|
#closePromise = null;
|
|
@@ -80721,6 +80722,7 @@ var CodexAcpAgent = class {
|
|
|
80721
80722
|
#threadCwd = "";
|
|
80722
80723
|
#sessionAgent;
|
|
80723
80724
|
constructor(options) {
|
|
80725
|
+
this.#threadOverrides = options.sessionEnvironment ? { config: { shell_environment_policy: { set: options.sessionEnvironment } } } : {};
|
|
80724
80726
|
this.#onSessionUpdate = options.onSessionUpdate;
|
|
80725
80727
|
this.#onBackgroundActivity = options.onBackgroundActivity;
|
|
80726
80728
|
this.#onPromptDelegation = options.onPromptDelegation;
|
|
@@ -80790,7 +80792,7 @@ var CodexAcpAgent = class {
|
|
|
80790
80792
|
const created = threadStartResponseSchema.parse(
|
|
80791
80793
|
await this.#appServer.request(
|
|
80792
80794
|
"thread/start",
|
|
80793
|
-
{ cwd: context.params.cwd },
|
|
80795
|
+
{ cwd: context.params.cwd, ...this.#threadOverrides },
|
|
80794
80796
|
AbortSignal.any([context.signal, AbortSignal.timeout(APPROVAL_TIMEOUT_MILLISECONDS3)])
|
|
80795
80797
|
)
|
|
80796
80798
|
);
|
|
@@ -80820,6 +80822,7 @@ var CodexAcpAgent = class {
|
|
|
80820
80822
|
"thread/fork",
|
|
80821
80823
|
{
|
|
80822
80824
|
cwd: context.params.cwd,
|
|
80825
|
+
...this.#threadOverrides,
|
|
80823
80826
|
// Fork keeps the native context; its response only needs the new identity
|
|
80824
80827
|
// and settings. History is read through the separate history boundary.
|
|
80825
80828
|
excludeTurns: true,
|
|
@@ -80949,7 +80952,7 @@ var CodexAcpAgent = class {
|
|
|
80949
80952
|
return threadResumeResponseSchema.parse(
|
|
80950
80953
|
await this.#appServer.request(
|
|
80951
80954
|
"thread/resume",
|
|
80952
|
-
{ cwd, excludeTurns: true, threadId },
|
|
80955
|
+
{ cwd, excludeTurns: true, threadId, ...this.#threadOverrides },
|
|
80953
80956
|
AbortSignal.any([signal, AbortSignal.timeout(APPROVAL_TIMEOUT_MILLISECONDS3)])
|
|
80954
80957
|
)
|
|
80955
80958
|
);
|
|
@@ -81042,6 +81045,7 @@ var CodexAgentConnection = class extends EndpointAgentConnection {
|
|
|
81042
81045
|
command: options.command,
|
|
81043
81046
|
cwd: options.cwd,
|
|
81044
81047
|
environment: options.environment,
|
|
81048
|
+
...options.sessionEnvironment && { sessionEnvironment: options.sessionEnvironment },
|
|
81045
81049
|
onSessionUpdate: options.client.onUpdate,
|
|
81046
81050
|
onBackgroundActivity: (activity) => options.onBackgroundActivity?.(activity),
|
|
81047
81051
|
onPromptDelegation: async (stage) => await options.onPromptDelegation?.(stage),
|
|
@@ -85420,11 +85424,19 @@ var AcpAgentDefinition = class _AcpAgentDefinition {
|
|
|
85420
85424
|
this.#connectionFactory = createConnection;
|
|
85421
85425
|
}
|
|
85422
85426
|
createConnection = (options) => this.#connectionFactory({ ...options, command: this.command, environment: this.environment });
|
|
85423
|
-
withEnvironment = (environment) =>
|
|
85427
|
+
withEnvironment = (environment) => this.#copy(environment, this.#connectionFactory);
|
|
85428
|
+
withSessionEnvironment = (values) => {
|
|
85429
|
+
const sessionEnvironment = Object.freeze({ ...values });
|
|
85430
|
+
return this.#copy(
|
|
85431
|
+
{ ...this.environment, ...sessionEnvironment },
|
|
85432
|
+
(options) => this.#connectionFactory({ ...options, sessionEnvironment })
|
|
85433
|
+
);
|
|
85434
|
+
};
|
|
85435
|
+
#copy = (environment, createConnection) => new _AcpAgentDefinition(
|
|
85424
85436
|
this.id,
|
|
85425
85437
|
this.label,
|
|
85426
85438
|
this.command,
|
|
85427
|
-
|
|
85439
|
+
createConnection,
|
|
85428
85440
|
environment,
|
|
85429
85441
|
this.agentVersion,
|
|
85430
85442
|
this.agentIdentity,
|
|
@@ -105158,6 +105170,7 @@ var MAX_SESSION_EVENT_RESENDS = 5;
|
|
|
105158
105170
|
var RuntimeSessionEventPublisher = class {
|
|
105159
105171
|
#retained = [];
|
|
105160
105172
|
#sessions = /* @__PURE__ */ new Map();
|
|
105173
|
+
/** Sessions whose latest prompt has started and has not yet produced its first answer text. */
|
|
105161
105174
|
#awaitingFirstAnswer = /* @__PURE__ */ new Map();
|
|
105162
105175
|
#retainedBytes = 0;
|
|
105163
105176
|
#unsentCount = 0;
|
|
@@ -105291,7 +105304,8 @@ var RuntimeSessionEventPublisher = class {
|
|
|
105291
105304
|
return;
|
|
105292
105305
|
}
|
|
105293
105306
|
const awaiting = this.#awaitingFirstAnswer.get(event.sessionId);
|
|
105294
|
-
const
|
|
105307
|
+
const decision = this.#decideHandoff(event);
|
|
105308
|
+
const firstAnswer = decision.firstAnswer;
|
|
105295
105309
|
this.#retained.push({
|
|
105296
105310
|
event,
|
|
105297
105311
|
position: Number(event.position),
|
|
@@ -105313,7 +105327,7 @@ var RuntimeSessionEventPublisher = class {
|
|
|
105313
105327
|
return;
|
|
105314
105328
|
}
|
|
105315
105329
|
const socket = connection.socket;
|
|
105316
|
-
if (
|
|
105330
|
+
if (decision.immediate || this.#unsentCount >= SESSION_EVENT_BATCH_MAX_SIZE || EMPTY_ENVELOPE_BYTES + this.#unsentBytes >= MAX_EVENT_BATCH_BYTES) {
|
|
105317
105331
|
this.flushEvents(socket);
|
|
105318
105332
|
return;
|
|
105319
105333
|
}
|
|
@@ -105402,24 +105416,48 @@ var RuntimeSessionEventPublisher = class {
|
|
|
105402
105416
|
delivery.resends = 0;
|
|
105403
105417
|
}
|
|
105404
105418
|
};
|
|
105405
|
-
|
|
105419
|
+
/**
|
|
105420
|
+
* Decides whether `event` leaves without waiting for the batching window: the first thought or message after a
|
|
105421
|
+
* `prompt.started`, and the first answer text. Only the send time differs; batches keep the published order, so
|
|
105422
|
+
* whatever was waiting, the start included, leaves with them.
|
|
105423
|
+
*
|
|
105424
|
+
* The start itself and tool calls stay batched, because a client may act on either the moment it sees it. A
|
|
105425
|
+
* prompt is recorded as started just before it is handed to the Agent, and a cancellation that arrives in
|
|
105426
|
+
* between reaches an Agent that has nothing to cancel yet. An Agent such as Antigravity refuses steering for an
|
|
105427
|
+
* instant after announcing a command. The first thought or message cannot come before the Agent has the prompt.
|
|
105428
|
+
*/
|
|
105429
|
+
#decideHandoff = (event) => {
|
|
105430
|
+
const batched = { firstAnswer: false, immediate: false };
|
|
105406
105431
|
if (event.type === "lifecycle-metadata") {
|
|
105407
105432
|
const payload = event.payload;
|
|
105408
105433
|
if (payload.kind === "prompt.started") {
|
|
105409
105434
|
this.#awaitingFirstAnswer.set(event.sessionId, {
|
|
105410
105435
|
commandId: payload.commandId,
|
|
105411
|
-
generationId: event.sessionGenerationId
|
|
105436
|
+
generationId: event.sessionGenerationId,
|
|
105437
|
+
output: "awaiting-first-output"
|
|
105412
105438
|
});
|
|
105413
|
-
|
|
105439
|
+
return batched;
|
|
105440
|
+
}
|
|
105441
|
+
if (isPromptTerminal(payload) && this.#awaitingFirstAnswer.get(event.sessionId)?.commandId === payload.commandId && this.#awaitingFirstAnswer.get(event.sessionId)?.generationId === event.sessionGenerationId) {
|
|
105414
105442
|
this.#awaitingFirstAnswer.delete(event.sessionId);
|
|
105415
105443
|
}
|
|
105416
|
-
return
|
|
105444
|
+
return batched;
|
|
105417
105445
|
}
|
|
105418
|
-
|
|
105419
|
-
|
|
105446
|
+
const awaiting = this.#awaitingFirstAnswer.get(event.sessionId);
|
|
105447
|
+
if (event.type !== "acp" || awaiting?.generationId !== event.sessionGenerationId) {
|
|
105448
|
+
return batched;
|
|
105420
105449
|
}
|
|
105421
|
-
|
|
105422
|
-
|
|
105450
|
+
const update = event.payload;
|
|
105451
|
+
if (update.sessionUpdate === "agent_message_chunk" && update.content.type === "text" && update.content.text.length > 0) {
|
|
105452
|
+
this.#awaitingFirstAnswer.delete(event.sessionId);
|
|
105453
|
+
return { firstAnswer: true, immediate: true };
|
|
105454
|
+
}
|
|
105455
|
+
const isOutput = update.sessionUpdate === "agent_message_chunk" || update.sessionUpdate === "agent_thought_chunk";
|
|
105456
|
+
if (isOutput && awaiting.output === "awaiting-first-output") {
|
|
105457
|
+
this.#awaitingFirstAnswer.set(event.sessionId, { ...awaiting, output: "first-output-handed-off" });
|
|
105458
|
+
return { firstAnswer: false, immediate: true };
|
|
105459
|
+
}
|
|
105460
|
+
return batched;
|
|
105423
105461
|
};
|
|
105424
105462
|
cancelFlush = () => {
|
|
105425
105463
|
this.#pendingTask?.cancel();
|
|
@@ -105672,7 +105710,7 @@ async function runRuntime(config2, parentSignal, timer = systemTimer, options =
|
|
|
105672
105710
|
const resolveAgent = async (agentId, resolveSignal, sessionId) => {
|
|
105673
105711
|
const catalogAgent = await resolveCatalogAgent(config2, agentId, resolveSignal);
|
|
105674
105712
|
const environment = sessionId === void 0 ? void 0 : config2.sessionEnvironment?.({ sessionId, agentId });
|
|
105675
|
-
const agent2 = environment === void 0 ? catalogAgent : catalogAgent.
|
|
105713
|
+
const agent2 = environment === void 0 ? catalogAgent : catalogAgent.withSessionEnvironment(environment);
|
|
105676
105714
|
return {
|
|
105677
105715
|
agent: agent2,
|
|
105678
105716
|
adapter: adapters.resolve(catalogAgent),
|
|
@@ -106070,4 +106108,4 @@ export {
|
|
|
106070
106108
|
* MIT Licensed
|
|
106071
106109
|
*)
|
|
106072
106110
|
*/
|
|
106073
|
-
//# sourceMappingURL=chunk-
|
|
106111
|
+
//# sourceMappingURL=chunk-KOLL57ZM.js.map
|