@witqq/agent-sdk 0.6.1 → 0.7.0

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 (122) hide show
  1. package/README.md +433 -6
  2. package/dist/auth/index.cjs +188 -1
  3. package/dist/auth/index.cjs.map +1 -1
  4. package/dist/auth/index.d.cts +154 -138
  5. package/dist/auth/index.d.ts +154 -138
  6. package/dist/auth/index.js +188 -2
  7. package/dist/auth/index.js.map +1 -1
  8. package/dist/backends/claude.cjs +315 -21
  9. package/dist/backends/claude.cjs.map +1 -1
  10. package/dist/backends/claude.d.cts +2 -1
  11. package/dist/backends/claude.d.ts +2 -1
  12. package/dist/backends/claude.js +315 -21
  13. package/dist/backends/claude.js.map +1 -1
  14. package/dist/backends/copilot.cjs +132 -24
  15. package/dist/backends/copilot.cjs.map +1 -1
  16. package/dist/backends/copilot.d.cts +2 -1
  17. package/dist/backends/copilot.d.ts +2 -1
  18. package/dist/backends/copilot.js +132 -24
  19. package/dist/backends/copilot.js.map +1 -1
  20. package/dist/backends/vercel-ai.cjs +56 -17
  21. package/dist/backends/vercel-ai.cjs.map +1 -1
  22. package/dist/backends/vercel-ai.d.cts +1 -1
  23. package/dist/backends/vercel-ai.d.ts +1 -1
  24. package/dist/backends/vercel-ai.js +56 -17
  25. package/dist/backends/vercel-ai.js.map +1 -1
  26. package/dist/chat/accumulator.cjs +147 -0
  27. package/dist/chat/accumulator.cjs.map +1 -0
  28. package/dist/chat/accumulator.d.cts +61 -0
  29. package/dist/chat/accumulator.d.ts +61 -0
  30. package/dist/chat/accumulator.js +145 -0
  31. package/dist/chat/accumulator.js.map +1 -0
  32. package/dist/chat/backends.cjs +3534 -0
  33. package/dist/chat/backends.cjs.map +1 -0
  34. package/dist/chat/backends.d.cts +62 -0
  35. package/dist/chat/backends.d.ts +62 -0
  36. package/dist/chat/backends.js +3501 -0
  37. package/dist/chat/backends.js.map +1 -0
  38. package/dist/chat/context.cjs +230 -0
  39. package/dist/chat/context.cjs.map +1 -0
  40. package/dist/chat/context.d.cts +167 -0
  41. package/dist/chat/context.d.ts +167 -0
  42. package/dist/chat/context.js +227 -0
  43. package/dist/chat/context.js.map +1 -0
  44. package/dist/chat/core.cjs +282 -0
  45. package/dist/chat/core.cjs.map +1 -0
  46. package/dist/chat/core.d.cts +435 -0
  47. package/dist/chat/core.d.ts +435 -0
  48. package/dist/chat/core.js +261 -0
  49. package/dist/chat/core.js.map +1 -0
  50. package/dist/chat/errors.cjs +251 -0
  51. package/dist/chat/errors.cjs.map +1 -0
  52. package/dist/chat/errors.d.cts +122 -0
  53. package/dist/chat/errors.d.ts +122 -0
  54. package/dist/chat/errors.js +243 -0
  55. package/dist/chat/errors.js.map +1 -0
  56. package/dist/chat/events.cjs +203 -0
  57. package/dist/chat/events.cjs.map +1 -0
  58. package/dist/chat/events.d.cts +241 -0
  59. package/dist/chat/events.d.ts +241 -0
  60. package/dist/chat/events.js +196 -0
  61. package/dist/chat/events.js.map +1 -0
  62. package/dist/chat/index.cjs +5359 -0
  63. package/dist/chat/index.cjs.map +1 -0
  64. package/dist/chat/index.d.cts +52 -0
  65. package/dist/chat/index.d.ts +52 -0
  66. package/dist/chat/index.js +5296 -0
  67. package/dist/chat/index.js.map +1 -0
  68. package/dist/chat/react.cjs +2739 -0
  69. package/dist/chat/react.cjs.map +1 -0
  70. package/dist/chat/react.d.cts +619 -0
  71. package/dist/chat/react.d.ts +619 -0
  72. package/dist/chat/react.js +2714 -0
  73. package/dist/chat/react.js.map +1 -0
  74. package/dist/chat/runtime.cjs +1030 -0
  75. package/dist/chat/runtime.cjs.map +1 -0
  76. package/dist/chat/runtime.d.cts +118 -0
  77. package/dist/chat/runtime.d.ts +118 -0
  78. package/dist/chat/runtime.js +1028 -0
  79. package/dist/chat/runtime.js.map +1 -0
  80. package/dist/chat/server.cjs +643 -0
  81. package/dist/chat/server.cjs.map +1 -0
  82. package/dist/chat/server.d.cts +287 -0
  83. package/dist/chat/server.d.ts +287 -0
  84. package/dist/chat/server.js +617 -0
  85. package/dist/chat/server.js.map +1 -0
  86. package/dist/chat/sessions.cjs +398 -0
  87. package/dist/chat/sessions.cjs.map +1 -0
  88. package/dist/chat/sessions.d.cts +239 -0
  89. package/dist/chat/sessions.d.ts +239 -0
  90. package/dist/chat/sessions.js +394 -0
  91. package/dist/chat/sessions.js.map +1 -0
  92. package/dist/chat/state.cjs +177 -0
  93. package/dist/chat/state.cjs.map +1 -0
  94. package/dist/chat/state.d.cts +92 -0
  95. package/dist/chat/state.d.ts +92 -0
  96. package/dist/chat/state.js +167 -0
  97. package/dist/chat/state.js.map +1 -0
  98. package/dist/chat/storage.cjs +240 -0
  99. package/dist/chat/storage.cjs.map +1 -0
  100. package/dist/chat/storage.d.cts +191 -0
  101. package/dist/chat/storage.d.ts +191 -0
  102. package/dist/chat/storage.js +236 -0
  103. package/dist/chat/storage.js.map +1 -0
  104. package/dist/errors-BDLbNu9w.d.cts +13 -0
  105. package/dist/errors-BDLbNu9w.d.ts +13 -0
  106. package/dist/in-process-transport-C2oPTYs6.d.ts +223 -0
  107. package/dist/in-process-transport-DG-w5G6k.d.cts +223 -0
  108. package/dist/index.cjs +25 -13
  109. package/dist/index.cjs.map +1 -1
  110. package/dist/index.d.cts +32 -4
  111. package/dist/index.d.ts +32 -4
  112. package/dist/index.js +25 -13
  113. package/dist/index.js.map +1 -1
  114. package/dist/transport-D1OaUgRk.d.ts +67 -0
  115. package/dist/transport-DX1Nhm4N.d.cts +67 -0
  116. package/dist/types-Bh5AhqD-.d.ts +141 -0
  117. package/dist/types-CGF7AEX1.d.cts +141 -0
  118. package/dist/{types-BvwNzZCj.d.cts → types-CqvUAYxt.d.cts} +21 -3
  119. package/dist/{types-BvwNzZCj.d.ts → types-CqvUAYxt.d.ts} +21 -3
  120. package/dist/types-DLZzlJxt.d.ts +39 -0
  121. package/dist/types-tE0CXwBl.d.cts +39 -0
  122. package/package.json +149 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@witqq/agent-sdk",
