@a5c-ai/krate 5.0.1-staging.f672fe79b

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 (174) hide show
  1. package/Dockerfile +29 -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 +2407 -0
  6. package/dist/krate-lifecycle.json +201 -0
  7. package/dist/krate-runtime-snapshot.json +2955 -0
  8. package/dist/krate-summary.json +687 -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/glossary.md +66 -0
  27. package/docs/agents/implementation-blueprint.md +324 -0
  28. package/docs/agents/implementation-rollout-slices.md +251 -0
  29. package/docs/agents/memory-context-integration-spec.md +194 -0
  30. package/docs/agents/memory-ontology-schema-spec.md +253 -0
  31. package/docs/agents/memory-operations-runbook.md +121 -0
  32. package/docs/agents/mvp-vertical-slice-spec.md +146 -0
  33. package/docs/agents/observability-audit-spec.md +265 -0
  34. package/docs/agents/operator-runbook.md +174 -0
  35. package/docs/agents/org-memory-api-payload-examples.md +333 -0
  36. package/docs/agents/org-memory-controller-sequence-spec.md +181 -0
  37. package/docs/agents/org-memory-e2e-fixture-plan.md +161 -0
  38. package/docs/agents/org-memory-ui-implementation-map.md +114 -0
  39. package/docs/agents/org-memory-vertical-slice-spec.md +168 -0
  40. package/docs/agents/org-resource-model-delta-spec.md +111 -0
  41. package/docs/agents/org-route-resource-model-spec.md +183 -0
  42. package/docs/agents/org-scoping-namespace-spec.md +114 -0
  43. package/docs/agents/rbac-secrets-management-spec.md +406 -0
  44. package/docs/agents/repository-page-integration-spec.md +255 -0
  45. package/docs/agents/resource-contract-examples.md +808 -0
  46. package/docs/agents/resource-relationship-map.md +190 -0
  47. package/docs/agents/security-threat-model.md +188 -0
  48. package/docs/agents/shared-memory-company-brain-spec.md +358 -0
  49. package/docs/agents/storage-migration-spec.md +168 -0
  50. package/docs/agents/subagent-orchestration-spec.md +152 -0
  51. package/docs/agents/system-overview.md +88 -0
  52. package/docs/agents/tools-mcp-skills-spec.md +189 -0
  53. package/docs/agents/traceability-matrix.md +79 -0
  54. package/docs/agents/ui-flow-spec.md +211 -0
  55. package/docs/agents/ui-ux-system-spec.md +426 -0
  56. package/docs/agents/workspace-lifecycle-spec.md +166 -0
  57. package/docs/architecture-spec.md +78 -0
  58. package/docs/components/control-plane.md +78 -0
  59. package/docs/components/data-plane.md +69 -0
  60. package/docs/components/hooks-events.md +67 -0
  61. package/docs/components/identity-rbac-policy.md +73 -0
  62. package/docs/components/kubevela-oam.md +70 -0
  63. package/docs/components/operations-publishing.md +81 -0
  64. package/docs/components/runners-ci.md +66 -0
  65. package/docs/components/web-ui.md +94 -0
  66. package/docs/external/README.md +47 -0
  67. package/docs/external/bidirectional-sync-design.md +134 -0
  68. package/docs/external/cicd-interface.md +64 -0
  69. package/docs/external/external-backend-controllers.md +170 -0
  70. package/docs/external/external-backend-crds.md +234 -0
  71. package/docs/external/external-backend-ui-spec.md +151 -0
  72. package/docs/external/external-backend-ux-flows.md +115 -0
  73. package/docs/external/external-object-mapping.md +125 -0
  74. package/docs/external/git-forge-interface.md +68 -0
  75. package/docs/external/github-integration-design.md +151 -0
  76. package/docs/external/issue-tracking-interface.md +66 -0
  77. package/docs/external/provider-capability-manifests.md +204 -0
  78. package/docs/external/provider-catalog.md +139 -0
  79. package/docs/external/provider-rollout-testing.md +78 -0
  80. package/docs/external/research-results.md +48 -0
  81. package/docs/external/security-auth-permissions.md +81 -0
  82. package/docs/external/sync-state-machines.md +108 -0
  83. package/docs/external/unified-external-backend-model.md +107 -0
  84. package/docs/external/user-facing-changes.md +67 -0
  85. package/docs/gaps.md +161 -0
  86. package/docs/install.md +94 -0
  87. package/docs/krate-design.md +334 -0
  88. package/docs/local-minikube.md +55 -0
  89. package/docs/ontology/README.md +32 -0
  90. package/docs/ontology/bounded-contexts.md +29 -0
  91. package/docs/ontology/events-and-hooks.md +32 -0
  92. package/docs/ontology/oam-kubevela.md +32 -0
  93. package/docs/ontology/operations-and-release.md +25 -0
  94. package/docs/ontology/personas-and-actors.md +32 -0
  95. package/docs/ontology/policies-and-invariants.md +33 -0
  96. package/docs/ontology/problem-space.md +30 -0
  97. package/docs/ontology/resource-contracts.md +40 -0
  98. package/docs/ontology/resource-taxonomy.md +42 -0
  99. package/docs/ontology/runners-and-ci.md +29 -0
  100. package/docs/ontology/solution-space.md +24 -0
  101. package/docs/ontology/storage-and-data-boundaries.md +29 -0
  102. package/docs/ontology/validation-matrix.md +24 -0
  103. package/docs/ontology/web-ui-excellent-flows.md +32 -0
  104. package/docs/ontology/workflows.md +39 -0
  105. package/docs/ontology/world.md +35 -0
  106. package/docs/product-requirements.md +62 -0
  107. package/docs/roadmap-mvp.md +87 -0
  108. package/docs/system-requirements.md +90 -0
  109. package/docs/tests/README.md +53 -0
  110. package/docs/tests/agent-qa-plan.md +63 -0
  111. package/docs/tests/browser-ui-tests.md +62 -0
  112. package/docs/tests/ci-quality-gates.md +48 -0
  113. package/docs/tests/coverage-model.md +64 -0
  114. package/docs/tests/e2e-scenario-tests.md +53 -0
  115. package/docs/tests/fixtures-test-data.md +63 -0
  116. package/docs/tests/observability-reliability-tests.md +54 -0
  117. package/docs/tests/product-test-matrix.md +145 -0
  118. package/docs/tests/qa-adoption-roadmap.md +130 -0
  119. package/docs/tests/qa-automation-plan.md +101 -0
  120. package/docs/tests/security-compliance-tests.md +57 -0
  121. package/docs/tests/test-framework-tools.md +88 -0
  122. package/docs/tests/test-suite-layout.md +121 -0
  123. package/docs/tests/unit-integration-tests.md +48 -0
  124. package/docs/todo-kyverno +714 -0
  125. package/docs/user-stories.md +78 -0
  126. package/examples/minikube-demo.yaml +190 -0
  127. package/examples/oam-application.yaml +23 -0
  128. package/examples/policy-kyverno-pr-title.yaml +18 -0
  129. package/package.json +63 -0
  130. package/scripts/build.mjs +29 -0
  131. package/scripts/setup-minikube.mjs +65 -0
  132. package/scripts/smoke.mjs +37 -0
  133. package/scripts/validate-doc-coverage.mjs +152 -0
  134. package/scripts/validate-package.mjs +93 -0
  135. package/scripts/validate-ui.mjs +207 -0
  136. package/src/agent-approval-controller.js +123 -0
  137. package/src/agent-context-bundles.js +242 -0
  138. package/src/agent-dispatch-controller.js +86 -0
  139. package/src/agent-mux-client.js +280 -0
  140. package/src/agent-permission-review.js +162 -0
  141. package/src/agent-stack-controller.js +296 -0
  142. package/src/agent-trigger-controller.js +108 -0
  143. package/src/api-controller.js +206 -0
  144. package/src/argocd-gitops.js +43 -0
  145. package/src/auth.js +265 -0
  146. package/src/component-catalog.js +41 -0
  147. package/src/control-plane.js +136 -0
  148. package/src/controller-client.js +38 -0
  149. package/src/controller-ui.js +538 -0
  150. package/src/data-plane.js +178 -0
  151. package/src/gitea-backend.js +95 -0
  152. package/src/handoff.js +98 -0
  153. package/src/hooks-events.js +63 -0
  154. package/src/http-server.js +151 -0
  155. package/src/identity-policy.js +86 -0
  156. package/src/index.js +30 -0
  157. package/src/kubernetes-controller.js +812 -0
  158. package/src/kubernetes-resource-gateway.js +48 -0
  159. package/src/operations.js +112 -0
  160. package/src/resource-model.js +203 -0
  161. package/src/runners-ci.js +48 -0
  162. package/src/runtime.js +196 -0
  163. package/src/web-ui.js +40 -0
  164. package/tests/agent-approval-controller.test.js +173 -0
  165. package/tests/agent-context-bundles.test.js +278 -0
  166. package/tests/agent-dispatch-controller.test.js +176 -0
  167. package/tests/agent-mux-client.test.js +204 -0
  168. package/tests/agent-permission-review.test.js +209 -0
  169. package/tests/agent-resources.test.js +212 -0
  170. package/tests/agent-stack-controller.test.js +221 -0
  171. package/tests/agent-trigger-controller.test.js +211 -0
  172. package/tests/deployment.test.js +395 -0
  173. package/tests/e2e/lifecycle.test.js +117 -0
  174. package/tests/krate.test.js +727 -0
