@lingxi-ai-cn/dsh-tui-runtime 0.1.0-rc.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +109 -0
- package/README.zh.md +109 -0
- package/lib/index.js +10552 -0
- package/lib/invariant.js +9 -0
- package/lib/types/agent-view.d.ts +40 -0
- package/lib/types/app.d.ts +121 -0
- package/lib/types/composer.d.ts +188 -0
- package/lib/types/detail.d.ts +24 -0
- package/lib/types/footer.d.ts +85 -0
- package/lib/types/history-search.d.ts +58 -0
- package/lib/types/host.d.ts +210 -0
- package/lib/types/index.d.ts +60 -0
- package/lib/types/invariant.d.ts +6 -0
- package/lib/types/keybindings.d.ts +165 -0
- package/lib/types/markdown.d.ts +9 -0
- package/lib/types/open-url.d.ts +9 -0
- package/lib/types/plugin-hub.d.ts +158 -0
- package/lib/types/resume.d.ts +66 -0
- package/lib/types/rewind.d.ts +37 -0
- package/lib/types/sanitize.d.ts +9 -0
- package/lib/types/session-export.d.ts +29 -0
- package/lib/types/session-lifecycle.d.ts +20 -0
- package/lib/types/startup-logo.d.ts +45 -0
- package/lib/types/store.d.ts +88 -0
- package/lib/types/suggestion.d.ts +99 -0
- package/lib/types/terminal-input.d.ts +69 -0
- package/lib/types/terminal-session.d.ts +129 -0
- package/lib/types/theme.d.ts +76 -0
- package/lib/types/todo-panel.d.ts +12 -0
- package/lib/types/tool-card.d.ts +24 -0
- package/lib/types/tool-group.d.ts +10 -0
- package/lib/types/transcript-search.d.ts +67 -0
- package/lib/types/transcript-view.d.ts +32 -0
- package/lib/types/transcript.d.ts +159 -0
- package/lib/types/viewport.d.ts +211 -0
- package/lib/types/work-panel.d.ts +28 -0
- package/lib/types/work.d.ts +100 -0
- package/package.json +104 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/** Authoritative background-work projection for the native TUI. */
|
|
2
|
+
import type { AgentStatus, JobSnapshot, JobStatus, SessionIdType as SessionId, SubagentDescendantListEntry, SubagentRunEndInfo, SubagentRunInfo, SubagentTimingProjection } from './host.ts';
|
|
3
|
+
/** Live Agent facts used to refine one durable subagent catalog row. */
|
|
4
|
+
export interface TuiWorkAgentSnapshot {
|
|
5
|
+
/** Exact live Agent status. */
|
|
6
|
+
readonly status: AgentStatus;
|
|
7
|
+
/** Durable active-turn timing folded by the subagent projection. */
|
|
8
|
+
readonly timing?: SubagentTimingProjection | undefined;
|
|
9
|
+
}
|
|
10
|
+
/** One owner-scoped remote subagent lifecycle observed during this TUI process. */
|
|
11
|
+
export interface TuiObservedSubagentRun {
|
|
12
|
+
/** Authoritative lifecycle start payload. */
|
|
13
|
+
readonly info: SubagentRunInfo;
|
|
14
|
+
/** Local receipt time used only as a lower-bound elapsed clock. */
|
|
15
|
+
readonly observedAt: number;
|
|
16
|
+
/** Authoritative terminal payload, absent while the run is live. */
|
|
17
|
+
readonly outcome?: SubagentRunEndInfo | undefined;
|
|
18
|
+
/** Local receipt time of the terminal edge. */
|
|
19
|
+
readonly finishedAt?: number | undefined;
|
|
20
|
+
}
|
|
21
|
+
/** State vocabulary shared by jobs and continuable subagent rows. */
|
|
22
|
+
export type TuiWorkItemState = JobStatus | 'waiting' | 'inactive';
|
|
23
|
+
/** One deduplicated row in the native TUI work panel. */
|
|
24
|
+
export interface TuiWorkItemView {
|
|
25
|
+
/** Stable React and selection identity. */
|
|
26
|
+
readonly key: string;
|
|
27
|
+
/** Owning source of truth and available controls. */
|
|
28
|
+
readonly source: 'job' | 'subagent';
|
|
29
|
+
/** Source-owned job id or child Session id. */
|
|
30
|
+
readonly id: string;
|
|
31
|
+
/** Concise source-owned label. */
|
|
32
|
+
readonly label: string;
|
|
33
|
+
/** Owning Agent Session when known. */
|
|
34
|
+
readonly ownerSession?: SessionId | undefined;
|
|
35
|
+
/** Current authoritative lifecycle state. */
|
|
36
|
+
readonly state: TuiWorkItemState;
|
|
37
|
+
/** Source-specific terminal detail. */
|
|
38
|
+
readonly detail?: string | undefined;
|
|
39
|
+
/** Epoch milliseconds at the authoritative start or local observation edge. */
|
|
40
|
+
readonly startedAt?: number | undefined;
|
|
41
|
+
/** Epoch milliseconds at terminal settlement. */
|
|
42
|
+
readonly finishedAt?: number | undefined;
|
|
43
|
+
/** Durable tree depth for subagents; jobs use zero. */
|
|
44
|
+
readonly depth: number;
|
|
45
|
+
/** Whether Enter can open a local Session transcript. */
|
|
46
|
+
readonly inspectable: boolean;
|
|
47
|
+
/** Why a non-local child has no inspectable transcript. */
|
|
48
|
+
readonly readOnlyReason?: string | undefined;
|
|
49
|
+
/** Source-owned action currently safe to expose. */
|
|
50
|
+
readonly action: 'cancel-job' | 'interrupt-subagent' | 'none';
|
|
51
|
+
/** Durable accumulated execution and optional open-turn timing. */
|
|
52
|
+
readonly timing?: SubagentTimingProjection | undefined;
|
|
53
|
+
}
|
|
54
|
+
/** Footer counters derived from the same work rows as the panel. */
|
|
55
|
+
export interface TuiWorkSummary {
|
|
56
|
+
/** Running or stopping rows. */
|
|
57
|
+
readonly running: number;
|
|
58
|
+
/** Authoritative queued rows; zero until an owning service exposes that state. */
|
|
59
|
+
readonly queued: number;
|
|
60
|
+
/** Terminal failed rows retained by their owning service or observed lifecycle. */
|
|
61
|
+
readonly failed: number;
|
|
62
|
+
/** Total mounted work rows. */
|
|
63
|
+
readonly total: number;
|
|
64
|
+
}
|
|
65
|
+
/** Immutable work-panel snapshot consumed through `useSyncExternalStore`. */
|
|
66
|
+
export interface TuiWorkSnapshot {
|
|
67
|
+
/** Deduplicated rows in stable live-first order. */
|
|
68
|
+
readonly items: readonly TuiWorkItemView[];
|
|
69
|
+
/** Counters projected from `items`. */
|
|
70
|
+
readonly summary: TuiWorkSummary;
|
|
71
|
+
/** Catalog refresh currently in flight. */
|
|
72
|
+
readonly loading: boolean;
|
|
73
|
+
/** Contained catalog failure, retried on the next lifecycle change. */
|
|
74
|
+
readonly error?: string | undefined;
|
|
75
|
+
}
|
|
76
|
+
/** Empty immutable snapshot used before the first authoritative scan. */
|
|
77
|
+
export declare const EMPTY_TUI_WORK_SNAPSHOT: TuiWorkSnapshot;
|
|
78
|
+
/** Inputs for one deterministic work projection. */
|
|
79
|
+
export interface TuiWorkProjectionInput {
|
|
80
|
+
/** Jobs visible to the root and its currently live descendants. */
|
|
81
|
+
readonly jobs: readonly JobSnapshot[];
|
|
82
|
+
/** Durable local child catalog below the TUI root. */
|
|
83
|
+
readonly subagents: readonly SubagentDescendantListEntry[];
|
|
84
|
+
/** Exact live Agent facts keyed by child Session id. */
|
|
85
|
+
readonly liveAgents: ReadonlyMap<SessionId, TuiWorkAgentSnapshot>;
|
|
86
|
+
/** Owner-scoped remote runs observed in this process. */
|
|
87
|
+
readonly remoteRuns: readonly TuiObservedSubagentRun[];
|
|
88
|
+
/** Whether an authoritative catalog refresh is pending. */
|
|
89
|
+
readonly loading?: boolean;
|
|
90
|
+
/** Contained catalog error. */
|
|
91
|
+
readonly error?: string;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Project jobs, continuable local children, and summary-only remote runs into
|
|
95
|
+
* one stable panel without duplicating job-managed one-shot subagents.
|
|
96
|
+
* @param input - current snapshots from the owning services and event streams.
|
|
97
|
+
* @returns an immutable panel snapshot and counters.
|
|
98
|
+
*/
|
|
99
|
+
export declare function projectTuiWork(input: TuiWorkProjectionInput): TuiWorkSnapshot;
|
|
100
|
+
//# sourceMappingURL=work.d.ts.map
|
package/package.json
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lingxi-ai-cn/dsh-tui-runtime",
|
|
3
|
+
"description": "Native terminal UI for one in-process DeepSeek Harness Agent and Session",
|
|
4
|
+
"version": "0.1.0-rc.8",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/Lingxi-AI-cn/dsh-tui-plugin.git",
|
|
11
|
+
"directory": "packages/ui/tui"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"main": "lib/index.js",
|
|
15
|
+
"types": "lib/types/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./lib/types/index.d.ts",
|
|
19
|
+
"default": "./lib/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./invariant": {
|
|
22
|
+
"types": "./lib/types/invariant.d.ts",
|
|
23
|
+
"default": "./lib/invariant.js"
|
|
24
|
+
},
|
|
25
|
+
"./package.json": "./package.json"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"lib/index.js",
|
|
29
|
+
"lib/invariant.js",
|
|
30
|
+
"lib/types/**/*.d.ts"
|
|
31
|
+
],
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"ink": "5.2.1",
|
|
35
|
+
"mdast-util-from-markdown": "^2.0.3",
|
|
36
|
+
"mdast-util-gfm": "^3.1.0",
|
|
37
|
+
"micromark-extension-gfm": "^3.0.0",
|
|
38
|
+
"react": "^18.3.1",
|
|
39
|
+
"string-width": "^7.2.0"
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"@deepseek-ai/cordis-plugin-loader": "1.0.2",
|
|
43
|
+
"@deepseek-ai/dsh-agent": "0.1.0-rc.8",
|
|
44
|
+
"@deepseek-ai/dsh-agent-default-model": "0.1.0-rc.8",
|
|
45
|
+
"@deepseek-ai/dsh-agent-presets": "0.1.0-rc.8",
|
|
46
|
+
"@deepseek-ai/dsh-cmdline": "0.1.0-rc.8",
|
|
47
|
+
"@deepseek-ai/dsh-compaction": "0.1.0-rc.8",
|
|
48
|
+
"@deepseek-ai/dsh-commands": "0.1.0-rc.8",
|
|
49
|
+
"@deepseek-ai/dsh-fs": "0.1.0-rc.8",
|
|
50
|
+
"@deepseek-ai/dsh-invariants": "0.1.0-rc.8",
|
|
51
|
+
"@deepseek-ai/dsh-jobs": "0.1.0-rc.8",
|
|
52
|
+
"@deepseek-ai/dsh-llm": "0.1.0-rc.8",
|
|
53
|
+
"@deepseek-ai/dsh-native-command": "0.1.0-rc.8",
|
|
54
|
+
"@deepseek-ai/dsh-permission-presets": "0.1.0-rc.8",
|
|
55
|
+
"@deepseek-ai/dsh-session": "0.1.0-rc.8",
|
|
56
|
+
"@deepseek-ai/dsh-session-projection": "0.1.0-rc.8",
|
|
57
|
+
"@deepseek-ai/dsh-session-projection-cache": "0.1.0-rc.8",
|
|
58
|
+
"@deepseek-ai/dsh-session-query": "0.1.0-rc.8",
|
|
59
|
+
"@deepseek-ai/dsh-session-title": "0.1.0-rc.8",
|
|
60
|
+
"@deepseek-ai/dsh-settings": "0.1.0-rc.8",
|
|
61
|
+
"@deepseek-ai/dsh-subagent": "0.1.0-rc.8",
|
|
62
|
+
"@deepseek-ai/dsh-token-meter": "0.1.0-rc.8",
|
|
63
|
+
"@deepseek-ai/dsh-tools": "0.1.0-rc.8",
|
|
64
|
+
"@deepseek-ai/dsh-session-persistence": "0.1.0-rc.8",
|
|
65
|
+
"@deepseek-ai/dsh-user-approval": "0.1.0-rc.8",
|
|
66
|
+
"@deepseek-ai/dsh-user-questions": "0.1.0-rc.8",
|
|
67
|
+
"@deepseek-ai/cordis": "4.0.1",
|
|
68
|
+
"@deepseek-ai/schemastery": "3.18.1",
|
|
69
|
+
"@lingxi-ai-cn/dsh-session-export": "0.1.0-rc.8",
|
|
70
|
+
"@lingxi-ai-cn/dsh-plugin-hub": "0.1.0-rc.8"
|
|
71
|
+
},
|
|
72
|
+
"devDependencies": {
|
|
73
|
+
"@deepseek-ai/cordis-plugin-loader": "1.0.2",
|
|
74
|
+
"@deepseek-ai/dsh-agent": "0.1.0-rc.8",
|
|
75
|
+
"@deepseek-ai/dsh-agent-default-model": "0.1.0-rc.8",
|
|
76
|
+
"@deepseek-ai/dsh-agent-presets": "0.1.0-rc.8",
|
|
77
|
+
"@deepseek-ai/dsh-cmdline": "0.1.0-rc.8",
|
|
78
|
+
"@deepseek-ai/dsh-compaction": "0.1.0-rc.8",
|
|
79
|
+
"@deepseek-ai/dsh-commands": "0.1.0-rc.8",
|
|
80
|
+
"@deepseek-ai/dsh-fs": "0.1.0-rc.8",
|
|
81
|
+
"@deepseek-ai/dsh-invariants": "0.1.0-rc.8",
|
|
82
|
+
"@deepseek-ai/dsh-jobs": "0.1.0-rc.8",
|
|
83
|
+
"@deepseek-ai/dsh-llm": "0.1.0-rc.8",
|
|
84
|
+
"@deepseek-ai/dsh-native-command": "0.1.0-rc.8",
|
|
85
|
+
"@deepseek-ai/dsh-permission-presets": "0.1.0-rc.8",
|
|
86
|
+
"@deepseek-ai/dsh-session": "0.1.0-rc.8",
|
|
87
|
+
"@deepseek-ai/dsh-session-projection": "0.1.0-rc.8",
|
|
88
|
+
"@deepseek-ai/dsh-session-projection-cache": "0.1.0-rc.8",
|
|
89
|
+
"@deepseek-ai/dsh-session-query": "0.1.0-rc.8",
|
|
90
|
+
"@deepseek-ai/dsh-session-title": "0.1.0-rc.8",
|
|
91
|
+
"@deepseek-ai/dsh-settings": "0.1.0-rc.8",
|
|
92
|
+
"@deepseek-ai/dsh-subagent": "0.1.0-rc.8",
|
|
93
|
+
"@deepseek-ai/dsh-token-meter": "0.1.0-rc.8",
|
|
94
|
+
"@deepseek-ai/dsh-tools": "0.1.0-rc.8",
|
|
95
|
+
"@deepseek-ai/dsh-session-persistence": "0.1.0-rc.8",
|
|
96
|
+
"@deepseek-ai/dsh-user-approval": "0.1.0-rc.8",
|
|
97
|
+
"@deepseek-ai/dsh-user-questions": "0.1.0-rc.8",
|
|
98
|
+
"@deepseek-ai/cordis": "4.0.1",
|
|
99
|
+
"@deepseek-ai/schemastery": "3.18.1",
|
|
100
|
+
"@types/react": "~18.3.1",
|
|
101
|
+
"@lingxi-ai-cn/dsh-session-export": "0.1.0-rc.8",
|
|
102
|
+
"@lingxi-ai-cn/dsh-plugin-hub": "0.1.0-rc.8"
|
|
103
|
+
}
|
|
104
|
+
}
|