@co0ontty/wand 1.60.4 → 1.61.0-beta.g676ee8e
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/build-info.json +4 -4
- package/dist/config.d.ts +1 -1
- package/dist/config.js +18 -0
- package/dist/process-manager.js +9 -2
- package/dist/server-session-routes.js +2 -2
- package/dist/server.js +3 -1
- package/dist/structured-session-manager.d.ts +0 -2
- package/dist/structured-session-manager.js +18 -13
- package/dist/types.d.ts +2 -0
- package/dist/web-ui/content/scripts.js +29 -29
- package/dist/web-ui/content/styles.css +1 -1
- package/dist/web-ui/embedded-assets.d.ts +1 -1
- package/dist/web-ui/embedded-assets.js +3 -3
- package/package.json +1 -1
package/dist/build-info.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"commit": "
|
|
3
|
-
"builtAt": "2026-06-
|
|
4
|
-
"version": "1.
|
|
5
|
-
"channel": "
|
|
2
|
+
"commit": "676ee8ed1518463d31f33f9d6679d7700aac3eb7",
|
|
3
|
+
"builtAt": "2026-06-13T13:58:19.378Z",
|
|
4
|
+
"version": "1.61.0-beta.g676ee8e",
|
|
5
|
+
"channel": "beta"
|
|
6
6
|
}
|
package/dist/config.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import type { WandStorage } from "./storage.js";
|
|
|
7
7
|
* 升级路径:老 JSON 里仍存有这些字段时,首次启动会被搬到 DB(见 migrateLegacyPreferencesToDb),
|
|
8
8
|
* 然后下一次 saveConfig 写回 JSON 时它们会被剥离(见 stripPreferenceFields)。
|
|
9
9
|
*/
|
|
10
|
-
export declare const PREFERENCE_KEYS: readonly ["defaultMode", "defaultCwd", "defaultModel", "structuredRunner", "language", "cardDefaults", "inheritEnv"];
|
|
10
|
+
export declare const PREFERENCE_KEYS: readonly ["defaultMode", "defaultCwd", "defaultModel", "defaultThinkingEffort", "structuredRunner", "language", "cardDefaults", "inheritEnv"];
|
|
11
11
|
export type PreferenceKey = (typeof PREFERENCE_KEYS)[number];
|
|
12
12
|
export declare function isPreferenceKey(key: string): key is PreferenceKey;
|
|
13
13
|
export declare const defaultConfig: () => WandConfig;
|
package/dist/config.js
CHANGED
|
@@ -16,6 +16,7 @@ export const PREFERENCE_KEYS = [
|
|
|
16
16
|
"defaultMode",
|
|
17
17
|
"defaultCwd",
|
|
18
18
|
"defaultModel",
|
|
19
|
+
"defaultThinkingEffort",
|
|
19
20
|
"structuredRunner",
|
|
20
21
|
"language",
|
|
21
22
|
"cardDefaults",
|
|
@@ -44,6 +45,7 @@ export const defaultConfig = () => ({
|
|
|
44
45
|
macos: defaultMacosDmgConfig(),
|
|
45
46
|
cardDefaults: defaultCardExpandDefaults(),
|
|
46
47
|
defaultModel: "",
|
|
48
|
+
defaultThinkingEffort: "off",
|
|
47
49
|
structuredRunner: "cli",
|
|
48
50
|
inheritEnv: true,
|
|
49
51
|
commandPresets: [
|
|
@@ -242,6 +244,11 @@ export function applyStoragePreferences(config, storage) {
|
|
|
242
244
|
if (typeof v === "string")
|
|
243
245
|
config.defaultModel = v.trim();
|
|
244
246
|
}
|
|
247
|
+
if (storage.hasPreference(preferenceStorageKey("defaultThinkingEffort"))) {
|
|
248
|
+
const v = storage.getPreference(preferenceStorageKey("defaultThinkingEffort"), defaults.defaultThinkingEffort ?? "off");
|
|
249
|
+
if (v === "off" || v === "standard" || v === "deep" || v === "max")
|
|
250
|
+
config.defaultThinkingEffort = v;
|
|
251
|
+
}
|
|
245
252
|
if (storage.hasPreference(preferenceStorageKey("structuredRunner"))) {
|
|
246
253
|
const v = storage.getPreference(preferenceStorageKey("structuredRunner"), defaults.structuredRunner ?? "cli");
|
|
247
254
|
if (v === "cli" || v === "sdk")
|
|
@@ -285,6 +292,12 @@ export function writePreferenceToStorage(config, storage, key, value) {
|
|
|
285
292
|
config.defaultModel = v;
|
|
286
293
|
break;
|
|
287
294
|
}
|
|
295
|
+
case "defaultThinkingEffort": {
|
|
296
|
+
const v = value === "standard" || value === "deep" || value === "max" ? value : "off";
|
|
297
|
+
storage.setPreference(dbKey, v);
|
|
298
|
+
config.defaultThinkingEffort = v;
|
|
299
|
+
break;
|
|
300
|
+
}
|
|
288
301
|
case "structuredRunner": {
|
|
289
302
|
const v = value === "cli" ? "cli" : "sdk";
|
|
290
303
|
storage.setPreference(dbKey, v);
|
|
@@ -448,6 +461,11 @@ function mergeWithDefaults(input) {
|
|
|
448
461
|
macos: normalizeMacosDmgConfig(input.macos) ?? defaults.macos,
|
|
449
462
|
cardDefaults: normalizeCardDefaults(input.cardDefaults),
|
|
450
463
|
defaultModel: typeof input.defaultModel === "string" ? input.defaultModel.trim() : defaults.defaultModel,
|
|
464
|
+
defaultThinkingEffort: input.defaultThinkingEffort === "standard"
|
|
465
|
+
|| input.defaultThinkingEffort === "deep"
|
|
466
|
+
|| input.defaultThinkingEffort === "max"
|
|
467
|
+
? input.defaultThinkingEffort
|
|
468
|
+
: "off",
|
|
451
469
|
structuredRunner: (input.structuredRunner === "sdk" || input.structuredRunner === "cli") ? input.structuredRunner : defaults.structuredRunner,
|
|
452
470
|
inheritEnv: typeof input.inheritEnv === "boolean" ? input.inheritEnv : (defaults.inheritEnv ?? true),
|
|
453
471
|
};
|
package/dist/process-manager.js
CHANGED
|
@@ -165,7 +165,10 @@ function isClaudeSessionFileAvailable(cwd, claudeSessionId) {
|
|
|
165
165
|
* interpretations and validate with existsSync, falling back to naive replacement.
|
|
166
166
|
*/
|
|
167
167
|
function invertNormalizedProjectDir(dirName) {
|
|
168
|
-
// The normalization
|
|
168
|
+
// The normalization replaces every non-alphanumeric char with "-", so this
|
|
169
|
+
// inversion is best-effort: "-" most often maps back to "/", but may also be
|
|
170
|
+
// a literal "-", ".", or "_". We try "/" vs "-" per position and validate with
|
|
171
|
+
// existsSync; dots/underscores in the original path can't be recovered here.
|
|
169
172
|
const naive = dirName.replace(/-/g, "/");
|
|
170
173
|
if (existsSync(naive))
|
|
171
174
|
return naive;
|
|
@@ -494,7 +497,11 @@ function listClaudeTaskIds() {
|
|
|
494
497
|
}
|
|
495
498
|
}
|
|
496
499
|
function getClaudeProjectDir(cwd) {
|
|
497
|
-
|
|
500
|
+
// Claude Code encodes the project dir by replacing every non-alphanumeric
|
|
501
|
+
// character (slash, dot, underscore, etc.) with "-", not just "/". Mirroring
|
|
502
|
+
// only "/" misses paths like ".../vibe_coding/wand" → the scan looks in a
|
|
503
|
+
// directory Claude never wrote to, so the session ID is never discovered.
|
|
504
|
+
const normalized = path.resolve(cwd).replace(/[^a-zA-Z0-9]/g, "-");
|
|
498
505
|
return path.join(os.homedir(), ".claude", "projects", normalized);
|
|
499
506
|
}
|
|
500
507
|
function getLatestClaudeTaskId(excludeIds) {
|
|
@@ -159,10 +159,10 @@ export function registerSessionRoutes(app, processes, structured, storage, defau
|
|
|
159
159
|
provider,
|
|
160
160
|
runner: body.runner ?? (provider === "codex" ? "codex-cli-exec" : "claude-cli-print"),
|
|
161
161
|
worktreeEnabled: body.worktreeEnabled === true,
|
|
162
|
-
model: typeof body.model === "string" ? body.model.trim() : undefined,
|
|
162
|
+
model: typeof body.model === "string" ? body.model.trim() : (config.defaultModel ?? "").trim() || undefined,
|
|
163
163
|
thinkingEffort: typeof body.thinkingEffort === "string"
|
|
164
164
|
? body.thinkingEffort
|
|
165
|
-
:
|
|
165
|
+
: config.defaultThinkingEffort,
|
|
166
166
|
});
|
|
167
167
|
onSessionCreated?.(body.cwd ?? snapshot.cwd);
|
|
168
168
|
const prompt = body.prompt?.trim();
|
package/dist/server.js
CHANGED
|
@@ -1190,6 +1190,8 @@ export async function startServer(config, configPath) {
|
|
|
1190
1190
|
port: config.port,
|
|
1191
1191
|
defaultMode: config.defaultMode,
|
|
1192
1192
|
defaultCwd: config.defaultCwd,
|
|
1193
|
+
defaultModel: config.defaultModel ?? "",
|
|
1194
|
+
defaultThinkingEffort: config.defaultThinkingEffort ?? "off",
|
|
1193
1195
|
commandPresets: config.commandPresets,
|
|
1194
1196
|
structuredRunner: config.structuredRunner ?? "cli",
|
|
1195
1197
|
structuredRunners: [
|
|
@@ -2037,7 +2039,7 @@ export async function startServer(config, configPath) {
|
|
|
2037
2039
|
model: effectiveModel,
|
|
2038
2040
|
cols: reqCols,
|
|
2039
2041
|
rows: reqRows,
|
|
2040
|
-
thinkingEffort: body.thinkingEffort ??
|
|
2042
|
+
thinkingEffort: body.thinkingEffort ?? config.defaultThinkingEffort,
|
|
2041
2043
|
});
|
|
2042
2044
|
recordRecentPath(storage, body.cwd ?? snapshot.cwd);
|
|
2043
2045
|
res.status(201).json(snapshot);
|
|
@@ -119,8 +119,6 @@ export declare class StructuredSessionManager {
|
|
|
119
119
|
stop(id: string): SessionSnapshot;
|
|
120
120
|
delete(id: string): void;
|
|
121
121
|
private requireSession;
|
|
122
|
-
private buildQueuedPlaceholderTurns;
|
|
123
|
-
private buildRenderableMessages;
|
|
124
122
|
private emitStructuredSnapshot;
|
|
125
123
|
private flushNextQueuedMessage;
|
|
126
124
|
private emit;
|
|
@@ -629,6 +629,21 @@ export class StructuredSessionManager {
|
|
|
629
629
|
this.interruptedWith.set(id, prompt);
|
|
630
630
|
if (opts.preserveQueue) {
|
|
631
631
|
this.preserveQueueOnInterrupt.add(id);
|
|
632
|
+
// 「立即发送」排队条某一条:interrupt 把它作为新输入重发,但该条仍留在
|
|
633
|
+
// queuedMessages 里。必须在这里把它从队列摘掉一次,否则 preserveQueue 会
|
|
634
|
+
// 原样保留整条队列,待 interruptPrompt 跑完 flushNextQueuedMessage 会把它
|
|
635
|
+
// 当成普通排队再发一遍(重复发送)。客户端按 index 乐观删除,服务端这里
|
|
636
|
+
// 没有 index,只能按文本删第一处匹配(排队文本入队时已 trim,promote 重发
|
|
637
|
+
// 也会 trim,所以精确匹配可靠;重复文本极少见且语义等价)。
|
|
638
|
+
const queue = session.queuedMessages ?? [];
|
|
639
|
+
const removeAt = queue.indexOf(prompt);
|
|
640
|
+
if (removeAt !== -1) {
|
|
641
|
+
const trimmedQueue = queue.slice(0, removeAt).concat(queue.slice(removeAt + 1));
|
|
642
|
+
session = { ...session, queuedMessages: trimmedQueue };
|
|
643
|
+
this.sessions.set(id, session);
|
|
644
|
+
this.storage.saveSession(session);
|
|
645
|
+
this.emitStructuredSnapshot(session);
|
|
646
|
+
}
|
|
632
647
|
}
|
|
633
648
|
else {
|
|
634
649
|
this.preserveQueueOnInterrupt.delete(id);
|
|
@@ -957,23 +972,13 @@ export class StructuredSessionManager {
|
|
|
957
972
|
}
|
|
958
973
|
return session;
|
|
959
974
|
}
|
|
960
|
-
buildQueuedPlaceholderTurns(session) {
|
|
961
|
-
return (session.queuedMessages ?? []).map((text) => ({
|
|
962
|
-
role: "user",
|
|
963
|
-
content: [{ type: "text", text, __queued: true }],
|
|
964
|
-
}));
|
|
965
|
-
}
|
|
966
|
-
buildRenderableMessages(session) {
|
|
967
|
-
return [
|
|
968
|
-
...(session.messages ?? []),
|
|
969
|
-
...this.buildQueuedPlaceholderTurns(session),
|
|
970
|
-
];
|
|
971
|
-
}
|
|
972
975
|
emitStructuredSnapshot(session, eventType = "output") {
|
|
976
|
+
// 排队消息只通过 payload.queuedMessages 单独下发,由各端在消息卡片外的「排队条」
|
|
977
|
+
// 里纵向渲染——绝不再把它们当成 __queued 占位 turn 混进 messages 消息流里,否则会
|
|
978
|
+
// 和排队条重复显示(旧的「显示异常」根因)。
|
|
973
979
|
const payload = buildStructuredOutputPayload(session);
|
|
974
980
|
const data = {
|
|
975
981
|
...payload,
|
|
976
|
-
messages: this.buildRenderableMessages(session),
|
|
977
982
|
status: session.status,
|
|
978
983
|
exitCode: session.exitCode,
|
|
979
984
|
};
|
package/dist/types.d.ts
CHANGED
|
@@ -102,6 +102,8 @@ export interface WandConfig {
|
|
|
102
102
|
cardDefaults?: CardExpandDefaults;
|
|
103
103
|
/** 新建会话时默认使用的 Claude 模型(别名或完整 ID)。留空则不传 --model,由 claude 自行决定。 */
|
|
104
104
|
defaultModel?: string;
|
|
105
|
+
/** 新建会话时默认使用的思考深度。 */
|
|
106
|
+
defaultThinkingEffort?: "off" | "standard" | "deep" | "max";
|
|
105
107
|
/** 结构化会话使用的 runner: "cli"(默认,spawn claude -p)或 "sdk"(@anthropic-ai/claude-agent-sdk)。 */
|
|
106
108
|
structuredRunner?: "cli" | "sdk";
|
|
107
109
|
/**
|