@intentic/sandbox-contract 1.226.0 → 1.226.1

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 (165) hide show
  1. package/dist/contracts/activity.contract.d.ts.map +1 -1
  2. package/dist/contracts/activity.contract.js +17 -2
  3. package/dist/contracts/activity.contract.js.map +1 -1
  4. package/dist/contracts/agent.contract.d.ts.map +1 -1
  5. package/dist/contracts/agent.contract.js +71 -8
  6. package/dist/contracts/agent.contract.js.map +1 -1
  7. package/dist/contracts/agents.contract.d.ts +1 -0
  8. package/dist/contracts/agents.contract.d.ts.map +1 -1
  9. package/dist/contracts/agents.contract.js +164 -19
  10. package/dist/contracts/agents.contract.js.map +1 -1
  11. package/dist/contracts/automations.contract.d.ts.map +1 -1
  12. package/dist/contracts/automations.contract.js +78 -9
  13. package/dist/contracts/automations.contract.js.map +1 -1
  14. package/dist/contracts/capabilities.contract.d.ts.map +1 -1
  15. package/dist/contracts/capabilities.contract.js +98 -11
  16. package/dist/contracts/capabilities.contract.js.map +1 -1
  17. package/dist/contracts/chores.contract.d.ts.map +1 -1
  18. package/dist/contracts/chores.contract.js +26 -3
  19. package/dist/contracts/chores.contract.js.map +1 -1
  20. package/dist/contracts/ci.contract.d.ts.map +1 -1
  21. package/dist/contracts/ci.contract.js +52 -6
  22. package/dist/contracts/ci.contract.js.map +1 -1
  23. package/dist/contracts/claude.contract.d.ts.map +1 -1
  24. package/dist/contracts/claude.contract.js +44 -5
  25. package/dist/contracts/claude.contract.js.map +1 -1
  26. package/dist/contracts/drafts.contract.d.ts.map +1 -1
  27. package/dist/contracts/drafts.contract.js +26 -3
  28. package/dist/contracts/drafts.contract.js.map +1 -1
  29. package/dist/contracts/endpoints.contract.d.ts.map +1 -1
  30. package/dist/contracts/endpoints.contract.js +17 -2
  31. package/dist/contracts/endpoints.contract.js.map +1 -1
  32. package/dist/contracts/exit.contract.d.ts.map +1 -1
  33. package/dist/contracts/exit.contract.js +62 -7
  34. package/dist/contracts/exit.contract.js.map +1 -1
  35. package/dist/contracts/extensions.contract.d.ts.map +1 -1
  36. package/dist/contracts/extensions.contract.js +124 -15
  37. package/dist/contracts/extensions.contract.js.map +1 -1
  38. package/dist/contracts/git.contract.d.ts.map +1 -1
  39. package/dist/contracts/git.contract.js +384 -43
  40. package/dist/contracts/git.contract.js.map +1 -1
  41. package/dist/contracts/grok.contract.d.ts.map +1 -1
  42. package/dist/contracts/grok.contract.js +25 -3
  43. package/dist/contracts/grok.contract.js.map +1 -1
  44. package/dist/contracts/history.contract.d.ts.map +1 -1
  45. package/dist/contracts/history.contract.js +35 -4
  46. package/dist/contracts/history.contract.js.map +1 -1
  47. package/dist/contracts/intentic.contract.d.ts.map +1 -1
  48. package/dist/contracts/intentic.contract.js +25 -3
  49. package/dist/contracts/intentic.contract.js.map +1 -1
  50. package/dist/contracts/inventory.contract.d.ts.map +1 -1
  51. package/dist/contracts/inventory.contract.js +26 -3
  52. package/dist/contracts/inventory.contract.js.map +1 -1
  53. package/dist/contracts/logs.contract.d.ts.map +1 -1
  54. package/dist/contracts/logs.contract.js +17 -2
  55. package/dist/contracts/logs.contract.js.map +1 -1
  56. package/dist/contracts/loops.contract.d.ts.map +1 -1
  57. package/dist/contracts/loops.contract.js +52 -6
  58. package/dist/contracts/loops.contract.js.map +1 -1
  59. package/dist/contracts/panels.contract.d.ts.map +1 -1
  60. package/dist/contracts/panels.contract.js +26 -3
  61. package/dist/contracts/panels.contract.js.map +1 -1
  62. package/dist/contracts/personas.contract.d.ts.map +1 -1
  63. package/dist/contracts/personas.contract.js +71 -8
  64. package/dist/contracts/personas.contract.js.map +1 -1
  65. package/dist/contracts/ports.contract.d.ts.map +1 -1
  66. package/dist/contracts/ports.contract.js +26 -3
  67. package/dist/contracts/ports.contract.js.map +1 -1
  68. package/dist/contracts/prepush.contract.d.ts.map +1 -1
  69. package/dist/contracts/prepush.contract.js +24 -3
  70. package/dist/contracts/prepush.contract.js.map +1 -1
  71. package/dist/contracts/providers.contract.d.ts.map +1 -1
  72. package/dist/contracts/providers.contract.js +9 -1
  73. package/dist/contracts/providers.contract.js.map +1 -1
  74. package/dist/contracts/public.contract.d.ts.map +1 -1
  75. package/dist/contracts/public.contract.js +26 -3
  76. package/dist/contracts/public.contract.js.map +1 -1
  77. package/dist/contracts/push.contract.d.ts.map +1 -1
  78. package/dist/contracts/push.contract.js +35 -4
  79. package/dist/contracts/push.contract.js.map +1 -1
  80. package/dist/contracts/secrets.contract.d.ts.map +1 -1
  81. package/dist/contracts/secrets.contract.js +43 -5
  82. package/dist/contracts/secrets.contract.js.map +1 -1
  83. package/dist/contracts/sessions.contract.d.ts.map +1 -1
  84. package/dist/contracts/sessions.contract.js +15 -2
  85. package/dist/contracts/sessions.contract.js.map +1 -1
  86. package/dist/contracts/settings.contract.d.ts.map +1 -1
  87. package/dist/contracts/settings.contract.js +43 -5
  88. package/dist/contracts/settings.contract.js.map +1 -1
  89. package/dist/contracts/share.contract.d.ts.map +1 -1
  90. package/dist/contracts/share.contract.js +35 -4
  91. package/dist/contracts/share.contract.js.map +1 -1
  92. package/dist/contracts/skills.contract.d.ts.map +1 -1
  93. package/dist/contracts/skills.contract.js +35 -4
  94. package/dist/contracts/skills.contract.js.map +1 -1
  95. package/dist/contracts/system.contract.d.ts.map +1 -1
  96. package/dist/contracts/system.contract.js +107 -14
  97. package/dist/contracts/system.contract.js.map +1 -1
  98. package/dist/contracts/translator.contract.d.ts.map +1 -1
  99. package/dist/contracts/translator.contract.js +29 -4
  100. package/dist/contracts/translator.contract.js.map +1 -1
  101. package/dist/contracts/usage.contract.d.ts.map +1 -1
  102. package/dist/contracts/usage.contract.js +9 -1
  103. package/dist/contracts/usage.contract.js.map +1 -1
  104. package/dist/contracts/vpn.contract.d.ts.map +1 -1
  105. package/dist/contracts/vpn.contract.js +32 -4
  106. package/dist/contracts/vpn.contract.js.map +1 -1
  107. package/dist/contracts/workflows.contract.d.ts.map +1 -1
  108. package/dist/contracts/workflows.contract.js +70 -8
  109. package/dist/contracts/workflows.contract.js.map +1 -1
  110. package/dist/contracts/workspace.contract.d.ts.map +1 -1
  111. package/dist/contracts/workspace.contract.js +216 -25
  112. package/dist/contracts/workspace.contract.js.map +1 -1
  113. package/dist/events.d.ts.map +1 -1
  114. package/dist/events.js +179 -88
  115. package/dist/events.js.map +1 -1
  116. package/dist/history-state.d.ts.map +1 -1
  117. package/dist/history-state.js +1 -0
  118. package/dist/history-state.js.map +1 -1
  119. package/dist/index.d.ts +1 -0
  120. package/dist/index.d.ts.map +1 -1
  121. package/dist/schemas.d.ts +1 -0
  122. package/dist/schemas.d.ts.map +1 -1
  123. package/dist/schemas.js +2856 -1276
  124. package/dist/schemas.js.map +1 -1
  125. package/package.json +4 -4
  126. package/src/contracts/activity.contract.ts +18 -2
  127. package/src/contracts/agent.contract.ts +78 -8
  128. package/src/contracts/agents.contract.ts +180 -19
  129. package/src/contracts/automations.contract.ts +80 -9
  130. package/src/contracts/capabilities.contract.ts +106 -11
  131. package/src/contracts/chores.contract.ts +29 -3
  132. package/src/contracts/ci.contract.ts +55 -6
  133. package/src/contracts/claude.contract.ts +47 -5
  134. package/src/contracts/drafts.contract.ts +26 -3
  135. package/src/contracts/endpoints.contract.ts +19 -2
  136. package/src/contracts/exit.contract.ts +69 -7
  137. package/src/contracts/extensions.contract.ts +134 -15
  138. package/src/contracts/git.contract.ts +421 -43
  139. package/src/contracts/grok.contract.ts +26 -3
  140. package/src/contracts/history.contract.ts +37 -4
  141. package/src/contracts/intentic.contract.ts +28 -3
  142. package/src/contracts/inventory.contract.ts +27 -3
  143. package/src/contracts/logs.contract.ts +18 -2
  144. package/src/contracts/loops.contract.ts +58 -6
  145. package/src/contracts/panels.contract.ts +26 -3
  146. package/src/contracts/personas.contract.ts +77 -8
  147. package/src/contracts/ports.contract.ts +27 -3
  148. package/src/contracts/prepush.contract.ts +26 -3
  149. package/src/contracts/providers.contract.ts +10 -1
  150. package/src/contracts/public.contract.ts +29 -3
  151. package/src/contracts/push.contract.ts +37 -4
  152. package/src/contracts/secrets.contract.ts +46 -5
  153. package/src/contracts/sessions.contract.ts +16 -2
  154. package/src/contracts/settings.contract.ts +46 -5
  155. package/src/contracts/share.contract.ts +37 -4
  156. package/src/contracts/skills.contract.ts +39 -4
  157. package/src/contracts/system.contract.ts +119 -14
  158. package/src/contracts/translator.contract.ts +32 -4
  159. package/src/contracts/usage.contract.ts +10 -1
  160. package/src/contracts/vpn.contract.ts +35 -4
  161. package/src/contracts/workflows.contract.ts +77 -8
  162. package/src/contracts/workspace.contract.ts +231 -25
  163. package/src/events.ts +207 -88
  164. package/src/history-state.ts +6 -0
  165. package/src/schemas.ts +3506 -1260
