@agimon-ai/doompi-git 0.0.1-alpha.5 → 0.0.1-alpha.51

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.
Files changed (180) hide show
  1. package/README.md +33 -1
  2. package/dist/apiContracts.cjs +387 -0
  3. package/dist/apiContracts.cjs.map +1 -0
  4. package/dist/apiContracts.d.mts +53 -0
  5. package/dist/apiContracts.d.mts.map +1 -0
  6. package/dist/apiContracts.mjs +382 -0
  7. package/dist/apiContracts.mjs.map +1 -0
  8. package/dist/extensions/pi.cjs +105 -1
  9. package/dist/extensions/pi.cjs.map +1 -0
  10. package/dist/extensions/pi.d.mts +6 -2
  11. package/dist/extensions/pi.d.mts.map +1 -0
  12. package/dist/extensions/pi.mjs +100 -1
  13. package/dist/extensions/pi.mjs.map +1 -0
  14. package/dist/extensions/server.cjs +1828 -0
  15. package/dist/extensions/server.cjs.map +1 -0
  16. package/dist/extensions/server.d.mts +5 -0
  17. package/dist/extensions/server.d.mts.map +1 -0
  18. package/dist/extensions/server.mjs +1820 -0
  19. package/dist/extensions/server.mjs.map +1 -0
  20. package/dist/extensions/web.mjs +2639 -0
  21. package/dist/extensions/web.mjs.map +1 -0
  22. package/dist/gitDependencies-CtVubYvU.mjs +22 -0
  23. package/dist/gitDependencies-CtVubYvU.mjs.map +1 -0
  24. package/dist/gitDependencies-Dqsz2HjK.cjs +33 -0
  25. package/dist/gitDependencies-Dqsz2HjK.cjs.map +1 -0
  26. package/dist/index-D79MSCee.d.mts +145 -0
  27. package/dist/index-D79MSCee.d.mts.map +1 -0
  28. package/dist/index.cjs +4 -1
  29. package/dist/index.d.mts +2 -5
  30. package/dist/index.mjs +2 -1
  31. package/dist/runWorktree-BE795LxL.cjs +374 -0
  32. package/dist/runWorktree-BE795LxL.cjs.map +1 -0
  33. package/dist/runWorktree-SPzJvIBt.mjs +303 -0
  34. package/dist/runWorktree-SPzJvIBt.mjs.map +1 -0
  35. package/dist/worktreeOperations-BYmVU0UV.cjs +1350 -0
  36. package/dist/worktreeOperations-BYmVU0UV.cjs.map +1 -0
  37. package/dist/worktreeOperations-BrWG2muV.mjs +1194 -0
  38. package/dist/worktreeOperations-BrWG2muV.mjs.map +1 -0
  39. package/llms.txt +4 -0
  40. package/package.json +59 -44
  41. package/src/prompts/doompi-use-git/SKILL.md +21 -1
  42. package/dist/_virtual/_rolldown/runtime.cjs +0 -1
  43. package/dist/adapters/channel/worktreeChannel.cjs +0 -2
  44. package/dist/adapters/channel/worktreeChannel.cjs.map +0 -1
  45. package/dist/adapters/channel/worktreeChannel.d.cts +0 -40
  46. package/dist/adapters/channel/worktreeChannel.d.cts.map +0 -1
  47. package/dist/adapters/channel/worktreeChannel.d.mts +0 -40
  48. package/dist/adapters/channel/worktreeChannel.d.mts.map +0 -1
  49. package/dist/adapters/channel/worktreeChannel.mjs +0 -2
  50. package/dist/adapters/channel/worktreeChannel.mjs.map +0 -1
  51. package/dist/adapters/filesystem/atomicJson.cjs +0 -2
  52. package/dist/adapters/filesystem/atomicJson.cjs.map +0 -1
  53. package/dist/adapters/filesystem/atomicJson.mjs +0 -2
  54. package/dist/adapters/filesystem/atomicJson.mjs.map +0 -1
  55. package/dist/adapters/filesystem/paths.cjs +0 -2
  56. package/dist/adapters/filesystem/paths.cjs.map +0 -1
  57. package/dist/adapters/filesystem/paths.mjs +0 -2
  58. package/dist/adapters/filesystem/paths.mjs.map +0 -1
  59. package/dist/adapters/hub/hubClient.cjs +0 -2
  60. package/dist/adapters/hub/hubClient.cjs.map +0 -1
  61. package/dist/adapters/hub/hubClient.d.cts +0 -1
  62. package/dist/adapters/hub/hubClient.d.mts +0 -1
  63. package/dist/adapters/hub/hubClient.mjs +0 -2
  64. package/dist/adapters/hub/hubClient.mjs.map +0 -1
  65. package/dist/adapters/pi/extension.cjs +0 -2
  66. package/dist/adapters/pi/extension.cjs.map +0 -1
  67. package/dist/adapters/pi/extension.d.cts +0 -9
  68. package/dist/adapters/pi/extension.d.cts.map +0 -1
  69. package/dist/adapters/pi/extension.d.mts +0 -9
  70. package/dist/adapters/pi/extension.d.mts.map +0 -1
  71. package/dist/adapters/pi/extension.mjs +0 -2
  72. package/dist/adapters/pi/extension.mjs.map +0 -1
  73. package/dist/adapters/pi/extensions/runWorktreeTool.cjs +0 -15
  74. package/dist/adapters/pi/extensions/runWorktreeTool.cjs.map +0 -1
  75. package/dist/adapters/pi/extensions/runWorktreeTool.mjs +0 -15
  76. package/dist/adapters/pi/extensions/runWorktreeTool.mjs.map +0 -1
  77. package/dist/adapters/web/worktreesChannel.cjs +0 -2
  78. package/dist/adapters/web/worktreesChannel.cjs.map +0 -1
  79. package/dist/adapters/web/worktreesChannel.d.cts +0 -21
  80. package/dist/adapters/web/worktreesChannel.d.cts.map +0 -1
  81. package/dist/adapters/web/worktreesChannel.d.mts +0 -21
  82. package/dist/adapters/web/worktreesChannel.d.mts.map +0 -1
  83. package/dist/adapters/web/worktreesChannel.mjs +0 -2
  84. package/dist/adapters/web/worktreesChannel.mjs.map +0 -1
  85. package/dist/adapters/worktree/compositionMirror.cjs +0 -2
  86. package/dist/adapters/worktree/compositionMirror.cjs.map +0 -1
  87. package/dist/adapters/worktree/compositionMirror.mjs +0 -2
  88. package/dist/adapters/worktree/compositionMirror.mjs.map +0 -1
  89. package/dist/adapters/worktree/gitCli.cjs +0 -4
  90. package/dist/adapters/worktree/gitCli.cjs.map +0 -1
  91. package/dist/adapters/worktree/gitCli.mjs +0 -4
  92. package/dist/adapters/worktree/gitCli.mjs.map +0 -1
  93. package/dist/adapters/worktree/repositoryIdentity.cjs +0 -2
  94. package/dist/adapters/worktree/repositoryIdentity.cjs.map +0 -1
  95. package/dist/adapters/worktree/repositoryIdentity.mjs +0 -2
  96. package/dist/adapters/worktree/repositoryIdentity.mjs.map +0 -1
  97. package/dist/adapters/worktree/worktreeOperations.cjs +0 -2
  98. package/dist/adapters/worktree/worktreeOperations.cjs.map +0 -1
  99. package/dist/adapters/worktree/worktreeOperations.d.cts +0 -38
  100. package/dist/adapters/worktree/worktreeOperations.d.cts.map +0 -1
  101. package/dist/adapters/worktree/worktreeOperations.d.mts +0 -38
  102. package/dist/adapters/worktree/worktreeOperations.d.mts.map +0 -1
  103. package/dist/adapters/worktree/worktreeOperations.mjs +0 -2
  104. package/dist/adapters/worktree/worktreeOperations.mjs.map +0 -1
  105. package/dist/adapters/worktree/worktreeRegistry.cjs +0 -2
  106. package/dist/adapters/worktree/worktreeRegistry.cjs.map +0 -1
  107. package/dist/adapters/worktree/worktreeRegistry.mjs +0 -2
  108. package/dist/adapters/worktree/worktreeRegistry.mjs.map +0 -1
  109. package/dist/commands/doomGitCommand.cjs +0 -2
  110. package/dist/commands/doomGitCommand.cjs.map +0 -1
  111. package/dist/commands/doomGitCommand.mjs +0 -2
  112. package/dist/commands/doomGitCommand.mjs.map +0 -1
  113. package/dist/container/index.cjs +0 -2
  114. package/dist/container/index.cjs.map +0 -1
  115. package/dist/container/index.d.cts +0 -6
  116. package/dist/container/index.d.cts.map +0 -1
  117. package/dist/container/index.d.mts +0 -6
  118. package/dist/container/index.d.mts.map +0 -1
  119. package/dist/container/index.mjs +0 -2
  120. package/dist/container/index.mjs.map +0 -1
  121. package/dist/extensions/pi.d.cts +0 -2
  122. package/dist/hubApi.cjs +0 -2
  123. package/dist/hubApi.cjs.map +0 -1
  124. package/dist/hubApi.d.cts +0 -6
  125. package/dist/hubApi.d.cts.map +0 -1
  126. package/dist/hubApi.d.mts +0 -6
  127. package/dist/hubApi.d.mts.map +0 -1
  128. package/dist/hubApi.mjs +0 -2
  129. package/dist/hubApi.mjs.map +0 -1
  130. package/dist/index.d.cts +0 -5
  131. package/dist/schemas/runWorktreeTool.cjs +0 -2
  132. package/dist/schemas/runWorktreeTool.cjs.map +0 -1
  133. package/dist/schemas/runWorktreeTool.mjs +0 -2
  134. package/dist/schemas/runWorktreeTool.mjs.map +0 -1
  135. package/dist/services/extensionService.cjs +0 -2
  136. package/dist/services/extensionService.cjs.map +0 -1
  137. package/dist/services/extensionService.d.cts +0 -8
  138. package/dist/services/extensionService.d.cts.map +0 -1
  139. package/dist/services/extensionService.d.mts +0 -8
  140. package/dist/services/extensionService.d.mts.map +0 -1
  141. package/dist/services/extensionService.mjs +0 -2
  142. package/dist/services/extensionService.mjs.map +0 -1
  143. package/dist/services/support/errors.cjs +0 -2
  144. package/dist/services/support/errors.cjs.map +0 -1
  145. package/dist/services/support/errors.mjs +0 -2
  146. package/dist/services/support/errors.mjs.map +0 -1
  147. package/dist/services/worktreeNaming.cjs +0 -2
  148. package/dist/services/worktreeNaming.cjs.map +0 -1
  149. package/dist/services/worktreeNaming.d.cts +0 -34
  150. package/dist/services/worktreeNaming.d.cts.map +0 -1
  151. package/dist/services/worktreeNaming.d.mts +0 -34
  152. package/dist/services/worktreeNaming.d.mts.map +0 -1
  153. package/dist/services/worktreeNaming.mjs +0 -2
  154. package/dist/services/worktreeNaming.mjs.map +0 -1
  155. package/dist/types/extension.d.cts +0 -17
  156. package/dist/types/extension.d.cts.map +0 -1
  157. package/dist/types/extension.d.mts +0 -17
  158. package/dist/types/extension.d.mts.map +0 -1
  159. package/dist/types/webWorktrees.cjs +0 -2
  160. package/dist/types/webWorktrees.cjs.map +0 -1
  161. package/dist/types/webWorktrees.mjs +0 -2
  162. package/dist/types/webWorktrees.mjs.map +0 -1
  163. package/dist/types/worktreeRegistry.d.cts +0 -41
  164. package/dist/types/worktreeRegistry.d.cts.map +0 -1
  165. package/dist/types/worktreeRegistry.d.mts +0 -41
  166. package/dist/types/worktreeRegistry.d.mts.map +0 -1
  167. package/dist/webHub.cjs +0 -1
  168. package/dist/webHub.d.cts +0 -2
  169. package/dist/webHub.d.mts +0 -2
  170. package/dist/webHub.mjs +0 -1
  171. package/src/exports/webClient.ts +0 -1
  172. package/src/types/webWorktrees.ts +0 -55
  173. package/src/types/worktreeRegistry.ts +0 -78
  174. package/src/web/components/RunWorktreeToolMessage.tsx +0 -45
  175. package/src/web/components/WorktreesActivitySection.tsx +0 -79
  176. package/src/web/components/WorktreesPanel.tsx +0 -174
  177. package/src/web/components/toolRenderers.ts +0 -7
  178. package/src/web/index.ts +0 -30
  179. package/src/web/stores/worktreesActivityStore.ts +0 -124
  180. package/src/web/tsconfig.json +0 -22