3
- "version": "0.6.1",
3
+ "version": "0.7.0",
4
4
  "description": "Universal AI agent abstraction layer supporting Copilot CLI, Claude CLI, and Vercel AI SDK backends",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -56,6 +56,136 @@
56
56
  "types": "./dist/auth/index.d.cts",
57
57
  "default": "./dist/auth/index.cjs"
58
58
  }
59
+ },
60
+ "./chat": {
61
+ "import": {
62
+ "types": "./dist/chat/index.d.ts",
63
+ "default": "./dist/chat/index.js"
64
+ },
65
+ "require": {
66
+ "types": "./dist/chat/index.d.cts",
67
+ "default": "./dist/chat/index.cjs"
68
+ }
69
+ },
70
+ "./chat/core": {
71
+ "import": {
72
+ "types": "./dist/chat/core.d.ts",
73
+ "default": "./dist/chat/core.js"
74
+ },
75
+ "require": {
76
+ "types": "./dist/chat/core.d.cts",
77
+ "default": "./dist/chat/core.cjs"
78
+ }
79
+ },
80
+ "./chat/errors": {
81
+ "import": {
82
+ "types": "./dist/chat/errors.d.ts",
83
+ "default": "./dist/chat/errors.js"
84
+ },
85
+ "require": {
86
+ "types": "./dist/chat/errors.d.cts",
87
+ "default": "./dist/chat/errors.cjs"
88
+ }
89
+ },
90
+ "./chat/events": {
91
+ "import": {
92
+ "types": "./dist/chat/events.d.ts",
93
+ "default": "./dist/chat/events.js"
94
+ },
95
+ "require": {
96
+ "types": "./dist/chat/events.d.cts",
97
+ "default": "./dist/chat/events.cjs"
98
+ }
99
+ },
100
+ "./chat/storage": {
101
+ "import": {
102
+ "types": "./dist/chat/storage.d.ts",
103
+ "default": "./dist/chat/storage.js"
104
+ },
105
+ "require": {
106
+ "types": "./dist/chat/storage.d.cts",
107
+ "default": "./dist/chat/storage.cjs"
108
+ }
109
+ },
110
+ "./chat/sessions": {
111
+ "import": {
112
+ "types": "./dist/chat/sessions.d.ts",
113
+ "default": "./dist/chat/sessions.js"
114
+ },
115
+ "require": {
116
+ "types": "./dist/chat/sessions.d.cts",
117
+ "default": "./dist/chat/sessions.cjs"
118
+ }
119
+ },
120
+ "./chat/context": {
121
+ "import": {
122
+ "types": "./dist/chat/context.d.ts",
123
+ "default": "./dist/chat/context.js"
124
+ },
125
+ "require": {
126
+ "types": "./dist/chat/context.d.cts",
127
+ "default": "./dist/chat/context.cjs"
128
+ }
129
+ },
130
+ "./chat/accumulator": {
131
+ "import": {
132
+ "types": "./dist/chat/accumulator.d.ts",
133
+ "default": "./dist/chat/accumulator.js"
134
+ },
135
+ "require": {
136
+ "types": "./dist/chat/accumulator.d.cts",
137
+ "default": "./dist/chat/accumulator.cjs"
138
+ }
139
+ },
140
+ "./chat/state": {
141
+ "import": {
142
+ "types": "./dist/chat/state.d.ts",
143
+ "default": "./dist/chat/state.js"
144
+ },
145
+ "require": {
146
+ "types": "./dist/chat/state.d.cts",
147
+ "default": "./dist/chat/state.cjs"
148
+ }
149
+ },
150
+ "./chat/backends": {
151
+ "import": {
152
+ "types": "./dist/chat/backends.d.ts",
153
+ "default": "./dist/chat/backends.js"
154
+ },
155
+ "require": {
156
+ "types": "./dist/chat/backends.d.cts",
157
+ "default": "./dist/chat/backends.cjs"
158
+ }
159
+ },
160
+ "./chat/runtime": {
161
+ "import": {
162
+ "types": "./dist/chat/runtime.d.ts",
163
+ "default": "./dist/chat/runtime.js"
164
+ },
165
+ "require": {
166
+ "types": "./dist/chat/runtime.d.cts",
167
+ "default": "./dist/chat/runtime.cjs"
168
+ }
169
+ },
170
+ "./chat/react": {
171
+ "import": {
172
+ "types": "./dist/chat/react.d.ts",
173
+ "default": "./dist/chat/react.js"
174
+ },
175
+ "require": {
176
+ "types": "./dist/chat/react.d.cts",
177
+ "default": "./dist/chat/react.cjs"
178
+ }
179
+ },
180
+ "./chat/server": {
181
+ "import": {
182
+ "types": "./dist/chat/server.d.ts",
183
+ "default": "./dist/chat/server.js"
184
+ },
185
+ "require": {
186
+ "types": "./dist/chat/server.d.cts",
187
+ "default": "./dist/chat/server.cjs"
188
+ }
59
189
  }
