@qoder-ai/qoder-agent-sdk 1.0.20 → 1.0.22
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 +20 -14
- package/dist/core/brand.d.ts +4 -0
- package/dist/core/process-transport.d.ts +2 -0
- package/dist/core/runtime-launch-options.d.ts +2 -0
- package/dist/global/plugins.d.ts +8 -2
- package/dist/index.d.ts +7 -4
- package/dist/index.js +30 -27
- package/dist/protocol/control.d.ts +53 -79
- package/dist/protocol/index.d.ts +1 -1
- package/dist/protocol/index.js +1 -1
- package/dist/protocol/messages.d.ts +19 -0
- package/dist/query/index.d.ts +2 -0
- package/dist/query/startup.d.ts +11 -0
- package/dist/runtime-manifest.json +6 -6
- package/dist/settings/resolve-settings.d.ts +2 -0
- package/dist/types/messages.d.ts +3 -1
- package/dist/types/model-policy-provider.d.ts +10 -0
- package/dist/types/options.d.ts +19 -0
- package/dist/types/plugins.d.ts +52 -0
- package/dist/types/session.d.ts +5 -0
- package/dist/types/settings.d.ts +14 -1
- package/package.json +2 -2
- package/scripts/postinstall.cjs +154 -24
package/README.md
CHANGED
|
@@ -47,19 +47,24 @@ const q = query({
|
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
The worker transport uses the runtime installed at
|
|
50
|
-
`dist/_worker/qoder-worker-runtime.obf.mjs`.
|
|
51
|
-
|
|
52
|
-
`new WorkerTransport({ pathToQoderWorkerRuntime })`.
|
|
50
|
+
`dist/_worker/qoder-worker-runtime.obf.mjs`. To use another Worker runtime,
|
|
51
|
+
pass its path explicitly with
|
|
52
|
+
`new WorkerTransport({ pathToQoderWorkerRuntime })`. Environment variables do
|
|
53
|
+
not override the Worker runtime entry.
|
|
53
54
|
|
|
54
55
|
The package includes a `dist/runtime-manifest.json` that records the default
|
|
55
|
-
runtime and
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
The
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
runtime and the URL template for qodercli Worker runtime artifacts. At
|
|
57
|
+
installation time, the SDK resolves exactly one artifact for its own brand,
|
|
58
|
+
the current operating system, and the current architecture. It does not fall
|
|
59
|
+
back to the universal artifact. The SDK package itself does not need to host a
|
|
60
|
+
copy of the archive. The presence of `dist/_worker` is used as an integrity
|
|
61
|
+
check after installation, not as the mode selector.
|
|
62
|
+
|
|
63
|
+
The installed Worker runtime is self-contained. Platform packages include the
|
|
64
|
+
matching native keychain, PTY, image-processing, and ripgrep assets. Linux
|
|
65
|
+
packages retain both glibc and musl image-processing bindings. OpenHarmony does
|
|
66
|
+
not have an install-delivered platform artifact and must use an explicitly
|
|
67
|
+
supplied runtime source.
|
|
63
68
|
|
|
64
69
|
If your environment blocks install scripts or network downloads, skip postinstall
|
|
65
70
|
runtime downloads:
|
|
@@ -70,14 +75,15 @@ QODER_SKIP_DOWNLOAD=1 npm install @qoder-ai/qoder-agent-sdk zod
|
|
|
70
75
|
|
|
71
76
|
`QODER_SKIP_DOWNLOAD` only affects install-time downloads. It does not change the
|
|
72
77
|
package's default runtime. Then point the process transport at an existing
|
|
73
|
-
`qodercli
|
|
78
|
+
`qodercli`:
|
|
74
79
|
|
|
75
80
|
```bash
|
|
76
81
|
export QODERCLI_PATH=/absolute/path/to/qodercli
|
|
77
|
-
# or
|
|
78
|
-
export QODER_WORKER_RUNTIME_PATH=/absolute/path/to/qoder-worker-runtime.obf.mjs
|
|
79
82
|
```
|
|
80
83
|
|
|
84
|
+
To use an existing Worker runtime, pass its absolute path through
|
|
85
|
+
`new WorkerTransport({ pathToQoderWorkerRuntime })`.
|
|
86
|
+
|
|
81
87
|
`query()` is the only query entry point and defaults to Worker. Pass
|
|
82
88
|
`transport: ProcessTransport.default`,
|
|
83
89
|
`transport: WorkerTransport.default`, or a custom transport provider when a
|
package/dist/core/brand.d.ts
CHANGED
|
@@ -6,7 +6,9 @@ export declare const SDK_BRAND_CONFIG: {
|
|
|
6
6
|
packageName: string;
|
|
7
7
|
cliCommands: readonly ["qoderclicn", "qodercn"];
|
|
8
8
|
configDirName: string;
|
|
9
|
+
projectConfigDirName: string;
|
|
9
10
|
configDirEnv: string;
|
|
11
|
+
configDirNameEnv: string;
|
|
10
12
|
cliHomeEnv: string;
|
|
11
13
|
accessTokenEnv: string;
|
|
12
14
|
serviceAccountEnv: string;
|
|
@@ -15,7 +17,9 @@ export declare const SDK_BRAND_CONFIG: {
|
|
|
15
17
|
packageName: string;
|
|
16
18
|
cliCommands: readonly ["qodercli", "qoder"];
|
|
17
19
|
configDirName: string;
|
|
20
|
+
projectConfigDirName: string;
|
|
18
21
|
configDirEnv: string;
|
|
22
|
+
configDirNameEnv: string;
|
|
19
23
|
cliHomeEnv: string;
|
|
20
24
|
accessTokenEnv: string;
|
|
21
25
|
serviceAccountEnv: string;
|
package/dist/global/plugins.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PluginDetails, InstallPluginResult, UninstallPluginResult } from '../types/plugins.js';
|
|
1
|
+
import type { PluginDetails, InstallPluginResult, PluginValidationReport, ValidatePluginOptions, UninstallPluginResult } from '../types/plugins.js';
|
|
2
2
|
export declare function listPlugins(opts?: {
|
|
3
3
|
orgId?: string;
|
|
4
4
|
cliPath?: string;
|
|
@@ -20,4 +20,10 @@ export declare function uninstallPlugin(id: string, opts?: {
|
|
|
20
20
|
keepData?: boolean;
|
|
21
21
|
cliPath?: string;
|
|
22
22
|
env?: Record<string, string>;
|
|
23
|
-
}): Promise<UninstallPluginResult>;
|
|
23
|
+
}): Promise<UninstallPluginResult>;
|
|
24
|
+
/**
|
|
25
|
+
* Statically validate a local plugin without creating a session or executing
|
|
26
|
+
* plugin hooks, MCP servers, or binaries. Invalid plugin content is returned
|
|
27
|
+
* as a report; transport and CLI capability failures reject the promise.
|
|
28
|
+
*/
|
|
29
|
+
export declare function validatePlugin(path: string, opts?: ValidatePluginOptions): Promise<PluginValidationReport>;
|
package/dist/index.d.ts
CHANGED
|
@@ -52,6 +52,9 @@
|
|
|
52
52
|
* ```
|
|
53
53
|
*/
|
|
54
54
|
export { query } from './query/query.js';
|
|
55
|
+
export { startup } from './query/startup.js';
|
|
56
|
+
export type { StartupParams, WarmQuery } from './query/startup.js';
|
|
57
|
+
export { resolveSettings } from './settings/resolve-settings.js';
|
|
55
58
|
export { DEFAULT_RUNTIME_TRANSPORT, } from './core/default-runtime.js';
|
|
56
59
|
export { ProcessTransport, QoderCliProcessError, } from './core/process-transport.js';
|
|
57
60
|
export { hasResolvableQoderWorkerRuntime, QoderWorkerRuntimeError, WorkerTransport, resolveQoderWorkerRuntimePath, } from './core/worker-transport.js';
|
|
@@ -66,8 +69,8 @@ export { InMemorySessionStore } from './session/session-store.js';
|
|
|
66
69
|
export { importSessionToStore } from './session/session-import.js';
|
|
67
70
|
export type { ImportSessionToStoreOptions } from './session/session-import.js';
|
|
68
71
|
export type { SessionKey, SessionStore, SessionStoreEntry, SessionStoreFlush, } from './session/session-store.js';
|
|
69
|
-
export { listPlugins, enablePlugin, disablePlugin, installPlugin, uninstallPlugin } from './global/plugins.js';
|
|
70
|
-
export type { PluginDetails, PluginResources, InstallPluginResult, UninstallPluginResult } from './types/plugins.js';
|
|
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';
|
|
71
74
|
export { submitFeedback } from './feedback.js';
|
|
72
75
|
export type { SubmitFeedbackParams, SubmitFeedbackOptions, IntegrationMode, } from './feedback.js';
|
|
73
76
|
export { AbortError, ModelPolicyTimeoutError, ProtocolVersionMismatchError, UnsupportedCliCapabilityError, } from './core/errors.js';
|
|
@@ -83,7 +86,7 @@ export type { AccessTokenInput, AuthOptions, FetchServiceAccountToken, ServiceAc
|
|
|
83
86
|
*/
|
|
84
87
|
export type { FetchJobToken, JobTokenAuthOptions, JobTokenRequest, JobTokenResult, } from './types/auth.js';
|
|
85
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';
|
|
86
|
-
export type { SDKMessage, SDKAssistantMessage, SDKUserMessage, SDKUserMessageReplay, SDKResultMessage, SDKResultSuccess, SDKResultError, SDKSystemMessage, SDKSystemInitMessage, SDKSystemMessageSubtype, SDKSystemMessageBySubtype, SDKPartialAssistantMessage, SDKCompactBoundaryMessage, SDKStatusMessage, SDKAPIRetryMessage, SDKHookStartedMessage, SDKHookProgressMessage, SDKHookResponseMessage, SDKPermissionDeniedMessage, SDKMirrorErrorMessage, SDKTaskNotificationMessage, SDKTaskStartedMessage, SDKTaskProgressMessage, SDKTaskUpdatedMessage, SDKBackgroundTasksChangedMessage, SDKSessionStateChangedMessage, SDKSessionTitleChangedMessage, SDKFilesPersistedEvent, SDKElicitationCompleteMessage, SDKPromptSuggestionMessage, SDKCloudAgentEventMessage, 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, SDKHookStartedMessage, SDKHookProgressMessage, SDKHookResponseMessage, SDKPermissionDeniedMessage, SDKMirrorErrorMessage, SDKTaskNotificationMessage, SDKTaskStartedMessage, SDKTaskProgressMessage, SDKTaskUpdatedMessage, SDKBackgroundTasksChangedMessage, SDKSessionStateChangedMessage, SDKSessionTitleChangedMessage, SDKFilesPersistedEvent, SDKElicitationCompleteMessage, SDKPromptSuggestionMessage, SDKCloudAgentEventMessage, SDKPermissionDenial, } from './types/messages.js';
|
|
87
90
|
export type { DefaultRuntimeTransport, } from './core/default-runtime.js';
|
|
88
91
|
export type { QueryTransportCreateOptions, QueryTransportProviderOption, } from './core/query-transport.js';
|
|
89
92
|
export type { ProcessTransportOptions } from './core/process-transport.js';
|
|
@@ -97,7 +100,7 @@ export type { HookEvent, HookPermissionDecision, HookCallback, HookCallbackMatch
|
|
|
97
100
|
export type { McpStdioServerConfig, McpSSEServerConfig, McpHttpServerConfig, McpSdkServerConfig, McpSdkServerConfigWithInstance, McpServerConfig, McpServerToolPolicy, McpServerConfigForProcessTransport, McpServerStatus, McpServerStatusConfig, } from './types/mcp.js';
|
|
98
101
|
export type { AgentDefinition, AgentInfo, AgentMemoryScope, AgentMcpServerSpec, } from './types/agents.js';
|
|
99
102
|
export type { SDKSessionInfo, SessionMessage, ListSessionsOptions, GetSessionInfoOptions, GetSessionMessagesOptions, GetSubagentMessagesOptions, ListSubagentsOptions, SessionMutationOptions, ForkSessionOptions, ForkSessionResult, RewindFilesResult, RewindScope, RewindStatus, RewindFileFailure, RewindResult, } from './types/session.js';
|
|
100
|
-
export type { Settings, ResolvedSettings, ResolvedSettingsSource, } from './types/settings.js';
|
|
103
|
+
export type { Settings, ResolveSettingsOptions, ResolvedSettingSource, ResolvedSettings, ResolvedSettingsSource, SettingsProvenanceEntry, } from './types/settings.js';
|
|
101
104
|
export { filterEscalatingDefaultMode } from './types/settings.js';
|
|
102
105
|
export type { QoderModelPurpose } from './types/control.js';
|
|
103
106
|
export type { SDKControlRequest, SDKControlResponse, SDKControlInterruptResponse, SDKControlInitializeResponse, SDKControlGetContextUsageResponse, SDKControlGetUsageInfoRequest, SDKControlGetUsageInfoResponse, SDKControlAddDirectoriesResponse, SDKControlReloadPluginsResponse, SDKControlStopTaskRequest, SDKControlBackgroundTasksRequest, SDKControlBackgroundTasksResponse, } from './types/control.js';
|