@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.
@@ -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
- if (getProcess() && isActive() && !instructions.isCurrent({ systemPrompt, contextIdentity })) {
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
  }