@agimon-ai/po-git 0.0.0-alpha.20 → 0.0.0-alpha.200

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 (36) hide show
  1. package/LICENSE +97 -8
  2. package/README.md +91 -21
  3. package/dist/apiContracts.cjs +78 -12
  4. package/dist/apiContracts.cjs.map +1 -1
  5. package/dist/apiContracts.d.mts +2 -2
  6. package/dist/apiContracts.d.mts.map +1 -1
  7. package/dist/apiContracts.mjs +78 -12
  8. package/dist/apiContracts.mjs.map +1 -1
  9. package/dist/extensions/native.mjs +2255 -544
  10. package/dist/extensions/native.mjs.map +1 -1
  11. package/dist/extensions/server.cjs +1553 -508
  12. package/dist/extensions/server.cjs.map +1 -1
  13. package/dist/extensions/server.d.mts.map +1 -1
  14. package/dist/extensions/server.mjs +1512 -467
  15. package/dist/extensions/server.mjs.map +1 -1
  16. package/dist/extensions/web.mjs +1747 -1374
  17. package/dist/extensions/web.mjs.map +1 -1
  18. package/dist/gitDependencies-D8bKxZSc.cjs +2690 -0
  19. package/dist/gitDependencies-D8bKxZSc.cjs.map +1 -0
  20. package/dist/gitDependencies-Delu4xip.mjs +2432 -0
  21. package/dist/gitDependencies-Delu4xip.mjs.map +1 -0
  22. package/dist/index.cjs +13 -22
  23. package/dist/index.d.mts +266 -14
  24. package/dist/index.d.mts.map +1 -1
  25. package/dist/index.mjs +3 -22
  26. package/dist/po-runtime-identity.json +1 -0
  27. package/llms.txt +3 -3
  28. package/package.json +99 -21
  29. package/src/prompts/codemode-how-to-git/SKILL.md +137 -0
  30. package/dist/index.cjs.map +0 -1
  31. package/dist/index.mjs.map +0 -1
  32. package/dist/worktreeOperations-Cd8Q12L4.mjs +0 -1064
  33. package/dist/worktreeOperations-Cd8Q12L4.mjs.map +0 -1
  34. package/dist/worktreeOperations-Dxs3txKL.cjs +0 -1220
  35. package/dist/worktreeOperations-Dxs3txKL.cjs.map +0 -1
  36. package/src/prompts/po-use-git/SKILL.md +0 -87
package/LICENSE CHANGED
@@ -1,13 +1,102 @@
1
- MIT License
1
+ # Functional Source License, Version 1.1, MIT Future License
2
2
 
