@a5c-ai/krate 5.0.1-staging.00fa5317c

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 (256) hide show
  1. package/Dockerfile +31 -0
  2. package/README.md +183 -0
  3. package/bin/krate-demo.mjs +23 -0
  4. package/bin/krate-server.mjs +14 -0
  5. package/dist/krate-controller-ui.json +3205 -0
  6. package/dist/krate-lifecycle.json +201 -0
  7. package/dist/krate-runtime-snapshot.json +3125 -0
  8. package/dist/krate-summary.json +724 -0
  9. package/docs/README.md +61 -0
  10. package/docs/agents/README.md +83 -0
  11. package/docs/agents/acceptance-test-matrix.md +193 -0
  12. package/docs/agents/agent-mux-adapter-contract.md +167 -0
  13. package/docs/agents/agent-mux-source-map.md +310 -0
  14. package/docs/agents/agent-run-memory-import-spec.md +256 -0
  15. package/docs/agents/agent-stack-management-spec.md +421 -0
  16. package/docs/agents/api-contract-spec.md +309 -0
  17. package/docs/agents/artifacts-writeback-spec.md +145 -0
  18. package/docs/agents/chart-packaging-spec.md +128 -0
  19. package/docs/agents/ci-orchestration-spec.md +140 -0
  20. package/docs/agents/context-assembly-spec.md +219 -0
  21. package/docs/agents/controller-reconciliation-spec.md +255 -0
  22. package/docs/agents/crd-schema-spec.md +315 -0
  23. package/docs/agents/decision-log-open-questions.md +169 -0
  24. package/docs/agents/developer-implementation-checklist.md +329 -0
  25. package/docs/agents/dispatching-design.md +262 -0
  26. package/docs/agents/gaps-agent-mux-to-krate-crds.md +298 -0
  27. package/docs/agents/glossary.md +66 -0
  28. package/docs/agents/implementation-blueprint.md +324 -0
  29. package/docs/agents/implementation-rollout-slices.md +251 -0
  30. package/docs/agents/memory-context-integration-spec.md +194 -0
  31. package/docs/agents/memory-ontology-schema-spec.md +253 -0
  32. package/docs/agents/memory-operations-runbook.md +121 -0
  33. package/docs/agents/mvp-vertical-slice-spec.md +146 -0
  34. package/docs/agents/observability-audit-spec.md +265 -0
  35. package/docs/agents/operator-runbook.md +174 -0
  36. package/docs/agents/org-memory-api-payload-examples.md +333 -0
  37. package/docs/agents/org-memory-controller-sequence-spec.md +181 -0
  38. package/docs/agents/org-memory-e2e-fixture-plan.md +161 -0
  39. package/docs/agents/org-memory-ui-implementation-map.md +114 -0
  40. package/docs/agents/org-memory-vertical-slice-spec.md +168 -0
  41. package/docs/agents/org-resource-model-delta-spec.md +111 -0
  42. package/docs/agents/org-route-resource-model-spec.md +183 -0
  43. package/docs/agents/org-scoping-namespace-spec.md +114 -0
  44. package/docs/agents/rbac-secrets-management-spec.md +406 -0
  45. package/docs/agents/repository-page-integration-spec.md +255 -0
  46. package/docs/agents/resource-contract-examples.md +808 -0
  47. package/docs/agents/resource-relationship-map.md +190 -0
  48. package/docs/agents/security-threat-model.md +188 -0
  49. package/docs/agents/shared-memory-company-brain-spec.md +358 -0
  50. package/docs/agents/storage-migration-spec.md +168 -0
  51. package/docs/agents/subagent-orchestration-spec.md +152 -0
  52. package/docs/agents/system-overview.md +88 -0
  53. package/docs/agents/tools-mcp-skills-spec.md +189 -0
  54. package/docs/agents/traceability-matrix.md +79 -0
  55. package/docs/agents/ui-flow-spec.md +211 -0
  56. package/docs/agents/ui-ux-system-spec.md +426 -0
  57. package/docs/agents/workspace-lifecycle-spec.md +166 -0
  58. package/docs/architecture-spec.md +78 -0
  59. package/docs/components/control-plane.md +78 -0
  60. package/docs/components/data-plane.md +69 -0
  61. package/docs/components/hooks-events.md +67 -0
  62. package/docs/components/identity-rbac-policy.md +73 -0
  63. package/docs/components/kubevela-oam.md +70 -0
  64. package/docs/components/operations-publishing.md +81 -0
  65. package/docs/components/runners-ci.md +66 -0
  66. package/docs/components/web-ui.md +94 -0
  67. package/docs/external/README.md +47 -0
  68. package/docs/external/bidirectional-sync-design.md +134 -0
  69. package/docs/external/cicd-interface.md +64 -0
  70. package/docs/external/external-backend-controllers.md +170 -0
  71. package/docs/external/external-backend-crds.md +234 -0
  72. package/docs/external/external-backend-ui-spec.md +151 -0
  73. package/docs/external/external-backend-ux-flows.md +115 -0
  74. package/docs/external/external-object-mapping.md +125 -0
  75. package/docs/external/git-forge-interface.md +68 -0
  76. package/docs/external/github-integration-design.md +151 -0
  77. package/docs/external/issue-tracking-interface.md +66 -0
  78. package/docs/external/provider-capability-manifests.md +204 -0
  79. package/docs/external/provider-catalog.md +139 -0
  80. package/docs/external/provider-rollout-testing.md +78 -0
  81. package/docs/external/research-results.md +48 -0
  82. package/docs/external/security-auth-permissions.md +81 -0
  83. package/docs/external/sync-state-machines.md +108 -0
  84. package/docs/external/unified-external-backend-model.md +107 -0
  85. package/docs/external/user-facing-changes.md +67 -0
  86. package/docs/gaps.md +161 -0
  87. package/docs/install.md +94 -0
  88. package/docs/krate-design.md +334 -0
  89. package/docs/local-minikube.md +55 -0
  90. package/docs/ontology/README.md +32 -0
  91. package/docs/ontology/bounded-contexts.md +29 -0
  92. package/docs/ontology/events-and-hooks.md +32 -0
  93. package/docs/ontology/oam-kubevela.md +32 -0
  94. package/docs/ontology/operations-and-release.md +25 -0
  95. package/docs/ontology/personas-and-actors.md +32 -0
  96. package/docs/ontology/policies-and-invariants.md +33 -0
  97. package/docs/ontology/problem-space.md +30 -0
  98. package/docs/ontology/resource-contracts.md +40 -0
  99. package/docs/ontology/resource-taxonomy.md +42 -0
  100. package/docs/ontology/runners-and-ci.md +29 -0
  101. package/docs/ontology/solution-space.md +24 -0
  102. package/docs/ontology/storage-and-data-boundaries.md +29 -0
  103. package/docs/ontology/validation-matrix.md +24 -0
  104. package/docs/ontology/web-ui-excellent-flows.md +32 -0
  105. package/docs/ontology/workflows.md +39 -0
  106. package/docs/ontology/world.md +35 -0
  107. package/docs/openapi.yaml +1275 -0
  108. package/docs/product-requirements.md +62 -0
  109. package/docs/roadmap-mvp.md +87 -0
  110. package/docs/system-requirements.md +90 -0
  111. package/docs/tests/README.md +53 -0
  112. package/docs/tests/agent-qa-plan.md +63 -0
  113. package/docs/tests/browser-ui-tests.md +62 -0
  114. package/docs/tests/ci-quality-gates.md +48 -0
  115. package/docs/tests/coverage-model.md +64 -0
  116. package/docs/tests/e2e-scenario-tests.md +53 -0
  117. package/docs/tests/fixtures-test-data.md +63 -0
  118. package/docs/tests/observability-reliability-tests.md +54 -0
  119. package/docs/tests/product-test-matrix.md +145 -0
  120. package/docs/tests/qa-adoption-roadmap.md +130 -0
  121. package/docs/tests/qa-automation-plan.md +101 -0
  122. package/docs/tests/security-compliance-tests.md +57 -0
  123. package/docs/tests/test-framework-tools.md +88 -0
  124. package/docs/tests/test-suite-layout.md +121 -0
  125. package/docs/tests/unit-integration-tests.md +48 -0
  126. package/docs/todo-kyverno +714 -0
  127. package/docs/todos.md +4 -0
  128. package/docs/user-stories.md +78 -0
  129. package/examples/minikube-demo.yaml +190 -0
  130. package/examples/oam-application.yaml +23 -0
  131. package/examples/policy-kyverno-pr-title.yaml +18 -0
  132. package/package.json +63 -0
  133. package/scripts/build.mjs +29 -0
  134. package/scripts/setup-minikube.mjs +65 -0
  135. package/scripts/smoke.mjs +37 -0
  136. package/scripts/validate-doc-coverage.mjs +152 -0
  137. package/scripts/validate-package.mjs +93 -0
  138. package/scripts/validate-ui.mjs +278 -0
  139. package/src/agent-adapter-controller.js +169 -0
  140. package/src/agent-approval-controller.js +170 -0
  141. package/src/agent-context-bundles.js +242 -0
  142. package/src/agent-dispatch-controller.js +209 -0
  143. package/src/agent-gateway-config-controller.js +147 -0
  144. package/src/agent-memory-controller.js +357 -0
  145. package/src/agent-memory-import.js +327 -0
  146. package/src/agent-memory-query.js +292 -0
  147. package/src/agent-memory-repository-source-controller.js +255 -0
  148. package/src/agent-mux-client.js +280 -0
  149. package/src/agent-permission-review.js +250 -0
  150. package/src/agent-project-controller.js +117 -0
  151. package/src/agent-provider-config-controller.js +150 -0
  152. package/src/agent-secret-config-grant-controller.js +282 -0
  153. package/src/agent-session-transcript-controller.js +189 -0
  154. package/src/agent-stack-controller.js +347 -0
  155. package/src/agent-subagent-controller.js +160 -0
  156. package/src/agent-transport-binding-controller.js +121 -0
  157. package/src/agent-trigger-controller.js +381 -0
  158. package/src/agent-workspace-controller.js +702 -0
  159. package/src/agent-writeback-controller.js +302 -0
  160. package/src/api-controller.js +541 -0
  161. package/src/argocd-gitops.js +43 -0
  162. package/src/async-controller.js +207 -0
  163. package/src/audit-controller.js +191 -0
  164. package/src/auth.js +307 -0
  165. package/src/component-catalog.js +41 -0
  166. package/src/control-plane.js +136 -0
  167. package/src/controller-client.js +72 -0
  168. package/src/controller-ui.js +617 -0
  169. package/src/data-plane.js +179 -0
  170. package/src/event-bus.js +61 -0
  171. package/src/external/conflict-controller.js +225 -0
  172. package/src/external/github/auth.js +96 -0
  173. package/src/external/github/cicd.js +180 -0
  174. package/src/external/github/git-forge.js +240 -0
  175. package/src/external/github/index.js +144 -0
  176. package/src/external/github/issue-tracking.js +163 -0
  177. package/src/external/provider-adapter.js +161 -0
  178. package/src/external/provider-resource-factory.js +161 -0
  179. package/src/external/sync-controller.js +235 -0
  180. package/src/external/webhook-controller.js +144 -0
  181. package/src/external/write-controller.js +283 -0
  182. package/src/gitea-backend.js +131 -0
  183. package/src/gitea-service.js +173 -0
  184. package/src/handoff.js +98 -0
  185. package/src/hooks-events.js +63 -0
  186. package/src/http-server.js +377 -0
  187. package/src/identity-policy.js +86 -0
  188. package/src/index.js +57 -0
  189. package/src/kubernetes-controller-async.js +511 -0
  190. package/src/kubernetes-controller.js +878 -0
  191. package/src/kubernetes-resource-gateway.js +48 -0
  192. package/src/notification-controller.js +178 -0
  193. package/src/operations.js +112 -0
  194. package/src/org-scoping.js +5 -0
  195. package/src/resource-model.js +221 -0
  196. package/src/runner-controller.js +272 -0
  197. package/src/runners-ci.js +48 -0
  198. package/src/runtime.js +196 -0
  199. package/src/snapshot-cache.js +157 -0
  200. package/src/web-ui.js +40 -0
  201. package/tests/agent-adapter-controller.test.js +361 -0
  202. package/tests/agent-approval-controller.test.js +173 -0
  203. package/tests/agent-context-bundles.test.js +278 -0
  204. package/tests/agent-dispatch-controller.test.js +315 -0
  205. package/tests/agent-gateway-config-controller.test.js +386 -0
  206. package/tests/agent-memory-controller.test.js +308 -0
  207. package/tests/agent-memory-import-snapshot.test.js +477 -0
  208. package/tests/agent-memory-query.test.js +404 -0
  209. package/tests/agent-memory-repository-source.test.js +514 -0
  210. package/tests/agent-mux-client.test.js +204 -0
  211. package/tests/agent-permission-review-v2.test.js +317 -0
  212. package/tests/agent-permission-review.test.js +209 -0
  213. package/tests/agent-project-controller.test.js +302 -0
  214. package/tests/agent-provider-config-controller.test.js +376 -0
  215. package/tests/agent-resources.test.js +228 -0
  216. package/tests/agent-secret-config-grant.test.js +231 -0
  217. package/tests/agent-session-transcript-controller.test.js +499 -0
  218. package/tests/agent-stack-controller.test.js +221 -0
  219. package/tests/agent-subagent-controller.test.js +201 -0
  220. package/tests/agent-transport-binding-controller.test.js +294 -0
  221. package/tests/agent-trigger-controller.test.js +211 -0
  222. package/tests/agent-trigger-routes.test.js +190 -0
  223. package/tests/agent-trigger-sources.test.js +245 -0
  224. package/tests/agent-workspace-controller.test.js +181 -0
  225. package/tests/agent-writeback.test.js +292 -0
  226. package/tests/approval-persistence.test.js +171 -0
  227. package/tests/async-controller.test.js +252 -0
  228. package/tests/audit-controller.test.js +227 -0
  229. package/tests/codespace-controller.test.js +318 -0
  230. package/tests/deployment.test.js +407 -0
  231. package/tests/e2e/lifecycle.test.js +117 -0
  232. package/tests/event-bus-integration.test.js +190 -0
  233. package/tests/external-github-forge.test.js +560 -0
  234. package/tests/external-github-issues-cicd.test.js +520 -0
  235. package/tests/external-integration.test.js +470 -0
  236. package/tests/external-persistence.test.js +340 -0
  237. package/tests/external-provider-adapter.test.js +365 -0
  238. package/tests/external-resource-model.test.js +215 -0
  239. package/tests/external-webhook-sync.test.js +287 -0
  240. package/tests/external-write-conflict.test.js +353 -0
  241. package/tests/gitea-service.test.js +253 -0
  242. package/tests/health-check-real.test.js +165 -0
  243. package/tests/integration/full-flow.test.js +266 -0
  244. package/tests/krate.test.js +756 -0
  245. package/tests/memory-search-wiring.test.js +270 -0
  246. package/tests/notification-controller.test.js +196 -0
  247. package/tests/notification-integration.test.js +179 -0
  248. package/tests/org-scoping.test.js +687 -0
  249. package/tests/runner-controller.test.js +327 -0
  250. package/tests/runner-integration.test.js +231 -0
  251. package/tests/session-cookie-hmac.test.js +151 -0
  252. package/tests/snapshot-performance.test.js +247 -0
  253. package/tests/sse-events.test.js +107 -0
  254. package/tests/webhook-trigger.test.js +198 -0
  255. package/tests/workspace-volumes.test.js +312 -0
  256. package/tests/writeback-persistence.test.js +207 -0
