Merge latest master into worktree-fast-gates
This commit is contained in:
@@ -1370,6 +1370,7 @@ Imported as libraries by other packages; a `cordis.yml` cannot load them.
|
|||||||
|
|
||||||
- `@deepseek-ai/create-sdk` ([`packages/sdk/create-sdk/src/index.ts`](../packages/sdk/create-sdk/src/index.ts))
|
- `@deepseek-ai/create-sdk` ([`packages/sdk/create-sdk/src/index.ts`](../packages/sdk/create-sdk/src/index.ts))
|
||||||
- `@deepseek-ai/dsh-acp-snapshot` ([`packages/support/acp-snapshot/src/index.ts`](../packages/support/acp-snapshot/src/index.ts))
|
- `@deepseek-ai/dsh-acp-snapshot` ([`packages/support/acp-snapshot/src/index.ts`](../packages/support/acp-snapshot/src/index.ts))
|
||||||
|
- `@deepseek-ai/dsh-agent-loop-testkit` ([`packages/support/agent-loop-testkit/src/index.ts`](../packages/support/agent-loop-testkit/src/index.ts))
|
||||||
- `@deepseek-ai/dsh-app-boot` ([`packages/ui/app-boot/src/index.ts`](../packages/ui/app-boot/src/index.ts))
|
- `@deepseek-ai/dsh-app-boot` ([`packages/ui/app-boot/src/index.ts`](../packages/ui/app-boot/src/index.ts))
|
||||||
- `@deepseek-ai/dsh-brand` ([`packages/util/brand/src/index.ts`](../packages/util/brand/src/index.ts))
|
- `@deepseek-ai/dsh-brand` ([`packages/util/brand/src/index.ts`](../packages/util/brand/src/index.ts))
|
||||||
- `@deepseek-ai/dsh-helper` ([`packages/sdk/helper/src/index.ts`](../packages/sdk/helper/src/index.ts))
|
- `@deepseek-ai/dsh-helper` ([`packages/sdk/helper/src/index.ts`](../packages/sdk/helper/src/index.ts))
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ flowchart TD
|
|||||||
end
|
end
|
||||||
subgraph group_support["packages/support"]
|
subgraph group_support["packages/support"]
|
||||||
pkg_acp_snapshot["acp-snapshot"]
|
pkg_acp_snapshot["acp-snapshot"]
|
||||||
|
pkg_agent_loop_testkit["agent-loop-testkit"]
|
||||||
pkg_invariants["invariants"]
|
pkg_invariants["invariants"]
|
||||||
pkg_llm_replay["llm-replay"]
|
pkg_llm_replay["llm-replay"]
|
||||||
pkg_loader_smoke["loader-smoke"]
|
pkg_loader_smoke["loader-smoke"]
|
||||||
@@ -304,6 +305,11 @@ flowchart TD
|
|||||||
pkg_hooks_codex --> pkg_session
|
pkg_hooks_codex --> pkg_session
|
||||||
pkg_hooks_codex --> pkg_session_persistence
|
pkg_hooks_codex --> pkg_session_persistence
|
||||||
pkg_hooks_codex --> pkg_tools
|
pkg_hooks_codex --> pkg_tools
|
||||||
|
pkg_agent_loop_testkit --> pkg_agent
|
||||||
|
pkg_agent_loop_testkit --> pkg_llm
|
||||||
|
pkg_agent_loop_testkit --> pkg_session
|
||||||
|
pkg_agent_loop_testkit --> pkg_system_prompt
|
||||||
|
pkg_agent_loop_testkit --> pkg_tools
|
||||||
pkg_acp --> pkg_agent
|
pkg_acp --> pkg_agent
|
||||||
pkg_acp --> pkg_bash
|
pkg_acp --> pkg_bash
|
||||||
pkg_acp --> pkg_llm
|
pkg_acp --> pkg_llm
|
||||||
@@ -483,6 +489,7 @@ flowchart TD
|
|||||||
| [`tool-todo`](../packages/todo/tool-todo) | `todo` | [`agent`](../packages/core/agent), [`session`](../packages/core/session), [`tools`](../packages/core/tools) |
|
| [`tool-todo`](../packages/todo/tool-todo) | `todo` | [`agent`](../packages/core/agent), [`session`](../packages/core/session), [`tools`](../packages/core/tools) |
|
||||||
| [`tool-cordis`](../packages/cordis/tool-cordis) | `cordis` | [`scope`](../packages/core/scope), [`tools`](../packages/core/tools) |
|
| [`tool-cordis`](../packages/cordis/tool-cordis) | `cordis` | [`scope`](../packages/core/scope), [`tools`](../packages/core/tools) |
|
||||||
| [`hooks-codex`](../packages/hooks/hooks-codex) | `hooks` | [`agent`](../packages/core/agent), [`hook-protocol`](../packages/hooks/hook-protocol), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-persistence`](../packages/session-persistence/session-persistence), [`tools`](../packages/core/tools) |
|
| [`hooks-codex`](../packages/hooks/hooks-codex) | `hooks` | [`agent`](../packages/core/agent), [`hook-protocol`](../packages/hooks/hook-protocol), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-persistence`](../packages/session-persistence/session-persistence), [`tools`](../packages/core/tools) |
|
||||||
|
| [`agent-loop-testkit`](../packages/support/agent-loop-testkit) | `support` | [`agent`](../packages/core/agent), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools) |
|
||||||
| [`acp`](../packages/ui/acp) | `ui` | [`agent`](../packages/core/agent), [`bash`](../packages/bash/bash), [`llm`](../packages/llm/llm), [`permission`](../packages/ui/permission), [`sandbox`](../packages/sandbox/sandbox), [`session`](../packages/core/session), [`session-persistence`](../packages/session-persistence/session-persistence), [`tools`](../packages/core/tools), [`user-approval`](../packages/ui/user-approval), [`user-interaction`](../packages/ui/user-interaction) |
|
| [`acp`](../packages/ui/acp) | `ui` | [`agent`](../packages/core/agent), [`bash`](../packages/bash/bash), [`llm`](../packages/llm/llm), [`permission`](../packages/ui/permission), [`sandbox`](../packages/sandbox/sandbox), [`session`](../packages/core/session), [`session-persistence`](../packages/session-persistence/session-persistence), [`tools`](../packages/core/tools), [`user-approval`](../packages/ui/user-approval), [`user-interaction`](../packages/ui/user-interaction) |
|
||||||
| [`tool-ask-user`](../packages/ui/tool-ask-user) | `ui` | [`agent`](../packages/core/agent), [`tools`](../packages/core/tools), [`user-interaction`](../packages/ui/user-interaction) |
|
| [`tool-ask-user`](../packages/ui/tool-ask-user) | `ui` | [`agent`](../packages/core/agent), [`tools`](../packages/core/tools), [`user-interaction`](../packages/ui/user-interaction) |
|
||||||
| [`workspace-context`](../packages/context/workspace-context) | `context` | [`agent`](../packages/core/agent), [`fs`](../packages/fs/fs), [`llm`](../packages/llm/llm), [`paths`](../packages/util/paths), [`session`](../packages/core/session), [`tools`](../packages/core/tools) |
|
| [`workspace-context`](../packages/context/workspace-context) | `context` | [`agent`](../packages/core/agent), [`fs`](../packages/fs/fs), [`llm`](../packages/llm/llm), [`paths`](../packages/util/paths), [`session`](../packages/core/session), [`tools`](../packages/core/tools) |
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
import { Context } from 'cordis'
|
import { Context } from 'cordis'
|
||||||
import LlmService from '@deepseek-ai/dsh-llm'
|
|
||||||
import SessionStore from '@deepseek-ai/dsh-session'
|
|
||||||
import type { SessionEvent } from '@deepseek-ai/dsh-session'
|
import type { SessionEvent } from '@deepseek-ai/dsh-session'
|
||||||
import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
|
|
||||||
import ToolRegistry from '@deepseek-ai/dsh-tools'
|
|
||||||
import AgentRegistry from '@deepseek-ai/dsh-agent'
|
|
||||||
import AgentLoop, { ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
import AgentLoop, { ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
||||||
|
import { mountAgentLoopTestDependencies } from '@deepseek-ai/dsh-agent-loop-testkit'
|
||||||
import { LocalBashExecutor } from '@deepseek-ai/dsh-bash-local'
|
import { LocalBashExecutor } from '@deepseek-ai/dsh-bash-local'
|
||||||
import * as ToolBash from '@deepseek-ai/dsh-tool-bash'
|
import * as ToolBash from '@deepseek-ai/dsh-tool-bash'
|
||||||
import * as ToolTodo from '@deepseek-ai/dsh-tool-todo'
|
import * as ToolTodo from '@deepseek-ai/dsh-tool-todo'
|
||||||
@@ -50,11 +46,9 @@ export interface CodingHarnessOptions {
|
|||||||
|
|
||||||
export async function codingHarness(workdir: string, options: CodingHarnessOptions = {}): Promise<Context> {
|
export async function codingHarness(workdir: string, options: CodingHarnessOptions = {}): Promise<Context> {
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
await ctx.plugin(LlmService)
|
await mountAgentLoopTestDependencies(ctx, {
|
||||||
await ctx.plugin(SessionStore)
|
systemPrompt: { persona: options.persona ?? '' },
|
||||||
await ctx.plugin(SystemPrompt, { persona: options.persona ?? '' })
|
})
|
||||||
await ctx.plugin(ToolRegistry)
|
|
||||||
await ctx.plugin(AgentRegistry)
|
|
||||||
await ctx.plugin(AgentLoop, { agents: [] })
|
await ctx.plugin(AgentLoop, { agents: [] })
|
||||||
await ctx.plugin(LlmDeepSeek, { models: ['deepseek-v4-flash'] })
|
await ctx.plugin(LlmDeepSeek, { models: ['deepseek-v4-flash'] })
|
||||||
await ctx.plugin(LocalBashExecutor, { cwd: workdir, timeoutMs: 30_000 })
|
await ctx.plugin(LocalBashExecutor, { cwd: workdir, timeoutMs: 30_000 })
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
import { Context } from 'cordis'
|
import { Context } from 'cordis'
|
||||||
import LlmService from '@deepseek-ai/dsh-llm'
|
|
||||||
import SessionStore from '@deepseek-ai/dsh-session'
|
|
||||||
import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
|
|
||||||
import ToolRegistry from '@deepseek-ai/dsh-tools'
|
|
||||||
import AgentRegistry from '@deepseek-ai/dsh-agent'
|
|
||||||
import AgentLoop, { ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
import AgentLoop, { ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
||||||
|
import { mountAgentLoopTestDependencies } from '@deepseek-ai/dsh-agent-loop-testkit'
|
||||||
import * as LlmDeepSeek from '@deepseek-ai/dsh-llm-deepseek'
|
import * as LlmDeepSeek from '@deepseek-ai/dsh-llm-deepseek'
|
||||||
import * as ToolCordis from '@deepseek-ai/dsh-tool-cordis'
|
import * as ToolCordis from '@deepseek-ai/dsh-tool-cordis'
|
||||||
|
|
||||||
@@ -23,11 +19,9 @@ const PERSONA = 'You are cordis-agent, a self-referential harness demo. '
|
|||||||
|
|
||||||
export async function cordisHarness(): Promise<Context> {
|
export async function cordisHarness(): Promise<Context> {
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
await ctx.plugin(LlmService)
|
await mountAgentLoopTestDependencies(ctx, {
|
||||||
await ctx.plugin(SessionStore)
|
systemPrompt: { persona: PERSONA },
|
||||||
await ctx.plugin(SystemPrompt, { persona: PERSONA })
|
})
|
||||||
await ctx.plugin(ToolRegistry)
|
|
||||||
await ctx.plugin(AgentRegistry)
|
|
||||||
await ctx.plugin(AgentLoop, { agents: [] })
|
await ctx.plugin(AgentLoop, { agents: [] })
|
||||||
await ctx.plugin(LlmDeepSeek, { models: ['deepseek-v4-flash'] })
|
await ctx.plugin(LlmDeepSeek, { models: ['deepseek-v4-flash'] })
|
||||||
await ctx.plugin(ToolCordis)
|
await ctx.plugin(ToolCordis)
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ Packages live at `packages/<group>/<pkg>/`; groups are containers, while names r
|
|||||||
| [`sdk/`](sdk/README.md) | Project SDK tooling | Product — stable surface |
|
| [`sdk/`](sdk/README.md) | Project SDK tooling | Product — stable surface |
|
||||||
| [`ui/`](ui/README.md) | Editor/client integration surfaces: ACP bridge, JSON-RPC SDK server, user-approval/user-interaction seams, ask-user tool | Product — stable surface |
|
| [`ui/`](ui/README.md) | Editor/client integration surfaces: ACP bridge, JSON-RPC SDK server, user-approval/user-interaction seams, ask-user tool | Product — stable surface |
|
||||||
| [`examples/`](examples/README.md) | Demo bundles (agent-spine + stdio/ACP/JSON-RPC bins) the leaves load | Support — example infra |
|
| [`examples/`](examples/README.md) | Demo bundles (agent-spine + stdio/ACP/JSON-RPC bins) the leaves load | Support — example infra |
|
||||||
| [`support/`](support/README.md) | Support infrastructure (invariants, replay, Loader smokes, subagent mock) | Support — lower compatibility expectations |
|
| [`support/`](support/README.md) | Support infrastructure (testkits, invariants, replay, Loader smokes, subagent mock) | Support — lower compatibility expectations |
|
||||||
| [`util/`](util/README.md) | Low-level zero-dependency utilities shared across groups (`Branded<B>`, Harness home/path helpers, timeout, retention) | Support — small, stable, harness-dep-free |
|
| [`util/`](util/README.md) | Low-level zero-dependency utilities shared across groups (`Branded<B>`, Harness home/path helpers, timeout, retention) | Support — small, stable, harness-dep-free |
|
||||||
|
|
||||||
Groups distinguish product API from support infrastructure. New packages join an existing group; a new group updates its README and this table.
|
Groups distinguish product API from support infrastructure. New packages join an existing group; a new group updates its README and this table.
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@deepseek-ai/dsh-agent": "workspace:^",
|
"@deepseek-ai/dsh-agent": "workspace:^",
|
||||||
"@deepseek-ai/dsh-agent-loop": "workspace:^",
|
"@deepseek-ai/dsh-agent-loop": "workspace:^",
|
||||||
|
"@deepseek-ai/dsh-agent-loop-testkit": "workspace:^",
|
||||||
"@deepseek-ai/dsh-user-approval": "workspace:^",
|
"@deepseek-ai/dsh-user-approval": "workspace:^",
|
||||||
"@deepseek-ai/dsh-bash": "workspace:^",
|
"@deepseek-ai/dsh-bash": "workspace:^",
|
||||||
"@deepseek-ai/dsh-bash-local": "workspace:^",
|
"@deepseek-ai/dsh-bash-local": "workspace:^",
|
||||||
|
|||||||
@@ -3,14 +3,11 @@ import { Context } from 'cordis'
|
|||||||
import { existsSync, mkdtempSync, readFileSync, rmSync } from 'node:fs'
|
import { existsSync, mkdtempSync, readFileSync, rmSync } from 'node:fs'
|
||||||
import { tmpdir } from 'node:os'
|
import { tmpdir } from 'node:os'
|
||||||
import { join } from 'node:path'
|
import { join } from 'node:path'
|
||||||
import LlmService from '@deepseek-ai/dsh-llm'
|
import { SessionId, type SessionEvent } from '@deepseek-ai/dsh-session'
|
||||||
import SessionStore, { SessionId } from '@deepseek-ai/dsh-session'
|
|
||||||
import type { SessionEvent } from '@deepseek-ai/dsh-session'
|
|
||||||
import SessionPersistenceJsonl from '@deepseek-ai/dsh-session-persistence-jsonl'
|
import SessionPersistenceJsonl from '@deepseek-ai/dsh-session-persistence-jsonl'
|
||||||
import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
|
import { AgentId } from '@deepseek-ai/dsh-agent'
|
||||||
import ToolRegistry from '@deepseek-ai/dsh-tools'
|
|
||||||
import AgentRegistry, { AgentId } from '@deepseek-ai/dsh-agent'
|
|
||||||
import AgentLoop, { ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
import AgentLoop, { ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
||||||
|
import { mountAgentLoopTestDependencies } from '@deepseek-ai/dsh-agent-loop-testkit'
|
||||||
import TaskService from '@deepseek-ai/dsh-tasks'
|
import TaskService from '@deepseek-ai/dsh-tasks'
|
||||||
import * as ToolTasks from '@deepseek-ai/dsh-tool-tasks'
|
import * as ToolTasks from '@deepseek-ai/dsh-tool-tasks'
|
||||||
import { LocalBashExecutor } from '@deepseek-ai/dsh-bash-local'
|
import { LocalBashExecutor } from '@deepseek-ai/dsh-bash-local'
|
||||||
@@ -25,12 +22,8 @@ import { MockAdapter, textResponse, toolCallResponse } from '../../../core/agent
|
|||||||
*/
|
*/
|
||||||
async function harness(adapter: MockAdapter, sessionRoot?: string, dshHome?: string) {
|
async function harness(adapter: MockAdapter, sessionRoot?: string, dshHome?: string) {
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
await ctx.plugin(LlmService)
|
await mountAgentLoopTestDependencies(ctx)
|
||||||
await ctx.plugin(SessionStore)
|
|
||||||
if (sessionRoot !== undefined) await ctx.plugin(SessionPersistenceJsonl, { root: sessionRoot })
|
if (sessionRoot !== undefined) await ctx.plugin(SessionPersistenceJsonl, { root: sessionRoot })
|
||||||
await ctx.plugin(SystemPrompt)
|
|
||||||
await ctx.plugin(ToolRegistry)
|
|
||||||
await ctx.plugin(AgentRegistry)
|
|
||||||
await ctx.plugin(AgentLoop, { agents: [] })
|
await ctx.plugin(AgentLoop, { agents: [] })
|
||||||
await ctx.plugin(TaskService)
|
await ctx.plugin(TaskService)
|
||||||
await ctx.plugin(ToolTasks)
|
await ctx.plugin(ToolTasks)
|
||||||
|
|||||||
@@ -31,11 +31,11 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@deepseek-ai/dsh-agent": "workspace:^",
|
"@deepseek-ai/dsh-agent": "workspace:^",
|
||||||
"@deepseek-ai/dsh-agent-loop": "workspace:^",
|
"@deepseek-ai/dsh-agent-loop": "workspace:^",
|
||||||
|
"@deepseek-ai/dsh-agent-loop-testkit": "workspace:^",
|
||||||
"@deepseek-ai/dsh-compact": "workspace:^",
|
"@deepseek-ai/dsh-compact": "workspace:^",
|
||||||
"@deepseek-ai/dsh-invariants": "workspace:^",
|
"@deepseek-ai/dsh-invariants": "workspace:^",
|
||||||
"@deepseek-ai/dsh-llm": "workspace:^",
|
"@deepseek-ai/dsh-llm": "workspace:^",
|
||||||
"@deepseek-ai/dsh-session": "workspace:^",
|
"@deepseek-ai/dsh-session": "workspace:^",
|
||||||
"@deepseek-ai/dsh-system-prompt": "workspace:^",
|
|
||||||
"@deepseek-ai/dsh-tools": "workspace:^",
|
"@deepseek-ai/dsh-tools": "workspace:^",
|
||||||
"cordis": "^4.0.0-rc.7"
|
"cordis": "^4.0.0-rc.7"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
import { Context } from 'cordis'
|
import { Context } from 'cordis'
|
||||||
import LlmService from '@deepseek-ai/dsh-llm'
|
|
||||||
import type { ContentBlock, GenerateOptions, StreamChunk } from '@deepseek-ai/dsh-llm'
|
import type { ContentBlock, GenerateOptions, StreamChunk } from '@deepseek-ai/dsh-llm'
|
||||||
import { CallId, LlmAdapter } from '@deepseek-ai/dsh-llm'
|
import { CallId, LlmAdapter } from '@deepseek-ai/dsh-llm'
|
||||||
import SessionStore from '@deepseek-ai/dsh-session'
|
|
||||||
import { isToolPairingBalanced } from '@deepseek-ai/dsh-session'
|
import { isToolPairingBalanced } from '@deepseek-ai/dsh-session'
|
||||||
import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
|
import { defineTool } from '@deepseek-ai/dsh-tools'
|
||||||
import ToolRegistry, { defineTool } from '@deepseek-ai/dsh-tools'
|
import { AgentId } from '@deepseek-ai/dsh-agent'
|
||||||
import AgentRegistry, { AgentId } from '@deepseek-ai/dsh-agent'
|
|
||||||
import AgentLoop, { ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
import AgentLoop, { ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
||||||
|
import { mountAgentLoopTestDependencies } from '@deepseek-ai/dsh-agent-loop-testkit'
|
||||||
import * as Invariants from '@deepseek-ai/dsh-invariants'
|
import * as Invariants from '@deepseek-ai/dsh-invariants'
|
||||||
import { BasicCompactService } from '@deepseek-ai/dsh-compact-basic'
|
import { BasicCompactService } from '@deepseek-ai/dsh-compact-basic'
|
||||||
import type { SurfaceEvent } from '@deepseek-ai/dsh-session'
|
import type { SurfaceEvent } from '@deepseek-ai/dsh-session'
|
||||||
@@ -60,12 +58,8 @@ class StepwiseToolAdapter extends LlmAdapter {
|
|||||||
|
|
||||||
async function harness(toolSteps: number): Promise<{ ctx: Context; compact: ReproCompactService }> {
|
async function harness(toolSteps: number): Promise<{ ctx: Context; compact: ReproCompactService }> {
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
await ctx.plugin(LlmService)
|
await mountAgentLoopTestDependencies(ctx)
|
||||||
await ctx.plugin(SessionStore)
|
|
||||||
await ctx.plugin(Invariants)
|
await ctx.plugin(Invariants)
|
||||||
await ctx.plugin(SystemPrompt)
|
|
||||||
await ctx.plugin(ToolRegistry)
|
|
||||||
await ctx.plugin(AgentRegistry)
|
|
||||||
await ctx.plugin(AgentLoop, { agents: [] })
|
await ctx.plugin(AgentLoop, { agents: [] })
|
||||||
ctx.llm.registerAdapter(['mock'], new StepwiseToolAdapter(toolSteps))
|
ctx.llm.registerAdapter(['mock'], new StepwiseToolAdapter(toolSteps))
|
||||||
ctx.tools.register(defineTool({
|
ctx.tools.register(defineTool({
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@deepseek-ai/dsh-agent": "workspace:^",
|
"@deepseek-ai/dsh-agent": "workspace:^",
|
||||||
"@deepseek-ai/dsh-agent-loop": "workspace:^",
|
"@deepseek-ai/dsh-agent-loop": "workspace:^",
|
||||||
|
"@deepseek-ai/dsh-agent-loop-testkit": "workspace:^",
|
||||||
"@deepseek-ai/dsh-llm": "workspace:^",
|
"@deepseek-ai/dsh-llm": "workspace:^",
|
||||||
"@deepseek-ai/dsh-session": "workspace:^",
|
"@deepseek-ai/dsh-session": "workspace:^",
|
||||||
"@deepseek-ai/dsh-system-prompt": "workspace:^",
|
"@deepseek-ai/dsh-system-prompt": "workspace:^",
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||||
import { Context } from 'cordis'
|
import { Context } from 'cordis'
|
||||||
import Loader from '@cordisjs/plugin-loader'
|
import Loader from '@cordisjs/plugin-loader'
|
||||||
import LlmService, { CallId, LlmAdapter } from '@deepseek-ai/dsh-llm'
|
import { CallId, LlmAdapter } from '@deepseek-ai/dsh-llm'
|
||||||
import type { GenerateOptions, StreamChunk } from '@deepseek-ai/dsh-llm'
|
import type { GenerateOptions, StreamChunk } from '@deepseek-ai/dsh-llm'
|
||||||
import SessionStore, { Session, SessionId, foldRequestHeader } from '@deepseek-ai/dsh-session'
|
import { Session, SessionId, foldRequestHeader } from '@deepseek-ai/dsh-session'
|
||||||
import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
|
import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
|
||||||
import AgentRegistry, { AgentId } from '@deepseek-ai/dsh-agent'
|
import { AgentId } from '@deepseek-ai/dsh-agent'
|
||||||
import type { Agent } from '@deepseek-ai/dsh-agent'
|
import type { Agent } from '@deepseek-ai/dsh-agent'
|
||||||
import ToolRegistry, { defineTool } from '@deepseek-ai/dsh-tools'
|
import { defineTool } from '@deepseek-ai/dsh-tools'
|
||||||
import AgentLoop from '@deepseek-ai/dsh-agent-loop'
|
import AgentLoop from '@deepseek-ai/dsh-agent-loop'
|
||||||
|
import { mountAgentLoopTestDependencies } from '@deepseek-ai/dsh-agent-loop-testkit'
|
||||||
import * as timeContext from '@deepseek-ai/dsh-time-context'
|
import * as timeContext from '@deepseek-ai/dsh-time-context'
|
||||||
import type { Config } from '@deepseek-ai/dsh-time-context'
|
import type { Config } from '@deepseek-ai/dsh-time-context'
|
||||||
|
|
||||||
@@ -89,11 +90,7 @@ class ScriptedAdapter extends LlmAdapter {
|
|||||||
|
|
||||||
async function loopHarness(adapter: ScriptedAdapter, config: Config = {}): Promise<Context> {
|
async function loopHarness(adapter: ScriptedAdapter, config: Config = {}): Promise<Context> {
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
await ctx.plugin(LlmService)
|
await mountAgentLoopTestDependencies(ctx)
|
||||||
await ctx.plugin(SessionStore)
|
|
||||||
await ctx.plugin(SystemPrompt)
|
|
||||||
await ctx.plugin(ToolRegistry)
|
|
||||||
await ctx.plugin(AgentRegistry)
|
|
||||||
await ctx.plugin(AgentLoop, { agents: [] })
|
await ctx.plugin(AgentLoop, { agents: [] })
|
||||||
await ctx.plugin(timeContext, config)
|
await ctx.plugin(timeContext, config)
|
||||||
ctx.llm.registerAdapter(['mock'], adapter)
|
ctx.llm.registerAdapter(['mock'], adapter)
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
"@deepseek-ai/dsh-agent": "workspace:^",
|
"@deepseek-ai/dsh-agent": "workspace:^",
|
||||||
"@deepseek-ai/dsh-scope": "workspace:^",
|
"@deepseek-ai/dsh-scope": "workspace:^",
|
||||||
"@deepseek-ai/dsh-agent-loop": "workspace:^",
|
"@deepseek-ai/dsh-agent-loop": "workspace:^",
|
||||||
|
"@deepseek-ai/dsh-agent-loop-testkit": "workspace:^",
|
||||||
"@deepseek-ai/dsh-llm": "workspace:^",
|
"@deepseek-ai/dsh-llm": "workspace:^",
|
||||||
"@deepseek-ai/dsh-session": "workspace:^",
|
"@deepseek-ai/dsh-session": "workspace:^",
|
||||||
"@deepseek-ai/dsh-system-prompt": "workspace:^",
|
"@deepseek-ai/dsh-system-prompt": "workspace:^",
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
import { Context } from 'cordis'
|
import { Context } from 'cordis'
|
||||||
import LlmService from '@deepseek-ai/dsh-llm'
|
import { AgentId } from '@deepseek-ai/dsh-agent'
|
||||||
import SessionStore from '@deepseek-ai/dsh-session'
|
|
||||||
import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
|
|
||||||
import ToolRegistry from '@deepseek-ai/dsh-tools'
|
|
||||||
import AgentRegistry, { AgentId } from '@deepseek-ai/dsh-agent'
|
|
||||||
import AgentLoop, { ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
import AgentLoop, { ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
||||||
|
import { mountAgentLoopTestDependencies } from '@deepseek-ai/dsh-agent-loop-testkit'
|
||||||
import * as ToolCordis from '../src/index.ts'
|
import * as ToolCordis from '../src/index.ts'
|
||||||
import { MockAdapter, textResponse, toolCallResponse } from '../../../core/agent-loop/tests/mock-adapter.ts'
|
import { MockAdapter, textResponse, toolCallResponse } from '../../../core/agent-loop/tests/mock-adapter.ts'
|
||||||
import { REVERSE_TOOL_CODE } from './helpers.ts'
|
import { REVERSE_TOOL_CODE } from './helpers.ts'
|
||||||
@@ -20,11 +17,7 @@ import { REVERSE_TOOL_CODE } from './helpers.ts'
|
|||||||
|
|
||||||
async function harness(adapter: MockAdapter): Promise<Context> {
|
async function harness(adapter: MockAdapter): Promise<Context> {
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
await ctx.plugin(LlmService)
|
await mountAgentLoopTestDependencies(ctx)
|
||||||
await ctx.plugin(SessionStore)
|
|
||||||
await ctx.plugin(SystemPrompt)
|
|
||||||
await ctx.plugin(ToolRegistry)
|
|
||||||
await ctx.plugin(AgentRegistry)
|
|
||||||
await ctx.plugin(AgentLoop, { agents: [] })
|
await ctx.plugin(AgentLoop, { agents: [] })
|
||||||
await ctx.plugin(ToolCordis)
|
await ctx.plugin(ToolCordis)
|
||||||
ctx.llm.registerAdapter(['mock'], adapter)
|
ctx.llm.registerAdapter(['mock'], adapter)
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@deepseek-ai/dsh-agent": "workspace:^",
|
"@deepseek-ai/dsh-agent": "workspace:^",
|
||||||
"@deepseek-ai/dsh-agent-loop": "workspace:^",
|
"@deepseek-ai/dsh-agent-loop": "workspace:^",
|
||||||
|
"@deepseek-ai/dsh-agent-loop-testkit": "workspace:^",
|
||||||
"@deepseek-ai/dsh-fs-policy": "workspace:^",
|
"@deepseek-ai/dsh-fs-policy": "workspace:^",
|
||||||
"@deepseek-ai/dsh-fs": "workspace:^",
|
"@deepseek-ai/dsh-fs": "workspace:^",
|
||||||
"@deepseek-ai/dsh-fs-local": "workspace:^",
|
"@deepseek-ai/dsh-fs-local": "workspace:^",
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
import { Context } from 'cordis'
|
import { Context } from 'cordis'
|
||||||
import LlmService from '@deepseek-ai/dsh-llm'
|
import type { Agent } from '@deepseek-ai/dsh-agent'
|
||||||
import SessionStore from '@deepseek-ai/dsh-session'
|
|
||||||
import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
|
|
||||||
import ToolRegistry from '@deepseek-ai/dsh-tools'
|
|
||||||
import AgentRegistry, { type Agent } from '@deepseek-ai/dsh-agent'
|
|
||||||
import AgentLoop from '@deepseek-ai/dsh-agent-loop'
|
import AgentLoop from '@deepseek-ai/dsh-agent-loop'
|
||||||
|
import { mountAgentLoopTestDependencies } from '@deepseek-ai/dsh-agent-loop-testkit'
|
||||||
import LocalFileSystem from '@deepseek-ai/dsh-fs-local'
|
import LocalFileSystem from '@deepseek-ai/dsh-fs-local'
|
||||||
import * as FsPolicy from '@deepseek-ai/dsh-fs-policy'
|
import * as FsPolicy from '@deepseek-ai/dsh-fs-policy'
|
||||||
import * as ToolFs from '@deepseek-ai/dsh-tool-fs'
|
import * as ToolFs from '@deepseek-ai/dsh-tool-fs'
|
||||||
@@ -17,11 +14,7 @@ import * as LlmDeepSeek from '@deepseek-ai/dsh-llm-deepseek'
|
|||||||
*/
|
*/
|
||||||
export async function fsHarness(fsCwd: string, persona = ''): Promise<Context> {
|
export async function fsHarness(fsCwd: string, persona = ''): Promise<Context> {
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
await ctx.plugin(LlmService)
|
await mountAgentLoopTestDependencies(ctx, { systemPrompt: { persona } })
|
||||||
await ctx.plugin(SessionStore)
|
|
||||||
await ctx.plugin(SystemPrompt, { persona })
|
|
||||||
await ctx.plugin(ToolRegistry)
|
|
||||||
await ctx.plugin(AgentRegistry)
|
|
||||||
await ctx.plugin(AgentLoop, { agents: [] })
|
await ctx.plugin(AgentLoop, { agents: [] })
|
||||||
await ctx.plugin(LlmDeepSeek, { models: ['deepseek-v4-flash'] })
|
await ctx.plugin(LlmDeepSeek, { models: ['deepseek-v4-flash'] })
|
||||||
await ctx.plugin(LocalFileSystem, { cwd: fsCwd })
|
await ctx.plugin(LocalFileSystem, { cwd: fsCwd })
|
||||||
|
|||||||
@@ -32,9 +32,9 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@deepseek-ai/dsh-agent": "workspace:^",
|
"@deepseek-ai/dsh-agent": "workspace:^",
|
||||||
"@deepseek-ai/dsh-agent-loop": "workspace:^",
|
"@deepseek-ai/dsh-agent-loop": "workspace:^",
|
||||||
|
"@deepseek-ai/dsh-agent-loop-testkit": "workspace:^",
|
||||||
"@deepseek-ai/dsh-llm": "workspace:^",
|
"@deepseek-ai/dsh-llm": "workspace:^",
|
||||||
"@deepseek-ai/dsh-session": "workspace:^",
|
"@deepseek-ai/dsh-session": "workspace:^",
|
||||||
"@deepseek-ai/dsh-system-prompt": "workspace:^",
|
|
||||||
"@deepseek-ai/dsh-tools": "workspace:^",
|
"@deepseek-ai/dsh-tools": "workspace:^",
|
||||||
"cordis": "^4.0.0-rc.7"
|
"cordis": "^4.0.0-rc.7"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
import { Context } from 'cordis'
|
import { Context } from 'cordis'
|
||||||
import LlmService, { CallId } from '@deepseek-ai/dsh-llm'
|
import { CallId } from '@deepseek-ai/dsh-llm'
|
||||||
import SessionStore, { type SessionEvent } from '@deepseek-ai/dsh-session'
|
import type { SessionEvent } from '@deepseek-ai/dsh-session'
|
||||||
import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
|
import { defineTool } from '@deepseek-ai/dsh-tools'
|
||||||
import ToolRegistry, { defineTool } from '@deepseek-ai/dsh-tools'
|
import { AgentId } from '@deepseek-ai/dsh-agent'
|
||||||
import AgentRegistry, { AgentId } from '@deepseek-ai/dsh-agent'
|
|
||||||
import AgentLoop, { type ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
import AgentLoop, { type ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
||||||
|
import { mountAgentLoopTestDependencies } from '@deepseek-ai/dsh-agent-loop-testkit'
|
||||||
import * as RepeatToolGuard from '@deepseek-ai/dsh-repeat-tool-guard'
|
import * as RepeatToolGuard from '@deepseek-ai/dsh-repeat-tool-guard'
|
||||||
import type { Config } from '@deepseek-ai/dsh-repeat-tool-guard'
|
import type { Config } from '@deepseek-ai/dsh-repeat-tool-guard'
|
||||||
import { MockAdapter, textResponse, toolCallResponse } from '../../../core/agent-loop/tests/mock-adapter.ts'
|
import { MockAdapter, textResponse, toolCallResponse } from '../../../core/agent-loop/tests/mock-adapter.ts'
|
||||||
@@ -21,11 +21,7 @@ import { MockAdapter, textResponse, toolCallResponse } from '../../../core/agent
|
|||||||
/** Boot the core spine + the guard; the caller registers adapters and extra listeners. */
|
/** Boot the core spine + the guard; the caller registers adapters and extra listeners. */
|
||||||
async function harness(config: Config = {}): Promise<Context> {
|
async function harness(config: Config = {}): Promise<Context> {
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
await ctx.plugin(LlmService)
|
await mountAgentLoopTestDependencies(ctx)
|
||||||
await ctx.plugin(SessionStore)
|
|
||||||
await ctx.plugin(SystemPrompt)
|
|
||||||
await ctx.plugin(ToolRegistry)
|
|
||||||
await ctx.plugin(AgentRegistry)
|
|
||||||
await ctx.plugin(AgentLoop, { agents: [] })
|
await ctx.plugin(AgentLoop, { agents: [] })
|
||||||
await ctx.plugin(RepeatToolGuard, config)
|
await ctx.plugin(RepeatToolGuard, config)
|
||||||
ctx.tools.register(defineTool({ name: 'probe', description: 'p', parameters: {}, async execute() { return [{ type: 'text', text: 'ok' }] } }))
|
ctx.tools.register(defineTool({ name: 'probe', description: 'p', parameters: {}, async execute() { return [{ type: 'text', text: 'ok' }] } }))
|
||||||
@@ -363,11 +359,7 @@ describe('fold onto the downstream decision', () => {
|
|||||||
describe('config validation fails loud', () => {
|
describe('config validation fails loud', () => {
|
||||||
async function spine(): Promise<Context> {
|
async function spine(): Promise<Context> {
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
await ctx.plugin(LlmService)
|
await mountAgentLoopTestDependencies(ctx)
|
||||||
await ctx.plugin(SessionStore)
|
|
||||||
await ctx.plugin(SystemPrompt)
|
|
||||||
await ctx.plugin(ToolRegistry)
|
|
||||||
await ctx.plugin(AgentRegistry)
|
|
||||||
await ctx.plugin(AgentLoop, { agents: [] })
|
await ctx.plugin(AgentLoop, { agents: [] })
|
||||||
return ctx
|
return ctx
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@deepseek-ai/dsh-agent": "workspace:^",
|
"@deepseek-ai/dsh-agent": "workspace:^",
|
||||||
"@deepseek-ai/dsh-agent-loop": "workspace:^",
|
"@deepseek-ai/dsh-agent-loop": "workspace:^",
|
||||||
|
"@deepseek-ai/dsh-agent-loop-testkit": "workspace:^",
|
||||||
"@deepseek-ai/dsh-bash": "workspace:^",
|
"@deepseek-ai/dsh-bash": "workspace:^",
|
||||||
"@deepseek-ai/dsh-bash-local": "workspace:^",
|
"@deepseek-ai/dsh-bash-local": "workspace:^",
|
||||||
"@deepseek-ai/dsh-hook-protocol": "workspace:^",
|
"@deepseek-ai/dsh-hook-protocol": "workspace:^",
|
||||||
@@ -45,7 +46,6 @@
|
|||||||
"@deepseek-ai/dsh-session-persistence": "workspace:^",
|
"@deepseek-ai/dsh-session-persistence": "workspace:^",
|
||||||
"@deepseek-ai/dsh-session-persistence-jsonl": "workspace:^",
|
"@deepseek-ai/dsh-session-persistence-jsonl": "workspace:^",
|
||||||
"@deepseek-ai/dsh-subagent": "workspace:^",
|
"@deepseek-ai/dsh-subagent": "workspace:^",
|
||||||
"@deepseek-ai/dsh-system-prompt": "workspace:^",
|
|
||||||
"@deepseek-ai/dsh-tools": "workspace:^",
|
"@deepseek-ai/dsh-tools": "workspace:^",
|
||||||
"cordis": "^4.0.0-rc.7"
|
"cordis": "^4.0.0-rc.7"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,12 +4,11 @@ import { tmpdir } from 'node:os'
|
|||||||
import { join } from 'node:path'
|
import { join } from 'node:path'
|
||||||
import { Context, type Fiber } from 'cordis'
|
import { Context, type Fiber } from 'cordis'
|
||||||
import Loader from '@cordisjs/plugin-loader'
|
import Loader from '@cordisjs/plugin-loader'
|
||||||
import LlmService from '@deepseek-ai/dsh-llm'
|
import type { SessionEvent } from '@deepseek-ai/dsh-session'
|
||||||
import SessionStore, { type SessionEvent } from '@deepseek-ai/dsh-session'
|
import { defineTool } from '@deepseek-ai/dsh-tools'
|
||||||
import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
|
import { AgentId } from '@deepseek-ai/dsh-agent'
|
||||||
import ToolRegistry, { defineTool } from '@deepseek-ai/dsh-tools'
|
|
||||||
import AgentRegistry, { AgentId } from '@deepseek-ai/dsh-agent'
|
|
||||||
import AgentLoop, { type ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
import AgentLoop, { type ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
||||||
|
import { mountAgentLoopTestDependencies } from '@deepseek-ai/dsh-agent-loop-testkit'
|
||||||
import { LocalBashExecutor } from '@deepseek-ai/dsh-bash-local'
|
import { LocalBashExecutor } from '@deepseek-ai/dsh-bash-local'
|
||||||
import * as HooksClaude from '@deepseek-ai/dsh-hooks-claude'
|
import * as HooksClaude from '@deepseek-ai/dsh-hooks-claude'
|
||||||
import { MockAdapter, textResponse, toolCallResponse } from '../../../core/agent-loop/tests/mock-adapter.ts'
|
import { MockAdapter, textResponse, toolCallResponse } from '../../../core/agent-loop/tests/mock-adapter.ts'
|
||||||
@@ -42,11 +41,7 @@ async function harness(configDir: string, adapter: MockAdapter): Promise<Context
|
|||||||
/** {@link harness}, also exposing the bridge's fiber for tests that dispose it. */
|
/** {@link harness}, also exposing the bridge's fiber for tests that dispose it. */
|
||||||
async function harnessWithFiber(configDir: string, adapter: MockAdapter): Promise<{ ctx: Context; hooks: Fiber }> {
|
async function harnessWithFiber(configDir: string, adapter: MockAdapter): Promise<{ ctx: Context; hooks: Fiber }> {
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
await ctx.plugin(LlmService)
|
await mountAgentLoopTestDependencies(ctx)
|
||||||
await ctx.plugin(SessionStore)
|
|
||||||
await ctx.plugin(SystemPrompt)
|
|
||||||
await ctx.plugin(ToolRegistry)
|
|
||||||
await ctx.plugin(AgentRegistry)
|
|
||||||
await ctx.plugin(AgentLoop, { agents: [] })
|
await ctx.plugin(AgentLoop, { agents: [] })
|
||||||
await ctx.plugin(LocalBashExecutor, { timeoutMs: 10_000 })
|
await ctx.plugin(LocalBashExecutor, { timeoutMs: 10_000 })
|
||||||
const hooks = await ctx.plugin(HooksClaude, { configPath: join(configDir, 'hooks.json') })
|
const hooks = await ctx.plugin(HooksClaude, { configPath: join(configDir, 'hooks.json') })
|
||||||
@@ -337,11 +332,7 @@ describe('hooks-claude bridge — load resilience', () => {
|
|||||||
it('a missing config file registers no hooks and does not crash the loop', async () => {
|
it('a missing config file registers no hooks and does not crash the loop', async () => {
|
||||||
const adapter = new MockAdapter([textResponse('fine')])
|
const adapter = new MockAdapter([textResponse('fine')])
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
await ctx.plugin(LlmService)
|
await mountAgentLoopTestDependencies(ctx)
|
||||||
await ctx.plugin(SessionStore)
|
|
||||||
await ctx.plugin(SystemPrompt)
|
|
||||||
await ctx.plugin(ToolRegistry)
|
|
||||||
await ctx.plugin(AgentRegistry)
|
|
||||||
await ctx.plugin(AgentLoop, { agents: [] })
|
await ctx.plugin(AgentLoop, { agents: [] })
|
||||||
await ctx.plugin(LocalBashExecutor, { timeoutMs: 10_000 })
|
await ctx.plugin(LocalBashExecutor, { timeoutMs: 10_000 })
|
||||||
await ctx.plugin(HooksClaude, { configPath: '/nonexistent/hooks.json' })
|
await ctx.plugin(HooksClaude, { configPath: '/nonexistent/hooks.json' })
|
||||||
@@ -359,11 +350,7 @@ describe('hooks-claude bridge — load resilience', () => {
|
|||||||
const dir = writeConfig({ UserPromptSubmit: [{ hooks: [{ type: 'command', command: 'exit 2' }] }] })
|
const dir = writeConfig({ UserPromptSubmit: [{ hooks: [{ type: 'command', command: 'exit 2' }] }] })
|
||||||
const adapter = new MockAdapter([textResponse('ok')])
|
const adapter = new MockAdapter([textResponse('ok')])
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
await ctx.plugin(LlmService)
|
await mountAgentLoopTestDependencies(ctx)
|
||||||
await ctx.plugin(SessionStore)
|
|
||||||
await ctx.plugin(SystemPrompt)
|
|
||||||
await ctx.plugin(ToolRegistry)
|
|
||||||
await ctx.plugin(AgentRegistry)
|
|
||||||
await ctx.plugin(AgentLoop, { agents: [] })
|
await ctx.plugin(AgentLoop, { agents: [] })
|
||||||
await ctx.plugin(LocalBashExecutor, { timeoutMs: 10_000 })
|
await ctx.plugin(LocalBashExecutor, { timeoutMs: 10_000 })
|
||||||
const fiber = await ctx.plugin(HooksClaude, { configPath: join(dir, 'hooks.json') })
|
const fiber = await ctx.plugin(HooksClaude, { configPath: join(dir, 'hooks.json') })
|
||||||
|
|||||||
@@ -3,13 +3,12 @@ import { mkdtempSync, rmSync, writeFileSync, chmodSync, existsSync, readFileSync
|
|||||||
import { tmpdir } from 'node:os'
|
import { tmpdir } from 'node:os'
|
||||||
import { join } from 'node:path'
|
import { join } from 'node:path'
|
||||||
import { Context } from 'cordis'
|
import { Context } from 'cordis'
|
||||||
import LlmService from '@deepseek-ai/dsh-llm'
|
import type { SessionEvent } from '@deepseek-ai/dsh-session'
|
||||||
import SessionStore, { type SessionEvent } from '@deepseek-ai/dsh-session'
|
|
||||||
import SessionPersistenceJsonl from '@deepseek-ai/dsh-session-persistence-jsonl'
|
import SessionPersistenceJsonl from '@deepseek-ai/dsh-session-persistence-jsonl'
|
||||||
import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
|
import { defineTool } from '@deepseek-ai/dsh-tools'
|
||||||
import ToolRegistry, { defineTool } from '@deepseek-ai/dsh-tools'
|
import { AgentId } from '@deepseek-ai/dsh-agent'
|
||||||
import AgentRegistry, { AgentId } from '@deepseek-ai/dsh-agent'
|
|
||||||
import AgentLoop, { type ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
import AgentLoop, { type ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
||||||
|
import { mountAgentLoopTestDependencies } from '@deepseek-ai/dsh-agent-loop-testkit'
|
||||||
import { LocalBashExecutor } from '@deepseek-ai/dsh-bash-local'
|
import { LocalBashExecutor } from '@deepseek-ai/dsh-bash-local'
|
||||||
import * as HooksClaude from '@deepseek-ai/dsh-hooks-claude'
|
import * as HooksClaude from '@deepseek-ai/dsh-hooks-claude'
|
||||||
import { MockAdapter, textResponse, toolCallResponse } from '../../../core/agent-loop/tests/mock-adapter.ts'
|
import { MockAdapter, textResponse, toolCallResponse } from '../../../core/agent-loop/tests/mock-adapter.ts'
|
||||||
@@ -31,12 +30,8 @@ function hooks(d: string, h: unknown): string {
|
|||||||
type HarnessOpts = { pluginRoot?: string; projectDir?: string; stderrSummaryMaxChars?: number; sessionRoot?: string }
|
type HarnessOpts = { pluginRoot?: string; projectDir?: string; stderrSummaryMaxChars?: number; sessionRoot?: string }
|
||||||
async function harness(configPath: string, adapter: MockAdapter, opts: HarnessOpts = {}): Promise<Context> {
|
async function harness(configPath: string, adapter: MockAdapter, opts: HarnessOpts = {}): Promise<Context> {
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
await ctx.plugin(LlmService)
|
await mountAgentLoopTestDependencies(ctx)
|
||||||
await ctx.plugin(SessionStore)
|
|
||||||
if (opts.sessionRoot !== undefined) await ctx.plugin(SessionPersistenceJsonl, { root: opts.sessionRoot })
|
if (opts.sessionRoot !== undefined) await ctx.plugin(SessionPersistenceJsonl, { root: opts.sessionRoot })
|
||||||
await ctx.plugin(SystemPrompt)
|
|
||||||
await ctx.plugin(ToolRegistry)
|
|
||||||
await ctx.plugin(AgentRegistry)
|
|
||||||
await ctx.plugin(AgentLoop, { agents: [] })
|
await ctx.plugin(AgentLoop, { agents: [] })
|
||||||
await ctx.plugin(LocalBashExecutor, { timeoutMs: 10_000 })
|
await ctx.plugin(LocalBashExecutor, { timeoutMs: 10_000 })
|
||||||
await ctx.plugin(HooksClaude, { configPath, ...opts })
|
await ctx.plugin(HooksClaude, { configPath, ...opts })
|
||||||
@@ -357,11 +352,7 @@ export function defineCoverageCases(group: CoverageGroup): void {
|
|||||||
hooks(d, { UserPromptSubmit: [{ hooks: [{ type: 'command', command: s }] }] })
|
hooks(d, { UserPromptSubmit: [{ hooks: [{ type: 'command', command: s }] }] })
|
||||||
const adapter = new MockAdapter([textResponse('ok')])
|
const adapter = new MockAdapter([textResponse('ok')])
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
await ctx.plugin(LlmService)
|
await mountAgentLoopTestDependencies(ctx)
|
||||||
await ctx.plugin(SessionStore)
|
|
||||||
await ctx.plugin(SystemPrompt)
|
|
||||||
await ctx.plugin(ToolRegistry)
|
|
||||||
await ctx.plugin(AgentRegistry)
|
|
||||||
await ctx.plugin(AgentLoop, { agents: [] })
|
await ctx.plugin(AgentLoop, { agents: [] })
|
||||||
await ctx.plugin(LocalBashExecutor, { timeoutMs: 10_000 })
|
await ctx.plugin(LocalBashExecutor, { timeoutMs: 10_000 })
|
||||||
// Direct apply with only configPath — bypasses schemastery's defaults, so
|
// Direct apply with only configPath — bypasses schemastery's defaults, so
|
||||||
@@ -663,11 +654,7 @@ export function defineCoverageCases(group: CoverageGroup): void {
|
|||||||
hooks(serverDir, { PreToolUse: [{ hooks: [{ type: 'command', command: 'pwd > where' }] }] })
|
hooks(serverDir, { PreToolUse: [{ hooks: [{ type: 'command', command: 'pwd > where' }] }] })
|
||||||
const adapter = new MockAdapter([toolCallResponse('c1', 'echo', {}), textResponse('done')])
|
const adapter = new MockAdapter([toolCallResponse('c1', 'echo', {}), textResponse('done')])
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
await ctx.plugin(LlmService)
|
await mountAgentLoopTestDependencies(ctx)
|
||||||
await ctx.plugin(SessionStore)
|
|
||||||
await ctx.plugin(SystemPrompt)
|
|
||||||
await ctx.plugin(ToolRegistry)
|
|
||||||
await ctx.plugin(AgentRegistry)
|
|
||||||
await ctx.plugin(AgentLoop, { agents: [] })
|
await ctx.plugin(AgentLoop, { agents: [] })
|
||||||
// Executor default cwd = serverDir (deliberately NOT the session cwd).
|
// Executor default cwd = serverDir (deliberately NOT the session cwd).
|
||||||
await ctx.plugin(LocalBashExecutor, { timeoutMs: 10_000, cwd: serverDir })
|
await ctx.plugin(LocalBashExecutor, { timeoutMs: 10_000, cwd: serverDir })
|
||||||
@@ -696,11 +683,7 @@ export function defineCoverageCases(group: CoverageGroup): void {
|
|||||||
const marker = join(childDir, 'stopwhere')
|
const marker = join(childDir, 'stopwhere')
|
||||||
hooks(serverDir, { SubagentStop: [{ hooks: [{ type: 'command', command: 'pwd > stopwhere' }] }] })
|
hooks(serverDir, { SubagentStop: [{ hooks: [{ type: 'command', command: 'pwd > stopwhere' }] }] })
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
await ctx.plugin(LlmService)
|
await mountAgentLoopTestDependencies(ctx)
|
||||||
await ctx.plugin(SessionStore)
|
|
||||||
await ctx.plugin(SystemPrompt)
|
|
||||||
await ctx.plugin(ToolRegistry)
|
|
||||||
await ctx.plugin(AgentRegistry)
|
|
||||||
await ctx.plugin(AgentLoop, { agents: [] })
|
await ctx.plugin(AgentLoop, { agents: [] })
|
||||||
// Executor default cwd = serverDir (deliberately NOT the child session cwd).
|
// Executor default cwd = serverDir (deliberately NOT the child session cwd).
|
||||||
await ctx.plugin(LocalBashExecutor, { timeoutMs: 10_000, cwd: serverDir })
|
await ctx.plugin(LocalBashExecutor, { timeoutMs: 10_000, cwd: serverDir })
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@deepseek-ai/dsh-agent": "workspace:^",
|
"@deepseek-ai/dsh-agent": "workspace:^",
|
||||||
"@deepseek-ai/dsh-agent-loop": "workspace:^",
|
"@deepseek-ai/dsh-agent-loop": "workspace:^",
|
||||||
|
"@deepseek-ai/dsh-agent-loop-testkit": "workspace:^",
|
||||||
"@deepseek-ai/dsh-bash": "workspace:^",
|
"@deepseek-ai/dsh-bash": "workspace:^",
|
||||||
"@deepseek-ai/dsh-bash-local": "workspace:^",
|
"@deepseek-ai/dsh-bash-local": "workspace:^",
|
||||||
"@deepseek-ai/dsh-hook-protocol": "workspace:^",
|
"@deepseek-ai/dsh-hook-protocol": "workspace:^",
|
||||||
@@ -43,7 +44,6 @@
|
|||||||
"@deepseek-ai/dsh-session": "workspace:^",
|
"@deepseek-ai/dsh-session": "workspace:^",
|
||||||
"@deepseek-ai/dsh-session-persistence": "workspace:^",
|
"@deepseek-ai/dsh-session-persistence": "workspace:^",
|
||||||
"@deepseek-ai/dsh-session-persistence-jsonl": "workspace:^",
|
"@deepseek-ai/dsh-session-persistence-jsonl": "workspace:^",
|
||||||
"@deepseek-ai/dsh-system-prompt": "workspace:^",
|
|
||||||
"@deepseek-ai/dsh-tools": "workspace:^",
|
"@deepseek-ai/dsh-tools": "workspace:^",
|
||||||
"cordis": "^4.0.0-rc.7"
|
"cordis": "^4.0.0-rc.7"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,12 +4,11 @@ import { tmpdir } from 'node:os'
|
|||||||
import { join } from 'node:path'
|
import { join } from 'node:path'
|
||||||
import { Context } from 'cordis'
|
import { Context } from 'cordis'
|
||||||
import Loader from '@cordisjs/plugin-loader'
|
import Loader from '@cordisjs/plugin-loader'
|
||||||
import LlmService from '@deepseek-ai/dsh-llm'
|
import type { SessionEvent } from '@deepseek-ai/dsh-session'
|
||||||
import SessionStore, { type SessionEvent } from '@deepseek-ai/dsh-session'
|
import { defineTool } from '@deepseek-ai/dsh-tools'
|
||||||
import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
|
import { AgentId } from '@deepseek-ai/dsh-agent'
|
||||||
import ToolRegistry, { defineTool } from '@deepseek-ai/dsh-tools'
|
|
||||||
import AgentRegistry, { AgentId } from '@deepseek-ai/dsh-agent'
|
|
||||||
import AgentLoop, { type ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
import AgentLoop, { type ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
||||||
|
import { mountAgentLoopTestDependencies } from '@deepseek-ai/dsh-agent-loop-testkit'
|
||||||
import { LocalBashExecutor } from '@deepseek-ai/dsh-bash-local'
|
import { LocalBashExecutor } from '@deepseek-ai/dsh-bash-local'
|
||||||
import * as HooksCodex from '@deepseek-ai/dsh-hooks-codex'
|
import * as HooksCodex from '@deepseek-ai/dsh-hooks-codex'
|
||||||
import { MockAdapter, textResponse, toolCallResponse } from '../../../core/agent-loop/tests/mock-adapter.ts'
|
import { MockAdapter, textResponse, toolCallResponse } from '../../../core/agent-loop/tests/mock-adapter.ts'
|
||||||
@@ -40,11 +39,7 @@ function writeHooks(dir: string, hooks: unknown): void {
|
|||||||
|
|
||||||
async function harness(dir: string, adapter: MockAdapter): Promise<Context> {
|
async function harness(dir: string, adapter: MockAdapter): Promise<Context> {
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
await ctx.plugin(LlmService)
|
await mountAgentLoopTestDependencies(ctx)
|
||||||
await ctx.plugin(SessionStore)
|
|
||||||
await ctx.plugin(SystemPrompt)
|
|
||||||
await ctx.plugin(ToolRegistry)
|
|
||||||
await ctx.plugin(AgentRegistry)
|
|
||||||
await ctx.plugin(AgentLoop, { agents: [] })
|
await ctx.plugin(AgentLoop, { agents: [] })
|
||||||
await ctx.plugin(LocalBashExecutor, { timeoutMs: 10_000 })
|
await ctx.plugin(LocalBashExecutor, { timeoutMs: 10_000 })
|
||||||
await ctx.plugin(HooksCodex, { configPath: join(dir, 'hooks.json'), model: 'test-model' })
|
await ctx.plugin(HooksCodex, { configPath: join(dir, 'hooks.json'), model: 'test-model' })
|
||||||
@@ -141,11 +136,7 @@ describe('hooks-codex bridge', () => {
|
|||||||
writeHooks(dir, { UserPromptSubmit: [{ hooks: [{ type: 'command', command: deny }] }] })
|
writeHooks(dir, { UserPromptSubmit: [{ hooks: [{ type: 'command', command: deny }] }] })
|
||||||
const adapter = new MockAdapter([textResponse('ok')])
|
const adapter = new MockAdapter([textResponse('ok')])
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
await ctx.plugin(LlmService)
|
await mountAgentLoopTestDependencies(ctx)
|
||||||
await ctx.plugin(SessionStore)
|
|
||||||
await ctx.plugin(SystemPrompt)
|
|
||||||
await ctx.plugin(ToolRegistry)
|
|
||||||
await ctx.plugin(AgentRegistry)
|
|
||||||
await ctx.plugin(AgentLoop, { agents: [] })
|
await ctx.plugin(AgentLoop, { agents: [] })
|
||||||
await ctx.plugin(LocalBashExecutor, { timeoutMs: 10_000 })
|
await ctx.plugin(LocalBashExecutor, { timeoutMs: 10_000 })
|
||||||
const fiber = await ctx.plugin(HooksCodex, { configPath: join(dir, 'hooks.json'), model: 'm' })
|
const fiber = await ctx.plugin(HooksCodex, { configPath: join(dir, 'hooks.json'), model: 'm' })
|
||||||
@@ -167,11 +158,7 @@ describe('hooks-codex bridge', () => {
|
|||||||
const slow = script(dir, 'slow.sh', `#!/usr/bin/env bash\necho $$ > "${pidFile}"\ntouch "${marker}"\nsleep 30\n`)
|
const slow = script(dir, 'slow.sh', `#!/usr/bin/env bash\necho $$ > "${pidFile}"\ntouch "${marker}"\nsleep 30\n`)
|
||||||
writeHooks(dir, { SessionStart: [{ hooks: [{ type: 'command', command: slow }] }] })
|
writeHooks(dir, { SessionStart: [{ hooks: [{ type: 'command', command: slow }] }] })
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
await ctx.plugin(LlmService)
|
await mountAgentLoopTestDependencies(ctx)
|
||||||
await ctx.plugin(SessionStore)
|
|
||||||
await ctx.plugin(SystemPrompt)
|
|
||||||
await ctx.plugin(ToolRegistry)
|
|
||||||
await ctx.plugin(AgentRegistry)
|
|
||||||
await ctx.plugin(AgentLoop, { agents: [] })
|
await ctx.plugin(AgentLoop, { agents: [] })
|
||||||
await ctx.plugin(LocalBashExecutor, { timeoutMs: 10_000 })
|
await ctx.plugin(LocalBashExecutor, { timeoutMs: 10_000 })
|
||||||
const fiber = await ctx.plugin(HooksCodex, { configPath: join(dir, 'hooks.json'), model: 'm' })
|
const fiber = await ctx.plugin(HooksCodex, { configPath: join(dir, 'hooks.json'), model: 'm' })
|
||||||
|
|||||||
@@ -3,13 +3,12 @@ import { mkdtempSync, rmSync, writeFileSync, chmodSync, existsSync, readFileSync
|
|||||||
import { tmpdir } from 'node:os'
|
import { tmpdir } from 'node:os'
|
||||||
import { join } from 'node:path'
|
import { join } from 'node:path'
|
||||||
import { Context } from 'cordis'
|
import { Context } from 'cordis'
|
||||||
import LlmService from '@deepseek-ai/dsh-llm'
|
import type { SessionEvent } from '@deepseek-ai/dsh-session'
|
||||||
import SessionStore, { type SessionEvent } from '@deepseek-ai/dsh-session'
|
|
||||||
import SessionPersistenceJsonl from '@deepseek-ai/dsh-session-persistence-jsonl'
|
import SessionPersistenceJsonl from '@deepseek-ai/dsh-session-persistence-jsonl'
|
||||||
import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
|
import { defineTool } from '@deepseek-ai/dsh-tools'
|
||||||
import ToolRegistry, { defineTool } from '@deepseek-ai/dsh-tools'
|
import { AgentId } from '@deepseek-ai/dsh-agent'
|
||||||
import AgentRegistry, { AgentId } from '@deepseek-ai/dsh-agent'
|
|
||||||
import AgentLoop, { type ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
import AgentLoop, { type ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
||||||
|
import { mountAgentLoopTestDependencies } from '@deepseek-ai/dsh-agent-loop-testkit'
|
||||||
import { LocalBashExecutor } from '@deepseek-ai/dsh-bash-local'
|
import { LocalBashExecutor } from '@deepseek-ai/dsh-bash-local'
|
||||||
import * as HooksCodex from '@deepseek-ai/dsh-hooks-codex'
|
import * as HooksCodex from '@deepseek-ai/dsh-hooks-codex'
|
||||||
import { MockAdapter, textResponse, toolCallResponse } from '../../../core/agent-loop/tests/mock-adapter.ts'
|
import { MockAdapter, textResponse, toolCallResponse } from '../../../core/agent-loop/tests/mock-adapter.ts'
|
||||||
@@ -27,10 +26,9 @@ function hooks(d: string, h: unknown): string {
|
|||||||
type HarnessOpts = { stderrSummaryMaxChars?: number; sessionRoot?: string }
|
type HarnessOpts = { stderrSummaryMaxChars?: number; sessionRoot?: string }
|
||||||
async function harness(configPath: string, adapter: MockAdapter, opts: HarnessOpts = {}): Promise<Context> {
|
async function harness(configPath: string, adapter: MockAdapter, opts: HarnessOpts = {}): Promise<Context> {
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
await ctx.plugin(LlmService); await ctx.plugin(SessionStore)
|
await mountAgentLoopTestDependencies(ctx)
|
||||||
if (opts.sessionRoot !== undefined) await ctx.plugin(SessionPersistenceJsonl, { root: opts.sessionRoot })
|
if (opts.sessionRoot !== undefined) await ctx.plugin(SessionPersistenceJsonl, { root: opts.sessionRoot })
|
||||||
await ctx.plugin(SystemPrompt)
|
await ctx.plugin(AgentLoop, { agents: [] })
|
||||||
await ctx.plugin(ToolRegistry); await ctx.plugin(AgentRegistry); await ctx.plugin(AgentLoop, { agents: [] })
|
|
||||||
await ctx.plugin(LocalBashExecutor, { timeoutMs: 10_000 })
|
await ctx.plugin(LocalBashExecutor, { timeoutMs: 10_000 })
|
||||||
await ctx.plugin(HooksCodex, { configPath, model: 'm', ...opts })
|
await ctx.plugin(HooksCodex, { configPath, model: 'm', ...opts })
|
||||||
ctx.llm.registerAdapter(['mock'], adapter)
|
ctx.llm.registerAdapter(['mock'], adapter)
|
||||||
@@ -312,8 +310,8 @@ export function defineCoverageCases(groups: CoverageGroup | readonly CoverageGro
|
|||||||
const warn = vi.fn()
|
const warn = vi.fn()
|
||||||
const adapter = new MockAdapter([textResponse('ok')])
|
const adapter = new MockAdapter([textResponse('ok')])
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
await ctx.plugin(LlmService); await ctx.plugin(SessionStore); await ctx.plugin(SystemPrompt)
|
await mountAgentLoopTestDependencies(ctx)
|
||||||
await ctx.plugin(ToolRegistry); await ctx.plugin(AgentRegistry); await ctx.plugin(AgentLoop, { agents: [] })
|
await ctx.plugin(AgentLoop, { agents: [] })
|
||||||
await ctx.plugin(LocalBashExecutor, { timeoutMs: 10_000 })
|
await ctx.plugin(LocalBashExecutor, { timeoutMs: 10_000 })
|
||||||
ctx.logger.warn = warn as never
|
ctx.logger.warn = warn as never
|
||||||
// Direct apply (schema bypass) → the `model ?? ''` fallback is exercised.
|
// Direct apply (schema bypass) → the `model ?? ''` fallback is exercised.
|
||||||
@@ -621,8 +619,8 @@ export function defineCoverageCases(groups: CoverageGroup | readonly CoverageGro
|
|||||||
hooks(serverDir, { PreToolUse: [{ hooks: [{ type: 'command', command: 'pwd > where' }] }] })
|
hooks(serverDir, { PreToolUse: [{ hooks: [{ type: 'command', command: 'pwd > where' }] }] })
|
||||||
const adapter = new MockAdapter([toolCallResponse('c1', 'Bash', { command: 'x' }), textResponse('done')])
|
const adapter = new MockAdapter([toolCallResponse('c1', 'Bash', { command: 'x' }), textResponse('done')])
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
await ctx.plugin(LlmService); await ctx.plugin(SessionStore); await ctx.plugin(SystemPrompt)
|
await mountAgentLoopTestDependencies(ctx)
|
||||||
await ctx.plugin(ToolRegistry); await ctx.plugin(AgentRegistry); await ctx.plugin(AgentLoop, { agents: [] })
|
await ctx.plugin(AgentLoop, { agents: [] })
|
||||||
await ctx.plugin(LocalBashExecutor, { timeoutMs: 10_000, cwd: serverDir })
|
await ctx.plugin(LocalBashExecutor, { timeoutMs: 10_000, cwd: serverDir })
|
||||||
await ctx.plugin(HooksCodex, { configPath: join(serverDir, 'hooks.json'), model: 'm' })
|
await ctx.plugin(HooksCodex, { configPath: join(serverDir, 'hooks.json'), model: 'm' })
|
||||||
ctx.llm.registerAdapter(['mock'], adapter)
|
ctx.llm.registerAdapter(['mock'], adapter)
|
||||||
|
|||||||
@@ -34,14 +34,13 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@deepseek-ai/dsh-agent": "workspace:^",
|
"@deepseek-ai/dsh-agent": "workspace:^",
|
||||||
"@deepseek-ai/dsh-agent-loop": "workspace:^",
|
"@deepseek-ai/dsh-agent-loop": "workspace:^",
|
||||||
|
"@deepseek-ai/dsh-agent-loop-testkit": "workspace:^",
|
||||||
"@deepseek-ai/dsh-invariants": "workspace:^",
|
"@deepseek-ai/dsh-invariants": "workspace:^",
|
||||||
"@deepseek-ai/dsh-llm": "workspace:^",
|
"@deepseek-ai/dsh-llm": "workspace:^",
|
||||||
"@deepseek-ai/dsh-session": "workspace:^",
|
"@deepseek-ai/dsh-session": "workspace:^",
|
||||||
"@deepseek-ai/dsh-subagent": "workspace:^",
|
"@deepseek-ai/dsh-subagent": "workspace:^",
|
||||||
"@deepseek-ai/dsh-subagent-inprocess": "workspace:^",
|
"@deepseek-ai/dsh-subagent-inprocess": "workspace:^",
|
||||||
"@deepseek-ai/dsh-subagent-spawn": "workspace:^",
|
"@deepseek-ai/dsh-subagent-spawn": "workspace:^",
|
||||||
"@deepseek-ai/dsh-system-prompt": "workspace:^",
|
|
||||||
"@deepseek-ai/dsh-tools": "workspace:^",
|
|
||||||
"@cordisjs/plugin-loader": "^1.0.0-rc.5",
|
"@cordisjs/plugin-loader": "^1.0.0-rc.5",
|
||||||
"cordis": "^4.0.0-rc.7"
|
"cordis": "^4.0.0-rc.7"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
import { Context } from 'cordis'
|
import { Context } from 'cordis'
|
||||||
import LlmService from '@deepseek-ai/dsh-llm'
|
import { AgentId } from '@deepseek-ai/dsh-agent'
|
||||||
import SessionStore from '@deepseek-ai/dsh-session'
|
|
||||||
import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
|
|
||||||
import ToolRegistry from '@deepseek-ai/dsh-tools'
|
|
||||||
import AgentRegistry, { AgentId } from '@deepseek-ai/dsh-agent'
|
|
||||||
import AgentLoop from '@deepseek-ai/dsh-agent-loop'
|
import AgentLoop from '@deepseek-ai/dsh-agent-loop'
|
||||||
|
import { mountAgentLoopTestDependencies } from '@deepseek-ai/dsh-agent-loop-testkit'
|
||||||
import * as Invariants from '@deepseek-ai/dsh-invariants'
|
import * as Invariants from '@deepseek-ai/dsh-invariants'
|
||||||
import SubagentService, { type SubagentStartRequest } from '@deepseek-ai/dsh-subagent'
|
import SubagentService, { type SubagentStartRequest } from '@deepseek-ai/dsh-subagent'
|
||||||
import * as Spawn from '@deepseek-ai/dsh-subagent-spawn'
|
import * as Spawn from '@deepseek-ai/dsh-subagent-spawn'
|
||||||
@@ -26,11 +23,7 @@ function start(ctx: Context, provider: string, request: Omit<SubagentStartReques
|
|||||||
*/
|
*/
|
||||||
async function setup(script: Script) {
|
async function setup(script: Script) {
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
await ctx.plugin(LlmService)
|
await mountAgentLoopTestDependencies(ctx)
|
||||||
await ctx.plugin(SessionStore)
|
|
||||||
await ctx.plugin(SystemPrompt)
|
|
||||||
await ctx.plugin(ToolRegistry)
|
|
||||||
await ctx.plugin(AgentRegistry)
|
|
||||||
await ctx.plugin(Invariants)
|
await ctx.plugin(Invariants)
|
||||||
await ctx.plugin(AgentLoop, { agents: [] })
|
await ctx.plugin(AgentLoop, { agents: [] })
|
||||||
await ctx.plugin(SubagentService)
|
await ctx.plugin(SubagentService)
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
import { Context } from 'cordis'
|
import { Context } from 'cordis'
|
||||||
import Loader from '@cordisjs/plugin-loader'
|
import Loader from '@cordisjs/plugin-loader'
|
||||||
import LlmService from '@deepseek-ai/dsh-llm'
|
|
||||||
import SessionStore from '@deepseek-ai/dsh-session'
|
|
||||||
import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
|
|
||||||
import ToolRegistry from '@deepseek-ai/dsh-tools'
|
|
||||||
import AgentRegistry, { AgentId } from '@deepseek-ai/dsh-agent'
|
import AgentRegistry, { AgentId } from '@deepseek-ai/dsh-agent'
|
||||||
import AgentLoop from '@deepseek-ai/dsh-agent-loop'
|
import AgentLoop from '@deepseek-ai/dsh-agent-loop'
|
||||||
|
import { mountAgentLoopTestDependencies } from '@deepseek-ai/dsh-agent-loop-testkit'
|
||||||
import * as Invariants from '@deepseek-ai/dsh-invariants'
|
import * as Invariants from '@deepseek-ai/dsh-invariants'
|
||||||
import SubagentService, { type SubagentStartRequest } from '@deepseek-ai/dsh-subagent'
|
import SubagentService, { type SubagentStartRequest } from '@deepseek-ai/dsh-subagent'
|
||||||
import { MockAdapter, textResponse, toolCallResponse } from '../../../core/agent-loop/tests/mock-adapter.ts'
|
import { MockAdapter, textResponse, toolCallResponse } from '../../../core/agent-loop/tests/mock-adapter.ts'
|
||||||
@@ -33,11 +30,7 @@ const emptyStop: StreamChunk[] = [{ type: 'finish', reason: { kind: 'stop' } }]
|
|||||||
*/
|
*/
|
||||||
async function setup(script: Script) {
|
async function setup(script: Script) {
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
await ctx.plugin(LlmService)
|
await mountAgentLoopTestDependencies(ctx)
|
||||||
await ctx.plugin(SessionStore)
|
|
||||||
await ctx.plugin(SystemPrompt)
|
|
||||||
await ctx.plugin(ToolRegistry)
|
|
||||||
await ctx.plugin(AgentRegistry)
|
|
||||||
await ctx.plugin(Invariants)
|
await ctx.plugin(Invariants)
|
||||||
await ctx.plugin(AgentLoop, { agents: [] })
|
await ctx.plugin(AgentLoop, { agents: [] })
|
||||||
await ctx.plugin(SubagentService)
|
await ctx.plugin(SubagentService)
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@deepseek-ai/dsh-agent": "workspace:^",
|
"@deepseek-ai/dsh-agent": "workspace:^",
|
||||||
"@deepseek-ai/dsh-agent-loop": "workspace:^",
|
"@deepseek-ai/dsh-agent-loop": "workspace:^",
|
||||||
|
"@deepseek-ai/dsh-agent-loop-testkit": "workspace:^",
|
||||||
"@deepseek-ai/dsh-invariants": "workspace:^",
|
"@deepseek-ai/dsh-invariants": "workspace:^",
|
||||||
"@deepseek-ai/dsh-llm": "workspace:^",
|
"@deepseek-ai/dsh-llm": "workspace:^",
|
||||||
"@deepseek-ai/dsh-session": "workspace:^",
|
"@deepseek-ai/dsh-session": "workspace:^",
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
import { Context } from 'cordis'
|
import { Context } from 'cordis'
|
||||||
import LlmService, { CallId, type ContentBlock, type GenerateOptions } from '@deepseek-ai/dsh-llm'
|
import { CallId, type ContentBlock, type GenerateOptions } from '@deepseek-ai/dsh-llm'
|
||||||
import SessionStore from '@deepseek-ai/dsh-session'
|
import { AgentId } from '@deepseek-ai/dsh-agent'
|
||||||
import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
|
|
||||||
import ToolRegistry from '@deepseek-ai/dsh-tools'
|
|
||||||
import AgentRegistry, { AgentId } from '@deepseek-ai/dsh-agent'
|
|
||||||
import type { ContinuationDecision } from '@deepseek-ai/dsh-agent'
|
import type { ContinuationDecision } from '@deepseek-ai/dsh-agent'
|
||||||
import AgentLoop from '@deepseek-ai/dsh-agent-loop'
|
import AgentLoop from '@deepseek-ai/dsh-agent-loop'
|
||||||
|
import { mountAgentLoopTestDependencies } from '@deepseek-ai/dsh-agent-loop-testkit'
|
||||||
import * as Invariants from '@deepseek-ai/dsh-invariants'
|
import * as Invariants from '@deepseek-ai/dsh-invariants'
|
||||||
import SubagentService, { type SubagentStartRequest } from '@deepseek-ai/dsh-subagent'
|
import SubagentService, { type SubagentStartRequest } from '@deepseek-ai/dsh-subagent'
|
||||||
import type { Config as ToolConfig, StructuredOutputSchema } from '@deepseek-ai/dsh-tools'
|
import type { Config as ToolConfig, StructuredOutputSchema } from '@deepseek-ai/dsh-tools'
|
||||||
@@ -43,10 +41,9 @@ const SCHEMA: StructuredOutputSchema = {
|
|||||||
async function setup(script: Script, options: SetupOptions = {}) {
|
async function setup(script: Script, options: SetupOptions = {}) {
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
const adapter = new MockAdapter(script)
|
const adapter = new MockAdapter(script)
|
||||||
await ctx.plugin(LlmService)
|
await mountAgentLoopTestDependencies(ctx, {
|
||||||
await ctx.plugin(SessionStore)
|
tools: { mode: options.toolMode ?? 'native' },
|
||||||
await ctx.plugin(SystemPrompt)
|
})
|
||||||
await ctx.plugin(ToolRegistry, { mode: options.toolMode ?? 'native' })
|
|
||||||
if (options.toolMode === 'code' || options.toolMode === 'both') {
|
if (options.toolMode === 'code' || options.toolMode === 'both') {
|
||||||
ctx.provide('codeRuntime', {
|
ctx.provide('codeRuntime', {
|
||||||
language: 'typescript',
|
language: 'typescript',
|
||||||
@@ -54,7 +51,6 @@ async function setup(script: Script, options: SetupOptions = {}) {
|
|||||||
run: options.codeRun ?? (() => Promise.resolve({ logs: [] })),
|
run: options.codeRun ?? (() => Promise.resolve({ logs: [] })),
|
||||||
} as never)
|
} as never)
|
||||||
}
|
}
|
||||||
await ctx.plugin(AgentRegistry)
|
|
||||||
await ctx.plugin(Invariants)
|
await ctx.plugin(Invariants)
|
||||||
await ctx.plugin(AgentLoop, { agents: [] })
|
await ctx.plugin(AgentLoop, { agents: [] })
|
||||||
await ctx.plugin(SubagentService)
|
await ctx.plugin(SubagentService)
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
import { Context } from 'cordis'
|
import { Context } from 'cordis'
|
||||||
import LlmService from '@deepseek-ai/dsh-llm'
|
import { AgentId, type Agent } from '@deepseek-ai/dsh-agent'
|
||||||
import SessionStore from '@deepseek-ai/dsh-session'
|
|
||||||
import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
|
|
||||||
import ToolRegistry from '@deepseek-ai/dsh-tools'
|
|
||||||
import AgentRegistry, { AgentId, type Agent } from '@deepseek-ai/dsh-agent'
|
|
||||||
import AgentLoop from '@deepseek-ai/dsh-agent-loop'
|
import AgentLoop from '@deepseek-ai/dsh-agent-loop'
|
||||||
|
import { mountAgentLoopTestDependencies } from '@deepseek-ai/dsh-agent-loop-testkit'
|
||||||
import * as Invariants from '@deepseek-ai/dsh-invariants'
|
import * as Invariants from '@deepseek-ai/dsh-invariants'
|
||||||
import SubagentService from '@deepseek-ai/dsh-subagent'
|
import SubagentService from '@deepseek-ai/dsh-subagent'
|
||||||
import { MockAdapter, textResponse } from '../../../core/agent-loop/tests/mock-adapter.ts'
|
import { MockAdapter, textResponse } from '../../../core/agent-loop/tests/mock-adapter.ts'
|
||||||
@@ -15,11 +12,7 @@ type Script = ConstructorParameters<typeof MockAdapter>[0]
|
|||||||
|
|
||||||
async function setup(script: Script) {
|
async function setup(script: Script) {
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
await ctx.plugin(LlmService)
|
await mountAgentLoopTestDependencies(ctx)
|
||||||
await ctx.plugin(SessionStore)
|
|
||||||
await ctx.plugin(SystemPrompt)
|
|
||||||
await ctx.plugin(ToolRegistry)
|
|
||||||
await ctx.plugin(AgentRegistry)
|
|
||||||
await ctx.plugin(Invariants)
|
await ctx.plugin(Invariants)
|
||||||
await ctx.plugin(AgentLoop, { agents: [] })
|
await ctx.plugin(AgentLoop, { agents: [] })
|
||||||
await ctx.plugin(SubagentService)
|
await ctx.plugin(SubagentService)
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@deepseek-ai/dsh-agent": "workspace:^",
|
"@deepseek-ai/dsh-agent": "workspace:^",
|
||||||
"@deepseek-ai/dsh-agent-loop": "workspace:^",
|
"@deepseek-ai/dsh-agent-loop": "workspace:^",
|
||||||
|
"@deepseek-ai/dsh-agent-loop-testkit": "workspace:^",
|
||||||
"@deepseek-ai/dsh-bash-local": "workspace:^",
|
"@deepseek-ai/dsh-bash-local": "workspace:^",
|
||||||
"@deepseek-ai/dsh-invariants": "workspace:^",
|
"@deepseek-ai/dsh-invariants": "workspace:^",
|
||||||
"@deepseek-ai/dsh-llm": "workspace:^",
|
"@deepseek-ai/dsh-llm": "workspace:^",
|
||||||
@@ -39,10 +40,8 @@
|
|||||||
"@deepseek-ai/dsh-session": "workspace:^",
|
"@deepseek-ai/dsh-session": "workspace:^",
|
||||||
"@deepseek-ai/dsh-subagent": "workspace:^",
|
"@deepseek-ai/dsh-subagent": "workspace:^",
|
||||||
"@deepseek-ai/dsh-subagent-inprocess": "workspace:^",
|
"@deepseek-ai/dsh-subagent-inprocess": "workspace:^",
|
||||||
"@deepseek-ai/dsh-system-prompt": "workspace:^",
|
|
||||||
"@deepseek-ai/dsh-tool-bash": "workspace:^",
|
"@deepseek-ai/dsh-tool-bash": "workspace:^",
|
||||||
"@deepseek-ai/dsh-tool-subagent": "workspace:^",
|
"@deepseek-ai/dsh-tool-subagent": "workspace:^",
|
||||||
"@deepseek-ai/dsh-tools": "workspace:^",
|
|
||||||
"@cordisjs/plugin-loader": "^1.0.0-rc.5",
|
"@cordisjs/plugin-loader": "^1.0.0-rc.5",
|
||||||
"cordis": "^4.0.0-rc.7"
|
"cordis": "^4.0.0-rc.7"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
import { Context } from 'cordis'
|
import { Context } from 'cordis'
|
||||||
import LlmService from '@deepseek-ai/dsh-llm'
|
import type { Agent } from '@deepseek-ai/dsh-agent'
|
||||||
import SessionStore from '@deepseek-ai/dsh-session'
|
|
||||||
import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
|
|
||||||
import ToolRegistry from '@deepseek-ai/dsh-tools'
|
|
||||||
import AgentRegistry, { type Agent } from '@deepseek-ai/dsh-agent'
|
|
||||||
import AgentLoop from '@deepseek-ai/dsh-agent-loop'
|
import AgentLoop from '@deepseek-ai/dsh-agent-loop'
|
||||||
|
import { mountAgentLoopTestDependencies } from '@deepseek-ai/dsh-agent-loop-testkit'
|
||||||
import { LocalBashExecutor } from '@deepseek-ai/dsh-bash-local'
|
import { LocalBashExecutor } from '@deepseek-ai/dsh-bash-local'
|
||||||
import * as ToolBash from '@deepseek-ai/dsh-tool-bash'
|
import * as ToolBash from '@deepseek-ai/dsh-tool-bash'
|
||||||
import * as LlmDeepSeek from '@deepseek-ai/dsh-llm-deepseek'
|
import * as LlmDeepSeek from '@deepseek-ai/dsh-llm-deepseek'
|
||||||
@@ -21,15 +18,13 @@ import * as ToolSubagent from '@deepseek-ai/dsh-tool-subagent'
|
|||||||
*/
|
*/
|
||||||
export async function spawnHarness(workdir: string): Promise<Context> {
|
export async function spawnHarness(workdir: string): Promise<Context> {
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
await ctx.plugin(LlmService)
|
|
||||||
await ctx.plugin(SessionStore)
|
|
||||||
// This harness installs only the global default persona, so both parent and
|
// This harness installs only the global default persona, so both parent and
|
||||||
// spawned children render it. It stays neutral for both roles; the
|
// spawned children render it. It stays neutral for both roles; the
|
||||||
// delegation nudge lives in the e2e's user prompt and the subagent tool's
|
// delegation nudge lives in the e2e's user prompt and the subagent tool's
|
||||||
// own description.
|
// own description.
|
||||||
await ctx.plugin(SystemPrompt, { persona: 'You are a coding agent. Report only when the requested work is done.' })
|
await mountAgentLoopTestDependencies(ctx, {
|
||||||
await ctx.plugin(ToolRegistry)
|
systemPrompt: { persona: 'You are a coding agent. Report only when the requested work is done.' },
|
||||||
await ctx.plugin(AgentRegistry)
|
})
|
||||||
await ctx.plugin(AgentLoop, { agents: [] })
|
await ctx.plugin(AgentLoop, { agents: [] })
|
||||||
await ctx.plugin(LlmDeepSeek, { models: ['deepseek-v4-flash'] })
|
await ctx.plugin(LlmDeepSeek, { models: ['deepseek-v4-flash'] })
|
||||||
await ctx.plugin(LocalBashExecutor, { cwd: workdir, timeoutMs: 30_000 })
|
await ctx.plugin(LocalBashExecutor, { cwd: workdir, timeoutMs: 30_000 })
|
||||||
|
|||||||
@@ -1,13 +1,10 @@
|
|||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
import { Context } from 'cordis'
|
import { Context } from 'cordis'
|
||||||
import Loader from '@cordisjs/plugin-loader'
|
import Loader from '@cordisjs/plugin-loader'
|
||||||
import LlmService from '@deepseek-ai/dsh-llm'
|
|
||||||
import SessionStore from '@deepseek-ai/dsh-session'
|
|
||||||
import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
|
|
||||||
import ToolRegistry from '@deepseek-ai/dsh-tools'
|
|
||||||
import AgentRegistry, { AgentId } from '@deepseek-ai/dsh-agent'
|
import AgentRegistry, { AgentId } from '@deepseek-ai/dsh-agent'
|
||||||
import { SessionId } from '@deepseek-ai/dsh-session'
|
import { SessionId } from '@deepseek-ai/dsh-session'
|
||||||
import AgentLoop from '@deepseek-ai/dsh-agent-loop'
|
import AgentLoop from '@deepseek-ai/dsh-agent-loop'
|
||||||
|
import { mountAgentLoopTestDependencies } from '@deepseek-ai/dsh-agent-loop-testkit'
|
||||||
import * as Invariants from '@deepseek-ai/dsh-invariants'
|
import * as Invariants from '@deepseek-ai/dsh-invariants'
|
||||||
import SubagentService, { type SubagentStartRequest } from '@deepseek-ai/dsh-subagent'
|
import SubagentService, { type SubagentStartRequest } from '@deepseek-ai/dsh-subagent'
|
||||||
import { MockAdapter, maxTokensResponse, textResponse, toolCallResponse } from '../../../core/agent-loop/tests/mock-adapter.ts'
|
import { MockAdapter, maxTokensResponse, textResponse, toolCallResponse } from '../../../core/agent-loop/tests/mock-adapter.ts'
|
||||||
@@ -26,11 +23,7 @@ type Script = ConstructorParameters<typeof MockAdapter>[0]
|
|||||||
async function setup(script: Script) {
|
async function setup(script: Script) {
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
const adapter = new MockAdapter(script)
|
const adapter = new MockAdapter(script)
|
||||||
await ctx.plugin(LlmService)
|
await mountAgentLoopTestDependencies(ctx)
|
||||||
await ctx.plugin(SessionStore)
|
|
||||||
await ctx.plugin(SystemPrompt)
|
|
||||||
await ctx.plugin(ToolRegistry)
|
|
||||||
await ctx.plugin(AgentRegistry)
|
|
||||||
await ctx.plugin(Invariants)
|
await ctx.plugin(Invariants)
|
||||||
await ctx.plugin(AgentLoop, { agents: [] })
|
await ctx.plugin(AgentLoop, { agents: [] })
|
||||||
await ctx.plugin(SubagentService)
|
await ctx.plugin(SubagentService)
|
||||||
@@ -303,11 +296,7 @@ describe('dsh-subagent-spawn', () => {
|
|||||||
// Rebuild the stack by hand so we hold the backend's fiber.
|
// Rebuild the stack by hand so we hold the backend's fiber.
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
const adapter = new MockAdapter(['hang'])
|
const adapter = new MockAdapter(['hang'])
|
||||||
await ctx.plugin(LlmService)
|
await mountAgentLoopTestDependencies(ctx)
|
||||||
await ctx.plugin(SessionStore)
|
|
||||||
await ctx.plugin(SystemPrompt)
|
|
||||||
await ctx.plugin(ToolRegistry)
|
|
||||||
await ctx.plugin(AgentRegistry)
|
|
||||||
await ctx.plugin(Invariants)
|
await ctx.plugin(Invariants)
|
||||||
await ctx.plugin(AgentLoop, { agents: [] })
|
await ctx.plugin(AgentLoop, { agents: [] })
|
||||||
await ctx.plugin(SubagentService)
|
await ctx.plugin(SubagentService)
|
||||||
@@ -336,11 +325,7 @@ describe('dsh-subagent-spawn', () => {
|
|||||||
|
|
||||||
it('a start racing an already-unloading backend cannot begin child creation', async () => {
|
it('a start racing an already-unloading backend cannot begin child creation', async () => {
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
await ctx.plugin(LlmService)
|
await mountAgentLoopTestDependencies(ctx)
|
||||||
await ctx.plugin(SessionStore)
|
|
||||||
await ctx.plugin(SystemPrompt)
|
|
||||||
await ctx.plugin(ToolRegistry)
|
|
||||||
await ctx.plugin(AgentRegistry)
|
|
||||||
await ctx.plugin(AgentLoop, { agents: [] })
|
await ctx.plugin(AgentLoop, { agents: [] })
|
||||||
await ctx.plugin(SubagentService)
|
await ctx.plugin(SubagentService)
|
||||||
const fiber = await ctx.plugin(spawn, { providerName: 'spawn' })
|
const fiber = await ctx.plugin(spawn, { providerName: 'spawn' })
|
||||||
|
|||||||
@@ -5,9 +5,10 @@ Packages that exist to serve development, testing, and the examples rather than
|
|||||||
| Package | Role | ctx key |
|
| Package | Role | ctx key |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| `acp-snapshot/` | ACP snapshot suite kit: subprocess scenario harness + golden normalizers + the `defineAcpSnapshotSuite` factory | (library — imported by example `*.snapshot.ts` suites) |
|
| `acp-snapshot/` | ACP snapshot suite kit: subprocess scenario harness + golden normalizers + the `defineAcpSnapshotSuite` factory | (library — imported by example `*.snapshot.ts` suites) |
|
||||||
|
| `agent-loop-testkit/` | Shared prerequisite mounting for tests that exercise the concrete agent loop | (library — imported by AgentLoop integration tests) |
|
||||||
| `invariants/` | Runtime event-contract assertions for development diagnostics | (listens on `session/*`, `agent/*`) |
|
| `invariants/` | Runtime event-contract assertions for development diagnostics | (listens on `session/*`, `agent/*`) |
|
||||||
| `loader-smoke/` | Shared real-Loader subprocess harness for keyless example smokes | (library — imported by example e2e suites) |
|
| `loader-smoke/` | Shared real-Loader subprocess harness for keyless example smokes | (library — imported by example e2e suites) |
|
||||||
| `llm-replay/` | Record/replay adapter: short-circuits `llm/stream` from a recorded session JSONL (keyless snapshot tests) | (listens on `llm/stream`) |
|
| `llm-replay/` | Record/replay adapter: short-circuits `llm/stream` from a recorded session JSONL (keyless snapshot tests) | (listens on `llm/stream`) |
|
||||||
| `subagent-mock/` | Scripted `SubagentProvider` for deterministic seam/tool tests | (registers on `ctx.subagents`) |
|
| `subagent-mock/` | Scripted `SubagentProvider` for deterministic seam/tool tests | (registers on `ctx.subagents`) |
|
||||||
|
|
||||||
`invariants` is development support but has no environment guard: it runs wherever registered, and the default `dsh-agent-spine-demo` bundle mounts it unconditionally. `llm-replay` backs the demos and the snapshot test tier under the per-file coverage gate. `acp-snapshot` carries the snapshot tier's harness/normalizer/suite machinery, while `loader-smoke` owns the parallel stdio/Loader process boundary used by keyless example e2e suites. `subagent-mock` exercises the real `ctx.subagents` load path without a model or child agent. A package graduates OUT of `support/` into a product group only when it gains documented product consumers.
|
`invariants` is development support but has no environment guard: it runs wherever registered, and the default `dsh-agent-spine-demo` bundle mounts it unconditionally. `agent-loop-testkit` centralizes the mandatory service spine for hand-built AgentLoop tests without owning their loop or scenario. `llm-replay` backs the demos and the snapshot test tier under the per-file coverage gate. `acp-snapshot` carries the snapshot tier's harness/normalizer/suite machinery, while `loader-smoke` owns the parallel stdio/Loader process boundary used by keyless example e2e suites. `subagent-mock` exercises the real `ctx.subagents` load path without a model or child agent. A package graduates OUT of `support/` into a product group only when it gains documented product consumers.
|
||||||
|
|||||||
27
packages/support/agent-loop-testkit/README.md
Normal file
27
packages/support/agent-loop-testkit/README.md
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
# `@deepseek-ai/dsh-agent-loop-testkit`
|
||||||
|
|
||||||
|
Shared prerequisite mounting for tests that exercise the concrete `AgentLoop`. `mountAgentLoopTestDependencies(ctx, options?)` installs the LLM, session, system-prompt, tool, and agent services in dependency order, then returns before the loop is mounted.
|
||||||
|
|
||||||
|
The caller registers adapters and optional plugins, mounts `AgentLoop` with the configuration under test, and disposes its own Context. System-prompt and tool-registry configuration can be forwarded through `options`; the helper does not provide test defaults beyond those owned by the services. A plugin-load failure rejects the helper call, while services activated earlier in the sequence remain owned by the caller's Context.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { Context } from 'cordis'
|
||||||
|
import AgentLoop from '@deepseek-ai/dsh-agent-loop'
|
||||||
|
import { mountAgentLoopTestDependencies } from '@deepseek-ai/dsh-agent-loop-testkit'
|
||||||
|
|
||||||
|
const ctx = new Context()
|
||||||
|
|
||||||
|
await mountAgentLoopTestDependencies(ctx)
|
||||||
|
// Register the test adapter and any optional plugins here.
|
||||||
|
await ctx.plugin(AgentLoop, { agents: [] })
|
||||||
|
```
|
||||||
|
|
||||||
|
Tests of injection failures, partial topology, service load order, or service teardown mount their dependencies directly instead of using this helper.
|
||||||
|
|
||||||
|
## Model Experience
|
||||||
|
|
||||||
|
None, as this test-only composition helper neither drives nor modifies model requests.
|
||||||
|
|
||||||
|
## Known Limitations and Deferred Work
|
||||||
|
|
||||||
|
- **Only the mandatory prerequisite spine is shared** — adapters, optional plugins, `AgentLoop`, agents, and Context teardown remain caller-owned so scenario-specific ordering stays visible.
|
||||||
41
packages/support/agent-loop-testkit/package.json
Normal file
41
packages/support/agent-loop-testkit/package.json
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
"name": "@deepseek-ai/dsh-agent-loop-testkit",
|
||||||
|
"description": "Shared prerequisite mounting for tests that exercise the concrete agent loop",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"private": true,
|
||||||
|
"type": "module",
|
||||||
|
"main": "lib/index.js",
|
||||||
|
"types": "lib/types/index.d.ts",
|
||||||
|
"exports": {
|
||||||
|
".": {
|
||||||
|
"types": "./lib/types/index.d.ts",
|
||||||
|
"default": "./lib/index.js"
|
||||||
|
},
|
||||||
|
"./src/*": "./src/*",
|
||||||
|
"./package.json": "./package.json"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"lib/index.js",
|
||||||
|
"lib/types/**/*.d.ts",
|
||||||
|
"lib/types/**/*.d.ts.map",
|
||||||
|
"src"
|
||||||
|
],
|
||||||
|
"license": "BSD-3-Clause",
|
||||||
|
"peerDependencies": {
|
||||||
|
"@deepseek-ai/dsh-agent": "^0.0.1",
|
||||||
|
"@deepseek-ai/dsh-llm": "^0.0.1",
|
||||||
|
"@deepseek-ai/dsh-session": "^0.0.1",
|
||||||
|
"@deepseek-ai/dsh-system-prompt": "^0.0.1",
|
||||||
|
"@deepseek-ai/dsh-tools": "^0.0.1",
|
||||||
|
"cordis": "^4.0.0-rc.7"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@deepseek-ai/dsh-agent": "workspace:^",
|
||||||
|
"@deepseek-ai/dsh-agent-loop": "workspace:^",
|
||||||
|
"@deepseek-ai/dsh-llm": "workspace:^",
|
||||||
|
"@deepseek-ai/dsh-session": "workspace:^",
|
||||||
|
"@deepseek-ai/dsh-system-prompt": "workspace:^",
|
||||||
|
"@deepseek-ai/dsh-tools": "workspace:^",
|
||||||
|
"cordis": "^4.0.0-rc.7"
|
||||||
|
}
|
||||||
|
}
|
||||||
46
packages/support/agent-loop-testkit/src/index.ts
Normal file
46
packages/support/agent-loop-testkit/src/index.ts
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
/**
|
||||||
|
* Shared mounting for the services required before tests load the concrete
|
||||||
|
* agent loop. The caller retains ownership of the context, loop, adapters,
|
||||||
|
* optional plugins, and teardown.
|
||||||
|
* @module @deepseek-ai/dsh-agent-loop-testkit
|
||||||
|
*/
|
||||||
|
|
||||||
|
import type { Context } from 'cordis'
|
||||||
|
import AgentRegistry from '@deepseek-ai/dsh-agent'
|
||||||
|
import LlmService from '@deepseek-ai/dsh-llm'
|
||||||
|
import SessionStore from '@deepseek-ai/dsh-session'
|
||||||
|
import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
|
||||||
|
import type { Config as SystemPromptConfig } from '@deepseek-ai/dsh-system-prompt'
|
||||||
|
import ToolRegistry from '@deepseek-ai/dsh-tools'
|
||||||
|
import type { Config as ToolRegistryConfig } from '@deepseek-ai/dsh-tools'
|
||||||
|
|
||||||
|
/** Configuration forwarded to the prerequisite service plugins. */
|
||||||
|
export interface AgentLoopTestDependenciesOptions {
|
||||||
|
/** Configuration for the system-prompt registry. */
|
||||||
|
readonly systemPrompt?: SystemPromptConfig
|
||||||
|
/** Configuration for the tool registry. */
|
||||||
|
readonly tools?: ToolRegistryConfig
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mount the standard prerequisite services for an AgentLoop test.
|
||||||
|
*
|
||||||
|
* The function deliberately does not mount AgentLoop or register an adapter,
|
||||||
|
* so tests retain control of load order and the topology under test. The
|
||||||
|
* context owns every mounted service and remains responsible for disposal. A
|
||||||
|
* plugin-load failure rejects the promise; services activated earlier in the
|
||||||
|
* sequence remain context-owned and unwind with that context.
|
||||||
|
* @param ctx - test context that owns the mounted services.
|
||||||
|
* @param options - optional service configuration forwarded without mutation.
|
||||||
|
* @returns after every prerequisite service has activated.
|
||||||
|
*/
|
||||||
|
export async function mountAgentLoopTestDependencies(
|
||||||
|
ctx: Context,
|
||||||
|
options: AgentLoopTestDependenciesOptions = {},
|
||||||
|
): Promise<void> {
|
||||||
|
await ctx.plugin(LlmService)
|
||||||
|
await ctx.plugin(SessionStore)
|
||||||
|
await ctx.plugin(SystemPrompt, options.systemPrompt ?? {})
|
||||||
|
await ctx.plugin(ToolRegistry, options.tools ?? {})
|
||||||
|
await ctx.plugin(AgentRegistry)
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
import { describe, expect, it } from 'vitest'
|
||||||
|
import { Context } from 'cordis'
|
||||||
|
import AgentLoop from '@deepseek-ai/dsh-agent-loop'
|
||||||
|
import { renderPrompt } from '@deepseek-ai/dsh-system-prompt'
|
||||||
|
import { mountAgentLoopTestDependencies } from '../src/index.ts'
|
||||||
|
|
||||||
|
describe('dsh-agent-loop-testkit', () => {
|
||||||
|
it('mounts a configurable prerequisite spine that can activate AgentLoop', async () => {
|
||||||
|
const ctx = new Context()
|
||||||
|
await mountAgentLoopTestDependencies(ctx, {
|
||||||
|
systemPrompt: { persona: 'Test persona.' },
|
||||||
|
tools: { mode: 'native' },
|
||||||
|
})
|
||||||
|
|
||||||
|
expect(renderPrompt(await ctx.systemPrompt.assemble())).toContain('Test persona.')
|
||||||
|
await expect(ctx.plugin(AgentLoop, { agents: [] })).resolves.toBeDefined()
|
||||||
|
|
||||||
|
await ctx.fiber.dispose()
|
||||||
|
})
|
||||||
|
})
|
||||||
33
packages/support/agent-loop-testkit/tsconfig.json
Normal file
33
packages/support/agent-loop-testkit/tsconfig.json
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../../tsconfig.base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"rootDir": "src",
|
||||||
|
"outDir": "lib/types"
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"src"
|
||||||
|
],
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"path": "../../../vendor/cosmokit"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "../../../vendor/cordis"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "../../core/agent"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "../../llm/llm"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "../../core/session"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "../../core/system-prompt"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "../../core/tools"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -30,6 +30,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@deepseek-ai/dsh-agent": "workspace:^",
|
"@deepseek-ai/dsh-agent": "workspace:^",
|
||||||
"@deepseek-ai/dsh-agent-loop": "workspace:^",
|
"@deepseek-ai/dsh-agent-loop": "workspace:^",
|
||||||
|
"@deepseek-ai/dsh-agent-loop-testkit": "workspace:^",
|
||||||
"@deepseek-ai/dsh-llm": "workspace:^",
|
"@deepseek-ai/dsh-llm": "workspace:^",
|
||||||
"@deepseek-ai/dsh-session": "workspace:^",
|
"@deepseek-ai/dsh-session": "workspace:^",
|
||||||
"@deepseek-ai/dsh-system-prompt": "workspace:^",
|
"@deepseek-ai/dsh-system-prompt": "workspace:^",
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
import { Context } from 'cordis'
|
import { Context } from 'cordis'
|
||||||
import LlmService from '@deepseek-ai/dsh-llm'
|
|
||||||
import SessionStore from '@deepseek-ai/dsh-session'
|
|
||||||
import type { SessionEvent } from '@deepseek-ai/dsh-session'
|
import type { SessionEvent } from '@deepseek-ai/dsh-session'
|
||||||
import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
|
import { AgentId } from '@deepseek-ai/dsh-agent'
|
||||||
import ToolRegistry from '@deepseek-ai/dsh-tools'
|
|
||||||
import AgentRegistry, { AgentId } from '@deepseek-ai/dsh-agent'
|
|
||||||
import AgentLoop, { ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
import AgentLoop, { ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
||||||
|
import { mountAgentLoopTestDependencies } from '@deepseek-ai/dsh-agent-loop-testkit'
|
||||||
import * as ToolTodo from '@deepseek-ai/dsh-tool-todo'
|
import * as ToolTodo from '@deepseek-ai/dsh-tool-todo'
|
||||||
import { MockAdapter, textResponse, toolCallResponse } from '../../../core/agent-loop/tests/mock-adapter.ts'
|
import { MockAdapter, textResponse, toolCallResponse } from '../../../core/agent-loop/tests/mock-adapter.ts'
|
||||||
|
|
||||||
@@ -18,11 +15,7 @@ import { MockAdapter, textResponse, toolCallResponse } from '../../../core/agent
|
|||||||
*/
|
*/
|
||||||
async function harness(adapter: MockAdapter): Promise<Context> {
|
async function harness(adapter: MockAdapter): Promise<Context> {
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
await ctx.plugin(LlmService)
|
await mountAgentLoopTestDependencies(ctx)
|
||||||
await ctx.plugin(SessionStore)
|
|
||||||
await ctx.plugin(SystemPrompt)
|
|
||||||
await ctx.plugin(ToolRegistry)
|
|
||||||
await ctx.plugin(AgentRegistry)
|
|
||||||
await ctx.plugin(AgentLoop, { agents: [] })
|
await ctx.plugin(AgentLoop, { agents: [] })
|
||||||
await ctx.plugin(ToolTodo)
|
await ctx.plugin(ToolTodo)
|
||||||
ctx.llm.registerAdapter(['mock'], adapter)
|
ctx.llm.registerAdapter(['mock'], adapter)
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@deepseek-ai/dsh-agent": "workspace:^",
|
"@deepseek-ai/dsh-agent": "workspace:^",
|
||||||
"@deepseek-ai/dsh-agent-loop": "workspace:^",
|
"@deepseek-ai/dsh-agent-loop": "workspace:^",
|
||||||
|
"@deepseek-ai/dsh-agent-loop-testkit": "workspace:^",
|
||||||
"@deepseek-ai/dsh-bash": "workspace:^",
|
"@deepseek-ai/dsh-bash": "workspace:^",
|
||||||
"@deepseek-ai/dsh-bash-local": "workspace:^",
|
"@deepseek-ai/dsh-bash-local": "workspace:^",
|
||||||
"@deepseek-ai/dsh-fs-local": "workspace:^",
|
"@deepseek-ai/dsh-fs-local": "workspace:^",
|
||||||
|
|||||||
@@ -5,13 +5,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Context } from 'cordis'
|
import { Context } from 'cordis'
|
||||||
import LlmService, { CallId, type GenerateOptions, type StreamChunk } from '@deepseek-ai/dsh-llm'
|
import { CallId, type GenerateOptions, type StreamChunk } from '@deepseek-ai/dsh-llm'
|
||||||
import { LlmAdapter } from '@deepseek-ai/dsh-llm'
|
import { LlmAdapter } from '@deepseek-ai/dsh-llm'
|
||||||
import SessionStore from '@deepseek-ai/dsh-session'
|
|
||||||
import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
|
|
||||||
import ToolRegistry from '@deepseek-ai/dsh-tools'
|
|
||||||
import AgentRegistry from '@deepseek-ai/dsh-agent'
|
|
||||||
import AgentLoop from '@deepseek-ai/dsh-agent-loop'
|
import AgentLoop from '@deepseek-ai/dsh-agent-loop'
|
||||||
|
import { mountAgentLoopTestDependencies } from '@deepseek-ai/dsh-agent-loop-testkit'
|
||||||
import SessionPersistenceJsonl from '@deepseek-ai/dsh-session-persistence-jsonl'
|
import SessionPersistenceJsonl from '@deepseek-ai/dsh-session-persistence-jsonl'
|
||||||
import { LocalBashExecutor } from '@deepseek-ai/dsh-bash-local'
|
import { LocalBashExecutor } from '@deepseek-ai/dsh-bash-local'
|
||||||
import LocalFileSystem from '@deepseek-ai/dsh-fs-local'
|
import LocalFileSystem from '@deepseek-ai/dsh-fs-local'
|
||||||
@@ -188,11 +185,9 @@ export async function makeBridgeHarness(options: {
|
|||||||
const adapter = new MockAdapter(options.script ?? [])
|
const adapter = new MockAdapter(options.script ?? [])
|
||||||
|
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
await ctx.plugin(LlmService)
|
await mountAgentLoopTestDependencies(ctx, {
|
||||||
await ctx.plugin(SessionStore)
|
systemPrompt: { persona: options.persona ?? '' },
|
||||||
await ctx.plugin(SystemPrompt, { persona: options.persona ?? '' })
|
})
|
||||||
await ctx.plugin(ToolRegistry)
|
|
||||||
await ctx.plugin(AgentRegistry)
|
|
||||||
await ctx.plugin(AgentLoop, { agents: [] })
|
await ctx.plugin(AgentLoop, { agents: [] })
|
||||||
await ctx.plugin(SessionPersistenceJsonl, { root: options.storageDir })
|
await ctx.plugin(SessionPersistenceJsonl, { root: options.storageDir })
|
||||||
await ctx.plugin(UserInteractionService)
|
await ctx.plugin(UserInteractionService)
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@deepseek-ai/dsh-agent": "workspace:^",
|
"@deepseek-ai/dsh-agent": "workspace:^",
|
||||||
"@deepseek-ai/dsh-agent-loop": "workspace:^",
|
"@deepseek-ai/dsh-agent-loop": "workspace:^",
|
||||||
|
"@deepseek-ai/dsh-agent-loop-testkit": "workspace:^",
|
||||||
"@deepseek-ai/dsh-brand": "workspace:^",
|
"@deepseek-ai/dsh-brand": "workspace:^",
|
||||||
"@deepseek-ai/dsh-invariants": "workspace:^",
|
"@deepseek-ai/dsh-invariants": "workspace:^",
|
||||||
"@deepseek-ai/dsh-llm": "workspace:^",
|
"@deepseek-ai/dsh-llm": "workspace:^",
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
import { Context } from 'cordis'
|
import { Context } from 'cordis'
|
||||||
import LlmService from '@deepseek-ai/dsh-llm'
|
import { AgentId } from '@deepseek-ai/dsh-agent'
|
||||||
import SessionStore from '@deepseek-ai/dsh-session'
|
|
||||||
import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
|
|
||||||
import ToolRegistry from '@deepseek-ai/dsh-tools'
|
|
||||||
import AgentRegistry, { AgentId } from '@deepseek-ai/dsh-agent'
|
|
||||||
import AgentLoop from '@deepseek-ai/dsh-agent-loop'
|
import AgentLoop from '@deepseek-ai/dsh-agent-loop'
|
||||||
|
import { mountAgentLoopTestDependencies } from '@deepseek-ai/dsh-agent-loop-testkit'
|
||||||
import * as Invariants from '@deepseek-ai/dsh-invariants'
|
import * as Invariants from '@deepseek-ai/dsh-invariants'
|
||||||
import SubagentService from '@deepseek-ai/dsh-subagent'
|
import SubagentService from '@deepseek-ai/dsh-subagent'
|
||||||
import * as spawn from '@deepseek-ai/dsh-subagent-spawn'
|
import * as spawn from '@deepseek-ai/dsh-subagent-spawn'
|
||||||
@@ -26,11 +23,7 @@ type Script = ConstructorParameters<typeof MockAdapter>[0]
|
|||||||
async function setup(script: Script) {
|
async function setup(script: Script) {
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
const adapter = new MockAdapter(script)
|
const adapter = new MockAdapter(script)
|
||||||
await ctx.plugin(LlmService)
|
await mountAgentLoopTestDependencies(ctx)
|
||||||
await ctx.plugin(SessionStore)
|
|
||||||
await ctx.plugin(SystemPrompt)
|
|
||||||
await ctx.plugin(ToolRegistry)
|
|
||||||
await ctx.plugin(AgentRegistry)
|
|
||||||
await ctx.plugin(Invariants)
|
await ctx.plugin(Invariants)
|
||||||
await ctx.plugin(AgentLoop, { agents: [] })
|
await ctx.plugin(AgentLoop, { agents: [] })
|
||||||
await ctx.plugin(SubagentService)
|
await ctx.plugin(SubagentService)
|
||||||
|
|||||||
90
pnpm-lock.yaml
generated
90
pnpm-lock.yaml
generated
@@ -155,6 +155,9 @@ importers:
|
|||||||
'@deepseek-ai/dsh-agent-loop':
|
'@deepseek-ai/dsh-agent-loop':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../core/agent-loop
|
version: link:../../core/agent-loop
|
||||||
|
'@deepseek-ai/dsh-agent-loop-testkit':
|
||||||
|
specifier: workspace:^
|
||||||
|
version: link:../../support/agent-loop-testkit
|
||||||
'@deepseek-ai/dsh-bash':
|
'@deepseek-ai/dsh-bash':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../bash
|
version: link:../bash
|
||||||
@@ -237,6 +240,9 @@ importers:
|
|||||||
'@deepseek-ai/dsh-agent-loop':
|
'@deepseek-ai/dsh-agent-loop':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../core/agent-loop
|
version: link:../../core/agent-loop
|
||||||
|
'@deepseek-ai/dsh-agent-loop-testkit':
|
||||||
|
specifier: workspace:^
|
||||||
|
version: link:../../support/agent-loop-testkit
|
||||||
'@deepseek-ai/dsh-compact':
|
'@deepseek-ai/dsh-compact':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../compact
|
version: link:../compact
|
||||||
@@ -249,9 +255,6 @@ importers:
|
|||||||
'@deepseek-ai/dsh-session':
|
'@deepseek-ai/dsh-session':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../core/session
|
version: link:../../core/session
|
||||||
'@deepseek-ai/dsh-system-prompt':
|
|
||||||
specifier: workspace:^
|
|
||||||
version: link:../../core/system-prompt
|
|
||||||
'@deepseek-ai/dsh-tools':
|
'@deepseek-ai/dsh-tools':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../core/tools
|
version: link:../../core/tools
|
||||||
@@ -271,6 +274,9 @@ importers:
|
|||||||
'@deepseek-ai/dsh-agent-loop':
|
'@deepseek-ai/dsh-agent-loop':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../core/agent-loop
|
version: link:../../core/agent-loop
|
||||||
|
'@deepseek-ai/dsh-agent-loop-testkit':
|
||||||
|
specifier: workspace:^
|
||||||
|
version: link:../../support/agent-loop-testkit
|
||||||
'@deepseek-ai/dsh-llm':
|
'@deepseek-ai/dsh-llm':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../llm/llm
|
version: link:../../llm/llm
|
||||||
@@ -351,6 +357,9 @@ importers:
|
|||||||
'@deepseek-ai/dsh-agent-loop':
|
'@deepseek-ai/dsh-agent-loop':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../core/agent-loop
|
version: link:../../core/agent-loop
|
||||||
|
'@deepseek-ai/dsh-agent-loop-testkit':
|
||||||
|
specifier: workspace:^
|
||||||
|
version: link:../../support/agent-loop-testkit
|
||||||
'@deepseek-ai/dsh-llm':
|
'@deepseek-ai/dsh-llm':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../llm/llm
|
version: link:../../llm/llm
|
||||||
@@ -718,6 +727,9 @@ importers:
|
|||||||
'@deepseek-ai/dsh-agent-loop':
|
'@deepseek-ai/dsh-agent-loop':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../core/agent-loop
|
version: link:../../core/agent-loop
|
||||||
|
'@deepseek-ai/dsh-agent-loop-testkit':
|
||||||
|
specifier: workspace:^
|
||||||
|
version: link:../../support/agent-loop-testkit
|
||||||
'@deepseek-ai/dsh-fs':
|
'@deepseek-ai/dsh-fs':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../fs
|
version: link:../fs
|
||||||
@@ -795,15 +807,15 @@ importers:
|
|||||||
'@deepseek-ai/dsh-agent-loop':
|
'@deepseek-ai/dsh-agent-loop':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../core/agent-loop
|
version: link:../../core/agent-loop
|
||||||
|
'@deepseek-ai/dsh-agent-loop-testkit':
|
||||||
|
specifier: workspace:^
|
||||||
|
version: link:../../support/agent-loop-testkit
|
||||||
'@deepseek-ai/dsh-llm':
|
'@deepseek-ai/dsh-llm':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../llm/llm
|
version: link:../../llm/llm
|
||||||
'@deepseek-ai/dsh-session':
|
'@deepseek-ai/dsh-session':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../core/session
|
version: link:../../core/session
|
||||||
'@deepseek-ai/dsh-system-prompt':
|
|
||||||
specifier: workspace:^
|
|
||||||
version: link:../../core/system-prompt
|
|
||||||
'@deepseek-ai/dsh-tools':
|
'@deepseek-ai/dsh-tools':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../core/tools
|
version: link:../../core/tools
|
||||||
@@ -835,6 +847,9 @@ importers:
|
|||||||
'@deepseek-ai/dsh-agent-loop':
|
'@deepseek-ai/dsh-agent-loop':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../core/agent-loop
|
version: link:../../core/agent-loop
|
||||||
|
'@deepseek-ai/dsh-agent-loop-testkit':
|
||||||
|
specifier: workspace:^
|
||||||
|
version: link:../../support/agent-loop-testkit
|
||||||
'@deepseek-ai/dsh-bash':
|
'@deepseek-ai/dsh-bash':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../bash/bash
|
version: link:../../bash/bash
|
||||||
@@ -859,9 +874,6 @@ importers:
|
|||||||
'@deepseek-ai/dsh-subagent':
|
'@deepseek-ai/dsh-subagent':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../subagent/subagent
|
version: link:../../subagent/subagent
|
||||||
'@deepseek-ai/dsh-system-prompt':
|
|
||||||
specifier: workspace:^
|
|
||||||
version: link:../../core/system-prompt
|
|
||||||
'@deepseek-ai/dsh-tools':
|
'@deepseek-ai/dsh-tools':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../core/tools
|
version: link:../../core/tools
|
||||||
@@ -881,6 +893,9 @@ importers:
|
|||||||
'@deepseek-ai/dsh-agent-loop':
|
'@deepseek-ai/dsh-agent-loop':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../core/agent-loop
|
version: link:../../core/agent-loop
|
||||||
|
'@deepseek-ai/dsh-agent-loop-testkit':
|
||||||
|
specifier: workspace:^
|
||||||
|
version: link:../../support/agent-loop-testkit
|
||||||
'@deepseek-ai/dsh-bash':
|
'@deepseek-ai/dsh-bash':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../bash/bash
|
version: link:../../bash/bash
|
||||||
@@ -902,9 +917,6 @@ importers:
|
|||||||
'@deepseek-ai/dsh-session-persistence-jsonl':
|
'@deepseek-ai/dsh-session-persistence-jsonl':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../session-persistence/session-persistence-jsonl
|
version: link:../../session-persistence/session-persistence-jsonl
|
||||||
'@deepseek-ai/dsh-system-prompt':
|
|
||||||
specifier: workspace:^
|
|
||||||
version: link:../../core/system-prompt
|
|
||||||
'@deepseek-ai/dsh-tools':
|
'@deepseek-ai/dsh-tools':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../core/tools
|
version: link:../../core/tools
|
||||||
@@ -1339,6 +1351,9 @@ importers:
|
|||||||
'@deepseek-ai/dsh-agent-loop':
|
'@deepseek-ai/dsh-agent-loop':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../core/agent-loop
|
version: link:../../core/agent-loop
|
||||||
|
'@deepseek-ai/dsh-agent-loop-testkit':
|
||||||
|
specifier: workspace:^
|
||||||
|
version: link:../../support/agent-loop-testkit
|
||||||
'@deepseek-ai/dsh-invariants':
|
'@deepseek-ai/dsh-invariants':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../support/invariants
|
version: link:../../support/invariants
|
||||||
@@ -1357,12 +1372,6 @@ importers:
|
|||||||
'@deepseek-ai/dsh-subagent-spawn':
|
'@deepseek-ai/dsh-subagent-spawn':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../subagent-spawn
|
version: link:../subagent-spawn
|
||||||
'@deepseek-ai/dsh-system-prompt':
|
|
||||||
specifier: workspace:^
|
|
||||||
version: link:../../core/system-prompt
|
|
||||||
'@deepseek-ai/dsh-tools':
|
|
||||||
specifier: workspace:^
|
|
||||||
version: link:../../core/tools
|
|
||||||
cordis:
|
cordis:
|
||||||
specifier: ^4.0.0-rc.7
|
specifier: ^4.0.0-rc.7
|
||||||
version: 4.0.0-rc.7(@cordisjs/plugin-include@1.0.4)(@cordisjs/plugin-loader@1.0.0-rc.5)
|
version: 4.0.0-rc.7(@cordisjs/plugin-include@1.0.4)(@cordisjs/plugin-loader@1.0.0-rc.5)
|
||||||
@@ -1375,6 +1384,9 @@ importers:
|
|||||||
'@deepseek-ai/dsh-agent-loop':
|
'@deepseek-ai/dsh-agent-loop':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../core/agent-loop
|
version: link:../../core/agent-loop
|
||||||
|
'@deepseek-ai/dsh-agent-loop-testkit':
|
||||||
|
specifier: workspace:^
|
||||||
|
version: link:../../support/agent-loop-testkit
|
||||||
'@deepseek-ai/dsh-invariants':
|
'@deepseek-ai/dsh-invariants':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../support/invariants
|
version: link:../../support/invariants
|
||||||
@@ -1412,6 +1424,9 @@ importers:
|
|||||||
'@deepseek-ai/dsh-agent-loop':
|
'@deepseek-ai/dsh-agent-loop':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../core/agent-loop
|
version: link:../../core/agent-loop
|
||||||
|
'@deepseek-ai/dsh-agent-loop-testkit':
|
||||||
|
specifier: workspace:^
|
||||||
|
version: link:../../support/agent-loop-testkit
|
||||||
'@deepseek-ai/dsh-bash-local':
|
'@deepseek-ai/dsh-bash-local':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../bash/bash-local
|
version: link:../../bash/bash-local
|
||||||
@@ -1433,18 +1448,12 @@ importers:
|
|||||||
'@deepseek-ai/dsh-subagent-inprocess':
|
'@deepseek-ai/dsh-subagent-inprocess':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../subagent-inprocess
|
version: link:../subagent-inprocess
|
||||||
'@deepseek-ai/dsh-system-prompt':
|
|
||||||
specifier: workspace:^
|
|
||||||
version: link:../../core/system-prompt
|
|
||||||
'@deepseek-ai/dsh-tool-bash':
|
'@deepseek-ai/dsh-tool-bash':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../bash/tool-bash
|
version: link:../../bash/tool-bash
|
||||||
'@deepseek-ai/dsh-tool-subagent':
|
'@deepseek-ai/dsh-tool-subagent':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../tool-subagent
|
version: link:../tool-subagent
|
||||||
'@deepseek-ai/dsh-tools':
|
|
||||||
specifier: workspace:^
|
|
||||||
version: link:../../core/tools
|
|
||||||
cordis:
|
cordis:
|
||||||
specifier: ^4.0.0-rc.7
|
specifier: ^4.0.0-rc.7
|
||||||
version: 4.0.0-rc.7(@cordisjs/plugin-include@1.0.4)(@cordisjs/plugin-loader@1.0.0-rc.5)
|
version: 4.0.0-rc.7(@cordisjs/plugin-include@1.0.4)(@cordisjs/plugin-loader@1.0.0-rc.5)
|
||||||
@@ -1508,6 +1517,30 @@ importers:
|
|||||||
specifier: ^4.0.0-rc.7
|
specifier: ^4.0.0-rc.7
|
||||||
version: 4.0.0-rc.7(@cordisjs/plugin-include@1.0.4)(@cordisjs/plugin-loader@1.0.0-rc.5)
|
version: 4.0.0-rc.7(@cordisjs/plugin-include@1.0.4)(@cordisjs/plugin-loader@1.0.0-rc.5)
|
||||||
|
|
||||||
|
packages/support/agent-loop-testkit:
|
||||||
|
devDependencies:
|
||||||
|
'@deepseek-ai/dsh-agent':
|
||||||
|
specifier: workspace:^
|
||||||
|
version: link:../../core/agent
|
||||||
|
'@deepseek-ai/dsh-agent-loop':
|
||||||
|
specifier: workspace:^
|
||||||
|
version: link:../../core/agent-loop
|
||||||
|
'@deepseek-ai/dsh-llm':
|
||||||
|
specifier: workspace:^
|
||||||
|
version: link:../../llm/llm
|
||||||
|
'@deepseek-ai/dsh-session':
|
||||||
|
specifier: workspace:^
|
||||||
|
version: link:../../core/session
|
||||||
|
'@deepseek-ai/dsh-system-prompt':
|
||||||
|
specifier: workspace:^
|
||||||
|
version: link:../../core/system-prompt
|
||||||
|
'@deepseek-ai/dsh-tools':
|
||||||
|
specifier: workspace:^
|
||||||
|
version: link:../../core/tools
|
||||||
|
cordis:
|
||||||
|
specifier: ^4.0.0-rc.7
|
||||||
|
version: 4.0.0-rc.7(@cordisjs/plugin-include@1.0.4)(@cordisjs/plugin-loader@1.0.0-rc.5)
|
||||||
|
|
||||||
packages/support/invariants:
|
packages/support/invariants:
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@deepseek-ai/dsh-agent':
|
'@deepseek-ai/dsh-agent':
|
||||||
@@ -1651,6 +1684,9 @@ importers:
|
|||||||
'@deepseek-ai/dsh-agent-loop':
|
'@deepseek-ai/dsh-agent-loop':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../core/agent-loop
|
version: link:../../core/agent-loop
|
||||||
|
'@deepseek-ai/dsh-agent-loop-testkit':
|
||||||
|
specifier: workspace:^
|
||||||
|
version: link:../../support/agent-loop-testkit
|
||||||
'@deepseek-ai/dsh-llm':
|
'@deepseek-ai/dsh-llm':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../llm/llm
|
version: link:../../llm/llm
|
||||||
@@ -1685,6 +1721,9 @@ importers:
|
|||||||
'@deepseek-ai/dsh-agent-loop':
|
'@deepseek-ai/dsh-agent-loop':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../core/agent-loop
|
version: link:../../core/agent-loop
|
||||||
|
'@deepseek-ai/dsh-agent-loop-testkit':
|
||||||
|
specifier: workspace:^
|
||||||
|
version: link:../../support/agent-loop-testkit
|
||||||
'@deepseek-ai/dsh-bash':
|
'@deepseek-ai/dsh-bash':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../bash/bash
|
version: link:../../bash/bash
|
||||||
@@ -2105,6 +2144,9 @@ importers:
|
|||||||
'@deepseek-ai/dsh-agent-loop':
|
'@deepseek-ai/dsh-agent-loop':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../core/agent-loop
|
version: link:../../core/agent-loop
|
||||||
|
'@deepseek-ai/dsh-agent-loop-testkit':
|
||||||
|
specifier: workspace:^
|
||||||
|
version: link:../../support/agent-loop-testkit
|
||||||
'@deepseek-ai/dsh-brand':
|
'@deepseek-ai/dsh-brand':
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../../util/brand
|
version: link:../../util/brand
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ const SENTENCE_MODEL_EXPERIENCE: Readonly<Record<string, SentenceContract>> = {
|
|||||||
'packages/subagent/subagent': { kind: 'indirect', reason: 'The provider registry delegates parent-model rendering to dsh-tool-subagent.' },
|
'packages/subagent/subagent': { kind: 'indirect', reason: 'The provider registry delegates parent-model rendering to dsh-tool-subagent.' },
|
||||||
'packages/subagent/subagent-subprocess': { kind: 'indirect', reason: 'Only process-based subagent backends compose a child model request.' },
|
'packages/subagent/subagent-subprocess': { kind: 'indirect', reason: 'Only process-based subagent backends compose a child model request.' },
|
||||||
'packages/support/acp-snapshot': { kind: 'none', reason: 'The test harness observes and normalizes transcripts without changing live requests.' },
|
'packages/support/acp-snapshot': { kind: 'none', reason: 'The test harness observes and normalizes transcripts without changing live requests.' },
|
||||||
|
'packages/support/agent-loop-testkit': { kind: 'none', reason: 'The test helper mounts services but neither drives nor modifies model requests.' },
|
||||||
'packages/support/invariants': { kind: 'none', reason: 'The observer validates requests but never rewrites their context.' },
|
'packages/support/invariants': { kind: 'none', reason: 'The observer validates requests but never rewrites their context.' },
|
||||||
'packages/support/loader-smoke': { kind: 'none', reason: 'The test harness observes child-process streams without changing live requests.' },
|
'packages/support/loader-smoke': { kind: 'none', reason: 'The test harness observes child-process streams without changing live requests.' },
|
||||||
'packages/support/llm-replay': { kind: 'none', reason: 'The keyless adapter invokes no provider model.' },
|
'packages/support/llm-replay': { kind: 'none', reason: 'The keyless adapter invokes no provider model.' },
|
||||||
|
|||||||
@@ -64,6 +64,7 @@
|
|||||||
{ "path": "./packages/spill/spill-policy" },
|
{ "path": "./packages/spill/spill-policy" },
|
||||||
{ "path": "./packages/timeout/timeout-policy" },
|
{ "path": "./packages/timeout/timeout-policy" },
|
||||||
{ "path": "./packages/support/invariants" },
|
{ "path": "./packages/support/invariants" },
|
||||||
|
{ "path": "./packages/support/agent-loop-testkit" },
|
||||||
{ "path": "./packages/ui/acp" },
|
{ "path": "./packages/ui/acp" },
|
||||||
{ "path": "./packages/examples/acp-demo" },
|
{ "path": "./packages/examples/acp-demo" },
|
||||||
{ "path": "./packages/ui/app-boot" },
|
{ "path": "./packages/ui/app-boot" },
|
||||||
|
|||||||
@@ -75,6 +75,7 @@
|
|||||||
{ "path": "./packages/spill/spill-policy" },
|
{ "path": "./packages/spill/spill-policy" },
|
||||||
{ "path": "./packages/timeout/timeout-policy" },
|
{ "path": "./packages/timeout/timeout-policy" },
|
||||||
{ "path": "./packages/support/invariants" },
|
{ "path": "./packages/support/invariants" },
|
||||||
|
{ "path": "./packages/support/agent-loop-testkit" },
|
||||||
{ "path": "./packages/ui/acp" },
|
{ "path": "./packages/ui/acp" },
|
||||||
{ "path": "./packages/examples/acp-demo" },
|
{ "path": "./packages/examples/acp-demo" },
|
||||||
{ "path": "./packages/ui/app-boot" },
|
{ "path": "./packages/ui/app-boot" },
|
||||||
|
|||||||
Reference in New Issue
Block a user