@co0ontty/wand 1.20.4 → 1.21.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/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export type SessionKind = "pty" | "structured";
2
2
  export type SessionCreateKind = "pty" | "structured";
3
3
  export type SessionProvider = "claude" | "codex";
4
- export type SessionRunner = "claude-cli" | "claude-cli-print" | "pty";
4
+ export type SessionRunner = "claude-cli" | "claude-cli-print" | "claude-sdk" | "codex-cli-exec" | "pty";
5
5
  export type ExecutionMode = "assist" | "agent" | "agent-max" | "default" | "auto-edit" | "full-access" | "native" | "managed";
6
6
  export type AutonomyPolicy = "assist" | "agent" | "agent-max";
7
7
  export type ApprovalPolicy = "ask-every-time" | "approve-once" | "remember-this-turn";
@@ -14,6 +14,9 @@ export interface ProcessEvent {
14
14
  type: "output" | "status" | "started" | "ended" | "usage" | "task" | "notification";
15
15
  sessionId: string;
16
16
  data?: unknown;
17
+ /** Monotonic per-session sequence stamped by the WS broadcast layer for
18
+ * output events. Lets clients spot gaps caused by backpressure drops. */
19
+ seq?: number;
17
20
  }
18
21
  export type ProcessEventHandler = (event: ProcessEvent) => void;
19
22
  export interface EscalationRequest {
@@ -88,6 +91,8 @@ export interface WandConfig {
88
91
  cardDefaults?: CardExpandDefaults;
89
92
  /** 新建会话时默认使用的 Claude 模型(别名或完整 ID)。留空则不传 --model,由 claude 自行决定。 */
90
93
  defaultModel?: string;
94
+ /** 结构化会话使用的 runner: "cli"(默认,spawn claude -p)或 "sdk"(@anthropic-ai/claude-agent-sdk)。 */
95
+ structuredRunner?: "cli" | "sdk";
91
96
  }
92
97
  export interface ClaudeModelInfo {
93
98
  /** 传给 --model 的值(别名或完整模型 ID) */
@@ -186,6 +191,10 @@ export interface CommandRequest {
186
191
  worktreeEnabled?: boolean;
187
192
  /** Claude 模型(别名或完整 ID)。仅对 claude provider 生效。留空则回落到 config.defaultModel。 */
188
193
  model?: string;
194
+ /** 创建会话时由前端测得的真实列数。后端用它直接 spawn PTY,避免"先 120 列再 resize"的早期错位。 */
195
+ cols?: number;
196
+ /** 创建会话时由前端测得的真实行数。 */
197
+ rows?: number;
189
198
  }
190
199
  export interface InputRequest {
191
200
  input?: string;
@@ -284,7 +293,7 @@ export interface SessionSnapshot {
284
293
  autonomyPolicy?: AutonomyPolicy;
285
294
  approvalPolicy?: ApprovalPolicy;
286
295
  allowedScopes?: EscalationScope[];
287
- status: "running" | "exited" | "failed" | "stopped";
296
+ status: "idle" | "running" | "exited" | "failed" | "stopped";
288
297
  exitCode: number | null;
289
298
  startedAt: string;
290
299
  endedAt: string | null;
@@ -325,6 +334,10 @@ export interface SessionSnapshot {
325
334
  currentTaskTitle?: string;
326
335
  /** 用户为此会话选定的 Claude 模型(别名或完整 ID)。结构化会话下次 spawn 时使用;PTY 会话仅用于展示。 */
327
336
  selectedModel?: string | null;
337
+ /** 当前 PTY 列宽,由最近一次 resize 决定。前端用它来判断本端 fit 是否需要校准。 */
338
+ ptyCols?: number;
339
+ /** 当前 PTY 行数,由最近一次 resize 决定。 */
340
+ ptyRows?: number;
328
341
  }
329
342
  /** Unified event type emitted by ClaudePtyBridge for WebSocket broadcast */
330
343
  export type SessionEventType = "output.raw" | "output.chat" | "chat.turn" | "permission.prompt" | "permission.resolved" | "session.id" | "task" | "ended";