@gkorepanov/ccodex 0.4.18 → 0.4.19
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/config/compatibility.json +1 -1
- package/dist/claude/developerInstructions.d.ts +2 -0
- package/dist/claude/developerInstructions.js +9 -0
- package/dist/claude/developerInstructions.js.map +1 -0
- package/dist/claude/service.d.ts +6 -0
- package/dist/claude/service.js +38 -4
- package/dist/claude/service.js.map +1 -1
- package/dist/claude/session/commands.d.ts +1 -0
- package/dist/claude/session/providerRuntimeFactory.js +6 -1
- package/dist/claude/session/providerRuntimeFactory.js.map +1 -1
- package/dist/claude/session/session.d.ts +5 -0
- package/dist/claude/session/session.js +18 -3
- package/dist/claude/session/session.js.map +1 -1
- package/dist/cli/args.d.ts +1 -0
- package/dist/cli/args.js +24 -1
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/main.js +3 -1
- package/dist/cli/main.js.map +1 -1
- package/dist/desktop/launchConfig.d.ts +1 -0
- package/dist/desktop/launchConfig.js +71 -0
- package/dist/desktop/launchConfig.js.map +1 -0
- package/dist/desktop/stdioFrontend.d.ts +1 -0
- package/dist/desktop/stdioFrontend.js +6 -2
- package/dist/desktop/stdioFrontend.js.map +1 -1
- package/dist/gateway/clientConnection.js +18 -19
- package/dist/gateway/clientConnection.js.map +1 -1
- package/dist/protocol/appContext.d.ts +1 -0
- package/dist/protocol/appContext.js +5 -0
- package/dist/protocol/appContext.js.map +1 -0
- package/dist/store/sqliteStore.js +15 -0
- package/dist/store/sqliteStore.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { v7 as uuidv7 } from "uuid";
|
|
2
2
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
3
3
|
import { MetricsRegistry } from "../../observability/metrics.js";
|
|
4
|
-
import { invalidParams } from "../../protocol/errors.js";
|
|
4
|
+
import { invalidParams, RpcError } from "../../protocol/errors.js";
|
|
5
5
|
import { classifyClaudeResult, classifyClaudeRuntimeError, } from "../resultClassifier.js";
|
|
6
6
|
import { runtimeWorkspaceRoots, settingsGeneration, withSettingsFrom } from "../../store/HybridStore.js";
|
|
7
7
|
import { addUsage } from "./usage.js";
|
|
@@ -109,6 +109,13 @@ function commandLane(command) {
|
|
|
109
109
|
return "provider";
|
|
110
110
|
return "normal";
|
|
111
111
|
}
|
|
112
|
+
export class ActiveClaudeTurnError extends RpcError {
|
|
113
|
+
turnId;
|
|
114
|
+
constructor(threadId, turnId) {
|
|
115
|
+
super(-32602, `Thread '${threadId}' already has an active turn.`);
|
|
116
|
+
this.turnId = turnId;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
112
119
|
export class ClaudeSession {
|
|
113
120
|
threadId;
|
|
114
121
|
repository;
|
|
@@ -775,6 +782,8 @@ export class ClaudeSession {
|
|
|
775
782
|
messageUuid,
|
|
776
783
|
});
|
|
777
784
|
if (staged.kind === "busy") {
|
|
785
|
+
if (staged.activeTurnId)
|
|
786
|
+
throw new ActiveClaudeTurnError(this.threadId, staged.activeTurnId);
|
|
778
787
|
throw invalidParams(`Thread '${this.threadId}' already has an active turn.`);
|
|
779
788
|
}
|
|
780
789
|
if (staged.kind === "stale") {
|
|
@@ -4079,7 +4088,10 @@ export class ClaudeSession {
|
|
|
4079
4088
|
return { kind: "staged" };
|
|
4080
4089
|
}
|
|
4081
4090
|
if (this.stagedRuntimeTurns.size)
|
|
4082
|
-
return {
|
|
4091
|
+
return {
|
|
4092
|
+
kind: "busy",
|
|
4093
|
+
activeTurnId: this.scopes.get(this.threadId)?.turnId ?? null,
|
|
4094
|
+
};
|
|
4083
4095
|
}
|
|
4084
4096
|
if (command.runtimeGeneration !== this.runtimeGeneration
|
|
4085
4097
|
|| command.settingsGeneration !== settingsGeneration(record)) {
|
|
@@ -4103,7 +4115,10 @@ export class ClaudeSession {
|
|
|
4103
4115
|
}
|
|
4104
4116
|
if (this.interruptFence || this.transportStopFence
|
|
4105
4117
|
|| this.lifecycle || this.compaction || record.thread.status.type === "active") {
|
|
4106
|
-
return {
|
|
4118
|
+
return {
|
|
4119
|
+
kind: "busy",
|
|
4120
|
+
activeTurnId: this.scopes.get(this.threadId)?.turnId ?? null,
|
|
4121
|
+
};
|
|
4107
4122
|
}
|
|
4108
4123
|
this.stagedRuntimeTurns.add(command.messageUuid);
|
|
4109
4124
|
this.emitLifecycle();
|