@tencent-ai/agent-sdk 0.0.33 → 0.1.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 (384) hide show
  1. package/README.md +70 -7
  2. package/cli/CHANGELOG.md +2418 -0
  3. package/cli/LICENSE.txt +19 -0
  4. package/cli/README.md +26 -0
  5. package/cli/bin/codebuddy +39 -0
  6. package/cli/dist/codebuddy.js +20 -0
  7. package/cli/package.json +44 -0
  8. package/cli/product.cloudhosted.json +242 -0
  9. package/cli/product.internal.json +244 -0
  10. package/cli/product.ioa.json +467 -0
  11. package/cli/product.json +948 -0
  12. package/cli/product.selfhosted.json +196 -0
  13. package/cli/vendor/ripgrep/COPYING +3 -0
  14. package/cli/vendor/ripgrep/arm64-darwin/rg +0 -0
  15. package/cli/vendor/ripgrep/arm64-darwin/ripgrep.node +0 -0
  16. package/cli/vendor/ripgrep/arm64-linux/rg +0 -0
  17. package/cli/vendor/ripgrep/arm64-linux/ripgrep.node +0 -0
  18. package/cli/vendor/ripgrep/x64-darwin/rg +0 -0
  19. package/cli/vendor/ripgrep/x64-darwin/ripgrep.node +0 -0
  20. package/cli/vendor/ripgrep/x64-linux/rg +0 -0
  21. package/cli/vendor/ripgrep/x64-linux/ripgrep.node +0 -0
  22. package/cli/vendor/ripgrep/x64-win32/rg.exe +0 -0
  23. package/cli/vendor/ripgrep/x64-win32/ripgrep.node +0 -0
  24. package/lib/errors.d.ts +10 -0
  25. package/lib/errors.d.ts.map +1 -0
  26. package/lib/errors.js +17 -0
  27. package/lib/errors.js.map +1 -0
  28. package/lib/index.d.ts +36 -0
  29. package/lib/index.d.ts.map +1 -0
  30. package/lib/index.js +40 -0
  31. package/lib/index.js.map +1 -0
  32. package/lib/package.spec.js +3 -2
  33. package/lib/package.spec.js.map +1 -1
  34. package/lib/query.d.ts +46 -0
  35. package/lib/query.d.ts.map +1 -0
  36. package/lib/query.js +270 -0
  37. package/lib/query.js.map +1 -0
  38. package/lib/session.d.ts +53 -0
  39. package/lib/session.d.ts.map +1 -0
  40. package/lib/session.js +163 -0
  41. package/lib/session.js.map +1 -0
  42. package/lib/transport/index.d.ts +104 -0
  43. package/lib/transport/index.d.ts.map +1 -0
  44. package/lib/transport/index.js +20 -0
  45. package/lib/transport/index.js.map +1 -0
  46. package/lib/transport/process-transport.d.ts +65 -0
  47. package/lib/transport/process-transport.d.ts.map +1 -0
  48. package/lib/transport/process-transport.js +380 -0
  49. package/lib/transport/process-transport.js.map +1 -0
  50. package/lib/types.d.ts +603 -0
  51. package/lib/types.d.ts.map +1 -0
  52. package/lib/types.js +58 -0
  53. package/lib/types.js.map +1 -0
  54. package/lib/utils/cli-resolver.d.ts +36 -0
  55. package/lib/utils/cli-resolver.d.ts.map +1 -0
  56. package/lib/utils/cli-resolver.js +123 -0
  57. package/lib/utils/cli-resolver.js.map +1 -0
  58. package/lib/utils/env-utils.d.ts +9 -0
  59. package/lib/utils/env-utils.d.ts.map +1 -0
  60. package/lib/utils/env-utils.js +19 -0
  61. package/lib/utils/env-utils.js.map +1 -0
  62. package/lib/utils/index.d.ts +8 -0
  63. package/lib/utils/index.d.ts.map +1 -0
  64. package/lib/utils/index.js +17 -0
  65. package/lib/utils/index.js.map +1 -0
  66. package/lib/utils/process.d.ts +8 -0
  67. package/lib/utils/process.d.ts.map +1 -0
  68. package/lib/utils/process.js +16 -0
  69. package/lib/utils/process.js.map +1 -0
  70. package/lib/utils/stream.d.ts +24 -0
  71. package/lib/utils/stream.d.ts.map +1 -0
  72. package/lib/utils/stream.js +85 -0
  73. package/lib/utils/stream.js.map +1 -0
  74. package/package.json +21 -17
  75. package/dist/952.agent-sdk.js +0 -1
  76. package/dist/agent-sdk.js +0 -7
  77. package/lib/common/application-utils.d.ts +0 -5
  78. package/lib/common/application-utils.d.ts.map +0 -1
  79. package/lib/common/application-utils.js +0 -23
  80. package/lib/common/application-utils.js.map +0 -1
  81. package/lib/common/component-registry.d.ts +0 -10
  82. package/lib/common/component-registry.d.ts.map +0 -1
  83. package/lib/common/component-registry.js +0 -50
  84. package/lib/common/component-registry.js.map +0 -1
  85. package/lib/common/index.d.ts +0 -5
  86. package/lib/common/index.d.ts.map +0 -1
  87. package/lib/common/index.js +0 -21
  88. package/lib/common/index.js.map +0 -1
  89. package/lib/common/services/agent.d.ts +0 -12
  90. package/lib/common/services/agent.d.ts.map +0 -1
  91. package/lib/common/services/agent.js +0 -28
  92. package/lib/common/services/agent.js.map +0 -1
  93. package/lib/common/services/auth.d.ts +0 -59
  94. package/lib/common/services/auth.d.ts.map +0 -1
  95. package/lib/common/services/auth.js +0 -91
  96. package/lib/common/services/auth.js.map +0 -1
  97. package/lib/common/services/codebase.d.ts +0 -44
  98. package/lib/common/services/codebase.d.ts.map +0 -1
  99. package/lib/common/services/codebase.js +0 -87
  100. package/lib/common/services/codebase.js.map +0 -1
  101. package/lib/common/services/event.d.ts +0 -8
  102. package/lib/common/services/event.d.ts.map +0 -1
  103. package/lib/common/services/event.js +0 -18
  104. package/lib/common/services/event.js.map +0 -1
  105. package/lib/common/services/filepath.d.ts +0 -7
  106. package/lib/common/services/filepath.d.ts.map +0 -1
  107. package/lib/common/services/filepath.js +0 -16
  108. package/lib/common/services/filepath.js.map +0 -1
  109. package/lib/common/services/http.d.ts +0 -5
  110. package/lib/common/services/http.d.ts.map +0 -1
  111. package/lib/common/services/http.js +0 -12
  112. package/lib/common/services/http.js.map +0 -1
  113. package/lib/common/services/index.d.ts +0 -10
  114. package/lib/common/services/index.d.ts.map +0 -1
  115. package/lib/common/services/index.js +0 -26
  116. package/lib/common/services/index.js.map +0 -1
  117. package/lib/common/services/logger.d.ts +0 -7
  118. package/lib/common/services/logger.d.ts.map +0 -1
  119. package/lib/common/services/logger.js +0 -17
  120. package/lib/common/services/logger.js.map +0 -1
  121. package/lib/common/services/product.d.ts +0 -12
  122. package/lib/common/services/product.d.ts.map +0 -1
  123. package/lib/common/services/product.js +0 -29
  124. package/lib/common/services/product.js.map +0 -1
  125. package/lib/common/services/storage.d.ts +0 -7
  126. package/lib/common/services/storage.d.ts.map +0 -1
  127. package/lib/common/services/storage.js +0 -17
  128. package/lib/common/services/storage.js.map +0 -1
  129. package/lib/common/services/tracing.d.ts +0 -10
  130. package/lib/common/services/tracing.d.ts.map +0 -1
  131. package/lib/common/services/tracing.js +0 -29
  132. package/lib/common/services/tracing.js.map +0 -1
  133. package/lib/common/types/agents/agent.d.ts +0 -49
  134. package/lib/common/types/agents/agent.d.ts.map +0 -1
  135. package/lib/common/types/agents/agent.js +0 -9
  136. package/lib/common/types/agents/agent.js.map +0 -1
  137. package/lib/common/types/agents/ai.d.ts +0 -96
  138. package/lib/common/types/agents/ai.d.ts.map +0 -1
  139. package/lib/common/types/agents/ai.js +0 -3
  140. package/lib/common/types/agents/ai.js.map +0 -1
  141. package/lib/common/types/agents/completion.d.ts +0 -192
  142. package/lib/common/types/agents/completion.d.ts.map +0 -1
  143. package/lib/common/types/agents/completion.js +0 -4
  144. package/lib/common/types/agents/completion.js.map +0 -1
  145. package/lib/common/types/agents/conversation-manager.d.ts +0 -256
  146. package/lib/common/types/agents/conversation-manager.d.ts.map +0 -1
  147. package/lib/common/types/agents/conversation-manager.js +0 -3
  148. package/lib/common/types/agents/conversation-manager.js.map +0 -1
  149. package/lib/common/types/agents/craft-history.d.ts +0 -111
  150. package/lib/common/types/agents/craft-history.d.ts.map +0 -1
  151. package/lib/common/types/agents/craft-history.js +0 -3
  152. package/lib/common/types/agents/craft-history.js.map +0 -1
  153. package/lib/common/types/agents/craft.d.ts +0 -17
  154. package/lib/common/types/agents/craft.d.ts.map +0 -1
  155. package/lib/common/types/agents/craft.js +0 -3
  156. package/lib/common/types/agents/craft.js.map +0 -1
  157. package/lib/common/types/agents/file-tree.d.ts +0 -169
  158. package/lib/common/types/agents/file-tree.d.ts.map +0 -1
  159. package/lib/common/types/agents/file-tree.js +0 -17
  160. package/lib/common/types/agents/file-tree.js.map +0 -1
  161. package/lib/common/types/agents/index.d.ts +0 -10
  162. package/lib/common/types/agents/index.d.ts.map +0 -1
  163. package/lib/common/types/agents/index.js +0 -26
  164. package/lib/common/types/agents/index.js.map +0 -1
  165. package/lib/common/types/agents/run.d.ts +0 -133
  166. package/lib/common/types/agents/run.d.ts.map +0 -1
  167. package/lib/common/types/agents/run.js +0 -27
  168. package/lib/common/types/agents/run.js.map +0 -1
  169. package/lib/common/types/agents/tools.d.ts +0 -343
  170. package/lib/common/types/agents/tools.d.ts.map +0 -1
  171. package/lib/common/types/agents/tools.js +0 -67
  172. package/lib/common/types/agents/tools.js.map +0 -1
  173. package/lib/common/types/agents/user-reference.d.ts +0 -78
  174. package/lib/common/types/agents/user-reference.d.ts.map +0 -1
  175. package/lib/common/types/agents/user-reference.js +0 -3
  176. package/lib/common/types/agents/user-reference.js.map +0 -1
  177. package/lib/common/types/auth.d.ts +0 -73
  178. package/lib/common/types/auth.d.ts.map +0 -1
  179. package/lib/common/types/auth.js +0 -3
  180. package/lib/common/types/auth.js.map +0 -1
  181. package/lib/common/types/client-info.d.ts +0 -47
  182. package/lib/common/types/client-info.d.ts.map +0 -1
  183. package/lib/common/types/client-info.js +0 -3
  184. package/lib/common/types/client-info.js.map +0 -1
  185. package/lib/common/types/codebase.d.ts +0 -69
  186. package/lib/common/types/codebase.d.ts.map +0 -1
  187. package/lib/common/types/codebase.js +0 -3
  188. package/lib/common/types/codebase.js.map +0 -1
  189. package/lib/common/types/event/activity.d.ts +0 -5
  190. package/lib/common/types/event/activity.d.ts.map +0 -1
  191. package/lib/common/types/event/activity.js +0 -3
  192. package/lib/common/types/event/activity.js.map +0 -1
  193. package/lib/common/types/event/authentication.d.ts +0 -14
  194. package/lib/common/types/event/authentication.d.ts.map +0 -1
  195. package/lib/common/types/event/authentication.js +0 -9
  196. package/lib/common/types/event/authentication.js.map +0 -1
  197. package/lib/common/types/event/chat.d.ts +0 -48
  198. package/lib/common/types/event/chat.d.ts.map +0 -1
  199. package/lib/common/types/event/chat.js +0 -3
  200. package/lib/common/types/event/chat.js.map +0 -1
  201. package/lib/common/types/event/check-point.d.ts +0 -13
  202. package/lib/common/types/event/check-point.d.ts.map +0 -1
  203. package/lib/common/types/event/check-point.js +0 -3
  204. package/lib/common/types/event/check-point.js.map +0 -1
  205. package/lib/common/types/event/code.d.ts +0 -22
  206. package/lib/common/types/event/code.d.ts.map +0 -1
  207. package/lib/common/types/event/code.js +0 -14
  208. package/lib/common/types/event/code.js.map +0 -1
  209. package/lib/common/types/event/commit-message.d.ts +0 -25
  210. package/lib/common/types/event/commit-message.d.ts.map +0 -1
  211. package/lib/common/types/event/commit-message.js +0 -3
  212. package/lib/common/types/event/commit-message.js.map +0 -1
  213. package/lib/common/types/event/completion.d.ts +0 -313
  214. package/lib/common/types/event/completion.d.ts.map +0 -1
  215. package/lib/common/types/event/completion.js +0 -38
  216. package/lib/common/types/event/completion.js.map +0 -1
  217. package/lib/common/types/event/craft.d.ts +0 -256
  218. package/lib/common/types/event/craft.d.ts.map +0 -1
  219. package/lib/common/types/event/craft.js +0 -3
  220. package/lib/common/types/event/craft.js.map +0 -1
  221. package/lib/common/types/event/document.d.ts +0 -42
  222. package/lib/common/types/event/document.d.ts.map +0 -1
  223. package/lib/common/types/event/document.js +0 -3
  224. package/lib/common/types/event/document.js.map +0 -1
  225. package/lib/common/types/event/element.d.ts +0 -11
  226. package/lib/common/types/event/element.d.ts.map +0 -1
  227. package/lib/common/types/event/element.js +0 -3
  228. package/lib/common/types/event/element.js.map +0 -1
  229. package/lib/common/types/event/events.d.ts +0 -131
  230. package/lib/common/types/event/events.d.ts.map +0 -1
  231. package/lib/common/types/event/events.js +0 -88
  232. package/lib/common/types/event/events.js.map +0 -1
  233. package/lib/common/types/event/ide-event.d.ts +0 -44
  234. package/lib/common/types/event/ide-event.d.ts.map +0 -1
  235. package/lib/common/types/event/ide-event.js +0 -15
  236. package/lib/common/types/event/ide-event.js.map +0 -1
  237. package/lib/common/types/event/index.d.ts +0 -14
  238. package/lib/common/types/event/index.d.ts.map +0 -1
  239. package/lib/common/types/event/index.js +0 -30
  240. package/lib/common/types/event/index.js.map +0 -1
  241. package/lib/common/types/event/legacy-completion.d.ts +0 -196
  242. package/lib/common/types/event/legacy-completion.d.ts.map +0 -1
  243. package/lib/common/types/event/legacy-completion.js +0 -38
  244. package/lib/common/types/event/legacy-completion.js.map +0 -1
  245. package/lib/common/types/event/mcp.d.ts +0 -20
  246. package/lib/common/types/event/mcp.d.ts.map +0 -1
  247. package/lib/common/types/event/mcp.js +0 -3
  248. package/lib/common/types/event/mcp.js.map +0 -1
  249. package/lib/common/types/event/plugin-status.d.ts +0 -7
  250. package/lib/common/types/event/plugin-status.d.ts.map +0 -1
  251. package/lib/common/types/event/plugin-status.js +0 -3
  252. package/lib/common/types/event/plugin-status.js.map +0 -1
  253. package/lib/common/types/event/protocol.d.ts +0 -117
  254. package/lib/common/types/event/protocol.d.ts.map +0 -1
  255. package/lib/common/types/event/protocol.js +0 -5
  256. package/lib/common/types/event/protocol.js.map +0 -1
  257. package/lib/common/types/filepath.d.ts +0 -35
  258. package/lib/common/types/filepath.d.ts.map +0 -1
  259. package/lib/common/types/filepath.js +0 -3
  260. package/lib/common/types/filepath.js.map +0 -1
  261. package/lib/common/types/http.d.ts +0 -3
  262. package/lib/common/types/http.d.ts.map +0 -1
  263. package/lib/common/types/http.js +0 -3
  264. package/lib/common/types/http.js.map +0 -1
  265. package/lib/common/types/index.d.ts +0 -13
  266. package/lib/common/types/index.d.ts.map +0 -1
  267. package/lib/common/types/index.js +0 -29
  268. package/lib/common/types/index.js.map +0 -1
  269. package/lib/common/types/local-storage.d.ts +0 -26
  270. package/lib/common/types/local-storage.d.ts.map +0 -1
  271. package/lib/common/types/local-storage.js +0 -5
  272. package/lib/common/types/local-storage.js.map +0 -1
  273. package/lib/common/types/logger.d.ts +0 -10
  274. package/lib/common/types/logger.d.ts.map +0 -1
  275. package/lib/common/types/logger.js +0 -3
  276. package/lib/common/types/logger.js.map +0 -1
  277. package/lib/common/types/product/activities.d.ts +0 -5
  278. package/lib/common/types/product/activities.d.ts.map +0 -1
  279. package/lib/common/types/product/activities.js +0 -3
  280. package/lib/common/types/product/activities.js.map +0 -1
  281. package/lib/common/types/product/agent-tools.d.ts +0 -5
  282. package/lib/common/types/product/agent-tools.d.ts.map +0 -1
  283. package/lib/common/types/product/agent-tools.js +0 -3
  284. package/lib/common/types/product/agent-tools.js.map +0 -1
  285. package/lib/common/types/product/agent.d.ts +0 -45
  286. package/lib/common/types/product/agent.d.ts.map +0 -1
  287. package/lib/common/types/product/agent.js +0 -10
  288. package/lib/common/types/product/agent.js.map +0 -1
  289. package/lib/common/types/product/authentication.d.ts +0 -76
  290. package/lib/common/types/product/authentication.d.ts.map +0 -1
  291. package/lib/common/types/product/authentication.js +0 -28
  292. package/lib/common/types/product/authentication.js.map +0 -1
  293. package/lib/common/types/product/codebase.d.ts +0 -40
  294. package/lib/common/types/product/codebase.d.ts.map +0 -1
  295. package/lib/common/types/product/codebase.js +0 -3
  296. package/lib/common/types/product/codebase.js.map +0 -1
  297. package/lib/common/types/product/command.d.ts +0 -24
  298. package/lib/common/types/product/command.d.ts.map +0 -1
  299. package/lib/common/types/product/command.js +0 -3
  300. package/lib/common/types/product/command.js.map +0 -1
  301. package/lib/common/types/product/commit-message.d.ts +0 -7
  302. package/lib/common/types/product/commit-message.d.ts.map +0 -1
  303. package/lib/common/types/product/commit-message.js +0 -3
  304. package/lib/common/types/product/commit-message.js.map +0 -1
  305. package/lib/common/types/product/completion.d.ts +0 -35
  306. package/lib/common/types/product/completion.d.ts.map +0 -1
  307. package/lib/common/types/product/completion.js +0 -3
  308. package/lib/common/types/product/completion.js.map +0 -1
  309. package/lib/common/types/product/config.d.ts +0 -6
  310. package/lib/common/types/product/config.d.ts.map +0 -1
  311. package/lib/common/types/product/config.js +0 -3
  312. package/lib/common/types/product/config.js.map +0 -1
  313. package/lib/common/types/product/features.d.ts +0 -193
  314. package/lib/common/types/product/features.d.ts.map +0 -1
  315. package/lib/common/types/product/features.js +0 -198
  316. package/lib/common/types/product/features.js.map +0 -1
  317. package/lib/common/types/product/index.d.ts +0 -24
  318. package/lib/common/types/product/index.d.ts.map +0 -1
  319. package/lib/common/types/product/index.js +0 -40
  320. package/lib/common/types/product/index.js.map +0 -1
  321. package/lib/common/types/product/inline-chat.d.ts +0 -15
  322. package/lib/common/types/product/inline-chat.d.ts.map +0 -1
  323. package/lib/common/types/product/inline-chat.js +0 -3
  324. package/lib/common/types/product/inline-chat.js.map +0 -1
  325. package/lib/common/types/product/instruction.d.ts +0 -10
  326. package/lib/common/types/product/instruction.d.ts.map +0 -1
  327. package/lib/common/types/product/instruction.js +0 -8
  328. package/lib/common/types/product/instruction.js.map +0 -1
  329. package/lib/common/types/product/knowledge-base.d.ts +0 -16
  330. package/lib/common/types/product/knowledge-base.d.ts.map +0 -1
  331. package/lib/common/types/product/knowledge-base.js +0 -3
  332. package/lib/common/types/product/knowledge-base.js.map +0 -1
  333. package/lib/common/types/product/language-model.d.ts +0 -42
  334. package/lib/common/types/product/language-model.d.ts.map +0 -1
  335. package/lib/common/types/product/language-model.js +0 -3
  336. package/lib/common/types/product/language-model.js.map +0 -1
  337. package/lib/common/types/product/links.d.ts +0 -20
  338. package/lib/common/types/product/links.d.ts.map +0 -1
  339. package/lib/common/types/product/links.js +0 -3
  340. package/lib/common/types/product/links.js.map +0 -1
  341. package/lib/common/types/product/log.d.ts +0 -39
  342. package/lib/common/types/product/log.d.ts.map +0 -1
  343. package/lib/common/types/product/log.js +0 -12
  344. package/lib/common/types/product/log.js.map +0 -1
  345. package/lib/common/types/product/product-provider.d.ts +0 -12
  346. package/lib/common/types/product/product-provider.d.ts.map +0 -1
  347. package/lib/common/types/product/product-provider.js +0 -5
  348. package/lib/common/types/product/product-provider.js.map +0 -1
  349. package/lib/common/types/product/product.d.ts +0 -203
  350. package/lib/common/types/product/product.d.ts.map +0 -1
  351. package/lib/common/types/product/product.js +0 -19
  352. package/lib/common/types/product/product.js.map +0 -1
  353. package/lib/common/types/product/prompt-template.d.ts +0 -6
  354. package/lib/common/types/product/prompt-template.d.ts.map +0 -1
  355. package/lib/common/types/product/prompt-template.js +0 -3
  356. package/lib/common/types/product/prompt-template.js.map +0 -1
  357. package/lib/common/types/product/remote-agent.d.ts +0 -20
  358. package/lib/common/types/product/remote-agent.d.ts.map +0 -1
  359. package/lib/common/types/product/remote-agent.js +0 -3
  360. package/lib/common/types/product/remote-agent.js.map +0 -1
  361. package/lib/common/types/product/replacement.d.ts +0 -38
  362. package/lib/common/types/product/replacement.d.ts.map +0 -1
  363. package/lib/common/types/product/replacement.js +0 -18
  364. package/lib/common/types/product/replacement.js.map +0 -1
  365. package/lib/common/types/product/telemetry.d.ts +0 -22
  366. package/lib/common/types/product/telemetry.d.ts.map +0 -1
  367. package/lib/common/types/product/telemetry.js +0 -3
  368. package/lib/common/types/product/telemetry.js.map +0 -1
  369. package/lib/common/types/product/updates.d.ts +0 -17
  370. package/lib/common/types/product/updates.d.ts.map +0 -1
  371. package/lib/common/types/product/updates.js +0 -8
  372. package/lib/common/types/product/updates.js.map +0 -1
  373. package/lib/common/types/protocol.d.ts +0 -31
  374. package/lib/common/types/protocol.d.ts.map +0 -1
  375. package/lib/common/types/protocol.js +0 -10
  376. package/lib/common/types/protocol.js.map +0 -1
  377. package/lib/common/types/tracing.d.ts +0 -74
  378. package/lib/common/types/tracing.d.ts.map +0 -1
  379. package/lib/common/types/tracing.js +0 -3
  380. package/lib/common/types/tracing.js.map +0 -1
  381. package/lib/common/utils.d.ts +0 -3
  382. package/lib/common/utils.d.ts.map +0 -1
  383. package/lib/common/utils.js +0 -10
  384. package/lib/common/utils.js.map +0 -1
