@qwen-code/channel-base 0.19.4 → 0.19.5
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/dist/ChannelAgentBridge.d.ts +6 -0
- package/dist/ChannelBase.d.ts +26 -1
- package/dist/ChannelBase.js +409 -50
- package/dist/ChannelBase.js.map +1 -1
- package/dist/ChannelLoopScheduler.d.ts +4 -0
- package/dist/ChannelLoopScheduler.js +5 -0
- package/dist/ChannelLoopScheduler.js.map +1 -1
- package/dist/DaemonChannelBridge.d.ts +6 -1
- package/dist/DaemonChannelBridge.js +46 -7
- package/dist/DaemonChannelBridge.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/sanitize.js +1 -1
- package/dist/sanitize.js.map +1 -1
- package/dist/types.d.ts +65 -0
- package/dist/types.js +4 -1
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
|
@@ -27,6 +27,11 @@ interface ChannelAgentBridgeEventMap {
|
|
|
27
27
|
textChunk: [sessionId: string, chunk: string];
|
|
28
28
|
toolCall: [ToolCallEvent];
|
|
29
29
|
}
|
|
30
|
+
export interface BridgeSessionInfo {
|
|
31
|
+
sessionId: string;
|
|
32
|
+
workspaceCwd: string;
|
|
33
|
+
hasActivePrompt: boolean;
|
|
34
|
+
}
|
|
30
35
|
export interface ChannelAgentBridge {
|
|
31
36
|
readonly availableCommands: AvailableCommand[];
|
|
32
37
|
getAvailableCommands?(sessionId: string): AvailableCommand[];
|
|
@@ -44,5 +49,6 @@ export interface ChannelAgentBridge {
|
|
|
44
49
|
output: string;
|
|
45
50
|
aborted: boolean;
|
|
46
51
|
}>;
|
|
52
|
+
listSessions?(): BridgeSessionInfo[];
|
|
47
53
|
}
|
|
48
54
|
export {};
|
package/dist/ChannelBase.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ChannelConfig, ChannelMemoryCallbacks, Envelope, SessionTarget } from './types.js';
|
|
1
|
+
import type { ChannelConfig, ChannelMemoryCallbacks, ChannelRuntimeIdentity, ChannelRuntimeMemoryScope, ChannelTaskLifecycleEvent, Envelope, SessionTarget } from './types.js';
|
|
2
2
|
import { GroupGate } from './GroupGate.js';
|
|
3
3
|
import { SenderGate } from './SenderGate.js';
|
|
4
4
|
import { SessionRouter } from './SessionRouter.js';
|
|
@@ -46,6 +46,9 @@ export declare abstract class ChannelBase {
|
|
|
46
46
|
protected gate: SenderGate;
|
|
47
47
|
protected router: SessionRouter;
|
|
48
48
|
protected name: string;
|
|
49
|
+
/** Resolved (defaulted + frozen) identity/scope — adapters should read these, not raw config. */
|
|
50
|
+
protected readonly identity: ChannelRuntimeIdentity;
|
|
51
|
+
protected readonly memoryScope: ChannelRuntimeMemoryScope;
|
|
49
52
|
/** Resolved proxy URL, available to subclasses for adapter-specific clients. */
|
|
50
53
|
protected proxy?: string;
|
|
51
54
|
private readonly channelMemory?;
|
|
@@ -68,10 +71,29 @@ export declare abstract class ChannelBase {
|
|
|
68
71
|
private collectBuffers;
|
|
69
72
|
private readonly bridgeToolCallListener;
|
|
70
73
|
private readonly bridgeSessionDiedListener;
|
|
74
|
+
dispatchToolCall(event: ToolCallEvent): void;
|
|
71
75
|
constructor(name: string, config: ChannelConfig, bridge: ChannelAgentBridge, options?: ChannelBaseOptions);
|
|
72
76
|
abstract connect(): Promise<void>;
|
|
73
77
|
abstract sendMessage(chatId: string, text: string): Promise<void>;
|
|
74
78
|
abstract disconnect(): void;
|
|
79
|
+
/**
|
|
80
|
+
* Adapter hook for task lifecycle events — the canonical way to track task
|
|
81
|
+
* state (onPromptStart/onPromptEnd are retained for back-compat). The prompt
|
|
82
|
+
* flow never awaits this hook; an async override's rejection is caught and
|
|
83
|
+
* logged, nothing more.
|
|
84
|
+
*/
|
|
85
|
+
protected onTaskLifecycle(_event: ChannelTaskLifecycleEvent): void | Promise<void>;
|
|
86
|
+
private emitTaskLifecycle;
|
|
87
|
+
private logTaskLifecycleError;
|
|
88
|
+
private lifecycleError;
|
|
89
|
+
private emitTaskCancellation;
|
|
90
|
+
private resolveIdentity;
|
|
91
|
+
private resolveMemoryScope;
|
|
92
|
+
/** Built once — identity/memoryScope are frozen at construction. */
|
|
93
|
+
private boundaryPrompt?;
|
|
94
|
+
private channelBoundaryPrompt;
|
|
95
|
+
private shouldPrependChannelBoundaryPrompt;
|
|
96
|
+
private lifecycleBase;
|
|
75
97
|
supportsProactiveSend(): boolean;
|
|
76
98
|
protected supportsProactiveTarget(target: SessionTarget): boolean;
|
|
77
99
|
protected pushProactive(target: SessionTarget, text: string): Promise<void>;
|
|
@@ -80,6 +102,9 @@ export declare abstract class ChannelBase {
|
|
|
80
102
|
runLoopPrompt(job: ChannelLoop, options?: ChannelLoopPromptOptions): Promise<string | undefined>;
|
|
81
103
|
private runLoopBridgePrompt;
|
|
82
104
|
private cancelTimedOutLoopPrompt;
|
|
105
|
+
protected requestActivePromptCancellation(sessionId: string, reason?: 'cancel_command' | 'clear' | 'steer'): Promise<boolean>;
|
|
106
|
+
private logCancelSessionFailure;
|
|
107
|
+
private settleCancelRequested;
|
|
83
108
|
onToolCall(_chatId: string, _event: ToolCallEvent): void;
|
|
84
109
|
onSessionDied(sessionId: string): void;
|
|
85
110
|
private attachBridgeEvents;
|