@@ -1,29 +1,138 @@
1
1
  import { oc } from "@orpc/contract";
2
2
  import { CapabilityIdParamSchema, ExtensionEnabledInputSchema, ExtensionProcessParamSchema, ExtensionProcessStatusSchema, ExtensionSettingsInputSchema, ExtensionSettingsSchema, ExtensionReadinessSchema, ExtensionUpdateActionSchema, ExtensionUpdateAppliedSchema, ExtensionUpdatePolicyInputSchema, ExtensionUpdatePreviewSchema, ExtensionUpdatesCheckedSchema, ExtensionUsageInputSchema, ExtensionsListSchema, OkSchema, WorkspaceExtensionCreatedSchema, WorkspaceExtensionCreateSchema, } from "../schemas.js";
3
3
  export const extensionsContract = {
4
- list: oc.route({ method: "GET", path: "/extensions" }).output(ExtensionsListSchema),
5
- create: oc.route({ method: "POST", path: "/extensions/workspace" }).input(WorkspaceExtensionCreateSchema).output(WorkspaceExtensionCreatedSchema),
6
- settings: oc.route({ method: "GET", path: "/extensions/{id}/settings" }).input(CapabilityIdParamSchema).output(ExtensionSettingsSchema),
7
- setSettings: oc.route({ method: "POST", path: "/extensions/{id}/settings" }).input(ExtensionSettingsInputSchema).output(OkSchema),
8
- setEnabled: oc.route({ method: "POST", path: "/extensions/{id}/enabled" }).input(ExtensionEnabledInputSchema).output(OkSchema),
9
- recordUsage: oc.route({ method: "POST", path: "/extensions/{id}/usage" }).input(ExtensionUsageInputSchema).output(OkSchema),
10
- readiness: oc.route({ method: "GET", path: "/extensions/{id}/readiness" }).input(CapabilityIdParamSchema).output(ExtensionReadinessSchema),
11
- checkUpdates: oc.route({ method: "POST", path: "/extensions/updates/check" }).output(ExtensionUpdatesCheckedSchema),
4
+ list: oc
5
+ .route({
6
+ method: "GET",
7
+ path: "/extensions",
8
+ summary: "Installed extensions",
9
+ description: "Every extension installed here, resolved to the manifest the owner approved, which is what the app boots its extension host from. The code itself is served separately, because raw script bytes are not a JSON answer.",
10
+ })
11
+ .output(ExtensionsListSchema),
12
+ create: oc
13
+ .route({
14
+ method: "POST",
15
+ path: "/extensions/workspace",
16
+ summary: "Write a new extension in place",
17
+ description: "Scaffolds a working extension into this workspace and installs it. The only call here that creates one, and it exists because that folder is otherwise reachable only through an agent's file tools, which is a fine way to change an extension and a poor way to meet the idea of one.",
18
+ })
19
+ .input(WorkspaceExtensionCreateSchema)
20
+ .output(WorkspaceExtensionCreatedSchema),
21
+ settings: oc
22
+ .route({
23
+ method: "GET",
24
+ path: "/extensions/{id}/settings",
25
+ summary: "An extension's settings",
26
+ description: "The current values for the settings this extension declared it has.",
27
+ })
28
+ .input(CapabilityIdParamSchema)
29
+ .output(ExtensionSettingsSchema),
30
+ setSettings: oc
31
+ .route({
32
+ method: "POST",
33
+ path: "/extensions/{id}/settings",
34
+ summary: "Change an extension's settings",
35
+ description: "Writes new values. A key the extension never declared is refused rather than quietly stored, the same honesty rule that governs everything else an extension claims.",
36
+ })
37
+ .input(ExtensionSettingsInputSchema)
38
+ .output(OkSchema),
39
+ setEnabled: oc
40
+ .route({
41
+ method: "POST",
42
+ path: "/extensions/{id}/enabled",
43
+ summary: "Turn an extension on or off",
44
+ description: "The owner's switch. Turning one off stops its background processes at once. What it contributes to an agent's tools is rebuilt at the start of the next turn, and anything it adds to the sandbox image only at the next rebuild.",
45
+ })
46
+ .input(ExtensionEnabledInputSchema)
47
+ .output(OkSchema),
48
+ recordUsage: oc
49
+ .route({
50
+ method: "POST",
51
+ path: "/extensions/{id}/usage",
52
+ summary: "Record what an extension just used",
53
+ description: "Written by the app rather than measured by the daemon, because the permission gate runs in the browser: from the sandbox's side an extension's traffic is indistinguishable from anyone else's. This is how the record of which powers an extension actually exercises gets kept.",
54
+ })
55
+ .input(ExtensionUsageInputSchema)
56
+ .output(OkSchema),
57
+ readiness: oc
58
+ .route({
59
+ method: "GET",
60
+ path: "/extensions/{id}/readiness",
61
+ summary: "Whether an extension is fit to share",
62
+ description: "The checks that can be answered from an extension's own files, for an author about to publish. Read on demand rather than carried on the list, because it reads the code off disk each time.",
63
+ })
64
+ .input(CapabilityIdParamSchema)
65
+ .output(ExtensionReadinessSchema),
66
+ checkUpdates: oc
67
+ .route({
68
+ method: "POST",
69
+ path: "/extensions/updates/check",
70
+ summary: "Look for extension updates now",
71
+ description: "Compares every installed extension against its source and reports what is newer, what carries an advisory and what looks unhealthy. This also happens on a schedule; call it to check on demand.",
72
+ })
73
+ .output(ExtensionUpdatesCheckedSchema),
12
74
  updatePreview: oc
13
- .route({ method: "POST", path: "/extensions/{id}/update/preview" })
75
+ .route({
76
+ method: "POST",
77
+ path: "/extensions/{id}/update/preview",
78
+ summary: "What an update would change",
79
+ description: "The read before the click: which versions are involved and exactly which powers the new code asks for that the running one does not. Costs one throwaway copy of the source, the same as browsing a registry entry.",
80
+ })
14
81
  .input(ExtensionUpdateActionSchema)
15
82
  .output(ExtensionUpdatePreviewSchema),
16
83
  applyUpdate: oc
17
- .route({ method: "POST", path: "/extensions/{id}/update" })
84
+ .route({
85
+ method: "POST",
86
+ path: "/extensions/{id}/update",
87
+ summary: "Update an extension",
88
+ description: "The whole swap as one transaction: fetch, check, quiet the running one, replace it while keeping the outgoing copy one step back, restart and watch it come up. The existing configuration is kept, so a token for a private source survives what removing and re-adding would lose. Owner only, because it changes what code runs.",
89
+ })
18
90
  .input(ExtensionUpdateActionSchema)
19
91
  .output(ExtensionUpdateAppliedSchema),
20
- revert: oc.route({ method: "POST", path: "/extensions/{id}/revert" }).input(CapabilityIdParamSchema).output(ExtensionUpdateAppliedSchema),
21
- setUpdatePolicy: oc.route({ method: "POST", path: "/extensions/{id}/update-policy" }).input(ExtensionUpdatePolicyInputSchema).output(OkSchema),
92
+ revert: oc
93
+ .route({
94
+ method: "POST",
95
+ path: "/extensions/{id}/revert",
96
+ summary: "Go back to the previous version",
97
+ description: "Swaps the copy kept from before the last update back into place. Owner only, for the same reason updating is.",
98
+ })
99
+ .input(CapabilityIdParamSchema)
100
+ .output(ExtensionUpdateAppliedSchema),
101
+ setUpdatePolicy: oc
102
+ .route({
103
+ method: "POST",
104
+ path: "/extensions/{id}/update-policy",
105
+ summary: "How an extension should handle its own updates",
106
+ description: "The owner's standing answer for one extension: tell me, have an agent look at it, or just do it. Security advisories can be opted out of separately.",
107
+ })
108
+ .input(ExtensionUpdatePolicyInputSchema)
109
+ .output(OkSchema),
22
110
  processStatus: oc
23
- .route({ method: "GET", path: "/extensions/{id}/processes/{name}" })
111
+ .route({
112
+ method: "GET",
113
+ path: "/extensions/{id}/processes/{name}",
114
+ summary: "Whether an extension's background process is up",
115
+ description: "The state of one process an extension declared, with the port it was given and its preview address if it has one.",
116
+ })
24
117
  .input(ExtensionProcessParamSchema)
25
118
  .output(ExtensionProcessStatusSchema),
26
- processStart: oc.route({ method: "POST", path: "/extensions/{id}/processes/{name}/start" }).input(ExtensionProcessParamSchema).output(OkSchema),
27
- processStop: oc.route({ method: "POST", path: "/extensions/{id}/processes/{name}/stop" }).input(ExtensionProcessParamSchema).output(OkSchema),
119
+ processStart: oc
120
+ .route({
121
+ method: "POST",
122
+ path: "/extensions/{id}/processes/{name}/start",
123
+ summary: "Start an extension's background process",
124
+ description: "Brings one of an extension's declared processes up in an attachable terminal.",
125
+ })
126
+ .input(ExtensionProcessParamSchema)
127
+ .output(OkSchema),
128
+ processStop: oc
129
+ .route({
130
+ method: "POST",
131
+ path: "/extensions/{id}/processes/{name}/stop",
132
+ summary: "Stop an extension's background process",
133
+ description: "Shuts one of an extension's declared processes down and frees its port.",
134
+ })
135
+ .input(ExtensionProcessParamSchema)
136
+ .output(OkSchema),
28
137
  };
