workflows/coding.ts, report.ts, meta.ts + matching tests All 28 tests pass, build clean
This commit is contained in:
@@ -84,8 +84,8 @@ objects/: CAS 文件,hash 为文件名
|
||||
|
||||
```
|
||||
packages/pulse/src/workflows/
|
||||
coding-workflow.ts # workflow 定义 + meta 类型
|
||||
report-workflow.ts # workflow 定义 + meta 类型
|
||||
coding.ts # workflow 定义 + meta 类型
|
||||
report.ts # workflow 定义 + meta 类型
|
||||
workflow-type.ts # 核心类型
|
||||
workflow-rule-adapter.ts # adapter(Moore diff + event 写入)
|
||||
index.ts # barrel exports
|
||||
|
||||
@@ -12,7 +12,7 @@ import { tmpdir } from 'node:os';
|
||||
import { join } from 'node:path';
|
||||
import { createOpenAiLlmClient } from '../llm-client.js';
|
||||
import { createStore } from '../store.js';
|
||||
import { createCodingWorkflow } from '../workflows/coding-workflow.js';
|
||||
import { createCodingWorkflow } from '../workflows/coding.js';
|
||||
import { createArchitectRole } from '../workflows/roles/architect-llm.js';
|
||||
import { createWorkflowRule } from '../workflows/workflow-rule-adapter.js';
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import { tmpdir } from 'node:os';
|
||||
import { dirname, join } from 'node:path';
|
||||
import { createStore } from '../index.js';
|
||||
import { createOpenAiLlmClient } from '../llm-client.js';
|
||||
import { createCodingWorkflow } from '../workflows/coding-workflow.js';
|
||||
import { createCodingWorkflow } from '../workflows/coding.js';
|
||||
import { createCoderRole } from '../workflows/roles/coder-cursor.js';
|
||||
import { createReviewerRole } from '../workflows/roles/reviewer-cursor.js';
|
||||
import { createWorkflowRule } from '../workflows/workflow-rule-adapter.js';
|
||||
|
||||
@@ -15,7 +15,7 @@ import { tmpdir } from 'node:os';
|
||||
import { join } from 'node:path';
|
||||
import { createStore } from '../index.js';
|
||||
import { createOpenAiLlmClient } from '../llm-client.js';
|
||||
import { createReportWorkflow } from '../workflows/report-workflow.js';
|
||||
import { createReportWorkflow } from '../workflows/report.js';
|
||||
import { createAnalystRole } from '../workflows/roles/analyst-llm.js';
|
||||
import { createRendererRole } from '../workflows/roles/renderer-template.js';
|
||||
import { createWorkflowRule } from '../workflows/workflow-rule-adapter.js';
|
||||
|
||||
@@ -9,7 +9,7 @@ import { mkdtempSync, rmSync } from 'node:fs';
|
||||
import { tmpdir } from 'node:os';
|
||||
import { join } from 'node:path';
|
||||
import { createStore, type PulseStore } from '../store.js';
|
||||
import { createCodingWorkflow } from '../workflows/coding-workflow.js';
|
||||
import { createCodingWorkflow } from '../workflows/coding.js';
|
||||
import { createWorkflowRule } from '../workflows/workflow-rule-adapter.js';
|
||||
|
||||
describe('Council v2 E2E', () => {
|
||||
|
||||
@@ -945,7 +945,7 @@ export {
|
||||
type CodingRoles,
|
||||
createCodingWorkflow,
|
||||
type ReviewerMeta,
|
||||
} from './workflows/coding-workflow.js';
|
||||
} from './workflows/coding.js';
|
||||
export { createWorkflowTicker } from './workflows/index.js';
|
||||
export { createArchitectRole } from './workflows/roles/architect-llm.js';
|
||||
export { createCoderRole } from './workflows/roles/coder-cursor.js';
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import { mkdtempSync, rmSync } from 'node:fs';
|
||||
import { tmpdir } from 'node:os';
|
||||
import { join } from 'node:path';
|
||||
import { createStore, type PulseStore } from '../store.js';
|
||||
import { createCodingWorkflow } from './coding-workflow.js';
|
||||
import { createCodingWorkflow } from './coding.js';
|
||||
import { createWorkflowRule } from './workflow-rule-adapter.js';
|
||||
|
||||
describe('CodingTask WorkflowType', () => {
|
||||
@@ -4,16 +4,16 @@
|
||||
* 小橘 🍊 (NEKO Team)
|
||||
*/
|
||||
|
||||
export { createCodingWorkflow } from './coding-workflow.js';
|
||||
export { createMetaWorkflow } from './meta-workflow.js';
|
||||
export { createCodingWorkflow } from './coding.js';
|
||||
export { createMetaWorkflow } from './meta.js';
|
||||
export type {
|
||||
MetaArchitectMeta,
|
||||
MetaCoderMeta,
|
||||
MetaReviewerMeta,
|
||||
MetaTesterMeta,
|
||||
MetaPromoterMeta,
|
||||
} from './meta-workflow.js';
|
||||
export { createReportWorkflow } from './report-workflow.js';
|
||||
} from './meta.js';
|
||||
export { createReportWorkflow } from './report.js';
|
||||
export {
|
||||
type AgentExecutorConfig,
|
||||
type AgentResult,
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ import {
|
||||
type MetaPromoterMeta,
|
||||
type MetaReviewerMeta,
|
||||
type MetaTesterMeta,
|
||||
} from './meta-workflow.js';
|
||||
} from './meta.js';
|
||||
import { createWorkflowRule } from './workflow-rule-adapter.js';
|
||||
import { END, START, type WorkflowMessage } from './workflow-type.js';
|
||||
import { mkdtempSync } from 'node:fs';
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
|
||||
import { describe, expect, test } from 'bun:test';
|
||||
import { createStore, type Store } from '../store.js';
|
||||
import { createReportWorkflow } from './report-workflow.js';
|
||||
import { createReportWorkflow } from './report.js';
|
||||
import { createWorkflowRule } from './workflow-rule-adapter.js';
|
||||
|
||||
function tmpStore(): { store: Store; cleanup: () => void } {
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
import type { LlmClient } from '../../llm-client.js';
|
||||
import type { AnalystMeta } from '../report-workflow.js';
|
||||
import type { AnalystMeta } from '../report.js';
|
||||
import type { Role } from '../workflow-type.js';
|
||||
import { createToolRole } from './llm-role-factory.js';
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
import type { LlmClient } from '../../llm-client.js';
|
||||
import type { ArchitectMeta } from '../coding-workflow.js';
|
||||
import type { ArchitectMeta } from '../coding.js';
|
||||
import type { Role } from '../workflow-type.js';
|
||||
import { createLlmRole } from './llm-role-factory.js';
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
import type { LlmClient } from '../../llm-client.js';
|
||||
import type { CoderMeta } from '../coding-workflow.js';
|
||||
import type { CoderMeta } from '../coding.js';
|
||||
import type { Role } from '../workflow-type.js';
|
||||
import {
|
||||
type AgentRunner,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
import type { LlmClient } from '../../llm-client.js';
|
||||
import type { MetaArchitectMeta } from '../meta-workflow.js';
|
||||
import type { MetaArchitectMeta } from '../meta.js';
|
||||
import type { Role } from '../workflow-type.js';
|
||||
import { createToolRole } from './llm-role-factory.js';
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
import type { LlmClient } from '../../llm-client.js';
|
||||
import type { MetaCoderMeta } from '../meta-workflow.js';
|
||||
import type { MetaCoderMeta } from '../meta.js';
|
||||
import type { Role } from '../workflow-type.js';
|
||||
import { type AgentRunner, createAgentExecutorRole } from './agent-executor.js';
|
||||
|
||||
@@ -55,7 +55,7 @@ ${reviewFeedback}
|
||||
|
||||
## 参考
|
||||
- 先阅读 docs/workflow-spec.md
|
||||
- 参考 packages/pulse/src/workflows/coding-workflow.ts 和 report-workflow.ts
|
||||
- 参考 packages/pulse/src/workflows/coding.ts 和 report.ts
|
||||
|
||||
## 步骤
|
||||
1. 创建 workflow 定义文件(meta types + moderator + factory)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
import { execSync } from 'node:child_process';
|
||||
import type { MetaPromoterMeta } from '../meta-workflow.js';
|
||||
import type { MetaPromoterMeta } from '../meta.js';
|
||||
import type { Role, RoleResult, WorkflowMessage } from '../workflow-type.js';
|
||||
|
||||
export function createMetaPromoterRole(opts: {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
import type { LlmClient } from '../../llm-client.js';
|
||||
import type { MetaReviewerMeta } from '../meta-workflow.js';
|
||||
import type { MetaReviewerMeta } from '../meta.js';
|
||||
import type { Role } from '../workflow-type.js';
|
||||
import { type AgentRunner, createAgentExecutorRole } from './agent-executor.js';
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import { execSync } from 'node:child_process';
|
||||
import type { LlmClient } from '../../llm-client.js';
|
||||
import type { MetaTesterMeta } from '../meta-workflow.js';
|
||||
import type { MetaTesterMeta } from '../meta.js';
|
||||
import type { Role, RoleResult, WorkflowMessage } from '../workflow-type.js';
|
||||
|
||||
const JUDGE_PROMPT = `你是 Pulse 工作流的测试评审官。
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
import type { LlmClient } from '../../llm-client.js';
|
||||
import type { RendererMeta } from '../report-workflow.js';
|
||||
import type { RendererMeta } from '../report.js';
|
||||
import type { Role, RoleResult, WorkflowMessage } from '../workflow-type.js';
|
||||
|
||||
const SYSTEM_PROMPT = `You are a talented web designer who creates beautiful single-file HTML reports.
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* 小橘 🍊 (NEKO Team)
|
||||
*/
|
||||
|
||||
import type { RendererMeta } from '../report-workflow.js';
|
||||
import type { RendererMeta } from '../report.js';
|
||||
import type { Role, RoleResult, WorkflowMessage } from '../workflow-type.js';
|
||||
import type { AnalysisResult } from './analyst-llm.js';
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
import type { LlmClient } from '../../llm-client.js';
|
||||
import type { ReviewerMeta } from '../coding-workflow.js';
|
||||
import type { ReviewerMeta } from '../coding.js';
|
||||
import type { Role } from '../workflow-type.js';
|
||||
import {
|
||||
type AgentRunner,
|
||||
|
||||
Reference in New Issue
Block a user