@yushaw/sanqian-chat 0.2.34 → 0.2.36

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.
@@ -517,7 +517,7 @@ function createSessionResourceMethods(getSdk) {
517
517
  async removeSessionResource(fullId) {
518
518
  const sdk = getSdk();
519
519
  if (!sdk) return;
520
- await sdk.removeSessionResource?.(fullId);
520
+ await sdk.removeResource?.(fullId);
521
521
  }
522
522
  };
523
523
  }
@@ -478,7 +478,7 @@ function createSessionResourceMethods(getSdk) {
478
478
  async removeSessionResource(fullId) {
479
479
  const sdk = getSdk();
480
480
  if (!sdk) return;
481
- await sdk.removeSessionResource?.(fullId);
481
+ await sdk.removeResource?.(fullId);
482
482
  }
483
483
  };
484
484
  }
@@ -815,7 +815,7 @@ function registerCommonChatIpcHandlers(handle, ctx) {
815
815
  const agentId = ctx.getAgentId();
816
816
  const queryParams = agentId ? `?agent_id=${encodeURIComponent(agentId)}` : "";
817
817
  const url = `http://127.0.0.1:${sdk.getPort()}/api/sdk/contexts${queryParams}`;
818
- const response = await fetch(url);
818
+ const response = await fetch(url, { headers: sdk.getHttpAuthHeaders() });
819
819
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
820
820
  const data = await response.json();
821
821
  return { success: true, data: data.contexts || [] };
@@ -832,7 +832,7 @@ function registerCommonChatIpcHandlers(handle, ctx) {
832
832
  if (params.offset !== void 0) queryString.set("offset", String(params.offset));
833
833
  if (params.limit !== void 0) queryString.set("limit", String(params.limit));
834
834
  const url = `http://127.0.0.1:${sdk.getPort()}/api/sdk/contexts/${encodeURIComponent(params.providerId)}/list?${queryString}`;
835
- const response = await fetch(url);
835
+ const response = await fetch(url, { headers: sdk.getHttpAuthHeaders() });
836
836
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
837
837
  const data = await response.json();
838
838
  if (data.error) throw new Error(data.error);
@@ -784,7 +784,7 @@ function registerCommonChatIpcHandlers(handle, ctx) {
784
784
  const agentId = ctx.getAgentId();
785
785
  const queryParams = agentId ? `?agent_id=${encodeURIComponent(agentId)}` : "";
786
786
  const url = `http://127.0.0.1:${sdk.getPort()}/api/sdk/contexts${queryParams}`;
787
- const response = await fetch(url);
787
+ const response = await fetch(url, { headers: sdk.getHttpAuthHeaders() });
788
788
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
789
789
  const data = await response.json();
790
790
  return { success: true, data: data.contexts || [] };
@@ -801,7 +801,7 @@ function registerCommonChatIpcHandlers(handle, ctx) {
801
801
  if (params.offset !== void 0) queryString.set("offset", String(params.offset));
802
802
  if (params.limit !== void 0) queryString.set("limit", String(params.limit));
803
803
  const url = `http://127.0.0.1:${sdk.getPort()}/api/sdk/contexts/${encodeURIComponent(params.providerId)}/list?${queryString}`;
804
- const response = await fetch(url);
804
+ const response = await fetch(url, { headers: sdk.getHttpAuthHeaders() });
805
805
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
806
806
  const data = await response.json();
807
807
  if (data.error) throw new Error(data.error);
@@ -6399,7 +6399,7 @@ function createSessionResourceMethods(getSdk) {
6399
6399
  async removeSessionResource(fullId) {
6400
6400
  const sdk = getSdk();
6401
6401
  if (!sdk) return;
6402
- await sdk.removeSessionResource?.(fullId);
6402
+ await sdk.removeResource?.(fullId);
6403
6403
  }
6404
6404
  };
6405
6405
  }
@@ -6311,7 +6311,7 @@ function createSessionResourceMethods(getSdk) {
6311
6311
  async removeSessionResource(fullId) {
6312
6312
  const sdk = getSdk();
6313
6313
  if (!sdk) return;
6314
- await sdk.removeSessionResource?.(fullId);
6314
+ await sdk.removeResource?.(fullId);
6315
6315
  }
6316
6316
  };
6317
6317
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yushaw/sanqian-chat",
3
- "version": "0.2.34",
3
+ "version": "0.2.36",
4
4
  "description": "Floating chat window SDK for Sanqian AI Assistant",
5
5
  "main": "./dist/main/index.js",
6
6
  "types": "./dist/main/index.d.ts",
@@ -44,7 +44,7 @@
44
44
  "test:watch": "vitest"
45
45
  },
46
46
  "dependencies": {
47
- "@yushaw/sanqian-sdk": "^0.3.24",
47
+ "@yushaw/sanqian-sdk": "^0.3.26",
48
48
  "react-virtuoso": "^4.15.0",
49
49
  "rehype-harden": "^1.1.6",
50
50
  "remark-gfm": "^4.0.1",