@klarkxy/dsh-fusion 0.1.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/LICENSE +41 -0
- package/README.md +33 -0
- package/cordis.patch.yml +4 -0
- package/docs/README.zh-CN.md +13 -0
- package/lib/client.inner.cjs +959 -0
- package/lib/client.inner.cjs.map +1 -0
- package/lib/client.js +1129 -0
- package/lib/contracts.d.ts +173 -0
- package/lib/contracts.js +28 -0
- package/lib/contracts.js.map +1 -0
- package/lib/host-contracts.d.ts +38 -0
- package/lib/host-contracts.js +1 -0
- package/lib/index.d.ts +134 -0
- package/lib/index.js +1670 -0
- package/lib/index.js.map +1 -0
- package/package.json +128 -0
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["brief","parseBrief","route","parseRoute","target","parseTarget"],"sources":["../src/validation.ts","../src/storage.ts","../src/presentation.ts","../src/service.ts","../src/native.ts","../src/tools.ts","../src/runtime.ts","../src/index.ts"],"sourcesContent":["import { createHash } from 'node:crypto'\nimport type { FusionBrief, FusionState, FusionTarget, Json, ModelRoute } from './contracts.ts'\n\nexport class FusionError extends Error {\n readonly code: string\n constructor(code: string, message: string) { super(message); this.name = 'FusionError'; this.code = code }\n}\nexport function requireFusion(condition: unknown, code: string, message: string): asserts condition {\n if (!condition) throw new FusionError(code, message)\n}\nexport function text(value: unknown, label: string, max: number, empty = false): string {\n requireFusion(typeof value === 'string' && value.length <= max && (empty || value.trim().length > 0), 'INVALID_INPUT', `${label} must be ${empty ? '0' : '1'}–${max} characters.`)\n return value\n}\nexport function integer(value: unknown, label: string): number {\n requireFusion(Number.isSafeInteger(value) && Number(value) >= 1, 'INVALID_INPUT', `${label} must be a positive integer.`)\n return value as number\n}\nexport function object(value: unknown): Record<string, unknown> {\n requireFusion(value !== null && typeof value === 'object' && !Array.isArray(value), 'INVALID_INPUT', 'Expected an object.')\n return value as Record<string, unknown>\n}\nexport function stringList(value: unknown, label: string, limit = 32): string[] {\n requireFusion(Array.isArray(value) && value.length <= limit, 'INVALID_INPUT', `${label} must have at most ${limit} items.`)\n return value.map(item => text(item, label, 2000))\n}\nexport function brief(value: unknown): FusionBrief {\n const row = object(value)\n return { title: text(row.title, 'title', 120), goal: text(row.goal, 'goal', 8000), context: text(row.context ?? '', 'context', 48_000, true),\n constraints: stringList(row.constraints ?? [], 'constraints'), acceptance: stringList(row.acceptance ?? [], 'acceptance') }\n}\nexport function route(value: unknown): ModelRoute {\n const row = object(value)\n return { provider: text(row.provider, 'provider', 300), model: text(row.model, 'model', 300),\n ...(row.reasoningEffort === undefined ? {} : { reasoningEffort: text(row.reasoningEffort, 'reasoningEffort', 100) }) }\n}\nfunction json(value: unknown, depth = 0): asserts value is Json {\n requireFusion(depth <= 12, 'INVALID_INPUT', 'Target is nested too deeply.')\n if (value === null || typeof value === 'boolean' || typeof value === 'string') return\n if (typeof value === 'number') { requireFusion(Number.isFinite(value), 'INVALID_INPUT', 'Non-finite target value.'); return }\n if (Array.isArray(value)) { requireFusion(value.length <= 128, 'INVALID_INPUT', 'Target array too large.'); value.forEach(item => json(item, depth + 1)); return }\n const row = object(value)\n requireFusion(Object.keys(row).length <= 128, 'INVALID_INPUT', 'Target object too large.')\n for (const [key, item] of Object.entries(row)) {\n requireFusion(!['__proto__', 'constructor', 'prototype'].includes(key), 'INVALID_INPUT', 'Unsafe target key.')\n json(item, depth + 1)\n }\n}\nexport function target(value: unknown): FusionTarget | undefined {\n if (value === undefined) return undefined\n const row = object(value)\n const domain = text(row.domain, 'target domain', 100)\n const data = object(row.data)\n json(data)\n requireFusion(JSON.stringify(data).length <= 200_000, 'INVALID_INPUT', 'Target exceeds storage limit.')\n return { domain, data: structuredClone(data) as { [key: string]: Json } }\n}\nfunction timestamp(value: unknown): void {\n requireFusion(typeof value === 'number' && Number.isSafeInteger(value) && value >= 0, 'INVALID_STATE', 'Invalid record timestamp.')\n}\n/** Validate persisted control records before allowing any native work to resume. */\nexport function validateState(value: unknown): FusionState {\n const row = object(value)\n requireFusion(row.version === 1 && Number.isSafeInteger(row.revision) && Number(row.revision) >= 0, 'INVALID_STATE', 'Unsupported Fusion storage version.')\n requireFusion(Array.isArray(row.pairs) && row.pairs.length <= 512, 'INVALID_STATE', 'Invalid Fusion pair table.')\n const pairIds = new Set<string>(), leads = new Set<string>(), children = new Set<string>(), tasks = new Set<string>()\n for (const value of row.pairs) {\n const pair = object(value)\n const pairId = text(pair.id, 'pair id', 200)\n requireFusion(!pairIds.has(pairId), 'INVALID_STATE', 'Duplicate pair identity.'); pairIds.add(pairId)\n timestamp(pair.createdAt); text(pair.project, 'project identity', 8192)\n const lead = text(pair.leadSessionId, 'lead id', 200), child = text(pair.childSessionId, 'child id', 200)\n requireFusion(!leads.has(lead) && !children.has(child) && lead !== child, 'INVALID_STATE', 'Duplicate Fusion identity.')\n leads.add(lead); children.add(child)\n requireFusion(pair.profile === 'generic' || pair.profile === 'writing', 'INVALID_STATE', 'Unknown Fusion profile.')\n requireFusion(typeof pair.established === 'boolean', 'INVALID_STATE', 'Missing admission state.')\n route(pair.route)\n requireFusion(Array.isArray(pair.tasks) && pair.tasks.length <= 128, 'INVALID_STATE', 'Invalid task table.')\n for (const value of pair.tasks) {\n const task = object(value), id = text(task.id, 'task id', 200)\n requireFusion(!tasks.has(id), 'INVALID_STATE', 'Duplicate task identity.'); tasks.add(id)\n timestamp(task.createdAt); timestamp(task.updatedAt)\n if (task.error !== undefined) text(task.error, 'task error', 16_000, true)\n if (task.decision !== undefined) text(task.decision, 'task decision', 16_000, true)\n integer(task.revision, 'task revision'); brief(task.brief); target(task.target)\n requireFusion(['dispatching','working','decision','review','accepted','cancelled','failed','interrupted'].includes(String(task.state)), 'INVALID_STATE', 'Unknown task state.')\n requireFusion(['pending','accepted','uncertain'].includes(String(task.delivery)), 'INVALID_STATE', 'Unknown delivery state.')\n text(task.dispatchId, 'dispatch id', 200)\n stringList(task.messageIds, 'message ids', 64); const reportIds = stringList(task.reportIds, 'report ids', 64)\n if (task.notifiedReportId !== undefined) requireFusion(reportIds.includes(text(task.notifiedReportId, 'notified report id', 256)), 'INVALID_STATE', 'Notification references an unknown report.')\n requireFusion(Array.isArray(task.candidates) && task.candidates.length <= 16 && Array.isArray(task.reviews) && task.reviews.length <= 32, 'INVALID_STATE', 'Invalid candidate history.')\n const candidates = new Map<string, string>()\n for (const [index, item] of task.candidates.entries()) {\n const candidate = object(item)\n timestamp(candidate.createdAt)\n const candidateId = text(candidate.id, 'candidate id', 200)\n requireFusion(!candidates.has(candidateId), 'INVALID_STATE', 'Duplicate candidate identity.')\n requireFusion(integer(candidate.revision, 'candidate revision') === index + 1, 'INVALID_STATE', 'Invalid candidate order.')\n requireFusion(integer(candidate.taskRevision, 'candidate task revision') <= Number(task.revision), 'INVALID_STATE', 'Candidate belongs to a future task revision.')\n const candidateText = text(candidate.text, 'candidate', 200_000, true); text(candidate.report, 'report', 16_000, true)\n requireFusion(typeof candidate.hash === 'string' && /^[a-f0-9]{64}$/.test(candidate.hash), 'INVALID_STATE', 'Invalid candidate hash.')\n requireFusion(createHash('sha256').update(candidateText, 'utf8').digest('hex') === candidate.hash, 'INVALID_STATE', 'Candidate content does not match its stored hash.')\n candidates.set(candidateId, candidate.hash)\n }\n if (task.cleanup !== undefined) requireFusion(['pending', 'done', 'failed'].includes(String(task.cleanup)), 'INVALID_STATE', 'Invalid cleanup state.')\n if (task.adoption !== undefined) requireFusion(['pending', 'applied', 'dismissed', 'conflict'].includes(String(task.adoption)) && pair.profile === 'writing' && task.target, 'INVALID_STATE', 'Invalid adoption state.')\n if (task.application !== undefined) {\n const application = object(task.application)\n text(application.id, 'application id', 200); text(application.path, 'application path', 8192)\n text(application.beforeVersion, 'application baseline', 8192, true)\n const destination = target(task.target)\n requireFusion(destination && (destination.data.path === undefined || destination.data.path === application.path), 'INVALID_STATE', 'Application path differs from its captured target.')\n const candidateId = text(application.candidateId, 'application candidate', 200)\n const latest = object(task.candidates.at(-1))\n requireFusion(latest.id === candidateId && latest.taskRevision === task.revision && candidates.get(candidateId) === application.candidateHash, 'INVALID_STATE', 'Application references an unknown candidate.')\n requireFusion(typeof application.afterHash === 'string' && /^[a-f0-9]{64}$/.test(application.afterHash), 'INVALID_STATE', 'Invalid resulting file hash.')\n requireFusion(['pending', 'applied', 'conflict'].includes(String(application.state)) && pair.profile === 'writing' && task.target && task.state === 'accepted', 'INVALID_STATE', 'Invalid application state.')\n if (application.version !== undefined) text(application.version, 'application receipt version', 8192)\n if (application.state === 'pending') requireFusion(task.adoption === 'pending', 'INVALID_STATE', 'Pending intent requires pending adoption.')\n if (application.state === 'conflict') requireFusion(task.adoption === 'conflict' || task.adoption === 'dismissed', 'INVALID_STATE', 'Conflicting intent requires conflict or dismissal.')\n if (application.state === 'applied') requireFusion(task.adoption === 'applied' && application.version, 'INVALID_STATE', 'Applied intent requires a receipt.')\n }\n for (const item of task.reviews) {\n const review = object(item)\n timestamp(review.createdAt)\n const candidateId = text(review.candidateId, 'review candidate', 200)\n const hash = text(review.candidateHash, 'review hash', 64)\n requireFusion(candidates.get(candidateId) === hash, 'INVALID_STATE', 'Review references an unknown candidate revision.')\n requireFusion(['accept','revise','reject'].includes(String(review.verdict)), 'INVALID_STATE', 'Invalid review verdict.')\n text(review.feedback, 'feedback', 16_000, true)\n }\n if (task.state === 'accepted') {\n const candidate = task.candidates.at(-1) && object(task.candidates.at(-1))\n const review = task.reviews.at(-1) && object(task.reviews.at(-1))\n requireFusion(candidate && candidate.taskRevision === task.revision && review?.verdict === 'accept' && review.candidateId === candidate.id && review.candidateHash === candidate.hash, 'INVALID_STATE', 'Accepted task must reference the latest accepted candidate.')\n }\n }\n }\n requireFusion([...children].every(id => !leads.has(id)), 'INVALID_STATE', 'Recursive Fusion identity.')\n requireFusion(JSON.stringify(row).length <= 16_000_000, 'CAPACITY', 'Fusion history capacity reached. Existing records were preserved.')\n return structuredClone(row) as unknown as FusionState\n}\n","import { defineDomain, domainTable } from '@deepseek-ai/dsh-storage-domain'\nimport { z } from 'zod'\nimport { emptyFusionState, type FusionState, type FusionStore } from './contracts.ts'\nimport { validateState } from './validation.ts'\n\n/** One atomic business record; Sessions remain the transcript authority. */\nexport const fusionStateSchema = z.unknown().transform((value, ctx): FusionState => {\n try { return validateState(value) }\n catch (error) { ctx.addIssue({ code: 'custom', message: error instanceof Error ? error.message : 'Invalid Fusion state' }); return z.NEVER }\n})\nexport const fusionDomain = defineDomain({ name: 'dsh_fusion', version: 1,\n tables: { state: domainTable<string, FusionState>(fusionStateSchema) },\n})\nexport const FUSION_STATE_KEY = 'state'\nexport function createFusionStore(table: { get(key: string): FusionState | undefined; put(key: string, value: FusionState): Promise<void> }): FusionStore {\n return {\n load: () => validateState(table.get(FUSION_STATE_KEY) ?? emptyFusionState()),\n save: next => table.put(FUSION_STATE_KEY, validateState(next)),\n }\n}\n","import { isWorking, type FusionPair, type FusionTask } from './contracts.ts'\n\nexport type FusionLocale = 'zh' | 'en'\nexport interface FusionTaskView {\n id: string\n title: string\n status: string\n detail: string\n working: boolean\n canStop: boolean\n canPreview: boolean\n candidateLabel?: string\n /** Native child address, never a human-readable label used as a routing key. */\n executionAddress: string\n}\nconst labels = {\n zh: { dispatching: '正在交接', working: '执行中', decision: '等待主代理决策', review: '主代理审查中', accepted: '审查通过', cancelled: '已停止', failed: '执行失败', interrupted: '执行已中断' },\n en: { dispatching: 'Handing off', working: 'Executing', decision: 'Waiting for Lead decision', review: 'Lead review', accepted: 'Review passed', cancelled: 'Stopped', failed: 'Failed', interrupted: 'Interrupted' },\n} as const\n\n/** Pure task projection. No percentages, idle-to-success inference, or provider-cost estimates. */\nexport function taskView(pair: FusionPair, task: FusionTask, locale: FusionLocale): FusionTaskView {\n const zh = locale === 'zh', writing = pair.profile === 'writing'\n let status: string = labels[locale][task.state]\n if (zh && writing && task.state === 'working') status = '执笔中'\n if (zh && writing && task.state === 'decision') status = '等待统筹决策'\n if (zh && writing && task.state === 'review') status = '统筹审阅中'\n let detail = task.error ?? ''\n if (task.state === 'accepted') {\n if (writing && task.target) {\n status = task.adoption === 'applied' ? (zh ? '已采用' : 'Applied')\n : task.adoption === 'conflict' ? (zh ? '原文已变化' : 'Source changed')\n : task.adoption === 'dismissed' ? (zh ? '候选已放弃' : 'Candidate dismissed')\n : (zh ? '待你采用' : 'Awaiting author adoption')\n detail = zh ? '审阅通过不等于已写入稿件。' : 'Model review does not apply changes to the manuscript.'\n if (task.adoption === 'applied') detail = zh ? '宿主已确认应用。' : 'Application confirmed by the Host.'\n } else detail = zh ? '结果已通过模型审查;文件操作以原生执行记录为准。' : 'Review passed. Native execution records remain authoritative for file changes.'\n }\n if (task.cleanup === 'pending') status = zh ? '正在停止' : 'Stopping'\n if (task.cleanup === 'failed') { status = zh ? '停止未完全完成' : 'Stop incomplete'; detail = zh ? '旧结果已失效,但资源清理需要重试。' : 'Old results are invalid, but resource cleanup needs retry.' }\n const candidate = task.candidates.at(-1)\n return { id: task.id, title: task.brief.title, status, detail, working: isWorking(task.state) || task.cleanup === 'pending',\n canStop: task.adoption !== 'applied' && (isWorking(task.state) || task.cleanup === 'failed' || task.state === 'interrupted'),\n canPreview: Boolean(candidate), ...(candidate ? { candidateLabel: zh ? `候选第 ${candidate.revision} 版` : `Candidate v${candidate.revision}` } : {}),\n executionAddress: `dsh-resource://subagentchat/session/${encodeURIComponent(pair.childSessionId)}?parent=${encodeURIComponent(pair.leadSessionId)}&mode=continuable` }\n}\n\n/** Only a structured and matching source can suppress a cancelled child's late wakeup. */\nexport function isOwnedChildNotice(source: unknown, childId: string): boolean {\n if (!source || typeof source !== 'object') return false\n const row = source as Record<string, unknown>\n return (row.kind === 'subagent-settled' || row.kind === 'agent-message') && row.senderSessionId === childId\n}\n","import { createHash, randomUUID } from 'node:crypto'\nimport { emptyFusionState, isWorking, type FusionActor, type FusionBrief, type FusionCandidate, type FusionNative, type FusionPair,\n type FusionProfile, type FusionState, type FusionStore, type FusionTarget, type FusionTask, type ModelRoute } from './contracts.ts'\nimport type { FusionWritingHost } from './host-contracts.ts'\nimport type { FusionCandidateAction, FusionPreview } from './contracts.ts'\nimport { brief as parseBrief, integer, requireFusion, route as parseRoute, target as parseTarget, text, validateState } from './validation.ts'\n\nexport const contentHash = (value: string): string => createHash('sha256').update(value, 'utf8').digest('hex')\nconst clone = <T>(value: T): T => structuredClone(value)\nconst currentTask = (pair: FusionPair): FusionTask | undefined => pair.tasks.at(-1)\n\n/** Business records only. The native continuation manager owns Agents and all message scheduling. */\nexport class FusionService {\n private state: FusionState\n private pending: Promise<void> = Promise.resolve()\n private enabled = true\n private generation = 0\n private storageFailed = false\n private readonly controller = new AbortController()\n private readonly dispatches = new Map<string, Set<AbortController>>()\n private readonly applications = new Map<string, Set<AbortController>>()\n private readonly notifications = new Map<string, Set<AbortController>>()\n private readonly inFlight = new Set<Promise<unknown>>()\n private readonly ready: Promise<void>\n private readonly store: FusionStore\n private readonly inspectAdmission?: (pair: FusionPair, signal: AbortSignal) => Promise<'present' | 'absent'>\n private readonly native: FusionNative\n private readonly now: () => number\n private readonly id: () => string\n constructor(input: { store: FusionStore; native: FusionNative; inspectAdmission?: (pair: FusionPair, signal: AbortSignal) => Promise<'present' | 'absent'>; now?: () => number; id?: () => string }) {\n this.inspectAdmission = input.inspectAdmission\n this.store = input.store; this.native = input.native; this.now = input.now ?? Date.now; this.id = input.id ?? randomUUID\n this.state = validateState(this.store.load() ?? emptyFusionState())\n // A restored task is not a license to replay a side effect or start inference from a status read.\n this.ready = this.change(next => {\n for (const pair of next.pairs) for (const task of pair.tasks) {\n if (isWorking(task.state)) {\n task.state = 'interrupted'; task.delivery = 'uncertain'; task.updatedAt = this.now()\n task.error = '进程已重启。请核对执行记录后明确恢复;未自动重发任务。'\n }\n }\n }, true)\n }\n get active(): boolean { return this.enabled && !this.storageFailed }\n async initialized(): Promise<void> { await this.ready }\n snapshot(): FusionState { return clone(this.state) }\n pairFor(sessionId: string): FusionPair | undefined {\n const pair = this.state.pairs.find(pair => pair.leadSessionId === sessionId || pair.childSessionId === sessionId)\n return pair && clone(pair)\n }\n role(sessionId: string): 'lead' | 'sidekick' | undefined {\n const pair = this.state.pairs.find(pair => pair.leadSessionId === sessionId || pair.childSessionId === sessionId)\n return pair && (pair.leadSessionId === sessionId ? 'lead' : 'sidekick')\n }\n private async persist(next: FusionState): Promise<void> {\n next.revision++\n validateState(next)\n try { await this.store.save(clone(next)) }\n catch (error) { this.storageFailed = true; this.generation++; this.controller.abort(); throw error }\n this.state = clone(next)\n }\n private change<T>(fn: (next: FusionState) => T | Promise<T>, allowInactive = false): Promise<T> {\n const result = this.pending.then(async () => {\n requireFusion(allowInactive || this.enabled, 'DISABLED', 'Fusion is disabled.')\n requireFusion(allowInactive || !this.storageFailed, 'STORAGE_FAILED', 'Fusion storage failed. Reload after repairing storage; no new work was admitted.')\n const next = clone(this.state), value = await fn(next)\n await this.persist(next)\n return clone(value)\n })\n this.pending = result.then(() => undefined, () => undefined)\n return result\n }\n private owned(next: FusionState, actor: FusionActor, side: 'lead' | 'sidekick'): FusionPair {\n const pair = next.pairs.find(pair => (side === 'lead' ? pair.leadSessionId : pair.childSessionId) === actor.sessionId)\n requireFusion(pair && pair.project === actor.project && (side !== 'sidekick' || actor.parentSessionId === pair.leadSessionId), 'UNAUTHORIZED', 'This session does not own the Fusion task.')\n if (side === 'lead') requireFusion(!actor.parentSessionId, 'UNAUTHORIZED', 'A child cannot become a Fusion Lead.')\n return pair\n }\n private task(pair: FusionPair, taskId: string, revision: number): FusionTask {\n const task = currentTask(pair)\n requireFusion(task?.id === taskId && task.revision === revision, 'STALE', 'This task revision is no longer current.')\n return task\n }\n private isCurrent(pairId: string, taskId: string, revision: number, generation: number): boolean {\n if (!this.enabled || this.storageFailed || generation !== this.generation) return false\n const pair = this.state.pairs.find(pair => pair.id === pairId), task = pair && currentTask(pair)\n return task?.id === taskId && task.revision === revision && isWorking(task.state)\n }\n private track<T>(operation: Promise<T>): Promise<T> {\n this.inFlight.add(operation)\n void operation.finally(() => this.inFlight.delete(operation)).catch(() => {})\n return operation\n }\n private abortNotifications(taskId: string): void {\n for (const controller of this.notifications.get(taskId) ?? []) controller.abort()\n }\n async delegate(actor: FusionActor, input: { profile: FusionProfile; route: ModelRoute; brief: FusionBrief; target?: FusionTarget; signal: AbortSignal }): Promise<FusionTask> {\n await this.ready\n input.signal.throwIfAborted()\n requireFusion(!actor.parentSessionId && !this.roleIsChild(actor.sessionId), 'UNAUTHORIZED', 'Fusion only delegates from a user root session.')\n text(actor.sessionId, 'session id', 200); text(actor.project, 'project identity', 8192)\n const brief = parseBrief(input.brief), route = parseRoute(input.route), target = parseTarget(input.target)\n requireFusion(input.profile === 'generic' || input.profile === 'writing', 'INVALID_INPUT', 'Unknown Fusion profile.')\n const reserved = await this.change(async next => {\n input.signal.throwIfAborted()\n let pair = next.pairs.find(pair => pair.leadSessionId === actor.sessionId)\n if (pair) {\n requireFusion(pair.project === actor.project && pair.profile === input.profile, 'CONTEXT_CHANGED', 'Project or profile changed. Start a new root conversation.')\n requireFusion(!currentTask(pair) || !isWorking(currentTask(pair)!.state), 'BUSY', 'The previous Fusion task needs review, cancellation or a decision first.')\n requireFusion(!currentTask(pair) || !this.dispatches.has(currentTask(pair)!.id), 'ADMISSION_PENDING', 'The previous native admission is still settling.')\n requireFusion(!['pending', 'conflict'].includes(currentTask(pair)?.adoption ?? '') && currentTask(pair)?.application?.state !== 'pending', 'ADOPTION_PENDING', 'Adopt or dismiss the previous candidate before delegating again.')\n requireFusion(currentTask(pair)?.cleanup !== 'pending' && currentTask(pair)?.cleanup !== 'failed', 'STOP_INCOMPLETE', 'Previous child cleanup must finish before delegation.')\n requireFusion(JSON.stringify(pair.route) === JSON.stringify(route), 'ROUTE_CHANGED', 'The persistent partner uses another route. Start a new conversation to change it.')\n if (!pair.established && pair.tasks.length && this.inspectAdmission) {\n await this.native.stop(clone(pair), false)\n pair.established = await this.inspectAdmission(clone(pair), input.signal) === 'present'\n input.signal.throwIfAborted()\n }\n requireFusion(pair.established || pair.tasks.length === 0 || this.inspectAdmission, 'UNCERTAIN_ADMISSION', 'Initial child admission is uncertain. Start a new conversation after inspecting the old child.')\n } else {\n pair = { id: this.id(), leadSessionId: actor.sessionId, childSessionId: this.id(), project: actor.project,\n profile: input.profile, route, established: false, tasks: [], createdAt: this.now() }\n next.pairs.push(pair)\n }\n const task: FusionTask = { id: this.id(), revision: 1, state: 'dispatching', brief, ...(target ? { target } : {}), candidates: [], reviews: [],\n messageIds: [], dispatchId: this.id(), reportIds: [], delivery: 'pending', createdAt: this.now(), updatedAt: this.now() }\n pair.tasks.push(task)\n return { pair, task }\n })\n return this.dispatch(reserved.pair, reserved.task, input.signal)\n }\n private roleIsChild(id: string): boolean { return this.state.pairs.some(pair => pair.childSessionId === id) }\n private dispatch(pair: FusionPair, task: FusionTask, outerSignal: AbortSignal): Promise<FusionTask> {\n const controller = new AbortController(), generation = this.generation\n const controllers = this.dispatches.get(task.id) ?? new Set<AbortController>()\n controllers.add(controller); this.dispatches.set(task.id, controllers)\n const signal = AbortSignal.any([outerSignal, controller.signal, this.controller.signal])\n return this.track((async () => {\n try {\n signal.throwIfAborted()\n const message = await this.native.dispatch({ pair: clone(pair), task: clone(task), prompt: this.prompt(pair, task), signal })\n // Report/review can finish before the native admission promise returns. Completion is not cancellation.\n const admitted = await this.change(next => {\n const current = next.pairs.find(row => row.id === pair.id)!\n current.established = true\n const row = current.tasks.find(row => row.id === task.id)!\n const messageId = text(message.messageId, 'message id', 200)\n if (!row.messageIds.includes(messageId)) row.messageIds.push(messageId)\n if (row.revision === task.revision) {\n row.delivery = 'accepted'\n if (this.enabled && !this.storageFailed && generation === this.generation && row.state === 'dispatching') row.state = 'working'\n row.updatedAt = this.now()\n }\n return { task: row, valid: this.enabled && !this.storageFailed && generation === this.generation && !['cancelled', 'failed', 'interrupted'].includes(row.state) }\n }, true)\n requireFusion(admitted.valid, 'STALE', 'Task was invalidated while its message was being admitted.')\n return admitted.task\n } catch (error) {\n await this.change(next => {\n const row = next.pairs.find(row => row.id === pair.id)?.tasks.find(row => row.id === task.id)\n if (row && row.revision === task.revision && isWorking(row.state)) {\n row.state = signal.aborted ? 'cancelled' : 'failed'\n row.delivery = 'uncertain'; row.updatedAt = this.now()\n row.error = signal.aborted ? '任务已取消,未自动重试。' : '委派未确认完成,请查看执行记录后再处理。'\n }\n }, true)\n // dispatch implementations clean partial starts; stop also covers accepted-but-unsaved children.\n const latest = this.pairFor(pair.leadSessionId)?.tasks.at(-1)\n // An old admission or revision must never drain newer work using the persistent child.\n if (!this.enabled || (latest?.id === task.id && latest.revision === task.revision && ['cancelled', 'failed', 'interrupted'].includes(latest.state))) {\n try { await this.native.stop(pair, false) } catch { /* later cancel can retry cleanup */ }\n }\n throw error\n } finally {\n controllers.delete(controller)\n if (!controllers.size) this.dispatches.delete(task.id)\n }\n })())\n }\n private prompt(pair: FusionPair, task: FusionTask): string {\n return `Fusion task ${task.id}; revision ${task.revision}; dispatch ${task.dispatchId}.\\n`\n + `Goal: ${task.brief.goal}\\nContext:\\n${task.brief.context}\\nConstraints:\\n${task.brief.constraints.join('\\n')}\\nAcceptance:\\n${task.brief.acceptance.join('\\n')}\\n`\n + (task.target ? `Versioned destination (do not change): ${JSON.stringify(task.target)}\\n` : '')\n + (task.decision ? `Lead feedback: ${task.decision}\\n` : '')\n + `Use fusion_report with this taskId and taskRevision, and a unique reportId. Submit ${pair.profile === 'writing' ? 'the exact prose candidate' : 'a concise result with verifiable evidence'}, or request a decision. Do not claim the task is complete without reporting. Stop after reporting and wait for the Lead.`\n }\n async report(actor: FusionActor, input: { taskId: string; taskRevision: number; reportId: string; kind: 'candidate' | 'decision'; text: string; report?: string; signal: AbortSignal }): Promise<FusionTask> {\n await this.ready; input.signal.throwIfAborted()\n integer(input.taskRevision, 'task revision'); text(input.reportId, 'report id', 200)\n text(input.text, 'report text', input.kind === 'candidate' ? 200_000 : 16_000, input.kind === 'candidate')\n text(input.report ?? '', 'report summary', 16_000, true)\n requireFusion(input.kind === 'candidate' || input.kind === 'decision', 'INVALID_INPUT', 'Unknown report kind.')\n const generation = this.generation\n const result = await this.change(next => {\n input.signal.throwIfAborted()\n const pair = this.owned(next, actor, 'sidekick'), task = this.task(pair, input.taskId, input.taskRevision)\n // A report from the exact native-owned child proves that initial admission materialized.\n pair.established = true\n const reportKey = `${task.revision}:${input.reportId}`\n if (task.reportIds.includes(reportKey)) {\n const candidate = task.candidates.at(-1)\n requireFusion(input.kind === 'decision' ? task.decision === input.text : candidate?.text === input.text && candidate.report === (input.report ?? ''), 'DUPLICATE_CONFLICT', 'A report id cannot be reused for different content.')\n return { pair, task, reportKey, duplicate: true }\n }\n requireFusion(task.state === 'dispatching' || task.state === 'working', 'STALE', 'The task is no longer accepting reports.')\n task.reportIds.push(reportKey)\n if (input.kind === 'decision') { task.state = 'decision'; task.decision = input.text }\n else {\n task.candidates.push({ id: this.id(), taskRevision: task.revision, revision: task.candidates.length + 1,\n text: input.text, hash: contentHash(input.text), report: input.report ?? '', createdAt: this.now() })\n task.state = 'review'\n }\n task.updatedAt = this.now()\n return { pair, task, reportKey, duplicate: false }\n })\n if (result.duplicate) {\n requireFusion(result.task.notifiedReportId === result.reportKey, 'NOTIFICATION_UNCERTAIN', 'The report was saved, but Lead notification is not confirmed. Inspect the exact task record before any explicit recovery.')\n return result.task\n }\n const controller = new AbortController()\n const controllers = this.notifications.get(result.task.id) ?? new Set<AbortController>()\n controllers.add(controller)\n this.notifications.set(result.task.id, controllers)\n try {\n if (this.isCurrent(result.pair.id, result.task.id, result.task.revision, generation)) {\n const candidate = result.task.candidates.at(-1)\n const body = result.task.state === 'decision'\n ? `Decision requested for ${result.task.id} revision ${result.task.revision}: ${result.task.decision}`\n : `Candidate ready for ${result.task.id} revision ${result.task.revision}: ${candidate!.id}, sha256 ${candidate!.hash}. Read the exact candidate using fusion_read before fusion_review. Report: ${candidate!.report}`\n const signal = AbortSignal.any([controller.signal, this.controller.signal])\n signal.throwIfAborted()\n await this.track(this.native.notify({ pair: result.pair, task: result.task, actor, text: body, signal }))\n await this.change(next => {\n const row = next.pairs.find(pair => pair.id === result.pair.id)?.tasks.find(task => task.id === result.task.id)\n if (row?.revision === result.task.revision && isWorking(row.state)) row.notifiedReportId = result.reportKey\n }, true)\n }\n } finally {\n controllers.delete(controller)\n if (controllers.size === 0) this.notifications.delete(result.task.id)\n }\n return clone(this.state.pairs.find(pair => pair.id === result.pair.id)?.tasks.find(task => task.id === result.task.id) ?? result.task)\n }\n read(actor: FusionActor, taskId: string, candidateId?: string): { task: FusionTask; candidate?: FusionCandidate } {\n const pair = this.owned(this.state, actor, 'lead')\n const task = pair.tasks.find(row => row.id === taskId)\n requireFusion(task, 'NOT_FOUND', 'Unknown Fusion task.')\n const candidate = candidateId ? task.candidates.find(row => row.id === candidateId) : task.candidates.at(-1)\n requireFusion(!candidateId || candidate, 'NOT_FOUND', 'Unknown candidate.')\n return clone({ task, ...(candidate ? { candidate } : {}) })\n }\n async review(actor: FusionActor, input: { taskId: string; taskRevision: number; candidateId: string; hash: string; verdict: 'accept' | 'revise' | 'reject'; feedback: string; signal: AbortSignal }): Promise<FusionTask> {\n await this.ready; input.signal.throwIfAborted(); text(input.feedback, 'feedback', 16_000, true)\n requireFusion(['accept','revise','reject'].includes(input.verdict), 'INVALID_INPUT', 'Unknown review verdict.')\n const result = await this.change(next => {\n input.signal.throwIfAborted()\n const pair = this.owned(next, actor, 'lead'), task = this.task(pair, input.taskId, integer(input.taskRevision, 'task revision'))\n const candidate = task.candidates.at(-1)\n requireFusion(candidate?.id === input.candidateId && candidate.hash === input.hash && candidate.taskRevision === task.revision, 'STALE', 'Review must reference the current exact candidate.')\n requireFusion(task.state === 'review', 'STALE', 'The task is not awaiting review.')\n requireFusion(contentHash(candidate.text) === candidate.hash, 'INVALID_STATE', 'Candidate content does not match its stored hash.')\n task.reviews.push({ candidateId: candidate.id, candidateHash: candidate.hash, verdict: input.verdict, feedback: input.feedback, createdAt: this.now() })\n task.updatedAt = this.now()\n if (input.verdict === 'accept') { task.state = 'accepted'; if (pair.profile === 'writing' && task.target) task.adoption = 'pending' }\n else if (input.verdict === 'reject') task.state = 'cancelled'\n else {\n requireFusion(task.candidates.length < 16, 'RETRY_LIMIT', 'Revision limit reached. Keep the candidate and ask the author for direction.')\n requireFusion(input.feedback.trim(), 'INVALID_INPUT', 'Revision requires actionable feedback.')\n task.revision++; task.state = 'dispatching'; task.dispatchId = this.id(); task.delivery = 'pending'; task.decision = input.feedback; delete task.notifiedReportId\n }\n return { pair, task }\n })\n this.abortNotifications(result.task.id)\n if (input.verdict === 'revise') return this.dispatch(result.pair, result.task, input.signal)\n return result.task\n }\n async decide(actor: FusionActor, input: { taskId: string; taskRevision: number; feedback: string; signal: AbortSignal }): Promise<FusionTask> {\n await this.ready; input.signal.throwIfAborted(); text(input.feedback, 'decision', 16_000)\n const result = await this.change(async next => {\n input.signal.throwIfAborted()\n const pair = this.owned(next, actor, 'lead'), task = this.task(pair, input.taskId, integer(input.taskRevision, 'task revision'))\n requireFusion(['decision', 'interrupted', 'failed'].includes(task.state), 'STALE', 'Only a blocked or explicitly interrupted task can resume.')\n requireFusion(task.delivery !== 'pending', 'UNCERTAIN_ADMISSION', 'Initial admission is still pending.')\n if (this.inspectAdmission) {\n // Explicit continuation must first quiesce any surviving admission and verify native authority.\n await this.native.stop(clone(pair), false)\n pair.established = await this.inspectAdmission(clone(pair), input.signal) === 'present'\n input.signal.throwIfAborted()\n task.cleanup = 'done'\n } else requireFusion(pair.established, 'UNCERTAIN_ADMISSION', 'Inspect uncertain initial admission before resuming.')\n requireFusion(task.revision < 32, 'RETRY_LIMIT', 'Task revision limit reached.')\n task.revision++; task.state = 'dispatching'; task.delivery = 'pending'; task.dispatchId = this.id(); task.decision = input.feedback; delete task.error; delete task.notifiedReportId\n task.updatedAt = this.now()\n return { pair, task }\n })\n this.abortNotifications(result.task.id)\n return this.dispatch(result.pair, result.task, input.signal)\n }\n async cancel(actor: FusionActor, taskId: string, taskRevision: number, stopLead = false): Promise<void> {\n await this.ready\n const present = this.task(this.owned(this.state, actor, 'lead'), taskId, integer(taskRevision, 'task revision'))\n for (const controller of this.applications.get(present.id) ?? []) controller.abort()\n // Invalidate business results before any asynchronous resource teardown.\n const pair = await this.change(next => {\n const pair = this.owned(next, actor, 'lead'), task = this.task(pair, taskId, integer(taskRevision, 'task revision'))\n requireFusion(task.application?.state !== 'pending', 'APPLICATION_UNCERTAIN', 'Inspect the pending application before stopping this task.')\n requireFusion(task.adoption !== 'applied', 'ALREADY_APPLIED', 'Stopping does not undo an applied change.')\n if (task.state === 'accepted' && pair.profile === 'writing' && task.target) task.adoption = 'dismissed'\n else task.state = 'cancelled'\n task.cleanup = 'pending'; task.updatedAt = this.now()\n return pair\n })\n for (const controller of this.dispatches.get(taskId) ?? []) controller.abort()\n this.abortNotifications(taskId)\n try {\n await this.track(this.native.stop(pair, stopLead))\n await this.change(next => { this.task(this.owned(next, actor, 'lead'), taskId, taskRevision).cleanup = 'done' }, true)\n } catch (error) {\n await this.change(next => { this.task(this.owned(next, actor, 'lead'), taskId, taskRevision).cleanup = 'failed' }, true)\n throw error\n }\n }\n async executionInterrupted(actor: FusionActor, reason: string, expected?: { taskId: string; revision: number }): Promise<void> {\n await this.ready\n await this.change(next => {\n const pair = this.owned(next, actor, 'sidekick'), task = currentTask(pair)\n if (task && (!expected || (task.id === expected.taskId && task.revision === expected.revision)) && ['dispatching', 'working'].includes(task.state)) {\n task.state = 'interrupted'; task.error = text(reason, 'interruption reason', 16_000); task.delivery = 'uncertain'; task.updatedAt = this.now()\n }\n })\n }\n /** Explicit recovery only: saved content is re-notified, never dispatched to the Writer. */\n async recover(actor: FusionActor, taskId: string, taskRevision: number, outerSignal: AbortSignal): Promise<FusionTask> {\n await this.ready\n outerSignal.throwIfAborted()\n const result = await this.change(next => {\n const pair = this.owned(next, actor, 'lead'), task = this.task(pair, taskId, integer(taskRevision, 'task revision'))\n requireFusion(['interrupted', 'review', 'decision'].includes(task.state), 'STALE', 'This task has no recoverable report.')\n const reportKey = task.reportIds.at(-1)\n requireFusion(reportKey?.startsWith(`${task.revision}:`), 'NO_REPORT', 'There is no saved report for this revision. Resume with feedback instead.')\n const candidate = task.candidates.at(-1)\n task.state = candidate?.taskRevision === task.revision ? 'review' : 'decision'\n requireFusion(task.state === 'review' || task.decision, 'NO_REPORT', 'No saved report is available.')\n task.updatedAt = this.now()\n return { pair, task, reportKey }\n })\n const controller = new AbortController(), controllers = this.notifications.get(taskId) ?? new Set<AbortController>()\n controllers.add(controller); this.notifications.set(taskId, controllers)\n const signal = AbortSignal.any([outerSignal, controller.signal, this.controller.signal])\n try {\n signal.throwIfAborted()\n const candidate = result.task.candidates.at(-1)\n const body = result.task.state === 'review'\n ? `Recovered saved candidate for ${taskId} revision ${taskRevision}: ${candidate!.id}, sha256 ${candidate!.hash}. Read with fusion_read, then fusion_review. This is a repeated notification, not a new Writer result.`\n : `Recovered saved decision for ${taskId} revision ${taskRevision}: ${result.task.decision}`\n await this.track(this.native.notify({ pair: result.pair, task: result.task, actor, text: body, signal }))\n await this.change(next => {\n const task = this.task(this.owned(next, actor, 'lead'), taskId, taskRevision)\n requireFusion(['review', 'decision'].includes(task.state), 'STALE', 'Recovery was cancelled.')\n task.notifiedReportId = result.reportKey\n })\n return this.read(actor, taskId).task\n } finally {\n controllers.delete(controller)\n if (!controllers.size) this.notifications.delete(taskId)\n }\n }\n private candidateAction(next: FusionState, actor: FusionActor, input: FusionCandidateAction) {\n requireFusion(input.sessionId === actor.sessionId, 'UNAUTHORIZED', 'Session identity mismatch.')\n const pair = this.owned(next, actor, 'lead'), task = this.task(pair, input.taskId, integer(input.taskRevision, 'task revision'))\n const candidate = task.candidates.at(-1)\n requireFusion(candidate?.id === input.candidateId && candidate.hash === input.hash && candidate.taskRevision === task.revision,\n 'STALE', 'The exact current candidate is required.')\n const review = task.reviews.at(-1)\n requireFusion(review?.verdict === 'accept' && review.candidateId === candidate.id && review.candidateHash === candidate.hash, 'NOT_ACCEPTED', 'The exact candidate has not been accepted by the Lead.')\n requireFusion(pair.profile === 'writing' && task.target && task.state === 'accepted', 'NOT_ACCEPTED', 'The Lead must accept this writing candidate first.')\n return { pair, task, candidate, target: task.target }\n }\n /** Also used by status. An uncertain filesystem mutation is inspected, never replayed. */\n async reconcile(actor: FusionActor, host: FusionWritingHost, signal: AbortSignal): Promise<void> {\n await this.ready\n const pair = this.pairFor(actor.sessionId)\n if (!pair?.tasks.some(task => task.application?.state === 'pending')) return\n await this.change(async next => {\n const pair = this.owned(next, actor, 'lead')\n for (const task of pair.tasks) {\n const application = task.application\n if (application?.state !== 'pending') continue\n const candidate = task.candidates.find(row => row.id === application.candidateId)\n requireFusion(task.target && candidate, 'INVALID_STATE', 'Incomplete application intent.')\n await host.transact(actor, task.target, candidate, signal, async access => {\n const current = await access.inspect()\n if (current && contentHash(current.text) === application.afterHash) {\n application.state = 'applied'; application.version = text(current.version, 'application receipt version', 8192); task.adoption = 'applied'\n } else { application.state = 'conflict'; task.adoption = 'conflict' }\n task.updatedAt = this.now()\n })\n }\n })\n }\n async preview(actor: FusionActor, input: FusionCandidateAction, host: FusionWritingHost, signal: AbortSignal): Promise<FusionPreview> {\n await this.ready\n return this.change(async next => {\n const { task, candidate, target } = this.candidateAction(next, actor, input)\n requireFusion(!task.application || task.application.state === 'conflict', 'ALREADY_APPLIED', 'This application has already started or completed.')\n requireFusion(task.adoption !== 'dismissed' && task.adoption !== 'applied', 'STALE', 'This candidate is no longer awaiting adoption.')\n return host.transact(actor, target, candidate, signal, async access => ({ ...await access.prepare(), candidateId: candidate.id, hash: candidate.hash }))\n })\n }\n async applyCandidate(actor: FusionActor, input: FusionCandidateAction & { expectedVersion: string }, host: FusionWritingHost, outerSignal: AbortSignal): Promise<FusionTask> {\n await this.ready\n text(input.expectedVersion, 'expected version', 8192, true)\n const controller = new AbortController(), controllers = this.applications.get(input.taskId) ?? new Set<AbortController>()\n controllers.add(controller); this.applications.set(input.taskId, controllers)\n try { return await this.change(async next => {\n const { task, candidate, target } = this.candidateAction(next, actor, input)\n requireFusion(task.adoption !== 'dismissed', 'STALE', 'This candidate was dismissed.')\n requireFusion(!task.application || task.application.state === 'conflict', 'ALREADY_APPLIED', 'This application has already started or completed.')\n const signal = AbortSignal.any([outerSignal, controller.signal, this.controller.signal])\n return host.transact(actor, target, candidate, signal, async access => {\n const preview = await access.prepare()\n requireFusion(preview.version === input.expectedVersion, 'CONFLICT', 'The preview version changed. Preview the current file again.')\n signal.throwIfAborted()\n task.application = { id: this.id(), candidateId: candidate.id, candidateHash: candidate.hash, path: preview.path,\n beforeVersion: preview.version, afterHash: contentHash(preview.after), state: 'pending' }\n task.adoption = 'pending'; task.updatedAt = this.now()\n // Reserve the largest receipt (including JSON escaping) before any irreversible file write.\n requireFusion(JSON.stringify(next).length <= 16_000_000 - 65_536, 'CAPACITY', 'Fusion history has no room for the application receipt. The file was not changed.')\n // Persist the exact resulting file hash while holding both the mutation queue and Host lock.\n await this.persist(next)\n signal.throwIfAborted()\n try {\n const receipt = await access.commit(preview.version)\n requireFusion(receipt.path === preview.path, 'INVALID_RECEIPT', 'Host committed a different destination.')\n task.application.state = 'applied'; task.application.version = text(receipt.version, 'application receipt version', 8192); task.adoption = 'applied'\n task.updatedAt = this.now()\n // A winning disable/cancel cannot erase a completed filesystem receipt.\n return task\n } catch (error) {\n // Keep the durable pending intent for a later, lock-protected inspection.\n throw error\n }\n })\n }) } catch (error) {\n if (this.active) await this.change(next => {\n const pair = next.pairs.find(row => row.leadSessionId === actor.sessionId && row.project === actor.project)\n const task = pair?.tasks.at(-1), candidate = task?.candidates.at(-1)\n if (task?.id === input.taskId && task.revision === input.taskRevision && candidate?.id === input.candidateId && candidate.hash === input.hash && task.state === 'accepted' && task.adoption !== 'applied' && task.adoption !== 'dismissed') {\n if (!task.application || task.application.state === 'conflict') task.adoption = 'conflict'\n task.error = (error instanceof Error ? error.message : String(error)).slice(0, 16_000)\n }\n }).catch(() => {})\n throw error\n } finally {\n controllers.delete(controller)\n if (!controllers.size) this.applications.delete(input.taskId)\n }\n }\n async dismiss(actor: FusionActor, input: FusionCandidateAction): Promise<FusionTask> {\n await this.ready\n return this.change(next => {\n const { task } = this.candidateAction(next, actor, input)\n requireFusion(task.application?.state !== 'pending' && task.adoption !== 'applied', 'ALREADY_APPLIED', 'Inspect the application before dismissing it.')\n task.adoption = 'dismissed'; task.updatedAt = this.now()\n return task\n })\n }\n /** Domain Host only: never expose an RPC that lets a browser claim a file was applied. */\n async adoption(leadSessionId: string, taskId: string, candidateId: string, state: 'applied' | 'dismissed' | 'conflict'): Promise<void> {\n await this.ready\n await this.change(next => {\n const pair = next.pairs.find(row => row.leadSessionId === leadSessionId), task = pair?.tasks.find(row => row.id === taskId)\n requireFusion(task && task.state === 'accepted' && task.candidates.at(-1)?.id === candidateId, 'STALE', 'No accepted candidate matches the Host receipt.')\n requireFusion(task.adoption !== 'applied' || state === 'applied', 'ALREADY_APPLIED', 'An applied receipt cannot be overwritten.')\n task.adoption = state; task.updatedAt = this.now()\n }, true)\n }\n /** Stops owned work only. Invalidate synchronously, then await admissions and cleanup. */\n async dispose(): Promise<void> {\n if (!this.enabled) return\n this.enabled = false; this.generation++; this.controller.abort()\n for (const controllers of this.dispatches.values()) for (const controller of controllers) controller.abort()\n for (const taskId of this.notifications.keys()) this.abortNotifications(taskId)\n const errors: unknown[] = []\n try {\n await this.ready\n await this.change(next => {\n for (const pair of next.pairs) for (const task of pair.tasks) if (isWorking(task.state)) {\n task.state = 'cancelled'; task.cleanup = 'pending'; task.updatedAt = this.now()\n }\n }, true)\n } catch (error) { errors.push(error) }\n await Promise.allSettled([...this.inFlight])\n const results = await Promise.allSettled(this.state.pairs.map(pair => this.native.stop(clone(pair), false)))\n try {\n await this.change(next => {\n next.pairs.forEach((pair, index) => { for (const task of pair.tasks) if (task.cleanup === 'pending') task.cleanup = results[index].status === 'fulfilled' ? 'done' : 'failed' })\n }, true)\n } catch (error) { errors.push(error) }\n for (const result of results) if (result.status === 'rejected') errors.push(result.reason)\n if (errors.length) throw new AggregateError(errors, 'Fusion teardown did not complete cleanly.')\n }\n}\n","import { randomUUID } from 'node:crypto'\nimport type {} from '@klarkxy/dsh-ai-services/contracts'\nimport type { Agent, AgentOptions, AgentRegistry } from '@deepseek-ai/dsh-agent'\nimport type { SessionId } from '@deepseek-ai/dsh-session'\nimport type { MessageId, ReasoningEffortId } from '@deepseek-ai/dsh-llm'\nimport type { SubagentRuntime } from '@deepseek-ai/dsh-subagent'\nimport type { FusionActor, FusionNative, FusionPair } from './contracts.ts'\nimport { isOwnedChildNotice } from './presentation.ts'\nimport { requireFusion } from './validation.ts'\n\nexport interface NativeBindings {\n agents: Pick<AgentRegistry, 'get'>\n subagents: Pick<SubagentRuntime, 'getProvider' | 'startContinuable' | 'sendMessage' | 'interrupt' | 'drainContinuableChildren'>\n}\nexport interface NativeComposition {\n /** The production agent/created hook installs report only on the owned child. */\n scopedReport?: boolean\n verifyContinuation?(pair: FusionPair, signal: AbortSignal): Promise<void>\n /** Names come from the actual composed tool registry, not a guessed global deny list. */\n tools(parent: Agent, pair: FusionPair): string[]\n persona(pair: FusionPair): string\n}\nconst sid = (id: string): SessionId => id as SessionId\n\n/** Identity is derived from the exact live Agent, never a model-supplied role or label. */\nexport function nativeActor(bindings: NativeBindings, agent: Agent | undefined): FusionActor {\n requireFusion(agent && bindings.agents.get(agent.id) === agent, 'UNAUTHORIZED', 'A current live Agent is required.')\n const header = agent.session.header\n requireFusion(typeof header.cwd === 'string' && header.cwd.length > 0, 'NO_WORKSPACE', 'Fusion requires a session workspace.')\n return { sessionId: String(agent.id), project: header.cwd,\n ...(header.parentSession ? { parentSessionId: String(header.parentSession) } : {}) }\n}\nfunction leadOf(bindings: NativeBindings, pair: FusionPair): Agent {\n const lead = bindings.agents.get(sid(pair.leadSessionId))\n const actor = nativeActor(bindings, lead)\n requireFusion(actor.project === pair.project && !actor.parentSessionId, 'UNAUTHORIZED', 'The stored Fusion parent does not match this live workspace.')\n return lead!\n}\nfunction ownedChild(bindings: NativeBindings, pair: FusionPair): Agent | undefined {\n const child = bindings.agents.get(sid(pair.childSessionId))\n if (!child) return undefined\n const actor = nativeActor(bindings, child)\n requireFusion(actor.parentSessionId === pair.leadSessionId && actor.project === pair.project, 'UNAUTHORIZED', 'The live child does not belong to this Fusion pair.')\n return child\n}\n\n/** Adapter only: the pinned native continuation manager owns creation, inboxes and cold resume. */\nexport function createNativeBridge(bindings: NativeBindings, composition: NativeComposition): FusionNative {\n return {\n async dispatch({ pair, prompt, signal }) {\n signal.throwIfAborted()\n const lead = leadOf(bindings, pair)\n if (pair.established) {\n await composition.verifyContinuation?.(pair, signal)\n signal.throwIfAborted()\n // sendMessage, not another spawn, is the native cold-resume entry point.\n const messageId = await bindings.subagents.sendMessage(lead, sid(pair.childSessionId), [{ type: 'text', text: prompt }], { signal })\n return { messageId: String(messageId) }\n }\n const provider = bindings.subagents.getProvider('spawn')\n requireFusion(provider?.prepareContinuable && provider.capabilities.agentOptions\n && provider.capabilities.persona && provider.capabilities.toolFilter,\n 'UNSUPPORTED_CAPABILITY', 'Fusion requires the native spawn provider with continuable, model, persona and tool-filter support.')\n requireFusion(!provider.inheritsParentContext, 'CONTEXT_NOT_ISOLATED', 'The Fusion provider must not copy the parent transcript.')\n requireFusion(!bindings.agents.get(sid(pair.childSessionId)), 'IDENTITY_CONFLICT', 'The reserved child identity is already live.')\n const tools = [...new Set(composition.tools(lead, pair))]\n requireFusion(tools.includes('fusion_report'), 'INVALID_COMPOSITION', 'The child must have its report tool.')\n requireFusion(!tools.includes('fusion_delegate') && !tools.includes('fusion_review'), 'INVALID_COMPOSITION', 'The child cannot own Lead controls.')\n // Generic production children inherit native capabilities and their native permissions.\n // The owned-child execution guard rejects Fusion Lead controls; native policy governs further delegation.\n // Restriction names must be inherited capabilities, not model-visible child-local aliases.\n const toolFilter = pair.profile === 'generic' && composition.scopedReport ? undefined\n : { allow: composition.scopedReport ? tools.filter(name => name !== 'fusion_report') : tools }\n const agentOptions: AgentOptions = {\n provider: pair.route.provider, model: pair.route.model,\n reasoningEffort: pair.route.reasoningEffort as ReasoningEffortId | undefined,\n }\n const started = await bindings.subagents.startContinuable({\n provider: 'spawn', label: pair.profile === 'writing' ? '执笔' : 'Fusion Sidekick', childId: sid(pair.childSessionId),\n request: { parent: lead, prompt: [{ type: 'text', text: prompt }], agentOptions,\n persona: composition.persona(pair), ...(toolFilter ? { toolFilter } : {}), maxDepth: 1 },\n signal,\n })\n requireFusion(String(started.childId) === pair.childSessionId, 'IDENTITY_CONFLICT', 'The native provider returned another child identity.')\n return { messageId: String(started.messageId) }\n },\n async notify({ pair, task, actor, text, signal }) {\n signal.throwIfAborted()\n const lead = leadOf(bindings, pair)\n const marker = `[fusion:${pair.id}:${task.id}:${task.revision}]`\n const content = [{ type: 'text' as const, text: `${marker}\\n${text}` }]\n let messageId: MessageId\n if (actor.sessionId === pair.leadSessionId && !actor.parentSessionId && actor.project === pair.project) {\n // Explicit Host recovery uses saved records, with honest producer attribution.\n // A cold Writer must not be reactivated merely to send its old report.\n messageId = randomUUID() as MessageId\n lead.followup({ id: messageId, role: 'user', source: { kind: 'plugin:@klarkxy/dsh-fusion', plugin: '@klarkxy/dsh-fusion' }, content })\n } else {\n const child = ownedChild(bindings, pair)\n requireFusion(child && String(child.id) === actor.sessionId && actor.parentSessionId === pair.leadSessionId,\n 'UNAUTHORIZED', 'Only the current bound child can report to the Lead.')\n messageId = await bindings.subagents.sendMessage(child, sid(pair.leadSessionId), content, { signal })\n }\n if (signal.aborted) { lead.inbox.remove?.(messageId); signal.throwIfAborted() }\n },\n async stop(pair, stopLead) {\n const child = ownedChild(bindings, pair)\n const lead = bindings.agents.get(sid(pair.leadSessionId))\n if (lead) {\n leadOf(bindings, pair)\n // Remove only this pair's pending notices; leave unrelated user and child work intact.\n const marker = `[fusion:${pair.id}:`\n for (const message of [...(lead.inbox.nextStep ?? []), ...(lead.inbox.nextTurn ?? [])]) {\n if (isOwnedChildNotice(message.source, pair.childSessionId) || (message.source.kind === 'plugin:@klarkxy/dsh-fusion' && message.content.some(block => block.type === 'text' && block.text.includes(marker)))) lead.inbox.remove(message.id)\n }\n }\n // The business service invalidates the task first. Native interrupt alone preserves the inbox.\n child?.inbox.clear()\n if (stopLead && lead) lead.cancel({ kind: 'user' }, { keepInbox: true })\n if (lead) {\n await bindings.subagents.drainContinuableChildren(lead, [sid(pair.childSessionId)])\n } else if (child) {\n // A detached parent cannot authorize drain. Stop work, but never pretend ownership release succeeded.\n bindings.subagents.interrupt(sid(pair.childSessionId), { kind: 'user', parentSessionId: sid(pair.leadSessionId) })\n await child.whenIdle()\n requireFusion(false, 'PARENT_UNAVAILABLE', 'Child execution stopped, but its parent must be restored before ownership cleanup can be confirmed.')\n }\n },\n }\n}\n","import { defineTool } from '@deepseek-ai/dsh-tools'\nimport type { Agent } from '@deepseek-ai/dsh-agent'\nimport type { FusionRuntime } from './runtime.ts'\nimport { requireFusion } from './validation.ts'\n\nconst taskFields = { taskId: { type: 'string' as const, required: true }, taskRevision: { type: 'integer' as const, required: true } } as const\nconst candidateFields = { ...taskFields, candidateId: { type: 'string' as const, required: true }, hash: { type: 'string' as const, required: true } } as const\nconst output = { schema: { type: 'string' as const }, render: (_args: unknown, value: unknown) => [{ type: 'text' as const, text: String(value) }] }\n/** Exact execution Agent identity is bound at registration and checked again on every call. */\nexport function fusionTools(runtime: FusionRuntime, agent: Agent, sidekick: boolean) {\n const bound = (exec: { agent?: unknown }) => {\n requireFusion(exec.agent === agent, 'UNAUTHORIZED', 'Fusion tools cannot be borrowed by another Agent.')\n return runtime.actor(agent)\n }\n if (sidekick) return [defineTool({ name: 'fusion_report', description: 'Report the exact candidate or a decision request for your current Fusion task. Never write the manuscript. Use a unique reportId; do not regenerate or resend after acknowledgement.',\n parameters: { ...taskFields, reportId: { type: 'string', required: true }, kind: { type: 'string', enum: ['candidate', 'decision'], required: true }, text: { type: 'string', required: true }, report: { type: 'string' } }, output,\n async execute(args, exec) { return JSON.stringify(await runtime.service.report(bound(exec), { ...args, signal: exec.signal })) },\n })]\n return [\n defineTool({ name: 'fusion_delegate', description: 'Delegate one bounded task to the same persistent Sidekick. In writing sessions the Writer authors exact prose; provide the original versioned target from read. Wait for its report, then read and review. Generic tasks retain ordinary execution tools; explicitly cancel before takeover.',\n parameters: { title: { type: 'string', required: true }, goal: { type: 'string', required: true }, context: { type: 'string' }, constraints: { type: 'array', items: { type: 'string' } }, acceptance: { type: 'array', items: { type: 'string' } }, target: { type: 'object', additionalProperties: false, properties: { kind: { type: 'string', enum: ['edit', 'create'], required: true }, path: { type: 'string', required: true }, oldText: { type: 'string' }, targetVersion: { type: 'string' }, basis: { type: 'array', items: { type: 'object', properties: { path: { type: 'string', required: true }, version: { type: 'string', required: true }, label: { type: 'string' } }, additionalProperties: false } } }, description: 'Writing target: edit requires original targetVersion and unique exact oldText; Writer text replaces that fragment. create requires a nonexistent .md/.txt path; Writer text becomes full content. basis lists original context read versions. No replacement text is accepted here.' } }, output,\n async execute(args, exec) { bound(exec); return JSON.stringify(await runtime.delegate(agent, args, exec.signal)) },\n }),\n defineTool({ name: 'fusion_read', description: 'Read the saved exact Sidekick candidate and its hash. Review this content without rewriting it.', parameters: { taskId: { type: 'string', required: true }, candidateId: { type: 'string' } }, output,\n async execute(args, exec) { return JSON.stringify(runtime.service.read(bound(exec), args.taskId, args.candidateId)) },\n }),\n defineTool({ name: 'fusion_review', description: 'Review the exact candidate id and hash. accept is model review only; the author still decides manuscript adoption. revise requires concrete feedback. reject ends the task.',\n parameters: { ...candidateFields, verdict: { type: 'string', enum: ['accept', 'revise', 'reject'], required: true }, feedback: { type: 'string', required: true } }, output,\n async execute(args, exec) { return JSON.stringify(await runtime.service.review(bound(exec), { ...args, signal: exec.signal })) },\n }),\n defineTool({ name: 'fusion_decide', description: 'Resolve a Sidekick decision or explicitly resume an interrupted task with feedback, reusing its persistent session.', parameters: { ...taskFields, feedback: { type: 'string', required: true } }, output,\n async execute(args, exec) { return JSON.stringify(await runtime.service.decide(bound(exec), { ...args, signal: exec.signal })) },\n }),\n defineTool({ name: 'fusion_cancel', description: 'Cancel the owned Sidekick task before explicit takeover. This preserves unrelated child sessions and does not undo files already applied.', parameters: taskFields, output,\n async execute(args, exec) { const actor = bound(exec); await runtime.service.cancel(actor, args.taskId, args.taskRevision); return 'Fusion task cancelled; takeover is now explicit.' },\n }),\n ]\n}\n","import type { Context } from '@deepseek-ai/cordis'\nimport type { Agent } from '@deepseek-ai/dsh-agent'\nimport type { SessionId, UserMessage } from '@deepseek-ai/dsh-session'\nimport { foldSubagentDescriptor } from '@deepseek-ai/dsh-subagent'\nimport type {} from '@deepseek-ai/dsh-session-query'\nimport type {} from '@deepseek-ai/dsh-session-projection'\nimport type { WorkspaceRegistry } from '@deepseek-ai/dsh-workspace'\nimport type {} from '@deepseek-ai/dsh-tools'\nimport type {} from '@deepseek-ai/dsh-system-prompt'\nimport type { AiServices } from '@klarkxy/dsh-ai-services/contracts'\nimport { FUSION_PLUGIN, FUSION_PURPOSE, FUSION_TOOLS, type FusionActor, type FusionCandidateAction, type FusionPair, type FusionProfile, type FusionStatus, type FusionStore } from './contracts.ts'\nimport type { FusionWritingHost } from './host-contracts.ts'\nimport { isOwnedChildNotice } from './presentation.ts'\nimport { FusionService } from './service.ts'\nimport { createNativeBridge, nativeActor } from './native.ts'\nimport { fusionTools } from './tools.ts'\nimport { brief, integer, object, requireFusion, text } from './validation.ts'\n\nexport class FusionRuntime {\n readonly service: FusionService\n private readonly ctx: Context\n private readonly ai: AiServices\n private readonly disposers: Array<() => unknown> = []\n private readonly installed = new Map<Agent, Array<() => unknown>>()\n private readonly pendingNoticeClaims = new Set<Promise<void>>()\n private closing?: Promise<void>\n constructor(ctx: Context, store: FusionStore, ai: AiServices) {\n this.ctx = ctx; this.ai = ai\n const native = createNativeBridge({ agents: ctx.agents, subagents: ctx.subagents }, {\n scopedReport: true,\n verifyContinuation: async (pair, signal) => { requireFusion(await this.inspectAdmission(pair, signal) === 'present', 'CHILD_MISSING', 'The persistent Sidekick is missing. Explicitly resume to inspect recovery.') },\n tools: (parent, pair) => this.childTools(parent, pair),\n persona: pair => pair.profile === 'writing'\n ? 'You are the persistent Fusion Writer. Author exact prose candidates for the assigned brief and captured destination. You may inspect allowed context, but must never mutate manuscript files. Report via fusion_report; ask a decision when blocked. Do not delegate, contact the user directly, or treat rejected drafts as story facts. Stop after reporting.'\n : 'You are the persistent Fusion Sidekick. Execute only the assigned bounded task using native permissions. Report exact outcomes and verifiable evidence via fusion_report; report decisions when blocked. Never recursively enable Fusion or take over the Lead. Stop after reporting.',\n })\n this.service = new FusionService({ store, native, inspectAdmission: (pair, signal) => this.inspectAdmission(pair, signal) })\n }\n private async inspectAdmission(pair: FusionPair, signal: AbortSignal): Promise<'present' | 'absent'> {\n signal.throwIfAborted()\n const catalog = await this.ctx.subagents.listChildren(pair.leadSessionId as SessionId, signal)\n const entry = catalog.find(row => String(row.id) === pair.childSessionId)\n let observation\n try { observation = await this.ctx.sessionQuery.observeSession(pair.childSessionId as SessionId, { signal, projectionMode: 'all' }) }\n catch (error) {\n if (error && typeof error === 'object' && 'code' in error && error.code === 'SESSION_QUERY_SESSION_NOT_FOUND' && !entry && !this.ctx.agents.get(pair.childSessionId as SessionId)) return 'absent'\n throw error\n }\n try {\n const header = observation.header, descriptor = foldSubagentDescriptor(observation.events)\n requireFusion(String(header.id) === pair.childSessionId && String(header.parentSession) === pair.leadSessionId && header.cwd === pair.project,\n 'IDENTITY_CONFLICT', 'The native Sidekick does not match this pair and workspace.')\n requireFusion(descriptor?.mode === 'continuable' && descriptor.provider === 'spawn' && (!entry || entry.mode === 'continuable'), 'UNCERTAIN_ADMISSION', 'The saved child has no supported native continuation descriptor.')\n requireFusion(descriptor.agentProvider === pair.route.provider && descriptor.agentModel === pair.route.model && descriptor.agentReasoningEffort === pair.route.reasoningEffort,\n 'ROUTE_CHANGED', 'The native Sidekick route differs from its pinned Fusion route.')\n const selected = observation.projections?.values as { modelSelection?: { next?: { provider: string; model: string; reasoningEffort?: string } | null } } | undefined\n if (selected?.modelSelection?.next) this.checkRoute(pair, selected.modelSelection.next)\n const live = this.ctx.agents.get(pair.childSessionId as SessionId)\n if (live) this.checkRoute(pair, live.options)\n return 'present'\n } finally { observation[Symbol.dispose]() }\n }\n private checkRoute(pair: FusionPair, route: { provider?: string; model?: string; reasoningEffort?: string }): void {\n requireFusion(route.provider === pair.route.provider && route.model === pair.route.model && route.reasoningEffort === pair.route.reasoningEffort,\n 'ROUTE_CHANGED', 'The Sidekick model changed outside Fusion. Restore its pinned route before continuing.')\n }\n actor(agent: Agent): FusionActor {\n requireFusion(this.service.active, 'DISABLED', 'Fusion is disabled.')\n return nativeActor({ agents: this.ctx.agents, subagents: this.ctx.subagents }, agent)\n }\n private writing(): FusionWritingHost | undefined { return this.ctx.get('fusionWriting') as FusionWritingHost | undefined }\n private profile(agent: { session: { header: { agentPreset?: unknown } } }, pair?: FusionPair): FusionProfile {\n const domain = this.writing()\n requireFusion(domain || !String(agent.session.header.agentPreset ?? '').startsWith('dsh-editor'), 'DOMAIN_UNAVAILABLE', 'The Editor writing domain is unavailable; delegation is blocked until it is restored.')\n if (pair?.profile === 'writing') {\n requireFusion(domain && domain.matches(agent.session.header as { agentPreset?: string }), 'DOMAIN_UNAVAILABLE', 'The writing domain is unavailable or this conversation changed writing mode.')\n return 'writing'\n }\n return domain?.matches(agent.session.header as { agentPreset?: string }) ? 'writing' : 'generic'\n }\n private childTools(parent: Agent, pair: FusionPair): string[] {\n // Generic children inherit the native preset composition. Model-visible aliases can be\n // child-local registrations, so they cannot be copied into a pre-creation restriction.\n if (pair.profile !== 'writing') return ['fusion_report']\n const available = parent.ctx.tools.schemas(parent).map(tool => tool.name).filter(name => name !== 'run_code' && !FUSION_TOOLS.includes(name as typeof FUSION_TOOLS[number]))\n this.profile(parent, pair)\n const allow = new Set(this.writing()!.writerTools)\n return [...available.filter(name => allow.has(name)), 'fusion_report']\n }\n async start(): Promise<void> {\n await this.service.initialized()\n const scope = this.ai.activate(FUSION_PLUGIN)\n this.disposers.push(() => scope.dispose())\n this.disposers.push(scope.registerPurpose({ id: FUSION_PURPOSE, label: 'Fusion 持久搭档', defaultTarget: { kind: 'role', role: 'normal' } }))\n this.disposers.push(this.ctx.on('agent/created', async ({ agent }) => { await this.install(agent); return undefined }, { global: true }))\n this.disposers.push(this.ctx.on('agent/disposed', ({ agent }) => { this.uninstall(agent) }, { global: true }))\n for (const agent of this.ctx.agents.list()) await this.install(agent)\n }\n private async install(agent: Agent): Promise<void> {\n if (this.installed.has(agent) || !this.service.active) return\n const header = agent.session.header, pair = this.service.pairFor(String(agent.id))\n const sidekick = pair?.childSessionId === String(agent.id)\n const root = !header.parentSession\n const disposers: Array<() => unknown> = []\n this.installed.set(agent, disposers)\n try {\n // Any inherited registration must still execute as the exact bound Agent.\n disposers.push(agent.ctx.tools.guard(exec => {\n if (exec.agent !== agent) return 'Fusion execution identity mismatch.'\n const livePair = this.service.pairFor(String(agent.id))\n if (!this.service.active) return sidekick || FUSION_TOOLS.includes(exec.name as typeof FUSION_TOOLS[number]) ? 'Fusion is disabled.' : undefined\n if (!root && !sidekick) return FUSION_TOOLS.includes(exec.name as typeof FUSION_TOOLS[number]) ? 'Only the owned Fusion Sidekick may report.' : undefined\n if (sidekick) {\n if (!livePair || livePair.childSessionId !== String(agent.id) || String(header.parentSession) !== livePair.leadSessionId || header.cwd !== livePair.project) return 'Fusion child identity changed.'\n const task = livePair.tasks.at(-1)\n if (!task || !['working', 'dispatching'].includes(task.state)) return 'The Fusion task is no longer accepting execution.'\n if (exec.name === 'fusion_report' || exec.name === 'run_code') return undefined\n if (FUSION_TOOLS.includes(exec.name as typeof FUSION_TOOLS[number])) return 'Sidekick cannot control the Lead.'\n if (livePair.profile === 'writing' && !this.writing()?.writerTools.includes(exec.name)) return 'Writer tools are restricted to the writing domain read surface.'\n if (livePair.profile === 'generic') {\n // Native preset inheritance does not inherit arbitrary per-Agent restrictions.\n // Consult the real Lead view at execution, including scoped aliases and later narrowing.\n const lead = this.ctx.agents.get(livePair.leadSessionId as SessionId)\n if (!lead || lead.session.header.parentSession || lead.session.header.cwd !== livePair.project) return 'The Fusion Lead workspace is unavailable or changed.'\n if (!lead.ctx.tools.get(exec.name, lead)) return 'This capability is not available to the Fusion Lead.'\n }\n return undefined\n }\n if (exec.name === 'fusion_report') return 'Only the owned Sidekick may report.'\n if (exec.name === 'run_code') return undefined\n try {\n if (this.profile(agent, livePair) === 'writing' && !FUSION_TOOLS.includes(exec.name as typeof FUSION_TOOLS[number]) && !this.writing()!.allowLeadTool(exec.name, exec.arguments)) return 'Delegate prose to the Fusion Writer; the author adopts the exact candidate.'\n } catch { return 'The Fusion writing domain is unavailable; execution is blocked until restored.' }\n return undefined\n }))\n if (root) {\n // Native claims before awaiting prompt assembly. Retain this narrow gate through\n // disable until each owned claim enters the gate or its native turn ends.\n const claims = new Map<number, () => void>()\n disposers.push(agent.ctx.on('agent/inbox/claimed', ({ message, turn }) => {\n const pair = this.service.pairFor(String(agent.id))\n if (!pair || !isOwnedChildNotice(message.source, pair.childSessionId) || claims.has(turn)) return\n let resolve!: () => void\n const pending = new Promise<void>(done => { resolve = done })\n this.pendingNoticeClaims.add(pending)\n claims.set(turn, () => { claims.delete(turn); this.pendingNoticeClaims.delete(pending); resolve() })\n }))\n disposers.push(agent.ctx.on('session/event', (_session, event) => {\n if (event.type === 'turn/end') claims.get(event.data.turn)?.()\n }))\n disposers.push(() => { for (const finish of [...claims.values()]) finish() })\n const discard = (message: UserMessage): boolean => {\n const pair = this.service.pairFor(String(agent.id))\n if (!pair || !isOwnedChildNotice(message.source, pair.childSessionId)) return false\n // Fusion reports own the wakeup. Native activation settlement is status, not a second task.\n if (message.source.kind === 'subagent-settled') return true\n const task = pair.tasks.at(-1)\n return !this.service.active || !task || !['review', 'decision'].includes(task.state)\n || !message.content.some(block => block.type === 'text' && block.text.includes(`[fusion:${pair.id}:${task.id}:${task.revision}]`))\n }\n // Keep the owned notice until the native pre-step claims it. Removing it during\n // insertion does not cancel native wakeDriver: an empty turn can still run plugin\n // snapshot middleware and inference. The claimed notice is the precise rejection cause.\n disposers.push(agent.ctx.on('agent/pre-step', async (payload, next) => {\n // Only the first step is a new wake. Later steps still belong to the existing\n // user turn (including explicit takeover after fusion_cancel); native turnEnds\n // decides whether an empty filtered continuation needs another model step.\n const newTurn = payload.step === 1\n const rejectOwnedWake = newTurn && payload.messages.length > 0 && payload.messages.every(discard)\n claims.get(payload.turn)?.()\n if (rejectOwnedWake) return { kind: 'reject' }\n const decision = await next()\n if (decision.kind === 'reject') return decision\n const messages = decision.messages.filter(message => !discard(message))\n return newTurn && decision.messages.length > 0 && messages.length === 0 ? { kind: 'reject' } : { ...decision, messages }\n }, { prepend: true }))\n }\n if (!root && !sidekick) return\n if (sidekick) {\n requireFusion(pair && header.cwd === pair.project && String(header.parentSession) === pair.leadSessionId, 'UNAUTHORIZED', 'Stored Writer identity does not match the native child.')\n if (pair.profile === 'writing') {\n const registry = this.ctx.get('workspaceRegistry') as WorkspaceRegistry | undefined\n const parent = this.ctx.sessions.get(pair.leadSessionId as SessionId)\n requireFusion(registry && parent && parent.header.cwd === pair.project && !parent.header.parentSession, 'WORKSPACE_UNAVAILABLE', 'The Writer requires its real Lead workspace.')\n const workspace = await registry.resolveByPath(pair.project)\n requireFusion(workspace && workspace.sessionIds.some(id => String(id) === pair.leadSessionId), 'WORKSPACE_MISMATCH', 'The Lead is not attached to this workspace.')\n await workspace.attachSession(agent.id)\n this.actor(agent)\n }\n const turns = new Map<number, { taskId: string; revision: number }>()\n disposers.push(agent.ctx.on('session/event', (_session, event) => {\n if (event.type === 'turn/start') {\n const task = this.service.pairFor(String(agent.id))?.tasks.at(-1)\n if (task) turns.set(event.data.turn, { taskId: task.id, revision: task.revision })\n }\n if (event.type === 'turn/end') {\n const expected = turns.get(event.data.turn)\n turns.delete(event.data.turn)\n if (!expected || !this.service.active) return\n const reason = event.data.reason.kind === 'error' ? event.data.reason.error.message : `The Sidekick turn ended (${event.data.reason.kind}) without a saved report. Inspect its session before resuming.`\n void this.service.executionInterrupted(this.actor(agent), reason, expected).catch(error => this.ctx.logger.warn('Fusion could not save child settlement', error))\n }\n }))\n this.checkRoute(pair, agent.options)\n disposers.push(agent.ctx.on('agent/request', async (_payload, next) => {\n const config = await next()\n try { this.checkRoute(pair, config) }\n catch (error) { await this.service.executionInterrupted(this.actor(agent), error instanceof Error ? error.message : String(error)); throw error }\n return config\n }, { prepend: true }))\n if (pair.profile === 'writing') requireFusion(this.writing(), 'DOMAIN_UNAVAILABLE', 'Writing domain required for the existing Writer.')\n }\n for (const tool of fusionTools(this, agent, sidekick)) disposers.push(agent.ctx.tools.register(tool))\n if (root) disposers.push(agent.ctx.systemPrompt.section({ name: 'fusion:lead', order: 95,\n text: 'Fusion collaboration is enabled. You are the Lead in the original user conversation. Discuss, plan and review; use fusion_delegate for bounded Sidekick work. Only one task may be active. Read its exact saved candidate with fusion_read before fusion_review. Accept means model review, never author file adoption. In writing modes, delegate prose editing/creation with its original read versions; do not rewrite the Writer candidate while forwarding it. Resolve decisions with fusion_decide. For explicit takeover cancel the task first with fusion_cancel. Ordinary generic native tools remain available. Existing model route stays pinned to this pair. Never create another Fusion pair from child sessions.' }))\n } catch (error) { this.uninstall(agent); throw error }\n }\n private uninstall(agent: Agent): void {\n const disposers = this.installed.get(agent)\n this.installed.delete(agent)\n for (const dispose of disposers?.reverse() ?? []) dispose()\n }\n async delegate(agent: Agent, input: unknown, signal: AbortSignal) {\n const actor = this.actor(agent), row = object(input), pair = this.service.pairFor(actor.sessionId)\n requireFusion(!actor.parentSessionId, 'UNAUTHORIZED', 'Only root sessions delegate.')\n const profile = this.profile(agent, pair)\n const route = pair?.route ?? await this.ai.resolve(FUSION_PURPOSE, actor.sessionId)\n signal.throwIfAborted(); this.actor(agent)\n const target = profile === 'writing' ? await this.writing()!.capture(actor, row.target, signal) : undefined\n signal.throwIfAborted(); this.actor(agent)\n return this.service.delegate(actor, { profile, route: { provider: route.provider, model: route.model, ...(route.reasoningEffort ? { reasoningEffort: route.reasoningEffort } : {}) }, brief: brief(row), ...(target ? { target } : {}), signal })\n }\n private rpcActor(sessionId: string): { actor: FusionActor; session: NonNullable<ReturnType<Context['sessions']['get']>> } {\n const session = this.ctx.sessions.get(sessionId as SessionId)\n requireFusion(session && String(session.id) === sessionId, 'SESSION_NOT_FOUND', 'The native session is not loaded.')\n requireFusion(!session.header.parentSession && this.service.role(sessionId) !== 'sidekick', 'UNAUTHORIZED', 'A child session cannot act as the Lead.')\n const project = text(session.header.cwd, 'session workspace', 8192)\n const pair = this.service.pairFor(sessionId)\n requireFusion(!pair || pair.project === project, 'CONTEXT_CHANGED', 'The session workspace differs from the Fusion pair.')\n return { actor: { sessionId, project }, session }\n }\n async rpc(endpoint: string, payload: unknown, signal: AbortSignal): Promise<unknown> {\n await this.service.initialized(); signal.throwIfAborted()\n requireFusion(this.service.active, 'DISABLED', 'Fusion is disabled.')\n const row = object(payload), sessionId = text(row.sessionId, 'session id', 200)\n const { actor, session } = this.rpcActor(sessionId)\n const pair = this.service.pairFor(sessionId), profile = this.profile({ session }, pair)\n const domain = profile === 'writing' ? this.writing()! : undefined\n if (domain) await this.service.reconcile(actor, domain, signal)\n signal.throwIfAborted(); this.rpcActor(sessionId)\n if (endpoint === 'status') {\n let error: string | undefined\n if (!pair) { try { await this.ai.resolve(FUSION_PURPOSE, sessionId) } catch (cause) { error = cause instanceof Error ? cause.message : String(cause) } }\n const current = this.service.pairFor(sessionId)\n const status: FusionStatus = { available: true, configured: !error, profile, revision: this.service.snapshot().revision,\n ...(error ? { error } : {}), ...(current ? { pair: current } : {}), usage: { leadTokens: null, sidekickTokens: null, cost: null },\n activity: { lead: this.ctx.agents.get(sessionId as SessionId)?.status ?? 'idle', sidekick: current ? this.ctx.agents.get(current.childSessionId as SessionId)?.status ?? 'idle' : 'idle' } }\n return status\n }\n const taskId = text(row.taskId, 'task id', 200), taskRevision = integer(row.taskRevision, 'task revision')\n if (endpoint === 'cancel') { await this.service.cancel(actor, taskId, taskRevision, true); return null }\n if (endpoint === 'resume') return this.service.decide(actor, { taskId, taskRevision, feedback: text(row.feedback, 'feedback', 16_000), signal })\n if (endpoint === 'recover') return this.service.recover(actor, taskId, taskRevision, signal)\n requireFusion(domain, 'DOMAIN_UNAVAILABLE', 'File adoption requires a writing domain.')\n const action: FusionCandidateAction = { sessionId, taskId, taskRevision, candidateId: text(row.candidateId, 'candidate id', 200), hash: text(row.hash, 'candidate hash', 64) }\n if (endpoint === 'preview') return this.service.preview(actor, action, domain, signal)\n if (endpoint === 'apply') return this.service.applyCandidate(actor, { ...action, expectedVersion: text(row.expectedVersion, 'expected version', 8192, true) }, domain, signal)\n if (endpoint === 'dismiss') return this.service.dismiss(actor, action)\n requireFusion(false, 'NOT_FOUND', 'Unknown Fusion endpoint.')\n }\n dispose(): Promise<void> {\n if (this.closing) return this.closing\n this.closing = (async () => {\n try { await this.service.dispose() }\n finally {\n // Drain may queue a settlement behind an unrelated running Lead request. Native\n // delivery is now finished: remove only still-pending owned notices before the\n // gate is uninstalled. An idle driver's synchronous claim is covered below.\n for (const agent of this.installed.keys()) {\n const pair = this.service.pairFor(String(agent.id))\n if (!pair || pair.leadSessionId !== String(agent.id) || this.ctx.agents.get(agent.id) !== agent) continue\n for (const message of [...agent.inbox.nextStep, ...agent.inbox.nextTurn]) {\n if (isOwnedChildNotice(message.source, pair.childSessionId)) agent.inbox.remove(message.id)\n }\n }\n // Wait only for already-claimed owned notices, never for an entire Lead turn,\n // unrelated input, or a middleware approval after this gate has been entered.\n while (this.pendingNoticeClaims.size) await Promise.all([...this.pendingNoticeClaims])\n for (const agent of [...this.installed.keys()]) this.uninstall(agent)\n for (const dispose of this.disposers.reverse()) dispose()\n }\n })()\n return this.closing\n }\n}\n","import type { Context } from '@deepseek-ai/cordis'\nimport type {} from '@deepseek-ai/dsh-storage-domain'\nimport { registerHostRpc, type HostRpcContext } from '@klarkxy/dsh-ai-services'\nimport type { AiServices } from '@klarkxy/dsh-ai-services/contracts'\nimport { FUSION_PLUGIN, FUSION_RPC_CHANNEL } from './contracts.ts'\nimport { FusionError } from './validation.ts'\nimport { fusionDomain, createFusionStore } from './storage.ts'\nimport { FusionRuntime } from './runtime.ts'\nexport const name = FUSION_PLUGIN\nexport const inject = ['agents', 'subagents', 'tools', 'systemPrompt', 'sessions', 'sessionQuery', 'sessionProjections', 'storageDomain', 'aiServices', 'connection', 'webServer'] as const\nexport type * from './contracts.ts'\nexport type * from './host-contracts.ts'\nexport { FusionRuntime } from './runtime.ts'\nexport async function apply(ctx: Context): Promise<void> {\n const domain = await ctx.storageDomain.open(fusionDomain)\n let runtime: FusionRuntime | undefined\n try {\n runtime = new FusionRuntime(ctx, createFusionStore(domain.table('state')), ctx.get('aiServices') as AiServices)\n await runtime.start()\n } catch (error) {\n if (runtime) await runtime.dispose().catch(() => {})\n await domain.close()\n throw error\n }\n const activeRuntime = runtime\n ctx.effect(() => async () => { try { await activeRuntime.dispose() } finally { await domain.close() } }, 'fusion.dispose')\n ctx.provide('fusion', activeRuntime)\n ctx.effect(() => registerHostRpc(ctx as Context & HostRpcContext, FUSION_RPC_CHANNEL, async (endpoint, payload, signal) => {\n try { return { ok: true as const, value: await activeRuntime.rpc(endpoint, payload, signal) } }\n catch (error) { return { ok: false as const, error: { code: error instanceof FusionError ? error.code : 'FAILED', message: error instanceof Error ? error.message : String(error) } } }\n }), 'fusion.rpc')\n}\n"],"mappings":";;;;;;;;AAGA,IAAa,cAAb,cAAiC,MAAM;CACrC;CACA,YAAY,MAAc,SAAiB;EAAE,MAAM,OAAO;EAAG,KAAK,OAAO;EAAe,KAAK,OAAO;CAAK;AAC3G;AACA,SAAgB,cAAc,WAAoB,MAAc,SAAoC;CAClG,IAAI,CAAC,WAAW,MAAM,IAAI,YAAY,MAAM,OAAO;AACrD;AACA,SAAgB,KAAK,OAAgB,OAAe,KAAa,QAAQ,OAAe;CACtF,cAAc,OAAO,UAAU,YAAY,MAAM,UAA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AAIjL,eAAsB,MAAM,KAA6B;CACvD,MAAM,SAAS,MAAM,IAAI,cAAc,KAAK,YAAY;CACxD,IAAI;CACJ,IAAI;EACF,UAAU,IAAI,cAAc,KAAK,kBAAkB,OAAO,MAAM,OAAO,CAAC,GAAG,IAAI,IAAI,YAAY,CAAe;EAC9G,MAAM,QAAQ,MAAM;CACtB,SAAS,OAAO;EACd,IAAI,SAAS,MAAM,QAAQ,QAAQ,CAAC,CAAC,YAAY,CAAC,CAAC;EACnD,MAAM,OAAO,MAAM;EACnB,MAAM;CACR;CACA,MAAM,gBAAgB;CACtB,IAAI,aAAa,YAAY;EAAE,IAAI;GAAE,MAAM,cAAc,QAAQ;EAAE,UAAU;GAAE,MAAM,OAAO,MAAM;EAAE;CAAE,GAAG,gBAAgB;CACzH,IAAI,QAAQ,UAAU,aAAa;CACnC,IAAI,aAAa,gBAAgB,KAAiC,oBAAoB,OAAO,UAAU,SAAS,WAAW;EACzH,IAAI;GAAE,OAAO;IAAE,IAAI;IAAe,OAAO,MAAM,cAAc,IAAI,UAAU,SAAS,MAAM;GAAE;EAAE,SACvF,OAAO;GAAE,OAAO;IAAE,IAAI;IAAgB,OAAO;KAAE,MAAM,iBAAiB,cAAc,MAAM,OAAO;KAAU,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;IAAE;GAAE;EAAE;CACxL,CAAC,GAAG,YAAY;AAClB"}
|
package/package.json
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@klarkxy/dsh-fusion",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Persistent native Lead and Sidekick collaboration with exact author-reviewed writing candidates.",
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=22"
|
|
9
|
+
},
|
|
10
|
+
"main": "./lib/index.js",
|
|
11
|
+
"types": "./lib/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./lib/index.d.ts",
|
|
15
|
+
"import": "./lib/index.js",
|
|
16
|
+
"default": "./lib/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./contracts": {
|
|
19
|
+
"types": "./lib/contracts.d.ts",
|
|
20
|
+
"import": "./lib/contracts.js",
|
|
21
|
+
"default": "./lib/contracts.js"
|
|
22
|
+
},
|
|
23
|
+
"./client": {
|
|
24
|
+
"default": "./lib/client.js"
|
|
25
|
+
},
|
|
26
|
+
"./package.json": "./package.json",
|
|
27
|
+
"./host-contracts": {
|
|
28
|
+
"types": "./lib/host-contracts.d.ts",
|
|
29
|
+
"import": "./lib/host-contracts.js",
|
|
30
|
+
"default": "./lib/host-contracts.js"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"lib",
|
|
35
|
+
"cordis.patch.yml",
|
|
36
|
+
"README.md",
|
|
37
|
+
"LICENSE",
|
|
38
|
+
"docs/README.zh-CN.md"
|
|
39
|
+
],
|
|
40
|
+
"dsh": {
|
|
41
|
+
"bundle": {
|
|
42
|
+
"patch": "./cordis.patch.yml"
|
|
43
|
+
},
|
|
44
|
+
"client": {
|
|
45
|
+
"platform": "web",
|
|
46
|
+
"inject": [
|
|
47
|
+
"@deepseek-ai/dsh-client-connection",
|
|
48
|
+
"@deepseek-ai/dsh-api-session-controller",
|
|
49
|
+
"@deepseek-ai/dsh-client-locale",
|
|
50
|
+
"@deepseek-ai/dsh-client-ui-session"
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"dshEditor": {
|
|
55
|
+
"role": "feature",
|
|
56
|
+
"visibility": "public",
|
|
57
|
+
"wrapClient": true,
|
|
58
|
+
"entries": [
|
|
59
|
+
{
|
|
60
|
+
"id": "fusion",
|
|
61
|
+
"title": "Fusion 协作",
|
|
62
|
+
"description": "主助手统筹、持久搭档执行,写作候选由你确认采用",
|
|
63
|
+
"feature": "fusion",
|
|
64
|
+
"service": "fusion",
|
|
65
|
+
"defaultEnabled": false
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
"dependencies": {
|
|
70
|
+
"@deepseek-ai/dsh-storage-domain": "0.1.7-rc.2",
|
|
71
|
+
"zod": "^4.1.5",
|
|
72
|
+
"@klarkxy/dsh-ai-services": "0.1.3"
|
|
73
|
+
},
|
|
74
|
+
"peerDependencies": {
|
|
75
|
+
"@deepseek-ai/cordis": "^4.0.4",
|
|
76
|
+
"@deepseek-ai/dsh-agent": ">=0.1.7-alpha.1 <0.2.0",
|
|
77
|
+
"@deepseek-ai/dsh-subagent": ">=0.1.7-alpha.1 <0.2.0",
|
|
78
|
+
"@deepseek-ai/dsh-tools": ">=0.1.7-alpha.1 <0.2.0",
|
|
79
|
+
"@deepseek-ai/dsh-session": ">=0.1.7-alpha.1 <0.2.0",
|
|
80
|
+
"@deepseek-ai/dsh-llm": ">=0.1.7-alpha.1 <0.2.0",
|
|
81
|
+
"@deepseek-ai/dsh-system-prompt": ">=0.1.7-alpha.1 <0.2.0",
|
|
82
|
+
"@deepseek-ai/dsh-session-query": ">=0.1.7-alpha.1 <0.2.0",
|
|
83
|
+
"@deepseek-ai/dsh-session-projection": ">=0.1.7-alpha.1 <0.2.0",
|
|
84
|
+
"@deepseek-ai/dsh-workspace": ">=0.1.7-alpha.1 <0.2.0"
|
|
85
|
+
},
|
|
86
|
+
"devDependencies": {
|
|
87
|
+
"@deepseek-ai/cordis": "^4.0.4",
|
|
88
|
+
"@deepseek-ai/dsh-llm": "0.1.7-rc.2",
|
|
89
|
+
"@deepseek-ai/dsh-session": "0.1.7-rc.2",
|
|
90
|
+
"react": "^18.2.0",
|
|
91
|
+
"@types/react": "18.3.31",
|
|
92
|
+
"@deepseek-ai/dsh-agent": "0.1.7-rc.2",
|
|
93
|
+
"@deepseek-ai/dsh-subagent": "0.1.7-rc.2",
|
|
94
|
+
"@deepseek-ai/dsh-tools": "0.1.7-rc.2",
|
|
95
|
+
"@deepseek-ai/dsh-system-prompt": "0.1.7-rc.2",
|
|
96
|
+
"@deepseek-ai/dsh-session-query": "0.1.7-rc.2",
|
|
97
|
+
"@deepseek-ai/dsh-session-projection": "0.1.7-rc.2",
|
|
98
|
+
"@deepseek-ai/dsh-workspace": "0.1.7-rc.2"
|
|
99
|
+
},
|
|
100
|
+
"keywords": [
|
|
101
|
+
"dsh",
|
|
102
|
+
"dsh-plugin",
|
|
103
|
+
"deepseek-harness",
|
|
104
|
+
"fusion",
|
|
105
|
+
"collaboration"
|
|
106
|
+
],
|
|
107
|
+
"repository": {
|
|
108
|
+
"type": "git",
|
|
109
|
+
"url": "git+https://github.com/klarkxy/dsh-editor.git",
|
|
110
|
+
"directory": "packages/dsh-fusion"
|
|
111
|
+
},
|
|
112
|
+
"homepage": "https://github.com/klarkxy/dsh-editor/tree/main/packages/dsh-fusion#readme",
|
|
113
|
+
"bugs": {
|
|
114
|
+
"url": "https://github.com/klarkxy/dsh-editor/issues"
|
|
115
|
+
},
|
|
116
|
+
"publishConfig": {
|
|
117
|
+
"access": "public",
|
|
118
|
+
"registry": "https://registry.npmjs.org/"
|
|
119
|
+
},
|
|
120
|
+
"dshRelease": {
|
|
121
|
+
"contentHash": "sha256-a0a9f420d2bbac48725847ac76f62b7059c761b1a3003d622b09f69edfe18e0b"
|
|
122
|
+
},
|
|
123
|
+
"scripts": {
|
|
124
|
+
"build": "tsdown && node ../../scripts/wrap-client.mjs @klarkxy/dsh-fusion",
|
|
125
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
126
|
+
"test": "node --experimental-strip-types --test test/*.node.mjs"
|
|
127
|
+
}
|
|
128
|
+
}
|