@@ -0,0 +1,1275 @@
1
+ openapi: 3.0.3
2
+ info:
3
+ title: Krate API
4
+ version: 1.0.0
5
+ description: |
6
+ Kubernetes-native Git forge HTTP API. Krate provides resource management,
7
+ agent orchestration, external backend sync, secret management, and real-time
8
+ event streaming for developer platforms built on Kubernetes.
9
+ contact:
10
+ name: a5c.ai
11
+ url: https://a5c.ai
12
+ license:
13
+ name: MIT
14
+
15
+ servers:
16
+ - url: http://localhost:3080
17
+ description: Local development server
18
+ - url: https://krate.example.com
19
+ description: Production server
20
+
21
+ tags:
22
+ - name: Health
23
+ description: Health and readiness checks
24
+ - name: Controller
25
+ description: Controller snapshot and UI model
26
+ - name: Organizations
27
+ description: Organization management
28
+ - name: Resources
29
+ description: Kubernetes resource CRUD (org-scoped)
30
+ - name: Secrets
31
+ description: Secret management (AgentSecretGrant resources)
32
+ - name: SecretGrants
33
+ description: Fine-grained secret grant management
34
+ - name: External
35
+ description: External backend sync, conflict resolution, and write intents
36
+ - name: Agents
37
+ description: Agent dispatch, memory queries, and event streaming
38
+ - name: Webhooks
39
+ description: Webhook ingestion for external provider events
40
+
41
+ paths:
42
+ /healthz:
43
+ get:
44
+ tags: [Health]
45
+ summary: Health check
46
+ description: Returns 200 OK when the server is healthy and ready to serve requests.
47
+ operationId: getHealth
48
+ responses:
49
+ '200':
50
+ description: Server is healthy
51
+ content:
52
+ application/json:
53
+ schema:
54
+ type: object
55
+ properties:
56
+ ok:
57
+ type: boolean
58
+ example: true
59
+ project:
60
+ type: string
61
+ example: Krate
62
+ '500':
63
+ $ref: '#/components/responses/InternalError'
64
+
65
+ /api/controller:
66
+ get:
67
+ tags: [Controller]
68
+ summary: Get controller UI model
69
+ description: |
70
+ Returns a full controller snapshot formatted as a UI model, optionally
71
+ scoped to a specific organization. Includes resources, org list, agents,
72
+ status, and dashboard views.
73
+ operationId: getController
74
+ parameters:
75
+ - name: org
76
+ in: query
77
+ description: Organization slug to scope the UI model to
78
+ required: false
79
+ schema:
80
+ type: string
81
+ example: default
82
+ responses:
83
+ '200':
84
+ description: Controller UI model
85
+ content:
86
+ application/json:
87
+ schema:
88
+ $ref: '#/components/schemas/ControllerUiModel'
89
+ '500':
90
+ $ref: '#/components/responses/InternalError'
91
+
92
+ /api/orgs:
93
+ get:
94
+ tags: [Organizations]
95
+ summary: List organizations
96
+ description: Returns all organizations from the controller snapshot.
97
+ operationId: listOrganizations
98
+ responses:
99
+ '200':
100
+ description: Organization list
101
+ content:
102
+ application/json:
103
+ schema:
104
+ type: object
105
+ properties:
106
+ organizations:
107
+ type: array
108
+ items:
109
+ $ref: '#/components/schemas/OrgSummary'
110
+ '500':
111
+ $ref: '#/components/responses/InternalError'
112
+ post:
113
+ tags: [Organizations]
114
+ summary: Create organization
115
+ description: Creates a new organization resource.
116
+ operationId: createOrganization
117
+ requestBody:
118
+ required: true
119
+ content:
120
+ application/json:
121
+ schema:
122
+ type: object
123
+ required: [name]
124
+ properties:
125
+ name:
126
+ type: string
127
+ description: Organization slug (DNS-safe label)
128
+ example: acme
129
+ displayName:
130
+ type: string
131
+ description: Human-readable organization name
132
+ example: Acme Corp
133
+ responses:
134
+ '201':
135
+ description: Organization created
136
+ content:
137
+ application/json:
138
+ schema:
139
+ $ref: '#/components/schemas/KrateResource'
140
+ '400':
141
+ $ref: '#/components/responses/BadRequest'
142
+ '500':
143
+ $ref: '#/components/responses/InternalError'
144
+
145
+ /api/orgs/{org}/resources:
146
+ get:
147
+ tags: [Resources]
148
+ summary: List resources by kind
149
+ description: |
150
+ Lists all resources of the specified kind within the organization's
151
+ namespace. Defaults to 'Repository' if kind is not specified.
152
+ operationId: listResources
153
+ parameters:
154
+ - $ref: '#/components/parameters/OrgParam'
155
+ - name: kind
156
+ in: query
157
+ description: Kubernetes resource kind to list (e.g. Repository, AgentStack)
158
+ required: false
159
+ schema:
160
+ type: string
161
+ example: Repository
162
+ responses:
163
+ '200':
164
+ description: Resource list
165
+ content:
166
+ application/json:
167
+ schema:
168
+ $ref: '#/components/schemas/ResourceList'
169
+ '400':
170
+ $ref: '#/components/responses/BadRequest'
171
+ '500':
172
+ $ref: '#/components/responses/InternalError'
173
+ post:
174
+ tags: [Resources]
175
+ summary: Apply (create or update) a resource
176
+ description: |
177
+ Creates or updates a Kubernetes resource in the organization's namespace.
178
+ The org context is automatically injected into metadata and spec.
179
+ operationId: applyResource
180
+ parameters:
181
+ - $ref: '#/components/parameters/OrgParam'
182
+ requestBody:
183
+ required: true
184
+ content:
185
+ application/json:
186
+ schema:
187
+ $ref: '#/components/schemas/KrateResource'
188
+ example:
189
+ apiVersion: krate.a5c.ai/v1alpha1
190
+ kind: AgentStack
191
+ metadata:
192
+ name: my-stack
193
+ spec:
194
+ organizationRef: default
195
+ description: My agent stack
196
+ responses:
197
+ '201':
198
+ description: Resource applied
199
+ content:
200
+ application/json:
201
+ schema:
202
+ $ref: '#/components/schemas/ApplyResult'
203
+ '400':
204
+ $ref: '#/components/responses/BadRequest'
205
+ '500':
206
+ $ref: '#/components/responses/InternalError'
207
+
208
+ /api/orgs/{org}/resources/{kind}/{name}:
209
+ get:
210
+ tags: [Resources]
211
+ summary: Get a resource
212
+ description: Returns a single resource by kind and name within the organization namespace.
213
+ operationId: getResource
214
+ parameters:
215
+ - $ref: '#/components/parameters/OrgParam'
216
+ - $ref: '#/components/parameters/KindParam'
217
+ - $ref: '#/components/parameters/NameParam'
218
+ responses:
219
+ '200':
220
+ description: Resource object
221
+ content:
222
+ application/json:
223
+ schema:
224
+ $ref: '#/components/schemas/KrateResource'
225
+ '404':
226
+ $ref: '#/components/responses/NotFound'
227
+ '500':
228
+ $ref: '#/components/responses/InternalError'
229
+ delete:
230
+ tags: [Resources]
231
+ summary: Delete a resource
232
+ description: Deletes the resource with the given kind and name from the organization namespace.
233
+ operationId: deleteResource
234
+ parameters:
235
+ - $ref: '#/components/parameters/OrgParam'
236
+ - $ref: '#/components/parameters/KindParam'
237
+ - $ref: '#/components/parameters/NameParam'
238
+ responses:
239
+ '200':
240
+ description: Resource deleted
241
+ content:
242
+ application/json:
243
+ schema:
244
+ $ref: '#/components/schemas/DeleteResult'
245
+ '404':
246
+ $ref: '#/components/responses/NotFound'
247
+ '500':
248
+ $ref: '#/components/responses/InternalError'
249
+
250
+ /api/orgs/{org}/secrets:
251
+ get:
252
+ tags: [Secrets]
253
+ summary: List secrets
254
+ description: |
255
+ Lists all secrets (AgentSecretGrant resources) for the organization.
256
+ Returns a simplified view with name, type, createdAt, and grants.
257
+ operationId: listSecrets
258
+ parameters:
259
+ - $ref: '#/components/parameters/OrgParam'
260
+ responses:
261
+ '200':
262
+ description: Secret list
263
+ content:
264
+ application/json:
265
+ schema:
266
+ type: object
267
+ properties:
268
+ secrets:
269
+ type: array
270
+ items:
271
+ $ref: '#/components/schemas/SecretItem'
272
+ '500':
273
+ $ref: '#/components/responses/InternalError'
274
+ post:
275
+ tags: [Secrets]
276
+ summary: Create a secret
277
+ description: |
278
+ Creates an AgentSecretGrant resource that registers a secret reference
279
+ with the specified permissions and grant target.
280
+ operationId: createSecret
281
+ parameters:
282
+ - $ref: '#/components/parameters/OrgParam'
283
+ requestBody:
284
+ required: true
285
+ content:
286
+ application/json:
287
+ schema:
288
+ type: object
289
+ required: [name]
290
+ properties:
291
+ name:
292
+ type: string
293
+ description: Secret name
294
+ example: github-token
295
+ grantedTo:
296
+ type: string
297
+ description: Agent or system the secret is granted to
298
+ example: agent-stack-builder
299
+ permissions:
300
+ type: array
301
+ items:
302
+ type: string
303
+ enum: [read, write, admin]
304
+ default: [read]
305
+ data:
306
+ type: object
307
+ description: Optional secret data (key-value pairs)
308
+ additionalProperties:
309
+ type: string
310
+ responses:
311
+ '201':
312
+ description: Secret created
313
+ content:
314
+ application/json:
315
+ schema:
316
+ $ref: '#/components/schemas/ApplyResult'
317
+ '400':
318
+ $ref: '#/components/responses/BadRequest'
319
+ '500':
320
+ $ref: '#/components/responses/InternalError'
321
+
322
+ /api/orgs/{org}/secrets/{name}:
323
+ delete:
324
+ tags: [Secrets]
325
+ summary: Delete a secret
326
+ description: Deletes the AgentSecretGrant with the given name from the organization.
327
+ operationId: deleteSecret
328
+ parameters:
329
+ - $ref: '#/components/parameters/OrgParam'
330
+ - $ref: '#/components/parameters/NameParam'
331
+ responses:
332
+ '200':
333
+ description: Secret deleted
334
+ content:
335
+ application/json:
336
+ schema:
337
+ $ref: '#/components/schemas/DeleteResult'
338
+ '404':
339
+ $ref: '#/components/responses/NotFound'
340
+ '500':
341
+ $ref: '#/components/responses/InternalError'
342
+
343
+ /api/orgs/{org}/secret-grants:
344
+ get:
345
+ tags: [SecretGrants]
346
+ summary: List secret grants
347
+ description: Lists all AgentSecretGrant resources for the organization (full resource view).
348
+ operationId: listSecretGrants
349
+ parameters:
350
+ - $ref: '#/components/parameters/OrgParam'
351
+ responses:
352
+ '200':
353
+ description: Secret grant list
354
+ content:
355
+ application/json:
356
+ schema:
357
+ $ref: '#/components/schemas/ResourceList'
358
+ '500':
359
+ $ref: '#/components/responses/InternalError'
360
+ post:
361
+ tags: [SecretGrants]
362
+ summary: Create a secret grant
363
+ description: |
364
+ Creates an AgentSecretGrant resource granting a specific agent access
365
+ to a named secret with the specified permissions.
366
+ operationId: createSecretGrant
367
+ parameters:
368
+ - $ref: '#/components/parameters/OrgParam'
369
+ requestBody:
370
+ required: true
371
+ content:
372
+ application/json:
373
+ schema:
374
+ type: object
375
+ required: [secretName, grantedTo]
376
+ properties:
377
+ name:
378
+ type: string
379
+ description: Grant resource name (auto-generated if omitted)
380
+ example: grant-github-token
381
+ secretName:
382
+ type: string
383
+ description: Name of the secret to grant access to
384
+ example: github-token
385
+ grantedTo:
386
+ type: string
387
+ description: Agent stack or system receiving the grant
388
+ example: agent-stack-builder
389
+ permissions:
390
+ type: array
391
+ items:
392
+ type: string
393
+ enum: [read, write, admin]
394
+ default: [read]
395
+ responses:
396
+ '201':
397
+ description: Secret grant created
398
+ content:
399
+ application/json:
400
+ schema:
401
+ $ref: '#/components/schemas/ApplyResult'
402
+ '400':
403
+ $ref: '#/components/responses/BadRequest'
404
+ '500':
405
+ $ref: '#/components/responses/InternalError'
406
+
407
+ /api/orgs/{org}/external/sync:
408
+ post:
409
+ tags: [External]
410
+ summary: Sync external binding
411
+ description: |
412
+ Triggers a synchronization of a named external binding (e.g. GitHub repository
413
+ adapter). Reconciles local resource state against the external provider.
414
+ operationId: syncExternal
415
+ parameters:
416
+ - $ref: '#/components/parameters/OrgParam'
417
+ requestBody:
418
+ required: true
419
+ content:
420
+ application/json:
421
+ schema:
422
+ $ref: '#/components/schemas/SyncInput'
423
+ example:
424
+ bindingName: github-binding
425
+ kind: Repository
426
+ localName: my-repo
427
+ spec: {}
428
+ externalEnvelope:
429
+ nativeId: '123456'
430
+ url: https://github.com/org/repo
431
+ etag: abc123
432
+ providerRef: github
433
+ responses:
434
+ '200':
435
+ description: Sync result
436
+ content:
437
+ application/json:
438
+ schema:
439
+ type: object
440
+ properties:
441
+ synced:
442
+ type: boolean
443
+ resource:
444
+ $ref: '#/components/schemas/KrateResource'
445
+ conflicts:
446
+ type: array
447
+ items:
448
+ type: object
449
+ '400':
450
+ $ref: '#/components/responses/BadRequest'
451
+ '500':
452
+ $ref: '#/components/responses/InternalError'
453
+
454
+ /api/orgs/{org}/external/conflicts/{name}/resolve:
455
+ post:
456
+ tags: [External]
457
+ summary: Resolve external conflict
458
+ description: |
459
+ Resolves a named external sync conflict using the specified strategy.
460
+ Strategies: local-wins, remote-wins, or manual (provide resolvedValue).
461
+ operationId: resolveConflict
462
+ parameters:
463
+ - $ref: '#/components/parameters/OrgParam'
464
+ - name: name
465
+ in: path
466
+ required: true
467
+ description: Conflict resource name
468
+ schema:
469
+ type: string
470
+ example: repo-conflict-abc123
471
+ requestBody:
472
+ required: true
473
+ content:
474
+ application/json:
475
+ schema:
476
+ type: object
477
+ required: [strategy]
478
+ properties:
479
+ strategy:
480
+ type: string
481
+ enum: [local-wins, remote-wins, manual]
482
+ description: Conflict resolution strategy
483
+ resolvedValue:
484
+ type: object
485
+ description: Merged spec value (required for manual strategy)
486
+ resources:
487
+ type: object
488
+ description: Additional resource context
489
+ responses:
490
+ '200':
491
+ description: Conflict resolved
492
+ content:
493
+ application/json:
494
+ schema:
495
+ type: object
496
+ properties:
497
+ resolved:
498
+ type: boolean
499
+ conflictName:
500
+ type: string
501
+ strategy:
502
+ type: string
503
+ '400':
504
+ $ref: '#/components/responses/BadRequest'
505
+ '404':
506
+ $ref: '#/components/responses/NotFound'
507
+ '500':
508
+ $ref: '#/components/responses/InternalError'
509
+
510
+ /api/orgs/{org}/external/write-intents/{name}/approve:
511
+ post:
512
+ tags: [External]
513
+ summary: Approve write intent
514
+ description: |
515
+ Approves a pending external write intent, allowing the agent to commit
516
+ changes to the external provider (e.g. push a branch to GitHub).
517
+ operationId: approveWriteIntent
518
+ parameters:
519
+ - $ref: '#/components/parameters/OrgParam'
520
+ - name: name
521
+ in: path
522
+ required: true
523
+ description: Write intent resource name
524
+ schema:
525
+ type: string
526
+ example: write-intent-push-abc
527
+ requestBody:
528
+ required: true
529
+ content:
530
+ application/json:
531
+ schema:
532
+ type: object
533
+ properties:
534
+ approvedBy:
535
+ type: string
536
+ description: Identity of the approver
537
+ example: alice
538
+ resources:
539
+ type: object
540
+ description: Additional resource context for the approval
541
+ responses:
542
+ '200':
543
+ description: Write intent approved
544
+ content:
545
+ application/json:
546
+ schema:
547
+ type: object
548
+ properties:
549
+ approved:
550
+ type: boolean
551
+ intentName:
552
+ type: string
553
+ '400':
554
+ $ref: '#/components/responses/BadRequest'
555
+ '404':
556
+ $ref: '#/components/responses/NotFound'
557
+ '500':
558
+ $ref: '#/components/responses/InternalError'
559
+
560
+ /api/orgs/{org}/external/write-intents/{name}/cancel:
561
+ post:
562
+ tags: [External]
563
+ summary: Cancel write intent
564
+ description: Cancels a pending external write intent, preventing the agent from writing to the external provider.
565
+ operationId: cancelWriteIntent
566
+ parameters:
567
+ - $ref: '#/components/parameters/OrgParam'
568
+ - name: name
569
+ in: path
570
+ required: true
571
+ description: Write intent resource name
572
+ schema:
573
+ type: string
574
+ example: write-intent-push-abc
575
+ requestBody:
576
+ required: true
577
+ content:
578
+ application/json:
579
+ schema:
580
+ type: object
581
+ properties:
582
+ cancelledBy:
583
+ type: string
584
+ description: Identity of the person cancelling the intent
585
+ example: alice
586
+ resources:
587
+ type: object
588
+ description: Additional resource context
589
+ responses:
590
+ '200':
591
+ description: Write intent cancelled
592
+ content:
593
+ application/json:
594
+ schema:
595
+ type: object
596
+ properties:
597
+ cancelled:
598
+ type: boolean
599
+ intentName:
600
+ type: string
601
+ '400':
602
+ $ref: '#/components/responses/BadRequest'
603
+ '404':
604
+ $ref: '#/components/responses/NotFound'
605
+ '500':
606
+ $ref: '#/components/responses/InternalError'
607
+
608
+ /api/orgs/{org}/agents/dispatch:
609
+ post:
610
+ tags: [Agents]
611
+ summary: Dispatch an agent run
612
+ description: |
613
+ Dispatches a new AgentDispatchRun against the named stack. The agent will
614
+ process the prompt in the context of the specified repository and branch.
615
+ operationId: dispatchAgent
616
+ parameters:
617
+ - $ref: '#/components/parameters/OrgParam'
618
+ requestBody:
619
+ required: true
620
+ content:
621
+ application/json:
622
+ schema:
623
+ $ref: '#/components/schemas/DispatchInput'
624
+ example:
625
+ stackRef: claude-code-stack
626
+ repository: my-repo
627
+ branch: main
628
+ prompt: Fix the failing tests in the auth module
629
+ responses:
630
+ '201':
631
+ description: Agent run dispatched
632
+ content:
633
+ application/json:
634
+ schema:
635
+ type: object
636
+ properties:
637
+ run:
638
+ $ref: '#/components/schemas/KrateResource'
639
+ runName:
640
+ type: string
641
+ description: Name of the created AgentDispatchRun
642
+ status:
643
+ type: string
644
+ example: dispatched
645
+ '400':
646
+ $ref: '#/components/responses/BadRequest'
647
+ '500':
648
+ $ref: '#/components/responses/InternalError'
649
+
650
+ /api/orgs/{org}/agents/runs/{name}/cancel:
651
+ post:
652
+ tags: [Agents]
653
+ summary: Cancel an agent run
654
+ description: Requests cancellation of a running AgentDispatchRun.
655
+ operationId: cancelAgentRun
656
+ parameters:
657
+ - $ref: '#/components/parameters/OrgParam'
658
+ - name: name
659
+ in: path
660
+ required: true
661
+ description: AgentDispatchRun resource name
662
+ schema:
663
+ type: string
664
+ example: run-abc123
665
+ responses:
666
+ '200':
667
+ description: Run cancelled
668
+ content:
669
+ application/json:
670
+ schema:
671
+ type: object
672
+ properties:
673
+ cancelled:
674
+ type: boolean
675
+ runName:
676
+ type: string
677
+ '404':
678
+ $ref: '#/components/responses/NotFound'
679
+ '500':
680
+ $ref: '#/components/responses/InternalError'
681
+
682
+ /api/orgs/{org}/agents/memory/query:
683
+ post:
684
+ tags: [Agents]
685
+ summary: Query agent memory
686
+ description: |
687
+ Queries the agent memory graph or grep index. Supports graph traversal,
688
+ grep-style pattern matching, and semantic search strategies.
689
+ operationId: queryAgentMemory
690
+ parameters:
691
+ - $ref: '#/components/parameters/OrgParam'
692
+ requestBody:
693
+ required: true
694
+ content:
695
+ application/json:
696
+ schema:
697
+ $ref: '#/components/schemas/MemoryQueryInput'
698
+ example:
699
+ query: deployment pipeline failures in main branch
700
+ strategy: graph
701
+ topK: 10
702
+ context:
703
+ organizationRef: default
704
+ responses:
705
+ '200':
706
+ description: Memory query results
707
+ content:
708
+ application/json:
709
+ schema:
710
+ $ref: '#/components/schemas/MemoryQueryResult'
711
+ '400':
712
+ $ref: '#/components/responses/BadRequest'
713
+ '500':
714
+ $ref: '#/components/responses/InternalError'
715
+
716
+ /api/orgs/{org}/agents/events/stream:
717
+ get:
718
+ tags: [Agents]
719
+ summary: SSE event stream
720
+ description: |
721
+ Server-Sent Events stream for real-time agent and system events.
722
+ Emits a "connected" event on open, then "heartbeat" every 30 seconds.
723
+ Event data is JSON-encoded: `{ type, payload }`.
724
+
725
+ **Note:** This endpoint returns `text/event-stream` and does not accept
726
+ standard JSON requests. Use the EventSource API in browsers.
727
+ operationId: streamAgentEvents
728
+ parameters:
729
+ - $ref: '#/components/parameters/OrgParam'
730
+ responses:
731
+ '200':
732
+ description: SSE event stream established
733
+ content:
734
+ text/event-stream:
735
+ schema:
736
+ type: string
737
+ description: |
738
+ Newline-delimited SSE events. Each event is:
739
+ `data: {"type":"<event-type>","payload":{...}}\n\n`
740
+ example: |
741
+ data: {"type":"connected"}
742
+
743
+ data: {"type":"heartbeat"}
744
+
745
+ data: {"type":"run.status.changed","payload":{"runName":"run-abc","phase":"Running"}}
746
+ '500':
747
+ $ref: '#/components/responses/InternalError'
748
+
749
+ /api/orgs/{org}/agents/approvals/{name}/decide:
750
+ post:
751
+ tags: [Agents]
752
+ summary: Decide on an agent approval
753
+ description: |
754
+ Approves or denies a pending AgentApproval resource. The agent run
755
+ that triggered the approval will proceed or be blocked accordingly.
756
+ operationId: decideAgentApproval
757
+ parameters:
758
+ - $ref: '#/components/parameters/OrgParam'
759
+ - name: name
760
+ in: path
761
+ required: true
762
+ description: AgentApproval resource name
763
+ schema:
764
+ type: string
765
+ example: approval-abc123
766
+ requestBody:
767
+ required: true
768
+ content:
769
+ application/json:
770
+ schema:
771
+ type: object
772
+ required: [decision]
773
+ properties:
774
+ decision:
775
+ type: string
776
+ enum: [approve, deny]
777
+ description: Approval decision
778
+ decidedBy:
779
+ type: string
780
+ description: Identity of the decision maker
781
+ example: alice
782
+ reason:
783
+ type: string
784
+ description: Optional reason for the decision
785
+ example: Approved for hotfix deployment
786
+ responses:
787
+ '200':
788
+ description: Approval decision recorded
789
+ content:
790
+ application/json:
791
+ schema:
792
+ type: object
793
+ properties:
794
+ decided:
795
+ type: boolean
796
+ decision:
797
+ type: string
798
+ enum: [approve, deny]
799
+ approvalName:
800
+ type: string
801
+ '400':
802
+ $ref: '#/components/responses/BadRequest'
803
+ '404':
804
+ $ref: '#/components/responses/NotFound'
805
+ '500':
806
+ $ref: '#/components/responses/InternalError'
807
+
808
+ /api/orgs/{org}/agents/webhooks/ingest:
809
+ post:
810
+ tags: [Webhooks]
811
+ summary: Ingest agent webhook event
812
+ description: |
813
+ Ingests a raw webhook payload (from GitHub, Gitea, or other providers)
814
+ and dispatches it to matching AgentTriggerRule resources. Normalizes
815
+ the event type from the payload structure automatically.
816
+ operationId: ingestAgentWebhook
817
+ parameters:
818
+ - $ref: '#/components/parameters/OrgParam'
819
+ requestBody:
820
+ required: true
821
+ content:
822
+ application/json:
823
+ schema:
824
+ $ref: '#/components/schemas/WebhookPayload'
825
+ example:
826
+ action: opened
827
+ pull_request:
828
+ number: 42
829
+ title: Fix auth bug
830
+ head:
831
+ ref: fix/auth-bug
832
+ repository:
833
+ full_name: org/my-repo
834
+ sender:
835
+ login: alice
836
+ responses:
837
+ '200':
838
+ description: Webhook processed
839
+ content:
840
+ application/json:
841
+ schema:
842
+ type: object
843
+ properties:
844
+ processed:
845
+ type: boolean
846
+ triggeredRules:
847
+ type: array
848
+ items:
849
+ type: string
850
+ dispatchedRuns:
851
+ type: array
852
+ items:
853
+ type: string
854
+ '400':
855
+ $ref: '#/components/responses/BadRequest'
856
+ '500':
857
+ $ref: '#/components/responses/InternalError'
858
+
859
+ /api/orgs/{org}/webhooks/ingest:
860
+ post:
861
+ tags: [Webhooks]
862
+ summary: Ingest webhook event (alias)
863
+ description: Alias for `/api/orgs/{org}/agents/webhooks/ingest`. Accepts the same payload and produces the same result.
864
+ operationId: ingestWebhook
865
+ parameters:
866
+ - $ref: '#/components/parameters/OrgParam'
867
+ requestBody:
868
+ required: true
869
+ content:
870
+ application/json:
871
+ schema:
872
+ $ref: '#/components/schemas/WebhookPayload'
873
+ responses:
874
+ '200':
875
+ description: Webhook processed
876
+ content:
877
+ application/json:
878
+ schema:
879
+ type: object
880
+ properties:
881
+ processed:
882
+ type: boolean
883
+ triggeredRules:
884
+ type: array
885
+ items:
886
+ type: string
887
+ '400':
888
+ $ref: '#/components/responses/BadRequest'
889
+ '500':
890
+ $ref: '#/components/responses/InternalError'
891
+
892
+ components:
893
+ parameters:
894
+ OrgParam:
895
+ name: org
896
+ in: path
897
+ required: true
898
+ description: Organization slug
899
+ schema:
900
+ type: string
901
+ example: default
902
+ KindParam:
903
+ name: kind
904
+ in: path
905
+ required: true
906
+ description: Kubernetes resource kind
907
+ schema:
908
+ type: string
909
+ example: Repository
910
+ NameParam:
911
+ name: name
912
+ in: path
913
+ required: true
914
+ description: Resource name
915
+ schema:
916
+ type: string
917
+ example: my-repo
918
+
919
+ responses:
920
+ BadRequest:
921
+ description: Bad request — invalid input or malformed JSON
922
+ content:
923
+ application/json:
924
+ schema:
925
+ $ref: '#/components/schemas/ErrorResponse'
926
+ NotFound:
927
+ description: Resource not found
928
+ content:
929
+ application/json:
930
+ schema:
931
+ $ref: '#/components/schemas/ErrorResponse'
932
+ InternalError:
933
+ description: Internal server error
934
+ content:
935
+ application/json:
936
+ schema:
937
+ $ref: '#/components/schemas/ErrorResponse'
938
+
939
+ schemas:
940
+ KrateResource:
941
+ type: object
942
+ description: A Krate (Kubernetes-style) resource object
943
+ required: [apiVersion, kind, metadata]
944
+ properties:
945
+ apiVersion:
946
+ type: string
947
+ example: krate.a5c.ai/v1alpha1
948
+ kind:
949
+ type: string
950
+ description: Resource kind (e.g. Repository, AgentStack)
951
+ example: AgentStack
952
+ metadata:
953
+ type: object
954
+ required: [name]
955
+ properties:
956
+ name:
957
+ type: string
958
+ example: my-stack
959
+ namespace:
960
+ type: string
961
+ example: krate-org-default
962
+ labels:
963
+ type: object
964
+ additionalProperties:
965
+ type: string
966
+ annotations:
967
+ type: object
968
+ additionalProperties:
969
+ type: string
970
+ creationTimestamp:
971
+ type: string
972
+ format: date-time
973
+ spec:
974
+ type: object
975
+ description: Resource spec (kind-specific fields)
976
+ additionalProperties: true
977
+ status:
978
+ type: object
979
+ description: Resource status (set by controller)
980
+ additionalProperties: true
981
+
982
+ ResourceList:
983
+ type: object
984
+ properties:
985
+ items:
986
+ type: array
987
+ items:
988
+ $ref: '#/components/schemas/KrateResource'
989
+ total:
990
+ type: integer
991
+ description: Total number of items
992
+ example: 5
993
+ kind:
994
+ type: string
995
+ description: Resource kind that was listed
996
+ example: Repository
997
+
998
+ ApplyResult:
999
+ type: object
1000
+ properties:
1001
+ resource:
1002
+ $ref: '#/components/schemas/KrateResource'
1003
+ created:
1004
+ type: boolean
1005
+ description: True if created, false if updated
1006
+ name:
1007
+ type: string
1008
+ description: Resource name
1009
+
1010
+ DeleteResult:
1011
+ type: object
1012
+ properties:
1013
+ deleted:
1014
+ type: boolean
1015
+ name:
1016
+ type: string
1017
+ kind:
1018
+ type: string
1019
+
1020
+ ErrorResponse:
1021
+ type: object
1022
+ required: [error]
1023
+ properties:
1024
+ error:
1025
+ type: string
1026
+ description: Error code
1027
+ example: not_found
1028
+ message:
1029
+ type: string
1030
+ description: Human-readable error message
1031
+ example: Resource not found
1032
+ code:
1033
+ type: integer
1034
+ description: HTTP status code
1035
+ example: 404
1036
+
1037
+ OrgSummary:
1038
+ type: object
1039
+ properties:
1040
+ slug:
1041
+ type: string
1042
+ example: acme
1043
+ displayName:
1044
+ type: string
1045
+ example: Acme Corp
1046
+ namespace:
1047
+ type: string
1048
+ example: krate-org-acme
1049
+
1050
+ ControllerUiModel:
1051
+ type: object
1052
+ description: UI-facing snapshot of the controller state
1053
+ properties:
1054
+ org:
1055
+ $ref: '#/components/schemas/OrgSummary'
1056
+ orgs:
1057
+ type: array
1058
+ items:
1059
+ $ref: '#/components/schemas/OrgSummary'
1060
+ namespace:
1061
+ type: string
1062
+ status:
1063
+ type: string
1064
+ enum: [ok, degraded, unknown]
1065
+ resources:
1066
+ type: array
1067
+ items:
1068
+ type: object
1069
+ agents:
1070
+ type: object
1071
+ properties:
1072
+ stacks:
1073
+ type: object
1074
+ runs:
1075
+ type: object
1076
+ rules:
1077
+ type: object
1078
+ approvals:
1079
+ type: object
1080
+ views:
1081
+ type: object
1082
+
1083
+ SecretItem:
1084
+ type: object
1085
+ description: Simplified secret view (from AgentSecretGrant)
1086
+ properties:
1087
+ name:
1088
+ type: string
1089
+ example: github-token
1090
+ type:
1091
+ type: string
1092
+ example: Opaque
1093
+ createdAt:
1094
+ type: string
1095
+ format: date-time
1096
+ nullable: true
1097
+ namespace:
1098
+ type: string
1099
+ example: krate-org-default
1100
+ grants:
1101
+ type: array
1102
+ items:
1103
+ type: string
1104
+ description: List of agents or systems that have access
1105
+
1106
+ MemoryQueryInput:
1107
+ type: object
1108
+ required: [query]
1109
+ properties:
1110
+ query:
1111
+ type: string
1112
+ description: Natural language or pattern query
1113
+ example: deployment failures in the auth module
1114
+ strategy:
1115
+ type: string
1116
+ enum: [graph, grep, semantic, auto]
1117
+ default: auto
1118
+ description: Query strategy to use
1119
+ topK:
1120
+ type: integer
1121
+ minimum: 1
1122
+ maximum: 100
1123
+ default: 10
1124
+ description: Maximum number of results to return
1125
+ context:
1126
+ type: object
1127
+ description: Additional context for the query
1128
+ properties:
1129
+ organizationRef:
1130
+ type: string
1131
+ example: default
1132
+ repository:
1133
+ type: string
1134
+ namespace:
1135
+ type: string
1136
+
1137
+ MemoryQueryResult:
1138
+ type: object
1139
+ properties:
1140
+ results:
1141
+ type: array
1142
+ items:
1143
+ type: object
1144
+ properties:
1145
+ id:
1146
+ type: string
1147
+ score:
1148
+ type: number
1149
+ content:
1150
+ type: string
1151
+ metadata:
1152
+ type: object
1153
+ total:
1154
+ type: integer
1155
+ strategy:
1156
+ type: string
1157
+
1158
+ DispatchInput:
1159
+ type: object
1160
+ required: [stackRef]
1161
+ properties:
1162
+ stackRef:
1163
+ type: string
1164
+ description: Name of the AgentStack to dispatch
1165
+ example: claude-code-stack
1166
+ repository:
1167
+ type: string
1168
+ description: Repository name for the agent run context
1169
+ example: my-repo
1170
+ branch:
1171
+ type: string
1172
+ description: Git branch the agent should operate on
1173
+ default: main
1174
+ example: fix/auth-bug
1175
+ prompt:
1176
+ type: string
1177
+ description: Initial prompt or task for the agent
1178
+ example: Fix the failing tests in the auth module
1179
+ context:
1180
+ type: object
1181
+ description: Additional context passed to the agent
1182
+ additionalProperties: true
1183
+
1184
+ SyncInput:
1185
+ type: object
1186
+ required: [kind, localName]
1187
+ properties:
1188
+ bindingName:
1189
+ type: string
1190
+ description: Name of the TransportBinding to sync
1191
+ example: github-binding
1192
+ kind:
1193
+ type: string
1194
+ description: Resource kind being synced
1195
+ example: Repository
1196
+ localName:
1197
+ type: string
1198
+ description: Local resource name
1199
+ example: my-repo
1200
+ namespace:
1201
+ type: string
1202
+ description: Kubernetes namespace (defaults to org namespace)
1203
+ spec:
1204
+ type: object
1205
+ description: Local resource spec
1206
+ additionalProperties: true
1207
+ externalEnvelope:
1208
+ type: object
1209
+ description: External provider metadata
1210
+ properties:
1211
+ nativeId:
1212
+ type: string
1213
+ description: External provider's identifier
1214
+ example: '123456'
1215
+ url:
1216
+ type: string
1217
+ format: uri
1218
+ example: https://github.com/org/repo
1219
+ etag:
1220
+ type: string
1221
+ description: ETag / version for optimistic concurrency
1222
+ providerRef:
1223
+ type: string
1224
+ example: github
1225
+ watermark:
1226
+ type: string
1227
+ description: Sync watermark for incremental syncs
1228
+
1229
+ WebhookPayload:
1230
+ type: object
1231
+ description: |
1232
+ Raw webhook payload from an external provider (GitHub, Gitea, etc.).
1233
+ The server automatically normalizes the event type from the payload structure.
1234
+ properties:
1235
+ action:
1236
+ type: string
1237
+ description: Webhook action (opened, created, labeled, etc.)
1238
+ example: opened
1239
+ pull_request:
1240
+ type: object
1241
+ description: Pull request data (if applicable)
1242
+ issue:
1243
+ type: object
1244
+ description: Issue data (if applicable)
1245
+ comment:
1246
+ type: object
1247
+ description: Comment data (if applicable)
1248
+ label:
1249
+ type: object
1250
+ description: Label data (if applicable)
1251
+ repository:
1252
+ type: object
1253
+ description: Repository data
1254
+ properties:
1255
+ full_name:
1256
+ type: string
1257
+ example: org/my-repo
1258
+ sender:
1259
+ type: object
1260
+ description: Actor who triggered the event
1261
+ properties:
1262
+ login:
1263
+ type: string
1264
+ example: alice
1265
+ workflow_run:
1266
+ type: object
1267
+ description: CI workflow run data (for pipeline events)
1268
+ ref:
1269
+ type: string
1270
+ description: Git ref (for push events)
1271
+ commits:
1272
+ type: array
1273
+ description: Commit list (for push events)
1274
+ items:
1275
+ type: object