Commit Graph
52 Commits
Author SHA1 Message Date
hy 6fd15f62d6 Archive completed OpenSpec changes and refresh workbench docs 2026-03-18 09:22:00 +08:00
huangyuan b9f40188d0 分析 ai 测试报告字段」} continuous 0? oh w/ 》 2026-03-14 14:33:43 +08:00
huangyuan a920fdaa74 Rewrite docs and ai design flow 2026-03-14 11:47:34 +08:00
hy 5f6beebe21 Start new openspec change process 2026-03-13 16:44:14 +08:00
hy 3643c32394 Update test catalog governance 2026-03-13 15:54:51 +08:00
hy d7f078ef66 Organize accumulated tests and docs 2026-03-13 14:59:59 +08:00
hy 828ba1610d Review human-led delivery handoff 2026-03-13 12:52:50 +08:00
hy 5f4582b734 Update human-led delivery docs 2026-03-13 12:52:09 +08:00
hy f7aa26ba01 Archive improve-human-test-eval 2026-03-12 17:48:11 +08:00
hy 97857b6037 补充测试文档入口README纲要潜在漂移 2026-03-12 16:32:51 +08:00
hy b7716722d6 Archive refactor conversation workbe 2026-03-12 16:08:50 +08:00
hy 135304c821 Restructure doc hierarchy and skills 2026-03-12 15:30:04 +08:00
hy f73f4b86dd Clean renderer warning noise on UI 2026-03-12 14:02:55 +08:00
hy 3021f202b5 Clarify AI edit confirmation flow 2026-03-12 11:30:12 +08:00
hy b9deb51925 Rename human-live naming 2026-03-12 10:26:01 +08:00
hy f7de58edd4 Add doc/test directory docs 2026-03-11 17:24:54 +08:00
hy 5e7fa4c298 Add workspace-web-source-scope tests 2026-03-11 14:53:12 +08:00
hy 5333e42681 Update renderer AI test harness docs 2026-03-11 14:25:24 +08:00
hy 8991a16319 Migrate ai directory structure 2026-03-11 14:21:35 +08:00
huangyuan fa228c680b new workspace 2026-03-10 18:31:29 +08:00
hy 097787be46 Clarify @ scope reference intent 2026-03-09 19:21:57 +08:00
hy 51c7a815fb Implement workspace source scope 2026-03-09 17:15:56 +08:00
hy 4f0c9a9e00 设计 brain 驱动 skill 加载方案 2026-03-06 18:34:55 +08:00
hy 89347fe307 Document AI testing contract updates 2026-03-06 11:21:04 +08:00
hy 49560e5677 Clarify docx apply ops replace text 2026-03-05 18:37:18 +08:00
hy 24b37d5684 feat: add capability for docx file manipulation and human live case execution
- Introduced new fixtures for docx testing, including sample-edit.docx and README.md.
- Implemented assertions and runtime management for capability cases.
- Created event collector and fixture guard for managing test environments.
- Developed human live case execution with approval policies and workspace management.
- Added tests for missing fixtures, docx operations, and human live scenarios.
- Configured Vitest for AI test suites with appropriate timeouts and environment settings.
2026-03-05 17:50:35 +08:00
hy 699e308c0e feat(tests): implement script-based testing framework for AI capabilities and human tasks 2026-03-05 17:23:15 +08:00
hy b7389787d7 refactor: remove AI runtime test framework files to streamline project structure 2026-03-05 16:16:38 +08:00
hy ae8ec9a460 refactor: unify AI prompt management and enhance human execution flow
- Introduced a centralized AI prompt registry to consolidate main, human, and memory prompts, improving maintainability and auditability.
- Enhanced human execution strategy to allow for progressive exploration in case of recoverable failures, preventing premature task blocking.
- Removed the `HumanTaskInput.mode` field, simplifying the input contract to `taskId` and `objective`, reducing coupling and complexity.
- Updated relevant documentation and specifications to reflect architectural changes and ensure consistency across the system.
- Implemented structured prompt building interfaces to enforce output contracts and improve prompt quality.
- Ensured backward compatibility by maintaining existing event semantics while transitioning to the new prompt management system.
2026-03-05 15:02:11 +08:00
hy 3e6763fcaa refactor: centralize AI prompt management and enhance human execution flow
- Introduced a unified prompt registry for main, human, and memory prompts to improve maintainability and reduce duplication.
- Replaced inline prompts in various nodes with calls to the new prompt registry.
- Enhanced the human execution model to allow for progressive exploration after recoverable failures, rather than immediate blocking.
- Removed the `mode` field from `HumanTaskInput`, simplifying the input contract to just `taskId` and `objective`.
- Updated documentation to reflect changes in architecture and prompt management.
- Added structured prompt building functions to ensure consistent output contracts across the system.
2026-03-05 14:06:27 +08:00
hy c1139a33d9 feat: Update AI architecture and node structure to enhance task execution flow and state management 2026-03-04 15:34:01 +08:00
hy e212b5b9e4 Refactor AI Node Structure: Remove Slot Commit and Human Init Nodes, Simplify Tool Execution Flow
- Deleted `initNode.ts` and `slotCommitNode.ts` to streamline the human node structure.
- Updated `toolExecNode.ts` to remove unnecessary phases and simplify the tool execution logic.
- Adjusted `types.ts` to reflect the removal of phases and state properties related to slot management.
- Modified `contextDispatchNode.ts` and `dispatchNode.ts` to align with the new flow and removed references to slot states.
- Introduced `intentNode.ts` to handle intent decisions and context enrichment.
- Updated state schemas to remove slot-related properties and adjust the main stage flow.
- Cleaned up unused imports and types across various files to enhance code clarity and maintainability.
2026-03-04 14:08:03 +08:00
hy 1b51298756 feat: Implement tool-driven capabilities for terminal and docx editing
- Introduced a new tool-based architecture for `terminal_exec` and `docx` capabilities, allowing natural-language objectives to drive command execution and document editing.
- Refactored `terminal_exec` to utilize LangChain tools for executing shell commands, enforcing workspace boundaries and approval processes.
- Developed a structured tool set for the `docx` capability, enabling inspect, edit, apply, and save operations while maintaining Node.js compatibility.
- Added artifact metadata events for file outputs from both capabilities, ensuring proper correlation and UI integration.
- Established requirements and specifications for the new capabilities, including bounded execution loops and explicit success/failure states.
- Updated shared contracts and event definitions to support the new tool-driven execution model.
2026-03-04 10:14:51 +08:00
hy 179a631b9a feat: implement human task execution and context management nodes
- Added `toolExecNode.ts` for executing tools in human tasks, handling tool responses, and managing task states.
- Introduced `types.ts` to define types related to human run states and phases.
- Created `contextDispatchNode.ts` for dispatching context enrichment tasks.
- Developed `contextGateNode.ts` to manage context decision-making and transitions.
- Implemented `dispatchNode.ts` for handling task dispatching and state updates.
- Added `finalizeNode.ts` to generate final answers based on task outcomes.
- Created helper functions in `helpers.ts` for managing context evidence and task planning.
- Implemented `planNode.ts` for generating task plans based on user input and context.
- Updated `types.ts` to include new types for human tasks and context management.
- Refactored utility functions in `aiCapabilityUtils.ts` to streamline task handling.
- Enhanced `ChatPage.tsx` to support new event types and display human step tracking.
- Updated shared types to include new event stages and task definitions.
2026-03-03 17:20:17 +08:00
hy d08b30865b feat: implement host action executor and tools for AI capabilities
- Add hostActionExecutor.ts to manage execution of host actions including context retrieval, plan creation, and final answers.
- Introduce hostActionTools.ts for defining and validating host action schemas.
- Create hostNode.ts to handle decision-making and task execution logic for the AI host.
- Implement hostPrompt.ts to generate prompts for host decision-making based on current state and context evidence.
- Enhance runtime.ts to include local instructions in the AI run context.
- Update types.ts to define new types for host actions and events.
- Modify ChatPage.tsx to handle internal events and improve user feedback on task execution and approval processes.
- Ensure proper handling of internal events in the UI to avoid unnecessary user notifications.
2026-03-02 17:21:36 +08:00
hy 6ebab8bd00 feat: implement host decision loop with context enrichment and tool actions 2026-03-02 16:35:52 +08:00
hy 1572ec2e46 refactor: update project documentation language from English to Chinese (simplified) 2026-03-02 14:00:20 +08:00
hy fbdc178715 fix: update document language from Chinese to English 2026-03-02 11:42:07 +08:00
hy 966bed56c2 refactor: update project documentation and language specifications 2026-03-02 11:40:45 +08:00
hy b4c49ca782 feat: add terminal capability tools and file artifact management
- Implemented `emitFileArtifactEvent` for emitting file artifact events.
- Created `TerminalCapabilityTools` for executing terminal commands with workspace boundary checks and risk classification.
- Added `checkWorkspaceBoundary` and `classifyCommandRisk` functions for command validation.
- Introduced `terminalPolicy` for managing terminal command policies.
- Enhanced `ChatPage` to display file artifacts and provide options to open or reveal paths.
- Updated shared types to include artifact-related types and events.
- Added utility functions for grouping artifact events by task.
2026-02-28 18:41:59 +08:00
hy e31f1aeab5 Add specifications for various AI tooling capabilities
- Introduced `ai-tooling-docx` specification defining Node.js-first docx capability contract and implementation constraints.
- Added `ai-tooling-file-links` specification for local file artifact metadata emission and main-process local file actions.
- Created `ai-tooling-retrieval` specification outlining local knowledge-base retrieval tools and document scoping support.
- Established `ai-tooling-terminal-exec` specification detailing terminal command execution, loop controls, and risk policy enforcement.
- Defined `ai-tooling-writing` specification to remove legacy writing tools from active runtime and block deprecated tool invocations.
- Introduced `ai-workspace-sandbox` specification requiring workspace binding for executable actions and enforcing sandbox boundaries.
- Added `blocknote-export` specification for BlockNote-based document editing and export capabilities.
- Created `boundary-decode-governance` specification for handling untrusted dynamic input and narrowing unknown values.
- Established `chat-execution-ui` specification for enhancing chat UI with document targeting, workspace selection, and activity feeds.
- Added `chat-history-memory-v1` specification for managing session memory and excluding sensitive data.
- Introduced `document-type-ui` specification for distinguishing document types in UI and providing source information.
- Created `kb-writing-citation-trace` specification for tracking cited documents and chunks in writing workflows.
- Added `kb-writing-source-selection` specification for user document selection in writing input using "@" mentions.
- Established `kb-writing-workflow` specification for orchestrating knowledge-grounded writing workflows with structured progress events.
- Introduced `layered-storage-api` specification for redesigning storage API with clear layering and encapsulation.
- Created `type-ownership-layering` specification for managing shared contracts and internal type boundaries.
- Added `type-safety-any-governance` specification to disallow explicit `any` in active architecture paths and enforce typed contracts.
- Introduced `web-document-search` specification for indexing and searching web documents alongside files.
- Created `web-url-import` specification for importing web URLs and extracting relevant content for indexing.
- Established `writing-workflow-modularization` specification for modularizing writing workflow stages and centralizing utilities.
- Added `writing-workflow` specification to remove legacy interactions and define migration policies for existing writing data.
- Introduced `writing-workspace` specification for organizing writing documents in folders and managing document persistence.
2026-02-28 18:14:28 +08:00
hy 34c9fa3155 Refactor AI graph processing and utility functions
- Introduced utility functions for handling carrier content and tool calls in `graph.ts`.
- Simplified task mapping logic by creating a dedicated `toPlannedTask` function.
- Enhanced error handling in `ModelService` and `EmbeddingService` for better clarity.
- Added new utility functions in `decoder.ts` for type-safe conversions.
- Improved document handling in `DocumentsStore` with better type checks and normalization.
- Updated preload API to streamline communication between renderer and main process.
- Enhanced type definitions for better clarity and maintainability in global types.
- Refactored components to improve type safety and reduce TypeScript errors.
2026-02-28 17:57:39 +08:00
hy 537915d067 refactor: remove deprecated writing workflow types and methods
- Removed WritingFolderRecord, WritingDocumentRecord, and related methods from global types.
- Cleaned up legacy writing workflow types and events from shared types.
- Updated serialization utility to improve type safety for IPC results.
- Changed input and output types in AiRunEvent to use 'unknown' for better type handling.
2026-02-28 17:09:35 +08:00
hy 8bcbe7980e feat: add terminal execution capabilities and approval workflow
- Implemented a new terminal execution service in `terminalExec.ts` to run shell commands with configurable options.
- Removed deprecated writing tools from `writingTools.ts`.
- Updated AI task types to include 'terminal_exec' and 'local_kb_retrieval'.
- Enhanced AI run context and state management to support document selection and workspace configuration.
- Added approval request and decision types to the AI run event system.
- Modified the ChatPage component to handle terminal execution events and display results.
- Introduced UI elements for selecting documents and specifying workspace paths.
2026-02-28 15:42:52 +08:00
hy f2a269d68d Refactor LangGraph AI architecture to support host-centric execution model
- Shift architecture from writing-workspace automation to a general AI-hosted local execution model.
- Introduce new LangGraph-based AI runtime with host, local_kb_retrieval, terminal_exec, and docx capabilities.
- Implement structured execution event stream for UI rendering of plans, tasks, and tool steps.
- Remove legacy writing workflow interactions and persistence from active flow.
- Enforce workspace binding for executable runs and introduce sandbox policy for terminal actions.
- Add dual-layer execution UX in chat with inline AI activity feed and dedicated plan UI.
- Define capability registry for dispatching tasks and support placeholder capabilities.
- Update chat UI to require workspace selection and visualize execution progress.
- Remove deprecated writing workflow IPC endpoints and ensure no active paths depend on writing-domain stores.
2026-02-28 13:09:01 +08:00
hy 3d2b30c713 feat(ai-runtime): 引入基于LangGraph的AI运行时以重构聊天模式
- 新增LangGraph状态机,包含host、retrieval、writer和answer四个节点,支持多步骤任务执行
- 实现AI运行事件流,通过IPC向渲染进程发送计划、任务和工具调用等执行详情
- 添加会话记忆存储,支持加载最近对话轮次和生成紧凑的会话摘要
- 提供检索工具集(混合/向量/全文搜索)和写作工具集(创建/更新/搜索替换文档)
- 弃用旧版写作工作流,默认禁用其IPC端点并引导使用新运行时
- 更新渲染进程类型定义和预加载API,支持新的AI运行事件订阅
- 在写作工作空间页面添加通过URL参数直接打开文档的支持
- 统一使用@langchain/openai创建LLM客户端,将模型调用移至主进程
2026-02-27 19:12:50 +08:00
hy ad888da6b7 refactor(writing): 将写作工作流重构为模块化架构
将写作工作流的实现拆分为独立的运行时、节点和图构建模块,以提升可维护性和可扩展性。

