@qoder-ai/qoder-agent-sdk 1.0.15 → 1.0.17
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 +159 -24
- package/dist/auth.d.ts +4 -1
- package/dist/core/constants.d.ts +7 -2
- package/dist/core/deferred-transport.d.ts +23 -0
- package/dist/core/errors.d.ts +0 -8
- package/dist/core/process-transport.d.ts +3 -0
- package/dist/core/runtime-launch-options.d.ts +10 -1
- package/dist/core/transport.d.ts +2 -4
- package/dist/index.d.ts +13 -13
- package/dist/index.js +27 -22
- package/dist/mcp/sdk-mcp-server.d.ts +13 -1
- package/dist/mcp/tool-policy.d.ts +6 -0
- package/dist/protocol/agents.d.ts +0 -3
- package/dist/protocol/common.d.ts +27 -9
- package/dist/protocol/control.d.ts +40 -12
- package/dist/protocol/index.d.ts +4 -3
- package/dist/protocol/index.js +1 -1
- package/dist/protocol/mcp.d.ts +29 -0
- package/dist/protocol/messages.d.ts +38 -18
- package/dist/protocol/model-prompt-patches.d.ts +18 -0
- package/dist/protocol/version.d.ts +1 -1
- package/dist/query/query-runner.d.ts +16 -6
- package/dist/session/session-fork.d.ts +1 -27
- package/dist/session/session-import.d.ts +10 -0
- package/dist/session/session-manager.d.ts +3 -1
- package/dist/session/session-materializer.d.ts +15 -0
- package/dist/session/session-store.d.ts +45 -0
- package/dist/session/transcript-mirror.d.ts +25 -0
- package/dist/session/transcript-paths.d.ts +1 -2
- package/dist/types/auth.d.ts +27 -2
- package/dist/types/common.d.ts +1 -1
- package/dist/types/control.d.ts +13 -1
- package/dist/types/hooks.d.ts +1 -1
- package/dist/types/index.d.ts +2 -3
- package/dist/types/mcp.d.ts +9 -3
- package/dist/types/messages.d.ts +21 -2
- package/dist/types/options.d.ts +50 -10
- package/dist/types/session.d.ts +17 -7
- package/dist/types/settings.d.ts +19 -232
- package/package.json +4 -14
- package/dist/bridge/bridge-api.d.ts +0 -14
- package/dist/bridge/bridge-session.d.ts +0 -6
- package/dist/bridge/ccr-client.d.ts +0 -72
- package/dist/bridge/index.d.ts +0 -9
- package/dist/bridge/index.js +0 -3
- package/dist/bridge/sse-transport.d.ts +0 -37
- package/dist/browser/browser-query.d.ts +0 -24
- package/dist/browser/index.d.ts +0 -14
- package/dist/browser/index.js +0 -9
- package/dist/browser/websocket-transport.d.ts +0 -40
- package/dist/direct-connect/direct-connect-transport.d.ts +0 -31
- package/dist/direct-connect/url-parser.d.ts +0 -14
- package/dist/embed/embed.d.ts +0 -2
- package/dist/embed/embed.js +0 -1
- package/dist/embed/extract-from-bunfs.d.ts +0 -5
- package/dist/types/bridge.d.ts +0 -62
- package/dist/types/browser.d.ts +0 -26
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { Transport } from '../core/transport.js';
|
|
2
|
-
import type { StdoutMessage } from '../types/control.js';
|
|
3
|
-
export interface DirectConnectOptions {
|
|
4
|
-
url: string;
|
|
5
|
-
abortController?: AbortController;
|
|
6
|
-
cwd?: string;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* DirectConnectTransport — Connects to a remote qodercli server via WebSocket.
|
|
10
|
-
*
|
|
11
|
-
* Flow:
|
|
12
|
-
* 1. POST /sessions -> creates a session, gets { sessionId, workDir, wsUrl }
|
|
13
|
-
* 2. WebSocket to wsUrl -> bidirectional JSONL communication
|
|
14
|
-
*/
|
|
15
|
-
export declare class DirectConnectTransport implements Transport {
|
|
16
|
-
private options;
|
|
17
|
-
private ws;
|
|
18
|
-
private ready;
|
|
19
|
-
private messages;
|
|
20
|
-
private exitError?;
|
|
21
|
-
private partialLine;
|
|
22
|
-
private initializePromise;
|
|
23
|
-
constructor(options: DirectConnectOptions);
|
|
24
|
-
initialize(): Promise<void>;
|
|
25
|
-
private doInitialize;
|
|
26
|
-
write(data: string): Promise<void>;
|
|
27
|
-
close(): void;
|
|
28
|
-
isReady(): boolean;
|
|
29
|
-
readMessages(): AsyncGenerator<StdoutMessage, void, unknown>;
|
|
30
|
-
endInput(): void;
|
|
31
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export type DirectConnectUrlResult = {
|
|
2
|
-
serverUrl: string;
|
|
3
|
-
authToken?: string;
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* Parse a direct-connect URL.
|
|
7
|
-
*
|
|
8
|
-
* Supported formats:
|
|
9
|
-
* - cc://token@host:port/path -> { serverUrl: "http://host:port/path", authToken: "token" }
|
|
10
|
-
* - cc://host:port/path -> { serverUrl: "http://host:port/path" }
|
|
11
|
-
* - http://host:port/path -> { serverUrl: "http://host:port/path" }
|
|
12
|
-
* - https://host:port/path -> { serverUrl: "https://host:port/path" }
|
|
13
|
-
*/
|
|
14
|
-
export declare function parseDirectConnectUrl(url: string): DirectConnectUrlResult;
|
package/dist/embed/embed.d.ts
DELETED
package/dist/embed/embed.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{fileURLToPath as t}from"url";import{join as i,dirname as o}from"path";var r=t(import.meta.url),m=o(r),e=i(m,"..","cli.js"),l=e;export{l as default};
|
package/dist/types/bridge.d.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import type { SDKMessage } from './messages.js';
|
|
2
|
-
import type { SDKControlRequest, SDKControlResponse } from './control.js';
|
|
3
|
-
import type { CanUseToolOptions, PermissionMode, PermissionResult } from './permissions.js';
|
|
4
|
-
export type SessionState = 'idle' | 'running' | 'requires_action';
|
|
5
|
-
export type BridgeSessionHandle = {
|
|
6
|
-
readonly sessionId: string;
|
|
7
|
-
getSequenceNum(): number;
|
|
8
|
-
isConnected(): boolean;
|
|
9
|
-
write(msg: SDKMessage): void;
|
|
10
|
-
sendResult(): void;
|
|
11
|
-
sendControlRequest(req: SDKControlRequest): void;
|
|
12
|
-
sendControlResponse(res: SDKControlResponse): void;
|
|
13
|
-
sendControlCancelRequest(requestId: string): void;
|
|
14
|
-
reconnectTransport(opts: {
|
|
15
|
-
ingressToken: string;
|
|
16
|
-
apiBaseUrl: string;
|
|
17
|
-
epoch?: number;
|
|
18
|
-
}): Promise<void>;
|
|
19
|
-
reportState(state: SessionState): void;
|
|
20
|
-
reportMetadata(metadata: Record<string, unknown>): void;
|
|
21
|
-
reportDelivery(eventId: string, status: 'processing' | 'processed'): void;
|
|
22
|
-
flush(): Promise<void>;
|
|
23
|
-
close(): void;
|
|
24
|
-
};
|
|
25
|
-
export type AttachBridgeSessionOptions = {
|
|
26
|
-
sessionId: string;
|
|
27
|
-
ingressToken: string;
|
|
28
|
-
apiBaseUrl: string;
|
|
29
|
-
epoch?: number;
|
|
30
|
-
initialSequenceNum?: number;
|
|
31
|
-
heartbeatIntervalMs?: number;
|
|
32
|
-
outboundOnly?: boolean;
|
|
33
|
-
onInboundMessage?: (msg: SDKMessage) => void | Promise<void>;
|
|
34
|
-
onPermissionResponse?: (res: SDKControlResponse) => void;
|
|
35
|
-
/**
|
|
36
|
-
* Called before a bridge permission prompt is resolved remotely. Return a
|
|
37
|
-
* PermissionResult to short-circuit the bridge prompt; return undefined to
|
|
38
|
-
* let the normal bridge permission flow continue.
|
|
39
|
-
*/
|
|
40
|
-
canUseToolPreFilter?: (toolName: string, input: Record<string, unknown>, ctx: CanUseToolOptions) => Promise<PermissionResult | undefined>;
|
|
41
|
-
/**
|
|
42
|
-
* Called after a permission result is resolved by the pre-filter or the
|
|
43
|
-
* bridge response path.
|
|
44
|
-
*/
|
|
45
|
-
onPermissionResolved?: (toolName: string, result: PermissionResult) => void;
|
|
46
|
-
onInterrupt?: () => void;
|
|
47
|
-
onSetModel?: (model: string | undefined) => void;
|
|
48
|
-
onSetMaxThinkingTokens?: (tokens: number | null) => void;
|
|
49
|
-
onSetPermissionMode?: (mode: PermissionMode) => {
|
|
50
|
-
ok: true;
|
|
51
|
-
} | {
|
|
52
|
-
ok: false;
|
|
53
|
-
error: string;
|
|
54
|
-
};
|
|
55
|
-
onClose?: (code?: number) => void;
|
|
56
|
-
};
|
|
57
|
-
export type RemoteCredentials = {
|
|
58
|
-
worker_jwt: string;
|
|
59
|
-
api_base_url: string;
|
|
60
|
-
expires_in: number;
|
|
61
|
-
worker_epoch: number;
|
|
62
|
-
};
|
package/dist/types/browser.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { SDKUserMessage } from './messages.js';
|
|
2
|
-
import type { CanUseTool } from './permissions.js';
|
|
3
|
-
import type { HookEvent, HookCallbackMatcher } from './hooks.js';
|
|
4
|
-
import type { McpServerConfig } from './mcp.js';
|
|
5
|
-
export type OAuthCredential = {
|
|
6
|
-
type: 'oauth';
|
|
7
|
-
token: string;
|
|
8
|
-
};
|
|
9
|
-
export type AuthMessage = {
|
|
10
|
-
type: 'auth';
|
|
11
|
-
credential: OAuthCredential;
|
|
12
|
-
};
|
|
13
|
-
export type WebSocketOptions = {
|
|
14
|
-
url: string;
|
|
15
|
-
headers?: Record<string, string>;
|
|
16
|
-
authMessage?: AuthMessage;
|
|
17
|
-
};
|
|
18
|
-
export type BrowserQueryOptions = {
|
|
19
|
-
prompt: AsyncIterable<SDKUserMessage>;
|
|
20
|
-
websocket: WebSocketOptions;
|
|
21
|
-
abortController?: AbortController;
|
|
22
|
-
canUseTool?: CanUseTool;
|
|
23
|
-
hooks?: Partial<Record<HookEvent, HookCallbackMatcher[]>>;
|
|
24
|
-
mcpServers?: Record<string, McpServerConfig>;
|
|
25
|
-
jsonSchema?: Record<string, unknown>;
|
|
26
|
-
};
|