Terminal

エージェントとの会話をターミナルとして表示:自分の発言が目立つ等幅ログ、控えめなツール操作、誰がどれくらい作業しているかを示すライブステータス、そしてプロンプト。

対応フレームワーク
  • Angular: 対応
  • Vue: 対応
  • React: 対応
  • React Native: 未対応

使い方

Run started · fix-flaky-testsYouto Lead
The checkout tests fail about once in ten runs. Find out why and fix it.
Lead
On it. I'll rerun the suite to catch the failure first.
Lead
Ran npm test -- checkout --repeat 20 --reporter=verbose --coverage=false --bail=false
Exit code 1
✕ checkout › applies the discount once (2 of 20 runs)
    expected 90, received 81
    at discount.spec.ts:42:18
Explore
Read 2 files
Lead
Edited src/checkout/discount.ts
+3−1
Lead
Ran npm test -- checkout --repeat 20
ok · 41s
Lead

Fixed: the discount was applied twice.

  • applyDiscount() ran in a promise nobody awaited, so a slow run applied it again.
  • It is awaited now, and discount.spec.ts covers the slow path.

20 of 20 runs pass. Shall I look at the cart tests next?

Done · 6 turns · 1m 12s
Lead is done

インポート

ts
import {
  SoneTerminalComponent,
  SoneTerminalDividerComponent,
  SoneTerminalLineComponent,
  SoneTerminalLineDetailDirective,
  SoneTerminalLineMetaDirective,
  SoneTerminalLogComponent,
  SoneTerminalPromptActionsDirective,
  SoneTerminalPromptComponent,
  SoneTerminalPromptInputDirective,
  SoneTerminalStatusActionsDirective,
  SoneTerminalStatusComponent,
} from "@surface-one/angular/terminal";

API リファレンス

SoneTerminalComponentコンポーネント

`<sone-terminal>` — the frame of an agent conversation shown as a terminal: a monospace log (`<sone-terminal-log>`), the agent's live status (`<sone-terminal-status>`) and the prompt (`<sone-terminal-prompt>`). `<sone-agent-chat>` takes the very same parts as a chat.

セレクター
sone-terminal

SoneTerminalDividerComponentコンポーネント

`<sone-terminal-divider>` — a run boundary or a turn summary across the log.

セレクター
sone-terminal-divider
入力
名前型 デフォルト
timeAgentTime | nullnull
toneAgentTone"default"

SoneTerminalLineComponentコンポーネント

`<sone-terminal-line>` — one entry: time, speaker (`You → Lead`), glyph and text. The person's lines stand out (a soft tinted block, the `❯` prompt in the accent); `kind="activity"` is a quiet, one-line record of tool work. `[soneTerminalLineMeta]` sits at the end of the line, `[soneTerminalLineDetail]` under it (an expanded body, a command's output).

セレクター
sone-terminal-line
入力
名前型 デフォルト
from

Who wrote it: the person (`user`), an `agent`, or the `system`.

AgentFrom"agent"
kind

`message` is something said; `activity` is a quiet line of tool work.

AgentEntryKind"message"
speaker

The speaker's name; the person's defaults to “You”.

string | nullnull
to

Who the person (or an agent) spoke to: “You → Lead”.

string | nullnull
time

When it was said: a `Date`, epoch milliseconds or an ISO string.

AgentTime | nullnull
tone

`danger` for a failed command, `success` / `warning` for an outcome.

AgentTone"default"
glyph

The mark in front of the text; `❯` for the person, `›` for activity. `""` hides it.

string | nullnull
hue

A speaker colour, `1`–`8` (the chart hues), so each agent keeps its own.

number | nullnull
note

A quiet note about the entry, such as the model that wrote it: after the time in the chat, in front of the text in the terminal.

string | nullnull

SoneTerminalLineDetailDirectiveディレクティブ

Content under a line: its expanded body or a command's output.

セレクター
[soneTerminalLineDetail]

SoneTerminalLineMetaDirectiveディレクティブ

Trailing content of a line: a metric, a badge, a “show more” toggle.

セレクター
[soneTerminalLineMeta]

SoneTerminalLogComponentコンポーネント

`<sone-terminal-log>` — the scrolling `role="log"`: follows the newest line, offers “Jump to newest”.

セレクター
sone-terminal-log
入力
名前型 デフォルト
label

The log's accessible name.

string | nullnull
follow

Stay pinned to the newest line while the reader is there.

booleantrue

SoneTerminalPromptActionsDirectiveディレクティブ

Buttons and selects at the end of the prompt (model, send).

セレクター
[soneTerminalPromptActions]

SoneTerminalPromptComponentコンポーネント

`<sone-terminal-prompt>` — the `❯` prompt around a `textarea[soneTerminalPromptInput]`.

セレクター
sone-terminal-prompt
出力
名前型
submitted

Fires when the person sends (Enter, or a submit button inside).

void

SoneTerminalPromptInputDirectiveディレクティブ

The prompt's field: Enter sends, Shift+Enter breaks the line.

セレクター
textarea[soneTerminalPromptInput]
入力
名前型 デフォルト
ariaLabel

The field's accessible name (it has no visible label).

string | null$localize`:The prompt field of an agent conversation:Message`

SoneTerminalStatusActionsDirectiveディレクティブ

Actions at the end of the status line (Interrupt, Stop).

セレクター
[soneTerminalStatusActions]

SoneTerminalStatusComponentコンポーネント

`<sone-terminal-status>` — what the agent is doing right now: an animated mark, the sentence (“Lead is working”), the running time and a slot for actions (`[soneTerminalStatusActions]`, e.g. Interrupt). While the agent is busy the whole terminal shows a sweeping line.

セレクター
sone-terminal-status
入力
名前型 デフォルト
stateAgentState"idle"
speaker

Who it is about: “Lead is working”.

string | nullnull
since

When the current state began; a running time is shown while the agent is active.

AgentTime | nullnull
label

Replaces the built-in sentence.

string | nullnull
hue

The speaker colour, `1`–`8`.

number | nullnull