my-durable 0.0.25 → 0.0.26
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/apps/dpi-backend/src/git.ts +176 -17
- package/apps/dpi-backend/src/routes.ts +11 -1
- package/apps/dpi-backend/src/store.ts +39 -0
- package/apps/dpi-playground/apps/dpi-playground-fe/dist/assets/index-C9OQe54o.js +79 -0
- package/apps/dpi-playground/apps/dpi-playground-fe/dist/assets/index-DwYK0DEy.css +1 -0
- package/apps/dpi-playground/apps/dpi-playground-fe/dist/index.html +2 -2
- package/apps/dpi-playground/apps/dpi-playground-fe/src/components/GitPanel.vue +559 -57
- package/apps/dpi-sdk/src/client.ts +43 -8
- package/apps/dpi-sdk/src/protocol/rest-routes.ts +1 -0
- package/package.json +1 -1
- package/apps/dpi-playground/apps/dpi-playground-fe/dist/assets/index-CsBzwiFM.js +0 -78
- package/apps/dpi-playground/apps/dpi-playground-fe/dist/assets/index-DM_ddsmz.css +0 -1
|
@@ -53,8 +53,13 @@ export interface GitStatus {
|
|
|
53
53
|
subject?: string;
|
|
54
54
|
worktreeOf?: string;
|
|
55
55
|
worktrees?: { path: string; branch: string | null; head: string }[];
|
|
56
|
-
|
|
56
|
+
/** ±n line counts from numstat; -1 marks a binary file. */
|
|
57
|
+
files?: { path: string; x: string; y: string; a?: number; d?: number }[];
|
|
57
58
|
branches?: { name: string; current?: boolean; upstream?: string }[];
|
|
59
|
+
merge?: boolean;
|
|
60
|
+
conflicts?: number;
|
|
61
|
+
identity?: { name?: string; email?: string };
|
|
62
|
+
remoteUrl?: string;
|
|
58
63
|
}
|
|
59
64
|
export type GitOpName =
|
|
60
65
|
| "diff"
|
|
@@ -73,7 +78,25 @@ export type GitOpName =
|
|
|
73
78
|
| "discard"
|
|
74
79
|
| "diff-file"
|
|
75
80
|
| "stash-push"
|
|
76
|
-
| "stash-pop"
|
|
81
|
+
| "stash-pop"
|
|
82
|
+
| "unstage"
|
|
83
|
+
| "compare"
|
|
84
|
+
| "merge-abort"
|
|
85
|
+
| "show-files"
|
|
86
|
+
| "ignore"
|
|
87
|
+
| "checkpoint"
|
|
88
|
+
| "checkpoints"
|
|
89
|
+
| "rewind";
|
|
90
|
+
|
|
91
|
+
/** Everything a git op may return; most carry only text. */
|
|
92
|
+
export interface GitOpResult {
|
|
93
|
+
text: string;
|
|
94
|
+
commits?: { hash: string; refs: string; author: string; date: string; subject: string; parents: string[] }[];
|
|
95
|
+
ahead?: number;
|
|
96
|
+
behind?: number;
|
|
97
|
+
changed?: { status: string; path: string }[];
|
|
98
|
+
checkpoints?: { name: string; hash: string; date: string; subject: string }[];
|
|
99
|
+
}
|
|
77
100
|
|
|
78
101
|
export class DpiClient {
|
|
79
102
|
readonly baseUrl: string;
|
|
@@ -187,13 +210,25 @@ export class DpiClient {
|
|
|
187
210
|
gitOp(
|
|
188
211
|
path: string,
|
|
189
212
|
op: GitOpName,
|
|
190
|
-
opts: {
|
|
213
|
+
opts: {
|
|
214
|
+
ref?: string;
|
|
215
|
+
branch?: string;
|
|
216
|
+
message?: string;
|
|
217
|
+
target?: string;
|
|
218
|
+
files?: string[];
|
|
219
|
+
create?: boolean;
|
|
220
|
+
staged?: boolean;
|
|
221
|
+
rebase?: boolean;
|
|
222
|
+
setUpstream?: boolean;
|
|
223
|
+
name?: string;
|
|
224
|
+
lines?: string[];
|
|
225
|
+
} = {},
|
|
191
226
|
) {
|
|
192
|
-
return this.request<
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
);
|
|
227
|
+
return this.request<GitOpResult>("POST", "/v1/git", { path, op, ...opts });
|
|
228
|
+
}
|
|
229
|
+
/** Paths this session's agents wrote/edited — the session-changelist. */
|
|
230
|
+
sessionGitFiles(sessionId: string) {
|
|
231
|
+
return this.request<{ files: string[] }>("GET", `/v1/sessions/${enc(sessionId)}/git-files`);
|
|
197
232
|
}
|
|
198
233
|
/** Many paths, one round-trip — session lists want branch-per-cwd. */
|
|
199
234
|
gitStatusBatch(paths: string[], options: { timeoutMs?: number } = {}) {
|
|
@@ -28,6 +28,7 @@ const ROUTES: readonly (readonly [method: string, pattern: string])[] = [
|
|
|
28
28
|
["GET", "/sessions/:s/tasks"],
|
|
29
29
|
["POST", "/sessions/:s/tasks/:taskId/abort"],
|
|
30
30
|
["GET", "/sessions/:s/inspect"],
|
|
31
|
+
["GET", "/sessions/:s/git-files"],
|
|
31
32
|
["GET", "/sessions/:s/submissions/:id"],
|
|
32
33
|
|
|
33
34
|
["GET", "/sessions/:s/agents"],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "my-durable",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.26",
|
|
4
4
|
"description": "Durable Pi \u2014 the durable agent network: hub web UI, device backend daemon, TUI admin and the shared SDK, packaged as one runnable monorepo install",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|