@myrialabs/clopen 0.4.36 → 0.4.37
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/backend/git/conflict-state.test.ts +396 -0
- package/backend/git/git-executor.ts +6 -0
- package/backend/git/git-parser.ts +144 -48
- package/backend/git/git-service.ts +727 -57
- package/backend/git/push-target.test.ts +264 -0
- package/backend/project/status-manager.ts +20 -0
- package/backend/ws/git/branch-name.ts +6 -5
- package/backend/ws/git/branch.ts +43 -1
- package/backend/ws/git/commit-message.ts +13 -10
- package/backend/ws/git/conflict.ts +106 -3
- package/backend/ws/git/diff-budget.test.ts +125 -0
- package/backend/ws/git/diff-budget.ts +220 -0
- package/backend/ws/git/log.ts +25 -0
- package/backend/ws/git/remote.ts +75 -1
- package/dist/assets/{index-Cz4YpHVi.js → index-Bik9TCBi.js} +1 -1
- package/dist/assets/{index-Bg-SUCFg.js → index-sJmS_CCm.js} +1 -1
- package/dist/assets/main-DLqolBI2.css +1 -0
- package/dist/assets/{main-BofFsH8E.js → main-Df1I3hnw.js} +481 -470
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/shared/types/git.ts +123 -0
- package/dist/assets/main-9G7IpQpK.css +0 -1
package/dist/index.html
CHANGED
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
}
|
|
59
59
|
})();
|
|
60
60
|
</script>
|
|
61
|
-
<script type="module" crossorigin src="/assets/main-
|
|
62
|
-
<link rel="stylesheet" crossorigin href="/assets/main-
|
|
61
|
+
<script type="module" crossorigin src="/assets/main-Df1I3hnw.js"></script>
|
|
62
|
+
<link rel="stylesheet" crossorigin href="/assets/main-DLqolBI2.css">
|
|
63
63
|
</head>
|
|
64
64
|
<body
|
|
65
65
|
class="min-h-dvh bg-white text-slate-900 dark:bg-slate-950 dark:text-slate-100 transition-colors duration-200"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myrialabs/clopen",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.37",
|
|
4
4
|
"description": "All-in-one web workspace for AI coding agents — Claude Code, OpenCode, Codex, Copilot, Qwen Code, Pi, Cline, and Cursor — with chat, terminal, git, browser preview, database client, checkpoints, and real-time collaboration",
|
|
5
5
|
"author": "Myria Labs",
|
|
6
6
|
"license": "MIT",
|
package/shared/types/git.ts
CHANGED
|
@@ -46,6 +46,12 @@ export interface GitBranch {
|
|
|
46
46
|
name: string;
|
|
47
47
|
isCurrent: boolean;
|
|
48
48
|
isRemote: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* The branch this one tracks, e.g. `origin/main`. Populated from
|
|
51
|
+
* `%(upstream:short)`, or from `branch.<name>.remote`/`.merge` when the
|
|
52
|
+
* configured remote is a bare URL — which is what `gh pr checkout` writes for
|
|
53
|
+
* a fork PR, and which has no remote-tracking ref for git to name.
|
|
54
|
+
*/
|
|
49
55
|
upstream?: string;
|
|
50
56
|
ahead: number;
|
|
51
57
|
behind: number;
|
|
@@ -163,10 +169,107 @@ export interface GitConflictMarker {
|
|
|
163
169
|
baseContent?: string;
|
|
164
170
|
}
|
|
165
171
|
|
|
172
|
+
/**
|
|
173
|
+
* How git recorded the conflict, derived from the porcelain XY code. Only
|
|
174
|
+
* `both-modified` and `both-added` carry inline `<<<<<<<` markers; the rest are
|
|
175
|
+
* add/delete disagreements where the only meaningful answer is "keep the file"
|
|
176
|
+
* or "delete the file", which is why they need their own UI affordance.
|
|
177
|
+
*/
|
|
178
|
+
export type GitConflictKind =
|
|
179
|
+
| 'both-modified' // UU
|
|
180
|
+
| 'both-added' // AA
|
|
181
|
+
| 'added-by-us' // AU
|
|
182
|
+
| 'added-by-them' // UA
|
|
183
|
+
| 'deleted-by-us' // DU
|
|
184
|
+
| 'deleted-by-them' // UD
|
|
185
|
+
| 'both-deleted'; // DD
|
|
186
|
+
|
|
187
|
+
/** Ways a single conflicted path can be resolved. */
|
|
188
|
+
export type GitConflictResolution =
|
|
189
|
+
/** Take the whole file from our side (`git checkout --ours`). */
|
|
190
|
+
| 'ours'
|
|
191
|
+
/** Take the whole file from their side (`git checkout --theirs`). */
|
|
192
|
+
| 'theirs'
|
|
193
|
+
/** Write caller-supplied content, then stage it. */
|
|
194
|
+
| 'custom'
|
|
195
|
+
/** Keep the working-tree file as it stands (`git add`). */
|
|
196
|
+
| 'keep'
|
|
197
|
+
/** Resolve as deleted (`git rm`). */
|
|
198
|
+
| 'delete'
|
|
199
|
+
/** Put the conflict markers back (`git checkout --merge`). */
|
|
200
|
+
| 'reset';
|
|
201
|
+
|
|
166
202
|
export interface GitConflictFile {
|
|
167
203
|
path: string;
|
|
204
|
+
/** Working-tree text. Empty when `contentOmitted` is true. */
|
|
168
205
|
content: string;
|
|
169
206
|
markers: GitConflictMarker[];
|
|
207
|
+
kind: GitConflictKind;
|
|
208
|
+
/** True when the file has no text side to edit (binary, missing, or oversized). */
|
|
209
|
+
contentOmitted: boolean;
|
|
210
|
+
/** Why the content was omitted — drives the resolver's fallback UI. */
|
|
211
|
+
omitReason?: 'binary' | 'missing' | 'too-large';
|
|
212
|
+
/** Working-tree size in bytes, when the file exists. */
|
|
213
|
+
size?: number;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Everything the UI needs to explain (and finish) an in-progress operation.
|
|
218
|
+
*
|
|
219
|
+
* `oursLabel`/`theirsLabel` exist because the two sides swap meaning between
|
|
220
|
+
* merge and rebase: rebasing replays your commits onto the upstream, so `ours`
|
|
221
|
+
* is the branch you are rebasing *onto* and `theirs` is your own commit — the
|
|
222
|
+
* exact opposite of a merge. Showing the raw words without the branch names is
|
|
223
|
+
* the single biggest source of wrong resolutions.
|
|
224
|
+
*/
|
|
225
|
+
export interface GitOperationState {
|
|
226
|
+
operation: GitOperation | null;
|
|
227
|
+
/** 1-based position in a multi-commit replay (rebase only). */
|
|
228
|
+
step?: number;
|
|
229
|
+
/** Total commits in the replay (rebase only). */
|
|
230
|
+
total?: number;
|
|
231
|
+
/** Human label for the `ours` side, e.g. "main". */
|
|
232
|
+
oursLabel: string;
|
|
233
|
+
/** Human label for the `theirs` side, e.g. "your commit". */
|
|
234
|
+
theirsLabel: string;
|
|
235
|
+
/** Subject of the commit being replayed, when there is one. */
|
|
236
|
+
currentCommit?: string;
|
|
237
|
+
/** Paths still unmerged. `--continue` is refused while this is non-zero. */
|
|
238
|
+
unmergedCount: number;
|
|
239
|
+
canContinue: boolean;
|
|
240
|
+
canSkip: boolean;
|
|
241
|
+
/**
|
|
242
|
+
* Unmerged paths with no operation sentinel — a `stash pop`/`apply` that hit
|
|
243
|
+
* a conflict. The stash entry survives a failed pop, so aborting here must
|
|
244
|
+
* say so rather than implying the work is gone.
|
|
245
|
+
*/
|
|
246
|
+
stashConflict: boolean;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// ============================================
|
|
250
|
+
// Push Target
|
|
251
|
+
// ============================================
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Where `git push` will actually send this branch.
|
|
255
|
+
*
|
|
256
|
+
* The panel used to push to whichever remote its dropdown had selected, with
|
|
257
|
+
* `-u`. On a fork PR checked out for review that pushed the contributor's work
|
|
258
|
+
* into the main repository as a new branch, and the `-u` rewrote the branch's
|
|
259
|
+
* remote so every later push went there too. Resolving the real destination —
|
|
260
|
+
* and showing it — is what keeps that from happening.
|
|
261
|
+
*/
|
|
262
|
+
export interface GitPushTarget {
|
|
263
|
+
/** Remote name, or a bare URL when that is how the branch is configured. */
|
|
264
|
+
remote: string;
|
|
265
|
+
/** Branch name on the far side, which need not match the local name. */
|
|
266
|
+
remoteBranch: string;
|
|
267
|
+
/** False when the branch tracks nothing, so a push has to pick a destination. */
|
|
268
|
+
hasUpstream: boolean;
|
|
269
|
+
/** True when `remote` is a URL rather than a configured remote name. */
|
|
270
|
+
isUrl: boolean;
|
|
271
|
+
/** The local branch this was resolved for. */
|
|
272
|
+
branch: string;
|
|
170
273
|
}
|
|
171
274
|
|
|
172
275
|
// ============================================
|
|
@@ -208,6 +311,26 @@ export interface GitTag {
|
|
|
208
311
|
isAnnotated: boolean;
|
|
209
312
|
}
|
|
210
313
|
|
|
314
|
+
// ============================================
|
|
315
|
+
// Reflog
|
|
316
|
+
// ============================================
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* One `git reflog` row. This is the repo's undo journal: it still holds commits
|
|
320
|
+
* that branch deletes, resets and rebases have orphaned, so it is the only way
|
|
321
|
+
* back from a destructive action.
|
|
322
|
+
*/
|
|
323
|
+
export interface GitReflogEntry {
|
|
324
|
+
hash: string;
|
|
325
|
+
hashShort: string;
|
|
326
|
+
/** Reflog selector, e.g. `HEAD@{3}`. */
|
|
327
|
+
selector: string;
|
|
328
|
+
/** The recorded action, e.g. `rebase (finish)` or `commit`. */
|
|
329
|
+
action: string;
|
|
330
|
+
subject: string;
|
|
331
|
+
date: string;
|
|
332
|
+
}
|
|
333
|
+
|
|
211
334
|
// ============================================
|
|
212
335
|
// Commit Message Generation
|
|
213
336
|
// ============================================
|