@jskit-ai/assistant-core 0.1.222 → 0.1.224
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/examples/conversation/package.json +1 -1
- package/package.json +1 -1
- package/src/client/conversation/AssistantGoalControl.vue +8 -8
- package/src/server/conversation/claudeHistory.js +9 -3
- package/src/server/conversation/claudeProcess.js +60 -20
- package/src/server/conversation/claudeTurn.js +190 -41
- package/src/server/conversation/codexProvider.js +67 -3
- package/src/server/conversation/providers/claude.js +5 -1
- package/src/server/conversation/providers/claudeDriver.js +5 -1
- package/src/server/conversation/providers/codex.js +325 -216
- package/src/server/conversation/providers/codexDriver.js +14 -1
- package/src/server/conversation/providers/scoped.js +39 -23
- package/src/server/conversation/runtime.js +20 -1
- package/src/server/conversation/transcript.js +24 -10
- package/src/shared/conversation/pagination.js +93 -2
- package/src/shared/conversation/patches.js +7 -4
- package/test/claudeConversationSession.test.js +3 -2
- package/test/claudeProcess.test.js +139 -1
- package/test/claudeTurn.test.js +253 -3
- package/test/codexConversationSession.test.js +27 -4
- package/test/codexGoal.test.js +152 -0
- package/test/conversation.test.js +62 -0
- package/test/conversationRuntime.test.js +168 -4
- package/test/conversationSession.test.js +48 -0
|
@@ -9,6 +9,7 @@ export function createClaudeConversationAdapter({ getProcess, isActive, startPro
|
|
|
9
9
|
let pending = Promise.resolve();
|
|
10
10
|
let updateIdentity;
|
|
11
11
|
let installedMode;
|
|
12
|
+
let installedPrompt;
|
|
12
13
|
|
|
13
14
|
function instructionArguments({ systemPrompt, instructionMode = "append" }) {
|
|
14
15
|
if (typeof systemPrompt !== "string" || !systemPrompt.trim()) throw new TypeError("Claude instructions must contain text.");
|
|
@@ -27,7 +28,9 @@ export function createClaudeConversationAdapter({ getProcess, isActive, startPro
|
|
|
27
28
|
const instructionMode = input.instructionMode || "append";
|
|
28
29
|
const contextIdentity = JSON.stringify([input.contextIdentity, instructionMode]);
|
|
29
30
|
if (!getProcess()) instructions.invalidate();
|
|
30
|
-
|
|
31
|
+
const canUpdate = getProcess() && installedPrompt === systemPrompt && installedMode === instructionMode &&
|
|
32
|
+
liveUpdateIdentity !== undefined && updateIdentity === liveUpdateIdentity;
|
|
33
|
+
if (getProcess() && isActive() && !canUpdate && !instructions.isCurrent({ systemPrompt, contextIdentity })) {
|
|
31
34
|
throw new Error("Stop the current Claude turn before changing its settings.");
|
|
32
35
|
}
|
|
33
36
|
return instructions.ensure({
|
|
@@ -51,6 +54,7 @@ export function createClaudeConversationAdapter({ getProcess, isActive, startPro
|
|
|
51
54
|
}
|
|
52
55
|
updateIdentity = liveUpdateIdentity;
|
|
53
56
|
installedMode = instructionMode;
|
|
57
|
+
installedPrompt = systemPrompt;
|
|
54
58
|
return native;
|
|
55
59
|
}
|
|
56
60
|
});
|
|
@@ -271,6 +271,11 @@ export function createClaudeConversationDriver({ connections, host = {}, limits
|
|
|
271
271
|
const entry = await native.owner.acquire(context);
|
|
272
272
|
return native.owner.ensureReady(entry);
|
|
273
273
|
},
|
|
274
|
+
async updateConversationSettings({ native, context, input }) {
|
|
275
|
+
const entry = await native.owner.acquire(context, input.threadId);
|
|
276
|
+
if (entry.process) await native.owner.ensureProcess(entry);
|
|
277
|
+
return { ok: true };
|
|
278
|
+
},
|
|
274
279
|
disposeNative,
|
|
275
280
|
async interruptDetachedConversation({ native, input, context }) {
|
|
276
281
|
const entry = await native.owner.acquire(context, input.conversationId || input.threadId,
|
|
@@ -467,7 +472,6 @@ export function createClaudeConversationDriver({ connections, host = {}, limits
|
|
|
467
472
|
result = await disposeNative({ native: supplied, options: scoped ? scoped.context : options });
|
|
468
473
|
if (result?.ok === false) throw Object.assign(new Error(result.error || (scoped ? "Scoped cleanup could not be confirmed." : "Claude cleanup could not be confirmed.")), result);
|
|
469
474
|
} else {
|
|
470
|
-
await entry.nativeTurn.whenIdle().catch(() => {});
|
|
471
475
|
for (const id of pendingAccountStops) await stopAccount(id);
|
|
472
476
|
await owner.close(entry);
|
|
473
477
|
}
|