@band-ai/sdk 0.2.1 → 0.3.1

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.
Files changed (37) hide show
  1. package/dist/{ClaudeSDKAdapter-Cna5P1dR.d.ts → ClaudeSDKAdapter-CXud2DBE.d.ts} +2 -1
  2. package/dist/{ClaudeSDKAdapter-BY4zEbCl.d.cts → ClaudeSDKAdapter-Cx6zhSaG.d.cts} +2 -1
  3. package/dist/adapters.cjs +246 -116
  4. package/dist/adapters.d.cts +14 -3
  5. package/dist/adapters.d.ts +14 -3
  6. package/dist/adapters.js +143 -44
  7. package/dist/chunk-F63TPOI3.js +29 -0
  8. package/dist/{chunk-3BKAC4OZ.js → chunk-JADCAMZY.js} +8 -0
  9. package/dist/{chunk-N2QTUMGO.js → chunk-JJF44XWA.js} +365 -249
  10. package/dist/{chunk-TLBCKDQO.js → chunk-K5KAEYPF.js} +2 -2
  11. package/dist/{chunk-ZZJRRBPQ.js → chunk-KXJ74J73.js} +1 -1
  12. package/dist/{chunk-NMZLX7TP.js → chunk-MQBBWYRP.js} +52 -45
  13. package/dist/{chunk-RV76SKFT.js → chunk-MQY74R7D.js} +2 -20
  14. package/dist/{chunk-LBWKISBS.js → chunk-OH6VVVKT.js} +21 -0
  15. package/dist/{chunk-EAI2M3WM.js → chunk-W5IAI6Z4.js} +1 -1
  16. package/dist/{chunk-4IAXZBXX.js → chunk-WA7CHXUS.js} +2 -2
  17. package/dist/{chunk-NT7TBFX2.js → chunk-XWHWJP4I.js} +2 -2
  18. package/dist/{chunk-WLCM2OXG.js → chunk-YJ42AZO4.js} +1 -1
  19. package/dist/converters.js +6 -5
  20. package/dist/index.cjs +405 -277
  21. package/dist/index.d.cts +5 -5
  22. package/dist/index.d.ts +5 -5
  23. package/dist/index.js +12 -11
  24. package/dist/mcp-claude.js +4 -3
  25. package/dist/mcp.js +5 -4
  26. package/dist/rest.js +3 -3
  27. package/dist/runtime.cjs +387 -362
  28. package/dist/runtime.d.cts +10 -39
  29. package/dist/runtime.d.ts +10 -39
  30. package/dist/runtime.js +20 -142
  31. package/dist/{schemas-BotL3ZLH.d.cts → schemas-BgJhlqqO.d.cts} +57 -13
  32. package/dist/{schemas-DBsC4J1g.d.ts → schemas-C4mK1WSs.d.ts} +57 -13
  33. package/dist/testing.cjs +11 -0
  34. package/dist/testing.js +8 -1
  35. package/dist/{types-D958TC71.d.cts → types-BNNtOXu3.d.cts} +1 -1
  36. package/dist/{types-BTN_ZETM.d.ts → types-DFUtpxah.d.ts} +1 -1
  37. package/package.json +2 -2
package/dist/testing.cjs CHANGED
@@ -32,6 +32,14 @@ var DEFAULT_AGENT_TOOLS_CAPABILITIES = {
32
32
  memory: true
33
33
  };
34
34
 
35
+ // src/contracts/chatEvents.ts
36
+ var CHAT_EVENT_TYPES = ["tool_call", "tool_result", "thought", "error", "task"];
37
+ var CHAT_MESSAGE_TYPES = ["text", ...CHAT_EVENT_TYPES];
38
+ var VISIBLE_CONTENT_PATTERN = /[\p{L}\p{N}\p{P}\p{S}]/u;
39
+ function isBlankEventContent(content) {
40
+ return !VISIBLE_CONTENT_PATTERN.test(content);
41
+ }
42
+
35
43
  // src/testing/FakeAgentTools.ts
