@civilization/dsh-experimental-git 0.0.0-stage → 0.2.1-rc.2
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.i18n.yaml +13 -0
- package/README.md +22 -2
- package/README.zh.md +23 -0
- package/cordis.patch.yml +3 -0
- package/icon.svg +26 -0
- package/lib/client.js +2836 -0
- package/lib/index.js +7623 -0
- package/lib/types/client/GitBody.d.ts +66 -0
- package/lib/types/client/GitBranchPill.d.ts +27 -0
- package/lib/types/client/GitTitle.d.ts +12 -0
- package/lib/types/client/definition.d.ts +19 -0
- package/lib/types/client/git-helpers.d.ts +65 -0
- package/lib/types/client/index.d.ts +16 -0
- package/lib/types/client/locales.d.ts +185 -0
- package/lib/types/git-executor.d.ts +151 -0
- package/lib/types/index.d.ts +17 -0
- package/lib/types/tool.d.ts +11 -0
- package/lib/types/types.d.ts +175 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +75 -3
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core type declarations for the experimental Git plugin.
|
|
3
|
+
* Shared across the Host RPC handlers and Client UI viewers.
|
|
4
|
+
*/
|
|
5
|
+
/** File change status representation in git */
|
|
6
|
+
export type GitFileStatusCode = 'modified' | 'added' | 'deleted' | 'renamed' | 'untracked' | 'copied';
|
|
7
|
+
/** One changed file entry in the working directory or staging area */
|
|
8
|
+
export interface GitFileStatus {
|
|
9
|
+
/** Relative file path from the repository root */
|
|
10
|
+
readonly path: string;
|
|
11
|
+
/** Previous path if the file was renamed */
|
|
12
|
+
readonly originalPath?: string;
|
|
13
|
+
/** Normalized status kind */
|
|
14
|
+
readonly status: GitFileStatusCode;
|
|
15
|
+
/** Whether the change has been staged to index */
|
|
16
|
+
readonly staged: boolean;
|
|
17
|
+
}
|
|
18
|
+
/** Information about one local git branch */
|
|
19
|
+
export interface GitBranchInfo {
|
|
20
|
+
/** Branch name (e.g. 'main', 'master', 'feature/xyz') */
|
|
21
|
+
readonly name: string;
|
|
22
|
+
/** Whether this branch is currently checked out */
|
|
23
|
+
readonly isCurrent: boolean;
|
|
24
|
+
/** Upstream tracking branch if configured */
|
|
25
|
+
readonly upstream?: string;
|
|
26
|
+
/** Number of commits ahead of upstream */
|
|
27
|
+
readonly ahead?: number;
|
|
28
|
+
/** Number of commits behind upstream */
|
|
29
|
+
readonly behind?: number;
|
|
30
|
+
}
|
|
31
|
+
/** Full status summary of the workspace repository */
|
|
32
|
+
export interface GitStatusSummary {
|
|
33
|
+
/** Whether the checked directory is inside a Git worktree/repository */
|
|
34
|
+
readonly isRepo: boolean;
|
|
35
|
+
/** Absolute root directory of the repository */
|
|
36
|
+
readonly rootPath?: string;
|
|
37
|
+
/** Current branch name, or commit hash if detached */
|
|
38
|
+
readonly branch?: string;
|
|
39
|
+
/** Upstream branch name */
|
|
40
|
+
readonly upstream?: string;
|
|
41
|
+
/** Commits ahead of upstream */
|
|
42
|
+
readonly ahead: number;
|
|
43
|
+
/** Commits behind upstream */
|
|
44
|
+
readonly behind: number;
|
|
45
|
+
/** Latest commit summary on current HEAD */
|
|
46
|
+
readonly headCommit?: {
|
|
47
|
+
readonly hash: string;
|
|
48
|
+
readonly shortHash: string;
|
|
49
|
+
readonly message: string;
|
|
50
|
+
};
|
|
51
|
+
/** Staged changes in index */
|
|
52
|
+
readonly staged: readonly GitFileStatus[];
|
|
53
|
+
/** Unstaged changes in working tree */
|
|
54
|
+
readonly unstaged: readonly GitFileStatus[];
|
|
55
|
+
/** Untracked new files */
|
|
56
|
+
readonly untracked: readonly GitFileStatus[];
|
|
57
|
+
/** Total count of all changed/untracked files */
|
|
58
|
+
readonly totalChanges: number;
|
|
59
|
+
/** Total count of commits in the current repository */
|
|
60
|
+
readonly totalCommitsCount?: number;
|
|
61
|
+
}
|
|
62
|
+
/** One commit log entry with optional DAG topology metadata */
|
|
63
|
+
export interface GitCommitItem {
|
|
64
|
+
/** Full 40-character commit hash */
|
|
65
|
+
readonly hash: string;
|
|
66
|
+
/** Abbreviated 7-character commit hash */
|
|
67
|
+
readonly shortHash: string;
|
|
68
|
+
/** Author name */
|
|
69
|
+
readonly author: string;
|
|
70
|
+
/** Author email address */
|
|
71
|
+
readonly authorEmail: string;
|
|
72
|
+
/** Human-readable relative date (e.g. '2 hours ago') */
|
|
73
|
+
readonly relativeDate: string;
|
|
74
|
+
/** ISO date string */
|
|
75
|
+
readonly date: string;
|
|
76
|
+
/** Commit subject/first line of commit message */
|
|
77
|
+
readonly subject: string;
|
|
78
|
+
/** Full multiline commit body message (excluding subject) */
|
|
79
|
+
readonly body?: string;
|
|
80
|
+
/** Parent commit hashes */
|
|
81
|
+
readonly parents?: readonly string[];
|
|
82
|
+
/** Git branch / tag reference names */
|
|
83
|
+
readonly refs?: readonly string[];
|
|
84
|
+
/** Topological vertical lane column index (0-based) */
|
|
85
|
+
readonly lane?: number;
|
|
86
|
+
/** Color hex code for the current commit's lane */
|
|
87
|
+
readonly laneColor?: string;
|
|
88
|
+
/** Connecting graph rails to parent commits */
|
|
89
|
+
readonly paths?: readonly GitGraphLanePath[];
|
|
90
|
+
}
|
|
91
|
+
/** Vector path connecting lanes in the DAG graph visualization */
|
|
92
|
+
export interface GitGraphLanePath {
|
|
93
|
+
/** Starting lane index (from this commit) */
|
|
94
|
+
readonly fromLane: number;
|
|
95
|
+
/** Target lane index (to parent commit or pass-through) */
|
|
96
|
+
readonly toLane: number;
|
|
97
|
+
/** Type of track: pass-through, fork out, or merge in */
|
|
98
|
+
readonly kind: 'straight' | 'fork' | 'merge';
|
|
99
|
+
/** Color of this track line */
|
|
100
|
+
readonly color: string;
|
|
101
|
+
}
|
|
102
|
+
/** Detail information for a single commit including changed files */
|
|
103
|
+
export interface GitCommitDetail {
|
|
104
|
+
readonly commit: GitCommitItem;
|
|
105
|
+
readonly body?: string;
|
|
106
|
+
readonly parents?: readonly string[];
|
|
107
|
+
readonly files: readonly {
|
|
108
|
+
readonly path: string;
|
|
109
|
+
readonly oldPath?: string;
|
|
110
|
+
readonly status: GitFileStatusCode;
|
|
111
|
+
readonly additions: number;
|
|
112
|
+
readonly deletions: number;
|
|
113
|
+
}[];
|
|
114
|
+
readonly totalAdditions: number;
|
|
115
|
+
readonly totalDeletions: number;
|
|
116
|
+
}
|
|
117
|
+
/** Complete log query summary including commits and total count */
|
|
118
|
+
export interface GitLogSummary {
|
|
119
|
+
readonly commits: readonly GitCommitItem[];
|
|
120
|
+
readonly totalCount: number;
|
|
121
|
+
}
|
|
122
|
+
/** One Git tag entry */
|
|
123
|
+
export interface GitTagItem {
|
|
124
|
+
/** Tag name (e.g. 'v1.0.0', 'dsh-v0.2.1-rc.2') */
|
|
125
|
+
readonly name: string;
|
|
126
|
+
/** Target commit full 40-character SHA hash */
|
|
127
|
+
readonly commitHash: string;
|
|
128
|
+
/** Target commit abbreviated 7-character hash */
|
|
129
|
+
readonly shortHash: string;
|
|
130
|
+
/** ISO 8601 date string of tag or commit */
|
|
131
|
+
readonly date: string;
|
|
132
|
+
/** Human-readable relative date (e.g. '3 days ago') */
|
|
133
|
+
readonly relativeDate: string;
|
|
134
|
+
/** Tag annotation message or commit subject */
|
|
135
|
+
readonly message: string;
|
|
136
|
+
/** Author or tagger name */
|
|
137
|
+
readonly author: string;
|
|
138
|
+
/** Whether this is an annotated tag (git tag -a) */
|
|
139
|
+
readonly isAnnotated: boolean;
|
|
140
|
+
}
|
|
141
|
+
/** Aggregated local and remote branches */
|
|
142
|
+
export interface GitBranchesSummary {
|
|
143
|
+
readonly current?: string;
|
|
144
|
+
readonly local: readonly GitBranchInfo[];
|
|
145
|
+
readonly remote: readonly GitBranchInfo[];
|
|
146
|
+
}
|
|
147
|
+
/** Generic result of executing a git mutative operation */
|
|
148
|
+
export interface GitOperationResult {
|
|
149
|
+
readonly success: boolean;
|
|
150
|
+
readonly message?: string;
|
|
151
|
+
readonly output?: string;
|
|
152
|
+
}
|
|
153
|
+
/** One file's diff result */
|
|
154
|
+
export interface GitDiffFile {
|
|
155
|
+
/** File path */
|
|
156
|
+
readonly path: string;
|
|
157
|
+
/** Old file path if renamed */
|
|
158
|
+
readonly oldPath?: string;
|
|
159
|
+
/** Change status */
|
|
160
|
+
readonly status: GitFileStatusCode;
|
|
161
|
+
/** Raw unified diff patch lines */
|
|
162
|
+
readonly diffText: string;
|
|
163
|
+
/** Count of added lines */
|
|
164
|
+
readonly additions: number;
|
|
165
|
+
/** Count of removed lines */
|
|
166
|
+
readonly deletions: number;
|
|
167
|
+
}
|
|
168
|
+
/** Complete diff result summary */
|
|
169
|
+
export interface GitDiffSummary {
|
|
170
|
+
/** List of parsed diff files */
|
|
171
|
+
readonly files: readonly GitDiffFile[];
|
|
172
|
+
/** Complete raw unified diff output */
|
|
173
|
+
readonly rawDiff: string;
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=types.d.ts.map
|
package/locale/en.json
ADDED
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,78 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@civilization/dsh-experimental-git",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"description": "View project Git repository status, branches, commit log, and diffs in the right sidebar.",
|
|
4
|
+
"version": "0.2.1-rc.2",
|
|
5
|
+
"icon": "./icon.svg",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/civilization-os/deepseek-harness.git",
|
|
12
|
+
"directory": "packages/experimental/git"
|
|
13
|
+
},
|
|
14
|
+
"type": "module",
|
|
15
|
+
"main": "lib/index.js",
|
|
16
|
+
"types": "lib/types/index.d.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./lib/types/index.d.ts",
|
|
20
|
+
"default": "./lib/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./client": {
|
|
23
|
+
"types": "./lib/types/client/index.d.ts",
|
|
24
|
+
"default": "./lib/client.js"
|
|
25
|
+
},
|
|
26
|
+
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
27
|
+
"./locale/*.json": "./locale/*.json",
|
|
28
|
+
"./src/*": "./src/*",
|
|
29
|
+
"./package.json": "./package.json"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"icon.svg",
|
|
33
|
+
"locale/*.json",
|
|
34
|
+
"lib/index.js",
|
|
35
|
+
"lib/client.js",
|
|
36
|
+
"cordis.patch.yml",
|
|
37
|
+
"lib/types/**/*.d.ts"
|
|
38
|
+
],
|
|
39
|
+
"license": "MIT",
|
|
40
|
+
"dsh": {
|
|
41
|
+
"bundle": {
|
|
42
|
+
"patch": "./cordis.patch.yml"
|
|
43
|
+
},
|
|
44
|
+
"client": {
|
|
45
|
+
"inject": [
|
|
46
|
+
"@deepseek-ai/dsh-client-connection",
|
|
47
|
+
"@deepseek-ai/dsh-client-locale",
|
|
48
|
+
"@deepseek-ai/dsh-client-ui-sidebar-right",
|
|
49
|
+
"@deepseek-ai/dsh-client-ui-primitives",
|
|
50
|
+
"@deepseek-ai/dsh-client-shortcuts"
|
|
51
|
+
],
|
|
52
|
+
"platform": "web"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"dependencies": {
|
|
56
|
+
"@deepseek-ai/schemastery": "~3.18.5"
|
|
57
|
+
},
|
|
58
|
+
"peerDependencies": {
|
|
59
|
+
"@deepseek-ai/cordis": "~4.0.5"
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@deepseek-ai/cordis": "~4.0.5",
|
|
63
|
+
"@deepseek-ai/dsh-client-connection": "0.2.1-rc.2",
|
|
64
|
+
"@deepseek-ai/dsh-client-locale": "0.2.1-rc.2",
|
|
65
|
+
"@deepseek-ai/dsh-client-shortcuts": "0.2.1-rc.2",
|
|
66
|
+
"@deepseek-ai/dsh-client-ui-conversation": "0.2.1-rc.2",
|
|
67
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.2.1-rc.2",
|
|
68
|
+
"@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.1-rc.2",
|
|
69
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.2.1-rc.2",
|
|
70
|
+
"@deepseek-ai/dsh-tools": "0.2.1-rc.2",
|
|
71
|
+
"react": "^18.2.0",
|
|
72
|
+
"react-dom": "^18.2.0"
|
|
73
|
+
},
|
|
74
|
+
"scripts": {
|
|
75
|
+
"bundle": "tsdown",
|
|
76
|
+
"watch": "tsdown --watch"
|
|
77
|
+
}
|
|
6
78
|
}
|