@qoder-ai/qoder-agent-sdk 1.0.31 → 1.0.32

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.
@@ -6,6 +6,7 @@ export declare class DeferredTransport implements Transport {
6
6
  private bootstrapPromise;
7
7
  private readonly pending;
8
8
  private closed;
9
+ private closePromise;
9
10
  constructor(bootstrap: () => Promise<{
10
11
  transport: Transport;
11
12
  cleanup?: () => Promise<void>;
@@ -14,10 +15,11 @@ export declare class DeferredTransport implements Transport {
14
15
  private cleanupPromise;
15
16
  initialize(): Promise<void>;
16
17
  write(data: string): void;
17
- close(): void;
18
+ close(): Promise<void>;
18
19
  isReady(): boolean;
19
20
  readMessages(): AsyncGenerator<StdoutMessage, void, unknown>;
20
21
  endInput(): void;
21
22
  private getTransport;
23
+ private performClose;
22
24
  private runCleanup;
23
25
  }
@@ -40,4 +40,24 @@ export declare class ProtocolVersionMismatchError extends Error {
40
40
  export declare class UnsupportedCliCapabilityError extends Error {
41
41
  readonly capability: string;
42
42
  constructor(capability: string);
43
+ }
44
+ /**
45
+ * Thrown when the runtime rejects an SDK control request.
46
+ *
47
+ * `retryable` is true only when the runtime guarantees that retrying the
48
+ * original control operation will not duplicate an operation already applied
49
+ * by the Worker.
50
+ */
51
+ export declare class ControlRequestError extends Error {
52
+ readonly requestId: string;
53
+ readonly code: string | undefined;
54
+ readonly retryable: boolean;
55
+ readonly details: Record<string, unknown> | undefined;
56
+ constructor(options: {
57
+ requestId: string;
58
+ message: string;
59
+ code?: string;
60
+ retryable?: boolean;
61
+ details?: Record<string, unknown>;
62
+ });
43
63
  }
@@ -25,7 +25,7 @@ export interface Transport {
25
25
  * After calling close(), no further writes or reads should be attempted.
26
26
  * This should gracefully terminate the underlying process/connection.
27
27
  */
28
- close(): void;
28
+ close(): void | Promise<void>;
29
29
  /**
30
30
  * Whether the transport is ready to send and receive messages.
31
31
  * Returns false if the transport has not been initialized, has been
@@ -33,6 +33,7 @@ export declare class DaemonSessionTransport implements Transport {
33
33
  private closed;
34
34
  private cleaned;
35
35
  private releasePromise;
36
+ private closePromise;
36
37
  private subscribeResult;
37
38
  private readonly remoteSessionId;
38
39
  constructor(connection: DaemonConnection, options: DaemonSessionTransportOptions);
@@ -41,7 +42,7 @@ export declare class DaemonSessionTransport implements Transport {
41
42
  write(data: string): void;
42
43
  readMessages(): AsyncGenerator<StdoutMessage, void, unknown>;
43
44
  endInput(): void;
44
- close(): void;
45
+ close(): Promise<void>;
45
46
  isReady(): boolean;
46
47
  acceptOutput(message: DaemonWireSessionMessage): void;
47
48
  fail(error: unknown): void;
@@ -55,6 +56,6 @@ export declare class DaemonSessionTransport implements Transport {
55
56
  private updateCommandLifecycleCapability;
56
57
  private observeCommandLifecycle;
57
58
  private maybeCloseAfterResult;
58
- private closeAfterResult;
59
+ private performClose;
59
60
  private cleanup;
60
61
  }
package/dist/index.d.ts CHANGED
@@ -78,7 +78,7 @@ export { listPlugins, enablePlugin, disablePlugin, installPlugin, uninstallPlugi
78
78
  export type { PluginScope, PluginToggleOptions, PluginDetails, PluginResources, InstallPluginResult, UninstallPluginResult, PluginValidationSeverity, PluginValidationPhase, PluginValidationPosition, PluginValidationLocation, PluginValidationDiagnostic, PluginValidationReport, ValidatePluginOptions, } from './types/plugins.js';
79
79
  export { submitFeedback } from './feedback.js';
80
80
  export type { SubmitFeedbackParams, SubmitFeedbackOptions, IntegrationMode, } from './feedback.js';
81
- export { AbortError, ModelPolicyTimeoutError, ProtocolVersionMismatchError, UnsupportedCliCapabilityError, } from './core/errors.js';
81
+ export { AbortError, ControlRequestError, ModelPolicyTimeoutError, ProtocolVersionMismatchError, UnsupportedCliCapabilityError, } from './core/errors.js';
82
82
  export { DaemonRpcError } from './daemon/daemon-connection.js';
83
83
  export { AuthAccessTokenEnvVarError, AuthServiceAccountEnvVarError, } from './core/runtime-launch-options.js';
84
84
  export { WIRE_PROTOCOL_VERSION } from './protocol/version.js';