package/README.md CHANGED
@@ -27,9 +27,39 @@ Run the registered command in Pi:
27
27
 
28
28
  Show git worktrees owned by this session
29
29
 
30
+ ### New-session dialog
31
+
32
+ In the web cockpit, doompi-git replaces the new-session dialog for a git workspace. It offers three choices:
33
+
34
+ - **Existing branch**: a worktree session on a local branch, or on a remote-only branch (a local tracking branch is created). Branches already checked out elsewhere are disabled.
35
+ - **New branch**: a worktree session on a new branch from a base, preselected to the repository's default branch.
36
+ - **No branch**: a plain session in the workspace folder.
37
+
38
+ Worktree sessions opened here start at the top level of the session rail, with no parent. A workspace that is not a git checkout offers the plain session only. For remote devices, creating a worktree session needs the same passkey step-up as any new session.
39
+
30
40
  ## Package behavior
31
41
 
32
- > Before publishing, replace this paragraph with one concrete, copy-pasteable example of the package-specific input, output, configuration, or workflow that is not already demonstrated by the generated command.
42
+ ### Review this session's changes
43
+
44
+ The `# git` group in the activity dock shows the focused checkout's branch and `+added -removed`, followed by its worktrees. Regular and worktree sessions use the same diff row, even when they have no child worktrees. The row opens review (`g d`); the group heading opens worktrees (`g w`). The counts measure this session's checkout against its base, the way a pull request counts it: every commit since the branch left its base, plus staged, unstaged and untracked work. The base is the worktree's recorded base when the session owns one, then the remote's default branch (`origin/HEAD`, `origin/main`, `origin/master`), then the branch's upstream; with none of those only uncommitted work counts. The count refreshes after every tool call and settled turn; nothing polls.
45
+
46
+ The lane opens the review tab: changed files grouped by folder on the left, every diff stacked on the right. Select lines, or click a line number, to write a comment under that line; a comment on a removed line points at the old file. Comments queue on the tab, and **send review** hands them to the agent as one message, queued behind a running turn rather than dropped.
47
+
48
+ ### Pull, push and rebase
49
+
50
+ The review tab's header runs them by hand, one at a time per session:
51
+
52
+ - **pull** fetches, then rebases local commits onto the upstream.
53
+ - **rebase** fetches the base's remote, then rebases onto the base.
54
+ - **push** sets the upstream on a first push. A push the remote rejects after a rebase asks first, then forces with `--force-with-lease --force-if-includes`, which git refuses if the remote holds commits this branch never fetched and integrated.
55
+
56
+ Pull and rebase refuse uncommitted changes. A rebase that stops on conflicts stays paused and lists the files, with **ask agent to resolve** and **abort rebase**.
57
+
58
+ ### Remote auth, per workspace
59
+
60
+ Settings, then repository, then **git remote**, sets how one workspace's sessions reach the remote when you pull, push or rebase from the cockpit: this machine's own git (the default), an SSH key path (blank uses your ssh config and ssh-agent), or an HTTPS username and token for one host. Worktree sessions use their workspace's setup.
61
+
62
+ The setup lives outside every repository in `~/.pi/.doom/git/credentials.json` (folder `0700`, file `0600`). The token is write-only: the page shows only that one is saved. It goes into the environment of one `git fetch` or `git push` at a time, only for the host it was entered for, with git's credential helper list emptied first so the macOS keychain never stores it. The agent's own git commands never see these credentials. Saving from a remote device needs passkey step-up. An unknown SSH host is refused: trust it once with `ssh -T git@<host>` in a terminal.
33
63
 
