@co0ontty/wand 4.80.0 → 4.80.1
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/ai-team-availability.js +0 -1
- package/dist/ai-team-live.d.ts +3 -1
- package/dist/ai-team-live.js +31 -2
- package/dist/ai-team-runner.d.ts +2 -1
- package/dist/ai-team-runner.js +17 -7
- package/dist/ai-team-types.d.ts +8 -0
- package/dist/ai-team-types.js +4 -0
- package/dist/build-info.json +3 -3
- package/dist/claude-pty-bridge.js +16 -1
- package/dist/cli.js +0 -9
- package/dist/config.d.ts +2 -10
- package/dist/config.js +1 -73
- package/dist/git-quick-commit.d.ts +3 -6
- package/dist/git-quick-commit.js +38 -75
- package/dist/language-prompt.d.ts +1 -1
- package/dist/language-prompt.js +1 -1
- package/dist/native-session-title.d.ts +17 -0
- package/dist/native-session-title.js +257 -0
- package/dist/process-manager.d.ts +3 -0
- package/dist/process-manager.js +37 -6
- package/dist/server-session-routes.js +4 -29
- package/dist/server-settings-routes.js +2 -177
- package/dist/server-task-routes.js +1 -1
- package/dist/server-workspace-routes.js +1 -1
- package/dist/server.js +1 -13
- package/dist/session-ai-context.d.ts +3 -7
- package/dist/session-ai-context.js +0 -25
- package/dist/session-topic.d.ts +19 -0
- package/dist/session-topic.js +53 -3
- package/dist/session-transport.js +0 -1
- package/dist/silicon-employee-draft.d.ts +1 -1
- package/dist/storage.js +12 -18
- package/dist/structured-claude-adapter.d.ts +0 -6
- package/dist/structured-claude-adapter.js +1 -5
- package/dist/structured-provider-common.d.ts +8 -4
- package/dist/structured-provider-common.js +14 -15
- package/dist/structured-session-manager.d.ts +4 -40
- package/dist/structured-session-manager.js +53 -773
- package/dist/types.d.ts +12 -27
- package/dist/web-ui/content/ai-teams.js +9 -9
- package/dist/web-ui/content/scripts.js +70 -70
- package/dist/web-ui/content/styles.css +1 -1
- package/dist/web-ui/embedded-assets.js +3 -3
- package/dist/ws-broadcast.js +19 -7
- package/package.json +1 -2
- package/dist/claude-sdk-runner.d.ts +0 -59
- package/dist/claude-sdk-runner.js +0 -188
- package/dist/claude-skills.d.ts +0 -6
- package/dist/claude-skills.js +0 -53
- package/dist/system-ai.d.ts +0 -27
- package/dist/system-ai.js +0 -424
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SessionProvider, SessionRunner, SessionSnapshot, StructuredSessionState
|
|
1
|
+
import type { SessionProvider, SessionRunner, SessionSnapshot, StructuredSessionState } from "./types.js";
|
|
2
2
|
/**
|
|
3
3
|
* 把会话级系统提示交给 CLI 的开关。Claude / Qoder / Pi 用 `--append-system-prompt`,
|
|
4
4
|
* Grok 用 `--rules`;Codex / OpenCode / Gemini 没有这个入口,只能退回并入本轮消息
|
|
@@ -22,11 +22,15 @@ export declare function isThinkingEffort(value: unknown): value is NonNullable<S
|
|
|
22
22
|
/** 只取本 provider 的原生档位。别的 CLI 的前缀不能串过去。 */
|
|
23
23
|
export declare function prefixedThinkingEffort(provider: SessionProvider, effort: SessionSnapshot["thinkingEffort"]): string | null;
|
|
24
24
|
export declare function isStructuredRunnerForProvider(provider: SessionProvider, runner: unknown): runner is SessionRunner;
|
|
25
|
-
export declare function defaultStructuredRunner(provider: SessionProvider
|
|
26
|
-
|
|
25
|
+
export declare function defaultStructuredRunner(provider: SessionProvider): SessionRunner;
|
|
26
|
+
/**
|
|
27
|
+
* 历史值归一:`claude-sdk` 是 SDK 执行路径的遗留会话值(含旧客户端仍会提交的值)。
|
|
28
|
+
* SDK 已移除,读路径把它映射成同一套 `claude -p` 执行,不报错、不丢会话。
|
|
29
|
+
*/
|
|
30
|
+
export declare function normalizeStructuredRunner(runner: unknown): unknown;
|
|
31
|
+
export declare function resolveStructuredRunner(provider: SessionProvider, requestedRunner: unknown): SessionRunner;
|
|
27
32
|
export declare function defaultStructuredState(provider: SessionProvider, runner?: SessionRunner): StructuredSessionState;
|
|
28
33
|
export declare function normalizeThinkingEffort(value: unknown): SessionSnapshot["thinkingEffort"];
|
|
29
|
-
export declare function thinkingEffortToSdkBudget(effort: SessionSnapshot["thinkingEffort"]): number;
|
|
30
34
|
export declare function thinkingEffortToClaudeCliEffort(effort: SessionSnapshot["thinkingEffort"]): string | null;
|
|
31
35
|
export declare function thinkingEffortToClaudeSlashEffort(effort: SessionSnapshot["thinkingEffort"]): string;
|
|
32
36
|
export declare function thinkingEffortToCodexReasoningEffort(effort: SessionSnapshot["thinkingEffort"]): string | null;
|
|
@@ -73,6 +73,7 @@ export function prefixedThinkingEffort(provider, effort) {
|
|
|
73
73
|
return /^[a-z0-9][a-z0-9_-]{0,31}$/.test(level) ? level : null;
|
|
74
74
|
}
|
|
75
75
|
export function isStructuredRunnerForProvider(provider, runner) {
|
|
76
|
+
// "claude-sdk" 是历史值:SDK 执行路径已移除,只在读旧会话时用来识别(见 normalizeStructuredRunner)。
|
|
76
77
|
if (provider === "claude")
|
|
77
78
|
return runner === "claude-sdk" || runner === "claude-cli-print";
|
|
78
79
|
if (provider === "codex")
|
|
@@ -87,7 +88,7 @@ export function isStructuredRunnerForProvider(provider, runner) {
|
|
|
87
88
|
return runner === "pi-cli-json";
|
|
88
89
|
return runner === "gemini-cli-json";
|
|
89
90
|
}
|
|
90
|
-
export function defaultStructuredRunner(provider
|
|
91
|
+
export function defaultStructuredRunner(provider) {
|
|
91
92
|
if (provider === "codex")
|
|
92
93
|
return "codex-cli-exec";
|
|
93
94
|
if (provider === "opencode")
|
|
@@ -100,14 +101,22 @@ export function defaultStructuredRunner(provider, configuredClaudeRunner = "cli"
|
|
|
100
101
|
return "pi-cli-json";
|
|
101
102
|
if (provider === "gemini")
|
|
102
103
|
return "gemini-cli-json";
|
|
103
|
-
return
|
|
104
|
+
return "claude-cli-print";
|
|
104
105
|
}
|
|
105
|
-
|
|
106
|
-
|
|
106
|
+
/**
|
|
107
|
+
* 历史值归一:`claude-sdk` 是 SDK 执行路径的遗留会话值(含旧客户端仍会提交的值)。
|
|
108
|
+
* SDK 已移除,读路径把它映射成同一套 `claude -p` 执行,不报错、不丢会话。
|
|
109
|
+
*/
|
|
110
|
+
export function normalizeStructuredRunner(runner) {
|
|
111
|
+
return runner === "claude-sdk" ? "claude-cli-print" : runner;
|
|
112
|
+
}
|
|
113
|
+
export function resolveStructuredRunner(provider, requestedRunner) {
|
|
114
|
+
const normalized = normalizeStructuredRunner(requestedRunner);
|
|
115
|
+
const runner = normalized ?? defaultStructuredRunner(provider);
|
|
107
116
|
if (!isStructuredRunnerForProvider(provider, runner)) {
|
|
108
117
|
throw new Error(`runner ${String(runner)} 不支持 provider ${provider}。`);
|
|
109
118
|
}
|
|
110
|
-
return runner;
|
|
119
|
+
return runner === "claude-sdk" ? "claude-cli-print" : runner;
|
|
111
120
|
}
|
|
112
121
|
export function defaultStructuredState(provider, runner = defaultStructuredRunner(provider)) {
|
|
113
122
|
return { provider, runner, lastError: null, inFlight: false, activeRequestId: null };
|
|
@@ -122,16 +131,6 @@ export function normalizeThinkingEffort(value) {
|
|
|
122
131
|
return normalized;
|
|
123
132
|
return null;
|
|
124
133
|
}
|
|
125
|
-
export function thinkingEffortToSdkBudget(effort) {
|
|
126
|
-
const native = prefixedThinkingEffort("claude", effort) ?? effort;
|
|
127
|
-
if (native === "standard" || native === "low")
|
|
128
|
-
return 4096;
|
|
129
|
-
if (native === "deep" || native === "medium" || native === "high")
|
|
130
|
-
return 16000;
|
|
131
|
-
if (native === "max" || native === "xhigh" || native === "ultra")
|
|
132
|
-
return 31999;
|
|
133
|
-
return 0;
|
|
134
|
-
}
|
|
135
134
|
export function thinkingEffortToClaudeCliEffort(effort) {
|
|
136
135
|
const native = prefixedThinkingEffort("claude", effort);
|
|
137
136
|
if (native)
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { query as sdkQuery } from "@anthropic-ai/claude-agent-sdk";
|
|
2
1
|
import { type WorktreeSetupSpec } from "./git-worktree.js";
|
|
3
2
|
import { SessionLogger } from "./session-logger.js";
|
|
4
3
|
import { WandStorage } from "./storage.js";
|
|
@@ -67,30 +66,10 @@ export declare class StructuredSessionManager {
|
|
|
67
66
|
private readonly storage;
|
|
68
67
|
private readonly config;
|
|
69
68
|
private readonly logger;
|
|
70
|
-
private readonly sdkQueryFactory;
|
|
71
69
|
private readonly execHost?;
|
|
72
70
|
private readonly sessions;
|
|
73
71
|
private readonly pendingRunnerExecutions;
|
|
74
|
-
private readonly pendingSdkAbort;
|
|
75
|
-
/**
|
|
76
|
-
* Active SDK Query handle per session, kept around so we can call
|
|
77
|
-
* `query.interrupt()` for a graceful stop instead of aborting via signal.
|
|
78
|
-
* Only populated while an SDK call is in flight.
|
|
79
|
-
*/
|
|
80
|
-
private readonly pendingSdkQueries;
|
|
81
|
-
/** In-flight canUseTool waiters. One pending prompt per session. */
|
|
82
|
-
private readonly pendingPermissions;
|
|
83
|
-
/** approve_turn memory, scoped to the current SDK query. */
|
|
84
|
-
private readonly turnApprovalMemory;
|
|
85
72
|
private readonly interruptedWith;
|
|
86
|
-
private readonly interruptedSkills;
|
|
87
|
-
/**
|
|
88
|
-
* Sessions where the current interrupt is a "queue promote" (用户从排队条点了「立即」
|
|
89
|
-
* 把队首插队到 now)。退出处理三个分支默认会把 queuedMessages 清空——因为常规的
|
|
90
|
-
* interrupt 语义是"算了,做这个",把队列也作废。但 queue-promote 的语义是
|
|
91
|
-
* "先做这条,剩下的队列还要继续",所以这里打个标记,让退出 handler 保留 queue。
|
|
92
|
-
* 收到后必须 delete 掉,避免下一次普通 interrupt 误带 flag。
|
|
93
|
-
*/
|
|
94
73
|
private readonly preserveQueueOnInterrupt;
|
|
95
74
|
/** Last wall-clock time (ms) a streaming checkpoint reached SQLite. */
|
|
96
75
|
private readonly lastStreamSaveAt;
|
|
@@ -108,6 +87,7 @@ export declare class StructuredSessionManager {
|
|
|
108
87
|
private emitEvent;
|
|
109
88
|
private archiveTimer;
|
|
110
89
|
private readonly topicCoordinator;
|
|
90
|
+
private readonly nativeTitles;
|
|
111
91
|
private readonly streamEmitTimers;
|
|
112
92
|
private readonly claudeCliRunner;
|
|
113
93
|
private readonly codexRunner;
|
|
@@ -122,7 +102,7 @@ export declare class StructuredSessionManager {
|
|
|
122
102
|
private detachedRecoveryRetryTimer;
|
|
123
103
|
private detachedRecoveryFailureLogged;
|
|
124
104
|
private disposed;
|
|
125
|
-
constructor(storage: WandStorage, config: WandConfig, logger?: SessionLogger | null,
|
|
105
|
+
constructor(storage: WandStorage, config: WandConfig, logger?: SessionLogger | null, runners?: StructuredSessionManagerRunners, execHost?: StructuredExecHost | undefined);
|
|
126
106
|
private archiveExpiredSessions;
|
|
127
107
|
setEventEmitter(emitEvent: (event: ProcessEvent) => void): void;
|
|
128
108
|
/** Stop every runner and flush terminal state before storage is closed. */
|
|
@@ -155,6 +135,8 @@ export declare class StructuredSessionManager {
|
|
|
155
135
|
*/
|
|
156
136
|
setWorktreeMergeState(id: string, status: SessionSnapshot["worktreeMergeStatus"], info: SessionSnapshot["worktreeMergeInfo"]): SessionSnapshot | null;
|
|
157
137
|
private maybeGenerateSessionTopic;
|
|
138
|
+
/** 原生标题优先于模型标题:只受「不能是任务名/目录名」约束,命中且变化时才落库。 */
|
|
139
|
+
private applyNativeSessionTitle;
|
|
158
140
|
createSession(options: CreateStructuredSessionOptions): SessionSnapshot;
|
|
159
141
|
registerRelay(automationIdPrefix: string, handler: StructuredRelayHandler): void;
|
|
160
142
|
private relayHandlerFor;
|
|
@@ -171,7 +153,6 @@ export declare class StructuredSessionManager {
|
|
|
171
153
|
idempotencyKey?: string;
|
|
172
154
|
preserveQueue?: boolean;
|
|
173
155
|
queueAlreadyRemoved?: boolean;
|
|
174
|
-
skills?: string[];
|
|
175
156
|
}): Promise<SessionSnapshot>;
|
|
176
157
|
/**
|
|
177
158
|
* Reorder the pending queued messages. `order` is a permutation of the current
|
|
@@ -223,15 +204,10 @@ export declare class StructuredSessionManager {
|
|
|
223
204
|
private currentSessionForRequest;
|
|
224
205
|
/** Delete a handle only if it still belongs to the execution doing cleanup. */
|
|
225
206
|
private releasePendingRunnerExecution;
|
|
226
|
-
private releasePendingSdkAbort;
|
|
227
|
-
private releasePendingSdkQuery;
|
|
228
207
|
private emitStructuredSnapshot;
|
|
229
208
|
private flushNextQueuedMessage;
|
|
230
209
|
private emit;
|
|
231
210
|
private incrementApprovalStats;
|
|
232
|
-
private rememberTurnApproval;
|
|
233
|
-
private settlePendingPermission;
|
|
234
|
-
private handleCanUseTool;
|
|
235
211
|
private runCodexStreaming;
|
|
236
212
|
private runGrokStreaming;
|
|
237
213
|
private runOpenCodeStreaming;
|
|
@@ -247,17 +223,6 @@ export declare class StructuredSessionManager {
|
|
|
247
223
|
* outside CWD). stdin is always "ignore" — no ACP bidirectional control.
|
|
248
224
|
*/
|
|
249
225
|
private runClaudeStreaming;
|
|
250
|
-
/**
|
|
251
|
-
* Use @anthropic-ai/claude-agent-sdk instead of spawning claude -p directly.
|
|
252
|
-
* The SDK still spawns the claude binary but provides typed AsyncGenerator<SDKMessage>
|
|
253
|
-
* messages, so we skip NDJSON parsing. Options are 1:1 with the CLI flags.
|
|
254
|
-
*
|
|
255
|
-
* Streaming is enabled via includePartialMessages: true — the SDK emits
|
|
256
|
-
* SDKPartialAssistantMessage (type: "stream_event") with BetaRawMessageStreamEvent
|
|
257
|
-
* payloads for incremental text/thinking/tool_use updates, followed by a final
|
|
258
|
-
* SDKAssistantMessage with the authoritative complete content.
|
|
259
|
-
*/
|
|
260
|
-
private runClaudeSdkStreaming;
|
|
261
226
|
private compactContentBlocks;
|
|
262
227
|
private buildCompletedAssistantMessages;
|
|
263
228
|
/**
|
|
@@ -271,7 +236,6 @@ export declare class StructuredSessionManager {
|
|
|
271
236
|
*/
|
|
272
237
|
private mergeTruncatedReplayTurn;
|
|
273
238
|
private resolveQueuedMessagesAfterInterrupt;
|
|
274
|
-
private resolveQueuedMessageSkillsAfterInterrupt;
|
|
275
239
|
private normalizeToolResultContent;
|
|
276
240
|
/**
|
|
277
241
|
* 组装结构化 runner 退出失败时的可读错误字符串。
|