@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.
- package/README.md +73 -2
- package/cli/CHANGELOG.md +2418 -0
- package/cli/LICENSE.txt +19 -0
- package/cli/README.md +26 -0
- package/cli/bin/codebuddy +39 -0
- package/cli/dist/codebuddy.js +20 -0
- package/cli/package.json +44 -0
- package/cli/product.cloudhosted.json +242 -0
- package/cli/product.internal.json +244 -0
- package/cli/product.ioa.json +467 -0
- package/cli/product.json +948 -0
- package/cli/product.selfhosted.json +196 -0
- package/cli/vendor/ripgrep/COPYING +3 -0
- package/cli/vendor/ripgrep/arm64-darwin/rg +0 -0
- package/cli/vendor/ripgrep/arm64-darwin/ripgrep.node +0 -0
- package/cli/vendor/ripgrep/arm64-linux/rg +0 -0
- package/cli/vendor/ripgrep/arm64-linux/ripgrep.node +0 -0
- package/cli/vendor/ripgrep/x64-darwin/rg +0 -0
- package/cli/vendor/ripgrep/x64-darwin/ripgrep.node +0 -0
- package/cli/vendor/ripgrep/x64-linux/rg +0 -0
- package/cli/vendor/ripgrep/x64-linux/ripgrep.node +0 -0
- package/cli/vendor/ripgrep/x64-win32/rg.exe +0 -0
- package/cli/vendor/ripgrep/x64-win32/ripgrep.node +0 -0
- package/lib/errors.d.ts +10 -0
- package/lib/errors.d.ts.map +1 -0
- package/lib/errors.js +17 -0
- package/lib/errors.js.map +1 -0
- package/lib/index.d.ts +36 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +40 -0
- package/lib/index.js.map +1 -0
- package/lib/package.spec.js +3 -2
- package/lib/package.spec.js.map +1 -1
- package/lib/query.d.ts +46 -0
- package/lib/query.d.ts.map +1 -0
- package/lib/query.js +270 -0
- package/lib/query.js.map +1 -0
- package/lib/session.d.ts +53 -0
- package/lib/session.d.ts.map +1 -0
- package/lib/session.js +163 -0
- package/lib/session.js.map +1 -0
- package/lib/transport/index.d.ts +104 -0
- package/lib/transport/index.d.ts.map +1 -0
- package/lib/transport/index.js +20 -0
- package/lib/transport/index.js.map +1 -0
- package/lib/transport/process-transport.d.ts +65 -0
- package/lib/transport/process-transport.d.ts.map +1 -0
- package/lib/transport/process-transport.js +380 -0
- package/lib/transport/process-transport.js.map +1 -0
- package/lib/types.d.ts +603 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +58 -0
- package/lib/types.js.map +1 -0
- package/lib/utils/cli-resolver.d.ts +36 -0
- package/lib/utils/cli-resolver.d.ts.map +1 -0
- package/lib/utils/cli-resolver.js +123 -0
- package/lib/utils/cli-resolver.js.map +1 -0
- package/lib/utils/env-utils.d.ts +9 -0
- package/lib/utils/env-utils.d.ts.map +1 -0
- package/lib/utils/env-utils.js +19 -0
- package/lib/utils/env-utils.js.map +1 -0
- package/lib/utils/index.d.ts +8 -0
- package/lib/utils/index.d.ts.map +1 -0
- package/lib/utils/index.js +17 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/process.d.ts +8 -0
- package/lib/utils/process.d.ts.map +1 -0
- package/lib/utils/process.js +16 -0
- package/lib/utils/process.js.map +1 -0
- package/lib/utils/stream.d.ts +24 -0
- package/lib/utils/stream.d.ts.map +1 -0
- package/lib/utils/stream.js +85 -0
- package/lib/utils/stream.js.map +1 -0
- package/package.json +21 -14
- package/dist/agent-sdk.js +0 -1
- package/lib/common/application-utils.d.ts +0 -5
- package/lib/common/application-utils.d.ts.map +0 -1
- package/lib/common/application-utils.js +0 -18
- package/lib/common/application-utils.js.map +0 -1
- package/lib/common/component-registry.d.ts +0 -10
- package/lib/common/component-registry.d.ts.map +0 -1
- package/lib/common/component-registry.js +0 -50
- package/lib/common/component-registry.js.map +0 -1
- package/lib/common/index.d.ts +0 -4
- package/lib/common/index.d.ts.map +0 -1
- package/lib/common/index.js +0 -20
- package/lib/common/index.js.map +0 -1
- package/lib/common/services.d.ts +0 -8
- package/lib/common/services.d.ts.map +0 -1
- package/lib/common/services.js +0 -21
- package/lib/common/services.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
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/errors.d.ts
ADDED
|
@@ -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;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M,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
|
package/lib/index.js.map
ADDED
|
@@ -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"}
|
package/lib/package.spec.js
CHANGED
package/lib/package.spec.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.spec.js","sourceRoot":"","sources":["../src/package.spec.ts"],"names":[],"mappings":"AAAA,QAAQ,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,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