36
44
  var FakeAgentTools = class {
37
45
  capabilities = {
@@ -61,6 +69,9 @@ var FakeAgentTools = class {
61
69
  }
62
70
  async sendEvent(content, messageType, metadata) {
63
71
  this.maybeFail("sendEvent");
72
+ if (isBlankEventContent(content)) {
73
+ return { ok: false, status: "failed" };
74
+ }
64
75
  this.eventsSent.push({ content, messageType, metadata });
65
76
  const id = `evt-${this.eventCounter++}`;
66
77
  return { id, status: "sent" };
package/dist/testing.js CHANGED
@@ -1,6 +1,10 @@
1
+ import {
2
+ isBlankEventContent
3
+ } from "./chunk-F63TPOI3.js";
1
4
  import {
2
5
  DEFAULT_AGENT_TOOLS_CAPABILITIES
3
- } from "./chunk-3BKAC4OZ.js";
6
+ } from "./chunk-JADCAMZY.js";
7
+ import "./chunk-JY75VSQK.js";
4
8
 
5
9
  // src/testing/FakeAgentTools.ts
6
10
  var FakeAgentTools = class {
@@ -31,6 +35,9 @@ var FakeAgentTools = class {
31
35
  }
32
36
  async sendEvent(content, messageType, metadata) {
33
37
  this.maybeFail("sendEvent");
38
+ if (isBlankEventContent(content)) {
39
+ return { ok: false, status: "failed" };
40
+ }
34
41
  this.eventsSent.push({ content, messageType, metadata });
35
42
  const id = `evt-${this.eventCounter++}`;
36
43
  return { id, status: "sent" };
@@ -443,4 +443,4 @@ declare const SYNTHETIC_CONTACT_EVENTS_SENDER_ID = "contact-events";
443
443
  declare const SYNTHETIC_CONTACT_EVENTS_SENDER_NAME = "Contact Events";
444
444
  declare function ensureHandlePrefix(handle: string | null | undefined): string | null;
445
445
 
446
- export { type AgentConfig as A, type ContactEvent as C, HistoryProvider as H, type MessageHandler as M, type PlatformMessage as P, type SessionConfig as S, type AgentInput as a, type ContactEventCallback as b, type ContactEventConfig as c, type ContactEventStrategy as d, type ConversationContext as e, type PlatformEvent as f, type MessageEvent as g, SYNTHETIC_CONTACT_EVENTS_SENDER_ID as h, SYNTHETIC_CONTACT_EVENTS_SENDER_NAME as i, SYNTHETIC_SENDER_TYPE as j, ensureHandlePrefix as k };
446
+ export { type AgentConfig as A, type ContactEvent as C, HistoryProvider as H, type MessageHandler as M, type PlatformMessage as P, type SessionConfig as S, type AgentInput as a, type ContactEventCallback as b, type ContactEventConfig as c, type ContactEventStrategy as d, type ConversationContext as e, type PlatformEvent as f, type MessageEvent as g, type ParticipantAddedEvent as h, type ParticipantRemovedEvent as i, SYNTHETIC_CONTACT_EVENTS_SENDER_ID as j, SYNTHETIC_CONTACT_EVENTS_SENDER_NAME as k, SYNTHETIC_SENDER_TYPE as l, ensureHandlePrefix as m };
@@ -443,4 +443,4 @@ declare const SYNTHETIC_CONTACT_EVENTS_SENDER_ID = "contact-events";
443
443
  declare const SYNTHETIC_CONTACT_EVENTS_SENDER_NAME = "Contact Events";
444
444
  declare function ensureHandlePrefix(handle: string | null | undefined): string | null;
445
445
 
446
- export { type AgentConfig as A, type ContactEvent as C, HistoryProvider as H, type MessageHandler as M, type PlatformMessage as P, type SessionConfig as S, type AgentInput as a, type ContactEventCallback as b, type ContactEventConfig as c, type ContactEventStrategy as d, type ConversationContext as e, type PlatformEvent as f, type MessageEvent as g, SYNTHETIC_CONTACT_EVENTS_SENDER_ID as h, SYNTHETIC_CONTACT_EVENTS_SENDER_NAME as i, SYNTHETIC_SENDER_TYPE as j, ensureHandlePrefix as k };
446
+ export { type AgentConfig as A, type ContactEvent as C, HistoryProvider as H, type MessageHandler as M, type PlatformMessage as P, type SessionConfig as S, type AgentInput as a, type ContactEventCallback as b, type ContactEventConfig as c, type ContactEventStrategy as d, type ConversationContext as e, type PlatformEvent as f, type MessageEvent as g, type ParticipantAddedEvent as h, type ParticipantRemovedEvent as i, SYNTHETIC_CONTACT_EVENTS_SENDER_ID as j, SYNTHETIC_CONTACT_EVENTS_SENDER_NAME as k, SYNTHETIC_SENDER_TYPE as l, ensureHandlePrefix as m };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@band-ai/sdk",
3
- "version": "0.2.1",
3
+ "version": "0.3.1",
4
4
  "description": "Band TypeScript SDK core runtime",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -179,7 +179,7 @@
179
179
  "@types/js-yaml": "^4.0.9",
180
180
  "@types/node": "^22.13.14",
181
181
  "@typescript-eslint/eslint-plugin": "^8.26.0",
182
- "@typescript-eslint/parser": "^8.26.0",
182
+ "@typescript-eslint/parser": "^8.65.0",
183
183
  "@vitest/coverage-v8": "3.2.4",
184
184
  "ai": "^6.0.137",
185
185
  "eslint": "^9.22.0",