@co0ontty/wand 4.89.5 → 4.90.0
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 +5 -3
- package/dist/agent-dispatch.js +4 -9
- package/dist/ai-team-employee-binding.js +10 -9
- package/dist/ai-team-runner.d.ts +2 -1
- package/dist/ai-team-runner.js +38 -2
- package/dist/ai-team-types.js +3 -2
- package/dist/ai-text-runner.d.ts +61 -0
- package/dist/ai-text-runner.js +653 -0
- package/dist/avatar-input.d.ts +2 -0
- package/dist/avatar-input.js +19 -0
- package/dist/bounded-process-output.d.ts +5 -0
- package/dist/bounded-process-output.js +9 -0
- package/dist/build-info.json +3 -3
- package/dist/command-error.d.ts +6 -0
- package/dist/command-error.js +8 -0
- package/dist/config.js +11 -42
- package/dist/conversation-service.d.ts +12 -2
- package/dist/conversation-service.js +104 -25
- package/dist/conversation-session-preview.d.ts +2 -0
- package/dist/conversation-session-preview.js +4 -0
- package/dist/decision-client.js +22 -6
- package/dist/decision-expert-employee.js +2 -2
- package/dist/decision-expert-identity.d.ts +1 -1
- package/dist/decision-expert-identity.js +1 -1
- package/dist/decision-expert-service.d.ts +1 -0
- package/dist/decision-expert-service.js +82 -76
- package/dist/decision-hardware.js +4 -3
- package/dist/decision-types.d.ts +4 -0
- package/dist/decision-types.js +4 -0
- package/dist/deployment-lock.d.ts +13 -0
- package/dist/deployment-lock.js +189 -0
- package/dist/employee-text.js +1 -1
- package/dist/fixed-employee-avatar.d.ts +7 -0
- package/dist/fixed-employee-avatar.js +13 -0
- package/dist/git-quick-commit.d.ts +5 -40
- package/dist/git-quick-commit.js +8 -636
- package/dist/hr-employee-identity.d.ts +5 -0
- package/dist/hr-employee-identity.js +5 -0
- package/dist/hr-employee.d.ts +5 -0
- package/dist/hr-employee.js +21 -0
- package/dist/middleware/path-safety.js +1 -1
- package/dist/milestone-scope.js +1 -1
- package/dist/model-auto-assign.d.ts +1 -1
- package/dist/model-auto-assign.js +1 -1
- package/dist/models.d.ts +4 -0
- package/dist/models.js +21 -1
- package/dist/npm-update-utils.js +5 -44
- package/dist/pi-auto-resources.js +6 -3
- package/dist/plush-avatar.d.ts +10 -1
- package/dist/plush-avatar.js +13 -1
- package/dist/plush-cat-appearance.d.ts +97 -0
- package/dist/plush-cat-appearance.js +118 -0
- package/dist/plush-cat-whiskers.d.ts +6 -0
- package/dist/plush-cat-whiskers.js +42 -0
- package/dist/process-manager.d.ts +22 -21
- package/dist/process-manager.js +49 -83
- package/dist/prompt-optimizer.d.ts +1 -1
- package/dist/prompt-optimizer.js +1 -1
- package/dist/render-host.js +1 -19
- package/dist/scheduled-task-service.d.ts +41 -0
- package/dist/scheduled-task-service.js +294 -0
- package/dist/scheduled-task-state.d.ts +11 -0
- package/dist/scheduled-task-state.js +65 -0
- package/dist/scheduled-task-time.d.ts +4 -0
- package/dist/scheduled-task-time.js +82 -0
- package/dist/scheduled-task-types.d.ts +71 -0
- package/dist/scheduled-task-types.js +1 -0
- package/dist/server-ai-team-routes.js +3 -17
- package/dist/server-employee-routes.d.ts +3 -0
- package/dist/server-employee-routes.js +20 -38
- package/dist/server-file-routes.js +44 -1
- package/dist/server-pi-recommendation-routes.js +13 -4
- package/dist/server-request.d.ts +2 -0
- package/dist/server-request.js +9 -0
- package/dist/server-resume-routes.js +1 -1
- package/dist/server-scheduled-task-routes.d.ts +4 -0
- package/dist/server-scheduled-task-routes.js +34 -0
- package/dist/server-session-routes.d.ts +5 -13
- package/dist/server-session-routes.js +35 -70
- package/dist/server-task-routes.d.ts +6 -21
- package/dist/server-task-routes.js +25 -120
- package/dist/server-team-dispatch-routes.js +12 -2
- package/dist/server-workspace-routes.d.ts +1 -1
- package/dist/server-workspace-routes.js +33 -78
- package/dist/server.js +55 -20
- package/dist/session-model.d.ts +15 -0
- package/dist/session-model.js +23 -0
- package/dist/session-registry.d.ts +5 -1
- package/dist/session-registry.js +20 -11
- package/dist/session-request.d.ts +9 -0
- package/dist/session-request.js +27 -0
- package/dist/session-topic.d.ts +1 -1
- package/dist/session-topic.js +1 -1
- package/dist/session-transport.d.ts +3 -1
- package/dist/session-transport.js +11 -5
- package/dist/silicon-employee-draft.d.ts +2 -2
- package/dist/silicon-employee-draft.js +3 -3
- package/dist/socket-probe.d.ts +2 -0
- package/dist/socket-probe.js +20 -0
- package/dist/storage-schedules.d.ts +20 -0
- package/dist/storage-schedules.js +78 -0
- package/dist/storage-schema.d.ts +3 -0
- package/dist/storage-schema.js +702 -0
- package/dist/storage.d.ts +42 -8
- package/dist/storage.js +182 -715
- package/dist/structured-claude-adapter.js +12 -0
- package/dist/structured-claude-protocol.d.ts +4 -0
- package/dist/structured-claude-protocol.js +18 -4
- package/dist/structured-codex-adapter.js +11 -0
- package/dist/structured-exec-pump.js +79 -38
- package/dist/structured-failure.d.ts +21 -0
- package/dist/structured-failure.js +14 -0
- package/dist/structured-gemini-adapter.js +12 -2
- package/dist/structured-grok-adapter.js +12 -2
- package/dist/structured-opencode-adapter.js +8 -1
- package/dist/structured-qoder-adapter.js +14 -0
- package/dist/structured-session-manager.d.ts +13 -18
- package/dist/structured-session-manager.js +147 -517
- package/dist/system-employee.d.ts +1 -1
- package/dist/system-employee.js +1 -1
- package/dist/task-archive-policy.js +1 -1
- package/dist/task-read-model.d.ts +27 -0
- package/dist/task-read-model.js +47 -0
- package/dist/task-retention.d.ts +1 -1
- package/dist/task-retention.js +1 -1
- package/dist/task-title-service.d.ts +30 -0
- package/dist/task-title-service.js +122 -0
- package/dist/task-title.d.ts +1 -1
- package/dist/task-title.js +1 -1
- package/dist/terminal-daemon-client.js +1 -18
- package/dist/user-memory.js +1 -1
- package/dist/web-ui/asset-runtime.d.ts +12 -0
- package/dist/web-ui/asset-runtime.js +6 -0
- package/dist/web-ui/composer-avatar-activity.d.ts +6 -0
- package/dist/web-ui/composer-avatar-activity.js +29 -0
- package/dist/web-ui/content/ai-teams.js +13 -13
- package/dist/web-ui/content/module-manifest.json +1 -0
- package/dist/web-ui/content/modules/5478be410b112154/chat-render-PY6DIXNZ.js +24 -0
- package/dist/web-ui/content/modules/5478be410b112154/chunk-2YZLCGYN.js +1 -0
- package/dist/web-ui/content/modules/5478be410b112154/chunk-6CFHW3FA.js +111 -0
- package/dist/web-ui/content/modules/5478be410b112154/chunk-6XQEBIEX.js +1 -0
- package/dist/web-ui/content/modules/5478be410b112154/chunk-DDSO7OX7.js +1 -0
- package/dist/web-ui/content/modules/5478be410b112154/chunk-G3CXNMA2.js +20 -0
- package/dist/web-ui/content/modules/5478be410b112154/chunk-LGVAPHRS.js +36 -0
- package/dist/web-ui/content/modules/5478be410b112154/chunk-NURCNMRU.js +1 -0
- package/dist/web-ui/content/modules/5478be410b112154/chunk-PCMFGZKX.js +1 -0
- package/dist/web-ui/content/modules/5478be410b112154/chunk-QRNA4D7E.js +1 -0
- package/dist/web-ui/content/modules/5478be410b112154/chunk-TMRPHNJO.js +1 -0
- package/dist/web-ui/content/modules/5478be410b112154/chunk-WC7RK7LP.js +1 -0
- package/dist/web-ui/content/modules/5478be410b112154/chunk-YOXXNXOX.js +2 -0
- package/dist/web-ui/content/modules/5478be410b112154/chunk-YX475LXO.js +1 -0
- package/dist/web-ui/content/modules/5478be410b112154/employee-card-MDWKU4V3.js +1 -0
- package/dist/web-ui/content/modules/5478be410b112154/host-56WPSON2.js +1 -0
- package/dist/web-ui/content/modules/5478be410b112154/host-5QOHKHNC.js +1 -0
- package/dist/web-ui/content/modules/5478be410b112154/host-AWIJ5L2K.js +1 -0
- package/dist/web-ui/content/modules/5478be410b112154/host-BOZLGIT5.js +69 -0
- package/dist/web-ui/content/modules/5478be410b112154/host-EZV22Q7Y.js +4 -0
- package/dist/web-ui/content/modules/5478be410b112154/host-IW43Z5ZF.js +1 -0
- package/dist/web-ui/content/modules/5478be410b112154/host-JT7NIUQL.js +1 -0
- package/dist/web-ui/content/modules/5478be410b112154/host-JWEIDB55.js +3 -0
- package/dist/web-ui/content/modules/5478be410b112154/host-OU5TRYH6.js +2 -0
- package/dist/web-ui/content/modules/5478be410b112154/host-PRSTCPVE.js +5 -0
- package/dist/web-ui/content/modules/5478be410b112154/host-TWPJI3HE.js +1 -0
- package/dist/web-ui/content/modules/5478be410b112154/host-WZGJSNML.js +1 -0
- package/dist/web-ui/content/modules/5478be410b112154/host-X6KQVFD6.js +1 -0
- package/dist/web-ui/content/modules/5478be410b112154/host-YKCQFMQR.js +1 -0
- package/dist/web-ui/content/modules/5478be410b112154/host-bridge-2LZX6UUZ.js +1 -0
- package/dist/web-ui/content/modules/5478be410b112154/library-bridge-MQFJGTGY.js +4 -0
- package/dist/web-ui/content/modules/5478be410b112154/page-T3VUCU2W.js +3 -0
- package/dist/web-ui/content/modules/5478be410b112154/panel-HJBGBBPY.js +1 -0
- package/dist/web-ui/content/modules/5478be410b112154/runtime.js +920 -0
- package/dist/web-ui/content/modules/5478be410b112154/sha256-ANXV72UC.js +1 -0
- package/dist/web-ui/content/modules/5478be410b112154/task-board-host-AVMDIHIV.js +2 -0
- package/dist/web-ui/content/modules/5478be410b112154/workspace-agent-picker-KI7QVSK3.js +1 -0
- package/dist/web-ui/content/modules/5478be410b112154/workspace-window-L542FGP2.js +1 -0
- package/dist/web-ui/content/plush-avatar.js +177 -177
- package/dist/web-ui/content/scripts.js +1 -994
- package/dist/web-ui/content/styles.css +1 -1
- package/dist/web-ui/content/tailwind.css +1 -1
- package/dist/web-ui/embedded-assets.d.ts +32 -0
- package/dist/web-ui/embedded-assets.js +10 -8
- package/dist/web-ui/markdown.d.ts +3 -2
- package/dist/web-ui/markdown.js +61 -48
- package/dist/web-ui/message-file-target.d.ts +13 -0
- package/dist/web-ui/message-file-target.js +85 -0
- package/dist/web-ui/provider-identity.d.ts +1 -1
- package/dist/web-ui/provider-identity.js +3 -4
- package/dist/web-ui/react/local-preview/controller.d.ts +2 -0
- package/dist/web-ui/react/local-preview/controller.js +12 -0
- package/dist/web-ui/scripts.d.ts +10 -0
- package/dist/web-ui/scripts.js +42 -5
- package/package.json +6 -3
- package/browser-extension/icons/wand-128.png +0 -0
- package/browser-extension/icons/wand-16.png +0 -0
- package/browser-extension/icons/wand-32.png +0 -0
- package/browser-extension/icons/wand-48.png +0 -0
- package/dist/web-ui/content/licenses/codex-LICENSE.txt +0 -21
|
@@ -6,7 +6,7 @@ export { SYSTEM_EMPLOYEE_ID, SYSTEM_EMPLOYEE_KEY, SYSTEM_EMPLOYEE_NAME, SYSTEM_E
|
|
|
6
6
|
* 内置的「系统运维」员工。
|
|
7
7
|
*
|
|
8
8
|
* Wand 自己的 AI 调用(commit message / tag、提示词优化、会话与任务标题、
|
|
9
|
-
*
|
|
9
|
+
* 等)通过这位员工的候选链执行;员工招聘由独立 HR 负责。该员工:身份和头像固定,不可归档、不可删除;
|
|
10
10
|
* 名字、职责、人设与执行候选(工具 + 引擎 + 模型 + 思考深度)由用户维护。
|
|
11
11
|
*/
|
|
12
12
|
export declare const SYSTEM_EMPLOYEE_DUTY = "Wand \u7CFB\u7EDF\u8FD0\u7EF4\uFF1A\u670D\u52A1\u4E0E CLI \u7EBF\u8DEF\u3001\u66F4\u65B0\u5206\u53D1\u3001\u4ED3\u5E93\u4E0E\u4F1A\u8BDD\u64CD\u4F5C\uFF0CWand \u81EA\u6709 AI \u4EFB\u52A1\u7684\u6267\u884C\u8005\u3002";
|
package/dist/system-employee.js
CHANGED
|
@@ -8,7 +8,7 @@ export { SYSTEM_EMPLOYEE_ID, SYSTEM_EMPLOYEE_KEY, SYSTEM_EMPLOYEE_NAME, SYSTEM_E
|
|
|
8
8
|
* 内置的「系统运维」员工。
|
|
9
9
|
*
|
|
10
10
|
* Wand 自己的 AI 调用(commit message / tag、提示词优化、会话与任务标题、
|
|
11
|
-
*
|
|
11
|
+
* 等)通过这位员工的候选链执行;员工招聘由独立 HR 负责。该员工:身份和头像固定,不可归档、不可删除;
|
|
12
12
|
* 名字、职责、人设与执行候选(工具 + 引擎 + 模型 + 思考深度)由用户维护。
|
|
13
13
|
*/
|
|
14
14
|
export const SYSTEM_EMPLOYEE_DUTY = "Wand 系统运维:服务与 CLI 线路、更新分发、仓库与会话操作,Wand 自有 AI 任务的执行者。";
|
|
@@ -6,7 +6,7 @@ export function canArchiveTask(storage, sessions, taskId) {
|
|
|
6
6
|
if (!task || task.status === "doing")
|
|
7
7
|
return false;
|
|
8
8
|
if (storage.listWandTaskSessionIds(task.id).some(id => {
|
|
9
|
-
const session = sessions?.
|
|
9
|
+
const session = sessions?.getSlim(id) ?? storage.getSessionSlim(id);
|
|
10
10
|
return session ? isArchiveBlocked(session) : false;
|
|
11
11
|
}))
|
|
12
12
|
return false;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { SessionRegistry } from "./session-registry.js";
|
|
2
|
+
import type { WandStorage } from "./storage.js";
|
|
3
|
+
import type { WandTask } from "./task-types.js";
|
|
4
|
+
import type { SessionSnapshot } from "./types.js";
|
|
5
|
+
/** Request-scoped projection, never an authority for mutations or a cross-request cache. */
|
|
6
|
+
export declare class TaskReadModel {
|
|
7
|
+
readonly storage: WandStorage;
|
|
8
|
+
readonly sessions: SessionSnapshot[];
|
|
9
|
+
readonly sessionsById: Map<string, SessionSnapshot>;
|
|
10
|
+
readonly sessionsByTask: Map<string, SessionSnapshot[]>;
|
|
11
|
+
readonly tasks: WandTask[];
|
|
12
|
+
readonly cardsByContainer: Map<string, WandTask>;
|
|
13
|
+
readonly workspaces: Map<string, import("./types.js").Workspace>;
|
|
14
|
+
readonly milestones: import("./task-types.js").WandTaskMilestone[];
|
|
15
|
+
readonly activeTeamTasks: Set<string>;
|
|
16
|
+
constructor(storage: WandStorage, registry?: SessionRegistry, snapshots?: SessionSnapshot[]);
|
|
17
|
+
taskSessions(task: WandTask): SessionSnapshot[];
|
|
18
|
+
canArchive(task: WandTask): boolean;
|
|
19
|
+
milestone(id: string | null | undefined): {
|
|
20
|
+
milestoneId: string | null;
|
|
21
|
+
milestone: {
|
|
22
|
+
id: string;
|
|
23
|
+
name: string;
|
|
24
|
+
isDefault: boolean;
|
|
25
|
+
} | null;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { isArchiveBlocked } from "./archive-policy.js";
|
|
2
|
+
import { AI_TEAM_ACTIVE_RUN_STATUSES } from "./ai-team-types.js";
|
|
3
|
+
/** Request-scoped projection, never an authority for mutations or a cross-request cache. */
|
|
4
|
+
export class TaskReadModel {
|
|
5
|
+
storage;
|
|
6
|
+
sessions;
|
|
7
|
+
sessionsById;
|
|
8
|
+
sessionsByTask = new Map();
|
|
9
|
+
tasks;
|
|
10
|
+
cardsByContainer;
|
|
11
|
+
workspaces;
|
|
12
|
+
milestones;
|
|
13
|
+
activeTeamTasks;
|
|
14
|
+
constructor(storage, registry, snapshots) {
|
|
15
|
+
this.storage = storage;
|
|
16
|
+
this.sessions = snapshots ?? registry?.listSlim() ?? storage.loadSessionsSlim();
|
|
17
|
+
this.sessionsById = new Map(this.sessions.map(session => [session.id, session]));
|
|
18
|
+
for (const session of this.sessions) {
|
|
19
|
+
if (!session.workspaceTaskId)
|
|
20
|
+
continue;
|
|
21
|
+
const bucket = this.sessionsByTask.get(session.workspaceTaskId) ?? [];
|
|
22
|
+
bucket.push(session);
|
|
23
|
+
this.sessionsByTask.set(session.workspaceTaskId, bucket);
|
|
24
|
+
}
|
|
25
|
+
this.tasks = storage.listWandTasks();
|
|
26
|
+
this.cardsByContainer = new Map(this.tasks.filter(task => task.workspaceTaskId).map(task => [task.workspaceTaskId, task]));
|
|
27
|
+
this.workspaces = new Map(storage.listWorkspaces().map(workspace => [workspace.id, workspace]));
|
|
28
|
+
this.milestones = storage.listWandMilestones();
|
|
29
|
+
this.activeTeamTasks = new Set(storage.listAiTeamRuns({ statuses: AI_TEAM_ACTIVE_RUN_STATUSES }).map(run => run.taskId));
|
|
30
|
+
}
|
|
31
|
+
taskSessions(task) {
|
|
32
|
+
if (task.workspaceTaskId)
|
|
33
|
+
return this.sessionsByTask.get(task.workspaceTaskId) ?? [];
|
|
34
|
+
// Archived legacy cards retain their old links; active membership uses the canonical column.
|
|
35
|
+
return task.status === "archived" ? this.storage.listWandTaskSessionIds(task.id)
|
|
36
|
+
.flatMap(id => this.sessionsById.get(id) ? [this.sessionsById.get(id)] : []) : [];
|
|
37
|
+
}
|
|
38
|
+
canArchive(task) {
|
|
39
|
+
return task.status !== "doing" && !this.taskSessions(task).some(isArchiveBlocked)
|
|
40
|
+
&& !this.activeTeamTasks.has(task.id) && !(task.workspaceTaskId && this.activeTeamTasks.has(task.workspaceTaskId));
|
|
41
|
+
}
|
|
42
|
+
milestone(id) {
|
|
43
|
+
const milestone = id ? this.milestones.find(value => value.id === id) : this.milestones.find(value => value.isDefault);
|
|
44
|
+
return { milestoneId: milestone?.id ?? null,
|
|
45
|
+
milestone: milestone ? { id: milestone.id, name: milestone.name, isDefault: milestone.isDefault } : null };
|
|
46
|
+
}
|
|
47
|
+
}
|
package/dist/task-retention.d.ts
CHANGED
package/dist/task-retention.js
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { WandStorage } from "./storage.js";
|
|
2
|
+
import type { WandConfig, ProcessEvent } from "./types.js";
|
|
3
|
+
import type { OpenRouterFreeModelsService } from "./openrouter-free-models.js";
|
|
4
|
+
import { generateWandTaskTitle } from "./task-title.js";
|
|
5
|
+
export interface AutoTaskTitleOptions {
|
|
6
|
+
config?: WandConfig;
|
|
7
|
+
free?: Pick<OpenRouterFreeModelsService, "resolveForCall">;
|
|
8
|
+
generateTitle?: typeof generateWandTaskTitle;
|
|
9
|
+
cwd?: string;
|
|
10
|
+
}
|
|
11
|
+
/** One owner per storage lifetime; mutation notifications, never GET, drive naming. */
|
|
12
|
+
export declare class TaskTitleService {
|
|
13
|
+
private storage;
|
|
14
|
+
private options;
|
|
15
|
+
private pending;
|
|
16
|
+
private flight;
|
|
17
|
+
private controller;
|
|
18
|
+
private disposed;
|
|
19
|
+
private unsubscribe;
|
|
20
|
+
constructor(storage: WandStorage, options?: AutoTaskTitleOptions);
|
|
21
|
+
ingest(event: ProcessEvent): void;
|
|
22
|
+
configure(options: AutoTaskTitleOptions): void;
|
|
23
|
+
refresh(options?: AutoTaskTitleOptions): void;
|
|
24
|
+
private drain;
|
|
25
|
+
dispose(): void;
|
|
26
|
+
}
|
|
27
|
+
export declare function taskTitleService(storage: WandStorage, options?: AutoTaskTitleOptions): TaskTitleService;
|
|
28
|
+
export declare function refreshAutoBoardTaskTitles(storage: WandStorage, options?: AutoTaskTitleOptions): void;
|
|
29
|
+
/** Compatibility/test wait, not a shared execution queue. */
|
|
30
|
+
export declare function whenWandTaskTitlesSettled(): Promise<void>;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { generateWandTaskTitle, provisionalTaskTitleFromDescription, TASK_TITLE_MAX_LENGTH } from "./task-title.js";
|
|
2
|
+
import { isAutoNameableBoardTask, taskAutoNameSignature, taskAutoNameSourceText } from "./wand-task-sync.js";
|
|
3
|
+
import { resolveSystemAiContext } from "./session-ai-context.js";
|
|
4
|
+
import { getErrorMessage } from "./error-utils.js";
|
|
5
|
+
const services = new WeakMap();
|
|
6
|
+
const flights = new Set();
|
|
7
|
+
/** One owner per storage lifetime; mutation notifications, never GET, drive naming. */
|
|
8
|
+
export class TaskTitleService {
|
|
9
|
+
storage;
|
|
10
|
+
options;
|
|
11
|
+
pending = new Map();
|
|
12
|
+
flight = null;
|
|
13
|
+
controller = new AbortController();
|
|
14
|
+
disposed = false;
|
|
15
|
+
unsubscribe;
|
|
16
|
+
constructor(storage, options = {}) {
|
|
17
|
+
this.storage = storage;
|
|
18
|
+
this.options = options;
|
|
19
|
+
this.unsubscribe = storage.onTaskTitleChange(() => this.refresh());
|
|
20
|
+
storage.onClose(() => this.dispose());
|
|
21
|
+
}
|
|
22
|
+
ingest(event) {
|
|
23
|
+
const data = event.data;
|
|
24
|
+
if (event.type === "started" || event.type === "ended" || (data && ("title" in data || "description" in data))) {
|
|
25
|
+
this.storage.notifyTaskTitleChange();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
configure(options) {
|
|
29
|
+
this.options = { ...this.options, ...options };
|
|
30
|
+
}
|
|
31
|
+
refresh(options = {}) {
|
|
32
|
+
if (this.disposed)
|
|
33
|
+
return;
|
|
34
|
+
this.configure(options);
|
|
35
|
+
for (const card of this.storage.listWandTasks()) {
|
|
36
|
+
if (!isAutoNameableBoardTask(card))
|
|
37
|
+
continue;
|
|
38
|
+
const source = taskAutoNameSourceText(this.storage, card);
|
|
39
|
+
if (!source)
|
|
40
|
+
continue;
|
|
41
|
+
const signature = taskAutoNameSignature(source);
|
|
42
|
+
if (card.autoTitleSignature === signature)
|
|
43
|
+
continue;
|
|
44
|
+
const title = provisionalTaskTitleFromDescription(source);
|
|
45
|
+
this.storage.updateWandTask(card.id, { titleSource: "auto", autoTitleSignature: signature,
|
|
46
|
+
...(title && title !== card.title ? { title } : {}) });
|
|
47
|
+
if (this.options.generateTitle || this.options.config)
|
|
48
|
+
this.pending.set(card.id, { source, signature });
|
|
49
|
+
}
|
|
50
|
+
if (this.flight || !this.pending.size)
|
|
51
|
+
return;
|
|
52
|
+
const flight = Promise.resolve().then(() => this.drain());
|
|
53
|
+
this.flight = flight;
|
|
54
|
+
flights.add(flight);
|
|
55
|
+
void flight.finally(() => { flights.delete(flight); if (this.flight === flight)
|
|
56
|
+
this.flight = null; }).catch(() => { });
|
|
57
|
+
}
|
|
58
|
+
async drain() {
|
|
59
|
+
while (!this.disposed && this.pending.size) {
|
|
60
|
+
const [id, input] = this.pending.entries().next().value;
|
|
61
|
+
this.pending.delete(id);
|
|
62
|
+
try {
|
|
63
|
+
const current = this.storage.getWandTask(id);
|
|
64
|
+
if (!current || current.titleSource !== "auto" || current.autoTitleSignature !== input.signature
|
|
65
|
+
|| !taskAutoNameSourceText(this.storage, current))
|
|
66
|
+
continue;
|
|
67
|
+
const { config, free, generateTitle = generateWandTaskTitle } = this.options;
|
|
68
|
+
const provider = config?.defaultProvider ?? "claude";
|
|
69
|
+
const ai = config ? resolveSystemAiContext({ provider, structuredState: undefined, runner: undefined,
|
|
70
|
+
command: provider === "qoder" ? "qodercli" : provider, selectedModel: null,
|
|
71
|
+
thinkingEffort: config.defaultThinkingEffort }, config, this.storage.getSystemSiliconEmployee(), free) : {};
|
|
72
|
+
const cwd = (current.workspaceId ? this.storage.getWorkspace(current.workspaceId)?.cwd : undefined) || this.options.cwd
|
|
73
|
+
|| config?.defaultCwd || process.cwd();
|
|
74
|
+
const title = await generateTitle(input.source, cwd, config?.language ?? "", { ...ai, signal: this.controller.signal });
|
|
75
|
+
if (this.disposed)
|
|
76
|
+
return;
|
|
77
|
+
const latest = this.storage.getWandTask(id);
|
|
78
|
+
if (!latest || latest.titleSource !== "auto" || latest.autoTitleSignature !== input.signature
|
|
79
|
+
|| !taskAutoNameSourceText(this.storage, latest))
|
|
80
|
+
continue;
|
|
81
|
+
const clipped = title.slice(0, TASK_TITLE_MAX_LENGTH);
|
|
82
|
+
if (clipped && clipped !== latest.title)
|
|
83
|
+
this.storage.updateWandTask(id, { title: clipped });
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
if (!this.disposed)
|
|
87
|
+
console.error(`[WandTask] Failed to auto-generate title for ${id}:`, getErrorMessage(error));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
dispose() {
|
|
92
|
+
if (this.disposed)
|
|
93
|
+
return;
|
|
94
|
+
this.disposed = true;
|
|
95
|
+
this.pending.clear();
|
|
96
|
+
this.unsubscribe();
|
|
97
|
+
this.controller.abort();
|
|
98
|
+
if (this.flight)
|
|
99
|
+
flights.delete(this.flight);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
export function taskTitleService(storage, options = {}) {
|
|
103
|
+
let service = services.get(storage);
|
|
104
|
+
if (!service) {
|
|
105
|
+
service = new TaskTitleService(storage, options);
|
|
106
|
+
services.set(storage, service);
|
|
107
|
+
}
|
|
108
|
+
else
|
|
109
|
+
service.configure(options);
|
|
110
|
+
return service;
|
|
111
|
+
}
|
|
112
|
+
export function refreshAutoBoardTaskTitles(storage, options = {}) {
|
|
113
|
+
taskTitleService(storage, options).refresh(options);
|
|
114
|
+
}
|
|
115
|
+
/** Compatibility/test wait, not a shared execution queue. */
|
|
116
|
+
export async function whenWandTaskTitlesSettled() {
|
|
117
|
+
await Promise.resolve();
|
|
118
|
+
while (flights.size) {
|
|
119
|
+
await Promise.all([...flights]);
|
|
120
|
+
await Promise.resolve();
|
|
121
|
+
}
|
|
122
|
+
}
|
package/dist/task-title.d.ts
CHANGED
package/dist/task-title.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from "node:fs";
|
|
2
2
|
import net from "node:net";
|
|
3
|
+
import { probeUnixSocket as probeSocket } from "./socket-probe.js";
|
|
3
4
|
import { spawn } from "node:child_process";
|
|
4
5
|
import process from "node:process";
|
|
5
6
|
import { StringDecoder } from "node:string_decoder";
|
|
@@ -811,24 +812,6 @@ export async function connectExistingTerminalHost(configPath) {
|
|
|
811
812
|
const paths = terminalDaemonPaths(configPath);
|
|
812
813
|
return tryConnect(paths.socketPath, paths.tokenPath);
|
|
813
814
|
}
|
|
814
|
-
function probeSocket(socketPath) {
|
|
815
|
-
return new Promise((resolve) => {
|
|
816
|
-
const socket = net.createConnection(socketPath);
|
|
817
|
-
let settled = false;
|
|
818
|
-
const finish = (alive) => {
|
|
819
|
-
if (settled)
|
|
820
|
-
return;
|
|
821
|
-
settled = true;
|
|
822
|
-
clearTimeout(timer);
|
|
823
|
-
socket.destroy();
|
|
824
|
-
resolve(alive);
|
|
825
|
-
};
|
|
826
|
-
socket.once("connect", () => finish(true));
|
|
827
|
-
socket.once("error", () => finish(false));
|
|
828
|
-
const timer = setTimeout(() => finish(false), 300);
|
|
829
|
-
timer.unref?.();
|
|
830
|
-
});
|
|
831
|
-
}
|
|
832
815
|
function startDetachedDaemon(configPath) {
|
|
833
816
|
const entry = process.argv[1];
|
|
834
817
|
if (!entry || !existsSync(entry))
|
package/dist/user-memory.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { DEFAULT_EMPLOYEE_ID } from "./ai-team-types.js";
|
|
3
3
|
import { explicitEmployeeMemoryContent } from "./employee-knowledge-content.js";
|
|
4
|
-
import { callConfiguredAiText } from "./
|
|
4
|
+
import { callConfiguredAiText } from "./ai-text-runner.js";
|
|
5
5
|
import { resolveSystemAiContext } from "./session-ai-context.js";
|
|
6
6
|
import { USER_MEMORY_CATEGORIES, USER_MEMORY_REFRESH_MS, USER_MEMORY_RETENTION_MS, USER_MEMORY_TEXT_MAX_CHARS, } from "./user-memory-types.js";
|
|
7
7
|
/** Defense in depth, not a promise that arbitrary secrets can always be recognized. */
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
var __wandBrowserRuntime: {
|
|
3
|
+
configPath: string;
|
|
4
|
+
aiTeamsChunkSrc: string;
|
|
5
|
+
plushAvatarChunkSrc: string;
|
|
6
|
+
} | undefined;
|
|
7
|
+
}
|
|
8
|
+
export declare const browserAssetRuntime: {
|
|
9
|
+
configPath: string;
|
|
10
|
+
aiTeamsChunkSrc: string;
|
|
11
|
+
plushAvatarChunkSrc: string;
|
|
12
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Literal fallbacks keep standalone component harnesses and legacy builds usable.
|
|
2
|
+
export const browserAssetRuntime = globalThis.__wandBrowserRuntime ?? {
|
|
3
|
+
configPath: "${wandConfigPath}",
|
|
4
|
+
aiTeamsChunkSrc: "${aiTeamsChunkSrc}",
|
|
5
|
+
plushAvatarChunkSrc: "${plushAvatarChunkSrc}",
|
|
6
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ConversationTurn } from "../types.js";
|
|
2
|
+
import { type RunningActivityShape } from "./running-activity.js";
|
|
3
|
+
export type AvatarFileActivity = "idle" | "reading" | "writing";
|
|
4
|
+
/** Project only unfinished file tools in the current turn. Results retire their
|
|
5
|
+
* own invocation, including errors; a concurrent older tool can remain active. */
|
|
6
|
+
export declare function composerAvatarActivity(activity: RunningActivityShape | undefined, messages?: readonly ConversationTurn[]): AvatarFileActivity;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { computeRunningPhase } from "./running-activity.js";
|
|
2
|
+
/** Project only unfinished file tools in the current turn. Results retire their
|
|
3
|
+
* own invocation, including errors; a concurrent older tool can remain active. */
|
|
4
|
+
export function composerAvatarActivity(activity, messages = []) {
|
|
5
|
+
if (computeRunningPhase(activity) !== "executing")
|
|
6
|
+
return "idle";
|
|
7
|
+
let start = messages.length - 1;
|
|
8
|
+
while (start >= 0 && messages[start].role !== "user")
|
|
9
|
+
start--;
|
|
10
|
+
const calls = new Map();
|
|
11
|
+
const completed = new Set();
|
|
12
|
+
for (let index = start + 1; index < messages.length; index++) {
|
|
13
|
+
const message = messages[index];
|
|
14
|
+
for (const block of message.content ?? []) {
|
|
15
|
+
if (block.__subagent)
|
|
16
|
+
continue;
|
|
17
|
+
if (block.type === "tool_result")
|
|
18
|
+
completed.add(block.tool_use_id);
|
|
19
|
+
if (block.type !== "tool_use" || message.completedAt)
|
|
20
|
+
continue;
|
|
21
|
+
const kind = block.activity?.kind;
|
|
22
|
+
if (kind === "read_file" || kind === "edit_file") {
|
|
23
|
+
// Duplicate snapshots update the same invocation without reordering it.
|
|
24
|
+
calls.set(block.id, kind === "read_file" ? "reading" : "writing");
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return [...calls].reverse().find(([id]) => !completed.has(id))?.[1] ?? "idle";
|
|
29
|
+
}
|