29
138
  //# sourceMappingURL=extensions.contract.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"extensions.contract.js","sourceRoot":"","sources":["../../src/contracts/extensions.contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EACH,uBAAuB,EACvB,2BAA2B,EAC3B,2BAA2B,EAC3B,4BAA4B,EAC5B,4BAA4B,EAC5B,uBAAuB,EACvB,wBAAwB,EACxB,2BAA2B,EAC3B,4BAA4B,EAC5B,gCAAgC,EAChC,4BAA4B,EAC5B,6BAA6B,EAC7B,yBAAyB,EACzB,oBAAoB,EACpB,QAAQ,EACR,+BAA+B,EAC/B,8BAA8B,GACjC,MAAM,eAAe,CAAC;AAMvB,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAC9B,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,CAAC,MAAM,CAAC,oBAAoB,CAAC;IAInF,MAAM,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,CAAC,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC,MAAM,CAAC,+BAA+B,CAAC;IACjJ,QAAQ,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,2BAA2B,EAAE,CAAC,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC,MAAM,CAAC,uBAAuB,CAAC;IACvI,WAAW,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,2BAA2B,EAAE,CAAC,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC,MAAM,CAAC,Q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;;;;;;;IAUP,QAAQ;;;;;;;IAUR,UAAU;;;;;;;IAUV,MAAM;;;;;;;IAUN,IAAI;;;;;;;IAUJ,KAAK;;;;;;;IAUL,MAAM;;;;;;;IAUN,KAAK;;;;;;;;;;;;IAUL,QAAQ;;;;;;;;;;;;;;IAUR,MAAM;;;;;;;IAUN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAUN,OAAO;;;;;;IAYP,KAAK;;;;;;IASL,OAAO;;;;;;IAYP,QAAQ;;;;;;;;;;;;;;;;;;;IAUR,cAAc;;;;;;;;IAUd,YAAY;;;;;;;IAaZ,MAAM;;;;;;;;;IAUN,KAAK;;;;;;IAUL,IAAI;;;;;;IAUJ,IAAI;;;;;;;IAUJ,KAAK;;;;;IAUL,QAAQ;;;;;;;IASR,SAAS;;;;;;;IAaT,WAAW;;;;;;;;;;;;;;CAUd,CAAC"}
