@co0ontty/wand 4.94.0 → 4.95.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 +4 -1
- package/dist/ai-text-runner.d.ts +4 -0
- package/dist/ai-text-runner.js +44 -4
- package/dist/build-info.json +3 -3
- package/dist/cli-api.d.ts +1 -0
- package/dist/cli-api.js +7 -2
- package/dist/cli.js +47 -0
- package/dist/conversation-execution-preference.d.ts +7 -0
- package/dist/conversation-execution-preference.js +26 -0
- package/dist/conversation-organize-contract.d.ts +70 -0
- package/dist/conversation-organize-contract.js +1 -0
- package/dist/conversation-organize-service.d.ts +46 -0
- package/dist/conversation-organize-service.js +505 -0
- package/dist/conversation-organize.d.ts +41 -0
- package/dist/conversation-organize.js +97 -0
- package/dist/conversation-service.d.ts +2 -1
- package/dist/conversation-service.js +10 -4
- package/dist/core-turn-tracker.d.ts +5 -1
- package/dist/core-turn-tracker.js +17 -1
- package/dist/decision-expert-service.d.ts +2 -0
- package/dist/decision-expert-service.js +17 -1
- package/dist/decision-skill.d.ts +0 -1
- package/dist/decision-skill.js +5 -64
- package/dist/deployment-lock.js +4 -1
- package/dist/employee-im-config.d.ts +17 -0
- package/dist/employee-im-config.js +85 -0
- package/dist/employee-im-lifecycle.d.ts +35 -0
- package/dist/employee-im-lifecycle.js +168 -0
- package/dist/employee-im-types.d.ts +80 -0
- package/dist/employee-im-types.js +32 -0
- package/dist/employee-im.d.ts +35 -0
- package/dist/employee-im.js +157 -0
- package/dist/employee-knowledge.js +3 -2
- package/dist/employee-text.d.ts +1 -0
- package/dist/employee-text.js +28 -13
- package/dist/git-quick-commit.js +21 -3
- package/dist/managed-skill.d.ts +6 -0
- package/dist/managed-skill.js +99 -0
- package/dist/model-auto-assign.js +1 -1
- package/dist/process-manager.js +1 -1
- package/dist/prompt-optimizer.js +1 -1
- package/dist/scheduled-task-activity.d.ts +16 -0
- package/dist/scheduled-task-activity.js +42 -0
- package/dist/scheduled-task-agenda.d.ts +20 -0
- package/dist/scheduled-task-agenda.js +82 -0
- package/dist/scheduled-task-calendar.d.ts +37 -0
- package/dist/scheduled-task-calendar.js +131 -0
- package/dist/scheduled-task-read-range.d.ts +7 -0
- package/dist/scheduled-task-read-range.js +35 -0
- package/dist/scheduled-task-service.d.ts +6 -1
- package/dist/scheduled-task-service.js +61 -1
- package/dist/scheduled-task-state.d.ts +1 -1
- package/dist/scheduled-task-types.d.ts +38 -0
- package/dist/server-asset-routes.js +3 -2
- package/dist/server-conversation-organize-routes.d.ts +4 -0
- package/dist/server-conversation-organize-routes.js +75 -0
- package/dist/server-conversation-routes.js +2 -1
- package/dist/server-employee-im-routes.d.ts +9 -0
- package/dist/server-employee-im-routes.js +40 -0
- package/dist/server-employee-routes.js +1 -1
- package/dist/server-scheduled-task-routes.js +24 -0
- package/dist/server-session-lifecycle-routes.js +8 -3
- package/dist/server-session-routes.js +18 -0
- package/dist/server-session-worktree-routes.js +3 -3
- package/dist/server-workspace-routes.d.ts +3 -0
- package/dist/server-workspace-routes.js +14 -1
- package/dist/server.js +39 -5
- package/dist/session-ai-context.d.ts +11 -1
- package/dist/session-ai-context.js +21 -2
- package/dist/session-metadata-service.js +1 -1
- package/dist/session-registry.js +6 -0
- package/dist/session-request.js +3 -0
- package/dist/session-topic.js +1 -1
- package/dist/silicon-employee-draft.js +1 -1
- package/dist/speech-polisher-service.d.ts +2 -0
- package/dist/speech-polisher-service.js +28 -6
- package/dist/storage/conversation-organization-repository.d.ts +13 -0
- package/dist/storage/conversation-organization-repository.js +33 -0
- package/dist/storage/migrations.js +10 -0
- package/dist/storage/secrets-repository.d.ts +7 -0
- package/dist/storage/secrets-repository.js +28 -1
- package/dist/storage/tasks-repository.js +4 -0
- package/dist/storage-schedules.d.ts +8 -1
- package/dist/storage-schedules.js +24 -0
- package/dist/storage-schema.js +9 -0
- package/dist/storage.d.ts +6 -1
- package/dist/storage.js +13 -0
- package/dist/structured-session-manager.d.ts +1 -0
- package/dist/structured-session-manager.js +18 -4
- package/dist/system-ai-call.d.ts +49 -0
- package/dist/system-ai-call.js +28 -0
- package/dist/system-ai-session-recorder.d.ts +30 -0
- package/dist/system-ai-session-recorder.js +239 -0
- package/dist/system-cli.d.ts +6 -0
- package/dist/system-cli.js +93 -0
- package/dist/system-skill.d.ts +5 -0
- package/dist/system-skill.js +19 -0
- package/dist/task-organize-contract.js +2 -2
- package/dist/task-title-organize-service.d.ts +1 -1
- package/dist/task-title-organize-service.js +9 -5
- package/dist/task-title-organize.js +13 -6
- package/dist/task-title-service.js +1 -1
- package/dist/task-title.js +1 -1
- package/dist/user-memory.js +1 -1
- package/dist/wand-task-sync.js +2 -1
- package/dist/web-ui/content/ai-teams.js +12 -12
- package/dist/web-ui/content/module-manifest.json +1 -1
- package/dist/web-ui/content/modules/{0051bd3d55f10ab7/library-bridge-DTMQIHVJ.js → 09842858f9d34a4e/library-bridge.js} +2 -2
- package/dist/web-ui/content/modules/1021ae40c5761e3f/sha256.js +1 -0
- package/dist/web-ui/content/modules/134f6120c0acaf57/host.js +1 -0
- package/dist/web-ui/content/modules/1d518ae6ed66fe5a/chunk.js +3 -0
- package/dist/web-ui/content/modules/1f93b5bd70381bb6/runtime.js +539 -0
- package/dist/web-ui/content/modules/26c68d4decdd18b4/markdown.js +1 -0
- package/dist/web-ui/content/modules/2ed8bafd5b4fecc5/workspace-window.js +1 -0
- package/dist/web-ui/content/modules/31ffc2f05f87652c/host.js +1 -0
- package/dist/web-ui/content/modules/35aaa85b9d0937af/chunk.js +20 -0
- package/dist/web-ui/content/modules/3664d0620f124292/chunk.js +3 -0
- package/dist/web-ui/content/modules/3cea480770cb184c/chunk.js +1 -0
- package/dist/web-ui/content/modules/3d12adf54647c1e2/host-bridge.js +1 -0
- package/dist/web-ui/content/modules/459cca2482a9a4ba/host.js +18 -0
- package/dist/web-ui/content/modules/474c9647130ef3e9/task-board-host.js +2 -0
- package/dist/web-ui/content/modules/4f74d2517f29134c/chunk.js +15 -0
- package/dist/web-ui/content/modules/52a218d74002a011/host.js +30 -0
- package/dist/web-ui/content/modules/54f2b10659ef8475/employee-card.js +1 -0
- package/dist/web-ui/content/modules/703fb1c670f7b199/chunk.js +1 -0
- package/dist/web-ui/content/modules/75511da23f051718/host.js +1 -0
- package/dist/web-ui/content/modules/{0051bd3d55f10ab7/host-2IVIZ2YC.js → 799b19da948bec8d/host.js} +3 -2
- package/dist/web-ui/content/modules/{0051bd3d55f10ab7/host-XNIR3NTJ.js → 7ef73b6c20d2504f/host.js} +3 -2
- package/dist/web-ui/content/modules/8f8f7a0a8874d29a/host.js +1 -0
- package/dist/web-ui/content/modules/90f2cd73cdf3a2cd/chat-render.js +25 -0
- package/dist/web-ui/content/modules/9510efce6caaa9ec/chunk.js +1 -0
- package/dist/web-ui/content/modules/9a0e65188739957f/chunk.js +67 -0
- package/dist/web-ui/content/modules/9eae1033f47e4526/host.js +1 -0
- package/dist/web-ui/content/modules/a2c5b246e57fa165/panel.js +1 -0
- package/dist/web-ui/content/modules/a50ce28f45bfeb2e/host.js +1 -0
- package/dist/web-ui/content/modules/adfc53789d5bedb2/chunk.js +1 -0
- package/dist/web-ui/content/modules/bcecb0cc14b7d2bd/chunk.js +1 -0
- package/dist/web-ui/content/modules/c4706f47c23f33e4/host.js +1 -0
- package/dist/web-ui/content/modules/{0051bd3d55f10ab7/host-Q524TMSR.js → c7de873095c061ab/host.js} +4 -3
- package/dist/web-ui/content/modules/d789f84a3f8765ae/page.js +6 -0
- package/dist/web-ui/content/modules/db4e2dbc7aed6353/chunk.js +1 -0
- package/dist/web-ui/content/modules/e4fd9906521b4aa3/chunk.js +1 -0
- package/dist/web-ui/content/modules/eb95c3ee0d42827a/chunk.js +6 -0
- package/dist/web-ui/content/modules/{0051bd3d55f10ab7/host-PHHNGVNL.js → ec68d93a95c1d5d6/host.js} +2 -2
- package/dist/web-ui/content/modules/f33ed89d1ccd3a2d/chunk.js +1 -0
- package/dist/web-ui/content/modules/f6502dab121f9d91/chunk.js +1 -0
- package/dist/web-ui/content/modules/fac83e61c0a8c8a7/host.js +1 -0
- package/dist/web-ui/content/scripts.js +1 -1
- package/dist/web-ui/embedded-assets.d.ts +200 -27
- package/dist/web-ui/embedded-assets.js +5 -4
- package/dist/web-ui/react/workspaces/sidebar-manage.d.ts +5 -0
- package/dist/web-ui/react/workspaces/sidebar-manage.js +27 -3
- package/dist/web-ui/running-activity.d.ts +22 -9
- package/dist/web-ui/running-activity.js +58 -42
- package/dist/web-ui/running-current-action.d.ts +12 -0
- package/dist/web-ui/running-current-action.js +74 -0
- package/dist/web-ui/scripts.d.ts +4 -0
- package/dist/web-ui/scripts.js +17 -8
- package/package.json +4 -2
- package/scripts/recover-web-update.mjs +26 -19
- package/scripts/recover-web-update.sh +9 -6
- package/scripts/update-node.sh +3 -1
- package/skills/wand-system/SKILL.md +69 -0
- package/skills/wand-system/references/operations.md +100 -0
- package/skills/wand-system/scripts/wand.mjs +34 -0
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/chat-render-RY2I2CF3.js +0 -24
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/chunk-2F6J2MKX.js +0 -1
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/chunk-6C6A2RHG.js +0 -1
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/chunk-7AFM245W.js +0 -1
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/chunk-ECWYA3U5.js +0 -1
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/chunk-MHX2QXIS.js +0 -111
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/chunk-RAAPETNH.js +0 -1
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/chunk-RXKBHYUR.js +0 -38
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/chunk-T35D57FW.js +0 -1
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/chunk-U4EDP4TI.js +0 -1
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/chunk-WHXQR7JT.js +0 -20
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/chunk-YOXXNXOX.js +0 -2
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/chunk-YQJ6XYV7.js +0 -1
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/employee-card-NV34TZIH.js +0 -1
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/host-2AQAIUNO.js +0 -1
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/host-AZXNFCRW.js +0 -1
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/host-EPEQX22R.js +0 -1
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/host-FZYIMOLC.js +0 -1
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/host-G6GL4SNL.js +0 -1
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/host-PEILC5NU.js +0 -1
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/host-RO5MB6RB.js +0 -69
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/host-WOQRK6NG.js +0 -1
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/host-XRVOIEP6.js +0 -1
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/host-ZDKOQEMS.js +0 -1
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/host-bridge-PMQZRG5G.js +0 -1
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/page-PY4JUL4W.js +0 -3
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/panel-BBQFC55Q.js +0 -1
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/runtime.js +0 -974
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/sha256-ANXV72UC.js +0 -1
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/task-board-host-PXZSWBBG.js +0 -2
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/workspace-agent-picker-DJSECSY6.js +0 -1
- package/dist/web-ui/content/modules/0051bd3d55f10ab7/workspace-window-MNMKSOBG.js +0 -1
package/README.md
CHANGED
|
@@ -73,7 +73,10 @@ and `beta`, including a stable release that supersedes its prerelease. Installin
|
|
|
73
73
|
keeps the Beta subscription enabled. Updates pin the checked version, wait for Core turns,
|
|
74
74
|
and restart only the Web service. If an old updater cannot run, rerun `install.sh` for a
|
|
75
75
|
staged recovery that preserves the previous installation and service scope. Node.js must
|
|
76
|
-
meet the new package's requirement.
|
|
76
|
+
meet the new package's requirement. The runtime minimum is **Node.js 22.19.0**;
|
|
77
|
+
maintained even-numbered LTS releases are recommended (22.x / 24.x, with 26.x
|
|
78
|
+
also checked for compatibility). `.nvmrc` pins reproducible builds, not the
|
|
79
|
+
installation minimum. See [Web update and recovery](docs/web-updates.md).
|
|
77
80
|
|
|
78
81
|
### Configuration
|
|
79
82
|
|
package/dist/ai-text-runner.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type EmployeeTextDeps } from "./employee-text.js";
|
|
2
|
+
import { type AiCallTraceFactory, type SystemAiPurpose } from "./system-ai-call.js";
|
|
2
3
|
import type { AiTextRequest, SessionProvider, SessionSnapshot } from "./types.js";
|
|
3
4
|
export { QuickCommitError } from "./command-error.js";
|
|
4
5
|
/** Neutral one-shot text execution. Tool-running Git fallback never uses the retry chain. */
|
|
@@ -20,6 +21,9 @@ export interface QuickCommitAiOptions {
|
|
|
20
21
|
/** 整条候选链的时间上限;默认 CLI_CHAIN_BUDGET_MS。第一条消息里的调用要短得多。 */
|
|
21
22
|
budgetMs?: number;
|
|
22
23
|
signal?: AbortSignal;
|
|
24
|
+
purpose?: SystemAiPurpose;
|
|
25
|
+
traceFactory?: AiCallTraceFactory;
|
|
26
|
+
onCallSessionCreated?(sessionId: string): void;
|
|
23
27
|
}
|
|
24
28
|
type CliAiTextOptions = QuickCommitAiOptions & {
|
|
25
29
|
deadline?: number;
|
package/dist/ai-text-runner.js
CHANGED
|
@@ -10,6 +10,7 @@ import { getGitErrorMessage } from "./git-utils.js";
|
|
|
10
10
|
import { buildLanguageDirective } from "./language-prompt.js";
|
|
11
11
|
import { candidateInstalled, isSessionProvider } from "./session-provider.js";
|
|
12
12
|
import { asRecord } from "./structured-content.js";
|
|
13
|
+
import { AiCallTraceError } from "./system-ai-call.js";
|
|
13
14
|
import { composeSystemFallback, systemPromptFlag, thinkingEffortToClaudeCliEffort, thinkingEffortToCodexReasoningEffort, thinkingEffortToGrokEffort, thinkingEffortToOpenCodeVariant, thinkingEffortToPiLevel, thinkingEffortToQoderEffort } from "./structured-provider-common.js";
|
|
14
15
|
export { QuickCommitError } from "./command-error.js";
|
|
15
16
|
const CLAUDE_MESSAGE_TIMEOUT_MS = 60_000;
|
|
@@ -521,7 +522,7 @@ function singleCandidate(opts) {
|
|
|
521
522
|
* 只有一条候选时保持原行为(错误原样抛出,不摘要)。
|
|
522
523
|
* 仅用于一次性文本生成;执行工具的任务不能使用这条无条件重试路径。
|
|
523
524
|
*/
|
|
524
|
-
async function callTextCandidates(request, cwd, language, opts, parseOutput) {
|
|
525
|
+
async function callTextCandidates(request, cwd, language, opts, parseOutput, trace) {
|
|
525
526
|
opts.signal?.throwIfAborted();
|
|
526
527
|
const { resolveModelGroupModels } = await import("./model-groups.js");
|
|
527
528
|
const modelGroups = opts.modelGroups ?? opts.employeeText?.config.modelGroups;
|
|
@@ -549,6 +550,8 @@ async function callTextCandidates(request, cwd, language, opts, parseOutput) {
|
|
|
549
550
|
try {
|
|
550
551
|
const generate = await abortableEmployeeText(prepareEmployeeTextCandidate({
|
|
551
552
|
...opts.employeeText,
|
|
553
|
+
callSessionId: trace?.sessionId,
|
|
554
|
+
onUsage: usage => { opts.employeeText?.onUsage?.(usage); trace?.usageReported(usage); },
|
|
552
555
|
config: { ...opts.employeeText?.config, defaultCwd: cwd, inheritEnv: opts.inheritEnv ?? opts.employeeText?.config.inheritEnv, modelGroups },
|
|
553
556
|
}, { ...candidate, model: candidate.model ?? "default", thinkingEffort: candidate.thinkingEffort ?? opts.thinkingEffort ?? "off", mode: "default", kind: "structured" }, request, signal), signal);
|
|
554
557
|
signal.throwIfAborted();
|
|
@@ -558,9 +561,28 @@ async function callTextCandidates(request, cwd, language, opts, parseOutput) {
|
|
|
558
561
|
clearTimeout(timer);
|
|
559
562
|
}
|
|
560
563
|
};
|
|
561
|
-
if (chain.length === 1)
|
|
562
|
-
|
|
564
|
+
if (chain.length === 1) {
|
|
565
|
+
const candidate = chain[0];
|
|
566
|
+
trace?.candidateStarted({ ...candidate, thinkingEffort: candidate.thinkingEffort ?? opts.thinkingEffort ?? undefined });
|
|
567
|
+
let phase = "execution";
|
|
568
|
+
try {
|
|
569
|
+
const raw = await call(candidate);
|
|
570
|
+
phase = "result";
|
|
571
|
+
const parsed = await parseOutput(raw);
|
|
572
|
+
trace?.candidateSucceeded(raw, parsed);
|
|
573
|
+
return parsed;
|
|
574
|
+
}
|
|
575
|
+
catch (error) {
|
|
576
|
+
trace?.candidateFailed(candidate, error, phase);
|
|
577
|
+
throw error;
|
|
578
|
+
}
|
|
579
|
+
}
|
|
563
580
|
const installed = chain.filter((candidate) => candidateInstalled(candidate));
|
|
581
|
+
if (installed.length)
|
|
582
|
+
for (const candidate of chain) {
|
|
583
|
+
if (!installed.includes(candidate))
|
|
584
|
+
trace?.candidateSkipped(candidate, "CLI 未安装,未提交输入。");
|
|
585
|
+
}
|
|
564
586
|
const attempts = installed.length ? installed : chain;
|
|
565
587
|
const errors = [];
|
|
566
588
|
for (const candidate of attempts) {
|
|
@@ -569,15 +591,22 @@ async function callTextCandidates(request, cwd, language, opts, parseOutput) {
|
|
|
569
591
|
errors.push("已超过等待上限");
|
|
570
592
|
break;
|
|
571
593
|
}
|
|
594
|
+
trace?.candidateStarted({ ...candidate, thinkingEffort: candidate.thinkingEffort ?? opts.thinkingEffort ?? undefined });
|
|
595
|
+
let phase = "execution";
|
|
572
596
|
try {
|
|
573
597
|
const text = await call(candidate);
|
|
598
|
+
phase = "result";
|
|
574
599
|
const result = await parseOutput(text);
|
|
600
|
+
trace?.candidateSucceeded(text, result);
|
|
575
601
|
if (candidate !== attempts[0]) {
|
|
576
602
|
console.info(`[SystemAi] 候选 ${chain.indexOf(candidate) + 1}/${chain.length} (${candidate.provider}) 成功`);
|
|
577
603
|
}
|
|
578
604
|
return result;
|
|
579
605
|
}
|
|
580
606
|
catch (error) {
|
|
607
|
+
if (error instanceof AiCallTraceError)
|
|
608
|
+
throw error;
|
|
609
|
+
trace?.candidateFailed(candidate, error, phase);
|
|
581
610
|
opts.signal?.throwIfAborted();
|
|
582
611
|
errors.push(`${candidate.provider}: ${getGitErrorMessage(error)}`);
|
|
583
612
|
// 不记录提示词、路径、CLI 原始响应或可能带鉴权信息的错误正文。
|
|
@@ -588,5 +617,16 @@ async function callTextCandidates(request, cwd, language, opts, parseOutput) {
|
|
|
588
617
|
throw new QuickCommitError(`所有执行候选均失败:${errors.join(";")}`, "AI_FALLBACK_FAILED");
|
|
589
618
|
}
|
|
590
619
|
export async function callConfiguredAiText(request, cwd, language, opts, parseOutput = (raw) => raw) {
|
|
591
|
-
|
|
620
|
+
const trace = opts.traceFactory?.start(opts.purpose ?? "system-text", request, cwd);
|
|
621
|
+
try {
|
|
622
|
+
if (trace)
|
|
623
|
+
opts.onCallSessionCreated?.(trace.sessionId);
|
|
624
|
+
const result = await callTextCandidates(withOpsPersona(request, opts.opsPersona), cwd, language, opts, parseOutput, trace);
|
|
625
|
+
trace?.complete();
|
|
626
|
+
return result;
|
|
627
|
+
}
|
|
628
|
+
catch (error) {
|
|
629
|
+
trace?.fail(error, opts.signal?.aborted === true);
|
|
630
|
+
throw error;
|
|
631
|
+
}
|
|
592
632
|
}
|
package/dist/build-info.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"commit": "
|
|
3
|
-
"builtAt": "2026-10-
|
|
4
|
-
"version": "4.
|
|
2
|
+
"commit": "befb8fac24ba328a50e08d27ef6bf0e87c29515d",
|
|
3
|
+
"builtAt": "2026-10-15T20:12:59.388Z",
|
|
4
|
+
"version": "4.95.0",
|
|
5
5
|
"channel": "stable"
|
|
6
6
|
}
|
package/dist/cli-api.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export declare class WandCliApi {
|
|
|
5
5
|
constructor(config: WandConfig);
|
|
6
6
|
get<T>(pathname: string): Promise<T>;
|
|
7
7
|
post<T>(pathname: string, body: unknown): Promise<T>;
|
|
8
|
+
patch<T>(pathname: string, body: unknown): Promise<T>;
|
|
8
9
|
del<T>(pathname: string): Promise<T>;
|
|
9
10
|
private login;
|
|
10
11
|
private request;
|
package/dist/cli-api.js
CHANGED
|
@@ -12,6 +12,9 @@ export class WandCliApi {
|
|
|
12
12
|
async post(pathname, body) {
|
|
13
13
|
return this.request("POST", pathname, body);
|
|
14
14
|
}
|
|
15
|
+
async patch(pathname, body) {
|
|
16
|
+
return this.request("PATCH", pathname, body);
|
|
17
|
+
}
|
|
15
18
|
async del(pathname) {
|
|
16
19
|
return this.request("DELETE", pathname);
|
|
17
20
|
}
|
|
@@ -31,12 +34,14 @@ export class WandCliApi {
|
|
|
31
34
|
try {
|
|
32
35
|
parsed = result.body ? JSON.parse(result.body) : {};
|
|
33
36
|
}
|
|
34
|
-
catch {
|
|
37
|
+
catch {
|
|
38
|
+
throw new Error(`Wand 响应不是有效 JSON (HTTP ${result.status});${method === "GET" ? "无法确认结果。" : "请求可能已接受,请回读核对,不要重复提交。"}`);
|
|
39
|
+
}
|
|
35
40
|
const error = parsed && typeof parsed === "object" && "error" in parsed && typeof parsed.error === "string"
|
|
36
41
|
? parsed.error
|
|
37
42
|
: null;
|
|
38
43
|
if (result.status < 200 || result.status >= 300 || error) {
|
|
39
|
-
throw new Error(
|
|
44
|
+
throw new Error(`Wand 请求失败 (HTTP ${result.status})${error ? `:${error}` : ""}`);
|
|
40
45
|
}
|
|
41
46
|
return parsed;
|
|
42
47
|
}
|
package/dist/cli.js
CHANGED
|
@@ -197,6 +197,44 @@ async function main() {
|
|
|
197
197
|
}
|
|
198
198
|
break;
|
|
199
199
|
}
|
|
200
|
+
case "employee:list":
|
|
201
|
+
case "workspace:list":
|
|
202
|
+
case "session:create":
|
|
203
|
+
case "session:resume":
|
|
204
|
+
case "schedule:list":
|
|
205
|
+
case "schedule:read":
|
|
206
|
+
case "schedule:create":
|
|
207
|
+
case "schedule:update": {
|
|
208
|
+
const { parseSystemCliCommand } = await import("./system-cli.js");
|
|
209
|
+
const operationArgs = args.slice(1);
|
|
210
|
+
for (const flag of ["-c", "--config"]) {
|
|
211
|
+
const index = operationArgs.indexOf(flag);
|
|
212
|
+
if (index !== -1) {
|
|
213
|
+
if (!operationArgs[index + 1] || operationArgs[index + 1].startsWith("-"))
|
|
214
|
+
throw new Error("配置路径缺失。");
|
|
215
|
+
operationArgs.splice(index, 2);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
const operation = await parseSystemCliCommand(command, operationArgs);
|
|
219
|
+
const { config } = await loadConfigForCli(configPath);
|
|
220
|
+
process.stdout.write(`${JSON.stringify(await operation(new WandCliApi(config)), null, 2)}\n`);
|
|
221
|
+
break;
|
|
222
|
+
}
|
|
223
|
+
case "system:skills": {
|
|
224
|
+
for (let index = 1; index < args.length; index += 2) {
|
|
225
|
+
if (!["--providers", "--config", "-c"].includes(args[index])
|
|
226
|
+
|| !args[index + 1] || args[index + 1].startsWith("-")) {
|
|
227
|
+
throw new Error("用法:wand system:skills [--providers pi,claude,...] [-c <config-path>]");
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
const { installSystemSkill } = await import("./system-skill.js");
|
|
231
|
+
const { SESSION_PROVIDERS } = await import("./provider-catalog.js");
|
|
232
|
+
const selected = readFlagValue(args, "--providers")?.split(",") ?? [...SESSION_PROVIDERS];
|
|
233
|
+
if (selected.some(provider => !SESSION_PROVIDERS.includes(provider)))
|
|
234
|
+
throw new Error("未知CLI技能目标。");
|
|
235
|
+
process.stdout.write(`${JSON.stringify(await installSystemSkill(configPath, selected))}\n`);
|
|
236
|
+
break;
|
|
237
|
+
}
|
|
200
238
|
case "session:list":
|
|
201
239
|
case "session:read":
|
|
202
240
|
case "session:send":
|
|
@@ -313,6 +351,15 @@ Commands:
|
|
|
313
351
|
wand storage:cleanup [--apply] Inspect/reclaim abandoned Wand runtime storage
|
|
314
352
|
|
|
315
353
|
Agent runtime:
|
|
354
|
+
wand system:skills [--providers pi,claude,...] Install the managed wand-system skill
|
|
355
|
+
wand employee:list [--include-archived] List employee definitions (not private knowledge)
|
|
356
|
+
wand workspace:list List project directories
|
|
357
|
+
wand session:create --stdin Create an employee session from JSON
|
|
358
|
+
wand session:resume <id> --stdin Continue the exact structured session with JSON input
|
|
359
|
+
wand schedule:list [--include-cancelled]
|
|
360
|
+
wand schedule:read <id> Read schedule and execution history
|
|
361
|
+
wand schedule:create --stdin Create a schedule from JSON (requestId required)
|
|
362
|
+
wand schedule:update <id> --stdin Edit/pause/cancel (revision required)
|
|
316
363
|
wand session:list List sessions as JSON
|
|
317
364
|
wand inbox:list List mission inbox items as JSON
|
|
318
365
|
wand session:read <id> Read a complete session snapshot
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SiliconEmployee } from "./ai-team-types.js";
|
|
2
|
+
import { type WandTaskAgent } from "./task-types.js";
|
|
3
|
+
/** Request-local only: never saved to the employee or used to mutate an existing run. */
|
|
4
|
+
export type ConversationExecutionPreference = Pick<WandTaskAgent, "provider" | "engine" | "model" | "thinkingEffort">;
|
|
5
|
+
export declare function parseConversationExecutionPreference(value: unknown): ConversationExecutionPreference | undefined;
|
|
6
|
+
/** Manual selection is a single explicit candidate, not an implicit paid/fallback chain. */
|
|
7
|
+
export declare function withConversationExecutionPreference(employee: SiliconEmployee, preference: ConversationExecutionPreference): SiliconEmployee;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { isSessionProvider } from "./provider-catalog.js";
|
|
2
|
+
import { isThinkingEffort } from "./structured-provider-common.js";
|
|
3
|
+
import { normalizeWandTaskAgentMode } from "./task-types.js";
|
|
4
|
+
export function parseConversationExecutionPreference(value) {
|
|
5
|
+
if (value === undefined)
|
|
6
|
+
return undefined;
|
|
7
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
8
|
+
throw new Error("临时执行配置无效。");
|
|
9
|
+
const body = value;
|
|
10
|
+
if (!isSessionProvider(body.provider) || (body.engine !== undefined && body.engine !== "cli" && body.engine !== "sdk")
|
|
11
|
+
|| (body.engine === "sdk" && body.provider !== "pi"))
|
|
12
|
+
throw new Error("临时执行工具无效。");
|
|
13
|
+
if (typeof body.model !== "string" || !body.model.trim() || body.model.length > 128)
|
|
14
|
+
throw new Error("临时模型无效。");
|
|
15
|
+
if (!isThinkingEffort(body.thinkingEffort)
|
|
16
|
+
|| (body.thinkingEffort.includes(":") && !body.thinkingEffort.startsWith(`${body.provider}:`)))
|
|
17
|
+
throw new Error("临时思考深度无效。");
|
|
18
|
+
return { provider: body.provider, engine: body.engine,
|
|
19
|
+
model: body.model.trim(), thinkingEffort: body.thinkingEffort };
|
|
20
|
+
}
|
|
21
|
+
/** Manual selection is a single explicit candidate, not an implicit paid/fallback chain. */
|
|
22
|
+
export function withConversationExecutionPreference(employee, preference) {
|
|
23
|
+
const base = employee.agents.find(agent => agent.provider === preference.provider && (agent.engine ?? "cli") === (preference.engine ?? "cli"));
|
|
24
|
+
return { ...employee, agents: [{ ...preference, kind: "structured",
|
|
25
|
+
mode: normalizeWandTaskAgentMode(preference.provider, base?.mode) }] };
|
|
26
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { TaskOrganizeMode, TaskOrganizeTarget } from "./task-organize-contract.js";
|
|
2
|
+
export interface ConversationOrganizationScope {
|
|
3
|
+
target?: TaskOrganizeTarget;
|
|
4
|
+
taskIds?: readonly string[];
|
|
5
|
+
sessionIds?: readonly string[];
|
|
6
|
+
mode: TaskOrganizeMode;
|
|
7
|
+
}
|
|
8
|
+
export interface ConversationOrganizationPreview {
|
|
9
|
+
token: string;
|
|
10
|
+
sessionCount: number;
|
|
11
|
+
manualSessionCount: number;
|
|
12
|
+
skippedSessionCount: number;
|
|
13
|
+
existingTaskCount: number;
|
|
14
|
+
contentCharacters: number;
|
|
15
|
+
estimatedModelRequests: number;
|
|
16
|
+
unchanged: boolean;
|
|
17
|
+
activeJobId?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ConversationOrganizationResult {
|
|
20
|
+
ok: true;
|
|
21
|
+
foundSessions: number;
|
|
22
|
+
eligibleSessions: number;
|
|
23
|
+
skippedManualSessions: number;
|
|
24
|
+
skippedSessions: number;
|
|
25
|
+
analyzedSessions: number;
|
|
26
|
+
createdTasks: Array<{
|
|
27
|
+
taskId: string;
|
|
28
|
+
cardId: string;
|
|
29
|
+
title: string;
|
|
30
|
+
sessionCount: number;
|
|
31
|
+
}>;
|
|
32
|
+
reusedTasks: Array<{
|
|
33
|
+
taskId: string;
|
|
34
|
+
title: string;
|
|
35
|
+
sessionCount: number;
|
|
36
|
+
}>;
|
|
37
|
+
updatedTasks: Array<{
|
|
38
|
+
taskId: string;
|
|
39
|
+
previousTitle: string;
|
|
40
|
+
title: string;
|
|
41
|
+
}>;
|
|
42
|
+
movedSessions: Array<{
|
|
43
|
+
sessionId: string;
|
|
44
|
+
taskId: string;
|
|
45
|
+
taskName: string;
|
|
46
|
+
}>;
|
|
47
|
+
unassignedSessions: Array<{
|
|
48
|
+
sessionId: string;
|
|
49
|
+
reason: string;
|
|
50
|
+
}>;
|
|
51
|
+
refused: Array<{
|
|
52
|
+
id: string;
|
|
53
|
+
kind: "session" | "task";
|
|
54
|
+
reason: string;
|
|
55
|
+
}>;
|
|
56
|
+
unchanged?: boolean;
|
|
57
|
+
cancelled?: boolean;
|
|
58
|
+
error?: string;
|
|
59
|
+
}
|
|
60
|
+
export interface ConversationOrganizationJob {
|
|
61
|
+
id: string;
|
|
62
|
+
status: "running" | "completed" | "failed" | "cancelled" | "interrupted";
|
|
63
|
+
stage: string;
|
|
64
|
+
processedSessions: number;
|
|
65
|
+
totalSessions: number;
|
|
66
|
+
modelRequests: number;
|
|
67
|
+
result: ConversationOrganizationResult;
|
|
68
|
+
logSessionId?: string;
|
|
69
|
+
error?: string;
|
|
70
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { WandStorage } from "./storage.js";
|
|
2
|
+
import type { SessionSnapshot } from "./types.js";
|
|
3
|
+
import type { AutoTaskTitleOptions } from "./task-title-service.js";
|
|
4
|
+
import { type ConversationGroupingJudge } from "./conversation-organize.js";
|
|
5
|
+
import type { ConversationOrganizationScope, ConversationOrganizationPreview, ConversationOrganizationJob } from "./conversation-organize-contract.js";
|
|
6
|
+
export interface ConversationOrganizationDependencies {
|
|
7
|
+
titleOptions?: AutoTaskTitleOptions;
|
|
8
|
+
judge?: ConversationGroupingJudge;
|
|
9
|
+
summarize?(text: string, index: number, total: number, signal: AbortSignal): Promise<string>;
|
|
10
|
+
listSessions?(): SessionSnapshot[];
|
|
11
|
+
getSession?(id: string): SessionSnapshot | null;
|
|
12
|
+
refreshSession?(id: string): void;
|
|
13
|
+
}
|
|
14
|
+
export declare class ConversationOrganizationService {
|
|
15
|
+
private readonly storage;
|
|
16
|
+
private readonly deps;
|
|
17
|
+
private readonly previews;
|
|
18
|
+
private readonly active;
|
|
19
|
+
private readonly executing;
|
|
20
|
+
private readonly scopeJobs;
|
|
21
|
+
private readonly jobs;
|
|
22
|
+
private readonly operationTraces;
|
|
23
|
+
private readonly roleVersions;
|
|
24
|
+
private tail;
|
|
25
|
+
private closed;
|
|
26
|
+
constructor(storage: WandStorage, deps: ConversationOrganizationDependencies);
|
|
27
|
+
private save;
|
|
28
|
+
private scopeKey;
|
|
29
|
+
private getSession;
|
|
30
|
+
private taskDirectory;
|
|
31
|
+
private inScope;
|
|
32
|
+
private scan;
|
|
33
|
+
private fingerprint;
|
|
34
|
+
prepare(scope: ConversationOrganizationScope): ConversationOrganizationPreview;
|
|
35
|
+
start(token: string, force?: boolean): ConversationOrganizationJob;
|
|
36
|
+
get(id: string): ConversationOrganizationJob | null;
|
|
37
|
+
cancel(id: string): ConversationOrganizationJob | null;
|
|
38
|
+
private ai;
|
|
39
|
+
private summarize;
|
|
40
|
+
private taskCandidates;
|
|
41
|
+
private roleVersion;
|
|
42
|
+
private countModelRequest;
|
|
43
|
+
private execute;
|
|
44
|
+
private apply;
|
|
45
|
+
}
|
|
46
|
+
export declare function conversationOrganizationService(storage: WandStorage, deps: ConversationOrganizationDependencies): ConversationOrganizationService;
|