34
64
  ## Help
35
65
 
@@ -69,3 +99,5 @@ Maintained by [Agimon](https://agimon.ai/about).
69
99
  ## License
70
100
 
71
101
  MIT
102
+
103
+ Named Pi and server factories live in `src/extensions`. Controllers declare commands and APIs; services own worktree operations and filesystem persistence; tools return typed Pi declarations. Public services and types are exposed through flat `src/exports`. In composed DoomPi sessions, the fixed Session foundation durably admits `spawn_worktree.task`, parent messages, and child reports while waking the recipient. The prior in-memory inbox remains only as a standalone compatibility fallback.
@@ -0,0 +1,387 @@
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
5
+ let _agimon_ai_doompi_core_apiContracts = require("@agimon-ai/doompi-core/apiContracts");
6
+ let typebox = require("typebox");
7
+ //#region src/schemas/apiContracts.ts
8
+ const S = typebox.Type.String();
9
+ const B = typebox.Type.Boolean();
10
+ const O = typebox.Type.Optional;
11
+ const literals = (values) => typebox.Type.Union(values.map((value) => typebox.Type.Literal(value)));
12
+ const RecordSchema = typebox.Type.Object({
13
+ version: typebox.Type.Literal(1),
14
+ id: S,
15
+ branch: S,
16
+ baseRef: S,
17
+ path: S,
18
+ repositoryRoot: S,
19
+ sessionId: S,
20
+ parentSessionId: typebox.Type.Optional(S),
21
+ status: literals([
22
+ "spawning",
23
+ "running",
24
+ "closing",
25
+ "orphaned"
26
+ ]),
27
+ createdAt: S
28
+ });
29
+ const ErrorTargetSchema = typebox.Type.Union([typebox.Type.Object({ action: typebox.Type.Literal("create") }), typebox.Type.Object({
30
+ action: typebox.Type.Literal("close"),
31
+ id: S
32
+ })]);
33
+ const WorktreesPayloadSchema = typebox.Type.Object({
34
+ worktrees: typebox.Type.Array(typebox.Type.Object({
35
+ id: S,
36
+ branch: S,
37
+ path: S,
38
+ sessionId: typebox.Type.Union([S, typebox.Type.Null()]),
39
+ orphaned: B,
40
+ unowned: B
41
+ })),
42
+ pending: O(S),
43
+ error: O(S),
44
+ errorTarget: O(ErrorTargetSchema)
45
+ });
46
+ const WorktreesCommandSchema = typebox.Type.Union([typebox.Type.Object({
47
+ action: typebox.Type.Literal("create"),
48
+ branch: S,
49
+ baseRef: O(S),
50
+ reservationId: O(typebox.Type.String({
51
+ minLength: 1,
52
+ pattern: "^[A-Za-z0-9_-]+$"
53
+ }))
54
+ }), typebox.Type.Object({
55
+ action: typebox.Type.Literal("close"),
56
+ id: S,
57
+ force: O(B)
58
+ })]);
59
+ const N = typebox.Type.Integer({ minimum: 0 });
60
+ const ChangesSchema = typebox.Type.Object({
61
+ branch: O(S),
62
+ base: O(S),
63
+ added: N,
64
+ removed: N,
65
+ files: N,
66
+ truncated: O(B),
67
+ upstream: O(typebox.Type.Object({
68
+ ref: S,
69
+ ahead: N,
70
+ behind: N
71
+ })),
72
+ rebase: O(typebox.Type.Object({ conflicts: typebox.Type.Array(S) }))
73
+ });
74
+ const SyncErrorTargetSchema = typebox.Type.Union([typebox.Type.Object({ action: literals([
75
+ "pull",
76
+ "rebase",
77
+ "abort-rebase"
78
+ ]) }), typebox.Type.Object({
79
+ action: typebox.Type.Literal("push"),
80
+ forceRequired: O(typebox.Type.Literal(true))
81
+ })]);
82
+ const GitChangesPayloadSchema = typebox.Type.Object({
83
+ changes: O(ChangesSchema),
84
+ pending: O(S),
85
+ error: O(S),
86
+ errorTarget: O(SyncErrorTargetSchema)
87
+ });
88
+ const GitChangesCommandSchema = typebox.Type.Union([typebox.Type.Object({ action: literals([
89
+ "pull",
90
+ "rebase",
91
+ "abort-rebase"
92
+ ]) }), typebox.Type.Object({
93
+ action: typebox.Type.Literal("push"),
94
+ force: O(typebox.Type.Literal(true))
95
+ })]);
96
+ const AuthViewSchema = typebox.Type.Object({
97
+ method: literals([
98
+ "none",
99
+ "ssh",
100
+ "https"
101
+ ]),
102
+ ssh: O(typebox.Type.Object({ keyPath: O(S) })),
103
+ https: O(typebox.Type.Object({
104
+ host: S,
105
+ username: S,
106
+ hasToken: B
107
+ }))
108
+ });
109
+ const AuthSaveSchema = typebox.Type.Union([
110
+ typebox.Type.Object({ method: typebox.Type.Literal("none") }),
111
+ typebox.Type.Object({
112
+ method: typebox.Type.Literal("ssh"),
113
+ keyPath: O(S)
114
+ }),
115
+ typebox.Type.Object({
116
+ method: typebox.Type.Literal("https"),
117
+ host: S,
118
+ username: S,
119
+ token: O(typebox.Type.String({ writeOnly: true }))
120
+ })
121
+ ]);
122
+ const DiffRowSchema = typebox.Type.Object({
123
+ marker: literals([
124
+ "+",
125
+ "-",
126
+ " "
127
+ ]),
128
+ line: N,
129
+ content: S
130
+ });
131
+ const ReviewSummarySchema = typebox.Type.Object({
132
+ repository: B,
133
+ branch: O(S),
134
+ base: O(S),
135
+ mergeBase: O(S),
136
+ truncated: O(B),
137
+ files: typebox.Type.Array(typebox.Type.Object({
138
+ path: S,
139
+ status: literals([
140
+ "added",
141
+ "modified",
142
+ "deleted",
143
+ "untracked",
144
+ "conflicted"
145
+ ]),
146
+ added: N,
147
+ removed: N,
148
+ binary: O(B)
149
+ }))
150
+ });
151
+ const ReviewFileSchema = typebox.Type.Object({
152
+ path: S,
153
+ hunks: typebox.Type.Array(typebox.Type.Object({
154
+ start: N,
155
+ rows: typebox.Type.Array(DiffRowSchema)
156
+ })),
157
+ binary: O(typebox.Type.Literal(true)),
158
+ tooLarge: O(typebox.Type.Literal(true))
159
+ });
160
+ const query = [{
161
+ name: "repositoryId",
162
+ in: "query",
163
+ required: true,
164
+ schema: S
165
+ }, {
166
+ name: "sessionId",
167
+ in: "query",
168
+ required: true,
169
+ schema: S
170
+ }];
171
+ const apiContracts = (0, _agimon_ai_doompi_core_apiContracts.defineApiContract)({
172
+ version: 1,
173
+ dynamic: [],
174
+ http: ["global", "workspace"].flatMap((scope) => [
175
+ {
176
+ id: "git.list",
177
+ scope,
178
+ basePath: "git",
179
+ path: "/worktrees",
180
+ method: "GET",
181
+ authentication: "owner",
182
+ description: "List admitted repository worktrees.",
183
+ parameters: query.map((item) => ({
184
+ ...item,
185
+ required: item.name === "repositoryId"
186
+ })),
187
+ responses: (0, _agimon_ai_doompi_core_apiContracts.jsonApiResponses)(typebox.Type.Object({ worktrees: typebox.Type.Array(RecordSchema) }))
188
+ },
189
+ {
190
+ id: "git.create",
191
+ scope,
192
+ basePath: "git",
193
+ path: "/worktrees",
194
+ method: "POST",
195
+ authentication: "owner",
196
+ description: "Create a worktree and session.",
197
+ parameters: query,
198
+ body: {
199
+ required: true,
200
+ contentType: "application/json",
201
+ schema: typebox.Type.Object({
202
+ branch: typebox.Type.String({ minLength: 1 }),
203
+ baseRef: O(S),
204
+ name: O(S)
205
+ })
206
+ },
207
+ responses: (0, _agimon_ai_doompi_core_apiContracts.jsonApiResponses)(typebox.Type.Object({ worktree: RecordSchema }), 201)
208
+ },
209
+ {
210
+ id: "git.close",
211
+ scope,
212
+ basePath: "git",
213
+ path: "/worktrees/{id}",
214
+ method: "DELETE",
215
+ authentication: "owner",
216
+ description: "Close a worktree.",
217
+ parameters: [...query, {
218
+ name: "force",
219
+ in: "query",
220
+ required: false,
221
+ schema: B
222
+ }],
223
+ responses: (0, _agimon_ai_doompi_core_apiContracts.jsonApiResponses)(typebox.Type.Object({ worktree: RecordSchema }))
224
+ },
225
+ ...scope === "workspace" ? [
226
+ {
227
+ id: "git.auth.read",
228
+ scope,
229
+ basePath: "git",
230
+ path: "/auth",
231
+ method: "GET",
232
+ authentication: "owner",
233
+ description: "Read a workspace's remote auth for manual sync. The token is never returned.",
234
+ parameters: [{
235
+ name: "repositoryId",
236
+ in: "query",
237
+ required: true,
238
+ schema: S
239
+ }],
240
+ responses: (0, _agimon_ai_doompi_core_apiContracts.jsonApiResponses)(AuthViewSchema)
241
+ },
242
+ {
243
+ id: "git.auth.save",
244
+ scope,
245
+ basePath: "git",
246
+ path: "/auth",
247
+ method: "PUT",
248
+ authentication: "owner",
249
+ description: "Replace a workspace's remote auth. Passkey step-up gated for remote devices.",
250
+ parameters: [{
251
+ name: "repositoryId",
252
+ in: "query",
253
+ required: true,
254
+ schema: S
255
+ }],
256
+ body: {
257
+ required: true,
258
+ contentType: "application/json",
259
+ schema: AuthSaveSchema
260
+ },
261
+ responses: (0, _agimon_ai_doompi_core_apiContracts.jsonApiResponses)(AuthViewSchema)
262
+ },
263
+ {
264
+ id: "git.branches",
265
+ scope,
266
+ basePath: "git",
267
+ path: "/branches",
268
+ method: "GET",
269
+ authentication: "owner",
270
+ description: "List the workspace branches for the new-session dialog.",
271
+ responses: (0, _agimon_ai_doompi_core_apiContracts.jsonApiResponses)(typebox.Type.Object({
272
+ repository: B,
273
+ current: O(S),
274
+ defaultBase: O(S),
275
+ local: typebox.Type.Array(typebox.Type.Object({
276
+ name: S,
277
+ checkedOutAt: O(S)
278
+ })),
279
+ remote: typebox.Type.Array(typebox.Type.Object({
280
+ remote: S,
281
+ name: S
282
+ }))
283
+ }))
284
+ },
285
+ {
286
+ id: "git.sessions.create",
287
+ scope,
288
+ basePath: "git",
289
+ path: "/sessions",
290
+ method: "POST",
291
+ authentication: "owner",
292
+ description: "Start a top-level worktree session on an existing or new branch.",
293
+ body: {
294
+ required: true,
295
+ contentType: "application/json",
296
+ schema: typebox.Type.Union([typebox.Type.Object({
297
+ mode: typebox.Type.Literal("existing-branch"),
298
+ branch: S,
299
+ remote: O(S),
300
+ name: O(S)
301
+ }), typebox.Type.Object({
302
+ mode: typebox.Type.Literal("new-branch"),
303
+ branch: S,
304
+ baseRef: O(S),
305
+ name: O(S)
306
+ })])
307
+ },
308
+ responses: (0, _agimon_ai_doompi_core_apiContracts.jsonApiResponses)(typebox.Type.Object({
309
+ sessionId: S,
310
+ worktreeId: S
311
+ }), 201)
312
+ }
313
+ ] : [],
314
+ ...scope === "global" ? [{
315
+ id: "git.review.summary",
316
+ scope: "session",
317
+ basePath: "git",
318
+ path: "/review",
319
+ method: "GET",
320
+ authentication: "owner",
321
+ description: "List the files the session's checkout changed against its base.",
322
+ responses: (0, _agimon_ai_doompi_core_apiContracts.jsonApiResponses)(ReviewSummarySchema)
323
+ }, {
324
+ id: "git.review.file",
325
+ scope: "session",
326
+ basePath: "git",
327
+ path: "/review/file",
328
+ method: "GET",
329
+ authentication: "owner",
330
+ description: "One changed file's hunks; the path must be in the session's change set.",
331
+ parameters: [{
332
+ name: "path",
333
+ in: "query",
334
+ required: true,
335
+ schema: typebox.Type.String({ minLength: 1 })
336
+ }],
337
+ responses: (0, _agimon_ai_doompi_core_apiContracts.jsonApiResponses)(ReviewFileSchema)
338
+ }] : []
339
+ ]),
340
+ sockets: ["global", "workspace"].flatMap((scope) => [
341
+ {
342
+ id: "git.changes.channel",
343
+ scope,
344
+ service: "doompi.hub.v1",
345
+ member: "git_changes",
346
+ kind: "channel",
347
+ direction: "server-to-client",
348
+ description: "The session's change against its base, and manual sync state.",
349
+ input: GitChangesPayloadSchema
350
+ },
351
+ {
352
+ id: "git.changes.command",
353
+ scope,
354
+ service: "doompi.hub.v1",
355
+ member: "git_changes",
356
+ kind: "channel",
357
+ direction: "client-to-server",
358
+ description: "Manual pull, push, rebase or abort-rebase for the session.",
359
+ input: GitChangesCommandSchema
360
+ },
361
+ {
362
+ id: "git.channel",
363
+ scope,
364
+ service: "doompi.hub.v1",
365
+ member: "git_worktrees",
366
+ kind: "channel",
367
+ direction: "server-to-client",
368
+ description: "Worktree channel payload.",
369
+ input: WorktreesPayloadSchema
370
+ },
371
+ {
372
+ id: "git.command",
373
+ scope,
374
+ service: "doompi.hub.v1",
375
+ member: "git_worktrees",
376
+ kind: "channel",
377
+ direction: "client-to-server",
378
+ description: "Worktree channel command payload.",
379
+ input: WorktreesCommandSchema
380
+ }
381
+ ])
382
+ });
383
+ //#endregion
384
+ exports.apiContracts = apiContracts;
385
+ exports.default = apiContracts;
386
+
387
+ //# sourceMappingURL=apiContracts.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiContracts.cjs","names":["Type","defineApiContract","jsonApiResponses"],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract, jsonApiResponses } from '@agimon-ai/doompi-core/apiContracts';\nimport { Type } from 'typebox';\n\nconst S = Type.String();\nconst B = Type.Boolean();\nconst O = Type.Optional;\nconst literals = <T extends string>(values: T[]) => Type.Union(values.map((value) => Type.Literal(value)));\nconst RecordSchema = Type.Object({\n version: Type.Literal(1),\n id: S,\n branch: S,\n baseRef: S,\n path: S,\n repositoryRoot: S,\n sessionId: S,\n parentSessionId: Type.Optional(S),\n status: literals(['spawning', 'running', 'closing', 'orphaned']),\n createdAt: S,\n});\nconst ErrorTargetSchema = Type.Union([\n Type.Object({ action: Type.Literal('create') }),\n Type.Object({ action: Type.Literal('close'), id: S }),\n]);\nexport const WorktreesPayloadSchema = Type.Object({\n worktrees: Type.Array(\n Type.Object({ id: S, branch: S, path: S, sessionId: Type.Union([S, Type.Null()]), orphaned: B, unowned: B }),\n ),\n pending: O(S),\n error: O(S),\n errorTarget: O(ErrorTargetSchema),\n});\nexport const WorktreesCommandSchema = Type.Union([\n Type.Object({\n action: Type.Literal('create'),\n branch: S,\n baseRef: O(S),\n reservationId: O(Type.String({ minLength: 1, pattern: '^[A-Za-z0-9_-]+$' })),\n }),\n Type.Object({ action: Type.Literal('close'), id: S, force: O(B) }),\n]);\nconst N = Type.Integer({ minimum: 0 });\nconst ChangesSchema = Type.Object({\n branch: O(S),\n base: O(S),\n added: N,\n removed: N,\n files: N,\n truncated: O(B),\n upstream: O(Type.Object({ ref: S, ahead: N, behind: N })),\n rebase: O(Type.Object({ conflicts: Type.Array(S) })),\n});\nconst SyncErrorTargetSchema = Type.Union([\n Type.Object({ action: literals(['pull', 'rebase', 'abort-rebase']) }),\n Type.Object({ action: Type.Literal('push'), forceRequired: O(Type.Literal(true)) }),\n]);\nexport const GitChangesPayloadSchema = Type.Object({\n changes: O(ChangesSchema),\n pending: O(S),\n error: O(S),\n errorTarget: O(SyncErrorTargetSchema),\n});\nexport const GitChangesCommandSchema = Type.Union([\n Type.Object({ action: literals(['pull', 'rebase', 'abort-rebase']) }),\n Type.Object({ action: Type.Literal('push'), force: O(Type.Literal(true)) }),\n]);\nconst AuthViewSchema = Type.Object({\n method: literals(['none', 'ssh', 'https']),\n ssh: O(Type.Object({ keyPath: O(S) })),\n https: O(Type.Object({ host: S, username: S, hasToken: B })),\n});\nconst AuthSaveSchema = Type.Union([\n Type.Object({ method: Type.Literal('none') }),\n Type.Object({ method: Type.Literal('ssh'), keyPath: O(S) }),\n Type.Object({ method: Type.Literal('https'), host: S, username: S, token: O(Type.String({ writeOnly: true })) }),\n]);\nconst DiffRowSchema = Type.Object({ marker: literals(['+', '-', ' ']), line: N, content: S });\nconst ReviewSummarySchema = Type.Object({\n repository: B,\n branch: O(S),\n base: O(S),\n mergeBase: O(S),\n truncated: O(B),\n files: Type.Array(\n Type.Object({\n path: S,\n status: literals(['added', 'modified', 'deleted', 'untracked', 'conflicted']),\n added: N,\n removed: N,\n binary: O(B),\n }),\n ),\n});\nconst ReviewFileSchema = Type.Object({\n path: S,\n hunks: Type.Array(Type.Object({ start: N, rows: Type.Array(DiffRowSchema) })),\n binary: O(Type.Literal(true)),\n tooLarge: O(Type.Literal(true)),\n});\nconst query = [\n { name: 'repositoryId', in: 'query' as const, required: true, schema: S },\n { name: 'sessionId', in: 'query' as const, required: true, schema: S },\n];\nexport const apiContracts = defineApiContract({\n version: 1,\n dynamic: [],\n http: (['global', 'workspace'] as const).flatMap((scope) => [\n {\n id: 'git.list',\n scope,\n basePath: 'git',\n path: '/worktrees',\n method: 'GET',\n authentication: 'owner',\n description: 'List admitted repository worktrees.',\n parameters: query.map((item) => ({ ...item, required: item.name === 'repositoryId' })),\n responses: jsonApiResponses(Type.Object({ worktrees: Type.Array(RecordSchema) })),\n },\n {\n id: 'git.create',\n scope,\n basePath: 'git',\n path: '/worktrees',\n method: 'POST',\n authentication: 'owner',\n description: 'Create a worktree and session.',\n parameters: query,\n body: {\n required: true,\n contentType: 'application/json',\n schema: Type.Object({ branch: Type.String({ minLength: 1 }), baseRef: O(S), name: O(S) }),\n },\n responses: jsonApiResponses(Type.Object({ worktree: RecordSchema }), 201),\n },\n {\n id: 'git.close',\n scope,\n basePath: 'git',\n path: '/worktrees/{id}',\n method: 'DELETE',\n authentication: 'owner',\n description: 'Close a worktree.',\n parameters: [...query, { name: 'force', in: 'query', required: false, schema: B }],\n responses: jsonApiResponses(Type.Object({ worktree: RecordSchema })),\n },\n // The new-session dialog's routes and a workspace's remote auth exist only on a workspace mount.\n ...(scope === 'workspace'\n ? [\n {\n id: 'git.auth.read',\n scope,\n basePath: 'git',\n path: '/auth',\n method: 'GET' as const,\n authentication: 'owner' as const,\n description: \"Read a workspace's remote auth for manual sync. The token is never returned.\",\n parameters: [{ name: 'repositoryId', in: 'query' as const, required: true, schema: S }],\n responses: jsonApiResponses(AuthViewSchema),\n },\n {\n id: 'git.auth.save',\n scope,\n basePath: 'git',\n path: '/auth',\n method: 'PUT' as const,\n authentication: 'owner' as const,\n description: \"Replace a workspace's remote auth. Passkey step-up gated for remote devices.\",\n parameters: [{ name: 'repositoryId', in: 'query' as const, required: true, schema: S }],\n body: { required: true, contentType: 'application/json', schema: AuthSaveSchema },\n responses: jsonApiResponses(AuthViewSchema),\n },\n {\n id: 'git.branches',\n scope,\n basePath: 'git',\n path: '/branches',\n method: 'GET' as const,\n authentication: 'owner' as const,\n description: 'List the workspace branches for the new-session dialog.',\n responses: jsonApiResponses(\n Type.Object({\n repository: B,\n current: O(S),\n defaultBase: O(S),\n local: Type.Array(Type.Object({ name: S, checkedOutAt: O(S) })),\n remote: Type.Array(Type.Object({ remote: S, name: S })),\n }),\n ),\n },\n {\n id: 'git.sessions.create',\n scope,\n basePath: 'git',\n path: '/sessions',\n method: 'POST' as const,\n authentication: 'owner' as const,\n description: 'Start a top-level worktree session on an existing or new branch.',\n body: {\n required: true,\n contentType: 'application/json',\n schema: Type.Union([\n Type.Object({ mode: Type.Literal('existing-branch'), branch: S, remote: O(S), name: O(S) }),\n Type.Object({ mode: Type.Literal('new-branch'), branch: S, baseRef: O(S), name: O(S) }),\n ]),\n },\n responses: jsonApiResponses(Type.Object({ sessionId: S, worktreeId: S }), 201),\n },\n ]\n : []),\n // The review routes exist only on a session mount; listed once, beside the global entries.\n ...(scope === 'global'\n ? [\n {\n id: 'git.review.summary',\n scope: 'session' as const,\n basePath: 'git',\n path: '/review',\n method: 'GET' as const,\n authentication: 'owner' as const,\n description: \"List the files the session's checkout changed against its base.\",\n responses: jsonApiResponses(ReviewSummarySchema),\n },\n {\n id: 'git.review.file',\n scope: 'session' as const,\n basePath: 'git',\n path: '/review/file',\n method: 'GET' as const,\n authentication: 'owner' as const,\n description: \"One changed file's hunks; the path must be in the session's change set.\",\n parameters: [{ name: 'path', in: 'query' as const, required: true, schema: Type.String({ minLength: 1 }) }],\n responses: jsonApiResponses(ReviewFileSchema),\n },\n ]\n : []),\n ]),\n sockets: (['global', 'workspace'] as const).flatMap((scope) => [\n {\n id: 'git.changes.channel',\n scope,\n service: 'doompi.hub.v1',\n member: 'git_changes',\n kind: 'channel',\n direction: 'server-to-client',\n description: \"The session's change against its base, and manual sync state.\",\n input: GitChangesPayloadSchema,\n },\n {\n id: 'git.changes.command',\n scope,\n service: 'doompi.hub.v1',\n member: 'git_changes',\n kind: 'channel',\n direction: 'client-to-server',\n description: 'Manual pull, push, rebase or abort-rebase for the session.',\n input: GitChangesCommandSchema,\n },\n {\n id: 'git.channel',\n scope,\n service: 'doompi.hub.v1',\n member: 'git_worktrees',\n kind: 'channel',\n direction: 'server-to-client',\n description: 'Worktree channel payload.',\n input: WorktreesPayloadSchema,\n },\n {\n id: 'git.command',\n scope,\n service: 'doompi.hub.v1',\n member: 'git_worktrees',\n kind: 'channel',\n direction: 'client-to-server',\n description: 'Worktree channel command payload.',\n input: WorktreesCommandSchema,\n },\n ]),\n});\nexport default apiContracts;\n"],"mappings":";;;;;;;AAGA,MAAM,IAAIA,QAAAA,KAAK,OAAO;AACtB,MAAM,IAAIA,QAAAA,KAAK,QAAQ;AACvB,MAAM,IAAIA,QAAAA,KAAK;AACf,MAAM,YAA8B,WAAgBA,QAAAA,KAAK,MAAM,OAAO,KAAK,UAAUA,QAAAA,KAAK,QAAQ,KAAK,CAAC,CAAC;AACzG,MAAM,eAAeA,QAAAA,KAAK,OAAO;CAC/B,SAASA,QAAAA,KAAK,QAAQ,CAAC;CACvB,IAAI;CACJ,QAAQ;CACR,SAAS;CACT,MAAM;CACN,gBAAgB;CAChB,WAAW;CACX,iBAAiBA,QAAAA,KAAK,SAAS,CAAC;CAChC,QAAQ,SAAS;EAAC;EAAY;EAAW;EAAW;CAAU,CAAC;CAC/D,WAAW;AACb,CAAC;AACD,MAAM,oBAAoBA,QAAAA,KAAK,MAAM,CACnCA,QAAAA,KAAK,OAAO,EAAE,QAAQA,QAAAA,KAAK,QAAQ,QAAQ,EAAE,CAAC,GAC9CA,QAAAA,KAAK,OAAO;CAAE,QAAQA,QAAAA,KAAK,QAAQ,OAAO;CAAG,IAAI;AAAE,CAAC,CACtD,CAAC;AACD,MAAa,yBAAyBA,QAAAA,KAAK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GACV,MAAM;GACN,QAAQ;GACR,gBAAgB;GAChB,aAAa;GACb,YAAY,CAAC;IAAE,MAAM;IAAQ,IAAI;IAAkB,UAAU;IAAM,QAAQF,QAAAA,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;GAAE,CAAC;GAC1G,YAAA,GAAWE,oCAAAA,iBAAAA,CAAiB,gBAAgB;EAC9C,CACF,IACA,CAAC;CACP,CAAC;CACD,SAAU,CAAC,UAAU,WAAW,CAAC,CAAW,SAAS,UAAU;EAC7D;GACE,IAAI;GACJ;GACA,SAAS;GACT,QAAQ;GACR,MAAM;GACN,WAAW;GACX,aAAa;GACb,OAAO;EACT;EACA;GACE,IAAI;GACJ;GACA,SAAS;GACT,QAAQ;GACR,MAAM;GACN,WAAW;GACX,aAAa;GACb,OAAO;EACT;EACA;GACE,IAAI;GACJ;GACA,SAAS;GACT,QAAQ;GACR,MAAM;GACN,WAAW;GACX,aAAa;GACb,OAAO;EACT;EACA;GACE,IAAI;GACJ;GACA,SAAS;GACT,QAAQ;GACR,MAAM;GACN,WAAW;GACX,aAAa;GACb,OAAO;EACT;CACF,CAAC;AACH,CAAC"}
@@ -0,0 +1,53 @@
1
+ import { Type } from "typebox";
2
+ //#region src/schemas/apiContracts.d.ts
3
+ export declare const apiContracts: {
4
+ version: 1;
5
+ protocols?: Record<string, string> | undefined;
6
+ schemas?: Record<string, boolean | object> | undefined;
7
+ http: {
8
+ id: string;
9
+ scope: "global" | "session" | "workspace";
10
+ basePath?: string | undefined;
11
+ path: string;
12
+ method: "DELETE" | "GET" | "HEAD" | "OPTIONS" | "PATCH" | "POST" | "PUT";
13
+ description: string;
14
+ availability?: string | undefined;
15
+ authentication: "device" | "none" | "owner";
16
+ parameters?: {
17
+ name: string;
18
+ in: "header" | "path" | "query";
19
+ required: boolean;
20
+ schema: boolean | object;
21
+ }[] | undefined;
22
+ body?: {
23
+ contentType: string;
24
+ contentTypes?: string[] | undefined;
25
+ required: boolean;
26
+ schema: boolean | object;
27
+ } | undefined;
28
+ responses: Record<string, {
29
+ description: string;
30
+ contentType?: string | undefined;
31
+ schema?: boolean | object | undefined;
32
+ events?: Record<string, boolean | object> | undefined;
33
+ }>;
34
+ }[];
35
+ sockets: {
36
+ id: string;
37
+ scope: "global" | "session" | "workspace";
38
+ description: string;
39
+ availability?: string | undefined;
40
+ service: string;
41
+ member: string;
42
+ direction: "client-to-server" | "server-to-client";
43
+ kind: "channel" | "method" | "state";
44
+ input: boolean | object;
45
+ output?: boolean | object | undefined;
46
+ errors?: boolean | object | undefined;
47
+ }[];
48
+ dynamic: string[];
49
+ gaps?: string[] | undefined;
50
+ };
51
+ //#endregion
52
+ export { apiContracts as default };
53
+ //# sourceMappingURL=apiContracts.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiContracts.d.mts","names":[],"sources":["../src/schemas/apiContracts.ts"],"mappings":";;qBAsGa"}