@@ -0,0 +1,196 @@
1
+ {
2
+ "agents": [
3
+ {
4
+ "name": "cli",
5
+ "instructions": "cli-agent-prompt",
6
+ "description": "cli agent",
7
+ "models": [
8
+ "codewise-chat"
9
+ ],
10
+ "commands": [
11
+ "init",
12
+ "compact",
13
+ "statusline"
14
+ ],
15
+ "tools": [
16
+ "Task",
17
+ "Read",
18
+ "Write",
19
+ "Edit",
20
+ "MultiEdit",
21
+ "Bash",
22
+ "Glob",
23
+ "Grep",
24
+ "ExitPlanMode",
25
+ "TodoWrite",
26
+ "WebFetch",
27
+ "WebSearch",
28
+ "NotebookEdit",
29
+ "BashOutput",
30
+ "KillShell",
31
+ "SlashCommand",
32
+ "Skill",
33
+ "AskUserQuestion"
34
+ ],
35
+ "tags": [
36
+ "cli",
37
+ "default"
38
+ ]
39
+ },
40
+ {
41
+ "name": "general-purpose",
42
+ "instructions": "cli-agent-prompt",
43
+ "description": "general-purpose agent",
44
+ "tools": [
45
+ "Read",
46
+ "Write",
47
+ "Edit",
48
+ "MultiEdit",
49
+ "Bash",
50
+ "Glob",
51
+ "Grep",
52
+ "TodoWrite",
53
+ "SaveMemory",
54
+ "WebFetch",
55
+ "WebSearch",
56
+ "NotebookRead",
57
+ "NotebookEdit",
58
+ "NotebookWrite",
59
+ "BashOutput",
60
+ "KillShell",
61
+ "SlashCommand",
62
+ "Skill",
63
+ "AskUserQuestion"
64
+ ],
65
+ "tags": [
66
+ "cli",
67
+ "general-purpose"
68
+ ]
69
+ },
70
+ {
71
+ "name": "compact",
72
+ "instructions": "compact-agent-prompt",
73
+ "description": "compact agent",
74
+ "tools": [
75
+ "Read"
76
+ ],
77
+ "tags": [
78
+ "cli",
79
+ "compact"
80
+ ]
81
+ },
82
+ {
83
+ "name": "contentAnalyzer",
84
+ "instructions": "content-analyzer-agent-instructions",
85
+ "description": "content analyzer agent",
86
+ "tags": [
87
+ "cli",
88
+ "content-analyzer"
89
+ ]
90
+ },
91
+ {
92
+ "name": "terminalTitleGenerator",
93
+ "instructions": "terminal-title-generator-instructions",
94
+ "description": "Generate terminal window titles from conversation topics.",
95
+ "tags": [
96
+ "cli",
97
+ "terminal-title-generator"
98
+ ]
99
+ },
100
+ {
101
+ "name": "agentInstructions",
102
+ "instructions": "agent-instructions",
103
+ "description": "generating agent instructions",
104
+ "tags": [
105
+ "cli",
106
+ "agent-instructions"
107
+ ]
108
+ },
109
+ {
110
+ "name": "statusline-setup",
111
+ "instructions": "agent-statusline-instructions",
112
+ "description": "Use this agent to configure the user's Codebuddy Code status line setting.",
113
+ "tools": [
114
+ "Read",
115
+ "Write",
116
+ "Edit"
117
+ ],
118
+ "asTool": true,
119
+ "tags": [
120
+ "cli",
121
+ "sub-agent"
122
+ ]
123
+ },
124
+ {
125
+ "name": "Explore",
126
+ "instructions": "agent-explore-instructions",
127
+ "description": "Fast agent specialized for exploring codebases. Use this when you need to quickly find files by patterns (eg. \"src/components/**/*.tsx\"), search code for keywords (eg. \"API endpoints\"), or answer questions about the codebase (eg. \"how do API endpoints work?\"). When calling this agent, specify the desired thoroughness level: \"quick\" for basic searches, \"medium\" for moderate exploration, or \"very thorough\" for comprehensive analysis across multiple locations and naming conventions.",
128
+ "tools": [
129
+ "Read",
130
+ "Bash",
131
+ "Glob",
132
+ "Grep",
133
+ "WebFetch",
134
+ "WebSearch",
135
+ "BashOutput",
136
+ "KillShell",
137
+ "SlashCommand",
138
+ "Skill",
139
+ "AskUserQuestion"
140
+ ],
141
+ "asTool": true,
142
+ "tags": [
143
+ "cli",
144
+ "sub-agent"
145
+ ]
146
+ },
147
+ {
148
+ "name": "Plan",
149
+ "instructions": "agent-plan-instructions",
150
+ "description": "Fast agent specialized for exploring codebases. Use this when you need to quickly find files by patterns (eg. \"src/components/**/*.tsx\"), search code for keywords (eg. \"API endpoints\"), or answer questions about the codebase (eg. \"how do API endpoints work?\"). When calling this agent, specify the desired thoroughness level: \"quick\" for basic searches, \"medium\" for moderate exploration, or \"very thorough\" for comprehensive analysis across multiple locations and naming conventions. (Tools: All tools)",
151
+ "tools": [
152
+ "Read",
153
+ "Bash",
154
+ "Glob",
155
+ "Grep",
156
+ "TodoWrite",
157
+ "WebFetch",
158
+ "WebSearch",
159
+ "BashOutput",
160
+ "KillShell",
161
+ "SlashCommand",
162
+ "Skill",
163
+ "AskUserQuestion"
164
+ ],
165
+ "asTool": true,
166
+ "tags": [
167
+ "cli",
168
+ "sub-agent"
169
+ ]
170
+ }
171
+ ],
172
+ "models": [
173
+ {
174
+ "credits": "x0.01 credits",
175
+ "id": "codewise-chat",
176
+ "name": "Codewise-Chat",
177
+ "vendor": "tencent",
178
+ "maxOutputTokens": 8192,
179
+ "maxInputTokens": 128000,
180
+ "supportsToolCall": true,
181
+ "supportsImages": false,
182
+ "disabledMultimodal": true,
183
+ "maxAllowedSize": 56000
184
+ }
185
+ ],
186
+ "links": {
187
+ "officialWebsite": "https://copilot.tencent.com/cli",
188
+ "upgradeUrl": ""
189
+ },
190
+ "productFeatures": {
191
+ "BillingNotice": false,
192
+ "CustomModelsJSON": true
193
+ },
194
+ "commit": "99513c6e55aec7e6d92db60e8b7b62d96f32dc44",
195
+ "date": "2025-12-19T17:20:34.004Z"
196
+ }
@@ -0,0 +1,3 @@
1
+ This project is dual-licensed under the Unlicense and MIT licenses.
2
+
3
+ You may use this code under the terms of either license.
Binary file
Binary file
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Errors
3
+ */
4
+ /**
5
+ * Error thrown when an operation is aborted.
6
+ */
7
+ export declare class AbortError extends Error {
8
+ constructor(message?: string);
9
+ }
10
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;gBACrB,OAAO,SAAsB;CAI5C"}
package/lib/errors.js ADDED
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ /**
3
+ * Errors
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.AbortError = void 0;
7
+ /**
8
+ * Error thrown when an operation is aborted.
9
+ */
10
+ class AbortError extends Error {
11
+ constructor(message = 'Operation aborted') {
12
+ super(message);
13
+ this.name = 'AbortError';
14
+ }
15
+ }
16
+ exports.AbortError = AbortError;
17
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH;;GAEG;AACH,MAAa,UAAW,SAAQ,KAAK;IACjC,YAAY,OAAO,GAAG,mBAAmB;QACrC,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;IAC7B,CAAC;CACJ;AALD,gCAKC"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Genie Agent SDK for JavaScript/TypeScript
3
+ *
4
+ * Compatible with Claude Code Agent SDK interface.
5
+ *
6
+ * @example
7
+ * ```typescript
8
+ * import { query } from '@anthropic-ai/claude-code-sdk';
9
+ *
10
+ * const q = query({
11
+ * prompt: 'List all files in the current directory',
12
+ * options: { permissionMode: 'acceptEdits' }
13
+ * });
14
+ *
15
+ * for await (const message of q) {
16
+ * console.log(message);
17
+ * }
18
+ * ```
19
+ */
20
+ export { query } from './query';
21
+ export { Query } from './query';
22
+ export { createSession as unstable_v2_createSession, resumeSession as unstable_v2_resumeSession, prompt as unstable_v2_prompt, } from './session';
23
+ export { HOOK_EVENTS, EXIT_REASONS } from './types';
24
+ export { AbortError } from './errors';
25
+ export type { Options, SessionOptions } from './types';
26
+ export type { PermissionMode, PermissionBehavior, PermissionResult, PermissionUpdate, CanUseTool, } from './types';
27
+ export type { HookEvent, HookCallback, HookCallbackMatcher, HookInput, HookJSONOutput, SyncHookJSONOutput, AsyncHookJSONOutput, BaseHookInput, PreToolUseHookInput, PostToolUseHookInput, PostToolUseFailureHookInput, NotificationHookInput, UserPromptSubmitHookInput, SessionStartHookInput, SessionEndHookInput, StopHookInput, SubagentStartHookInput, SubagentStopHookInput, PreCompactHookInput, PermissionRequestHookInput, } from './types';
28
+ export type { Message, SystemMessage, UserMessage, AssistantMessage, PartialAssistantMessage, ResultMessage, CompactBoundaryMessage, StatusMessage, ToolProgressMessage, PermissionDenial, } from './types';
29
+ export type { SlashCommand, ModelInfo, AccountInfo, McpServerStatus, } from './types';
30
+ export type { OutputFormat, JsonSchemaOutputFormat } from './types';
31
+ export type { RawMessageStreamEvent } from './types';
32
+ export type { McpServerConfig, McpStdioServerConfig, McpSSEServerConfig, McpHttpServerConfig, } from './types';
33
+ export type { AgentDefinition } from './types';
34
+ export type { SandboxSettings } from './types';
35
+ export type { Session } from './types';
36
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC,OAAO,EACH,aAAa,IAAI,yBAAyB,EAC1C,aAAa,IAAI,yBAAyB,EAC1C,MAAM,IAAI,kBAAkB,GAC/B,MAAM,WAAW,CAAC;AAInB,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAIpD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAKtC,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGvD,YAAY,EACR,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,GACb,MAAM,SAAS,CAAC;AAGjB,YAAY,EACR,SAAS,EACT,YAAY,EACZ,mBAAmB,EACnB,SAAS,EACT,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,2BAA2B,EAC3B,qBAAqB,EACrB,yBAAyB,EACzB,qBAAqB,EACrB,mBAAmB,EACnB,aAAa,EACb,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,0BAA0B,GAC7B,MAAM,SAAS,CAAC;AAGjB,YAAY,EACR,OAAO,EACP,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,uBAAuB,EACvB,aAAa,EACb,sBAAsB,EACtB,aAAa,EACb,mBAAmB,EACnB,gBAAgB,GACnB,MAAM,SAAS,CAAC;AAGjB,YAAY,EACR,YAAY,EACZ,SAAS,EACT,WAAW,EACX,eAAe,GAClB,MAAM,SAAS,CAAC;AAGjB,YAAY,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAGpE,YAAY,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAGrD,YAAY,EACR,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,GACtB,MAAM,SAAS,CAAC;AAGjB,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG/C,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG/C,YAAY,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC"}
package/lib/index.js ADDED
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ /**
3
+ * Genie Agent SDK for JavaScript/TypeScript
4
+ *
5
+ * Compatible with Claude Code Agent SDK interface.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * import { query } from '@anthropic-ai/claude-code-sdk';
10
+ *
11
+ * const q = query({
12
+ * prompt: 'List all files in the current directory',
13
+ * options: { permissionMode: 'acceptEdits' }
14
+ * });
15
+ *
16
+ * for await (const message of q) {
17
+ * console.log(message);
18
+ * }
19
+ * ```
20
+ */
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.AbortError = exports.EXIT_REASONS = exports.HOOK_EVENTS = exports.unstable_v2_resumeSession = exports.unstable_v2_createSession = exports.Query = exports.query = void 0;
23
+ // ============= Main API =============
24
+ var query_1 = require("./query");
25
+ Object.defineProperty(exports, "query", { enumerable: true, get: function () { return query_1.query; } });
26
+ var query_2 = require("./query");
27
+ Object.defineProperty(exports, "Query", { enumerable: true, get: function () { return query_2.Query; } });
28
+ // V2 API (unstable)
29
+ var session_1 = require("./session");
30
+ Object.defineProperty(exports, "unstable_v2_createSession", { enumerable: true, get: function () { return session_1.createSession; } });
31
+ Object.defineProperty(exports, "unstable_v2_resumeSession", { enumerable: true, get: function () { return session_1.resumeSession; } });
32
+ Object.defineProperty(exports, "unstable_v2_prompt", { enumerable: true, get: function () { return session_1.prompt; } });
33
+ // ============= Constants =============
34
+ var types_1 = require("./types");
35
+ Object.defineProperty(exports, "HOOK_EVENTS", { enumerable: true, get: function () { return types_1.HOOK_EVENTS; } });
36
+ Object.defineProperty(exports, "EXIT_REASONS", { enumerable: true, get: function () { return types_1.EXIT_REASONS; } });
37
+ // ============= Errors =============
38
+ var errors_1 = require("./errors");
39
+ Object.defineProperty(exports, "AbortError", { enumerable: true, get: function () { return errors_1.AbortError; } });
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;AAEH,uCAAuC;AAEvC,iCAAgC;AAAvB,8FAAA,KAAK,OAAA;AACd,iCAAgC;AAAvB,8FAAA,KAAK,OAAA;AAEd,oBAAoB;AACpB,qCAImB;AAHf,oHAAA,aAAa,OAA6B;AAC1C,oHAAA,aAAa,OAA6B;AAC1C,6GAAA,MAAM,OAAsB;AAGhC,wCAAwC;AAExC,iCAAoD;AAA3C,oGAAA,WAAW,OAAA;AAAE,qGAAA,YAAY,OAAA;AAElC,qCAAqC;AAErC,mCAAsC;AAA7B,oGAAA,UAAU,OAAA"}
@@ -1,5 +1,6 @@
1
- describe('agent-sdk package', () => {
2
- it('support agent-sdk coverage statistics', () => {
1
+ "use strict";
2
+ describe('agent-sdk-js package', () => {
3
+ it('support agent-sdk-js coverage statistics', () => {
3
4
  // do nothing.
4
5
  });
5
6
  });
@@ -1 +1 @@
1
- {"version":3,"file":"package.spec.js","sourceRoot":"","sources":["../src/package.spec.ts"],"names":[],"mappings":"AAAA,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IAE/B,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;QAC7C,cAAc;IAClB,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"package.spec.js","sourceRoot":"","sources":["../src/package.spec.ts"],"names":[],"mappings":";AAAA,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IAElC,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QAChD,cAAc;IAClB,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
package/lib/query.d.ts ADDED
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Query Implementation
3
+ */
4
+ import type { Message, UserMessage, Options, PermissionMode, SlashCommand, ModelInfo, McpServerStatus, AccountInfo } from './types';
5
+ /**
6
+ * Create a query for interacting with the agent.
7
+ */
8
+ export declare function query(params: {
9
+ prompt: string | AsyncIterable<UserMessage>;
10
+ options?: Options;
11
+ }): Query;
12
+ /**
13
+ * Query class - an AsyncGenerator that yields messages.
14
+ */
15
+ export declare class Query implements AsyncGenerator<Message, void> {
16
+ private prompt;
17
+ private options?;
18
+ private transport;
19
+ private initialized;
20
+ private abortController;
21
+ private hookCallbacks;
22
+ private iterator;
23
+ constructor(prompt: string | AsyncIterable<UserMessage>, options?: Options | undefined);
24
+ [Symbol.asyncIterator](): AsyncGenerator<Message, void>;
25
+ next(): Promise<IteratorResult<Message, void>>;
26
+ return(): Promise<IteratorResult<Message, void>>;
27
+ throw(e: Error): Promise<IteratorResult<Message, void>>;
28
+ interrupt(): Promise<void>;
29
+ setPermissionMode(mode: PermissionMode): Promise<void>;
30
+ setModel(model?: string): Promise<void>;
31
+ setMaxThinkingTokens(maxThinkingTokens: number | null): Promise<void>;
32
+ supportedCommands(): Promise<SlashCommand[]>;
33
+ supportedModels(): Promise<ModelInfo[]>;
34
+ mcpServerStatus(): Promise<McpServerStatus[]>;
35
+ accountInfo(): Promise<AccountInfo>;
36
+ streamInput(stream: AsyncIterable<UserMessage>): Promise<void>;
37
+ private createIterator;
38
+ private initialize;
39
+ private sendPrompt;
40
+ private handleControlRequest;
41
+ private handleHookCallback;
42
+ private registeredHooks?;
43
+ private registerHooks;
44
+ private buildHooksConfig;
45
+ }
46
+ //# sourceMappingURL=query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../src/query.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EACR,OAAO,EACP,WAAW,EACX,OAAO,EACP,cAAc,EAQd,YAAY,EACZ,SAAS,EACT,eAAe,EACf,WAAW,EACd,MAAM,SAAS,CAAC;AAGjB;;GAEG;AACH,wBAAgB,KAAK,CAAC,MAAM,EAAE;IAC1B,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB,GAAG,KAAK,CAER;AAED;;GAEG;AACH,qBAAa,KAAM,YAAW,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC;IAQnD,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,OAAO,CAAC;IARpB,OAAO,CAAC,SAAS,CAAY;IAC7B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,aAAa,CAA0I;IAC/J,OAAO,CAAC,QAAQ,CAA8C;gBAGlD,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC,WAAW,CAAC,EAC3C,OAAO,CAAC,EAAE,OAAO,YAAA;IAoC7B,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC;IAOjD,IAAI,IAAI,OAAO,CAAC,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAI9C,MAAM,IAAI,OAAO,CAAC,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAKhD,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAOvD,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAa1B,iBAAiB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAOtD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAOvC,oBAAoB,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IASrE,iBAAiB,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAO5C,eAAe,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;IAOvC,eAAe,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;IAO7C,WAAW,IAAI,OAAO,CAAC,WAAW,CAAC;IAOnC,WAAW,CAAC,MAAM,EAAE,aAAa,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;YAQrD,cAAc;YAmCf,UAAU;YAyBV,UAAU;YAUV,oBAAoB;YAapB,kBAAkB;IAoBhC,OAAO,CAAC,eAAe,CAAC,CAAoD;IAE5E,OAAO,CAAC,aAAa;IAwBrB,OAAO,CAAC,gBAAgB;CAwB3B"}