@@ -1,48 +1,389 @@
1
1
  import { oc } from "@orpc/contract";
2
2
  import { CommitResultSchema, CommitSchema, DiscardSchema, FileDiffSchema, GitActionResultSchema, GitBranchCreateAtSchema, GitBranchCreateSchema, GitBranchDeleteSchema, GitBranchesSchema, GitChangesSchema, GitCheckoutSchema, GitCommitActionSchema, GitCommitDiffQuerySchema, GitCommitDiffSchema, GitCommitFileDiffQuerySchema, GitFileDiffQuerySchema, GitFileQuerySchema, GitFileSchema, GitFilesSchema, GitFileWriteSchema, GitLogQuerySchema, GitLogSchema, GitOperationStateSchema, GitPublishFileResultSchema, GitPublishFileSchema, GitUndoSchema, GitUndoStateSchema, GitRemoteReposSchema, GitRemoteStateSchema, GitReposSchema, GitResetSchema, GitStageSchema, GitStatusSchema, GitTagCreateSchema, GitTagDeleteSchema, GitTagPushSchema, OkSchema, PushSchema, RepoParamSchema, StashApplySchema, StashDiffQuerySchema, StashListSchema, StashPushSchema, StashRefParamSchema, } from "../schemas.js";
3
3
  export const gitContract = {
4
- changes: oc.route({ method: "GET", path: "/git/changes" }).output(GitChangesSchema),
5
- repos: oc.route({ method: "GET", path: "/git/repos" }).output(GitReposSchema),
6
- remoteRepos: oc.route({ method: "GET", path: "/git/remote-repos" }).output(GitRemoteReposSchema),
7
- log: oc.route({ method: "GET", path: "/git/{repo}/log" }).input(GitLogQuerySchema).output(GitLogSchema),
8
- commitDiff: oc.route({ method: "GET", path: "/git/{repo}/commit-diff" }).input(GitCommitDiffQuerySchema).output(GitCommitDiffSchema),
9
- commitFileDiff: oc.route({ method: "GET", path: "/git/{repo}/commit-file-diff" }).input(GitCommitFileDiffQuerySchema).output(FileDiffSchema),
10
- operation: oc.route({ method: "GET", path: "/git/{repo}/operation" }).input(RepoParamSchema).output(GitOperationStateSchema),
11
- abort: oc.route({ method: "POST", path: "/git/{repo}/abort" }).input(RepoParamSchema).output(GitActionResultSchema),
12
- undoable: oc.route({ method: "GET", path: "/git/{repo}/undo" }).input(RepoParamSchema).output(GitUndoStateSchema),
13
- undo: oc.route({ method: "POST", path: "/git/{repo}/undo" }).input(GitUndoSchema).output(GitActionResultSchema),
14
- stashes: oc.route({ method: "GET", path: "/git/{repo}/stashes" }).input(RepoParamSchema).output(StashListSchema),
15
- stashDiff: oc.route({ method: "GET", path: "/git/{repo}/stash-diff" }).input(StashDiffQuerySchema).output(GitCommitDiffSchema),
16
- stashPush: oc.route({ method: "POST", path: "/git/{repo}/stash" }).input(StashPushSchema).output(GitActionResultSchema),
17
- stashApply: oc.route({ method: "POST", path: "/git/{repo}/stash/apply" }).input(StashApplySchema).output(GitActionResultSchema),
18
- stashDrop: oc.route({ method: "POST", path: "/git/{repo}/stash/drop" }).input(StashRefParamSchema).output(OkSchema),
19
- createBranch: oc.route({ method: "POST", path: "/git/{repo}/branch" }).input(GitBranchCreateSchema).output(OkSchema),
20
- createTag: oc.route({ method: "POST", path: "/git/{repo}/tag" }).input(GitTagCreateSchema).output(OkSchema),
21
- deleteTag: oc.route({ method: "POST", path: "/git/{repo}/tag/delete" }).input(GitTagDeleteSchema).output(OkSchema),
22
- pushTag: oc.route({ method: "POST", path: "/git/{repo}/tag/push" }).input(GitTagPushSchema).output(GitActionResultSchema),
23
- checkout: oc.route({ method: "POST", path: "/git/{repo}/checkout" }).input(GitCheckoutSchema).output(GitActionResultSchema),
24
- cherryPick: oc.route({ method: "POST", path: "/git/{repo}/cherry-pick" }).input(GitCommitActionSchema).output(GitActionResultSchema),
25
- revert: oc.route({ method: "POST", path: "/git/{repo}/revert" }).input(GitCommitActionSchema).output(GitActionResultSchema),
26
- drop: oc.route({ method: "POST", path: "/git/{repo}/drop" }).input(GitCommitActionSchema).output(GitActionResultSchema),
27
- merge: oc.route({ method: "POST", path: "/git/{repo}/merge" }).input(GitCommitActionSchema).output(GitActionResultSchema),
28
- rebase: oc.route({ method: "POST", path: "/git/{repo}/rebase" }).input(GitCommitActionSchema).output(GitActionResultSchema),
29
- reset: oc.route({ method: "POST", path: "/git/{repo}/reset" }).input(GitResetSchema).output(GitActionResultSchema),
30
- fileDiff: oc.route({ method: "GET", path: "/git/{repo}/file-diff" }).input(GitFileDiffQuerySchema).output(FileDiffSchema),
31
- status: oc.route({ method: "GET", path: "/git/{repo}/status" }).input(RepoParamSchema).output(GitStatusSchema),
32
- commit: oc.route({ method: "POST", path: "/git/{repo}/commit" }).input(CommitSchema).output(CommitResultSchema),
33
- discard: oc.route({ method: "POST", path: "/git/{repo}/discard" }).input(DiscardSchema).output(OkSchema),
34
- stage: oc.route({ method: "POST", path: "/git/{repo}/stage" }).input(GitStageSchema).output(OkSchema),
35
- unstage: oc.route({ method: "POST", path: "/git/{repo}/unstage" }).input(GitStageSchema).output(OkSchema),
36
- branches: oc.route({ method: "GET", path: "/git/{repo}/branches" }).input(RepoParamSchema).output(GitBranchesSchema),
37
- createBranchAt: oc.route({ method: "POST", path: "/git/{repo}/branches" }).input(GitBranchCreateAtSchema).output(OkSchema),
38
- deleteBranch: oc.route({ method: "POST", path: "/git/{repo}/branches/delete" }).input(GitBranchDeleteSchema).output(OkSchema),
39
- remote: oc.route({ method: "GET", path: "/git/{repo}/remote" }).input(RepoParamSchema).output(GitRemoteStateSchema),
40
- fetch: oc.route({ method: "POST", path: "/git/{repo}/fetch" }).input(RepoParamSchema).output(GitActionResultSchema),
41
- pull: oc.route({ method: "POST", path: "/git/{repo}/pull" }).input(RepoParamSchema).output(GitActionResultSchema),
42
- push: oc.route({ method: "POST", path: "/git/{repo}/push" }).input(PushSchema).output(GitActionResultSchema),
43
- files: oc.route({ method: "GET", path: "/git/{repo}/files" }).input(RepoParamSchema).output(GitFilesSchema),
44
- readFile: oc.route({ method: "GET", path: "/git/{repo}/file" }).input(GitFileQuerySchema).output(GitFileSchema),
45
- writeFile: oc.route({ method: "PUT", path: "/git/{repo}/file" }).input(GitFileWriteSchema).output(OkSchema),
46
- publishFile: oc.route({ method: "POST", path: "/git/{repo}/publish-file" }).input(GitPublishFileSchema).output(GitPublishFileResultSchema),
4
+ changes: oc
5
+ .route({
6
+ method: "GET",
7
+ path: "/git/changes",
8
+ summary: "Uncommitted work across every repo",
9
+ description: "The workspace's whole review set in one answer: every repo that has something uncommitted, and within it every changed file with its status and line counts. This is what the Changes panel draws, and it is the call to make when you want to know whether a workspace is clean without walking the repos yourself.",
10
+ })
11
+ .output(GitChangesSchema),
12
+ repos: oc
13
+ .route({
14
+ method: "GET",
15
+ path: "/git/repos",
16
+ summary: "Every git repo in the workspace",
17
+ description: "The repos the daemon found under the workspace root, each with the id every other call in this group expects as its `{repo}` segment. The workspace root itself is always present as `root`.",
18
+ })
19
+ .output(GitReposSchema),
20
+ remoteRepos: oc
21
+ .route({
22
+ method: "GET",
23
+ path: "/git/remote-repos",
24
+ summary: "Repos matched to their remotes",
25
+ description: "The same repo list, but with the forge host and `owner/name` each one's remote points at. Use it to recognise a workspace repo in a list of names that came from somewhere else, such as a set of pull requests. Costs a remote lookup per repo, which is why it is separate from the plain repo list.",
26
+ })
27
+ .output(GitRemoteReposSchema),
28
+ log: oc
29
+ .route({
30
+ method: "GET",
31
+ path: "/git/{repo}/log",
32
+ summary: "Commit history for one repo",
33
+ description: "A page of commits on the current branch, newest first, each with its author, subject, timestamp and the refs pointing at it. Paginate with the cursor the answer hands back rather than by offset, so a commit landing mid-scroll does not shift the page under you.",
34
+ })
35
+ .input(GitLogQuerySchema)
36
+ .output(GitLogSchema),
37
+ commitDiff: oc
38
+ .route({
39
+ method: "GET",
40
+ path: "/git/{repo}/commit-diff",
41
+ summary: "What one commit changed",
42
+ description: "The list of files a single commit touched, with per-file status and line counts but not the content. Fetch the content of any one of them with the commit file diff call, so a commit with a thousand files stays one cheap answer.",
43
+ })
44
+ .input(GitCommitDiffQuerySchema)
45
+ .output(GitCommitDiffSchema),
46
+ commitFileDiff: oc
47
+ .route({
48
+ method: "GET",
49
+ path: "/git/{repo}/commit-file-diff",
50
+ summary: "One file's before and after at a commit",
51
+ description: "Both sides of a single file as of one commit: the content its parent had and the content that commit left. The daemon returns whole sides rather than a patch, so a caller can render the comparison however it likes.",
52
+ })
53
+ .input(GitCommitFileDiffQuerySchema)
54
+ .output(FileDiffSchema),
55
+ operation: oc
56
+ .route({
57
+ method: "GET",
58
+ path: "/git/{repo}/operation",
59
+ summary: "Whether a merge or rebase is halted mid-flight",
60
+ description: "Names the git operation the worktree is stuck inside, if any: a conflicted merge, an interrupted rebase, a half-applied cherry-pick. Check this first when another call refuses, because a halted worktree is the usual reason and the abort call is the way out.",
61
+ })
62
+ .input(RepoParamSchema)
63
+ .output(GitOperationStateSchema),
64
+ abort: oc
65
+ .route({
66
+ method: "POST",
67
+ path: "/git/{repo}/abort",
68
+ summary: "Abandon a halted merge or rebase",
69
+ description: "Runs git's own abort for whichever operation has the worktree halted, putting the repo back where it stood before the operation started. Nothing else clears that state.",
70
+ })
71
+ .input(RepoParamSchema)
72
+ .output(GitActionResultSchema),
73
+ undoable: oc
74
+ .route({
75
+ method: "GET",
76
+ path: "/git/{repo}/undo",
77
+ summary: "What undoing the last action would do",
78
+ description: "Reads the branch's reflog to describe the move that undo would reverse, and hands back the commit it would land on. Pass that commit to the undo call as proof you looked, and an undo prepared against a view that has since moved is refused rather than landing somewhere unexamined.",
79
+ })
80
+ .input(RepoParamSchema)
81
+ .output(GitUndoStateSchema),
82
+ undo: oc
83
+ .route({
84
+ method: "POST",
85
+ path: "/git/{repo}/undo",
86
+ summary: "Move the branch back one step",
87
+ description: "Walks the current branch back to where it pointed before its last action. This moves the branch ref and leaves the working tree alone, which is the opposite of restoring a checkpoint. Requires the commit the matching read handed you.",
88
+ })
89
+ .input(GitUndoSchema)
90
+ .output(GitActionResultSchema),
91
+ stashes: oc
92
+ .route({
93
+ method: "GET",
94
+ path: "/git/{repo}/stashes",
95
+ summary: "Everything set aside in the stash",
96
+ description: "The repo's stash entries, newest first, each with the message and the commit behind it. A stash entry is a commit, so it reads the same way a log entry does and its contents come back from the stash diff call.",
97
+ })
98
+ .input(RepoParamSchema)
99
+ .output(StashListSchema),
100
+ stashDiff: oc
101
+ .route({
102
+ method: "GET",
103
+ path: "/git/{repo}/stash-diff",
104
+ summary: "What one stash entry holds",
105
+ description: "The files a single stash entry would bring back, with per-file status and line counts. The same shape a commit diff has, because a stash entry is a commit.",
106
+ })
107
+ .input(StashDiffQuerySchema)
108
+ .output(GitCommitDiffSchema),
109
+ stashPush: oc
110
+ .route({
111
+ method: "POST",
112
+ path: "/git/{repo}/stash",
113
+ summary: "Set the current changes aside",
114
+ description: "Moves the working tree's changes onto the stash and leaves a clean tree behind. Nothing is lost: the entry is a commit you can inspect, apply or drop afterwards.",
115
+ })
116
+ .input(StashPushSchema)
117
+ .output(GitActionResultSchema),
118
+ stashApply: oc
119
+ .route({
120
+ method: "POST",
121
+ path: "/git/{repo}/stash/apply",
122
+ summary: "Bring a stash entry back",
123
+ description: "Replays one stash entry onto the working tree. A conflict is reported in the answer rather than raised as a failure, because a conflicting apply is an ordinary outcome a screen has to render.",
124
+ })
125
+ .input(StashApplySchema)
126
+ .output(GitActionResultSchema),
127
+ stashDrop: oc
128
+ .route({
129
+ method: "POST",
130
+ path: "/git/{repo}/stash/drop",
131
+ summary: "Discard a stash entry",
132
+ description: "Deletes one stash entry. This is the only unrecoverable call in the stash set, so the daemon takes a checkpoint of the workspace first.",
133
+ })
134
+ .input(StashRefParamSchema)
135
+ .output(OkSchema),
136
+ createBranch: oc
137
+ .route({
138
+ method: "POST",
139
+ path: "/git/{repo}/branch",
140
+ summary: "Start a branch at a commit",
141
+ description: "Points a new branch name at any commit, without moving HEAD. Use the checkout call if you also want to switch to it.",
142
+ })
143
+ .input(GitBranchCreateSchema)
144
+ .output(OkSchema),
145
+ createTag: oc
146
+ .route({
147
+ method: "POST",
148
+ path: "/git/{repo}/tag",
149
+ summary: "Tag a commit",
150
+ description: "Puts a tag on any commit. Local only: pushing it to the remote is a separate call.",
151
+ })
152
+ .input(GitTagCreateSchema)
153
+ .output(OkSchema),
154
+ deleteTag: oc
155
+ .route({
156
+ method: "POST",
157
+ path: "/git/{repo}/tag/delete",
158
+ summary: "Remove a tag",
159
+ description: "Deletes a tag locally. A tag already pushed stays on the remote until it is deleted there too.",
160
+ })
161
+ .input(GitTagDeleteSchema)
162
+ .output(OkSchema),
163
+ pushTag: oc
164
+ .route({
165
+ method: "POST",
166
+ path: "/git/{repo}/tag/push",
167
+ summary: "Send a tag to the remote",
168
+ description: "Pushes one tag to the repo's remote. Reports the outcome rather than failing, since a missing remote or missing credentials are ordinary answers here.",
169
+ })
170
+ .input(GitTagPushSchema)
171
+ .output(GitActionResultSchema),
172
+ checkout: oc
173
+ .route({
174
+ method: "POST",
175
+ path: "/git/{repo}/checkout",
176
+ summary: "Switch to a branch or commit",
177
+ description: "Moves HEAD to a branch, tag or commit and reshapes the working tree to match. The daemon takes a checkpoint first, so an unexpected result is recoverable. Uncommitted work that would be overwritten is reported instead of being trampled.",
178
+ })
179
+ .input(GitCheckoutSchema)
180
+ .output(GitActionResultSchema),
181
+ cherryPick: oc
182
+ .route({
183
+ method: "POST",
184
+ path: "/git/{repo}/cherry-pick",
185
+ summary: "Replay one commit onto this branch",
186
+ description: "Applies a single commit's changes on top of the current branch as a new commit. A conflict comes back in the answer, with the halted state readable from the operation call.",
187
+ })
188
+ .input(GitCommitActionSchema)
189
+ .output(GitActionResultSchema),
190
+ revert: oc
191
+ .route({
192
+ method: "POST",
193
+ path: "/git/{repo}/revert",
194
+ summary: "Undo a commit with a new commit",
195
+ description: "Adds a commit that reverses an earlier one, leaving the history intact. This is the safe way to take something back on a branch other people have pulled.",
196
+ })
197
+ .input(GitCommitActionSchema)
198
+ .output(GitActionResultSchema),
199
+ drop: oc
200
+ .route({
201
+ method: "POST",
202
+ path: "/git/{repo}/drop",
203
+ summary: "Remove a commit from history",
204
+ description: "Rewrites the branch so one commit is no longer in it. History changes, so this is for branches nobody else has pulled. A checkpoint is taken first.",
205
+ })
206
+ .input(GitCommitActionSchema)
207
+ .output(GitActionResultSchema),
208
+ merge: oc
209
+ .route({
210
+ method: "POST",
211
+ path: "/git/{repo}/merge",
212
+ summary: "Merge another branch in",
213
+ description: "Merges a branch or commit into the current one. Conflicts are reported in the answer and leave the worktree halted, which the operation call explains and the abort call clears.",
214
+ })
215
+ .input(GitCommitActionSchema)
216
+ .output(GitActionResultSchema),
217
+ rebase: oc
218
+ .route({
219
+ method: "POST",
220
+ path: "/git/{repo}/rebase",
221
+ summary: "Replay this branch onto another",
222
+ description: "Moves the current branch's commits on top of a different base. History changes. Conflicts halt the rebase and are reported rather than raised, so the operation and abort calls are the way through.",
223
+ })
224
+ .input(GitCommitActionSchema)
225
+ .output(GitActionResultSchema),
226
+ reset: oc
227
+ .route({
228
+ method: "POST",
229
+ path: "/git/{repo}/reset",
230
+ summary: "Move the branch to a commit",
231
+ description: "Repoints the current branch at another commit, optionally reshaping the working tree to match. The destructive modes take a checkpoint first.",
232
+ })
233
+ .input(GitResetSchema)
234
+ .output(GitActionResultSchema),
235
+ fileDiff: oc
236
+ .route({
237
+ method: "GET",
238
+ path: "/git/{repo}/file-diff",
239
+ summary: "One file's committed and working copies",
240
+ description: "Both sides of a file as it stands right now: what the last commit holds and what is on disk. This is what a review pane shows for an uncommitted change.",
241
+ })
242
+ .input(GitFileDiffQuerySchema)
243
+ .output(FileDiffSchema),
244
+ status: oc
245
+ .route({
246
+ method: "GET",
247
+ path: "/git/{repo}/status",
248
+ summary: "One repo's branch and pending changes",
249
+ description: "The current branch, its sync position against the remote, and every staged, unstaged and untracked path. The single-repo counterpart to the workspace-wide changes call.",
250
+ })
251
+ .input(RepoParamSchema)
252
+ .output(GitStatusSchema),
253
+ commit: oc
254
+ .route({
255
+ method: "POST",
256
+ path: "/git/{repo}/commit",
257
+ summary: "Commit the pending changes",
258
+ description: "Records a commit with your message. Give it a list of paths to commit only those, or leave it out to commit everything pending. The answer carries the commit it created.",
259
+ })
260
+ .input(CommitSchema)
261
+ .output(CommitResultSchema),
262
+ discard: oc
263
+ .route({
264
+ method: "POST",
265
+ path: "/git/{repo}/discard",
266
+ summary: "Throw away pending changes",
267
+ description: "Restores files to their committed state and deletes untracked ones. Give it paths to discard only those. The daemon checkpoints the workspace first, so this is recoverable from the timeline.",
268
+ })
269
+ .input(DiscardSchema)
270
+ .output(OkSchema),
271
+ stage: oc
272
+ .route({
273
+ method: "POST",
274
+ path: "/git/{repo}/stage",
275
+ summary: "Mark paths for the next commit",
276
+ description: "Adds paths to the index. Nothing on disk changes, so this is always safe and always reversible with the unstage call.",
277
+ })
278
+ .input(GitStageSchema)
279
+ .output(OkSchema),
280
+ unstage: oc
281
+ .route({
282
+ method: "POST",
283
+ path: "/git/{repo}/unstage",
284
+ summary: "Take paths back out of the next commit",
285
+ description: "Removes paths from the index and leaves the file itself untouched. The exact reverse of staging.",
286
+ })
287
+ .input(GitStageSchema)
288
+ .output(OkSchema),
289
+ branches: oc
290
+ .route({
291
+ method: "GET",
292
+ path: "/git/{repo}/branches",
293
+ summary: "Local branches and how far each has drifted",
294
+ description: "Every local branch with how many commits it sits ahead of and behind its remote counterpart, so a branch switcher can show sync state without a call per branch.",
295
+ })
296
+ .input(RepoParamSchema)
297
+ .output(GitBranchesSchema),
298
+ createBranchAt: oc
299
+ .route({
300
+ method: "POST",
301
+ path: "/git/{repo}/branches",
302
+ summary: "Create a branch from a starting point",
303
+ description: "Makes a branch at a named start point and optionally switches to it. The branch-switcher counterpart to creating a branch at a specific commit.",
304
+ })
305
+ .input(GitBranchCreateAtSchema)
306
+ .output(OkSchema),
307
+ deleteBranch: oc
308
+ .route({
309
+ method: "POST",
310
+ path: "/git/{repo}/branches/delete",
311
+ summary: "Delete a local branch",
312
+ description: "Removes a branch from the repo. Unmerged work is refused unless you ask for it to be forced, and the remote branch is untouched either way.",
313
+ })
314
+ .input(GitBranchDeleteSchema)
315
+ .output(OkSchema),
316
+ remote: oc
317
+ .route({
318
+ method: "GET",
319
+ path: "/git/{repo}/remote",
320
+ summary: "Sync position against the remote",
321
+ description: "How far the current branch sits ahead of and behind its remote, as of the last fetch, plus whether a remote and working credentials exist at all. This is a read of what the daemon already knows, not a network call, which is why fetching is a separate button.",
322
+ })
323
+ .input(RepoParamSchema)
324
+ .output(GitRemoteStateSchema),
325
+ fetch: oc
326
+ .route({
327
+ method: "POST",
328
+ path: "/git/{repo}/fetch",
329
+ summary: "Refresh what the remote holds",
330
+ description: "Contacts the remote and updates the daemon's picture of it without touching your branch. Run this before trusting the sync position.",
331
+ })
332
+ .input(RepoParamSchema)
333
+ .output(GitActionResultSchema),
334
+ pull: oc
335
+ .route({
336
+ method: "POST",
337
+ path: "/git/{repo}/pull",
338
+ summary: "Bring remote commits down",
339
+ description: "Fetches and integrates the remote's commits into the current branch. A pull that cannot fast-forward is reported in the answer rather than raised, because that is an ordinary thing to be told.",
340
+ })
341
+ .input(RepoParamSchema)
342
+ .output(GitActionResultSchema),
343
+ push: oc
344
+ .route({
345
+ method: "POST",
346
+ path: "/git/{repo}/push",
347
+ summary: "Send commits to the remote",
348
+ description: "Pushes the current branch, setting its upstream on first push. A rejected push, a missing remote and missing credentials all come back as reported outcomes rather than failures.",
349
+ })
350
+ .input(PushSchema)
351
+ .output(GitActionResultSchema),
352
+ files: oc
353
+ .route({
354
+ method: "GET",
355
+ path: "/git/{repo}/files",
356
+ summary: "Every tracked path in the repo",
357
+ description: "The flat list of files git tracks, which is what a file picker or a search box wants. Ignored and untracked files are not in it.",
358
+ })
359
+ .input(RepoParamSchema)
360
+ .output(GitFilesSchema),
361
+ readFile: oc
362
+ .route({
363
+ method: "GET",
364
+ path: "/git/{repo}/file",
365
+ summary: "Read a file from the repo",
366
+ description: "The contents of one file as it stands on disk. A path that climbs out of the repo is refused.",
367
+ })
368
+ .input(GitFileQuerySchema)
369
+ .output(GitFileSchema),
370
+ writeFile: oc
371
+ .route({
372
+ method: "PUT",
373
+ path: "/git/{repo}/file",
374
+ summary: "Write a file into the repo",
375
+ description: "Replaces one file's contents, creating it and its parent folders if they are missing. Nothing is committed: the change shows up as pending work.",
376
+ })
377
+ .input(GitFileWriteSchema)
378
+ .output(OkSchema),
379
+ publishFile: oc
380
+ .route({
381
+ method: "POST",
382
+ path: "/git/{repo}/publish-file",
383
+ summary: "Write, commit and push one file",
384
+ description: "The three steps as a single call with a single answer, committing only the path you named and leaving any other pending work alone. Being on a side branch, having no remote and having no credentials are all reported rather than raised.",
385
+ })
386
+ .input(GitPublishFileSchema)
387
+ .output(GitPublishFileResultSchema),
47
388
  };
48
389
  //# sourceMappingURL=git.contract.js.map