@qoder-ai/qoder-agent-sdk 1.0.57 → 1.0.59
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 +53 -54
- package/dist/core/default-runtime.d.ts +4 -2
- package/dist/core/errors.d.ts +12 -0
- package/dist/core/process-transport.d.ts +14 -117
- package/dist/core/query-transport.d.ts +12 -2
- package/dist/core/runtime-launch-options.d.ts +3 -0
- package/dist/core/worker-transport.d.ts +8 -52
- package/dist/daemon/daemon-connection.d.ts +4 -6
- package/dist/daemon/daemon-session-transport.d.ts +3 -0
- package/dist/daemon/global-daemon.d.ts +26 -8
- package/dist/daemon/legacy-transport-compat.d.ts +13 -0
- package/dist/daemon/protocol.d.ts +6 -0
- package/dist/daemon/start-daemon.d.ts +13 -2
- package/dist/index.d.ts +6 -6
- package/dist/index.js +35 -39
- package/dist/protocol/control.d.ts +1 -0
- package/dist/protocol/index.d.ts +1 -1
- package/dist/protocol/messages.d.ts +70 -2
- package/dist/query/query-runner.d.ts +4 -1
- package/dist/runtime-manifest.json +5 -5
- package/dist/types/index.d.ts +1 -4
- package/dist/types/messages.d.ts +3 -1
- package/dist/types/options.d.ts +35 -27
- package/package.json +2 -2
package/dist/protocol/index.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export type { EffectiveMemoryConfig, MemoryConsumptionFile, MemoryConsumptionRes
|
|
|
22
22
|
export type { EffectiveEvolutionConfig, EffectiveSkillEvolutionConfig, SerializableEvolutionConfig, SerializableSkillEvolutionConfig, SerializableSkillEvolutionGenerationOptions, SkillEvolutionGateInput, SkillEvolutionGateResult, SkillEvolutionMode, SkillEvolutionResult, SkillEvolutionSuggestion, } from './skill-evolution.js';
|
|
23
23
|
export type { PermissionMode, PermissionBehavior, PermissionScope, CanUseToolPermissionKind, CanUseToolPermissionOption, CanUseToolPermissionDetails, PermissionDecisionClassification, PermissionUpdateDestination, PermissionRuleValue, PermissionUpdate, PermissionResult, } from './permissions.js';
|
|
24
24
|
export type { McpStdioServerConfig, McpSSEServerConfig, McpHttpServerConfig, McpSdkServerConfig, McpServerConfigForProcessTransport, McpServerStatus, McpServerStatusConfig, McpSetServersResult, OAuthToken, } from './mcp.js';
|
|
25
|
-
export type { SDKAssistantMessage, SDKToolNonExecutionKind, SDKToolResultMeta, SDKMessageOrigin, SDKSelectedSkill, SDKUserMessage, SDKUserMessageReplay, SDKResultSuccess, SDKResultError, SDKResultMessage, SDKFileAttachment, SDKSystemMessage, SDKArtifactInfo, SDKArtifactUpdateMessage, SDKAvailableModelsUpdateMessage, SDKCommandsChangedMessage, SDKPartialAssistantMessage, SDKCompactBoundaryMessage, SDKStatusMessage, SDKAPIRetryMessage, SDKModelQueueStatusMessage, SDKControlRequestProgressMessage, SDKCommandLifecycleMessage, SDKToolProgressMessage, SDKHookDiagnosticsMessage, SDKHookStartedMessage, SDKHookProgressMessage, SDKHookResponseMessage, SDKTaskNotificationMessage, SDKTaskStartedMessage, SDKTaskProgressMessage, SDKTaskUpdatedMessage, SDKBackgroundTasksChangedMessage, SDKSessionStateChangedMessage, SDKPlanModeChangedMessage, SDKGoalUpdatedMessage, SDKGoalClearedMessage, SDKSessionTitleChangedMessage, SDKFilesPersistedEvent, SDKElicitationCompleteMessage, SDKPromptSuggestionMessage, SDKCloudAgentEventMessage, SDKMemoryGenerationMessage, SDKMemoryConsumptionMessage, SDKSkillEvolutionMessage, SDKAgentsMdSizeWarningMessage, SDKPermissionDenial, SDKPermissionDeniedMessage, SDKPermissionDeniedReasonType, SDKMessage, } from './messages.js';
|
|
25
|
+
export type { SDKAssistantMessage, SDKHostToolUseMessage, SDKHostToolResultMessage, SDKCodeModeHostResult, SDKToolNonExecutionKind, SDKToolResultMeta, SDKMessageOrigin, SDKSelectedSkill, SDKUserMessage, SDKUserMessageReplay, SDKResultSuccess, SDKResultError, SDKResultMessage, SDKFileAttachment, SDKSystemMessage, SDKArtifactInfo, SDKArtifactUpdateMessage, SDKAvailableModelsUpdateMessage, SDKCommandsChangedMessage, SDKPartialAssistantMessage, SDKCompactBoundaryMessage, SDKStatusMessage, SDKAPIRetryMessage, SDKModelQueueStatusMessage, SDKControlRequestProgressMessage, SDKCommandLifecycleMessage, SDKToolProgressMessage, SDKHookDiagnosticsMessage, SDKHookStartedMessage, SDKHookProgressMessage, SDKHookResponseMessage, SDKTaskNotificationMessage, SDKTaskStartedMessage, SDKTaskProgressMessage, SDKTaskUpdatedMessage, SDKBackgroundTasksChangedMessage, SDKSessionStateChangedMessage, SDKPlanModeChangedMessage, SDKGoalUpdatedMessage, SDKGoalClearedMessage, SDKSessionTitleChangedMessage, SDKFilesPersistedEvent, SDKElicitationCompleteMessage, SDKPromptSuggestionMessage, SDKCloudAgentEventMessage, SDKMemoryGenerationMessage, SDKMemoryConsumptionMessage, SDKSkillEvolutionMessage, SDKAgentsMdSizeWarningMessage, SDKPermissionDenial, SDKPermissionDeniedMessage, SDKPermissionDeniedReasonType, SDKMessage, } from './messages.js';
|
|
26
26
|
export type { BaseHookInput, PreToolUseHookInput, PostToolUseHookInput, PostToolUseFailureHookInput, UserPromptSubmitHookInput, SessionStartHookInput, SessionEndHookInput, StopHookInput, StopFailureHookInput, SubagentStartHookInput, SubagentStopHookInput, PreCompactHookInput, PostCompactHookInput, PermissionRequestHookInput, PermissionDeniedHookInput, SetupHookInput, TeammateIdleHookInput, TaskCreatedHookInput, TaskCompletedHookInput, ElicitationHookInput, ElicitationResultHookInput, ConfigChangeHookInput, WorktreeCreateHookInput, WorktreeRemoveHookInput, InstructionsLoadedHookInput, CwdChangedHookInput, FileChangedHookInput, HookInput, PreToolUseHookSpecificOutput, PostToolUseHookSpecificOutput, PostToolUseFailureHookSpecificOutput, UserPromptSubmitHookSpecificOutput, SessionStartHookSpecificOutput, SetupHookSpecificOutput, SubagentStartHookSpecificOutput, PermissionRequestHookSpecificOutput, ElicitationHookSpecificOutput, ElicitationResultHookSpecificOutput, CwdChangedHookSpecificOutput, FileChangedHookSpecificOutput, WorktreeCreateHookSpecificOutput, SyncHookJSONOutput, AsyncHookJSONOutput, HookJSONOutput, HookEvent, } from './hooks.js';
|
|
27
27
|
export type { AgentMcpServerSpec, AgentDefinition, AgentInfo, AgentMemoryScope, } from './agents.js';
|
|
28
28
|
export { QoderModelPurpose } from './control.js';
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* `@google/gemini-cli-core/protocol/schemas` are kept aligned via
|
|
12
12
|
* `satisfies z.ZodType<...>` against these types.
|
|
13
13
|
*/
|
|
14
|
-
import type { BetaMessage, BetaRawMessageStreamEvent, MessageParam, UUID, SDKAssistantMessageError, FastModeState, ApiKeySource, ModelUsage, NonNullableUsage, PluginInfo, ModelInfo, SlashCommand, SDKStatus } from './common.js';
|
|
14
|
+
import type { BetaMessage, BetaRawMessageStreamEvent, MessageParam, UUID, SDKAssistantMessageError, FastModeState, ApiKeySource, ModelUsage, NonNullableUsage, ContentBlock, PluginInfo, ModelInfo, SlashCommand, SDKStatus } from './common.js';
|
|
15
15
|
import type { PermissionMode } from './permissions.js';
|
|
16
16
|
import type { MemoryConsumptionResult, MemoryGenerationResult } from './memory.js';
|
|
17
17
|
import type { SkillEvolutionResult } from './skill-evolution.js';
|
|
@@ -73,6 +73,8 @@ export type SDKUserMessage = {
|
|
|
73
73
|
message: MessageParam;
|
|
74
74
|
parent_tool_use_id: string | null;
|
|
75
75
|
custom_context?: Record<string, string>;
|
|
76
|
+
/** Additional Qoder headers for this input's first main-model request and its retries. */
|
|
77
|
+
extra_headers?: Record<string, string>;
|
|
76
78
|
/** SDK telemetry metadata; started_at_ms/submitted_at_ms use Unix milliseconds. */
|
|
77
79
|
extra?: Record<string, unknown>;
|
|
78
80
|
/** The client has resolved slash commands, so a leading slash is literal input. */
|
|
@@ -239,6 +241,14 @@ export type SDKCompactBoundaryMessage = {
|
|
|
239
241
|
tail_uuid: UUID;
|
|
240
242
|
};
|
|
241
243
|
};
|
|
244
|
+
/** 本次压缩的累计用量,包含失败尝试和重试;缺失 credits 表示未知。 */
|
|
245
|
+
usage?: {
|
|
246
|
+
context_usage_ratio?: number;
|
|
247
|
+
credits?: number;
|
|
248
|
+
};
|
|
249
|
+
/** 用于费用去重和归因的全部压缩请求 ID。 */
|
|
250
|
+
modelRequestIds?: string[];
|
|
251
|
+
agent_id?: string;
|
|
242
252
|
uuid: UUID;
|
|
243
253
|
session_id: string;
|
|
244
254
|
};
|
|
@@ -247,6 +257,14 @@ export type SDKStatusMessage = {
|
|
|
247
257
|
subtype: 'status';
|
|
248
258
|
status: SDKStatus;
|
|
249
259
|
permissionMode?: PermissionMode;
|
|
260
|
+
/** 本次压缩的累计用量,包含失败尝试和重试;缺失 credits 表示未知。 */
|
|
261
|
+
usage?: {
|
|
262
|
+
context_usage_ratio?: number;
|
|
263
|
+
credits?: number;
|
|
264
|
+
};
|
|
265
|
+
/** 用于费用去重和归因的全部压缩请求 ID。 */
|
|
266
|
+
modelRequestIds?: string[];
|
|
267
|
+
agent_id?: string;
|
|
250
268
|
uuid: UUID;
|
|
251
269
|
session_id: string;
|
|
252
270
|
};
|
|
@@ -661,5 +679,55 @@ export type SDKToolProgressMessage = {
|
|
|
661
679
|
/** Omitted when the preview is truncated and the producer only has an estimate. */
|
|
662
680
|
total_lines?: number;
|
|
663
681
|
preview_truncated?: boolean;
|
|
682
|
+
/** Native MCP progress for the call identified by tool_use_id. */
|
|
683
|
+
mcp?: {
|
|
684
|
+
server_name: string;
|
|
685
|
+
progress: number;
|
|
686
|
+
total?: number;
|
|
687
|
+
message?: string;
|
|
688
|
+
};
|
|
689
|
+
};
|
|
690
|
+
/** Native child tool result for the host, optionally persisted in a CodeMode call delta. */
|
|
691
|
+
export type SDKCodeModeHostResult = {
|
|
692
|
+
content: string | ContentBlock[];
|
|
693
|
+
is_error?: boolean;
|
|
694
|
+
tool_use_result?: unknown;
|
|
695
|
+
tool_result_meta?: SDKToolResultMeta[];
|
|
696
|
+
};
|
|
697
|
+
type SDKHostToolEnvelope = {
|
|
698
|
+
type: 'system';
|
|
699
|
+
code_mode_tool_use_id: string;
|
|
700
|
+
uuid: UUID;
|
|
701
|
+
session_id: string;
|
|
702
|
+
parent_tool_use_id: string | null;
|
|
703
|
+
};
|
|
704
|
+
/** Host notification for a child tool call. Model usage and stop information belong to assistant messages. */
|
|
705
|
+
export type SDKHostToolUseMessage = SDKHostToolEnvelope & {
|
|
706
|
+
subtype: 'host_tool_use';
|
|
707
|
+
message: {
|
|
708
|
+
role: 'assistant';
|
|
709
|
+
content: [
|
|
710
|
+
{
|
|
711
|
+
type: 'tool_use';
|
|
712
|
+
id: string;
|
|
713
|
+
name: string;
|
|
714
|
+
input: Record<string, unknown>;
|
|
715
|
+
}
|
|
716
|
+
];
|
|
717
|
+
};
|
|
718
|
+
};
|
|
719
|
+
/** Output-only notification for a child tool result. */
|
|
720
|
+
export type SDKHostToolResultMessage = SDKHostToolEnvelope & Pick<SDKCodeModeHostResult, 'tool_use_result' | 'tool_result_meta'> & {
|
|
721
|
+
subtype: 'host_tool_result';
|
|
722
|
+
message: {
|
|
723
|
+
role: 'user';
|
|
724
|
+
content: [
|
|
725
|
+
{
|
|
726
|
+
type: 'tool_result';
|
|
727
|
+
tool_use_id: string;
|
|
728
|
+
} & Pick<SDKCodeModeHostResult, 'content' | 'is_error'>
|
|
729
|
+
];
|
|
730
|
+
};
|
|
664
731
|
};
|
|
665
|
-
export type SDKMessage = SDKToolProgressMessage | SDKAgentsMdSizeWarningMessage | SDKAssistantMessage | SDKUserMessage | SDKUserMessageReplay | SDKResultMessage | SDKSystemMessage | SDKArtifactUpdateMessage | SDKAvailableModelsUpdateMessage | SDKCommandsChangedMessage | SDKPermissionDeniedMessage | SDKPartialAssistantMessage | SDKCompactBoundaryMessage | SDKStatusMessage | SDKAPIRetryMessage | SDKModelQueueStatusMessage | SDKControlRequestProgressMessage | SDKCommandLifecycleMessage | SDKHookDiagnosticsMessage | SDKHookStartedMessage | SDKHookProgressMessage | SDKHookResponseMessage | SDKTaskNotificationMessage | SDKTaskStartedMessage | SDKTaskProgressMessage | SDKTaskUpdatedMessage | SDKBackgroundTasksChangedMessage | SDKSessionStateChangedMessage | SDKPlanModeChangedMessage | SDKGoalUpdatedMessage | SDKGoalClearedMessage | SDKSessionTitleChangedMessage | SDKFilesPersistedEvent | SDKElicitationCompleteMessage | SDKPromptSuggestionMessage | SDKCloudAgentEventMessage | SDKMemoryGenerationMessage | SDKMemoryConsumptionMessage | SDKSkillEvolutionMessage;
|
|
732
|
+
export type SDKMessage = SDKHostToolUseMessage | SDKHostToolResultMessage | SDKToolProgressMessage | SDKAgentsMdSizeWarningMessage | SDKAssistantMessage | SDKUserMessage | SDKUserMessageReplay | SDKResultMessage | SDKSystemMessage | SDKArtifactUpdateMessage | SDKAvailableModelsUpdateMessage | SDKCommandsChangedMessage | SDKPermissionDeniedMessage | SDKPartialAssistantMessage | SDKCompactBoundaryMessage | SDKStatusMessage | SDKAPIRetryMessage | SDKModelQueueStatusMessage | SDKControlRequestProgressMessage | SDKCommandLifecycleMessage | SDKHookDiagnosticsMessage | SDKHookStartedMessage | SDKHookProgressMessage | SDKHookResponseMessage | SDKTaskNotificationMessage | SDKTaskStartedMessage | SDKTaskProgressMessage | SDKTaskUpdatedMessage | SDKBackgroundTasksChangedMessage | SDKSessionStateChangedMessage | SDKPlanModeChangedMessage | SDKGoalUpdatedMessage | SDKGoalClearedMessage | SDKSessionTitleChangedMessage | SDKFilesPersistedEvent | SDKElicitationCompleteMessage | SDKPromptSuggestionMessage | SDKCloudAgentEventMessage | SDKMemoryGenerationMessage | SDKMemoryConsumptionMessage | SDKSkillEvolutionMessage;
|
|
733
|
+
export {};
|
|
@@ -47,9 +47,10 @@ import type { MemoryRuntimeCallbacks, SerializableMemoryConfig } from '../types/
|
|
|
47
47
|
import type { SkillEvolutionRuntimeCallbacks, SerializableEvolutionConfig } from '../types/skill-evolution.js';
|
|
48
48
|
import type { ResolveSessionArtifacts } from '../types/artifacts.js';
|
|
49
49
|
import type { BYOKModelValidationInput, BYOKProviderInfo, ByokConfigCheckResult, ByokConfigInfo, ByokConfigReference, CheckByokConfigInput, CreateByokConfigInput, DeleteByokConfigInput, UpdateByokConfigInput } from '../types/byok.js';
|
|
50
|
-
/**
|
|
50
|
+
/** Query initialization and input settings. */
|
|
51
51
|
type InitConfig = {
|
|
52
52
|
sdkStartedAtMs?: number;
|
|
53
|
+
extraHeaders?: Record<string, string>;
|
|
53
54
|
systemPrompt?: string;
|
|
54
55
|
appendSystemPrompt?: string;
|
|
55
56
|
modelRequestPatches?: ModelPromptPatches;
|
|
@@ -80,6 +81,7 @@ type InitConfig = {
|
|
|
80
81
|
};
|
|
81
82
|
export declare class QueryRunner implements InternalQuery {
|
|
82
83
|
private readonly hostActionDirect;
|
|
84
|
+
private extraHeadersSent;
|
|
83
85
|
private static readonly CUSTOM_CONTEXT_CAPABILITY;
|
|
84
86
|
private static readonly SELECTED_SKILLS_CAPABILITY;
|
|
85
87
|
private static readonly INITIALIZE_TIMEOUT_MS;
|
|
@@ -349,6 +351,7 @@ export declare class QueryRunner implements InternalQuery {
|
|
|
349
351
|
generateSessionTitle(description: string, options?: {
|
|
350
352
|
persist?: boolean;
|
|
351
353
|
customContext?: Record<string, string>;
|
|
354
|
+
sourceUserMessageId?: string;
|
|
352
355
|
}): Promise<SDKControlGenerateSessionTitleResponse['title']>;
|
|
353
356
|
askSideQuestion(question: string, options?: AskSideQuestionOptions): Promise<SideQuestionResult | null>;
|
|
354
357
|
/**
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 1,
|
|
3
3
|
"brand": "global",
|
|
4
|
-
"sdkVersion": "1.0.
|
|
5
|
-
"qoderCliVersion": "1.1.
|
|
4
|
+
"sdkVersion": "1.0.59",
|
|
5
|
+
"qoderCliVersion": "1.1.83",
|
|
6
6
|
"defaultTransport": "worker",
|
|
7
7
|
"workerRuntime": {
|
|
8
8
|
"packaged": false,
|
|
9
9
|
"delivery": "install",
|
|
10
10
|
"source": "qodercli-worker-runtime",
|
|
11
|
-
"urlTemplate": "https://download.qoder.com/qodercli/releases/1.1.
|
|
11
|
+
"urlTemplate": "https://download.qoder.com/qodercli/releases/1.1.83/qodercli-worker-runtime-{target}.tgz",
|
|
12
12
|
"artifactNameTemplate": "qodercli-worker-runtime-{target}.tgz",
|
|
13
|
-
"sdkVersion": "1.0.
|
|
14
|
-
"qoderCliVersion": "1.1.
|
|
13
|
+
"sdkVersion": "1.0.59",
|
|
14
|
+
"qoderCliVersion": "1.1.83"
|
|
15
15
|
}
|
|
16
16
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -6,12 +6,9 @@ export * from './common.js';
|
|
|
6
6
|
export * from './messages.js';
|
|
7
7
|
export * from './memory.js';
|
|
8
8
|
export * from './artifacts.js';
|
|
9
|
-
export type { DefaultRuntimeTransport } from '../core/default-runtime.js';
|
|
10
9
|
export type { QueryTransportCreateOptions, QueryTransportProviderOption, } from '../core/query-transport.js';
|
|
11
|
-
export type { ProcessTransportOptions } from '../core/process-transport.js';
|
|
12
|
-
export type { WorkerRuntimeTransportOptions, WorkerTransportOptions, } from '../core/worker-transport.js';
|
|
13
10
|
export type { QueryTransportProvider, Transport, } from '../core/transport.js';
|
|
14
|
-
export type { ElicitationRequest, ElicitationResult, OnElicitation, PromptRequestOption, PromptRequest, PromptResponse, SecurityScanOptions, Options, QueryTransportOptions,
|
|
11
|
+
export type { ElicitationRequest, ElicitationResult, OnElicitation, PromptRequestOption, PromptRequest, PromptResponse, SecurityScanOptions, Options, QueryTransportOptions, Query, } from './options.js';
|
|
15
12
|
export * from './permissions.js';
|
|
16
13
|
export type { HostActionOptions, HostActionParams } from './host-action.js';
|
|
17
14
|
export type { HookEvent, HookPermissionDecision, HookCallback, HookCallbackMatcher, HookInput, HookSpecificOutput, HookJSONOutput, AsyncHookJSONOutput, SyncHookJSONOutput, BaseHookInput, PreToolUseHookInput, PostToolUseHookInput, PostToolUseFailureHookInput, UserPromptSubmitHookInput, SessionStartHookInput, SessionEndHookInput, StopHookInput, SubagentStartHookInput, SubagentStopHookInput, PreCompactHookInput, PostCompactHookInput, PermissionRequestHookInput, PermissionDeniedHookInput, InstructionsLoadedHookInput, WorktreeCreateHookInput, WorktreeRemoveHookInput, CwdChangedHookInput, FileChangedHookInput, PreToolUseHookSpecificOutput, PostToolUseHookSpecificOutput, PostToolUseFailureHookSpecificOutput, UserPromptSubmitHookSpecificOutput, SessionStartHookSpecificOutput, SubagentStartHookSpecificOutput, PermissionRequestHookSpecificOutput, WorktreeCreateHookSpecificOutput, CwdChangedHookSpecificOutput, FileChangedHookSpecificOutput, } from './hooks.js';
|
package/dist/types/messages.d.ts
CHANGED
|
@@ -9,12 +9,14 @@ import type { SDKMessage as ProtocolSDKMessage, SDKStatusMessage as ProtocolSDKS
|
|
|
9
9
|
import type { MessageParam, UUID } from './common.js';
|
|
10
10
|
import type { PermissionMode } from './permissions.js';
|
|
11
11
|
import type { SessionKey } from '../session/session-store.js';
|
|
12
|
-
export type { SDKAssistantMessage, SDKArtifactInfo, SDKArtifactUpdateMessage, SDKAvailableModelsUpdateMessage, SDKCommandsChangedMessage, SDKResultSuccess, SDKResultError, SDKResultMessage, SDKPartialAssistantMessage, SDKCompactBoundaryMessage, SDKAPIRetryMessage, SDKModelQueueStatusMessage, SDKControlRequestProgressMessage, SDKCommandLifecycleMessage, SDKToolProgressMessage, SDKHookDiagnosticsMessage, SDKHookStartedMessage, SDKHookProgressMessage, SDKHookResponseMessage, SDKTaskNotificationMessage, SDKTaskStartedMessage, SDKTaskProgressMessage, SDKTaskUpdatedMessage, SDKBackgroundTasksChangedMessage, SDKSessionStateChangedMessage, SDKPlanModeChangedMessage, SDKSessionTitleChangedMessage, SDKFilesPersistedEvent, SDKElicitationCompleteMessage, SDKPromptSuggestionMessage, SDKCloudAgentEventMessage, SDKMemoryGenerationMessage, SDKMemoryConsumptionMessage, SDKSkillEvolutionMessage, SDKAgentsMdSizeWarningMessage, SDKPermissionDenial, SDKMessageOrigin, SDKSelectedSkill, SDKToolNonExecutionKind, SDKToolResultMeta, } from '../protocol/index.js';
|
|
12
|
+
export type { SDKHostToolUseMessage, SDKHostToolResultMessage, SDKCodeModeHostResult, SDKAssistantMessage, SDKArtifactInfo, SDKArtifactUpdateMessage, SDKAvailableModelsUpdateMessage, SDKCommandsChangedMessage, SDKResultSuccess, SDKResultError, SDKResultMessage, SDKPartialAssistantMessage, SDKCompactBoundaryMessage, SDKAPIRetryMessage, SDKModelQueueStatusMessage, SDKControlRequestProgressMessage, SDKCommandLifecycleMessage, SDKToolProgressMessage, SDKHookDiagnosticsMessage, SDKHookStartedMessage, SDKHookProgressMessage, SDKHookResponseMessage, SDKTaskNotificationMessage, SDKTaskStartedMessage, SDKTaskProgressMessage, SDKTaskUpdatedMessage, SDKBackgroundTasksChangedMessage, SDKSessionStateChangedMessage, SDKPlanModeChangedMessage, SDKSessionTitleChangedMessage, SDKFilesPersistedEvent, SDKElicitationCompleteMessage, SDKPromptSuggestionMessage, SDKCloudAgentEventMessage, SDKMemoryGenerationMessage, SDKMemoryConsumptionMessage, SDKSkillEvolutionMessage, SDKAgentsMdSizeWarningMessage, SDKPermissionDenial, SDKMessageOrigin, SDKSelectedSkill, SDKToolNonExecutionKind, SDKToolResultMeta, } from '../protocol/index.js';
|
|
13
13
|
export type SDKUserMessage = {
|
|
14
14
|
type: 'user';
|
|
15
15
|
message: MessageParam;
|
|
16
16
|
parent_tool_use_id: string | null;
|
|
17
17
|
custom_context?: Record<string, string>;
|
|
18
|
+
/** Additional Qoder headers for this input's first main-model request and its retries. */
|
|
19
|
+
extra_headers?: Record<string, string>;
|
|
18
20
|
/** SDK telemetry metadata; started_at_ms/submitted_at_ms use Unix milliseconds. */
|
|
19
21
|
extra?: Record<string, unknown>;
|
|
20
22
|
/**
|
package/dist/types/options.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Readable, Writable } from 'stream';
|
|
1
|
+
import type { Readable, Writable } from 'node:stream';
|
|
2
2
|
import type { CloseDiagnosticEvent } from './close-diagnostics.js';
|
|
3
3
|
import type { ElicitResult } from '@modelcontextprotocol/sdk/types.js';
|
|
4
4
|
import type { AuthOptions, InternalAuthOptions } from './auth.js';
|
|
@@ -9,7 +9,7 @@ import type { HookCallbackMatcher, HookEvent } from './hooks.js';
|
|
|
9
9
|
import type { McpServerConfig, McpServerStatus, McpSetServersResult, OAuthToken } from './mcp.js';
|
|
10
10
|
import type { SDKMessage, SDKUserMessage } from './messages.js';
|
|
11
11
|
import type { Settings } from './settings.js';
|
|
12
|
-
import type { SDKControlInterruptResponse, SDKControlInitializeResponse, SDKControlGetContextUsageResponse, SDKControlGenerateSessionTitleResponse, AskSideQuestionOptions, SideQuestionResult, SDKControlAddDirectoriesResponse, SDKControlReloadPluginsResponse, SDKControlReloadSkillsResponse
|
|
12
|
+
import type { SDKControlInterruptResponse, SDKControlInitializeResponse, SDKControlGetContextUsageResponse, SDKControlGenerateSessionTitleResponse, AskSideQuestionOptions, SideQuestionResult, SDKControlAddDirectoriesResponse, SDKControlReloadPluginsResponse, SDKControlReloadSkillsResponse } from './control.js';
|
|
13
13
|
import type { ModelPolicyProvider } from './model-policy-provider.js';
|
|
14
14
|
import type { BYOKModelValidationInput, BYOKProviderInfo, ByokConfigCheckResult, ByokConfigInfo, ByokConfigReference, CheckByokConfigInput, CreateByokConfigInput, DeleteByokConfigInput, UpdateByokConfigInput } from './byok.js';
|
|
15
15
|
import type { RewindFilesResult, RewindResult, RewindScope } from './session.js';
|
|
@@ -67,6 +67,16 @@ export type SecurityScanOptions = {
|
|
|
67
67
|
l3DeepScan?: boolean;
|
|
68
68
|
};
|
|
69
69
|
export type Options = {
|
|
70
|
+
/** 当前 Query 的业务类型;产品身份在 initDaemon/startDaemon 中配置。 */
|
|
71
|
+
business?: {
|
|
72
|
+
type: string;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Additional Qoder inference headers for the first main-model request of the
|
|
76
|
+
* first queryable input, including network retries. Later requests and
|
|
77
|
+
* subagents do not inherit them. Existing built-in headers take precedence.
|
|
78
|
+
*/
|
|
79
|
+
extraHeaders?: Record<string, string>;
|
|
70
80
|
/**
|
|
71
81
|
* Optional controller for defining when the host ends the session. Calling
|
|
72
82
|
* `abort()` closes the session and ends message iteration.
|
|
@@ -99,9 +109,9 @@ export type Options = {
|
|
|
99
109
|
* - `{ type: 'jobToken', fetchJobToken }` - Internal first-party host
|
|
100
110
|
* integration. Prefer the `jobToken(fetchJobToken)` helper in host code.
|
|
101
111
|
*
|
|
102
|
-
* Required
|
|
103
|
-
*
|
|
104
|
-
*
|
|
112
|
+
* Required unless `options.daemon` refers to a daemon that was started with
|
|
113
|
+
* its own credentials. Every other query starts the process-wide daemon with
|
|
114
|
+
* these credentials.
|
|
105
115
|
*/
|
|
106
116
|
auth?: InternalAuthOptions;
|
|
107
117
|
additionalDirectories?: string[];
|
|
@@ -124,13 +134,17 @@ export type Options = {
|
|
|
124
134
|
*/
|
|
125
135
|
experimentalCloudAgent?: CloudAgentOptions;
|
|
126
136
|
/**
|
|
127
|
-
* Selects the
|
|
137
|
+
* Selects the shared daemon's launch carrier for the first implicit daemon
|
|
138
|
+
* start.
|
|
128
139
|
*
|
|
129
|
-
* - omitted:
|
|
130
|
-
* - `ProcessTransport.default`:
|
|
131
|
-
* - `WorkerTransport.default`:
|
|
132
|
-
* - `new WorkerTransport({ ... })`:
|
|
140
|
+
* - omitted: the daemon uses the package's `DEFAULT_RUNTIME_TRANSPORT`.
|
|
141
|
+
* - `ProcessTransport.default`: launch qodercli as a process carrier.
|
|
142
|
+
* - `WorkerTransport.default`: launch the bundled worker runtime.
|
|
143
|
+
* - `new WorkerTransport({ ... })`: launch the given worker runtime.
|
|
133
144
|
* - custom `QueryTransportProvider`: provide a fresh transport per query.
|
|
145
|
+
*
|
|
146
|
+
* Once the daemon is ready, a query with a different launch mode is rejected
|
|
147
|
+
* with `DaemonConfigurationConflictError`.
|
|
134
148
|
*/
|
|
135
149
|
transport?: QueryTransportOptions;
|
|
136
150
|
agent?: string;
|
|
@@ -245,11 +259,6 @@ export type Options = {
|
|
|
245
259
|
* disable.
|
|
246
260
|
*/
|
|
247
261
|
controlRequestTimeoutMs?: number;
|
|
248
|
-
/**
|
|
249
|
-
* Grace period in milliseconds before the local transport terminates qodercli
|
|
250
|
-
* after closing stdin. Defaults to 2000.
|
|
251
|
-
*/
|
|
252
|
-
closeGraceMs?: number;
|
|
253
262
|
includePartialMessages?: boolean;
|
|
254
263
|
includeHookEvents?: boolean;
|
|
255
264
|
/** Opt in to bounded foreground shell previews via tool_progress on supported daemons. Defaults to off. */
|
|
@@ -265,11 +274,10 @@ export type Options = {
|
|
|
265
274
|
allowedMcpServerNames?: string[];
|
|
266
275
|
model?: string;
|
|
267
276
|
/**
|
|
268
|
-
* Path to
|
|
277
|
+
* Path to the local Qoder CLI entry that the daemon process launches.
|
|
269
278
|
*
|
|
270
|
-
* Native binaries and
|
|
271
|
-
*
|
|
272
|
-
* explicit `transport` provider takes precedence over this automatic choice.
|
|
279
|
+
* Native binaries and JavaScript CLI entries are both supported; a script
|
|
280
|
+
* entry runs through `executable` (or the SDK host's Node binary).
|
|
273
281
|
*/
|
|
274
282
|
pathToQoderCLIExecutable?: string;
|
|
275
283
|
permissionMode?: PermissionMode;
|
|
@@ -361,6 +369,11 @@ export type Options = {
|
|
|
361
369
|
* logging, but is not forwarded to qodercli.
|
|
362
370
|
*/
|
|
363
371
|
debugFile?: string;
|
|
372
|
+
/**
|
|
373
|
+
* Accepted for compatibility with the former per-query transport. The
|
|
374
|
+
* shared daemon owns process termination, so this value is ignored.
|
|
375
|
+
*/
|
|
376
|
+
closeGraceMs?: number;
|
|
364
377
|
spawnQoderCLIProcess?: (options: SpawnOptions) => SpawnedProcess;
|
|
365
378
|
};
|
|
366
379
|
export interface SpawnOptions {
|
|
@@ -511,6 +524,9 @@ export interface Query extends AsyncGenerator<SDKMessage, void> {
|
|
|
511
524
|
*/
|
|
512
525
|
generateSessionTitle(description: string, options?: {
|
|
513
526
|
persist?: boolean;
|
|
527
|
+
/** 原用户消息的 uuid;标题正文不参与业务归属匹配。 */
|
|
528
|
+
sourceUserMessageId?: string;
|
|
529
|
+
customContext?: Record<string, string>;
|
|
514
530
|
}): Promise<SDKControlGenerateSessionTitleResponse['title']>;
|
|
515
531
|
/**
|
|
516
532
|
* Ask a one-off question using the current conversation context without
|
|
@@ -652,12 +668,4 @@ export interface InternalQuery extends Query {
|
|
|
652
668
|
reconnectMcpServer(serverName: string): Promise<void>;
|
|
653
669
|
mcpClearAuth(serverName: string): Promise<void>;
|
|
654
670
|
injectMcpToken(serverName: string, token: OAuthToken): Promise<void>;
|
|
655
|
-
}
|
|
656
|
-
export interface Transport {
|
|
657
|
-
initialize(): Promise<void>;
|
|
658
|
-
write(data: string): void | Promise<void>;
|
|
659
|
-
close(): void;
|
|
660
|
-
isReady(): boolean;
|
|
661
|
-
readMessages(): AsyncGenerator<StdoutMessage, void, unknown>;
|
|
662
|
-
endInput(): void;
|
|
663
671
|
}
|
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.59",
|
|
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.83",
|
|
54
54
|
"qoderSdkBrand": "global",
|
|
55
55
|
"license": "SEE LICENSE IN LICENSE"
|
|
56
56
|
}
|