@tencent-ai/agent-sdk 0.1.0-next.989 → 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 (91) hide show
  1. package/README.md +73 -2
  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 -14
  75. package/dist/agent-sdk.js +0 -1
  76. package/lib/common/application-utils.d.ts +0 -5
  77. package/lib/common/application-utils.d.ts.map +0 -1
  78. package/lib/common/application-utils.js +0 -18
  79. package/lib/common/application-utils.js.map +0 -1
  80. package/lib/common/component-registry.d.ts +0 -10
  81. package/lib/common/component-registry.d.ts.map +0 -1
  82. package/lib/common/component-registry.js +0 -50
  83. package/lib/common/component-registry.js.map +0 -1
  84. package/lib/common/index.d.ts +0 -4
  85. package/lib/common/index.d.ts.map +0 -1
  86. package/lib/common/index.js +0 -20
  87. package/lib/common/index.js.map +0 -1
  88. package/lib/common/services.d.ts +0 -8
  89. package/lib/common/services.d.ts.map +0 -1
  90. package/lib/common/services.js +0 -21
  91. package/lib/common/services.js.map +0 -1
package/README.md CHANGED
@@ -1,4 +1,75 @@
1
- # Genie - Agent SDK Component
1
+ # CodeBuddy Agent SDK
2
2
 
3
- 负责与 Agent 交互,提供 Agent SDK 接口。
3
+ SDK for building AI agents with CodeBuddy Code's capabilities. Programmatically interact with AI to build autonomous agents that can understand codebases, edit files, and execute workflows.
4
4
 
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @tencent-ai/agent-sdk
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ```typescript
14
+ import { query } from '@tencent-ai/agent-sdk';
15
+
16
+ const response = query({
17
+ prompt: 'What files are in this directory?',
18
+ options: {
19
+ permissionMode: 'bypassPermissions',
20
+ },
21
+ });
22
+
23
+ for await (const message of response) {
24
+ if (message.type === 'assistant') {
25
+ for (const block of message.message.content) {
26
+ if (block.type === 'text') {
27
+ console.log(block.text);
28
+ }
29
+ }
30
+ }
31
+ }
32
+ ```
33
+
34
+ ## API Reference
35
+
36
+ ### `query(options)`
37
+
38
+ Create a query to interact with the agent.
39
+
40
+ ```typescript
41
+ const q = query({
42
+ prompt: string, // The prompt to send
43
+ options: {
44
+ model?: string, // Model to use
45
+ permissionMode?: 'default' | 'acceptEdits' | 'bypassPermissions',
46
+ maxTurns?: number, // Maximum conversation turns
47
+ cwd?: string, // Working directory
48
+ hooks?: HookCallback[], // Event hooks
49
+ agents?: Record<string, AgentDefinition>, // Custom agents
50
+ },
51
+ });
52
+
53
+ // Iterate over messages
54
+ for await (const message of q) {
55
+ // Handle message
56
+ }
57
+
58
+ ```
59
+
60
+ ### Message Types
61
+
62
+ - `system` - Session initialization info
63
+ - `assistant` - Agent responses (text, tool calls)
64
+ - `result` - Query completion status
65
+
66
+ ## Related Links
67
+
68
+ - [CodeBuddy Code CLI](https://www.npmjs.com/package/@tencent-ai/codebuddy-code)
69
+ - [Documentation](https://cnb.cool/codebuddy/codebuddy-code/-/blob/main/docs)
70
+ - [Issues](https://cnb.cool/codebuddy/codebuddy-code/-/issues)
71
+
72
+ ## Feedback
73
+
74
+ - Submit issues at [Issues](https://cnb.cool/codebuddy/codebuddy-code/-/issues)
75
+ - Contact: codebuddy@tencent.com