dsh-gitbar-lite 0.0.0-stage → 0.1.0

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/lib/shared.js ADDED
@@ -0,0 +1,125 @@
1
+ /**
2
+ * dsh-gitbar-lite — wire contract, shared by the two halves.
3
+ *
4
+ * The browser half is a hand-written classic-script bundle and therefore cannot
5
+ * `import` this module; it repeats these literals verbatim. `test/check.mjs`
6
+ * asserts the repetition rather than trusting it — a drifted route or action
7
+ * name fails silently at runtime (the client would `fetch` a path nobody
8
+ * serves), which is exactly the failure this file exists to prevent.
9
+ *
10
+ * @module dsh-gitbar-lite/shared
11
+ */
12
+
13
+ /** Package name; also the client module-loader id and the settings namespace. */
14
+ export const PLUGIN_ID = 'dsh-gitbar-lite'
15
+
16
+ /** The single exact Fetch route both halves speak over. */
17
+ export const RPC_ROUTE = '/api/dsh-gitbar-lite/rpc'
18
+
19
+ /** Every RPC action. The client sends `{ action, ...payload }`. */
20
+ export const ACTIONS = {
21
+ /** Repository identity + working-tree status + branch/ahead-behind. */
22
+ STATUS: 'status',
23
+ /** Persist (or clear) this workspace's bound repository. */
24
+ BIND: 'bind',
25
+ /** Candidate repositories under the workspace, for the picker. */
26
+ REPOS: 'repos',
27
+ /** Stage or unstage the given paths, for real (`git add` / `git restore --staged`). */
28
+ STAGE: 'stage',
29
+ /** Commit what is staged. */
30
+ COMMIT: 'commit',
31
+ /** Commit what is staged, then push. */
32
+ COMMIT_PUSH: 'commitAndPush',
33
+ /** Push the current branch. */
34
+ PUSH: 'push',
35
+ /** Fetch from the upstream's remote. */
36
+ FETCH: 'fetch',
37
+ /** Discard changes: archive the diff, then restore. `paths: null` means all. */
38
+ DISCARD: 'discard',
39
+ /** One file's unified diff against HEAD, for the preview tab. */
40
+ FILE_DIFF: 'fileDiff',
41
+ /** Archived trash entries for the bound repository. */
42
+ TRASH_LIST: 'trashList',
43
+ /** One archived entry's diff text. */
44
+ TRASH_DIFF: 'trashDiff',
45
+ /** Drop one archived entry (and its diff on disk). */
46
+ TRASH_DELETE: 'trashDelete',
47
+ /** Drop every archived entry. */
48
+ TRASH_CLEAR: 'trashClear',
49
+ /** Read or write the small persisted UI preferences. */
50
+ PREFS: 'prefs',
51
+ }
52
+
53
+ /**
54
+ * Machine-readable failure codes. The client shows `message` and branches on
55
+ * `code` only where the recovery differs (a conflict, a rejected push, a
56
+ * missing credential).
57
+ */
58
+ export const ERROR_CODES = {
59
+ BAD_REQUEST: 'E_BAD_REQUEST',
60
+ UNKNOWN_ACTION: 'E_UNKNOWN_ACTION',
61
+ NO_WORKSPACE: 'E_NO_WORKSPACE',
62
+ NO_REPO: 'E_NO_REPO',
63
+ NO_GIT: 'E_NO_GIT',
64
+ EMPTY_SUMMARY: 'E_EMPTY_SUMMARY',
65
+ NOTHING_STAGED: 'E_NOTHING_STAGED',
66
+ CONFLICT: 'E_CONFLICT',
67
+ GIT_FAILED: 'E_GIT_FAILED',
68
+ NO_REMOTE: 'E_NO_REMOTE',
69
+ NO_UPSTREAM: 'E_NO_UPSTREAM',
70
+ AUTH: 'E_AUTH',
71
+ PUSH_REJECTED: 'E_PUSH_REJECTED',
72
+ TRASH_NOT_FOUND: 'E_TRASH_NOT_FOUND',
73
+ INTERNAL: 'E_INTERNAL',
74
+ }
75
+
76
+ /**
77
+ * Which label the single context button wears. The client maps these to copy;
78
+ * the host decides by looking at the branch, the way GitHub Desktop does.
79
+ */
80
+ export const PRIMARY_ACTIONS = {
81
+ /** Local commits exist that the upstream does not have. */
82
+ PUSH: 'push',
83
+ /** The branch has no upstream yet, so the first push has to set one. */
84
+ PUBLISH: 'publish',
85
+ /** Nothing to push: the button fetches. */
86
+ FETCH: 'fetch',
87
+ }
88
+
89
+ /**
90
+ * Per-file status buckets. `untracked` and `conflicted` are the two cases where
91
+ * a plain `git restore` is not the right verb.
92
+ */
93
+ export const FILE_STATUS = {
94
+ MODIFIED: 'modified',
95
+ ADDED: 'added',
96
+ DELETED: 'deleted',
97
+ RENAMED: 'renamed',
98
+ UNTRACKED: 'untracked',
99
+ CONFLICTED: 'conflicted',
100
+ }
101
+
102
+ /** Trash entry origin: one path, or a whole working tree. */
103
+ export const DISCARD_SCOPE = {
104
+ FILE: 'file',
105
+ ALL: 'all',
106
+ }
107
+
108
+ /** State-file names inside the plugin's own directory under DSH_HOME. */
109
+ export const STATE_FILES = {
110
+ BINDINGS: 'bindings.json',
111
+ PREFS: 'prefs.json',
112
+ TRASH_INDEX: 'trash/index.json',
113
+ }
114
+
115
+ /** Directory the plugin owns under DSH_HOME. */
116
+ export const STATE_DIR_NAME = 'dsh-gitbar-lite'
117
+
118
+ /** Environment for every git child: no prompts, no locks, stable locale. */
119
+ export const GIT_ENV = {
120
+ GIT_TERMINAL_PROMPT: '0',
121
+ GIT_OPTIONAL_LOCKS: '0',
122
+ GIT_CONFIG_COUNT: '0',
123
+ GIT_PAGER: 'cat',
124
+ LC_ALL: 'C',
125
+ }
package/locale/en.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Git Bar (lite)",
4
+ "description": "A GitHub Desktop-style Git panel: changed files, tick-to-stage, commit, commit and push, discard into a trash, and diff preview."
5
+ }
6
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Git 栏(轻量)",
4
+ "description": "GitHub Desktop 风格的 Git 面板:变更文件、勾选提交、舍弃进回收站、Commit and Push、diff 预览。"
5
+ }
6
+ }
package/package.json CHANGED
@@ -1,6 +1,90 @@
1
1
  {
2
2
  "name": "dsh-gitbar-lite",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "A GitHub Desktop-style Git panel for DSH: changed files, tick-to-stage, Summary + Description, Commit and Commit and Push, discard-to-trash, and diff preview, in the built-in right sidebar.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "Ckarefulon",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/Ckarefulon/dsh-gitbar-lite.git"
11
+ },
12
+ "homepage": "https://github.com/Ckarefulon/dsh-gitbar-lite#readme",
13
+ "bugs": {
14
+ "url": "https://github.com/Ckarefulon/dsh-gitbar-lite/issues"
15
+ },
16
+ "publishConfig": {
17
+ "access": "public",
18
+ "registry": "https://registry.npmjs.org/"
19
+ },
20
+ "main": "./lib/index.js",
21
+ "exports": {
22
+ ".": "./lib/index.js",
23
+ "./client": "./lib/client.js",
24
+ "./cordis.patch.yml": "./cordis.patch.yml",
25
+ "./package.json": "./package.json",
26
+ "./locale/en.json": "./locale/en.json",
27
+ "./locale/zh.json": "./locale/zh.json"
28
+ },
29
+ "files": [
30
+ "lib",
31
+ "locale",
32
+ "docs",
33
+ "cordis.patch.yml",
34
+ "icon.svg",
35
+ "README.md",
36
+ "README.en.md",
37
+ "LICENSE"
38
+ ],
39
+ "icon": "./icon.svg",
40
+ "engines": {
41
+ "node": ">=22.0.0"
42
+ },
43
+ "scripts": {
44
+ "peers": "node scripts/install-peers.mjs",
45
+ "pretest": "node scripts/install-peers.mjs",
46
+ "test": "node --test test/parse.test.mjs test/diff.test.mjs test/store.test.mjs test/index.test.mjs test/client.test.mjs && node test/e2e.mjs && node test/check.mjs",
47
+ "test:unit": "node --test test/parse.test.mjs test/diff.test.mjs test/store.test.mjs test/index.test.mjs test/client.test.mjs",
48
+ "test:e2e": "node test/e2e.mjs",
49
+ "test:live": "node test/live.mjs",
50
+ "test:browser": "node test/serve.mjs",
51
+ "check": "node test/check.mjs && node scripts/check-client-bundle.mjs .",
52
+ "check:bundle": "node scripts/check-client-bundle.mjs ."
53
+ },
54
+ "keywords": [
55
+ "dsh",
56
+ "dsh-plugin",
57
+ "deepseek-harness",
58
+ "git",
59
+ "github-desktop",
60
+ "source-control",
61
+ "diff",
62
+ "commit",
63
+ "sidebar"
64
+ ],
65
+ "peerDependencies": {
66
+ "@deepseek-ai/cordis": ">=4.0.0 <5",
67
+ "@deepseek-ai/schemastery": ">=3.18.0 <4"
68
+ },
69
+ "meta": {
70
+ "title": "Git 栏(轻量)",
71
+ "description": "GitHub Desktop 风格的 Git 面板:变更文件、勾选提交、舍弃进回收站、Commit and Push、diff 预览。"
72
+ },
73
+ "dsh": {
74
+ "engines": {
75
+ "dsh": ">=0.2.0-rc.2"
76
+ },
77
+ "bundle": {
78
+ "patch": "./cordis.patch.yml"
79
+ },
80
+ "client": {
81
+ "platform": "web",
82
+ "inject": [
83
+ "@deepseek-ai/dsh-client-connection",
84
+ "@deepseek-ai/dsh-client-locale",
85
+ "@deepseek-ai/dsh-client-ui-conversation",
86
+ "@deepseek-ai/dsh-client-ui-sidebar-right"
87
+ ]
88
+ }
89
+ }
90
+ }