60
190
  },
61
191
  "files": [
@@ -65,10 +195,12 @@
65
195
  "scripts": {
66
196
  "build": "tsup",
67
197
  "test": "vitest run",
198
+ "test:e2e": "vitest run --config vitest.e2e.config.ts",
68
199
  "test:watch": "vitest",
69
200
  "typecheck": "tsc --noEmit",
70
201
  "lint": "tsc --noEmit",
71
- "prepublishOnly": "npm run build"
202
+ "prepublishOnly": "npm run build",
203
+ "demo": "tsx scripts/demo.ts"
72
204
  },
73
205
  "keywords": [
74
206
  "ai",
@@ -88,7 +220,9 @@
88
220
  "@ai-sdk/openai-compatible": ">=2.0.0",
89
221
  "@anthropic-ai/claude-agent-sdk": ">=0.2.0",
90
222
  "@github/copilot-sdk": "^0.1.22",
223
+ "@types/react": ">=18",
91
224
  "ai": ">=4.0.0",
225
+ "react": ">=18",
92
226
  "zod": "^3.23.0 || ^4.0.0"
93
227
  },
94
228
  "peerDependenciesMeta": {
@@ -103,14 +237,27 @@
103
237
  },
104
238
  "@ai-sdk/openai-compatible": {
105
239
  "optional": true
240
+ },
241
+ "react": {
242
+ "optional": true
243
+ },
244
+ "@types/react": {
245
+ "optional": true
106
246
  }
107
247
  },
108
248
  "devDependencies": {
109
249
  "@ai-sdk/openai-compatible": "^2.0.27",
110
250
  "@anthropic-ai/claude-agent-sdk": "^0.2.37",
111
251
  "@github/copilot-sdk": "^0.1.22",
252
+ "@testing-library/react": "^16.3.2",
253
+ "@types/better-sqlite3": "^7.6.13",
112
254
  "@types/node": "^25.2.1",
255
+ "@types/react-dom": "^19.2.3",
113
256
  "ai": "^6.0.73",
257
+ "better-sqlite3": "^12.6.2",
258
+ "drizzle-orm": "^0.45.1",
259
+ "jsdom": "^28.1.0",
260
+ "react-dom": "^19.2.4",
114
261
  "testfold": "^0.2.1",
115
262
  "tsup": "^8.4.0",
116
263
  "typescript": "^5.8.0",