@dev-anywhere/proxy 0.10.3 → 0.10.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/index.js
CHANGED
|
@@ -310,12 +310,12 @@ for (const [action, description] of [
|
|
|
310
310
|
["status", "Show automatic startup status"]
|
|
311
311
|
]) {
|
|
312
312
|
autostart.command(action).description(description).option("--system", "Use a system service that runs without desktop login").option("--now", "Start the system service now and restart Proxy (enable --system only)").action(async (options) => {
|
|
313
|
-
const { runAutostartCommand } = await import("./autostart-
|
|
313
|
+
const { runAutostartCommand } = await import("./autostart-LLJPWRR4.js");
|
|
314
314
|
await runAutostartCommand(action, options);
|
|
315
315
|
});
|
|
316
316
|
}
|
|
317
317
|
autostart.command("run", { hidden: true }).option("--daemon", "Detach after service readiness (systemd login trigger)").option("--system", "Run the persistent system service host").action(async (_options, command) => {
|
|
318
|
-
const { startAutostartService } = await import("./autostart-
|
|
318
|
+
const { startAutostartService } = await import("./autostart-LLJPWRR4.js");
|
|
319
319
|
const options = command.optsWithGlobals();
|
|
320
320
|
await startAutostartService(Boolean(options.daemon), Boolean(options.system));
|
|
321
321
|
});
|
package/dist/serve.js
CHANGED
|
@@ -3984,6 +3984,18 @@ var KimiAcpEventMapper = class {
|
|
|
3984
3984
|
|
|
3985
3985
|
// src/serve/worker-registry.ts
|
|
3986
3986
|
var RECONNECT_WORKER_HANDSHAKE_TIMEOUT_MS = 1e3;
|
|
3987
|
+
function isConversationActivityEnvelope(envelope) {
|
|
3988
|
+
switch (envelope.type) {
|
|
3989
|
+
case "assistant_message":
|
|
3990
|
+
case "thinking":
|
|
3991
|
+
case "assistant_tool_use":
|
|
3992
|
+
case "tool_result":
|
|
3993
|
+
case "user_input":
|
|
3994
|
+
return true;
|
|
3995
|
+
default:
|
|
3996
|
+
return false;
|
|
3997
|
+
}
|
|
3998
|
+
}
|
|
3987
3999
|
var WorkerStartupError = class extends Error {
|
|
3988
4000
|
constructor(message, errorCode2, nativeSessionId) {
|
|
3989
4001
|
super(message);
|
|
@@ -4773,7 +4785,6 @@ var WorkerRegistry = class {
|
|
|
4773
4785
|
return;
|
|
4774
4786
|
}
|
|
4775
4787
|
const ev = parsed.data;
|
|
4776
|
-
this.deps.touchSessionActivity?.(sessionId);
|
|
4777
4788
|
const isStreamDeltaSession = true;
|
|
4778
4789
|
if (ev.type === "system") {
|
|
4779
4790
|
if (this.handleCompactSystemEvent(sessionId, seq, ev)) return;
|
|
@@ -4789,6 +4800,7 @@ var WorkerRegistry = class {
|
|
|
4789
4800
|
return;
|
|
4790
4801
|
}
|
|
4791
4802
|
}
|
|
4803
|
+
let forwardedActivity = false;
|
|
4792
4804
|
for (const mapped of mapClaudeStreamEvent(sessionId, seq, {
|
|
4793
4805
|
event: ev,
|
|
4794
4806
|
isStreamDeltaSession,
|
|
@@ -4796,14 +4808,17 @@ var WorkerRegistry = class {
|
|
|
4796
4808
|
})) {
|
|
4797
4809
|
if (mapped.kind === "assistant_text") {
|
|
4798
4810
|
this.appendAssistantSnapshot(sessionId, seq, mapped.text, mapped.turnId);
|
|
4811
|
+
forwardedActivity = true;
|
|
4799
4812
|
} else if (mapped.kind === "envelope") {
|
|
4800
4813
|
if (mapped.envelope.type === "assistant_tool_use") {
|
|
4801
4814
|
this.completeAssistantSnapshot(sessionId, seq);
|
|
4802
4815
|
}
|
|
4803
4816
|
relay.sendEnvelope(mapped.envelope);
|
|
4817
|
+
forwardedActivity ||= isConversationActivityEnvelope(mapped.envelope);
|
|
4804
4818
|
} else if (mapped.kind === "control") {
|
|
4805
4819
|
this.completeAssistantSnapshot(sessionId, seq);
|
|
4806
4820
|
relay.sendRaw(mapped.raw);
|
|
4821
|
+
forwardedActivity ||= mapped.notifyTurnResult;
|
|
4807
4822
|
if (mapped.notifyTurnResult) this.deps.jsonObserver.onTurnResult(sessionId);
|
|
4808
4823
|
} else {
|
|
4809
4824
|
serviceLogger.warn(
|
|
@@ -4812,42 +4827,50 @@ var WorkerRegistry = class {
|
|
|
4812
4827
|
);
|
|
4813
4828
|
}
|
|
4814
4829
|
}
|
|
4830
|
+
if (forwardedActivity) this.deps.touchSessionActivity?.(sessionId);
|
|
4815
4831
|
}
|
|
4816
4832
|
forwardCodexAppServerEvent(sessionId, seq, event) {
|
|
4817
4833
|
const relay = this.deps.relayConnection;
|
|
4818
|
-
|
|
4834
|
+
let forwardedActivity = false;
|
|
4819
4835
|
for (const mapped of mapCodexAppServerEvent(sessionId, seq, event)) {
|
|
4820
4836
|
if (mapped.kind === "assistant_text") {
|
|
4821
4837
|
this.appendAssistantSnapshot(sessionId, seq, mapped.text, mapped.turnId);
|
|
4838
|
+
forwardedActivity = true;
|
|
4822
4839
|
} else if (mapped.kind === "envelope") {
|
|
4823
4840
|
if (mapped.envelope.type === "assistant_tool_use") {
|
|
4824
4841
|
this.completeAssistantSnapshot(sessionId, seq);
|
|
4825
4842
|
}
|
|
4826
4843
|
relay.sendEnvelope(mapped.envelope);
|
|
4844
|
+
forwardedActivity ||= isConversationActivityEnvelope(mapped.envelope);
|
|
4827
4845
|
} else {
|
|
4828
4846
|
this.completeAssistantSnapshot(sessionId, seq);
|
|
4829
4847
|
relay.sendRaw(mapped.raw);
|
|
4848
|
+
forwardedActivity ||= mapped.notifyTurnResult;
|
|
4830
4849
|
if (mapped.notifyTurnResult) this.deps.jsonObserver.onTurnResult(sessionId);
|
|
4831
4850
|
}
|
|
4832
4851
|
}
|
|
4852
|
+
if (forwardedActivity) this.deps.touchSessionActivity?.(sessionId);
|
|
4833
4853
|
}
|
|
4834
4854
|
forwardKimiAcpEvent(sessionId, seq, event) {
|
|
4835
4855
|
const relay = this.deps.relayConnection;
|
|
4836
|
-
|
|
4856
|
+
let forwardedActivity = false;
|
|
4837
4857
|
for (const mapped of this.kimiAcpEventMapper.map(sessionId, seq, event)) {
|
|
4838
4858
|
if (mapped.kind === "assistant_text") {
|
|
4839
4859
|
this.appendAssistantSnapshot(sessionId, seq, mapped.text);
|
|
4860
|
+
forwardedActivity = true;
|
|
4840
4861
|
} else if (mapped.kind === "envelope") {
|
|
4841
4862
|
if (mapped.envelope.type === "assistant_tool_use" || mapped.envelope.type === "user_input") {
|
|
4842
4863
|
this.completeAssistantSnapshot(sessionId, seq);
|
|
4843
4864
|
}
|
|
4844
4865
|
relay.sendEnvelope(mapped.envelope);
|
|
4866
|
+
forwardedActivity ||= isConversationActivityEnvelope(mapped.envelope);
|
|
4845
4867
|
} else if (mapped.kind === "control") {
|
|
4846
4868
|
if (mapped.providerCommands) {
|
|
4847
4869
|
this.deps.setProviderCommands?.(sessionId, mapped.providerCommands);
|
|
4848
4870
|
}
|
|
4849
4871
|
if (mapped.completeAssistant !== false) this.completeAssistantSnapshot(sessionId, seq);
|
|
4850
4872
|
relay.sendRaw(mapped.raw);
|
|
4873
|
+
forwardedActivity ||= mapped.notifyTurnResult;
|
|
4851
4874
|
if (mapped.notifyTurnResult) this.deps.jsonObserver.onTurnResult(sessionId);
|
|
4852
4875
|
} else {
|
|
4853
4876
|
serviceLogger.warn(
|
|
@@ -4856,25 +4879,29 @@ var WorkerRegistry = class {
|
|
|
4856
4879
|
);
|
|
4857
4880
|
}
|
|
4858
4881
|
}
|
|
4882
|
+
if (forwardedActivity) this.deps.touchSessionActivity?.(sessionId);
|
|
4859
4883
|
}
|
|
4860
4884
|
forwardCursorAcpEvent(sessionId, seq, event) {
|
|
4861
4885
|
const relay = this.deps.relayConnection;
|
|
4862
|
-
|
|
4886
|
+
let forwardedActivity = false;
|
|
4863
4887
|
for (const mapped of this.cursorAcpEventMapper.map(sessionId, seq, event)) {
|
|
4864
4888
|
if (mapped.kind === "assistant_text") {
|
|
4865
4889
|
if (this.interruptedCursorSessions.has(sessionId)) continue;
|
|
4866
4890
|
this.appendAssistantSnapshot(sessionId, seq, mapped.text);
|
|
4891
|
+
forwardedActivity = true;
|
|
4867
4892
|
} else if (mapped.kind === "envelope") {
|
|
4868
4893
|
if (mapped.envelope.type === "assistant_tool_use" || mapped.envelope.type === "user_input" || mapped.envelope.type === "assistant_message") {
|
|
4869
4894
|
this.completeAssistantSnapshot(sessionId, seq);
|
|
4870
4895
|
}
|
|
4871
4896
|
relay.sendEnvelope(mapped.envelope);
|
|
4897
|
+
forwardedActivity ||= isConversationActivityEnvelope(mapped.envelope);
|
|
4872
4898
|
} else if (mapped.kind === "control") {
|
|
4873
4899
|
if (mapped.providerCommands) {
|
|
4874
4900
|
this.deps.setProviderCommands?.(sessionId, mapped.providerCommands);
|
|
4875
4901
|
}
|
|
4876
4902
|
if (mapped.completeAssistant !== false) this.completeAssistantSnapshot(sessionId, seq);
|
|
4877
4903
|
relay.sendRaw(mapped.raw);
|
|
4904
|
+
forwardedActivity ||= mapped.notifyTurnResult;
|
|
4878
4905
|
if (mapped.notifyTurnResult) this.deps.jsonObserver.onTurnResult(sessionId);
|
|
4879
4906
|
} else {
|
|
4880
4907
|
serviceLogger.warn(
|
|
@@ -4883,6 +4910,7 @@ var WorkerRegistry = class {
|
|
|
4883
4910
|
);
|
|
4884
4911
|
}
|
|
4885
4912
|
}
|
|
4913
|
+
if (forwardedActivity) this.deps.touchSessionActivity?.(sessionId);
|
|
4886
4914
|
}
|
|
4887
4915
|
nextAssistantTurnId(sessionId) {
|
|
4888
4916
|
this.assistantTurnCounter += 1;
|
|
@@ -8999,8 +9027,12 @@ function handleTerminalConnection(socket, deps, admission) {
|
|
|
8999
9027
|
},
|
|
9000
9028
|
(sessionId, data, outputSeq) => {
|
|
9001
9029
|
if (protocolRejected) return;
|
|
9002
|
-
if (!ownsRegisteredSession(sessionId)
|
|
9003
|
-
|
|
9030
|
+
if (!ownsRegisteredSession(sessionId)) return;
|
|
9031
|
+
const session = sessionManager.getSession(sessionId);
|
|
9032
|
+
if (!session) return;
|
|
9033
|
+
if (data.length > 0 && (session.kind === "terminal" || session.state === SessionState.WORKING)) {
|
|
9034
|
+
touchSessionActivity(sessionManager, relayConnection, sessionId);
|
|
9035
|
+
}
|
|
9004
9036
|
relayConnection.sendBinary(encodeBinaryFrame(sessionId, outputSeq, data));
|
|
9005
9037
|
},
|
|
9006
9038
|
(err, line) => {
|