package/Dockerfile ADDED
@@ -0,0 +1,29 @@
1
+ FROM node:20-alpine AS deps
2
+ WORKDIR /app
3
+ COPY package.json package-lock.json ./
4
+ RUN npm ci
5
+
6
+ FROM deps AS build
7
+ COPY . .
8
+ RUN npm run build
9
+ RUN npm run ui:build
10
+ RUN npm prune --omit=dev
11
+
12
+ FROM node:20-alpine AS runtime
13
+ WORKDIR /app
14
+ RUN apk add --no-cache ca-certificates curl && curl -fsSL -o /usr/local/bin/kubectl https://dl.k8s.io/release/v1.32.2/bin/linux/amd64/kubectl && chmod +x /usr/local/bin/kubectl
15
+ ENV NODE_ENV=production
16
+ ENV PORT=3080
17
+ COPY --from=build /app/package.json /app/package-lock.json ./
18
+ COPY --from=build /app/node_modules ./node_modules
19
+ COPY --from=build /app/apps/web/.next/standalone ./
20
+ COPY --from=build /app/apps/web/.next/static ./apps/web/.next/static
21
+ RUN printf '{"type":"commonjs"}\n' > apps/web/package.json
22
+ COPY --from=build /app/bin ./bin
23
+ COPY --from=build /app/src ./src
24
+ COPY --from=build /app/dist ./dist
25
+ COPY --from=build /app/charts ./charts
26
+ COPY --from=build /app/examples ./examples
27
+ EXPOSE 3080
28
+ HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 CMD node -e "fetch('http://127.0.0.1:'+(process.env.PORT||3080)+'/healthz').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"
29
+ CMD ["node", "bin/krate-server.mjs"]
package/README.md ADDED
@@ -0,0 +1,183 @@
1
+ # Krate
2
+
3
+ Krate is a Kubernetes-native Git forge runtime. Repositories, pull requests, CI, webhooks, policy, and UI flows execute through Kubernetes-style resources, Argo CD GitOps reconciliation, and a Gitea-backed Git hosting backend with explicit storage boundaries.
4
+
5
+ This repository is the executable MVP runtime and handoff package for the specs in `docs/`. It includes a stateful Node.js runtime, HTTP API server, production-shaped Kubernetes package surface, deterministic e2e/package validation, a minikube setup script, a production-built controller container, and safe GitHub publishing lanes for package, chart, image, and generated artifacts.
6
+
7
+ ## What is implemented
8
+
9
+ - Kubernetes-style resource taxonomy for `Repository`, `PullRequest`, `Issue`, `Review`, `Pipeline`, `Job`, `RunnerPool`, `WebhookSubscription`, `WebhookDelivery`, `RefPolicy`, `BranchProtection`, `View`, and `Selector`.
10
+ - Control-plane behavior for validation, storage routing, watches, RBAC checks, admission policy, and audit warnings.
11
+ - Data-plane behavior backed by Gitea for repository hosting, SSH deploy keys, collaborators/teams, protected branches, webhooks, object storage records, and search indexing queueing.
12
+ - Runner/CI behavior for trusted and forked jobs, projected service-account identity, isolation policy, checks completion, and rerun-from-step behavior.
13
+ - Webhook/event behavior for subscriptions, signed deliveries, inspection, replay, and PR lifecycle notifications.
14
+ - Runnable local runtime and HTTP API for repository creation, PR creation, checks, review approval, merge, resource listing, and snapshot export/import restore.
15
+ - UI and operations handoff models for excellent flows, YAML transparency, Argo CD Application manifests, Gitea-backed install manifests, observability, backup/restore, and release gates.
16
+ - Integrated component catalog and lifecycle snapshot for all implementation areas.
17
+ - Next.js console under `apps/web` backed by the executable Krate runtime model.
18
+ - Production-shaped controller container using `bin/krate-server.mjs`, `/healthz`, and the same runtime API covered by tests.
19
+ - GitHub Actions publishing for validated package artifacts, dist/chart/example bundles, GHCR controller images, tagged Helm chart OCI pushes, and AKS Helm deployments for develop/staging/main.
20
+
21
+ ## Quick start
22
+
23
+ ```bash
24
+ npm run check
25
+ npm run demo
26
+ npm run demo -- --json
27
+ npm run serve
28
+ npm run e2e
29
+ npm run package:check
30
+ npm run setup:minikube -- --dry-run
31
+ ```
32
+
33
+ `npm run check` runs the full local gate: build, docs/ontology coverage, unit tests, e2e package validation, package checks, smoke assertions, UI validation, and the Next.js production build. `npm run serve` starts the local runtime API used by the lifecycle tests.
34
+
35
+ ## Entrypoints
36
+
37
+ - Library API: `src/index.js`
38
+ - CLI demo: `bin/krate-demo.mjs` or package bin `krate-demo`
39
+ - Runtime server: `bin/krate-server.mjs` or package bin `krate-server` (`npm run serve`)
40
+ - Public preview: `public/index.html`
41
+ - Next.js UI: `apps/web` (`npm run dev`, `npm run ui:build`)
42
+ - Product home: `https://a5c.ai/krate`
43
+ - Helm-style package: `charts/krate`
44
+ - Controller image: `Dockerfile` builds `ghcr.io/${{ github.repository }}/krate-controller`
45
+ - Publishing workflow: `.github/workflows/publish.yml` (develop -> `krate-develop.a5c.ai`, staging -> `krate-staging.a5c.ai`, main -> `krate.a5c.ai`)
46
+ - Minikube setup: `scripts/setup-minikube.mjs`
47
+ - Demo resources: `examples/minikube-demo.yaml`
48
+ - Generated handoff summary: `dist/krate-summary.json`
49
+ - Generated lifecycle snapshot: `dist/krate-lifecycle.json`
50
+ - Documentation index: `docs/README.md`
51
+
52
+
53
+ ## Sign-in and user management
54
+
55
+ Krate installs with GitHub login enabled by default and optional SSO disabled until an operator supplies provider settings. SSO is installation configuration only: admins manage users, teams, invites, repository access, and identity mappings in Krate after the provider is configured through Helm values.
56
+
57
+ ### Create a GitHub OAuth client
58
+
59
+ 1. In GitHub, open **Settings -> Developer settings -> OAuth Apps -> New OAuth App**.
60
+ 2. Set the homepage URL to the public Krate URL, for example `https://krate.example.com`.
61
+ 3. Set the callback URL to `https://krate.example.com/api/auth/callback/github`.
62
+ 4. Copy the generated client ID and client secret into a private values file or an existing Kubernetes Secret.
63
+
64
+ ```yaml
65
+ auth:
66
+ github:
67
+ enabled: true
68
+ clientId: "<github-client-id>"
69
+ clientSecret: "<github-client-secret>"
70
+ ```
71
+
72
+ Install or upgrade with:
73
+
74
+ ```bash
75
+ helm upgrade --install krate charts/krate -n krate-system --create-namespace -f auth-values.yaml
76
+ ```
77
+
78
+ To disable GitHub login:
79
+
80
+ ```yaml
81
+ auth:
82
+ github:
83
+ enabled: false
84
+ ```
85
+
86
+ ### Configure SSO
87
+
88
+ Create an OAuth/OIDC client in your identity provider with callback URL `https://krate.example.com/api/auth/callback/sso`, then pass the provider endpoints through Helm values. This configuration is intentionally not exposed in the UI.
89
+
90
+ ```yaml
91
+ auth:
92
+ sso:
93
+ enabled: true
94
+ providerName: "Company SSO"
95
+ issuerUrl: "https://idp.example.com"
96
+ authorizationUrl: "https://idp.example.com/oauth2/v1/authorize"
97
+ tokenUrl: "https://idp.example.com/oauth2/v1/token"
98
+ userInfoUrl: "https://idp.example.com/oauth2/v1/userinfo"
99
+ clientId: "<sso-client-id>"
100
+ clientSecret: "<sso-client-secret>"
101
+ scopes: "openid profile email groups"
102
+ ```
103
+
104
+ For existing secrets, create keys named `github-client-id`, `github-client-secret`, `sso-client-id`, and `sso-client-secret`, then reference them:
105
+
106
+ When every enabled provider uses `existingSecret`, the chart does not render an additional Krate-managed auth Secret. If only one provider uses an existing Secret, the chart renders only the inline-managed provider keys.
107
+
108
+ ```yaml
109
+ auth:
110
+ github:
111
+ existingSecret: krate-auth-secrets
112
+ sso:
113
+ existingSecret: krate-auth-secrets
114
+ ```
115
+
116
+ When a cluster ingress or identity proxy delegates authentication, set the forwarded identity headers at install time:
117
+
118
+ ```yaml
119
+ auth:
120
+ delegatedIdentity:
121
+ enabled: true
122
+ userHeader: x-forwarded-user
123
+ groupsHeader: x-forwarded-groups
124
+ ```
125
+
126
+ For local Next.js development, `http://localhost:3000/api/auth/delegated` can sign in without a proxy header when delegated identity is enabled. It defaults to `local-developer` in `krate:repo-admins`, and can be overridden with `?user=alice&email=alice@example.test&groups=krate:developers` or disabled with `KRATE_AUTH_DELEGATED_LOCAL_DEVELOPMENT=false`.
127
+
128
+ All web UI pages and authenticated API routes require the `krate_session` login cookie. `/login` and `/api/auth/*` stay public so users can start OAuth, delegated sign-in, or logout flows.
129
+
130
+ Krate stores `User`, `Team`, `Invite`, `IdentityMapping`, `RepositoryPermission`, and `SSHKey` resources. OAuth callbacks and delegated identity headers auto-register the Krate user plus identity mapping, and controllers reconcile those resources into workspace access, repository account mappings, team membership, SSH keys, and repository permissions while the UI exposes only Krate people and access flows.
131
+
132
+ ## Runtime API
133
+
134
+ Start the local server with `npm run serve`, then use:
135
+
136
+ - `GET /healthz` — health check.
137
+ - `GET /api/snapshot` — complete runtime resource/event/audit snapshot.
138
+ - `GET /api/resources/:kind` — Kubernetes-style list for a resource kind.
139
+ - `POST /api/repositories` — create a repository resource backed by the Gitea Git hosting integration plan.
140
+ - `POST /api/pullrequests` — create a PR, enqueue CI jobs, and deliver a webhook.
141
+ - `POST /api/pullrequests/:name/checks/complete` — complete the PR pipeline.
142
+ - `POST /api/pullrequests/:name/reviews` — add an approval or change-request review.
143
+ - `POST /api/pullrequests/:name/merge` — enforce checks/reviews, execute the Gitea-backed receive-pack path, and emit merge webhook delivery.
144
+
145
+ ## Development commands
146
+
147
+ - `npm run build` — generate `dist/krate-summary.json` and `dist/krate-lifecycle.json` from the executable model.
148
+ - `npm run validate:docs` — verify required docs, ontology files, and source terms.
149
+ - `npm test` — run Node test coverage for the model, runtime, API, and handoff surfaces.
150
+ - `npm run smoke` — execute MVP smoke assertions and print flow/storage status.
151
+ - `npm run demo` — print the human-readable handoff summary.
152
+ - `npm run serve` — start the local Krate HTTP API.
153
+ - `npm run ui:dev` / `npm run dev` — start the Next.js implementation console.
154
+ - `npm run ui:validate` — verify the UI files and model-data contract.
155
+ - `npm run ui:build` — build the Next.js console for production using the webpack builder for deterministic standalone tracing of the Node-backed Kubernetes controller routes.
156
+ - `npm run dev:check` — quick developer loop for UI contract and unit tests.
157
+ - `npm run check` — run the complete quality gate.
158
+
159
+ ## Documentation map
160
+
161
+ Start with `docs/README.md`, then read:
162
+
163
+ - `docs/product-requirements.md`
164
+ - `docs/system-requirements.md`
165
+ - `docs/architecture-spec.md`
166
+ - `docs/user-stories.md`
167
+ - `docs/roadmap-mvp.md`
168
+ - `docs/install.md`
169
+ - `docs/local-minikube.md`
170
+ - `charts/krate/README.md`
171
+ - `docs/ontology/README.md`
172
+
173
+ ## Release boundary
174
+
175
+ The current package is ready as a verified Kubernetes-native runtime contract, chart package, local minikube handoff, controller image build, and implementation artifact. The chart validates the Kubernetes install contract locally through e2e/package gates, the Dockerfile packages the runnable controller API and Next.js web app, and the publishing workflow safely pushes images/charts from non-PR contexts while deploying branch commits to the existing AKS cluster at `krate-develop.a5c.ai`, `krate-staging.a5c.ai`, and `krate.a5c.ai`.
176
+
177
+ ## QA automation
178
+
179
+ The product-wide QA strategy lives in `docs/tests/README.md`. Current executable gates are `npm run check`, `npm test`, `npm run e2e`, `npm run validate:docs`, `npm run package:check`, `npm run smoke`, `npm run ui:validate`, and `npm run ui:build`. Future planned gates cover browser automation, coverage, security, live integrations, and agent/company-brain workflows.
180
+
181
+ ## External backend integrations
182
+
183
+ Design docs for GitHub and future externally managed backends live in `docs/external/README.md`. The model splits providers into three optional interfaces: issue tracking, CI/CD, and git forge, with GitHub expected to support all three through GitHub Apps, APIs, webhooks, and bidirectional sync.
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+ import { readFile } from 'node:fs/promises';
3
+ import { createKrateMvpDemo, createKrateHandoffSummary, formatHandoffSummary, runSmokeAssertions } from '../src/index.js';
4
+
5
+ const args = new Set(process.argv.slice(2));
6
+ if (args.has('--help') || args.has('-h')) {
7
+ console.log(`Usage: krate-demo [--json]\n\nPrint the Krate executable MVP handoff summary.\n\nOptions:\n --json Emit machine-readable JSON\n --help Show this help`);
8
+ process.exit(0);
9
+ }
10
+
11
+ const packageInfo = JSON.parse(await readFile(new URL('../package.json', import.meta.url), 'utf8'));
12
+ const demo = createKrateMvpDemo();
13
+ const smoke = runSmokeAssertions(demo);
14
+ demo.smoke = smoke;
15
+ const summary = createKrateHandoffSummary(demo, { packageInfo });
16
+
17
+ if (args.has('--json')) {
18
+ console.log(JSON.stringify(summary, null, 2));
19
+ } else {
20
+ process.stdout.write(formatHandoffSummary(summary));
21
+ }
22
+
23
+ if (!smoke.ok) process.exit(1);
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env node
2
+ import { createKrateHttpServer } from '../src/http-server.js';
3
+
4
+ const portArg = process.argv.find((arg) => arg.startsWith('--port='));
5
+ const port = Number(portArg?.split('=')[1] || process.env.PORT || 3080);
6
+ const server = createKrateHttpServer();
7
+ server.listen(port, () => {
8
+ console.log(JSON.stringify({
9
+ status: 'listening',
10
+ port,
11
+ mode: 'kubernetes-api',
12
+ endpoints: ['/healthz', '/api/controller', '/api/controller/resources', '/api/repositories', '/api/watch/*', '/api/git-proxy']
13
+ }));
14
+ });