agent-Specialization/cli/legacy-ink-src/types.ts
JOJO d97c1423b1 feat(cli): rewrite CLI on opentui with Gateway host Bearer channel
- replace Ink implementation with opentui + React 19 (old version kept at cli/legacy-ink-src/ for field reference)
- all traffic goes through Gateway host Bearer token; workspace bound via X-Astrion-Workspace-Id header
- auto-spawn server only when no instance is alive (never kill/restart running ones); stale server without token is detected
- astrion launcher (bin/astrion, symlink-aware, --version/--help fast-exit)
- slash menu panels (session/model/mode/permission/path/context/approvals...) with shared selector component
- backend: host workspace list/create dual-channel endpoints, host token generated at startup
- i18n reads OS locale at startup (zh/en)

Co-authored-by: Astrion powered by Kimi-K3 <astrion-agent@users.noreply.github.com>
2026-09-11 17:27:53 +08:00

66 lines
1.5 KiB
TypeScript

export type PermissionMode = 'readonly' | 'approval' | 'auto_approval' | 'unrestricted';
export type ExecutionMode = 'sandbox' | 'direct';
export type RunMode = 'fast' | 'thinking' | 'deep';
export type Workspace = {
workspace_id: string;
label: string;
path: string;
};
export type WorkspaceCatalog = {
default_workspace_id: string;
workspaces: Workspace[];
};
export type CliStatus = {
model: string;
runMode: RunMode;
directory: string;
workspace: Workspace;
permissionMode: PermissionMode;
executionMode: ExecutionMode;
sessionId: string;
contextUsed: number;
contextLimit: number;
versioningEnabled: boolean;
backgroundAgents: number;
backgroundCommands: number;
activeSkill?: SkillDefinition;
};
export type SkillDefinition = {
id: string;
label: string;
description: string;
};
export type ModelDefinition = {
model_key: string;
name: string;
description?: string;
supports_thinking?: boolean;
fast_only?: boolean;
deep_only?: boolean;
context_window?: number;
};
export type TimelineItem = {
id: string;
kind: 'system' | 'user' | 'assistant' | 'tool' | 'thinking' | 'sub_agent';
title?: string;
summary?: string;
body?: string;
status?: 'running' | 'success' | 'failed' | 'cancelled';
lines?: string[];
};
export type SlashCommandKind = 'immediate' | 'picker' | 'panel' | 'form';
export type SlashCommand = {
name: string;
description: string;
aliases?: string[];
kind: SlashCommandKind;
};