- 提取共享工作流上下文,集中管理取消检查、事件发送、持久化和工具函数
- 将每个工作流阶段实现为独立的节点模块,明确职责边界
- 保持现有阶段ID和事件语义不变,确保渲染器兼容性
- 更新相关类型定义和存储接口以支持新架构
2026-02-25 15:28:09 +08:00
hy ca46afb6b9 refactor(storage): 重构存储层为低层数据库核心和领域服务
引入 LanceDbCore 作为低层数据库访问层,封装连接、表管理和查询辅助方法
创建 DocumentsStore、ChatStore、LlmConfigStore、WritingStore 等领域服务类
将 UnifiedStore 重构为 StorageService 门面,提供统一的领域服务访问
更新所有 IPC 处理器和主进程服务以使用新的存储 API
2026-02-25 14:25:57 +08:00
hy be7569f2a1 feat(writing): 新增基于知识库的AI写作工作流与写作空间
- 新增知识库驱动的AI写作工作流,使用LangGraph JS编排多阶段生成流程(大纲→检索计划→检索→引用选择→草稿生成)
- 支持通过"@"提及功能选择特定文档作为引用范围,默认检索整个知识库
- 新增写作空间,包含文件夹树、文档列表和BlockNote编辑器,支持文档的创建、编辑和持久化
- 集成BlockNote编辑器,支持将AI生成的Markdown导入编辑,并可导出为DOCX和PDF格式
- 新增写作工作流运行记录和引用追踪,确保生成内容的可追溯性
- 扩展存储层,新增写作文件夹、文档和工作流运行表
- 扩展搜索接口,支持按文档ID范围进行检索过滤
2026-02-24 17:21:08 +08:00
hy a90fe02f27 docs(openspec): 将上下文语言配置更新为英语
确保所有与文档相关的内容均使用英语编写,以保持一致性并便于国际化协作。
2026-02-10 17:32:16 +08:00