3
- Copyright (c) 2026 Vuong Ngo
3
+ ## Abbreviation
4
4
 
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
5
+ FSL-1.1-MIT
6
+
7
+ ## Notice
8
+
9
+ Copyright 2026 Agimon Pty Ltd
10
+
11
+ ## Terms and Conditions
12
+
13
+ ### Licensor ("We")
14
+
15
+ The party offering the Software under these Terms and Conditions.
16
+
17
+ ### The Software
18
+
19
+ The "Software" is each version of the software that we make available under
20
+ these Terms and Conditions, as indicated by our inclusion of these Terms and
21
+ Conditions with the Software.
22
+
23
+ ### License Grant
24
+
25
+ Subject to your compliance with this License Grant and the Patents,
26
+ Redistribution and Trademark clauses below, we hereby grant you the right to
27
+ use, copy, modify, create derivative works, publicly perform, publicly display
28
+ and redistribute the Software for any Permitted Purpose identified below.
29
+
30
+ ### Permitted Purpose
31
+
32
+ A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
33
+ means making the Software available to others in a commercial product or
34
+ service that:
35
+
36
+ 1. substitutes for the Software;
37
+
38
+ 2. substitutes for any other product or service we offer using the Software
39
+ that exists as of the date we make the Software available; or
40
+
41
+ 3. offers the same or substantially similar functionality as the Software.
42
+
43
+ Permitted Purposes specifically include using the Software:
44
+
45
+ 1. for your internal use and access;
46
+
47
+ 2. for non-commercial education;
48
+
49
+ 3. for non-commercial research; and
50
+
51
+ 4. in connection with professional services that you provide to a licensee
52
+ using the Software in accordance with these Terms and Conditions.
53
+
54
+ ### Patents
55
+
56
+ To the extent your use for a Permitted Purpose would necessarily infringe our
57
+ patents, the license grant above includes a license under our patents. If you
58
+ make a claim against any party that the Software infringes or contributes to
59
+ the infringement of any patent, then your patent license to the Software ends
60
+ immediately.
61
+
62
+ ### Redistribution
63
+
64
+ The Terms and Conditions apply to all copies, modifications and derivatives of
65
+ the Software.
66
+
67
+ If you redistribute any copies, modifications or derivatives of the Software,
68
+ you must include a copy of or a link to these Terms and Conditions and not
69
+ remove any copyright notices provided in or with the Software.
70
+
71
+ ### Disclaimer
72
+
73
+ THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
74
+ IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
75
+ PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
76
+
77
+ IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
78
+ SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
79
+ EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
80
+
81
+ ### Trademarks
82
+
83
+ Except for displaying the License Details and identifying us as the origin of
84
+ the Software, you have no right under these Terms and Conditions to use our
85
+ trademarks, trade names, service marks or product names.
86
+
87
+ ## Grant of Future License
88
+
89
+ We hereby irrevocably grant you an additional license to use the Software under
90
+ the MIT license that is effective on the second anniversary of the date we make
91
+ the Software available. On or after that date, you may use the Software under
92
+ the MIT license, in which case the following will apply:
93
+
94
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
95
+ this software and associated documentation files (the "Software"), to deal in
96
+ the Software without restriction, including without limitation the rights to
97
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
98
+ of the Software, and to permit persons to whom the Software is furnished to do
99
+ so, subject to the following conditions:
11
100
 
12
101
  The above copyright notice and this permission notice shall be included in all
13
102
  copies or substantial portions of the Software.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @agimon-ai/po-git
2
2
 
3
- Git worktree sessions for Po: spawn an isolated worktree with its own session and manage it from the parent
3
+ Git worktree sessions for Po: spawn an isolated worktree with its own session and manage it from the parent.
4
4
 
