Merge commit '5427cbcc19cfd1ce9f3af1ae22207852cc5740fa' into codex/workflow-runs-chat-node-f6
This commit is contained in:
@@ -1,8 +1,15 @@
|
||||
{
|
||||
"name": "@deepseek-ai/dsh-client-ui-workflow-run",
|
||||
"description": "Durable workflow-run Conversation Node and nested member disclosure for dsh web",
|
||||
"version": "0.0.1",
|
||||
"private": true,
|
||||
"version": "0.0.1-rc.1",
|
||||
"publishConfig": {
|
||||
"access": "restricted"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/deepseek-ai/deepseek-harness.git",
|
||||
"directory": "packages/client/ui-workflow-run"
|
||||
},
|
||||
"type": "module",
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/types/index.d.ts",
|
||||
@@ -22,13 +29,15 @@
|
||||
"./src/*": "./src/*",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"dshClient": {
|
||||
"inject": [
|
||||
"@deepseek-ai/dsh-client-locale",
|
||||
"@deepseek-ai/dsh-client-runtime",
|
||||
"@deepseek-ai/dsh-client-ui-conversation"
|
||||
],
|
||||
"platform": "web"
|
||||
"dsh": {
|
||||
"client": {
|
||||
"inject": [
|
||||
"@deepseek-ai/dsh-client-locale",
|
||||
"@deepseek-ai/dsh-client-runtime",
|
||||
"@deepseek-ai/dsh-client-ui-conversation"
|
||||
],
|
||||
"platform": "web"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"bundle": "tsdown",
|
||||
@@ -45,16 +54,16 @@
|
||||
"react": "^18.2.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@deepseek-ai/dsh-client-locale": "^0.0.1",
|
||||
"@deepseek-ai/dsh-client-runtime": "^0.0.1",
|
||||
"@deepseek-ai/dsh-client-ui-conversation": "^0.0.1",
|
||||
"@deepseek-ai/dsh-client-ui-primitives": "^0.0.1",
|
||||
"@deepseek-ai/dsh-client-ui-slots": "^0.0.1",
|
||||
"@deepseek-ai/dsh-invariants": "^0.0.1",
|
||||
"@deepseek-ai/dsh-session": "^0.0.1",
|
||||
"@deepseek-ai/dsh-tool-workflow": "^0.0.1",
|
||||
"@deepseek-ai/dsh-workflow": "^0.0.1",
|
||||
"cordis": "^4.0.0-rc.7"
|
||||
"@deepseek-ai/dsh-client-locale": "workspace:^",
|
||||
"@deepseek-ai/dsh-client-runtime": "workspace:^",
|
||||
"@deepseek-ai/dsh-client-ui-conversation": "workspace:^",
|
||||
"@deepseek-ai/dsh-client-ui-primitives": "workspace:^",
|
||||
"@deepseek-ai/dsh-client-ui-slots": "workspace:^",
|
||||
"@deepseek-ai/dsh-invariants": "workspace:^",
|
||||
"@deepseek-ai/dsh-session": "workspace:^",
|
||||
"@deepseek-ai/dsh-tool-workflow": "workspace:^",
|
||||
"@deepseek-ai/dsh-workflow": "workspace:^",
|
||||
"@deepseek-ai/cordis": "workspace:^"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@deepseek-ai/dsh-client-locale": "workspace:^",
|
||||
@@ -68,6 +77,6 @@
|
||||
"@deepseek-ai/dsh-tool-workflow": "workspace:^",
|
||||
"@deepseek-ai/dsh-workflow": "workspace:^",
|
||||
"@types/react": "~18.3.1",
|
||||
"cordis": "^4.0.0-rc.7"
|
||||
"@deepseek-ai/cordis": "workspace:^"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,6 +148,7 @@ function updateAgentEnd(state: WorkflowState, data: ToolWorkflowAgentEndData): W
|
||||
/** Durable workflow event family folded into one keyed Chat node. */
|
||||
export const workflowRunDefinition: ConversationNodeDefinition<WorkflowState> = {
|
||||
kind: 'workflow-run',
|
||||
target: 'chat',
|
||||
match: (event) => {
|
||||
if (event.type === 'tool-workflow/run-start') return { id: String(event.data.runId), role: 'start' }
|
||||
if (event.type === 'tool-workflow/agent-start'
|
||||
@@ -175,8 +176,8 @@ export const workflowRunDefinition: ConversationNodeDefinition<WorkflowState> =
|
||||
}
|
||||
return context.state
|
||||
},
|
||||
buildViewNode: (context, target): ChatConversationViewNode | null => {
|
||||
if (target !== 'chat' || context.start === undefined) return null
|
||||
buildViewNode: (context): ChatConversationViewNode | null => {
|
||||
if (context.start === undefined) return null
|
||||
const data = projectWorkflow(context, context.start.location)
|
||||
return {
|
||||
key: context.key,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/** Package-owned invariant companion for the workflow-run UI plugin. */
|
||||
|
||||
/* jscpd:ignore-start */
|
||||
import type { Context } from 'cordis'
|
||||
import type { Context } from '@deepseek-ai/cordis'
|
||||
import type { InvariantInstaller } from '@deepseek-ai/dsh-invariants'
|
||||
|
||||
const PACKAGE_NAME = '@deepseek-ai/dsh-client-ui-workflow-run'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// @vitest-environment jsdom
|
||||
import { Context, Service } from 'cordis'
|
||||
import { Context, Service } from '@deepseek-ai/cordis'
|
||||
import { cleanup, fireEvent, render, screen } from '@testing-library/react'
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import {
|
||||
@@ -226,11 +226,13 @@ describe('workflow-run Conversation Definition', () => {
|
||||
const updateContext: Parameters<typeof workflowRunDefinition.update>[0] = { ...startedContext, state }
|
||||
const unrelated = matched(at(3, 'turn/start', { turn: 1 }), 'update')
|
||||
expect(workflowRunDefinition.update(updateContext, unrelated)).toBe(state)
|
||||
expect(workflowRunDefinition.buildViewNode(updateContext, 'trajectory')).toBeNull()
|
||||
expect(workflowRunDefinition.buildViewNode({
|
||||
expect(workflowRunDefinition.target).toBe('chat')
|
||||
const buildViewNode = workflowRunDefinition.buildViewNode
|
||||
if (buildViewNode === undefined) throw new Error('expected workflow Chat view builder')
|
||||
expect(buildViewNode({
|
||||
...updateContext, matches: [], start: undefined,
|
||||
}, 'chat')).toBeNull()
|
||||
const directNode = workflowRunDefinition.buildViewNode(updateContext, 'chat') as ChatConversationViewNode | null
|
||||
})).toBeNull()
|
||||
const directNode = buildViewNode(updateContext) as ChatConversationViewNode | null
|
||||
if (directNode === null) throw new Error('expected direct workflow Chat node')
|
||||
expect(directNode.kind).toBe('workflow-run')
|
||||
expect((directNode.data as WorkflowRunChatData).status).toBe('running')
|
||||
@@ -271,6 +273,7 @@ const listState = (overrides: Partial<SessionListState> = {}): SessionListState
|
||||
current: PARENT_ID,
|
||||
phase: 'ready',
|
||||
subagentsByParent: {},
|
||||
tasksBySession: {},
|
||||
currentAddress: undefined,
|
||||
...overrides,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user