@ganglion/xacpx 0.15.3 → 0.15.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +17 -4
- package/dist/control/control-service.d.ts +4 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -20164,7 +20164,7 @@ async function resolveSessionAgentCommandFromIndex(session3) {
|
|
|
20164
20164
|
const raw = await readFile12(resolve2(home, ".acpx", "sessions", "index.json"), "utf8");
|
|
20165
20165
|
const parsed = JSON.parse(raw);
|
|
20166
20166
|
const targetCwd = resolve2(session3.cwd);
|
|
20167
|
-
const match = parsed.entries?.find((entry) => entry.name === session3.transportSession && entry.cwd === targetCwd && typeof entry.agentCommand === "string" && entry.agentCommand.trim().length > 0);
|
|
20167
|
+
const match = parsed.entries?.find((entry) => entry.name === session3.transportSession && typeof entry.cwd === "string" && resolve2(entry.cwd) === targetCwd && typeof entry.agentCommand === "string" && entry.agentCommand.trim().length > 0);
|
|
20168
20168
|
return match?.agentCommand?.trim();
|
|
20169
20169
|
} catch {
|
|
20170
20170
|
return;
|
|
@@ -24733,7 +24733,7 @@ class CommandRouter {
|
|
|
24733
24733
|
async handle(chatKey, input, reply, replyContextToken, accountId, media, metadata, abortSignal, onToolEvent, onThought, perfSpan, onPlan, onUsage, onCommands) {
|
|
24734
24734
|
const startedAt = Date.now();
|
|
24735
24735
|
let command = parseCommand(input);
|
|
24736
|
-
if (metadata?.channel === "control" && command.kind !== "prompt") {
|
|
24736
|
+
if (metadata?.channel === "control" && command.kind !== "prompt" && command.kind !== "session.reset") {
|
|
24737
24737
|
command = { kind: "prompt", text: input.trim() };
|
|
24738
24738
|
}
|
|
24739
24739
|
await this.logger.debug("command.parsed", "parsed inbound command", {
|
|
@@ -33861,6 +33861,7 @@ class ControlService {
|
|
|
33861
33861
|
transportSession: session3.transportSession,
|
|
33862
33862
|
running: this.deps.activeTurns.isActiveAnywhere(session3.alias),
|
|
33863
33863
|
archived: session3.archived === true,
|
|
33864
|
+
...session3.source === "agent-side" ? { native: true } : {},
|
|
33864
33865
|
...session3.agentCommand ? { agentCommand: session3.agentCommand } : {}
|
|
33865
33866
|
}));
|
|
33866
33867
|
}
|
|
@@ -34012,10 +34013,14 @@ class ControlService {
|
|
|
34012
34013
|
resolveSettled = resolve4;
|
|
34013
34014
|
});
|
|
34014
34015
|
this.inFlight.set(key, { controller, settled });
|
|
34016
|
+
let internalAlias;
|
|
34015
34017
|
let wasArchived = false;
|
|
34018
|
+
let priorTransportSession;
|
|
34016
34019
|
try {
|
|
34017
|
-
|
|
34018
|
-
|
|
34020
|
+
internalAlias = await this.deps.sessions.resolveAliasForChat(params.chatKey, params.sessionAlias);
|
|
34021
|
+
const prior = await this.deps.sessions.getSession(internalAlias);
|
|
34022
|
+
wasArchived = prior?.archived === true;
|
|
34023
|
+
priorTransportSession = prior?.transportSession;
|
|
34019
34024
|
} catch {}
|
|
34020
34025
|
try {
|
|
34021
34026
|
await this.deps.sessions.useSession(params.chatKey, params.sessionAlias);
|
|
@@ -34158,6 +34163,14 @@ ${chunk}` : chunk
|
|
|
34158
34163
|
} finally {
|
|
34159
34164
|
this.inFlight.delete(key);
|
|
34160
34165
|
resolveSettled();
|
|
34166
|
+
if (internalAlias && priorTransportSession) {
|
|
34167
|
+
try {
|
|
34168
|
+
const after = await this.deps.sessions.getSession(internalAlias);
|
|
34169
|
+
if (after && after.transportSession !== priorTransportSession) {
|
|
34170
|
+
this.deps.events.emit({ type: "sessions-changed" });
|
|
34171
|
+
}
|
|
34172
|
+
} catch {}
|
|
34173
|
+
}
|
|
34161
34174
|
}
|
|
34162
34175
|
}
|
|
34163
34176
|
cancelTurn(chatKey, sessionAlias) {
|
|
@@ -18,6 +18,10 @@ export interface ControlSessionInfo {
|
|
|
18
18
|
transportSession: string;
|
|
19
19
|
running: boolean;
|
|
20
20
|
archived: boolean;
|
|
21
|
+
/** True when this logical session was attached to an existing agent-side (native) rollout
|
|
22
|
+
* rather than freshly created. Mirrors LogicalSession.source === "agent-side"; omitted for
|
|
23
|
+
* fresh xacpx sessions so the wire stays minimal. */
|
|
24
|
+
native?: boolean;
|
|
21
25
|
/** The agent adapter command this session runs (acpx-recorded, or the agent's resolved
|
|
22
26
|
* default). Surfaced so the web can avoid seeding a new session's model picker from a
|
|
23
27
|
* session on a different adapter version (whose advertised model ids may be in an
|