5
5
  This package is a composable [Po](https://www.npmjs.com/package/@agimon-ai/po) subsystem. Select it through the native distribution configuration.
6
6
 
@@ -11,11 +11,11 @@ This package is a composable [Po](https://www.npmjs.com/package/@agimon-ai/po) s
11
11
 
12
12
  ## Install
13
13
 
14
- Add `@agimon-ai/po-git` to a selected layer in `.po/modes.yaml`, then run `po sync`. Native metadata selects its server and browser plugins; there is no standalone Pi entry.
14
+ Add `@agimon-ai/po-git` to a selected layer in `.po/presets.yaml`, then run `po sync`. Native metadata selects its server and browser plugins; there is no standalone Pi entry.
15
15
 
16
16
  ## Use
17
17
 
18
- Use the browser worktree controls or the native worktree tool.
18
+ Use the browser worktree controls or an agent session. In code mode, `worktrees` returns structured records; call `discover({ namespace: 'worktrees' })` for the installed signatures. Without code mode, use `run_worktree`. The [worktree guide](./src/prompts/codemode-how-to-git/SKILL.md) covers ownership, message delivery and when to refuse cleanup.
19
19
 
20
20
  ### New-session dialog
21
21
 
@@ -27,6 +27,91 @@ In the web cockpit, po-git replaces the new-session dialog for a git workspace.
27
27
 
28
28
  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.
29
29
 
30
+ ### Sparse checkouts
31
+
32
+ To offer partial checkouts, add a `sparse` block to `.po/worktree.yaml`. Without a sparse policy or profile, existing Git and Rift worktrees need no changes.
33
+
34
+ ```yaml
35
+ sparse:
36
+ profilePattern: profiles/{profile}.json
37
+ baseFolders: [.po, docs]
38
+ excludeFolders: [vendor]
39
+ ```
40
+
41
+ Commit `profiles/web.json` containing, for example, `{ "includeFolders": ["apps/web"] }`. Po reads profiles from Git at the selected ref, not from uncommitted files. The `web` checkout includes `apps/web` and the base folders. `full` is reserved for a complete checkout. Paths are repository-relative; exclusions limit the cone, not access to the Git object store.
42
+
43
+ Before the first sparse create, explicitly enable per-worktree Git config in the main repository. With the `sparo` binary from `@agimon-ai/po-sparo`, run `sparo --policy policy.json init --repo .`, where `policy.json` contains the three fields of the `sparse` block as a JSON object. This backs up shared Git config before changing it. Po does not run it for you.
44
+
45
+ `metadata.git.sparseProfile` sets the workspace checkout profile; `metadata.git.extraFolders` adds folders. Older workspaces can keep `metadata.sparo.profile` and `extraFolders` until they switch. Po uses `metadata.sparo` only if `metadata.git` is absent. The launcher's `selection.profile` chooses the session profile, not its files.
46
+
47
+ Plugins can inject the workspace service `po/git-engine`. Its contract and portable factory come from the MIT utility `@agimon-ai/po-sparo`; operations take an explicit policy, admitted environment and cancellation signal.
48
+
49
+ ### Worktree setup
50
+
51
+ A new worktree has no `node_modules` or builds. For an ordinary Git or Rift checkout, put the commands that prepare it in `.po/worktree.yaml` at the repository root:
52
+
53
+ ```yaml
54
+ setup:
55
+ - pnpm install --frozen-lockfile
56
+ - pnpm build
57
+ ```
58
+
59
+ For an engine-managed checkout (a named sparse profile or `full`), po-git runs `sparo install .` with the validated policy before the configured commands. Omit the example's `pnpm install` in that case. Without `setup`, neither install nor setup runs. Workflow launches skip this runner and own their preparation.
60
+
61
+ Setup runs in the child's `worktree-setup` runner, with a wake on exit. `setupStage: started` confirms the runner accepted the command, not that the build passed. For `failed` or `unconfirmed`, inspect the child and runner logs before deciding what to do. The checkout stays in place, even if Runner is missing. Do not spawn it again to retry setup. A malformed configuration is refused before any checkout is created.
62
+
63
+ ### Isolated repository workflows
64
+
65
+ Use `worktrees.startWorkflow({ key, attemptId, inputs })` to launch a repository workflow in its own checkout. The [worktree guide](./src/prompts/codemode-how-to-git/SKILL.md#isolated-workflow-runs) covers selecting a definition, retrying an attempt and checking its admission. The workflow gets the base remote, branch and commit plus its working branch as `PO_GIT_BASE_REMOTE`, `PO_GIT_BASE_BRANCH`, `PO_GIT_BASE_SHA` and `PO_GIT_BRANCH`. The corresponding `SPARO_*` names remain available for existing workflows.
66
+
67
+ ### Import an existing Sparo registry
68
+
69
+ This is a **one-time operator action**, not startup behavior. On the same host as the checkouts, stop the old `po-sparo` provider, keep both providers stopped and back up the `sparo` and `git` directories under the effective Po home. Do not move checkout directories. Use the public `importSparoWorktrees` export once per repository, with the repository's absolute root, the admitted home directory and the same explicit `PO_HOME` if it was overridden.
70
+
71
+ For a local Node operator, the following adapter uses an absolute, trusted Git executable and the supplied string-valued environment, not the operator shell's credentials. Pass `sourceProviderStopped: true` **only after** stopping the provider; the import cannot stop it for you.
72
+
73
+ ```js
74
+ import { execFileSync } from 'node:child_process';
75
+
76
+ import { createNodePlatform } from '@agimon-ai/po-core/nodePlatform';
77
+ import { importSparoWorktrees } from '@agimon-ai/po-git';
78
+
79
+ async function importStoppedRepository({
80
+ repositoryRoot,
81
+ homeDirectory,
82
+ environment,
83
+ gitExecutable,
84
+ sourceProviderStopped,
85
+ }) {
86
+ const git = (cwd, ...args) =>
87
+ execFileSync(gitExecutable, ['-C', cwd, ...args], {
88
+ env: environment,
89
+ encoding: 'utf8',
90
+ timeout: 30_000,
91
+ });
92
+ return importSparoWorktrees({
93
+ repositoryRoot,
94
+ homeDirectory,
95
+ environment,
96
+ sourceProviderStopped,
97
+ fs: createNodePlatform({ homeDirectory }).env(repositoryRoot),
98
+ git: {
99
+ async listWorktreePaths(cwd) {
100
+ return git(cwd, 'worktree', 'list', '--porcelain', '-z')
101
+ .split('\0')
102
+ .filter((field) => field.startsWith('worktree '))
103
+ .map((field) => field.slice('worktree '.length));
104
+ },
105
+ async currentBranch(cwd) {
106
+ return git(cwd, 'symbolic-ref', '--quiet', '--short', 'HEAD').trimEnd();
107
+ },
108
+ },
109
+ });
110
+ }
111
+ ```
112
+
113
+ Check `status`, `imported`, `duplicates`, `source` and `destination` before enabling po-git alone. `already-imported` means the completion marker exists; a rerun does not resurrect closed checkouts. `source-absent` imports nothing. A collision, malformed registry, wrong branch or unverifiable checkout (including Rift) refuses the import. Reconcile the evidence rather than forcing it. The old registry, worktree files and per-checkout engine state stay in place. If either provider has written since the backup, do not restore it over newer records.
114
+
30
115
  ## Package behavior
31
116
 
32
117
  ### Review this session's changes
@@ -53,31 +138,16 @@ The setup lives outside every repository in `~/.po/git/credentials.json` (folder
53
138
 
54
139
  ## Help
55
140
 
56
- The native server root registers `po-use-git` as a skill resource and the package index as Help-gated context. Guidance stays published under `src/prompts` and is not exported or copied into `dist`.
57
-
58
- ## Public API
59
-
60
- ```ts
61
- import { DefaultGitExtensionService } from '@agimon-ai/po-git';
62
- ```
63
-
64
- The service layer is host-neutral. The native session server root owns worktree operations, resources, hooks, and message-inbox disposal. Browser routes own presentation. Public symbols are forwarded through flat `src/exports` files.
141
+ The session registers `codemode-how-to-git` as a skill. The guide ships under `src/prompts`, indexed by `llms.txt`; it is not bundled into `dist`.
65
142
 
66
143
  ## Development
67
144
 
68
145
  ```bash
69
- pnpm build
70
- pnpm typecheck
71
- pnpm test
72
- pnpm lint
73
- pnpm exec vibe-lint check .
74
- npm pack --dry-run
146
+ pnpm exec nx run-many -t lint typecheck build test -p @agimon-ai/po-git
75
147
  ```
76
148
 
77
149
  Maintained by [Agimon](https://agimon.ai/about).
78
150
 
79
151
  ## License
80
152
 
81
- MIT
82
-
83
- Native routed declarations own commands, APIs, resources, hooks, and tools. Services own worktree operations and filesystem persistence. Session delivery is consumed through the fixed Session service; no terminal compatibility entry is published.
153
+ Functional Source License 1.1, MIT Future License (FSL-1.1-MIT): free for any purpose except a Competing Use; each version converts to MIT two years after release. See [LICENSE](LICENSE).
@@ -8,9 +8,11 @@ let typebox = require("typebox");
8
8
  const S = typebox.Type.String();
9
9
  const B = typebox.Type.Boolean();
10
10
  const O = typebox.Type.Optional;
11
+ const SparseProfileSchema = typebox.Type.String({ pattern: "^[A-Za-z0-9][A-Za-z0-9_-]*$" });
12
+ const SelectionSchema = typebox.Type.Object({ profile: typebox.Type.Union([S, typebox.Type.Null()]) });
11
13
  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
+ const WorktreeRecordSchema = typebox.Type.Object({
15
+ version: typebox.Type.Literal(2),
14
16
  id: S,
15
17
  branch: S,
16
18
  baseRef: S,
@@ -24,9 +26,35 @@ const RecordSchema = typebox.Type.Object({
24
26
  "closing",
25
27
  "orphaned"
26
28
  ]),
29
+ setupStage: O(literals([
30
+ "none",
31
+ "started",
32
+ "failed",
33
+ "unconfirmed"
34
+ ])),
35
+ backend: O(typebox.Type.Literal("rift")),
36
+ sparseProfile: O(SparseProfileSchema),
37
+ extraFolders: O(typebox.Type.Array(S)),
38
+ sparseFingerprint: O(S),
39
+ baseCommit: O(S),
40
+ workflow: O(typebox.Type.Object({
41
+ attemptId: S,
42
+ fingerprint: S,
43
+ state: literals([
44
+ "spawned",
45
+ "admitted",
46
+ "retained"
47
+ ]),
48
+ admissionId: O(S),
49
+ runId: O(S),
50
+ reason: O(S)
51
+ })),
27
52
  createdAt: S
28
53
  });
29
- const ErrorTargetSchema = typebox.Type.Union([typebox.Type.Object({ action: typebox.Type.Literal("create") }), typebox.Type.Object({
54
+ const ErrorTargetSchema = typebox.Type.Union([typebox.Type.Object({
55
+ action: typebox.Type.Literal("create"),
56
+ riftMissing: O(typebox.Type.Literal(true))
57
+ }), typebox.Type.Object({
30
58
  action: typebox.Type.Literal("close"),
31
59
  id: S
32
60
  })]);
@@ -171,7 +199,7 @@ const query = [{
171
199
  const apiContracts = (0, _agimon_ai_po_core_apiContracts.defineApiContract)({
172
200
  version: 1,
173
201
  dynamic: [],
174
- http: ["global", "workspace"].flatMap((scope) => [
202
+ http: ["host", "workspace"].flatMap((scope) => [
175
203
  {
176
204
  id: "git.list",
177
205
  scope,
@@ -184,7 +212,7 @@ const apiContracts = (0, _agimon_ai_po_core_apiContracts.defineApiContract)({
184
212
  ...item,
185
213
  required: item.name === "repositoryId"
186
214
  })),
187
- responses: (0, _agimon_ai_po_core_apiContracts.jsonApiResponses)(typebox.Type.Object({ worktrees: typebox.Type.Array(RecordSchema) }))
215
+ responses: (0, _agimon_ai_po_core_apiContracts.jsonApiResponses)(typebox.Type.Object({ worktrees: typebox.Type.Array(WorktreeRecordSchema) }))
188
216
  },
189
217
  {
190
218
  id: "git.create",
@@ -201,10 +229,12 @@ const apiContracts = (0, _agimon_ai_po_core_apiContracts.defineApiContract)({
201
229
  schema: typebox.Type.Object({
202
230
  branch: typebox.Type.String({ minLength: 1 }),
203
231
  baseRef: O(S),
204
- name: O(S)
232
+ name: O(S),
233
+ sparseProfile: O(SparseProfileSchema),
234
+ selection: O(SelectionSchema)
205
235
  })
206
236
  },
207
- responses: (0, _agimon_ai_po_core_apiContracts.jsonApiResponses)(typebox.Type.Object({ worktree: RecordSchema }), 201)
237
+ responses: (0, _agimon_ai_po_core_apiContracts.jsonApiResponses)(typebox.Type.Object({ worktree: WorktreeRecordSchema }), 201)
208
238
  },
209
239
  {
210
240
  id: "git.close",
@@ -220,7 +250,7 @@ const apiContracts = (0, _agimon_ai_po_core_apiContracts.defineApiContract)({
220
250
  required: false,
221
251
  schema: B
222
252
  }],
223
- responses: (0, _agimon_ai_po_core_apiContracts.jsonApiResponses)(typebox.Type.Object({ worktree: RecordSchema }))
253
+ responses: (0, _agimon_ai_po_core_apiContracts.jsonApiResponses)(typebox.Type.Object({ worktree: WorktreeRecordSchema }))
224
254
  },
225
255
  ...scope === "workspace" ? [
226
256
  {
@@ -272,6 +302,8 @@ const apiContracts = (0, _agimon_ai_po_core_apiContracts.defineApiContract)({
272
302
  repository: B,
273
303
  current: O(S),
274
304
  defaultBase: O(S),
305
+ sparseProfiles: O(typebox.Type.Array(S)),
306
+ defaultSparseProfile: O(S),
275
307
  local: typebox.Type.Array(typebox.Type.Object({
276
308
  name: S,
277
309
  checkedOutAt: O(S)
@@ -282,6 +314,36 @@ const apiContracts = (0, _agimon_ai_po_core_apiContracts.defineApiContract)({
282
314
  }))
283
315
  }))
284
316
  },
317
+ {
318
+ id: "git.branches.delete",
319
+ scope,
320
+ basePath: "git",
321
+ path: "/branches",
322
+ method: "DELETE",
323
+ authentication: "owner",
324
+ description: "Safely delete a local branch that is not checked out. Never force-deletes unmerged work.",
325
+ body: {
326
+ required: true,
327
+ contentType: "application/json",
328
+ schema: typebox.Type.Object({ branch: S })
329
+ },
330
+ responses: (0, _agimon_ai_po_core_apiContracts.jsonApiResponses)(typebox.Type.Object({ deleted: B }))
331
+ },
332
+ {
333
+ id: "git.branches.open",
334
+ scope,
335
+ basePath: "git",
336
+ path: "/branches/open",
337
+ method: "POST",
338
+ authentication: "owner",
339
+ description: "Open the branch checkout in Finder. Local callers only, no client-supplied path.",
340
+ body: {
341
+ required: true,
342
+ contentType: "application/json",
343
+ schema: typebox.Type.Object({ branch: S })
344
+ },
345
+ responses: (0, _agimon_ai_po_core_apiContracts.jsonApiResponses)(typebox.Type.Object({ opened: B }))
346
+ },
285
347
  {
286
348
  id: "git.sessions.create",
287
349
  scope,
@@ -297,12 +359,16 @@ const apiContracts = (0, _agimon_ai_po_core_apiContracts.defineApiContract)({
297
359
  mode: typebox.Type.Literal("existing-branch"),
298
360
  branch: S,
299
361
  remote: O(S),
300
- name: O(S)
362
+ name: O(S),
363
+ sparseProfile: O(SparseProfileSchema),
364
+ selection: O(SelectionSchema)
301
365
  }), typebox.Type.Object({
302
366
  mode: typebox.Type.Literal("new-branch"),
303
367
  branch: S,
304
368
  baseRef: O(S),
305
- name: O(S)
369
+ name: O(S),
370
+ sparseProfile: O(SparseProfileSchema),
371
+ selection: O(SelectionSchema)
306
372
  })])
307
373
  },
308
374
  responses: (0, _agimon_ai_po_core_apiContracts.jsonApiResponses)(typebox.Type.Object({
@@ -311,7 +377,7 @@ const apiContracts = (0, _agimon_ai_po_core_apiContracts.defineApiContract)({
311
377
  }), 201)
312
378
  }
313
379
  ] : [],
314
- ...scope === "global" ? [{
380
+ ...scope === "host" ? [{
315
381
  id: "git.review.summary",
316
382
  scope: "session",
317
383
  basePath: "git",
@@ -337,7 +403,7 @@ const apiContracts = (0, _agimon_ai_po_core_apiContracts.defineApiContract)({
337
403
  responses: (0, _agimon_ai_po_core_apiContracts.jsonApiResponses)(ReviewFileSchema)
338
404
  }] : []
339
405
  ]),
340
- sockets: ["global", "workspace"].flatMap((scope) => [
406
+ sockets: ["host", "workspace"].flatMap((scope) => [
341
407
  {
342
408
  id: "git.changes.channel",
343
409
  scope,
@@ -1 +1 @@
1
- {"version":3,"file":"apiContracts.cjs","names":["Type","defineApiContract","jsonApiResponses"],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract, jsonApiResponses } from '@agimon-ai/po-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: 'po.hub',\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: 'po.hub',\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: 'po.hub',\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: 'po.hub',\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,OAAO;CAChD,WAAWA,QAAAA,KAAK,MACdA,QAAAA,KAAK,OAAO;EAAE,IAAI;EAAG,QAAQ;EAAG,MAAM;EAAG,WAAWA,QAAAA,KAAK,MAAM,CAAC,GAAGA,QAAAA,KAAK,KAAK,CAAC,CAAC;EAAG,UAAU;EAAG,SAAS;CAAE,CAAC,CAC7G;CACA,SAAS,EAAE,CAAC;CACZ,OAAO,EAAE,CAAC;CACV,aAAa,EAAE,iBAAiB;AAClC,CAAC;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AAS,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"}
1
+ {"version":3,"file":"apiContracts.cjs","names":["Type","defineApiContract","jsonApiResponses"],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract, jsonApiResponses } from '@agimon-ai/po-core/apiContracts';\nimport { Type } from 'typebox';\n\nconst S = Type.String();\nconst B = Type.Boolean();\nconst O = Type.Optional;\nconst SparseProfileSchema = Type.String({ pattern: '^[A-Za-z0-9][A-Za-z0-9_-]*$' });\nconst SelectionSchema = Type.Object({ profile: Type.Union([S, Type.Null()]) });\nconst literals = <T extends string>(values: T[]) => Type.Union(values.map((value) => Type.Literal(value)));\nexport const WorktreeRecordSchema = Type.Object({\n version: Type.Literal(2),\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 setupStage: O(literals(['none', 'started', 'failed', 'unconfirmed'])),\n backend: O(Type.Literal('rift')),\n sparseProfile: O(SparseProfileSchema),\n extraFolders: O(Type.Array(S)),\n sparseFingerprint: O(S),\n baseCommit: O(S),\n workflow: O(\n Type.Object({\n attemptId: S,\n fingerprint: S,\n state: literals(['spawned', 'admitted', 'retained']),\n admissionId: O(S),\n runId: O(S),\n reason: O(S),\n }),\n ),\n createdAt: S,\n});\nconst ErrorTargetSchema = Type.Union([\n Type.Object({ action: Type.Literal('create'), riftMissing: O(Type.Literal(true)) }),\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: (['host', '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(WorktreeRecordSchema) })),\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({\n branch: Type.String({ minLength: 1 }),\n baseRef: O(S),\n name: O(S),\n sparseProfile: O(SparseProfileSchema),\n selection: O(SelectionSchema),\n }),\n },\n responses: jsonApiResponses(Type.Object({ worktree: WorktreeRecordSchema }), 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: WorktreeRecordSchema })),\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 sparseProfiles: O(Type.Array(S)),\n defaultSparseProfile: 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.branches.delete',\n scope,\n basePath: 'git',\n path: '/branches',\n method: 'DELETE' as const,\n authentication: 'owner' as const,\n description: 'Safely delete a local branch that is not checked out. Never force-deletes unmerged work.',\n body: { required: true, contentType: 'application/json', schema: Type.Object({ branch: S }) },\n responses: jsonApiResponses(Type.Object({ deleted: B })),\n },\n {\n id: 'git.branches.open',\n scope,\n basePath: 'git',\n path: '/branches/open',\n method: 'POST' as const,\n authentication: 'owner' as const,\n description: 'Open the branch checkout in Finder. Local callers only, no client-supplied path.',\n body: { required: true, contentType: 'application/json', schema: Type.Object({ branch: S }) },\n responses: jsonApiResponses(Type.Object({ opened: B })),\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({\n mode: Type.Literal('existing-branch'),\n branch: S,\n remote: O(S),\n name: O(S),\n sparseProfile: O(SparseProfileSchema),\n selection: O(SelectionSchema),\n }),\n Type.Object({\n mode: Type.Literal('new-branch'),\n branch: S,\n baseRef: O(S),\n name: O(S),\n sparseProfile: O(SparseProfileSchema),\n selection: O(SelectionSchema),\n }),\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 host entries.\n ...(scope === 'host'\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: (['host', 'workspace'] as const).flatMap((scope) => [\n {\n id: 'git.changes.channel',\n scope,\n service: 'po.hub',\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: 'po.hub',\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: 'po.hub',\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: 'po.hub',\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,sBAAsBA,QAAAA,KAAK,OAAO,EAAE,SAAS,8BAA8B,CAAC;AAClF,MAAM,kBAAkBA,QAAAA,KAAK,OAAO,EAAE,SAASA,QAAAA,KAAK,MAAM,CAAC,GAAGA,QAAAA,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;AAC7E,MAAM,YAA8B,WAAgBA,QAAAA,KAAK,MAAM,OAAO,KAAK,UAAUA,QAAAA,KAAK,QAAQ,KAAK,CAAC,CAAC;AACzG,MAAa,uBAAuBA,QAAAA,KAAK,OAAO;CAC9C,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,YAAY,EAAE,SAAS;EAAC;EAAQ;EAAW;EAAU;CAAa,CAAC,CAAC;CACpE,SAAS,EAAEA,QAAAA,KAAK,QAAQ,MAAM,CAAC;CAC/B,eAAe,EAAE,mBAAmB;CACpC,cAAc,EAAEA,QAAAA,KAAK,MAAM,CAAC,CAAC;CAC7B,mBAAmB,EAAE,CAAC;CACtB,YAAY,EAAE,CAAC;CACf,UAAU,EACRA,QAAAA,KAAK,OAAO;EACV,WAAW;EACX,aAAa;EACb,OAAO,SAAS;GAAC;GAAW;GAAY;EAAU,CAAC;EACnD,aAAa,EAAE,CAAC;EAChB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,YAAY,CAAC;IAAE,MAAM;IAAQ,IAAI;IAAkB,UAAU;IAAM,QAAQF,QAAAA,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;GAAE,CAAC;GAC1G,YAAA,GAAWE,gCAAAA,iBAAAA,CAAiB,gBAAgB;EAC9C,CACF,IACA,CAAC;CACP,CAAC;CACD,SAAU,CAAC,QAAQ,WAAW,CAAC,CAAW,SAAS,UAAU;EAC3D;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"}
@@ -6,7 +6,7 @@ export declare const apiContracts: {
6
6
  schemas?: Record<string, boolean | object> | undefined;
7
7
  http: {
8
8
  id: string;
9
- scope: "global" | "session" | "workspace";
9
+ scope: "host" | "session" | "workspace";
10
10
  basePath?: string | undefined;
11
11
  path: string;
12
12
  method: "DELETE" | "GET" | "HEAD" | "OPTIONS" | "PATCH" | "POST" | "PUT";
@@ -34,7 +34,7 @@ export declare const apiContracts: {
34
34
  }[];
35
35
  sockets: {
36
36
  id: string;
37
- scope: "global" | "session" | "workspace";
37
+ scope: "host" | "session" | "workspace";
38
38
  description: string;
39
39
  availability?: string | undefined;
40
40
  service: string;
@@ -1 +1 @@
1
- {"version":3,"file":"apiContracts.d.mts","names":[],"sources":["../src/schemas/apiContracts.ts"],"mappings":";;qBAsGa"}
1
+ {"version":3,"file":"apiContracts.d.mts","names":[],"sources":["../src/schemas/apiContracts.ts"],"mappings":";;qBAwHa"}