@pipeline-builder/api-core 7.4.5 → 7.4.7

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.
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * The cross-account pipeline runner CONTRACT — the one vocabulary the pipeline
3
3
  * service (signer + dispatcher), the runner Lambda (verifier + responder), the
4
- * `pipeline-manager infra setup-runner` CLI and the dashboard all speak.
4
+ * `pipeline-manager infra setup-account` CLI and the dashboard all speak.
5
5
  *
6
6
  * Dependency-free on purpose (type-only imports at most): the browser imports it
7
7
  * through the `@pipeline-builder/api-core/pipeline-runners` subpath, and the
@@ -43,54 +43,104 @@ export type TerminalRunRequestStatus = (typeof TERMINAL_RUN_REQUEST_STATUSES)[nu
43
43
  /** Whether `s` is a terminal request status (false for anything unknown). */
44
44
  export declare function isTerminalRunRequestStatus(s: unknown): s is TerminalRunRequestStatus;
45
45
  /** What a signed request asks the runner to do. */
46
- export declare const RUNNER_ACTIONS: readonly ['start', 'stop', 'probe', 'ping', 'status', 'deploy', 'deploy_status', 'deploy_cancel', 'undeploy', 'list_sources', 'check_source', 'inspect_repository'];
46
+ export declare const RUNNER_ACTIONS: readonly ['start', 'stop', 'probe', 'ping', 'status', 'deploy', 'deploy_status', 'deploy_cancel', 'undeploy', 'list_sources', 'check_source', 'inspect_repository', 'inspect_connection_start', 'inspect_connection_status', 'inspect_connection_stop'];
47
47
  export type RunnerAction = (typeof RUNNER_ACTIONS)[number];
48
- /** The actions recorded as a run request row (a `ping`, a `status` / `deploy_status` read, a `deploy_cancel` and the source actions never are). */
49
- export declare const RUN_REQUEST_ACTIONS: readonly ["start", "stop", "probe", "deploy", "undeploy"];
50
- export type RunRequestAction = (typeof RUN_REQUEST_ACTIONS)[number];
51
- /** A runner's successful answers (`outcome` of a 200). */
52
- export declare const RUNNER_OUTCOMES: readonly ['started', 'stopped', 'match', 'no_match', 'pong', 'status', 'deploying', 'deploy_status', 'deploy_cancelled', 'undeploying', 'sources', 'source_ok', 'repository_reads'];
53
- export type RunnerOutcome = (typeof RUNNER_OUTCOMES)[number];
54
- /** The outcome a successful answer to each action must carry. */
55
- export declare const EXPECTED_OUTCOMES: Readonly<Record<RunnerAction, readonly RunnerOutcome[]>>;
56
48
  /**
57
- * What a runner bundle can do beyond start/stop/probe/ping/status. `deploy:1`:
58
- * the stack was set up with `--enable-deploy` (EnableDeploy=true) and the
59
- * bundle speaks deploy, deploy_status, deploy_cancel and undeploy. One
60
- * capability covers undeploy too: it runs the same CodeBuild project.
61
- * `sources:1`: the bundle speaks list_sources and check_source and its role may
62
- * list the account's CodeConnections connections and describe its GitHub token
63
- * secrets — every bundle from this version on, with or without deploys.
64
- * `inspect:1`: the bundle speaks inspect_repository and its role may read the
65
- * org's GitHub token secrets' VALUES (GetSecretValue on
66
- * `pipeline-builder/<any org>/github-token[/<owner>]`) to read a private repository for
67
- * Generate from Git — the token never leaves the account.
49
+ * What a runner's STACK was set up with, beyond the baseline every runner
50
+ * speaks (start/stop/probe/ping/status, the source actions, repository
51
+ * inspection with the stored token or through a connection, and the identity
52
+ * echo on every reply). Capabilities reflect per-stack settings only:
53
+ * `deploy:1` — set up with `--deploy` (EnableDeploy=true): the bundle speaks
54
+ * deploy, deploy_status, deploy_cancel and undeploy (one CodeBuild project).
55
+ * `events:1` — the stack has EventBridge reporting, and a pong carries its
56
+ * health (`reporting`: failed events in the dead-letter queue, last event time).
68
57
  */
69
- export declare const RUNNER_CAPABILITIES: readonly ['deploy:1', 'sources:1', 'inspect:1'];
58
+ export declare const RUNNER_CAPABILITIES: readonly ['deploy:1', 'events:1'];
70
59
  export type RunnerCapability = (typeof RUNNER_CAPABILITIES)[number];
71
60
  export declare const DEPLOY_CAPABILITY: "deploy:1";
72
- export declare const SOURCES_CAPABILITY: "sources:1";
73
- export declare const INSPECT_CAPABILITY: "inspect:1";
61
+ export declare const EVENTS_CAPABILITY: "events:1";
62
+ /** A runner's successful answers (`outcome` of a 200). */
63
+ export declare const RUNNER_OUTCOMES: readonly ['started', 'stopped', 'match', 'no_match', 'pong', 'status', 'deploying', 'deploy_status', 'deploy_cancelled', 'undeploying', 'sources', 'source_ok', 'repository_reads', 'inspection_started', 'inspection_status', 'inspection_stopped'];
64
+ export type RunnerOutcome = (typeof RUNNER_OUTCOMES)[number];
74
65
  /**
75
- * The capability each gated action needs. The platform checks it BEFORE
76
- * signing: a bundle without it answers an unknown action 401
77
- * SIGNATURE_INVALID, which would page RunnerSignatureInvalid.
66
+ * THE runner action catalog: every action's outcomes, gating capability and
67
+ * whether it is recorded as a run request. Everything below is derived from it.
78
68
  */
79
- export declare const DEPLOY_ACTION_CAPABILITY: {
80
- readonly deploy: "deploy:1";
81
- readonly deploy_status: "deploy:1";
82
- readonly deploy_cancel: "deploy:1";
83
- readonly undeploy: "deploy:1";
84
- };
85
- /** The source actions' capability (checked before signing, like the deploy actions'). */
86
- export declare const SOURCE_ACTION_CAPABILITY: {
87
- readonly list_sources: "sources:1";
88
- readonly check_source: "sources:1";
89
- };
90
- /** The repository-inspection action's capability. */
91
- export declare const INSPECT_ACTION_CAPABILITY: {
92
- readonly inspect_repository: "inspect:1";
69
+ export declare const RUNNER_ACTION_SPECS: {
70
+ readonly start: {
71
+ readonly outcomes: readonly ["started"];
72
+ readonly runRequest: true;
73
+ };
74
+ readonly stop: {
75
+ readonly outcomes: readonly ["stopped"];
76
+ readonly runRequest: true;
77
+ };
78
+ readonly probe: {
79
+ readonly outcomes: readonly ["match", "no_match"];
80
+ readonly runRequest: true;
81
+ };
82
+ readonly ping: {
83
+ readonly outcomes: readonly ["pong"];
84
+ };
85
+ readonly status: {
86
+ readonly outcomes: readonly ["status"];
87
+ };
88
+ readonly deploy: {
89
+ readonly outcomes: readonly ["deploying"];
90
+ readonly capability: "deploy:1";
91
+ readonly runRequest: true;
92
+ };
93
+ readonly deploy_status: {
94
+ readonly outcomes: readonly ["deploy_status"];
95
+ readonly capability: "deploy:1";
96
+ };
97
+ readonly deploy_cancel: {
98
+ readonly outcomes: readonly ["deploy_cancelled"];
99
+ readonly capability: "deploy:1";
100
+ };
101
+ readonly undeploy: {
102
+ readonly outcomes: readonly ["undeploying"];
103
+ readonly capability: "deploy:1";
104
+ readonly runRequest: true;
105
+ };
106
+ readonly list_sources: {
107
+ readonly outcomes: readonly ["sources"];
108
+ };
109
+ readonly check_source: {
110
+ readonly outcomes: readonly ["source_ok"];
111
+ };
112
+ readonly inspect_repository: {
113
+ readonly outcomes: readonly ["repository_reads"];
114
+ };
115
+ readonly inspect_connection_start: {
116
+ readonly outcomes: readonly ["inspection_started"];
117
+ };
118
+ readonly inspect_connection_status: {
119
+ readonly outcomes: readonly ["inspection_status"];
120
+ };
121
+ readonly inspect_connection_stop: {
122
+ readonly outcomes: readonly ["inspection_stopped"];
123
+ };
93
124
  };
125
+ type Specs = typeof RUNNER_ACTION_SPECS;
126
+ /** The actions recorded as a run request row. */
127
+ export type RunRequestAction = {
128
+ [A in RunnerAction]: Specs[A] extends {
129
+ runRequest: true;
130
+ } ? A : never;
131
+ }[RunnerAction];
132
+ export declare const RUN_REQUEST_ACTIONS: readonly RunRequestAction[];
133
+ /** The outcome a successful answer to each action must carry. */
134
+ export declare const EXPECTED_OUTCOMES: Readonly<Record<RunnerAction, readonly RunnerOutcome[]>>;
135
+ /** The deploy actions (deploy, deploy_status, deploy_cancel, undeploy) → `deploy:1`. */
136
+ export declare const DEPLOY_ACTION_CAPABILITY: Readonly<Partial<Record<"check_source" | "deploy" | "deploy_cancel" | "deploy_status" | "inspect_connection_start" | "inspect_connection_status" | "inspect_connection_stop" | "inspect_repository" | "list_sources" | "ping" | "probe" | "start" | "status" | "stop" | "undeploy", "deploy:1" | "events:1">>>;
137
+ /** The source actions — what a runner routes and whose `sources` claim it accepts. */
138
+ export declare const SOURCE_ACTIONS: readonly ["list_sources", "check_source"];
139
+ /**
140
+ * Every connection-inspection action — what a runner routes and whose
141
+ * `inspectConnection` claim it accepts.
142
+ */
143
+ export declare const INSPECT_CONNECTION_ACTIONS: readonly ["inspect_connection_start", "inspect_connection_status", "inspect_connection_stop"];
94
144
  /** Whether a runner reporting `capabilities` may be sent `action`. */
95
145
  export declare function runnerSupportsAction(capabilities: readonly string[], action: RunnerAction): boolean;
96
146
  /** A pong's `capabilities`, kept to the known ones (deduplicated, catalog order); [] for anything malformed. */
@@ -106,21 +156,27 @@ export declare function pipelineNameMatchesPrefixes(pipelineName: string, prefix
106
156
  /** An AWS region name (`us-east-1`, `us-gov-west-1`). */
107
157
  export declare const AWS_REGION_PATTERN: RegExp;
108
158
  /**
109
- * A runner's label: ONE rule for `setup-runner --label`, the register / rename
110
- * API and the dashboard's rename. 1-32 lowercase letters, digits or '-',
111
- * starting with a letter or digit — what the CLI can type back to find the
112
- * runner (its by-label lookup), so a rename can never strand a runner from it.
113
- * Unique per org among non-revoked runners (409 RUNNER_LABEL_TAKEN; a partial
114
- * unique index in the database).
159
+ * A connector's NAME (the `label` column / field): free text the dashboard edits
160
+ * at any time — 1-64 characters after trimming, any language, no control or
161
+ * format characters (line breaks, NUL, bidi overrides). Unique per org among
162
+ * non-revoked connectors, ignoring case (409 RUNNER_LABEL_TAKEN; a partial
163
+ * unique index on lower(label)). The CLI finds a connector by its id or name.
115
164
  */
116
- export declare const RUNNER_LABEL_PATTERN: RegExp;
117
- /** {@link RUNNER_LABEL_PATTERN}'s length limit. */
118
- export declare const RUNNER_LABEL_MAX_LENGTH = 32;
119
- /** What a label breaking {@link RUNNER_LABEL_PATTERN} is told (after `label "<value>" `). */
120
- export declare const RUNNER_LABEL_MESSAGE = "must be 1-32 lowercase letters, digits or '-' (starting with a letter or digit)";
121
- /** Why `label` is not a valid runner label (`label "<label>" must be …`), or null when it is. */
165
+ export declare const RUNNER_LABEL_MAX_LENGTH = 64;
166
+ /** What a name breaking the rule is told (after `name `). */
167
+ export declare const RUNNER_LABEL_MESSAGE = "must be 1-64 characters, with no line breaks or other control characters";
168
+ /** The stored form of a typed name: trimmed. */
169
+ export declare function normalizeRunnerLabel(raw: string): string;
170
+ /** Why `label` is not a valid connector name (`name must be …`), or null when it is. Never echoes the value. */
122
171
  export declare function runnerLabelError(label: string): string | null;
123
- /** Every runner stack's name starts with this (setup-runner lists the account's stacks by it). */
172
+ /**
173
+ * A name fit to LOG or show, from an untrusted source (a signed claim, a
174
+ * runner's reply): control/format characters removed, whitespace runs
175
+ * collapsed, capped at {@link RUNNER_LABEL_MAX_LENGTH}. Undefined when nothing
176
+ * is left. Informational only — never compared, never a metric label.
177
+ */
178
+ export declare function displayRunnerName(raw: unknown): string | undefined;
179
+ /** Every account connector stack WITH a runner starts with this (setup-account lists the account's stacks by it). */
124
180
  export declare const RUNNER_STACK_PREFIX = "pipeline-builder-runner-";
125
181
  /**
126
182
  * CloudFormation stack name for a runner: `pipeline-builder-runner-<runnerId>`.
@@ -128,6 +184,10 @@ export declare const RUNNER_STACK_PREFIX = "pipeline-builder-runner-";
128
184
  * AWS account never collide.
129
185
  */
130
186
  export declare function runnerStackName(runnerId: string): string;
187
+ /** A reporting-only account connector's stack (`setup-account --no-runner`): one per account and organization. */
188
+ export declare const REPORTING_STACK_PREFIX = "pipeline-builder-reporting-";
189
+ /** The stack of a reporting-only account connector: `pipeline-builder-reporting-<orgId>`. */
190
+ export declare function reportingStackName(orgId: string): string;
131
191
  /**
132
192
  * The region a runner's stack lives in, read from its endpoint (a Lambda
133
193
  * Function URL `https://<id>.lambda-url.<region>.on.aws/` or an API Gateway
@@ -137,7 +197,7 @@ export declare function runnerStackName(runnerId: string): string;
137
197
  export declare function runnerStackRegion(endpointUrl: string | null | undefined): string | null;
138
198
  /** The secret (in the stack region) holding an org's registry pull credential, as `infra store-token --scope registry:push` names it. */
139
199
  export declare function registryPullSecretName(orgId: string): string;
140
- /** The command that stores an org's registry pull credential in a region (what `setup-runner --enable-deploy` checks first). */
200
+ /** The command that stores an org's registry pull credential in a region (what `setup-account --deploy` checks first). */
141
201
  export declare function registryPullCredentialCommand(region: string): string;
142
202
  /**
143
203
  * The oldest CDK bootstrap a deploy through a runner works with: version 21
@@ -152,7 +212,7 @@ export declare function cdkBootstrapCommand(region: string, qualifier?: string):
152
212
  * How to turn deploys on for one of the caller's own runners without the CLI
153
213
  * (`enableDeploy` on a runner without `deploy:1`): the CloudFormation console
154
214
  * page that updates its stack, the parameters it sets, and what
155
- * `setup-runner --enable-deploy` would check first — the registry pull
215
+ * `setup-account --deploy` would check first — the registry pull
156
216
  * credential in the stack region and a current CDK bootstrap in every region
157
217
  * the runner deploys to. Null for another org's runner (its owner's admins
158
218
  * update it) and when the stack's region can't be told.
@@ -167,7 +227,7 @@ export interface EnableDeployLinkDto {
167
227
  /** Each needs a CDK bootstrap of {@link MIN_CDK_BOOTSTRAP_VERSION}+. */
168
228
  bootstrapRegions: string[];
169
229
  }
170
- /** The registry pull host (`host` or `host:port`) for a platform base URL, as setup-runner derives it; null for no / a malformed URL. */
230
+ /** The registry pull host (`host` or `host:port`) for a platform base URL, as setup-account derives it; null for no / a malformed URL. */
171
231
  export declare function registryPullHostOf(platformBaseUrl: string | null | undefined): string | null;
172
232
  /** {@link EnableDeployLinkDto} for a runner, or null when its stack's region can't be told (or there is no platform URL). */
173
233
  export declare function enableDeployLink(a: {
@@ -177,7 +237,7 @@ export declare function enableDeployLink(a: {
177
237
  regions: readonly string[];
178
238
  platformBaseUrl: string | null | undefined;
179
239
  }): EnableDeployLinkDto | null;
180
- /** The stack parameters `setup-runner --enable-deploy` sets to turn deploys on (the rest keep their defaults). */
240
+ /** The stack parameters `setup-account --deploy` sets to turn deploys on (the rest keep their defaults). */
181
241
  export declare function enableDeployStackParameters(a: {
182
242
  orgId: string;
183
243
  registryPullHost: string;
@@ -205,7 +265,56 @@ export interface RunnerPongDetails {
205
265
  runnerVersion?: unknown;
206
266
  capabilities?: unknown;
207
267
  pipelinePrefixes?: unknown;
268
+ /** `events:1` only: {@link parseRunnerReporting}. */
269
+ reporting?: unknown;
270
+ }
271
+ /** A 12-digit AWS account id. Stored and shown in plain form (pinning, not secrecy). */
272
+ export declare const AWS_ACCOUNT_ID_PATTERN: RegExp;
273
+ /** Whether `v` is an ISO-8601 date-time string (`YYYY-MM-DDT…`, parseable) — what a reply's timestamps must be. */
274
+ export declare function isIsoDateTime(v: unknown): v is string;
275
+ /**
276
+ * What a runner echoes in every reply to a request it verified:
277
+ * its connector id (the request's `aud`), the request id (`jti`), its AWS
278
+ * account id and its name. The platform refuses a reply whose `runnerId` or
279
+ * `requestId` is not the request's, and pins the connector to `accountId`.
280
+ * `name` is informational (shown in logs), never checked.
281
+ */
282
+ export interface RunnerReplyIdentity {
283
+ runnerId: string;
284
+ requestId: string;
285
+ accountId?: string;
286
+ /** The connector's home region (its stack's, the Lambda's AWS_REGION): pinned together with the account. */
287
+ homeRegion?: string;
288
+ /** The region the action acted in — echoed for an action whose signed claim names one ({@link claimRegion}). */
289
+ region?: string;
290
+ name?: string;
291
+ }
292
+ /** The region a signed request names (source listing/check, stored-token / connection inspect, deploy / undeploy), else undefined. */
293
+ export declare function claimRegion(c: {
294
+ sources?: {
295
+ region: string;
296
+ };
297
+ inspect?: {
298
+ region: string;
299
+ };
300
+ inspectConnection?: {
301
+ region: string;
302
+ };
303
+ deploy?: {
304
+ region: string;
305
+ };
306
+ }): string | undefined;
307
+ /** A reply's `identity`: undefined when absent, null when malformed. */
308
+ export declare function parseRunnerReplyIdentity(raw: unknown): RunnerReplyIdentity | null | undefined;
309
+ /** The reporting health an `events:1` pong carries. */
310
+ export interface RunnerReportingHealth {
311
+ /** Events waiting in the dead-letter queue (failed 3 times). */
312
+ failedEvents: number;
313
+ /** When the events Lambda last delivered an event to the platform (ISO), null when never. */
314
+ lastEventAt: string | null;
208
315
  }
316
+ /** A pong's `reporting`, or undefined when absent or malformed. */
317
+ export declare function parseRunnerReporting(raw: unknown): RunnerReportingHealth | undefined;
209
318
  /**
210
319
  * Where a code comes from:
211
320
  * - `platform` — the pipeline service answers with it (`code` of the error envelope);
@@ -273,18 +382,23 @@ export declare const RUNNER_ERRORS: {
273
382
  readonly retryable: false;
274
383
  readonly category: 'platform';
275
384
  };
276
- readonly RUN_REQUEST_RATE_LIMITED: {
277
- readonly httpStatus: 429;
385
+ /**
386
+ * The connector answered from a different AWS account than the one it was
387
+ * pinned to: nothing is delivered to it until an admin confirms the new
388
+ * account (POST …/runners/:id/confirm-account).
389
+ */
390
+ readonly RUNNER_ACCOUNT_CHANGED: {
391
+ readonly httpStatus: 409;
278
392
  readonly retryable: false;
279
393
  readonly category: 'platform';
280
394
  };
281
- readonly TOO_MANY_PENDING: {
395
+ readonly RUN_REQUEST_RATE_LIMITED: {
282
396
  readonly httpStatus: 429;
283
397
  readonly retryable: false;
284
398
  readonly category: 'platform';
285
399
  };
286
- readonly RUNNER_UPDATE_REQUIRED: {
287
- readonly httpStatus: 409;
400
+ readonly TOO_MANY_PENDING: {
401
+ readonly httpStatus: 429;
288
402
  readonly retryable: false;
289
403
  readonly category: 'platform';
290
404
  };
@@ -347,7 +461,7 @@ export declare const RUNNER_ERRORS: {
347
461
  readonly retryable: false;
348
462
  readonly category: 'platform';
349
463
  };
350
- /** The runner does not list the `deploy:1` capability (an old bundle, or a stack without --enable-deploy): update it with {@link DEPLOY_SETUP_COMMAND}. */
464
+ /** The runner does not list the `deploy:1` capability (an old bundle, or a stack without --deploy): update it with {@link DEPLOY_SETUP_COMMAND}. */
351
465
  readonly RUNNER_DEPLOY_UNSUPPORTED: {
352
466
  readonly httpStatus: 409;
353
467
  readonly retryable: false;
@@ -476,7 +590,7 @@ export declare const RUNNER_ERRORS: {
476
590
  readonly retryable: false;
477
591
  readonly category: 'runner';
478
592
  };
479
- /** The stack was not set up with --enable-deploy (the platform clears the runner's stored capabilities). */
593
+ /** The stack was not set up with --deploy (the platform clears the runner's stored capabilities). */
480
594
  readonly DEPLOY_NOT_ENABLED: {
481
595
  readonly httpStatus: 403;
482
596
  readonly retryable: false;
@@ -542,7 +656,31 @@ export declare const RUNNER_ERRORS: {
542
656
  readonly retryable: false;
543
657
  readonly category: 'runner';
544
658
  };
659
+ /** inspect_connection_status: no such build in the runner's own inspect project. */
660
+ readonly INSPECT_BUILD_NOT_FOUND: {
661
+ readonly httpStatus: 404;
662
+ readonly retryable: false;
663
+ readonly category: 'runner';
664
+ };
665
+ /** The inspect project lives in the runner stack's own region; the connection must be there too. */
666
+ readonly INSPECT_REGION_UNSUPPORTED: {
667
+ readonly httpStatus: 409;
668
+ readonly retryable: false;
669
+ readonly category: 'runner';
670
+ };
671
+ /** The inspect project is at its concurrent build limit. */
672
+ readonly INSPECT_BUSY: {
673
+ readonly httpStatus: 409;
674
+ readonly retryable: false;
675
+ readonly category: 'runner';
676
+ };
545
677
  /** Not delivered within the request's lifetime. */
678
+ /** A reply whose echoed connector id, request id or region is not the request's, or a success without the echo. */
679
+ readonly RUNNER_IDENTITY_MISMATCH: {
680
+ readonly httpStatus: null;
681
+ readonly retryable: false;
682
+ readonly category: 'recorded';
683
+ };
546
684
  readonly RUN_REQUEST_EXPIRED: {
547
685
  readonly httpStatus: null;
548
686
  readonly retryable: false;
@@ -642,6 +780,10 @@ export interface RunClaims {
642
780
  sources?: RunSourcesClaim;
643
781
  /** inspect_repository only. */
644
782
  inspect?: RunInspectClaim;
783
+ /** inspect_connection_start, _status and _stop only. */
784
+ inspectConnection?: RunInspectConnectionClaim;
785
+ /** The connector's current name — informational (logs), never checked by the runner. */
786
+ name?: string;
645
787
  requestedBy: string;
646
788
  }
647
789
  /**
@@ -756,16 +898,68 @@ export declare const INSPECT_MAX_REPLY_BYTES: number;
756
898
  export declare const INSPECT_MAX_LISTING_ENTRIES = 1000;
757
899
  /** A repository name segment. */
758
900
  export declare const INSPECT_REPO_PATTERN: RegExp;
901
+ /**
902
+ * The `inspectConnection` claim block. Start: clone `repository` on `branch`
903
+ * through `connectionArn` (which must be AVAILABLE, in the runner's account and
904
+ * in `region` — the runner stack's own region, where its inspect project is) and
905
+ * collect a bounded snapshot. Status: how build `buildId` (one of this runner's
906
+ * inspect builds) is doing, with the snapshot once it succeeded. The runner
907
+ * builds the clone URL from the validated host and path only.
908
+ */
909
+ export type RunInspectConnectionClaim = {
910
+ kind: 'start';
911
+ region: string;
912
+ connectionArn: string;
913
+ repository: InspectConnectionRepository;
914
+ /** '' = the repository's default branch. */
915
+ branch: string;
916
+ /** '' = the root. */
917
+ subdirectory: string;
918
+ } | {
919
+ kind: 'status';
920
+ region: string;
921
+ buildId: string;
922
+ } | {
923
+ kind: 'stop';
924
+ region: string;
925
+ buildId: string;
926
+ };
927
+ /** The repository a connection inspection clones: its host (lowercased) and its `owner/…/repo` path. */
928
+ export interface InspectConnectionRepository {
929
+ host: string;
930
+ path: string;
931
+ }
932
+ /** Why `raw` is not a repository a connection inspection may clone, or null. */
933
+ export declare function inspectConnectionRepositoryProblem(raw: unknown): string | null;
934
+ /** A connection inspection's state, as inspect_connection_status answers it. */
935
+ export declare const INSPECT_CONNECTION_STATES: readonly ['queued', 'running', 'succeeded', 'failed', 'timed_out'];
936
+ export type InspectConnectionState = (typeof INSPECT_CONNECTION_STATES)[number];
937
+ /**
938
+ * Where a failed inspection failed: `source` — the clone (the connection can't
939
+ * read the repository, or the branch isn't there); `build` — collecting the
940
+ * snapshot; `other` — anything else.
941
+ */
942
+ export declare const INSPECT_CONNECTION_FAILED_PHASES: readonly ['source', 'build', 'other'];
943
+ export type InspectConnectionFailedPhase = (typeof INSPECT_CONNECTION_FAILED_PHASES)[number];
944
+ /** How often the platform asks how an inspect build is doing. */
945
+ export declare const INSPECT_CONNECTION_POLL_MS = 5000;
946
+ /** How long the platform waits for an inspect build in all, starting it included. */
947
+ export declare const INSPECT_CONNECTION_DEADLINE_MS: number;
948
+ /** The inspect project's build timeout (runner-stack.json): CodeBuild stops a build past it. */
949
+ export declare const INSPECT_BUILD_TIMEOUT_MINUTES = 10;
950
+ /** The inspect project's name before the runner's name suffix (`pipeline-builder-inspect-<runnerId>`). */
951
+ export declare const INSPECT_PROJECT_PREFIX = "pipeline-builder-inspect";
952
+ /** One of a runner's inspect builds: `pipeline-builder-inspect<suffix>:<uuid>`. */
953
+ export declare const INSPECT_BUILD_ID_PATTERN: RegExp;
759
954
  /**
760
955
  * Why the source options could not be listed (the picker falls back to pasting
761
956
  * an ARN and says why) — also why a stored-token read can't run:
762
957
  * - `no_runner`: no runner can do it;
763
958
  * - `runner_choice_required`: several can and none was named or is the obvious
764
959
  * default — choose one (not `no_runner`, which would send someone to set one up);
765
- * - `runner_update_required` / `runner_unreachable` / `team_deploys_not_shared`
766
- * / `rate_limited`: as named.
960
+ * - `runner_unreachable` / `team_deploys_not_shared` / `rate_limited`: as named.
767
961
  */
768
- export declare const SOURCE_OPTIONS_UNAVAILABLE_REASONS: readonly ['no_runner', 'runner_choice_required', 'runner_update_required', 'runner_unreachable', 'team_deploys_not_shared', 'rate_limited'];
962
+ export declare const SOURCE_OPTIONS_UNAVAILABLE_REASONS: readonly ['no_runner', 'runner_choice_required', 'runner_unreachable', 'team_deploys_not_shared', 'rate_limited'];
769
963
  export type SourceOptionsUnavailableReason = (typeof SOURCE_OPTIONS_UNAVAILABLE_REASONS)[number];
770
964
  /**
771
965
  * A signing key's lifecycle (`pipeline_runner_signing_keys.state`):
@@ -1211,13 +1405,7 @@ export interface DeployLogHint {
1211
1405
  }
1212
1406
  export declare function deployLogHint(runnerId: string, buildId: string | null): DeployLogHint;
1213
1407
  /** The command that turns deploys on for a runner. */
1214
- export declare const DEPLOY_SETUP_COMMAND = "pipeline-manager infra setup-runner --enable-deploy";
1215
- /**
1216
- * The command that updates a runner without deploys to the current bundle and
1217
- * role (`sources:1` and its read-only grants). A runner WITH deploys is updated
1218
- * with {@link DEPLOY_SETUP_COMMAND}, so the update keeps them on.
1219
- */
1220
- export declare const SOURCES_SETUP_COMMAND = "pipeline-manager infra setup-runner";
1408
+ export declare const DEPLOY_SETUP_COMMAND = "pipeline-manager infra setup-account --deploy";
1221
1409
  /** The facade routes under `/api/pipelines/runner/deploys/:requestId/`. `session` exchanges the grant; the rest take the session token. */
1222
1410
  export declare const DEPLOY_SESSION_LEAVES: readonly ['session', 'pipeline', 'plugin-lookup', 'progress', 'registry', 'result'];
1223
1411
  export type DeploySessionLeaf = (typeof DEPLOY_SESSION_LEAVES)[number];
@@ -1246,8 +1434,29 @@ export interface RunnerDeployCancelledReply {
1246
1434
  export declare const STACK_RETAINED_REASONS: readonly ['no_runner', 'runner_not_deploy_capable', 'toolchain_too_old', 'no_stack', 'undeploy_not_queued'];
1247
1435
  export type StackRetainedReason = (typeof STACK_RETAINED_REASONS)[number];
1248
1436
  /** Why an eligible runner cannot deploy a pipeline (`GET …/deploy-targets`, `details.reason` of RUNNER_NOT_DEPLOYABLE). */
1249
- export declare const DEPLOY_TARGET_REASONS: readonly ['deploy_not_enabled', 'update_required', 'unhealthy', 'prefix_mismatch', 'team_deploys_not_shared', 'region'];
1437
+ export declare const DEPLOY_TARGET_REASONS: readonly ['deploy_not_enabled', 'unhealthy', 'prefix_mismatch', 'team_deploys_not_shared', 'region'];
1250
1438
  export type DeployTargetReason = (typeof DEPLOY_TARGET_REASONS)[number];
1439
+ /**
1440
+ * How a connector was chosen when the caller named none, in precedence order:
1441
+ * the pipeline's last deploy runner, the org's default connector (an explicit
1442
+ * one, or the only eligible connector), the only usable connector, the
1443
+ * caller's last-used one. (`explicit`: the caller named it.)
1444
+ */
1445
+ export declare const RUNNER_PICK_SOURCES: readonly ['explicit', 'pipeline_last_deploy', 'org_default', 'only_usable', 'last_used'];
1446
+ export type RunnerPickSource = (typeof RUNNER_PICK_SOURCES)[number];
1447
+ /** The connector (and region) used when the caller names none, and why. */
1448
+ export interface RunnerPickDto {
1449
+ runnerId: string;
1450
+ /** Its preselected region: the pipeline's last deploy region, the default's home region (when allowed), else its only region; null = choose. */
1451
+ region: string | null;
1452
+ via: RunnerPickSource;
1453
+ }
1454
+ /** The org's default connector could not be used for this choice, and why. */
1455
+ export interface DefaultRunnerSkippedDto {
1456
+ runnerId: string;
1457
+ label: string;
1458
+ reason: DeployTargetReason;
1459
+ }
1251
1460
  /** Metric names the deploy path and its alerts share. */
1252
1461
  export declare const RUNNER_DEPLOY_METRICS: {
1253
1462
  /** Counter `{outcome}`: finished deploys (deployed | failed | expired | cancelled). */
@@ -1359,7 +1568,6 @@ export interface PipelineRunnerDto {
1359
1568
  status: RunnerStatus;
1360
1569
  lastDeliveryAt: string | null;
1361
1570
  createdAt: string;
1362
- updateRequired: boolean;
1363
1571
  /** Absolute: PLATFORM_BASE_URL + {@link runnerJwksPath}(id). */
1364
1572
  jwksUrl: string;
1365
1573
  /** Pipelines linked to this runner (`pipeline_registry.runner_id`). */
@@ -1372,6 +1580,20 @@ export interface PipelineRunnerDto {
1372
1580
  pipelinePrefixes: string[];
1373
1581
  /** For the owning org's admins, on an active runner without `deploy:1`: turn deploys on in the AWS console. */
1374
1582
  enableDeploy: EnableDeployLinkDto | null;
1583
+ /** The AWS account the connector is pinned to (plain form); null until its first identity reply. */
1584
+ awsAccountId: string | null;
1585
+ /** Its home region, pinned together with the account. */
1586
+ awsHomeRegion: string | null;
1587
+ /** A DIFFERENT account (or home region) a later reply came from: nothing is delivered until an admin confirms it (confirm-account). */
1588
+ accountMismatchId: string | null;
1589
+ homeRegionMismatch: string | null;
1590
+ /** EventBridge reporting health from its last events:1 pong; null when reporting is off (or unknown). */
1591
+ reporting: {
1592
+ failedEvents: number;
1593
+ lastEventAt: string | null;
1594
+ } | null;
1595
+ /** The viewing org's default connector (explicitly, or as its only eligible one). */
1596
+ isDefault: boolean;
1375
1597
  }
1376
1598
  /** A parent org's runner shared with this team (signed with the parent's effective key). */
1377
1599
  export interface InheritedPipelineRunnerDto extends PipelineRunnerDto {
@@ -1387,6 +1609,10 @@ export interface PipelineRunnersListDto {
1387
1609
  inherited: InheritedPipelineRunnerDto[];
1388
1610
  /** Null while runners are unavailable. */
1389
1611
  signingKey: RunnerSigningKeyDto | null;
1612
+ /** The org's default connector: its explicit one, else its only eligible connector; null when neither. */
1613
+ defaultRunnerId: string | null;
1614
+ /** The default was set by an admin (false: implicit — the only eligible connector, or none). */
1615
+ defaultExplicit: boolean;
1390
1616
  }
1391
1617
  /** `GET /pipelines/:pipelineId/runner-link` (and the 202 of `POST …/runner-link/refresh`, with `status: 'checking'`). */
1392
1618
  export interface RunnerLinkDto {
@@ -1523,6 +1749,9 @@ export interface RegisterRunnersDto {
1523
1749
  export interface DeployTargetRunnerDto {
1524
1750
  id: string;
1525
1751
  label: string;
1752
+ /** The AWS account and home region the connector is pinned to (its secondary line); null until known. */
1753
+ awsAccountId: string | null;
1754
+ awsHomeRegion: string | null;
1526
1755
  /** The caller's org owns it (false for an ancestor's shared runner). */
1527
1756
  isOwn: boolean;
1528
1757
  /** Set for every runner that is not the caller's own. */
@@ -1534,6 +1763,8 @@ export interface DeployTargetRunnerDto {
1534
1763
  reason: DeployTargetReason | null;
1535
1764
  /** The caller's own runner with deploys off (`deploy_not_enabled`): turn them on in the AWS console. */
1536
1765
  enableDeploy: EnableDeployLinkDto | null;
1766
+ /** The org's default connector (explicitly, or as its only eligible one). */
1767
+ isDefault: boolean;
1537
1768
  }
1538
1769
  /** What both deploy-target listings answer: the eligible runners for a pipeline name. */
1539
1770
  export interface DeployTargetsBaseDto {
@@ -1541,14 +1772,15 @@ export interface DeployTargetsBaseDto {
1541
1772
  unavailableReason: RunnersUnavailableReason | null;
1542
1773
  /** Every eligible runner, deployable or not. */
1543
1774
  runners: DeployTargetRunnerDto[];
1544
- /** The runner used when the body names none: set when exactly one is deployable. */
1545
- autoRunnerId: string | null;
1546
1775
  /**
1547
- * The runner the CALLER last deployed through (their most recent deploy
1548
- * request in this org), while it is deployable here: the default of a
1549
- * several-runner choice. Null otherwise.
1776
+ * The runner (and region) a deploy that names none uses — the pipeline's
1777
+ * last deploy runner, the org default, the only deployable runner, or the
1778
+ * caller's last-used one, first that can deploy it ({@link RUNNER_PICK_SOURCES});
1779
+ * null: several can and none is the obvious one (choose).
1550
1780
  */
1551
- lastUsedRunnerId: string | null;
1781
+ preferred: RunnerPickDto | null;
1782
+ /** The org's default connector exists but can't deploy this pipeline (the picker says why). */
1783
+ defaultSkipped: DefaultRunnerSkippedDto | null;
1552
1784
  /** {@link DEPLOY_SETUP_COMMAND}, for the "no deployable runner" copy. */
1553
1785
  setupCommand: string;
1554
1786
  }