@qoder-ai/qoder-agent-sdk 1.0.22 → 1.0.24
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 +24 -0
- package/dist/core/process-transport.d.ts +2 -1
- package/dist/core/runtime-command.d.ts +14 -0
- package/dist/core/runtime-launch-options.d.ts +3 -1
- package/dist/core/security-scan-options.d.ts +7 -0
- package/dist/core/worker-runtime-launch.d.ts +16 -0
- package/dist/core/worker-runtime-path.d.ts +2 -0
- package/dist/core/worker-transport.d.ts +3 -3
- package/dist/index.d.ts +6 -4
- package/dist/index.js +30 -30
- package/dist/memory/memory-options.d.ts +7 -0
- package/dist/protocol/control.d.ts +54 -10
- package/dist/protocol/index.d.ts +3 -2
- package/dist/protocol/index.js +1 -1
- package/dist/protocol/launch.d.ts +4 -0
- package/dist/protocol/memory.d.ts +133 -0
- package/dist/protocol/messages.d.ts +47 -1
- package/dist/query/query-runner.d.ts +21 -2
- package/dist/runtime-manifest.json +5 -5
- package/dist/types/control.d.ts +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/memory.d.ts +59 -0
- package/dist/types/messages.d.ts +2 -1
- package/dist/types/options.d.ts +42 -1
- package/dist/types/plugins.d.ts +1 -0
- package/dist/types/session.d.ts +6 -0
- package/dist/types/tools.d.ts +15 -1
- package/package.json +2 -2
package/dist/types/options.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import type { HookCallbackMatcher, HookEvent } from './hooks.js';
|
|
|
8
8
|
import type { McpServerConfig, McpServerStatus, McpSetServersResult, OAuthToken } from './mcp.js';
|
|
9
9
|
import type { SDKMessage, SDKUserMessage } from './messages.js';
|
|
10
10
|
import type { Settings } from './settings.js';
|
|
11
|
-
import type { SDKControlInterruptResponse, SDKControlInitializeResponse, SDKControlGetContextUsageResponse, SDKControlGenerateSessionTitleResponse, SDKControlAddDirectoriesResponse, SDKControlReloadPluginsResponse, StdoutMessage } from './control.js';
|
|
11
|
+
import type { SDKControlInterruptResponse, SDKControlInitializeResponse, SDKControlGetContextUsageResponse, SDKControlGenerateSessionTitleResponse, AskSideQuestionOptions, SideQuestionResult, SDKControlAddDirectoriesResponse, SDKControlReloadPluginsResponse, StdoutMessage } from './control.js';
|
|
12
12
|
import type { ModelPolicyProvider } from './model-policy-provider.js';
|
|
13
13
|
import type { BYOKModelValidationInput, BYOKProviderInfo } from './byok.js';
|
|
14
14
|
import type { RewindFilesResult, RewindResult, RewindScope } from './session.js';
|
|
@@ -17,6 +17,7 @@ import type { QueryTransportProviderOption } from '../core/query-transport.js';
|
|
|
17
17
|
import type { PluginDetails } from './plugins.js';
|
|
18
18
|
import type { SessionStore, SessionStoreFlush } from '../session/session-store.js';
|
|
19
19
|
import type { ModelPromptPatches } from '../protocol/model-prompt-patches.js';
|
|
20
|
+
import type { MemoryOptions } from './memory.js';
|
|
20
21
|
export type { CanUseTool };
|
|
21
22
|
export type { AuthOptions };
|
|
22
23
|
export type ElicitationRequest = {
|
|
@@ -50,6 +51,15 @@ export type PromptResponse = {
|
|
|
50
51
|
};
|
|
51
52
|
export type SettingSource = 'user' | 'project' | 'local';
|
|
52
53
|
export type QueryTransportOptions = QueryTransportProviderOption;
|
|
54
|
+
/** Built-in code security capabilities. All switches default to false. */
|
|
55
|
+
export type SecurityScanOptions = {
|
|
56
|
+
/** Run the static security check after supported file edits. */
|
|
57
|
+
l1StaticCheck?: boolean;
|
|
58
|
+
/** Allow lightweight repository security scans. */
|
|
59
|
+
l2LightweightScan?: boolean;
|
|
60
|
+
/** Allow deep repository security scans. */
|
|
61
|
+
l3DeepScan?: boolean;
|
|
62
|
+
};
|
|
53
63
|
export type Options = {
|
|
54
64
|
/**
|
|
55
65
|
* Optional controller for defining when the host ends the session. Calling
|
|
@@ -80,6 +90,18 @@ export type Options = {
|
|
|
80
90
|
*/
|
|
81
91
|
auth?: InternalAuthOptions;
|
|
82
92
|
additionalDirectories?: string[];
|
|
93
|
+
/**
|
|
94
|
+
* Opaque business identifiers forwarded to every local qodercli inference
|
|
95
|
+
* request unless a user message supplies its own `custom_context`.
|
|
96
|
+
*
|
|
97
|
+
* Backend-enforced limits are 1–8 string entries, keys up to 32 Unicode code
|
|
98
|
+
* points, values up to 128 Unicode code points, and at most 1024 UTF-8 bytes
|
|
99
|
+
* for the serialized JSON object. Do not include tokens, Service Account
|
|
100
|
+
* keys, email addresses, phone numbers, other credentials, or sensitive
|
|
101
|
+
* personal data. Backend acceptance requires Service Account authentication
|
|
102
|
+
* and a qoder VPC deployment.
|
|
103
|
+
*/
|
|
104
|
+
customContext?: Record<string, string>;
|
|
83
105
|
/**
|
|
84
106
|
* @experimental
|
|
85
107
|
* @unstable Cloud Agent runtime is experimental and may change without
|
|
@@ -161,6 +183,11 @@ export type Options = {
|
|
|
161
183
|
*/
|
|
162
184
|
resumeDropsTurn?: string;
|
|
163
185
|
hooks?: Partial<Record<HookEvent, HookCallbackMatcher[]>>;
|
|
186
|
+
/**
|
|
187
|
+
* Configure QoderCLI-owned memory generation and consumption for this query.
|
|
188
|
+
* Functions stay in the SDK process and are bridged through control requests.
|
|
189
|
+
*/
|
|
190
|
+
memory?: MemoryOptions;
|
|
164
191
|
onElicitation?: OnElicitation;
|
|
165
192
|
/**
|
|
166
193
|
* Called when the SDK detects that authentication has expired or
|
|
@@ -226,6 +253,11 @@ export type Options = {
|
|
|
226
253
|
loadTimeoutMs?: number;
|
|
227
254
|
sessionId?: string;
|
|
228
255
|
settings?: string | Settings;
|
|
256
|
+
/**
|
|
257
|
+
* Enables built-in code security capabilities for this SDK session.
|
|
258
|
+
* Omitted switches are disabled. This option is authoritative when provided.
|
|
259
|
+
*/
|
|
260
|
+
securityScan?: SecurityScanOptions;
|
|
229
261
|
settingSources?: SettingSource[];
|
|
230
262
|
stderr?: (data: string) => void;
|
|
231
263
|
strictMcpConfig?: boolean;
|
|
@@ -358,6 +390,11 @@ export interface Query extends AsyncGenerator<SDKMessage, void> {
|
|
|
358
390
|
generateSessionTitle(description: string, options?: {
|
|
359
391
|
persist?: boolean;
|
|
360
392
|
}): Promise<SDKControlGenerateSessionTitleResponse['title']>;
|
|
393
|
+
/**
|
|
394
|
+
* Ask a one-off question using the current conversation context without
|
|
395
|
+
* interrupting or mutating the main agent turn.
|
|
396
|
+
*/
|
|
397
|
+
askSideQuestion?(question: string, options?: AskSideQuestionOptions): Promise<SideQuestionResult | null>;
|
|
361
398
|
/**
|
|
362
399
|
* Add directories to the running session's workspace context.
|
|
363
400
|
*
|
|
@@ -417,6 +454,10 @@ export interface Query extends AsyncGenerator<SDKMessage, void> {
|
|
|
417
454
|
dryRun?: boolean;
|
|
418
455
|
}): Promise<RewindResult>;
|
|
419
456
|
seedReadState(path: string, mtime: number): Promise<void>;
|
|
457
|
+
/** Wait until pending TurnComplete memory generation has finished. */
|
|
458
|
+
flushMemory(): Promise<void>;
|
|
459
|
+
/** Reload configured memory consumption files without changing config. */
|
|
460
|
+
refreshMemory(): Promise<void>;
|
|
420
461
|
/**
|
|
421
462
|
* 主动驱动 MCP OAuth:拉起 OAuth 流程,返回授权 URL 让 host 引导用户跳转。
|
|
422
463
|
*
|
package/dist/types/plugins.d.ts
CHANGED
|
@@ -97,6 +97,7 @@ export type PluginValidationReport = {
|
|
|
97
97
|
resources?: PluginResources;
|
|
98
98
|
};
|
|
99
99
|
export type ValidatePluginOptions = {
|
|
100
|
+
/** Optional qodercli executable or qoder Worker runtime entry override. */
|
|
100
101
|
cliPath?: string;
|
|
101
102
|
env?: Record<string, string>;
|
|
102
103
|
signal?: AbortSignal;
|
package/dist/types/session.d.ts
CHANGED
|
@@ -36,6 +36,12 @@ export type SessionMessage = {
|
|
|
36
36
|
isApiErrorMessage?: true;
|
|
37
37
|
/** CLI-stamped display metadata for tool results that did not execute. */
|
|
38
38
|
tool_result_meta?: SDKToolResultMeta[];
|
|
39
|
+
/**
|
|
40
|
+
* Structured tool result persisted by qodercli alongside a user
|
|
41
|
+
* `tool_result` message. When one transcript entry contains multiple
|
|
42
|
+
* `tool_result` blocks, this is an array aligned with those blocks by index.
|
|
43
|
+
*/
|
|
44
|
+
tool_use_result?: unknown;
|
|
39
45
|
/**
|
|
40
46
|
* ISO 8601 timestamp of when this transcript entry was written to the
|
|
41
47
|
* jsonl file. Mirrors the on-disk `timestamp` field. Optional because
|
package/dist/types/tools.d.ts
CHANGED
|
@@ -62,6 +62,20 @@ export type BashInput = {
|
|
|
62
62
|
description?: string;
|
|
63
63
|
run_in_background?: boolean;
|
|
64
64
|
};
|
|
65
|
+
export type BashToolBackgroundLaunchResult = {
|
|
66
|
+
kind: 'backgrounded';
|
|
67
|
+
pid: number;
|
|
68
|
+
taskId: string;
|
|
69
|
+
outputFile?: string;
|
|
70
|
+
command: string;
|
|
71
|
+
stdout?: string;
|
|
72
|
+
initialOutput: string;
|
|
73
|
+
backgroundReason?: 'user' | 'model' | 'timeout' | 'auto';
|
|
74
|
+
telemetryExecutionId?: string;
|
|
75
|
+
totalLines?: number;
|
|
76
|
+
totalBytes?: number;
|
|
77
|
+
};
|
|
78
|
+
export declare function isBashToolBackgroundLaunchResult(value: unknown): value is BashToolBackgroundLaunchResult;
|
|
65
79
|
export type BashOutput = {
|
|
66
80
|
stdout: string;
|
|
67
81
|
stderr: string;
|
|
@@ -372,4 +386,4 @@ export type McpOutput = {
|
|
|
372
386
|
isError?: boolean;
|
|
373
387
|
};
|
|
374
388
|
export type ToolInputSchemas = AgentInput | BashInput | FileReadInput | FileEditInput | FileWriteInput | GlobInput | GrepInput | WebFetchInput | WebSearchInput | AskUserQuestionInput | NotebookEditInput | TaskStopInput | TaskCreateInput | TaskGetInput | TaskUpdateInput | TaskListInput | ExitPlanModeInput | ConfigInput | EnterWorktreeInput | ExitWorktreeInput | TodoWriteInput | ListMcpResourcesInput | ReadMcpResourceInput | McpInput;
|
|
375
|
-
export type ToolOutputSchemas = AgentOutput | BashOutput | FileReadOutput | FileEditOutput | FileWriteOutput | GlobOutput | GrepOutput | WebFetchOutput | WebSearchOutput | AskUserQuestionOutput | NotebookEditOutput | TaskStopOutput | TaskCreateOutput | TaskGetOutput | TaskUpdateOutput | TaskListOutput | ExitPlanModeOutput | ConfigOutput | EnterWorktreeOutput | ExitWorktreeOutput | TodoWriteOutput | ListMcpResourcesOutput | McpOutput;
|
|
389
|
+
export type ToolOutputSchemas = AgentOutput | BashToolBackgroundLaunchResult | BashOutput | FileReadOutput | FileEditOutput | FileWriteOutput | GlobOutput | GrepOutput | WebFetchOutput | WebSearchOutput | AskUserQuestionOutput | NotebookEditOutput | TaskStopOutput | TaskCreateOutput | TaskGetOutput | TaskUpdateOutput | TaskListOutput | ExitPlanModeOutput | ConfigOutput | EnterWorktreeOutput | ExitWorktreeOutput | TodoWriteOutput | ListMcpResourcesOutput | McpOutput;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qoder-ai/qoder-agent-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.24",
|
|
4
4
|
"description": "TypeScript SDK for building Qoder-powered coding agents.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"zod": "^3.25.0 || ^4.0.0"
|
|
52
52
|
},
|
|
53
|
-
"qoderCliVersion": "1.1.
|
|
53
|
+
"qoderCliVersion": "1.1.25",
|
|
54
54
|
"qoderSdkBrand": "global",
|
|
55
55
|
"license": "SEE LICENSE IN LICENSE"
|
|
56
56
|
}
|