@qoder-ai/qoder-agent-sdk 1.0.24 → 1.0.26
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 +28 -0
- package/dist/core/brand.d.ts +10 -0
- package/dist/core/constants.d.ts +6 -5
- package/dist/core/diagnostic-args.d.ts +2 -0
- package/dist/core/process-transport.d.ts +5 -0
- package/dist/core/runtime-launch-options.d.ts +1 -0
- package/dist/global/plugins.d.ts +3 -9
- package/dist/index.d.ts +7 -5
- package/dist/index.js +28 -29
- package/dist/protocol/control.d.ts +78 -3
- package/dist/protocol/index.d.ts +3 -2
- package/dist/protocol/index.js +1 -1
- package/dist/protocol/memory.d.ts +4 -0
- package/dist/protocol/messages.d.ts +43 -1
- package/dist/protocol/skill-evolution.d.ts +67 -0
- package/dist/protocol/version.d.ts +1 -1
- package/dist/query/query-runner.d.ts +44 -5
- package/dist/runtime-manifest.json +5 -5
- package/dist/session/session-manager.d.ts +42 -4
- package/dist/skill-evolution/skill-evolution-options.d.ts +2 -0
- package/dist/types/control.d.ts +1 -1
- package/dist/types/hooks.d.ts +4 -4
- package/dist/types/index.d.ts +1 -1
- package/dist/types/memory.d.ts +16 -1
- package/dist/types/messages.d.ts +1 -1
- package/dist/types/model-policy-provider.d.ts +8 -2
- package/dist/types/options.d.ts +61 -4
- package/dist/types/plugins.d.ts +11 -0
- package/dist/types/session.d.ts +8 -0
- package/dist/types/skill-evolution.d.ts +41 -0
- package/dist/types/tools.d.ts +26 -8
- package/package.json +2 -2
- package/scripts/postinstall.cjs +52 -39
package/README.md
CHANGED
|
@@ -284,6 +284,34 @@ const q = query({
|
|
|
284
284
|
});
|
|
285
285
|
```
|
|
286
286
|
|
|
287
|
+
## Plan Mode
|
|
288
|
+
|
|
289
|
+
Plan Mode is independent from tool permissions. Set its initial state with
|
|
290
|
+
`planMode`; the SDK applies it after the CLI handshake and before the first
|
|
291
|
+
user message, while preserving the underlying `permissionMode`:
|
|
292
|
+
|
|
293
|
+
```ts
|
|
294
|
+
const q = query({
|
|
295
|
+
prompt: "Plan a safe migration for this repository.",
|
|
296
|
+
options: {
|
|
297
|
+
auth: qodercliAuth(),
|
|
298
|
+
cwd: process.cwd(),
|
|
299
|
+
permissionMode: "default",
|
|
300
|
+
planMode: true,
|
|
301
|
+
},
|
|
302
|
+
});
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
For a live streaming session, use `q.setPlanMode(true | false)` to switch the
|
|
306
|
+
state and `q.getPlanMode()` to read the authoritative current state. These APIs
|
|
307
|
+
require a CLI that advertises the `plan_mode_v1` capability.
|
|
308
|
+
|
|
309
|
+
For compatibility with existing consumers, `system/init.permissionMode` is
|
|
310
|
+
projected as `"plan"` while Plan Mode is active. This does not replace the
|
|
311
|
+
underlying tool permission mode; after leaving Plan Mode, the field reports
|
|
312
|
+
that mode again. Use the Plan APIs and `plan_mode_changed` events as the
|
|
313
|
+
authoritative Plan state.
|
|
314
|
+
|
|
287
315
|
## Working Directory
|
|
288
316
|
|
|
289
317
|
Use `cwd` to run the agent in a specific project directory:
|
package/dist/core/brand.d.ts
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
export type SdkBrand = 'global' | 'cn';
|
|
2
2
|
export declare const SDK_BRAND: SdkBrand;
|
|
3
3
|
export declare const IS_CN_SDK: boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Prefix for all Qoder environment variables recognized by the CLI.
|
|
6
|
+
* Global builds use `QODER_`, CN builds use `QODERCN_`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const SDK_BRAND_ENV_PREFIX: string;
|
|
9
|
+
/**
|
|
10
|
+
* Environment variable the CLI reads to resolve a VPC private-deployment
|
|
11
|
+
* endpoint. VPC mode only activates in CN builds.
|
|
12
|
+
*/
|
|
13
|
+
export declare const SDK_VPC_ENDPOINT_ENV: string;
|
|
4
14
|
export declare const SDK_BRAND_CONFIG: {
|
|
5
15
|
productName: string;
|
|
6
16
|
packageName: string;
|
package/dist/core/constants.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* Hook events supported by the public SDK hook registration API.
|
|
8
8
|
*/
|
|
9
|
-
export declare const HOOK_EVENTS: readonly ["PreToolUse", "PostToolUse", "PostToolUseFailure", "UserPromptSubmit", "SessionStart", "SessionEnd", "Stop", "SubagentStart", "SubagentStop", "PreCompact", "PostCompact", "CwdChanged", "InstructionsLoaded", "FileChanged", "PermissionRequest", "PermissionDenied"];
|
|
9
|
+
export declare const HOOK_EVENTS: readonly ["PreToolUse", "PostToolUse", "PostToolUseFailure", "UserPromptSubmit", "SessionStart", "SessionEnd", "Stop", "SubagentStart", "SubagentStop", "PreCompact", "PostCompact", "CwdChanged", "InstructionsLoaded", "FileChanged", "PermissionRequest", "PermissionDenied", "WorktreeCreate", "WorktreeRemove"];
|
|
10
10
|
/**
|
|
11
11
|
* All supported exit reasons for session termination.
|
|
12
12
|
*/
|
|
@@ -40,11 +40,12 @@ export declare const CLI_EXIT_CODE_AUTH_ERROR = 41;
|
|
|
40
40
|
* `options.tools`.
|
|
41
41
|
*
|
|
42
42
|
* Keep this list explicit so new qodercli built-ins do not automatically
|
|
43
|
-
* become SDK-visible.
|
|
44
|
-
*
|
|
45
|
-
*
|
|
43
|
+
* become SDK-visible. UpdateGoal is included so an active goal started through
|
|
44
|
+
* the SDK control plane can terminate itself. Goal creation/read, cron,
|
|
45
|
+
* workflow, plan-mode transition, Bash PTY, worktree, topic, and
|
|
46
|
+
* background-task control tools remain opt-in via `options.tools`.
|
|
46
47
|
*/
|
|
47
|
-
export declare const SDK_DEFAULT_TOOLS: readonly ["Agent", "AskUserQuestion", "Bash", "Edit", "Glob", "Grep", "ImageGen", "ImageSearch", "NotebookEdit", "Read", "Skill", "TaskCreate", "TaskGet", "TaskUpdate", "TaskList", "WebFetch", "WebSearch", "Write"];
|
|
48
|
+
export declare const SDK_DEFAULT_TOOLS: readonly ["Agent", "AskUserQuestion", "Bash", "Edit", "Glob", "Grep", "ImageGen", "ImageSearch", "NotebookEdit", "Read", "Skill", "TaskCreate", "TaskGet", "TaskUpdate", "TaskList", "UpdateGoal", "WebFetch", "WebSearch", "Write"];
|
|
48
49
|
export declare const SDK_TASK_TOOLS: readonly ["TaskCreate", "TaskGet", "TaskUpdate", "TaskList"];
|
|
49
50
|
/**
|
|
50
51
|
* Resolve the SDK's curated default tool surface against qodercli's Task
|
|
@@ -47,6 +47,11 @@ export interface ProcessTransportOptions {
|
|
|
47
47
|
/** Custom environment variables (defaults to process.env) */
|
|
48
48
|
env?: Record<string, string | undefined>;
|
|
49
49
|
proxy?: string;
|
|
50
|
+
/**
|
|
51
|
+
* VPC private-deployment endpoint (CN deployments only). Written to the
|
|
52
|
+
* `QODERCN_VPC_ENDPOINT` / `QODER_VPC_ENDPOINT` env var for the child.
|
|
53
|
+
*/
|
|
54
|
+
vpcEndpoint?: string;
|
|
50
55
|
/** stderr handling mode */
|
|
51
56
|
stderr?: 'inherit' | 'pipe' | 'ignore';
|
|
52
57
|
/** Optional callback for child-process stderr output */
|
package/dist/global/plugins.d.ts
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import type { PluginDetails, InstallPluginResult, PluginValidationReport, ValidatePluginOptions, UninstallPluginResult } from '../types/plugins.js';
|
|
1
|
+
import type { PluginDetails, InstallPluginResult, PluginToggleOptions, PluginValidationReport, ValidatePluginOptions, UninstallPluginResult } from '../types/plugins.js';
|
|
2
2
|
export declare function listPlugins(opts?: {
|
|
3
3
|
orgId?: string;
|
|
4
4
|
cliPath?: string;
|
|
5
5
|
env?: Record<string, string>;
|
|
6
6
|
}): Promise<PluginDetails[]>;
|
|
7
|
-
export declare function enablePlugin(id: string, opts?:
|
|
8
|
-
|
|
9
|
-
env?: Record<string, string>;
|
|
10
|
-
}): Promise<void>;
|
|
11
|
-
export declare function disablePlugin(id: string, opts?: {
|
|
12
|
-
cliPath?: string;
|
|
13
|
-
env?: Record<string, string>;
|
|
14
|
-
}): Promise<void>;
|
|
7
|
+
export declare function enablePlugin(id: string, opts?: PluginToggleOptions): Promise<void>;
|
|
8
|
+
export declare function disablePlugin(id: string, opts?: PluginToggleOptions): Promise<void>;
|
|
15
9
|
export declare function installPlugin(path: string, opts?: {
|
|
16
10
|
cliPath?: string;
|
|
17
11
|
env?: Record<string, string>;
|
package/dist/index.d.ts
CHANGED
|
@@ -70,7 +70,7 @@ export { importSessionToStore } from './session/session-import.js';
|
|
|
70
70
|
export type { ImportSessionToStoreOptions } from './session/session-import.js';
|
|
71
71
|
export type { SessionKey, SessionStore, SessionStoreEntry, SessionStoreFlush, } from './session/session-store.js';
|
|
72
72
|
export { listPlugins, enablePlugin, disablePlugin, installPlugin, uninstallPlugin, validatePlugin, } from './global/plugins.js';
|
|
73
|
-
export type { PluginDetails, PluginResources, InstallPluginResult, UninstallPluginResult, PluginValidationSeverity, PluginValidationPhase, PluginValidationPosition, PluginValidationLocation, PluginValidationDiagnostic, PluginValidationReport, ValidatePluginOptions, } from './types/plugins.js';
|
|
73
|
+
export type { PluginScope, PluginToggleOptions, PluginDetails, PluginResources, InstallPluginResult, UninstallPluginResult, PluginValidationSeverity, PluginValidationPhase, PluginValidationPosition, PluginValidationLocation, PluginValidationDiagnostic, PluginValidationReport, ValidatePluginOptions, } from './types/plugins.js';
|
|
74
74
|
export { submitFeedback } from './feedback.js';
|
|
75
75
|
export type { SubmitFeedbackParams, SubmitFeedbackOptions, IntegrationMode, } from './feedback.js';
|
|
76
76
|
export { AbortError, ModelPolicyTimeoutError, ProtocolVersionMismatchError, UnsupportedCliCapabilityError, } from './core/errors.js';
|
|
@@ -86,7 +86,7 @@ export type { AccessTokenInput, AuthOptions, FetchServiceAccountToken, ServiceAc
|
|
|
86
86
|
*/
|
|
87
87
|
export type { FetchJobToken, JobTokenAuthOptions, JobTokenRequest, JobTokenResult, } from './types/auth.js';
|
|
88
88
|
export type { AccountInfo, UsageAddOnQuotaBucket, UsageInfo, UsageOrgResourcePackage, UsageQuotaBucket, SessionCreditsUsage, ApiKeySource, ExitReason, FastModeState, ConfigScope, SettingSource, SDKAssistantMessageError, SDKStatus, EffortLevel, ThinkingAdaptive, ThinkingEnabled, ThinkingDisabled, ThinkingConfig, ModelInfo, ModelSource, ServerModelJson, ServerModelJsonValue, ModelStrategy, ModelPromotion, LocalizedModelText, ModelContextConfig, ModelContextWindowEntry, ModelEffortEntry, ModelThinkingConfig, ModelThinkingDisabled, ModelThinkingEnabled, ModelUsage, NonNullableUsage, SlashCommand, ToolConfig, SdkPluginConfig, } from './types/common.js';
|
|
89
|
-
export type { SDKMessage, SDKAssistantMessage, SDKToolNonExecutionKind, SDKToolResultMeta, SDKUserMessage, SDKUserMessageReplay, SDKResultMessage, SDKResultSuccess, SDKResultError, SDKSystemMessage, SDKSystemInitMessage, SDKSystemMessageSubtype, SDKSystemMessageBySubtype, SDKPartialAssistantMessage, SDKCompactBoundaryMessage, SDKStatusMessage, SDKAPIRetryMessage, SDKModelQueueStatusMessage, SDKControlRequestProgressMessage, SDKHookStartedMessage, SDKHookProgressMessage, SDKHookResponseMessage, SDKPermissionDeniedMessage, SDKMirrorErrorMessage, SDKTaskNotificationMessage, SDKTaskStartedMessage, SDKTaskProgressMessage, SDKTaskUpdatedMessage, SDKBackgroundTasksChangedMessage, SDKSessionStateChangedMessage, SDKSessionTitleChangedMessage, SDKFilesPersistedEvent, SDKElicitationCompleteMessage, SDKPromptSuggestionMessage, SDKCloudAgentEventMessage, SDKMemoryGenerationMessage, SDKMemoryConsumptionMessage, SDKPermissionDenial, } from './types/messages.js';
|
|
89
|
+
export type { SDKMessage, SDKAssistantMessage, SDKToolNonExecutionKind, SDKToolResultMeta, SDKUserMessage, SDKUserMessageReplay, SDKResultMessage, SDKResultSuccess, SDKResultError, SDKSystemMessage, SDKSystemInitMessage, SDKSystemMessageSubtype, SDKSystemMessageBySubtype, SDKPartialAssistantMessage, SDKCompactBoundaryMessage, SDKStatusMessage, SDKAPIRetryMessage, SDKModelQueueStatusMessage, SDKControlRequestProgressMessage, SDKHookStartedMessage, SDKHookProgressMessage, SDKHookResponseMessage, SDKPermissionDeniedMessage, SDKMirrorErrorMessage, SDKTaskNotificationMessage, SDKTaskStartedMessage, SDKTaskProgressMessage, SDKTaskUpdatedMessage, SDKBackgroundTasksChangedMessage, SDKSessionStateChangedMessage, SDKPlanModeChangedMessage, SDKSessionTitleChangedMessage, SDKFilesPersistedEvent, SDKElicitationCompleteMessage, SDKPromptSuggestionMessage, SDKCloudAgentEventMessage, SDKMemoryGenerationMessage, SDKMemoryConsumptionMessage, SDKSkillEvolutionMessage, SDKPermissionDenial, } from './types/messages.js';
|
|
90
90
|
export type { DefaultRuntimeTransport, } from './core/default-runtime.js';
|
|
91
91
|
export type { QueryTransportCreateOptions, QueryTransportProviderOption, } from './core/query-transport.js';
|
|
92
92
|
export type { ProcessTransportOptions } from './core/process-transport.js';
|
|
@@ -94,17 +94,19 @@ export type { WorkerRuntimeTransportOptions, WorkerTransportOptions, } from './c
|
|
|
94
94
|
export type { QueryTransportProvider, Transport, } from './core/transport.js';
|
|
95
95
|
export type { Options, QueryTransportOptions, Query, SpawnOptions, SpawnedProcess, ElicitationRequest, ElicitationResult, OnElicitation, PromptRequest, PromptRequestOption, PromptResponse, CanUseTool, SecurityScanOptions, } from './types/options.js';
|
|
96
96
|
export type { EffectiveMemoryConfig, MemoryConsumptionFile, MemoryConsumptionOptions, MemoryConsumptionResult, MemoryGenerationGateInput, MemoryGenerationGateResult, MemoryGenerationOptions, MemoryGenerationFailedFile, MemoryGenerationResult, MemoryMode, MemoryOptions, MemoryRoot, MemoryRootAccess, MemoryShouldGenerate, } from './types/memory.js';
|
|
97
|
+
export type { EffectiveEvolutionConfig, EffectiveSkillEvolutionConfig, EvolutionOptions, SkillEvolutionGateInput, SkillEvolutionGateResult, SkillEvolutionGenerationOptions, SkillEvolutionMode, SkillEvolutionOptions, SkillEvolutionResult, SkillEvolutionShouldReview, SkillEvolutionSuggestion, } from './types/skill-evolution.js';
|
|
98
|
+
export { MAX_SKILL_EVOLUTION_REVIEW_THRESHOLD } from './types/skill-evolution.js';
|
|
97
99
|
export type { AgentCreateParams, BetaManagedAgentsAgentToolName, BetaManagedAgentsAgentToolset20260401Params, BetaManagedAgentsCustomSkillParams, BetaManagedAgentsFileResourceParams, BetaManagedAgentsModel, BetaManagedAgentsSkillParams, BetaManagedAgentsURLMCPServerParams, CloudAgentOptions, CloudAgentReference, CloudAgentStreamOptions, CloudSessionResource, CloudSessionCreateParams, CloudSessionCreateReference, CloudSessionExistingReference, CloudSessionReference, SessionCreateParams, } from './types/cloud-agent.js';
|
|
98
100
|
export type { SettingSource as SettingSourceFromOptions } from './types/options.js';
|
|
99
101
|
export type { PermissionMode, PermissionBehavior, PermissionDecisionClassification, PermissionUpdateDestination, PermissionRuleValue, PermissionUpdate, PermissionResult, CanUseToolOptions, } from './types/permissions.js';
|
|
100
|
-
export type { HookEvent, HookPermissionDecision, HookCallback, HookCallbackMatcher, HookInput, HookSpecificOutput, HookJSONOutput, AsyncHookJSONOutput, SyncHookJSONOutput, BaseHookInput, PreToolUseHookInput, PostToolUseHookInput, PostToolUseFailureHookInput, UserPromptSubmitHookInput, SessionStartHookInput, SessionEndHookInput, StopHookInput, SubagentStartHookInput, SubagentStopHookInput, PreCompactHookInput, PostCompactHookInput, PermissionRequestHookInput, InstructionsLoadedHookInput, CwdChangedHookInput, FileChangedHookInput, PreToolUseHookSpecificOutput, PostToolUseHookSpecificOutput, PostToolUseFailureHookSpecificOutput, UserPromptSubmitHookSpecificOutput, SessionStartHookSpecificOutput, SubagentStartHookSpecificOutput, PermissionRequestHookSpecificOutput, CwdChangedHookSpecificOutput, FileChangedHookSpecificOutput, } from './types/hooks.js';
|
|
102
|
+
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 './types/hooks.js';
|
|
101
103
|
export type { McpStdioServerConfig, McpSSEServerConfig, McpHttpServerConfig, McpSdkServerConfig, McpSdkServerConfigWithInstance, McpServerConfig, McpServerToolPolicy, McpServerConfigForProcessTransport, McpServerStatus, McpServerStatusConfig, } from './types/mcp.js';
|
|
102
104
|
export type { AgentDefinition, AgentInfo, AgentMemoryScope, AgentMcpServerSpec, } from './types/agents.js';
|
|
103
|
-
export type { SDKSessionInfo, SessionMessage, ListSessionsOptions, GetSessionInfoOptions, GetSessionMessagesOptions, GetSubagentMessagesOptions, ListSubagentsOptions, SessionMutationOptions, ForkSessionOptions, ForkSessionResult, RewindFilesResult, RewindScope, RewindStatus, RewindFileFailure, RewindResult, } from './types/session.js';
|
|
105
|
+
export type { SDKSessionInfo, SessionMessage, SessionMessageView, ListSessionsOptions, GetSessionInfoOptions, GetSessionMessagesOptions, GetSubagentMessagesOptions, ListSubagentsOptions, SessionMutationOptions, ForkSessionOptions, ForkSessionResult, RewindFilesResult, RewindScope, RewindStatus, RewindFileFailure, RewindResult, } from './types/session.js';
|
|
104
106
|
export type { Settings, ResolveSettingsOptions, ResolvedSettingSource, ResolvedSettings, ResolvedSettingsSource, SettingsProvenanceEntry, } from './types/settings.js';
|
|
105
107
|
export { filterEscalatingDefaultMode } from './types/settings.js';
|
|
106
108
|
export type { QoderModelPurpose } from './types/control.js';
|
|
107
|
-
export type { SDKControlRequest, SDKControlResponse, SDKControlInterruptResponse, SDKControlInitializeResponse, SDKControlGetContextUsageResponse, SDKControlGetUsageInfoRequest, SDKControlGetUsageInfoResponse, SideQuestionHistoryEntry, AskSideQuestionOptions, SideQuestionRefusalFallback, SideQuestionResult, SDKControlAddDirectoriesResponse, SDKControlReloadPluginsResponse, SDKControlStopTaskRequest, SDKControlBackgroundTasksRequest, SDKControlBackgroundTasksResponse, } from './types/control.js';
|
|
109
|
+
export type { SDKControlRequest, SDKControlResponse, SDKControlInterruptResponse, SDKControlInitializeResponse, SDKControlGetContextUsageResponse, SDKControlGetUsageInfoRequest, SDKControlGetUsageInfoResponse, SideQuestionHistoryEntry, AskSideQuestionOptions, SideQuestionRefusalFallback, SideQuestionResult, SDKControlAddDirectoriesResponse, SDKControlReloadPluginsResponse, SDKControlStopTaskRequest, SDKControlBackgroundTasksRequest, SDKControlBackgroundTasksResponse, SDKPlanModeSnapshot, } from './types/control.js';
|
|
108
110
|
export type { SDKControlGetModelPolicyRequest, SDKControlGetModelPolicyResponse, SDKCapabilities, ModelPolicyContext, ModelPolicyResult, ModelPolicyProvider, } from './types/model-policy-provider.js';
|
|
109
111
|
export type { SDKControlGetByokConfigRequest, SDKControlGetByokConfigResponse, SDKControlValidateByokModelRequest, SDKControlValidateByokModelResponse, BYOKModelValidationInput, BYOKProviderInfo, BYOKModelTypeInfo, BYOKModelInfo, CustomModel, } from './types/byok.js';
|
|
110
112
|
export { isBashToolBackgroundLaunchResult } from './types/tools.js';
|