Merge origin/master into codex/invariant-service-seam

# Conflicts:
#	docs/config-catalog.md
#	docs/event-producer-consumer.md
#	docs/module-graph.md
#	packages/examples/agent-spine-demo/README.md
#	packages/examples/agent-spine-demo/package.json
#	packages/examples/agent-spine-demo/src/index.ts
#	packages/examples/tui-demo/package.json
#	packages/support/invariants/src/scoped-events.generated.ts
#	packages/ui/acp/package.json
#	packages/ui/tui/package.json
#	packages/ui/tui/tests/tui.spec.ts
#	pnpm-lock.yaml
This commit is contained in:
Tianyi Cui
2026-07-21 01:13:28 +08:00
213 changed files with 7860 additions and 257 deletions

View File

@@ -0,0 +1,91 @@
<!-- Generated by scripts/gen-website-api.ts — do not edit by hand. Run `pnpm run gen-website-api` to regenerate. -->
# ctx.commands
`CommandService` — provided by `@deepseek-ai/dsh-commands`.
Human-command registry. Plain-context definitions are global; definitions registered through a command-injected child of an agent context shadow globals for that agent.
[Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/packages/ui/commands/src/index.ts#L207)
### ctx.commands.register(definition)
```ts website-api
/**
* Register a global or calling-agent-scoped command.
* @param definition - discovery metadata and direct UI handler.
* @returns the exact effect disposer that unregisters this definition.
*/
register(definition: CommandDefinition): () => void
```
Register a global or calling-agent-scoped command.
- `definition` — discovery metadata and direct UI handler.
**Returns** the exact effect disposer that unregisters this definition.
[Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/packages/ui/commands/src/index.ts#L220)
### ctx.commands.list(agent)
```ts website-api
/**
* List the effective immutable command descriptors for one agent.
* @param agent - exact receiving agent and scoped-layer key.
* @returns name-sorted descriptors after scoped shadowing.
*/
list(agent: Agent): readonly CommandDescriptor[]
```
List the effective immutable command descriptors for one agent.
- `agent` — exact receiving agent and scoped-layer key.
**Returns** name-sorted descriptors after scoped shadowing.
[Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/packages/ui/commands/src/index.ts#L247)
### ctx.commands.find(agent, name)
```ts website-api
/**
* Resolve one effective command definition.
* @param agent - exact receiving agent and scoped-layer key.
* @param name - command name without a slash.
* @returns the scoped shadow or global definition.
*/
find(agent: Agent, name: string): CommandDefinition | undefined
```
Resolve one effective command definition.
- `agent` — exact receiving agent and scoped-layer key.
- `name` — command name without a slash.
**Returns** the scoped shadow or global definition.
[Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/packages/ui/commands/src/index.ts#L260)
### ctx.commands.execute(agent, line, signal)
```ts website-api
/**
* Parse and execute a known command without sending it to the model.
* @param agent - exact receiving agent.
* @param line - complete slash-command line.
* @param signal - cancellation signal owned by the UI request.
* @returns a detached result, or `undefined` when syntax or name does not resolve.
*/
async execute( agent: Agent, line: string, signal: AbortSignal, ): Promise<CommandResult | undefined>
```
Parse and execute a known command without sending it to the model.
- `agent` — exact receiving agent.
- `line` — complete slash-command line.
- `signal` — cancellation signal owned by the UI request.
**Returns** a detached result, or `undefined` when syntax or name does not resolve.
[Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/packages/ui/commands/src/index.ts#L271)

View File

@@ -28,6 +28,27 @@ Read the current goal for one exact live agent.
[Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/packages/goal/goal/src/index.ts#L161)
### ctx.goals.disarm(agent)
```ts website-api
/**
* Remove process-local continuation authority without changing durable goal
* phase or revision. Lifecycle owners use this before unloading a driver;
* a later human-authorized {@link resume} records the new activation edge.
* @param agent - owning live agent.
* @returns a fresh disarmed view, or `undefined` when no goal is current.
*/
disarm(agent: Agent): GoalView | undefined
```
Remove process-local continuation authority without changing durable goal phase or revision. Lifecycle owners use this before unloading a driver; a later human-authorized resume records the new activation edge.
- `agent` — owning live agent.
**Returns** a fresh disarmed view, or `undefined` when no goal is current.
[Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/packages/goal/goal/src/index.ts#L175)
### ctx.goals.create(agent, request)
```ts website-api
@@ -48,7 +69,7 @@ Create and arm a goal. A completed goal may be replaced; every other current pha
**Returns** the created live view.
[Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/packages/goal/goal/src/index.ts#L175)
[Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/packages/goal/goal/src/index.ts#L190)
### ctx.goals.edit(agent, ref, request)
@@ -71,7 +92,7 @@ Edit objective and/or round cap without changing phase.
**Returns** the edited view.
[Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/packages/goal/goal/src/index.ts#L200)
[Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/packages/goal/goal/src/index.ts#L215)
### ctx.goals.pause(agent, ref)
@@ -92,7 +113,7 @@ Pause an active goal and disarm automatic continuation.
**Returns** the paused view.
[Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/packages/goal/goal/src/index.ts#L221)
[Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/packages/goal/goal/src/index.ts#L236)
### ctx.goals.resume(agent, ref)
@@ -114,7 +135,7 @@ Resume and arm a stopped goal, or rearm an active goal after a session-start edg
**Returns** the active view.
[Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/packages/goal/goal/src/index.ts#L232)
[Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/packages/goal/goal/src/index.ts#L247)
### ctx.goals.complete(agent, ref)
@@ -135,7 +156,7 @@ Mark a current non-complete goal complete and disarm it.
**Returns** the completed view.
[Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/packages/goal/goal/src/index.ts#L257)
[Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/packages/goal/goal/src/index.ts#L272)
### ctx.goals.block(agent, ref, reason)
@@ -158,7 +179,7 @@ Mark an active goal blocked and disarm it.
**Returns** the blocked view with its durable reason.
[Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/packages/goal/goal/src/index.ts#L275)
[Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/packages/goal/goal/src/index.ts#L290)
### ctx.goals.clear(agent, ref)
@@ -179,4 +200,4 @@ Clear the current goal while retaining a durable tombstone and history.
**Returns** the tombstone ref whose revision is one past the cleared snapshot.
[Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/packages/goal/goal/src/index.ts#L296)
[Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/packages/goal/goal/src/index.ts#L311)