@liveblocks/core 2.25.0-aiprivatebeta11 → 2.25.0-aiprivatebeta13

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.cjs CHANGED
@@ -6,7 +6,7 @@ var __export = (target, all) => {
6
6
 
7
7
  // src/version.ts
8
8
  var PKG_NAME = "@liveblocks/core";
9
- var PKG_VERSION = "2.25.0-aiprivatebeta11";
9
+ var PKG_VERSION = "2.25.0-aiprivatebeta13";
10
10
  var PKG_FORMAT = "cjs";
11
11
 
12
12
  // src/dupe-detection.ts
@@ -3918,18 +3918,18 @@ function createStore_forChatMessages(toolsStore, setToolResult) {
3918
3918
  }
3919
3919
  if (message.role === "assistant" && message.status === "awaiting-tool") {
3920
3920
  for (const toolCall of message.contentSoFar.filter(
3921
- (part) => part.type === "tool-invocation" && part.status === "executing"
3921
+ (part) => part.type === "tool-invocation" && part.stage === "executing"
3922
3922
  )) {
3923
- if (seenToolCallIds.has(toolCall.toolCallId)) {
3923
+ if (seenToolCallIds.has(toolCall.invocationId)) {
3924
3924
  continue;
3925
3925
  }
3926
- seenToolCallIds.add(toolCall.toolCallId);
3927
- const toolDef = toolsStore.getTool\u03A3(toolCall.toolName, message.chatId).get();
3926
+ seenToolCallIds.add(toolCall.invocationId);
3927
+ const toolDef = toolsStore.getTool\u03A3(toolCall.name, message.chatId).get();
3928
3928
  const respondSync = (result) => {
3929
3929
  setToolResult(
3930
3930
  message.chatId,
3931
3931
  message.id,
3932
- toolCall.toolCallId,
3932
+ toolCall.invocationId,
3933
3933
  result
3934
3934
  // TODO Pass in AiGenerationOptions here, or make the backend use the same options
3935
3935
  ).catch((err) => {
@@ -3942,8 +3942,8 @@ function createStore_forChatMessages(toolsStore, setToolResult) {
3942
3942
  if (executeFn && autoExecutableMessages.has(message.id)) {
3943
3943
  (async () => {
3944
3944
  const result = await executeFn(toolCall.args, {
3945
- toolName: toolCall.toolName,
3946
- toolCallId: toolCall.toolCallId
3945
+ name: toolCall.name,
3946
+ invocationId: toolCall.invocationId
3947
3947
  });
3948
3948
  respondSync(result);
3949
3949
  })().catch((err) => {
@@ -4231,7 +4231,11 @@ function createAi(config) {
4231
4231
  context.messagesStore.upsert(msg.message);
4232
4232
  break;
4233
4233
  }
4234
+ case "warning":
4235
+ warn(msg.message);
4236
+ break;
4234
4237
  case "error":
4238
+ error2(msg.error);
4235
4239
  break;
4236
4240
  case "rebooted":
4237
4241
  context.messagesStore.failAllPending();
@@ -4366,14 +4370,14 @@ function createAi(config) {
4366
4370
  function updateKnowledge(layerKey, data, key = nanoid()) {
4367
4371
  context.knowledge.updateKnowledge(layerKey, key, data);
4368
4372
  }
4369
- async function setToolResult(chatId, messageId, toolCallId, result, options) {
4373
+ async function setToolResult(chatId, messageId, invocationId, result, options) {
4370
4374
  const knowledge = context.knowledge.get();
4371
4375
  const tools = context.toolsStore.getToolDescriptions(chatId);
4372
4376
  const resp = await sendClientMsgWithResponse({
4373
4377
  cmd: "set-tool-result",
4374
4378
  chatId,
4375
4379
  messageId,
4376
- toolCallId,
4380
+ invocationId,
4377
4381
  result,
4378
4382
  generationOptions: {
4379
4383
  copilotId: _optionalChain([options, 'optionalAccess', _82 => _82.copilotId]),
@@ -4455,7 +4459,7 @@ function makeCreateSocketDelegateForAi(baseUrl, WebSocketPolyfill) {
4455
4459
  }
4456
4460
  const url2 = new URL(baseUrl);
4457
4461
  url2.protocol = url2.protocol === "http:" ? "ws" : "wss";
4458
- url2.pathname = "/ai/v1";
4462
+ url2.pathname = "/ai/v3";
4459
4463
  if (authValue.type === "secret") {
4460
4464
  url2.searchParams.set("tok", authValue.token.raw);
4461
4465
  } else if (authValue.type === "public") {