@cat-factory/server 0.269.3 → 0.270.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.
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +7 -0
- package/dist/app.js.map +1 -1
- package/dist/config/problems.d.ts.map +1 -1
- package/dist/config/problems.js +2 -1
- package/dist/config/problems.js.map +1 -1
- package/dist/github/GitHubPullRequestMerger.d.ts.map +1 -1
- package/dist/github/GitHubPullRequestMerger.js +2 -1
- package/dist/github/GitHubPullRequestMerger.js.map +1 -1
- package/dist/github/reviewPosting.d.ts.map +1 -1
- package/dist/github/reviewPosting.js +2 -1
- package/dist/github/reviewPosting.js.map +1 -1
- package/dist/modules/llmProxy/LlmProxyController.d.ts.map +1 -1
- package/dist/modules/llmProxy/LlmProxyController.js +5 -5
- package/dist/modules/llmProxy/LlmProxyController.js.map +1 -1
- package/dist/modules/models/ModelController.d.ts.map +1 -1
- package/dist/modules/models/ModelController.js +6 -38
- package/dist/modules/models/ModelController.js.map +1 -1
- package/dist/modules/models/workspaceCatalog.d.ts +22 -0
- package/dist/modules/models/workspaceCatalog.d.ts.map +1 -0
- package/dist/modules/models/workspaceCatalog.js +51 -0
- package/dist/modules/models/workspaceCatalog.js.map +1 -0
- package/dist/modules/notifications/NotificationRelayController.d.ts.map +1 -1
- package/dist/modules/notifications/NotificationRelayController.js +3 -3
- package/dist/modules/notifications/NotificationRelayController.js.map +1 -1
- package/dist/modules/persistence/GitHubDelegationController.js +2 -2
- package/dist/modules/persistence/GitHubDelegationController.js.map +1 -1
- package/dist/modules/publicApi/PublicProvisioningController.d.ts +50 -0
- package/dist/modules/publicApi/PublicProvisioningController.d.ts.map +1 -0
- package/dist/modules/publicApi/PublicProvisioningController.js +426 -0
- package/dist/modules/publicApi/PublicProvisioningController.js.map +1 -0
- package/dist/modules/publicApi/boardProjection.d.ts +9 -2
- package/dist/modules/publicApi/boardProjection.d.ts.map +1 -1
- package/dist/modules/publicApi/boardProjection.js +46 -1
- package/dist/modules/publicApi/boardProjection.js.map +1 -1
- package/dist/modules/publicApi/openapiDocument.generated.d.ts +1 -1
- package/dist/modules/publicApi/openapiDocument.generated.d.ts.map +1 -1
- package/dist/modules/publicApi/openapiDocument.generated.js +1 -1
- package/dist/modules/publicApi/openapiDocument.generated.js.map +1 -1
- package/dist/modules/telemetry/TelemetryIngestController.d.ts.map +1 -1
- package/dist/modules/telemetry/TelemetryIngestController.js +2 -1
- package/dist/modules/telemetry/TelemetryIngestController.js.map +1 -1
- package/dist/modules/telemetry/TelemetryReadController.d.ts.map +1 -1
- package/dist/modules/telemetry/TelemetryReadController.js +2 -1
- package/dist/modules/telemetry/TelemetryReadController.js.map +1 -1
- package/dist/modules/webSearch/WebSearchProxyController.js +2 -2
- package/dist/modules/webSearch/WebSearchProxyController.js.map +1 -1
- package/dist/modules/workspaces/WorkspaceController.d.ts.map +1 -1
- package/dist/modules/workspaces/WorkspaceController.js +2 -2
- package/dist/modules/workspaces/WorkspaceController.js.map +1 -1
- package/dist/modules/workspaces/infraSetup.d.ts.map +1 -1
- package/dist/modules/workspaces/infraSetup.js +2 -1
- package/dist/modules/workspaces/infraSetup.js.map +1 -1
- package/dist/notifications/notificationDelivery.js +3 -3
- package/dist/notifications/notificationDelivery.js.map +1 -1
- package/dist/observability/logger.d.ts +1 -1
- package/dist/observability/logger.d.ts.map +1 -1
- package/dist/observability/logger.js +2 -2
- package/dist/observability/logger.js.map +1 -1
- package/dist/runtime/platformHealth.js +2 -2
- package/dist/runtime/platformHealth.js.map +1 -1
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationRelayController.js","sourceRoot":"","sources":["../../../src/modules/notifications/NotificationRelayController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAE3B,OAAO,
|
|
1
|
+
{"version":3,"file":"NotificationRelayController.js","sourceRoot":"","sources":["../../../src/modules/notifications/N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AC3F,CAAC;QACD,IAAI,CAAC,YAAY;YAAE,OAAO,MAAM,EAAE,CAAA;QAElC,0FAA0F;QAC1F,gGAAgG;QAChG,oEAAoE;QACpE,IAAI,CAAC;YACH,MAAM,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,YAAY,EAAE,MAAM,CAAC,CAAA;QAChE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,GAAG,CAAC,IAAI,CAAC,0CAA0C,EAAE;gBACnD,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,cAAc,EAAE,IAAI,CAAC,cAAc;gBACnC,GAAG,EAAE,eAAe,CAAC,KAAK,CAAC;aAC5B,CAAC,CAAA;QACJ,CAAC;QACD,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAA;IAC7B,CAAC,CAAC,CAAA;IAEF,OAAO,GAAG,CAAA;AACZ,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Hono } from 'hono';
|
|
2
2
|
import { verifyMachineRequest } from '../../auth/machineGate.js';
|
|
3
3
|
import { logger } from '../../observability/logger.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getErrorMessage, RateLimitedError, UnavailableError } from '@cat-factory/kernel';
|
|
5
5
|
/**
|
|
6
6
|
* Generous for a legitimate satellite: the client (`DelegatedAppTokenSource`) memoises a
|
|
7
7
|
* minted token for 60s per installation, so steady-state traffic is ~1 mint/min per
|
|
@@ -149,7 +149,7 @@ export function githubDelegationController(options = {}) {
|
|
|
149
149
|
// error's message never leaks over the machine API.
|
|
150
150
|
log.error('github delegation: mint failed', {
|
|
151
151
|
installationId,
|
|
152
|
-
err:
|
|
152
|
+
err: getErrorMessage(error),
|
|
153
153
|
});
|
|
154
154
|
return c.json({ error: { code: 'internal', message: 'Internal error' } }, 500);
|
|
155
155
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GitHubDelegationController.js","sourceRoot":"","sources":["../../../src/modules/persistence/GitHubDelegationController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAE3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAEhE,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AACtD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"GitHubDelegationController.js","sourceRoot":"","sources":["../../../src/modules/persistence/GitHubDelegationController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAE3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAEhE,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AACtD,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAwDzF;;;;;GAKG;AACH,MAAM,kBAAkB,GAA8B,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAA;AAErF;;;;;;GAMG;AACH,SAAS,0BAA0B,CAAC,GAAY;IAC9C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAA;IAC7D,MAAM,GAAG,GAAa,EAAE,CAAA;IACxB,KAAK,MAAM,KAAK,IAAI,GAAG,EAAE,CAAC;QACxB,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC;YAAE,OAAO,SAAS,CAAA;QACzF,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACjB,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AAED,MAAM,UAAU,0BAA0B,CACxC,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EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC3D,CAAC,CAAA;YACF,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,CAAC,CAAA;QACvC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,mFAAmF;YACnF,oDAAoD;YACpD,GAAG,CAAC,KAAK,CAAC,gCAAgC,EAAE;gBAC1C,cAAc;gBACd,GAAG,EAAE,eAAe,CAAC,KAAK,CAAC;aAC5B,CAAC,CAAA;YACF,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,gBAAgB,EAAE,EAAE,EAAE,GAAG,CAAC,CAAA;QAChF,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,GAAG,CAAA;AACZ,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type BootstrapJob, type GitHubConnection, type KubernetesManifestSource, type PublicBootstrapJob, type PublicKubernetesManifestSource, type ServiceProvisioning, type UpdatePublicServiceInput } from '@cat-factory/contracts';
|
|
2
|
+
import { Hono } from 'hono';
|
|
3
|
+
import type { AppEnv, ServerContainer } from '../../http/env.js';
|
|
4
|
+
/**
|
|
5
|
+
* The workspace's source-control connection, whichever seam holds it, or the 503 when this
|
|
6
|
+
* deployment wires no source control at all.
|
|
7
|
+
*
|
|
8
|
+
* Two seams and not one, because a GitLab-only deployment builds no `github` module: that module
|
|
9
|
+
* requires the App's webhook verifier, which is App-specific (a GitLab workspace ingests through
|
|
10
|
+
* the neutral `/vcs/:provider/webhooks` route instead), so it is absent exactly when the PAT
|
|
11
|
+
* connect service is the thing holding the connection. Reading only the module answered a
|
|
12
|
+
* provider-neutral question with "source control is not configured" at a workspace that plainly
|
|
13
|
+
* had a connection, and the acceptance preflight then reported an unknown probe failure for a row
|
|
14
|
+
* it could read.
|
|
15
|
+
*
|
|
16
|
+
* The module is preferred when present, because with BOTH wired it is the one that routes an
|
|
17
|
+
* installation to its provider's client; the PAT service is the fallback, not a second opinion.
|
|
18
|
+
*/
|
|
19
|
+
export declare function readVcsConnection(container: ServerContainer, workspaceId: string): Promise<GitHubConnection | null>;
|
|
20
|
+
export declare function publicProvisioningController(): Hono<AppEnv>;
|
|
21
|
+
/**
|
|
22
|
+
* Project a bootstrap run onto the wire.
|
|
23
|
+
*
|
|
24
|
+
* `blockId` becomes `serviceId` because that is what this surface calls a service frame everywhere
|
|
25
|
+
* else, and a caller joins it straight onto `/api/v1/services/:serviceId/tasks`.
|
|
26
|
+
*
|
|
27
|
+
* The structured failure is FLATTENED into its three human-readable parts rather than published as a
|
|
28
|
+
* nested object: the kind (whether a retry could help), the detail, and the hint. All three are
|
|
29
|
+
* prose the platform wrote for whoever is reading a failed run; what is left behind is the
|
|
30
|
+
* remainder whose shape is genuinely internal. See the schema for the full accounting.
|
|
31
|
+
*/
|
|
32
|
+
export declare function toPublicBootstrapJob(job: BootstrapJob): PublicBootstrapJob;
|
|
33
|
+
/**
|
|
34
|
+
* Lower a public manifest source onto the internal one, for the same reason and with the same
|
|
35
|
+
* exhaustiveness as the URL source above.
|
|
36
|
+
*/
|
|
37
|
+
export declare function toKubernetesManifestSource(source: PublicKubernetesManifestSource): KubernetesManifestSource;
|
|
38
|
+
/**
|
|
39
|
+
* Lower a public service patch onto the board patch.
|
|
40
|
+
*
|
|
41
|
+
* An omitted key is left OUT rather than written as `undefined`: `updateBlock` patches only the
|
|
42
|
+
* keys present, so spreading an absent `provisioning` through would clear the stored one and
|
|
43
|
+
* silently un-deploy a service whose title was being corrected.
|
|
44
|
+
*/
|
|
45
|
+
export declare function toBlockPatch(input: UpdatePublicServiceInput, stored: ServiceProvisioning | undefined): {
|
|
46
|
+
title?: string;
|
|
47
|
+
description?: string;
|
|
48
|
+
provisioning?: ServiceProvisioning;
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=PublicProvisioningController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PublicProvisioningController.d.ts","sourceRoot":"","sources":["../../../src/modules/publicApi/PublicProvisioningController.ts"],"names":[],"mappings":"AAAA,OAAO,EAUL,KAAK,YAAY,EAEjB,KAAK,gBAAgB,EAErB,KAAK,wBAAwB,EAG7B,KAAK,kBAAkB,EAGvB,KAAK,8BAA8B,EAOnC,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC9B,MAAM,wBAAwB,CAAA;AAS/B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAE3B,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AA8ChE;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,iBAAiB,CACrC,SAAS,EAAE,eAAe,EAC1B,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAQlC;AA+BD,wBAAgB,4BAA4B,IAAI,IAAI,CAAC,MAAM,CAAC,CAO3D;AAID;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,YAAY,GAAG,kBAAkB,CAgB1E;AAuGD;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,8BAA8B,GACrC,wBAAwB,CAW1B;AAmFD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,wBAAwB,EAC/B,MAAM,EAAE,mBAAmB,GAAG,SAAS,GACtC;IACD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,mBAAmB,CAAA;CACnC,CAQA"}
|
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
import { connectPublicEnvironmentContract, getPublicRepoBootstrapContract, getPublicVcsConnectionContract, listPublicMergePresetsContract, listPublicWiredModelsContract, startPublicRepoBootstrapContract, testPublicEnvironmentConnectionContract, updatePublicServiceContract, UNATTRIBUTED_BLOCK_EDIT_AUTHORITY, } from '@cat-factory/contracts';
|
|
2
|
+
import { NotFoundError, UnavailableError } from '@cat-factory/kernel';
|
|
3
|
+
import { buildHonoRoute } from '@toad-contracts/hono';
|
|
4
|
+
import { Hono } from 'hono';
|
|
5
|
+
import { requireCapability } from '../../http/guards.js';
|
|
6
|
+
import { resolveWorkspaceModelCatalog } from '../models/workspaceCatalog.js';
|
|
7
|
+
import { toPublicService } from './boardProjection.js';
|
|
8
|
+
import { authorizeOrThrow } from './publicApiAuth.js';
|
|
9
|
+
// DEPLOYMENT PROVISIONING on `/api/v1`: bringing a workspace from "connected" to "able to run a
|
|
10
|
+
// pipeline". Until this existed the first four steps of automating a deployment had no public
|
|
11
|
+
// counterpart at all, so a caller that could provision its own keys, enrol its own webhook and file
|
|
12
|
+
// its own work still had to open a browser to have a repository to file it against.
|
|
13
|
+
//
|
|
14
|
+
// Its own controller rather than more of `PublicBoardController`: that file is about the shape of a
|
|
15
|
+
// board an integration drives, where everything here happens BEFORE there is a board to shape, and
|
|
16
|
+
// it is the only place on this surface that accepts an infrastructure credential.
|
|
17
|
+
//
|
|
18
|
+
// Five rules, each enforced below rather than merely intended:
|
|
19
|
+
//
|
|
20
|
+
// 1. **Every call delegates to the SAME service method the SPA's own controller calls.** A guard
|
|
21
|
+
// (the bootstrap preflight that refuses a non-empty repository, the monorepo subdirectory rules,
|
|
22
|
+
// the engine's own apiserver probe) cannot differ by which door the request came through.
|
|
23
|
+
// 2. **Public shapes are PROJECTIONS both ways.** The internal shapes these map to are internal
|
|
24
|
+
// wire shapes, which this repo evolves without migrations; `/api/v1` is frozen. The mappers
|
|
25
|
+
// here are the seam that lets both of those stay true, so an internal field rename is a diff in
|
|
26
|
+
// this file rather than a silent public break. See `contracts/src/public-provisioning.ts`.
|
|
27
|
+
// 3. **A secret goes IN and never comes back.** The two connection calls accept a secret bundle
|
|
28
|
+
// because reaching an apiserver needs one; every response projects the KEYS and no value.
|
|
29
|
+
// 4. **Refusals THROW `DomainError`s**, so `handleError` produces the one wire envelope and a
|
|
30
|
+
// caller gets the `details.reason` it branches on. `authorizeOrThrow` is the auth-gate form of
|
|
31
|
+
// the same rule.
|
|
32
|
+
// 5. **A read that cannot be answered is a 503 naming what is unwired**, never an empty success. A
|
|
33
|
+
// caller reading "no models" and "models not configured" the same way is exactly the confusion
|
|
34
|
+
// these reads exist to remove.
|
|
35
|
+
/** The bootstrap module, or the 503 naming what this deployment has not wired. */
|
|
36
|
+
function requireBootstrap(c) {
|
|
37
|
+
return requireCapability(c.get('container').bootstrap, 'Repo bootstrap is not configured');
|
|
38
|
+
}
|
|
39
|
+
/** The environments module, or the 503 naming what this deployment has not wired. */
|
|
40
|
+
function requireEnvironments(c) {
|
|
41
|
+
return requireCapability(c.get('container').environments, 'Environment integration is not configured');
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The workspace's source-control connection, whichever seam holds it, or the 503 when this
|
|
45
|
+
* deployment wires no source control at all.
|
|
46
|
+
*
|
|
47
|
+
* Two seams and not one, because a GitLab-only deployment builds no `github` module: that module
|
|
48
|
+
* requires the App's webhook verifier, which is App-specific (a GitLab workspace ingests through
|
|
49
|
+
* the neutral `/vcs/:provider/webhooks` route instead), so it is absent exactly when the PAT
|
|
50
|
+
* connect service is the thing holding the connection. Reading only the module answered a
|
|
51
|
+
* provider-neutral question with "source control is not configured" at a workspace that plainly
|
|
52
|
+
* had a connection, and the acceptance preflight then reported an unknown probe failure for a row
|
|
53
|
+
* it could read.
|
|
54
|
+
*
|
|
55
|
+
* The module is preferred when present, because with BOTH wired it is the one that routes an
|
|
56
|
+
* installation to its provider's client; the PAT service is the fallback, not a second opinion.
|
|
57
|
+
*/
|
|
58
|
+
export async function readVcsConnection(container, workspaceId) {
|
|
59
|
+
const github = container.github;
|
|
60
|
+
if (github)
|
|
61
|
+
return github.installationService.getConnection(workspaceId);
|
|
62
|
+
const pat = requireCapability(container.vcsConnectionService, 'Source-control integration is not configured');
|
|
63
|
+
return pat.getConnection(workspaceId);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Whether this deployment serves per-user locally-run model endpoints.
|
|
67
|
+
*
|
|
68
|
+
* A named predicate over a TYPED container rather than an `!== undefined` in the route, because
|
|
69
|
+
* this is the one optional-capability read on this surface whose answer is DATA rather than a
|
|
70
|
+
* refusal: it is reported to the caller, so it has to be as legible as the `require*` accessors
|
|
71
|
+
* next to it, and the field it names has to fail to compile if it is ever renamed.
|
|
72
|
+
*/
|
|
73
|
+
function servesUserScopedModels(container) {
|
|
74
|
+
return container.localModelEndpoints !== undefined;
|
|
75
|
+
}
|
|
76
|
+
/** The merge-preset module, or the 503. */
|
|
77
|
+
function requireMergePresets(c) {
|
|
78
|
+
return requireCapability(c.get('container').riskPolicies, 'Merge presets are not configured');
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* The internal engine a public `kubernetes` connection registers as.
|
|
82
|
+
*
|
|
83
|
+
* The internal vocabulary splits Kubernetes in two (`local-k3s` and `remote-kubernetes`), and that
|
|
84
|
+
* split is deliberately NOT a public fact: one backend serves both (`kubernetes-environment-backend`
|
|
85
|
+
* declares `engines: () => ['local-k3s', 'remote-kubernetes']`), both lower to the same provision
|
|
86
|
+
* type and the same provision config, so which name a handler is stored under is not observable in
|
|
87
|
+
* anything a run does. Exposing the choice would be asking a caller to make a decision that changes
|
|
88
|
+
* nothing, and freezing it onto a surface that can never drop it.
|
|
89
|
+
*/
|
|
90
|
+
const KUBERNETES_ENGINE = 'remote-kubernetes';
|
|
91
|
+
export function publicProvisioningController() {
|
|
92
|
+
const app = new Hono();
|
|
93
|
+
registerBootstrapRoutes(app);
|
|
94
|
+
registerEnvironmentRoutes(app);
|
|
95
|
+
registerServiceRoutes(app);
|
|
96
|
+
registerWiringRoutes(app);
|
|
97
|
+
return app;
|
|
98
|
+
}
|
|
99
|
+
// ---- repo bootstrap ---------------------------------------------------------
|
|
100
|
+
/**
|
|
101
|
+
* Project a bootstrap run onto the wire.
|
|
102
|
+
*
|
|
103
|
+
* `blockId` becomes `serviceId` because that is what this surface calls a service frame everywhere
|
|
104
|
+
* else, and a caller joins it straight onto `/api/v1/services/:serviceId/tasks`.
|
|
105
|
+
*
|
|
106
|
+
* The structured failure is FLATTENED into its three human-readable parts rather than published as a
|
|
107
|
+
* nested object: the kind (whether a retry could help), the detail, and the hint. All three are
|
|
108
|
+
* prose the platform wrote for whoever is reading a failed run; what is left behind is the
|
|
109
|
+
* remainder whose shape is genuinely internal. See the schema for the full accounting.
|
|
110
|
+
*/
|
|
111
|
+
export function toPublicBootstrapJob(job) {
|
|
112
|
+
return {
|
|
113
|
+
jobId: job.id,
|
|
114
|
+
status: job.status,
|
|
115
|
+
repoName: job.repoName,
|
|
116
|
+
repoOwner: job.repoOwner,
|
|
117
|
+
repoUrl: job.repoUrl,
|
|
118
|
+
serviceId: job.blockId,
|
|
119
|
+
progress: job.subtasks,
|
|
120
|
+
error: job.error,
|
|
121
|
+
failureKind: job.failure?.kind ?? null,
|
|
122
|
+
failureDetail: job.failure?.detail ?? null,
|
|
123
|
+
failureHint: job.failure?.hint ?? null,
|
|
124
|
+
createdAt: job.createdAt,
|
|
125
|
+
updatedAt: job.updatedAt,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
function registerBootstrapRoutes(app) {
|
|
129
|
+
buildHonoRoute(app, startPublicRepoBootstrapContract, async (c) => {
|
|
130
|
+
const auth = await authorizeOrThrow(c, startPublicRepoBootstrapContract.minScope);
|
|
131
|
+
const bootstrap = requireBootstrap(c);
|
|
132
|
+
// Wired but unable to act is a PREDICATE, not an absent value, so it throws directly rather
|
|
133
|
+
// than through the capability accessor: the same refusal the SPA's own route raises.
|
|
134
|
+
if (!bootstrap.service.canBootstrap) {
|
|
135
|
+
throw new UnavailableError('Repo bootstrapping needs the source-control connection and the implementation container ' +
|
|
136
|
+
'to be configured', 'bootstrap_not_dispatchable');
|
|
137
|
+
}
|
|
138
|
+
const body = c.req.valid('json');
|
|
139
|
+
// The omitted-value rules live here rather than as valibot defaults on the request schema: a
|
|
140
|
+
// schema default is ambiguous for a generator emitting a request type and a response type from
|
|
141
|
+
// one shape, so the contract states each default in prose and this is where it is applied.
|
|
142
|
+
const job = await bootstrap.service.bootstrap(auth.workspaceId, {
|
|
143
|
+
repoName: body.repoName,
|
|
144
|
+
...(body.type ? { type: body.type } : {}),
|
|
145
|
+
description: body.description ?? '',
|
|
146
|
+
// Private unless the caller says otherwise: the safe default for a repository this creates on
|
|
147
|
+
// someone's account, and the one the SPA's own form offers.
|
|
148
|
+
private: body.private ?? true,
|
|
149
|
+
instructions: body.instructions ?? '',
|
|
150
|
+
// Omitted means "scaffold from the brief alone", which the internal input spells as an
|
|
151
|
+
// explicit null rather than an absent key.
|
|
152
|
+
referenceArchitectureId: body.referenceArchitectureId ?? null,
|
|
153
|
+
});
|
|
154
|
+
return c.json(toPublicBootstrapJob(job), 201);
|
|
155
|
+
});
|
|
156
|
+
buildHonoRoute(app, getPublicRepoBootstrapContract, async (c) => {
|
|
157
|
+
const auth = await authorizeOrThrow(c, getPublicRepoBootstrapContract.minScope);
|
|
158
|
+
const bootstrap = requireBootstrap(c);
|
|
159
|
+
const { jobId } = c.req.valid('param');
|
|
160
|
+
// Scoped to the key's own workspace by the service, so another workspace's job is absent here
|
|
161
|
+
// rather than forbidden: the same 404-hides-everything rule the rest of this surface follows.
|
|
162
|
+
// The service raises that 404 itself, carrying `bootstrap_job_not_found`; a local `if (!job)`
|
|
163
|
+
// beside it would be dead code, and the reason a caller branches on would ship from nowhere.
|
|
164
|
+
return c.json(toPublicBootstrapJob(await bootstrap.service.getJob(auth.workspaceId, jobId)), 200);
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
// ---- the environment connection (the ENGINE half) ---------------------------
|
|
168
|
+
/**
|
|
169
|
+
* Lower a public URL source onto the internal one.
|
|
170
|
+
*
|
|
171
|
+
* Rebuilt member by member rather than passed through, because the two are separate types by
|
|
172
|
+
* design (see the contracts header): the internal variant is free to gain a source or rename a
|
|
173
|
+
* field, and this switch is where that stops being a silent public change. The `never` default is
|
|
174
|
+
* what makes it stop at COMPILE time.
|
|
175
|
+
*/
|
|
176
|
+
function toKubernetesUrlSource(url) {
|
|
177
|
+
switch (url.source) {
|
|
178
|
+
case 'ingressTemplate':
|
|
179
|
+
return { source: 'ingressTemplate', hostTemplate: url.hostTemplate, ...scheme(url.scheme) };
|
|
180
|
+
case 'ingressStatus':
|
|
181
|
+
return {
|
|
182
|
+
source: 'ingressStatus',
|
|
183
|
+
...(url.ingressName === undefined ? {} : { ingressName: url.ingressName }),
|
|
184
|
+
...scheme(url.scheme),
|
|
185
|
+
};
|
|
186
|
+
case 'serviceStatus':
|
|
187
|
+
return {
|
|
188
|
+
source: 'serviceStatus',
|
|
189
|
+
serviceName: url.serviceName,
|
|
190
|
+
...(url.port === undefined ? {} : { port: url.port }),
|
|
191
|
+
...scheme(url.scheme),
|
|
192
|
+
};
|
|
193
|
+
case 'gatewayStatus':
|
|
194
|
+
return {
|
|
195
|
+
source: 'gatewayStatus',
|
|
196
|
+
...(url.gatewayName === undefined ? {} : { gatewayName: url.gatewayName }),
|
|
197
|
+
...scheme(url.scheme),
|
|
198
|
+
};
|
|
199
|
+
case 'httpRouteStatus':
|
|
200
|
+
return {
|
|
201
|
+
source: 'httpRouteStatus',
|
|
202
|
+
...(url.httpRouteName === undefined ? {} : { httpRouteName: url.httpRouteName }),
|
|
203
|
+
...scheme(url.scheme),
|
|
204
|
+
};
|
|
205
|
+
default:
|
|
206
|
+
return unreachableSource(url);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
/** An omitted `scheme` stays omitted, so the engine's own default decides rather than this mapper. */
|
|
210
|
+
function scheme(value) {
|
|
211
|
+
return value === undefined ? {} : { scheme: value };
|
|
212
|
+
}
|
|
213
|
+
/** The compile-time half of the projection: a new public member has to be lowered explicitly. */
|
|
214
|
+
function unreachableSource(value) {
|
|
215
|
+
throw new Error(`unmapped public Kubernetes URL source: ${JSON.stringify(value)}`);
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Lower a public manifest source onto the internal one, for the same reason and with the same
|
|
219
|
+
* exhaustiveness as the URL source above.
|
|
220
|
+
*/
|
|
221
|
+
export function toKubernetesManifestSource(source) {
|
|
222
|
+
const renderer = source.renderer === undefined ? {} : { renderer: source.renderer };
|
|
223
|
+
return source.type === 'colocated'
|
|
224
|
+
? { type: 'colocated', path: source.path, ...renderer }
|
|
225
|
+
: {
|
|
226
|
+
type: 'separate',
|
|
227
|
+
repo: source.repo,
|
|
228
|
+
...(source.ref === undefined ? {} : { ref: source.ref }),
|
|
229
|
+
path: source.path,
|
|
230
|
+
...renderer,
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
/** Lower a public connection onto the internal per-engine handler config. */
|
|
234
|
+
function toInfraHandlerConfig(connection) {
|
|
235
|
+
return {
|
|
236
|
+
engine: KUBERNETES_ENGINE,
|
|
237
|
+
kubernetes: { ...connection.kubernetes, url: toKubernetesUrlSource(connection.kubernetes.url) },
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Project a registered handler back, with its secret KEYS and none of their values.
|
|
242
|
+
*
|
|
243
|
+
* `baseUrl` is the connection's own endpoint, which for a Kubernetes engine is the apiserver, so it
|
|
244
|
+
* is reported under the name the caller supplied it as rather than the engine's generic one.
|
|
245
|
+
*/
|
|
246
|
+
function toPublicConnectionView(view) {
|
|
247
|
+
return {
|
|
248
|
+
provisionType: view.provisionType,
|
|
249
|
+
engine: 'kubernetes',
|
|
250
|
+
label: view.label,
|
|
251
|
+
apiServerUrl: view.baseUrl,
|
|
252
|
+
secretKeys: view.secretKeys,
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
function registerEnvironmentRoutes(app) {
|
|
256
|
+
// Probe without persisting. `ok: false` is an ANSWER (the cluster refused the token), so it is a
|
|
257
|
+
// 200 carrying the verdict rather than an error: a caller distinguishes "the cluster said no"
|
|
258
|
+
// from "the request was malformed", and only one of those is a 4xx.
|
|
259
|
+
buildHonoRoute(app, testPublicEnvironmentConnectionContract, async (c) => {
|
|
260
|
+
const auth = await authorizeOrThrow(c, testPublicEnvironmentConnectionContract.minScope);
|
|
261
|
+
const environments = requireEnvironments(c);
|
|
262
|
+
const { connection, secrets } = c.req.valid('json');
|
|
263
|
+
const result = await environments.connectionService.testHandler(auth.workspaceId, {
|
|
264
|
+
config: toInfraHandlerConfig(connection),
|
|
265
|
+
// An omitted bundle is an EMPTY one, not an absent argument: probing a cluster with no
|
|
266
|
+
// credential is a legitimate question (does it accept anonymous reads), and the engine's own
|
|
267
|
+
// probe is what answers it.
|
|
268
|
+
secrets: secrets ?? {},
|
|
269
|
+
});
|
|
270
|
+
return c.json({ ok: result.ok, message: result.message ?? null }, 200);
|
|
271
|
+
});
|
|
272
|
+
buildHonoRoute(app, connectPublicEnvironmentContract, async (c) => {
|
|
273
|
+
const auth = await authorizeOrThrow(c, connectPublicEnvironmentContract.minScope);
|
|
274
|
+
const environments = requireEnvironments(c);
|
|
275
|
+
const { connection, secrets } = c.req.valid('json');
|
|
276
|
+
const view = await environments.connectionService.registerHandler(auth.workspaceId, {
|
|
277
|
+
// Derived rather than accepted: for a Kubernetes engine the provision type it serves is a
|
|
278
|
+
// fact about the engine, so asking a caller to restate it only creates a pair that can
|
|
279
|
+
// disagree.
|
|
280
|
+
provisionType: 'kubernetes',
|
|
281
|
+
config: toInfraHandlerConfig(connection),
|
|
282
|
+
secrets,
|
|
283
|
+
});
|
|
284
|
+
return c.json(toPublicConnectionView(view), 201);
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
// ---- a service's provisioning (the SOURCE half) -----------------------------
|
|
288
|
+
function registerServiceRoutes(app) {
|
|
289
|
+
buildHonoRoute(app, updatePublicServiceContract, async (c) => {
|
|
290
|
+
const auth = await authorizeOrThrow(c, updatePublicServiceContract.minScope);
|
|
291
|
+
const container = c.get('container');
|
|
292
|
+
const { serviceId } = c.req.valid('param');
|
|
293
|
+
// Resolved through the public board read, so a frame in another workspace, a task id, or a
|
|
294
|
+
// headless run anchor is ABSENT rather than forbidden, exactly as every other read here.
|
|
295
|
+
const service = await container.boardService.getService(auth.workspaceId, serviceId);
|
|
296
|
+
if (!service)
|
|
297
|
+
throw new NotFoundError('Service', serviceId, { reason: 'service_not_found' });
|
|
298
|
+
const block = await container.boardService.updateBlock(auth.workspaceId, serviceId, toBlockPatch(c.req.valid('json'), service.provisioning),
|
|
299
|
+
// Unattributed by the same reading a headless start gets (ADR 0037): an API key holds
|
|
300
|
+
// scopes, not a workspace tier.
|
|
301
|
+
UNATTRIBUTED_BLOCK_EDIT_AUTHORITY);
|
|
302
|
+
return c.json(toPublicService(block), 200);
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Lower a public service patch onto the board patch.
|
|
307
|
+
*
|
|
308
|
+
* An omitted key is left OUT rather than written as `undefined`: `updateBlock` patches only the
|
|
309
|
+
* keys present, so spreading an absent `provisioning` through would clear the stored one and
|
|
310
|
+
* silently un-deploy a service whose title was being corrected.
|
|
311
|
+
*/
|
|
312
|
+
export function toBlockPatch(input, stored) {
|
|
313
|
+
return {
|
|
314
|
+
...(input.title === undefined ? {} : { title: input.title }),
|
|
315
|
+
...(input.description === undefined ? {} : { description: input.description }),
|
|
316
|
+
...(input.provisioning === undefined
|
|
317
|
+
? {}
|
|
318
|
+
: { provisioning: mergeProvisioning(input.provisioning, stored) }),
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Overlay a public provisioning patch onto what the service already declares.
|
|
323
|
+
*
|
|
324
|
+
* `provisioning` is ONE JSON column and `updateBlock` REPLACES it wholesale, where this surface
|
|
325
|
+
* publishes two of its dozen fields. Writing just the pair would therefore delete every field the
|
|
326
|
+
* public shape cannot express: a Kubernetes service's `images`, `secretInjections` and
|
|
327
|
+
* `helmReleases`, authored in the app by someone who is not the caller. The next deploy would
|
|
328
|
+
* render manifests with no image overrides and no Secrets, which is the "empty environment that
|
|
329
|
+
* looks like a cluster fault" failure one field deeper, and the caller that caused it was only
|
|
330
|
+
* correcting a manifest path.
|
|
331
|
+
*
|
|
332
|
+
* A patch that CHANGES the provision type replaces instead of overlaying: the stored remainder
|
|
333
|
+
* belongs to the type being left behind, so carrying it forward would attach one engine's
|
|
334
|
+
* configuration to another.
|
|
335
|
+
*/
|
|
336
|
+
function mergeProvisioning(patch, stored) {
|
|
337
|
+
const base = stored?.type === patch.type ? stored : undefined;
|
|
338
|
+
return {
|
|
339
|
+
...base,
|
|
340
|
+
type: patch.type,
|
|
341
|
+
manifestSource: toKubernetesManifestSource(patch.manifestSource),
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
// ---- what this deployment has WIRED -----------------------------------------
|
|
345
|
+
/**
|
|
346
|
+
* Project one catalog model onto the two flags that decide whether a run can dispatch.
|
|
347
|
+
*
|
|
348
|
+
* Both are optional internally (an older catalog omitted them) and REQUIRED here, defaulted at this
|
|
349
|
+
* one seam. That is the honest direction: a caller cannot branch on a field it may not receive, and
|
|
350
|
+
* "absent" for either of these means the same thing as false (not selectable; not policy-blocked).
|
|
351
|
+
*/
|
|
352
|
+
function toPublicWiredModel(model) {
|
|
353
|
+
return {
|
|
354
|
+
modelId: model.id,
|
|
355
|
+
label: model.label,
|
|
356
|
+
provider: model.providerLabel,
|
|
357
|
+
available: model.available === true,
|
|
358
|
+
policyBlocked: model.policyBlocked === true,
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* Project the workspace's VCS connection onto what it may DO.
|
|
363
|
+
*
|
|
364
|
+
* `provider` defaults to `github` for a row written before the column existed, which is how the
|
|
365
|
+
* platform reads it everywhere else; stating it here keeps the public field non-null so a caller
|
|
366
|
+
* never has to encode that fallback itself.
|
|
367
|
+
*/
|
|
368
|
+
function toPublicVcsConnection(connection) {
|
|
369
|
+
return {
|
|
370
|
+
provider: connection.provider ?? 'github',
|
|
371
|
+
accountLogin: connection.accountLogin,
|
|
372
|
+
method: connection.method,
|
|
373
|
+
canCreateRepos: connection.canCreateRepos === true,
|
|
374
|
+
canManageWorkflows: connection.canManageWorkflows === true,
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
function toPublicMergePreset(preset) {
|
|
378
|
+
return {
|
|
379
|
+
presetId: preset.id,
|
|
380
|
+
name: preset.name,
|
|
381
|
+
isDefault: preset.isDefault,
|
|
382
|
+
autoMergeEnabled: preset.autoMergeEnabled,
|
|
383
|
+
ciMaxAttempts: preset.ciMaxAttempts,
|
|
384
|
+
dryRunRoles: [...preset.dryRunRoles],
|
|
385
|
+
// The roles the allowlist SCOPES, not the classes it allows: a role with an entry may land only
|
|
386
|
+
// what that entry names (an EMPTY entry lands nothing, which is a restriction and not an
|
|
387
|
+
// absence), and the class vocabulary itself stays internal.
|
|
388
|
+
submissionRestrictedRoles: Object.entries(preset.submissionClassesByRole)
|
|
389
|
+
.filter(([, classes]) => classes !== undefined)
|
|
390
|
+
.map(([role]) => role),
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
function registerWiringRoutes(app) {
|
|
394
|
+
// No user id is passed, and that absence is load-bearing rather than an omission: locally-run
|
|
395
|
+
// models are one developer's own endpoints, and a key-authenticated call has no developer. See
|
|
396
|
+
// `resolveWorkspaceModelCatalog`.
|
|
397
|
+
//
|
|
398
|
+
// Which is exactly why the omission is REPORTED. Those endpoints do not appear in this catalog at
|
|
399
|
+
// all, so on a deployment whose only wired models are local ones the answer is a list where
|
|
400
|
+
// nothing is available, which reads as "add a provider key" and would send an operator to change
|
|
401
|
+
// a setting that is already correct. The flag says whether this deployment has that capability
|
|
402
|
+
// wired at all, which is the most a key-authenticated read can honestly know.
|
|
403
|
+
buildHonoRoute(app, listPublicWiredModelsContract, async (c) => {
|
|
404
|
+
const auth = await authorizeOrThrow(c, listPublicWiredModelsContract.minScope);
|
|
405
|
+
const container = c.get('container');
|
|
406
|
+
const catalog = await resolveWorkspaceModelCatalog(container, auth.workspaceId);
|
|
407
|
+
return c.json({
|
|
408
|
+
models: catalog.map(toPublicWiredModel),
|
|
409
|
+
excludesUserScopedModels: servesUserScopedModels(container),
|
|
410
|
+
}, 200);
|
|
411
|
+
});
|
|
412
|
+
buildHonoRoute(app, getPublicVcsConnectionContract, async (c) => {
|
|
413
|
+
const auth = await authorizeOrThrow(c, getPublicVcsConnectionContract.minScope);
|
|
414
|
+
const connection = await readVcsConnection(c.get('container'), auth.workspaceId);
|
|
415
|
+
// Null is an ANSWER ("nothing connected"), which is the state a caller setting a workspace up
|
|
416
|
+
// is most likely to be in, so it is a 200 carrying null rather than a 404.
|
|
417
|
+
return c.json({ connection: connection ? toPublicVcsConnection(connection) : null }, 200);
|
|
418
|
+
});
|
|
419
|
+
buildHonoRoute(app, listPublicMergePresetsContract, async (c) => {
|
|
420
|
+
const auth = await authorizeOrThrow(c, listPublicMergePresetsContract.minScope);
|
|
421
|
+
const presets = requireMergePresets(c);
|
|
422
|
+
const rows = await presets.service.list(auth.workspaceId);
|
|
423
|
+
return c.json({ presets: rows.map(toPublicMergePreset) }, 200);
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
//# sourceMappingURL=PublicProvisioningController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PublicProvisioningController.js","sourceRoot":"","sources":["../../../src/modules/publicApi/PublicProvisioningController.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gCAAgC,EAChC,8BAA8B,EAC9B,8BAA8B,EAC9B,8BAA8B,EAC9B,6BAA6B,EAC7B,gCAAgC,EAChC,uCAAuC,EACvC,2BAA2B,EAC3B,iCAAiC,GAoBlC,MAAM,wBAAwB,CAAA;AAO/B,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,IAAI,EAAE,MAA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a board task block onto the external task resource. */
|
|
3
3
|
export declare function toPublicTask(block: Block, serviceId: string): PublicTask;
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Project a service frame block onto the external service resource.
|
|
6
|
+
*
|
|
7
|
+
* `provisioning` is projected only for the shapes this surface publishes (today `kubernetes`). A
|
|
8
|
+
* service provisioned through another engine reports NOTHING here rather than a coerced value: the
|
|
9
|
+
* public union cannot describe it, and answering with the nearest member would tell a caller its
|
|
10
|
+
* service deploys from manifests it never declared.
|
|
11
|
+
*/
|
|
5
12
|
export declare function toPublicService(frame: Block): PublicService;
|
|
6
13
|
//# sourceMappingURL=boardProjection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boardProjection.d.ts","sourceRoot":"","sources":["../../../src/modules/publicApi/boardProjection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"boardProjection.d.ts","sourceRoot":"","sources":["../../../src/modules/publicApi/boardProjection.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,KAAK,EAGV,KAAK,aAAa,EAClB,KAAK,UAAU,EAChB,MAAM,wBAAwB,CAAA;AAW/B,kEAAkE;AAClE,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,GAAG,UAAU,CAkBxE;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,aAAa,CAc3D"}
|