wicked-crew 0.9.0 → 0.9.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/api/capture.d.ts +6 -6
- package/dist/api/codebase-archive.d.ts +88 -0
- package/dist/api/codebase-archive.d.ts.map +1 -0
- package/dist/api/codebase-archive.js +282 -0
- package/dist/api/codebase-archive.js.map +1 -0
- package/dist/api/delivery-index.d.ts +3 -1
- package/dist/api/delivery-index.d.ts.map +1 -1
- package/dist/api/delivery-index.js +4 -2
- package/dist/api/delivery-index.js.map +1 -1
- package/dist/api/mcp.d.ts +8 -8
- package/dist/api/routes.d.ts +7 -2
- package/dist/api/routes.d.ts.map +1 -1
- package/dist/api/routes.js +54 -6
- package/dist/api/routes.js.map +1 -1
- package/dist/api/server.d.ts +2 -0
- package/dist/api/server.d.ts.map +1 -1
- package/dist/api/server.js +39 -1
- package/dist/api/server.js.map +1 -1
- package/dist/core/adapter.d.ts.map +1 -1
- package/dist/core/adapter.js +13 -4
- package/dist/core/adapter.js.map +1 -1
- package/dist/core/ado-deliver-helper.d.ts +22 -0
- package/dist/core/ado-deliver-helper.d.ts.map +1 -0
- package/dist/core/ado-deliver-helper.js +139 -0
- package/dist/core/ado-deliver-helper.js.map +1 -0
- package/dist/core/deliver-credentials.d.ts +88 -0
- package/dist/core/deliver-credentials.d.ts.map +1 -0
- package/dist/core/deliver-credentials.js +231 -0
- package/dist/core/deliver-credentials.js.map +1 -0
- package/dist/core/deliver.d.ts +11 -0
- package/dist/core/deliver.d.ts.map +1 -1
- package/dist/core/deliver.js +108 -4
- package/dist/core/deliver.js.map +1 -1
- package/dist/core/inventory-claim.d.ts +2 -8
- package/dist/core/inventory-claim.d.ts.map +1 -1
- package/dist/core/inventory-claim.js.map +1 -1
- package/dist/projects/routes.d.ts +2 -2
- package/dist/projects/state-home-registry.d.ts.map +1 -1
- package/dist/projects/state-home-registry.js +2 -0
- package/dist/projects/state-home-registry.js.map +1 -1
- package/dist/studio/assets/index-BLYKfepE.css +32 -0
- package/dist/studio/assets/{index-B1MYiNq-.js → index-BbXtfDnB.js} +95 -95
- package/dist/studio/editors/wicked-page/editor.json +1 -1
- package/dist/studio/editors/wicked-page/index.html +1 -1
- package/dist/studio/index.html +2 -2
- package/dist/studio/testid-inventory.json +37 -6
- package/endpoint-manifest.json +12 -2
- package/package.json +4 -4
- package/dist/studio/assets/index--O1AdvNx.css +0 -32
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* crew#720: the deliver phase's provider credentials — ONE preflight shape for GitHub and Azure
|
|
3
|
+
* DevOps — and the Azure DevOps repository a remote URL names.
|
|
4
|
+
*
|
|
5
|
+
* Only PRESENCE is read here, never a value: the credential stays in the daemon's environment
|
|
6
|
+
* (or gh's keyring) and is consumed by the deliver script alone, inside the deliver phase (the
|
|
7
|
+
* engine strips every forge credential from worker seats, wicked-core#671).
|
|
8
|
+
*
|
|
9
|
+
* The same check runs twice: at launch (so the deliver gate card says "<provider> credentials not
|
|
10
|
+
* configured" BEFORE approval, and `GET /repos/:id/deliver-target` reports it) and in the deliver
|
|
11
|
+
* script itself before anything is staged, whose refusal parks the run at the engine's
|
|
12
|
+
* deliver-refusal gate with the work kept ({@link DELIVER_CREDENTIALS_MISSING_MARKER}).
|
|
13
|
+
*/
|
|
14
|
+
/** The forge a delivery goes to. `null` from {@link deliverProviderOf} = neither (a local path,
|
|
15
|
+
* GitLab, Gitea, …): the push-only path, which needs no provider credential of crew's. */
|
|
16
|
+
export type DeliverProvider = 'github' | 'azure_devops';
|
|
17
|
+
/** api-types `DeliverCredentials` (crew#720) — the one preflight shape every provider shares. */
|
|
18
|
+
export interface DeliverCredentials {
|
|
19
|
+
provider: DeliverProvider;
|
|
20
|
+
/** `unknown` = the probe could not answer (gh timed out); never read as `missing`. */
|
|
21
|
+
status: 'configured' | 'missing' | 'unknown';
|
|
22
|
+
/** Where the credential comes from when configured; `null` otherwise. */
|
|
23
|
+
source: 'gh_token' | 'gh_login' | 'service_principal' | 'pat' | null;
|
|
24
|
+
/** What to set when `missing`, in the order the phase tries them (env var names, commands). */
|
|
25
|
+
missing: string[];
|
|
26
|
+
/** One sentence for the gate card and the run record. */
|
|
27
|
+
message: string;
|
|
28
|
+
}
|
|
29
|
+
/** The env var names the Azure DevOps delivery reads (service principal first, then the PAT). */
|
|
30
|
+
export declare const ADO_SP_ENV: readonly ["CREW_ADO_TENANT_ID", "CREW_ADO_CLIENT_ID", "CREW_ADO_CLIENT_SECRET"];
|
|
31
|
+
export declare const ADO_PAT_ENV = "AZURE_DEVOPS_EXT_PAT";
|
|
32
|
+
/**
|
|
33
|
+
* The line the deliver script prints when the provider credential is absent:
|
|
34
|
+
* `deliver: CREDENTIALS-MISSING <provider>` — before anything is staged, followed by the
|
|
35
|
+
* push-refused marker so the engine parks the run at its deliver-refusal gate.
|
|
36
|
+
*/
|
|
37
|
+
export declare const DELIVER_CREDENTIALS_MISSING_MARKER = "deliver: CREDENTIALS-MISSING";
|
|
38
|
+
/** The Azure DevOps credential the daemon environment holds (presence only). */
|
|
39
|
+
export declare function adoCredentials(env?: NodeJS.ProcessEnv): DeliverCredentials;
|
|
40
|
+
/**
|
|
41
|
+
* The GitHub credential: an exported `GH_TOKEN`, else a gh login for github.com. `logins` is
|
|
42
|
+
* `gh auth status`'s answer — `[]` = gh answered with no login, `'absent'` = gh is not installed,
|
|
43
|
+
* `null` = the probe could not answer (unknown, never missing).
|
|
44
|
+
*/
|
|
45
|
+
export declare function githubCredentials(env: NodeJS.ProcessEnv, logins: readonly string[] | 'absent' | null): DeliverCredentials;
|
|
46
|
+
/** The Azure DevOps repository a remote URL names. */
|
|
47
|
+
export interface AdoRepo {
|
|
48
|
+
org: string;
|
|
49
|
+
project: string;
|
|
50
|
+
repo: string;
|
|
51
|
+
/** The canonical https git URL every authenticated fetch/push goes to. */
|
|
52
|
+
gitUrl: string;
|
|
53
|
+
/** `…/_apis/git/repositories/<repo>` — the REST base for pull requests. */
|
|
54
|
+
apiBase: string;
|
|
55
|
+
/** The repository's web URL; a PR is `<webUrl>/pullrequest/<id>`. */
|
|
56
|
+
webUrl: string;
|
|
57
|
+
/** The Entra token authority (service-principal mint). */
|
|
58
|
+
loginBase: string;
|
|
59
|
+
}
|
|
60
|
+
/** Is `host` an Azure DevOps host (`dev.azure.com`, `ssh.dev.azure.com`, `*.visualstudio.com`)? */
|
|
61
|
+
export declare function isAdoHost(host: string | null): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* The Azure DevOps repository of a remote URL, or `null`. Accepts the four spellings Azure DevOps
|
|
64
|
+
* hands out — `https://[user@]dev.azure.com/<org>/<project>/_git/<repo>`,
|
|
65
|
+
* `https://<org>.visualstudio.com/[DefaultCollection/]<project>/_git/<repo>`,
|
|
66
|
+
* `git@ssh.dev.azure.com:v3/<org>/<project>/<repo>` and
|
|
67
|
+
* `<org>@vs-ssh.visualstudio.com:v3/<org>/<project>/<repo>` — and nothing looser. Userinfo is
|
|
68
|
+
* never kept. Every part is percent-decoded once and re-encoded, so the canonical URL is stable.
|
|
69
|
+
*/
|
|
70
|
+
export declare function adoRepoOf(url: string | null | undefined): AdoRepo | null;
|
|
71
|
+
/** The provider a delivery to `originUrl` uses, or `null` (push-only / local / unknown). */
|
|
72
|
+
export declare function deliverProviderOf(originUrl: string | null | undefined): DeliverProvider | null;
|
|
73
|
+
/** The credential preflight a deliver card shows for an origin; `null` when no provider applies. */
|
|
74
|
+
export declare function deliverCredentialsFor(originUrl: string | null | undefined, env: NodeJS.ProcessEnv, ghLogins: readonly string[] | 'absent' | null): DeliverCredentials | null;
|
|
75
|
+
/** `deliver: CREDENTIALS-MISSING <provider>` in a deliver transcript → that provider, else `null`.
|
|
76
|
+
* The LAST such line decides; the script prints it before anything reaches the remote. */
|
|
77
|
+
export declare function credentialsMissingIn(text: string): DeliverProvider | null;
|
|
78
|
+
/**
|
|
79
|
+
* {@link deliverCredentialsFor} with the gh probe run only when it can matter: a github.com origin
|
|
80
|
+
* with no exported GH_TOKEN (a bounded `gh auth status`, crew#737's probe). gh not installed reads
|
|
81
|
+
* `'absent'`; a probe that timed out reads unknown. Never throws.
|
|
82
|
+
*/
|
|
83
|
+
export declare function deliverCredentialsProbe(originUrl: string | null | undefined, env: NodeJS.ProcessEnv, probe?: () => Promise<string[] | 'absent' | null>): Promise<DeliverCredentials | null>;
|
|
84
|
+
export declare function ghLoginsOrAbsent(): Promise<string[] | 'absent' | null>;
|
|
85
|
+
/** The canonical `missing` reading for a provider — what the run record says after the deliver
|
|
86
|
+
* phase refused for want of the credential (the phase read the environment it ran in). */
|
|
87
|
+
export declare function missingCredentials(provider: DeliverProvider): DeliverCredentials;
|
|
88
|
+
//# sourceMappingURL=deliver-credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deliver-credentials.d.ts","sourceRoot":"","sources":["../../src/core/deliver-credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAOH;2FAC2F;AAC3F,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,cAAc,CAAC;AAExD,iGAAiG;AACjG,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,eAAe,CAAC;IAC1B,sFAAsF;IACtF,MAAM,EAAE,YAAY,GAAG,SAAS,GAAG,SAAS,CAAC;IAC7C,yEAAyE;IACzE,MAAM,EAAE,UAAU,GAAG,UAAU,GAAG,mBAAmB,GAAG,KAAK,GAAG,IAAI,CAAC;IACrE,+FAA+F;IAC/F,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,yDAAyD;IACzD,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,iGAAiG;AACjG,eAAO,MAAM,UAAU,iFAAkF,CAAC;AAC1G,eAAO,MAAM,WAAW,yBAAyB,CAAC;AAElD;;;;GAIG;AACH,eAAO,MAAM,kCAAkC,iCAAiC,CAAC;AAOjF,gFAAgF;AAChF,wBAAgB,cAAc,CAAC,GAAG,GAAE,MAAM,CAAC,UA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MAAM,CAAC,UAAU,EACtB,KAAK,GAAE,MAAM,OAAO,CAAC,MAAM,EAAE,GAAG,QAAQ,GAAG,IAAI,CAAoB,GAClE,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAMpC;AAQD,wBAAgB,gBAAgB,IAAI,OAAO,CAAC,MAAM,EAAE,GAAG,QAAQ,GAAG,IAAI,CAAC,CAMtE;AAcD;2FAC2F;AAC3F,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,eAAe,GAAG,kBAAkB,CAEhF"}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* crew#720: the deliver phase's provider credentials — ONE preflight shape for GitHub and Azure
|
|
3
|
+
* DevOps — and the Azure DevOps repository a remote URL names.
|
|
4
|
+
*
|
|
5
|
+
* Only PRESENCE is read here, never a value: the credential stays in the daemon's environment
|
|
6
|
+
* (or gh's keyring) and is consumed by the deliver script alone, inside the deliver phase (the
|
|
7
|
+
* engine strips every forge credential from worker seats, wicked-core#671).
|
|
8
|
+
*
|
|
9
|
+
* The same check runs twice: at launch (so the deliver gate card says "<provider> credentials not
|
|
10
|
+
* configured" BEFORE approval, and `GET /repos/:id/deliver-target` reports it) and in the deliver
|
|
11
|
+
* script itself before anything is staged, whose refusal parks the run at the engine's
|
|
12
|
+
* deliver-refusal gate with the work kept ({@link DELIVER_CREDENTIALS_MISSING_MARKER}).
|
|
13
|
+
*/
|
|
14
|
+
// A function-only import (no module-evaluation use), so the cycle with deliver.ts is inert.
|
|
15
|
+
import { execFile } from 'node:child_process';
|
|
16
|
+
import { originRemoteHost, parseGhAuthStatusLogins } from './deliver.js';
|
|
17
|
+
import { childEnvWithBootEstateDb } from './governance-store.js';
|
|
18
|
+
/** The env var names the Azure DevOps delivery reads (service principal first, then the PAT). */
|
|
19
|
+
export const ADO_SP_ENV = ['CREW_ADO_TENANT_ID', 'CREW_ADO_CLIENT_ID', 'CREW_ADO_CLIENT_SECRET'];
|
|
20
|
+
export const ADO_PAT_ENV = 'AZURE_DEVOPS_EXT_PAT';
|
|
21
|
+
/**
|
|
22
|
+
* The line the deliver script prints when the provider credential is absent:
|
|
23
|
+
* `deliver: CREDENTIALS-MISSING <provider>` — before anything is staged, followed by the
|
|
24
|
+
* push-refused marker so the engine parks the run at its deliver-refusal gate.
|
|
25
|
+
*/
|
|
26
|
+
export const DELIVER_CREDENTIALS_MISSING_MARKER = 'deliver: CREDENTIALS-MISSING';
|
|
27
|
+
function present(env, name) {
|
|
28
|
+
const v = env[name];
|
|
29
|
+
return typeof v === 'string' && v.trim() !== '';
|
|
30
|
+
}
|
|
31
|
+
/** The Azure DevOps credential the daemon environment holds (presence only). */
|
|
32
|
+
export function adoCredentials(env = process.env) {
|
|
33
|
+
if (ADO_SP_ENV.every((n) => present(env, n))) {
|
|
34
|
+
return { provider: 'azure_devops', status: 'configured', source: 'service_principal', missing: [], message: 'Azure DevOps credentials: the service principal (CREW_ADO_TENANT_ID / CREW_ADO_CLIENT_ID / CREW_ADO_CLIENT_SECRET).' };
|
|
35
|
+
}
|
|
36
|
+
if (present(env, ADO_PAT_ENV)) {
|
|
37
|
+
return { provider: 'azure_devops', status: 'configured', source: 'pat', missing: [], message: `Azure DevOps credentials: a personal access token (${ADO_PAT_ENV}).` };
|
|
38
|
+
}
|
|
39
|
+
const spMissing = ADO_SP_ENV.filter((n) => !present(env, n));
|
|
40
|
+
return {
|
|
41
|
+
provider: 'azure_devops',
|
|
42
|
+
status: 'missing',
|
|
43
|
+
source: null,
|
|
44
|
+
missing: [...spMissing, ADO_PAT_ENV],
|
|
45
|
+
message: `Azure DevOps credentials not configured: set ${ADO_SP_ENV.join(', ')} (a service principal) or ${ADO_PAT_ENV} ` +
|
|
46
|
+
"in the daemon's environment and restart it. The deliver phase refuses before anything is staged and the run waits at the deliver gate with its work kept.",
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The GitHub credential: an exported `GH_TOKEN`, else a gh login for github.com. `logins` is
|
|
51
|
+
* `gh auth status`'s answer — `[]` = gh answered with no login, `'absent'` = gh is not installed,
|
|
52
|
+
* `null` = the probe could not answer (unknown, never missing).
|
|
53
|
+
*/
|
|
54
|
+
export function githubCredentials(env, logins) {
|
|
55
|
+
if (present(env, 'GH_TOKEN')) {
|
|
56
|
+
return { provider: 'github', status: 'configured', source: 'gh_token', missing: [], message: 'GitHub credentials: GH_TOKEN in the daemon environment.' };
|
|
57
|
+
}
|
|
58
|
+
if (logins === null) {
|
|
59
|
+
return { provider: 'github', status: 'unknown', source: null, missing: [], message: 'GitHub credentials: gh did not answer in time; the deliver phase checks again before it stages anything.' };
|
|
60
|
+
}
|
|
61
|
+
if (logins !== 'absent' && logins.length > 0) {
|
|
62
|
+
return { provider: 'github', status: 'configured', source: 'gh_login', missing: [], message: `GitHub credentials: gh is signed in to github.com (${logins.join(', ')}).` };
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
provider: 'github',
|
|
66
|
+
status: 'missing',
|
|
67
|
+
source: null,
|
|
68
|
+
missing: ['gh auth login', 'GH_TOKEN'],
|
|
69
|
+
message: `GitHub credentials not configured: ${logins === 'absent' ? 'gh is not installed and ' : 'gh is not signed in to github.com and '}no GH_TOKEN is exported. ` +
|
|
70
|
+
"Run `gh auth login` on this machine or export GH_TOKEN in the daemon's environment. The deliver phase refuses before anything is staged and the run waits at the deliver gate with its work kept.",
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
const ADO_PART = /^[A-Za-z0-9._~%() -]+$/;
|
|
74
|
+
/** Is `host` an Azure DevOps host (`dev.azure.com`, `ssh.dev.azure.com`, `*.visualstudio.com`)? */
|
|
75
|
+
export function isAdoHost(host) {
|
|
76
|
+
if (host === null)
|
|
77
|
+
return false;
|
|
78
|
+
const h = host.toLowerCase();
|
|
79
|
+
return h === 'dev.azure.com' || h === 'ssh.dev.azure.com' || h === 'visualstudio.com' || h.endsWith('.visualstudio.com');
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* The Azure DevOps repository of a remote URL, or `null`. Accepts the four spellings Azure DevOps
|
|
83
|
+
* hands out — `https://[user@]dev.azure.com/<org>/<project>/_git/<repo>`,
|
|
84
|
+
* `https://<org>.visualstudio.com/[DefaultCollection/]<project>/_git/<repo>`,
|
|
85
|
+
* `git@ssh.dev.azure.com:v3/<org>/<project>/<repo>` and
|
|
86
|
+
* `<org>@vs-ssh.visualstudio.com:v3/<org>/<project>/<repo>` — and nothing looser. Userinfo is
|
|
87
|
+
* never kept. Every part is percent-decoded once and re-encoded, so the canonical URL is stable.
|
|
88
|
+
*/
|
|
89
|
+
export function adoRepoOf(url) {
|
|
90
|
+
const raw = (url ?? '').trim();
|
|
91
|
+
if (raw === '' || !isAdoHost(originRemoteHost(raw)))
|
|
92
|
+
return null;
|
|
93
|
+
let org;
|
|
94
|
+
let project;
|
|
95
|
+
let repo;
|
|
96
|
+
const dec = (s) => {
|
|
97
|
+
try {
|
|
98
|
+
return decodeURIComponent(s);
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
const ssh = /^(?:ssh:\/\/)?[^@/\s]+@(?:ssh\.dev\.azure\.com|vs-ssh\.visualstudio\.com)[:/](?:v3\/)([^/]+)\/([^/]+)\/([^/]+?)\/?$/i.exec(raw);
|
|
105
|
+
if (ssh !== null) {
|
|
106
|
+
[org, project, repo] = [ssh[1], ssh[2], ssh[3]];
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
let u;
|
|
110
|
+
try {
|
|
111
|
+
u = new URL(raw);
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
if (u.protocol !== 'https:')
|
|
117
|
+
return null;
|
|
118
|
+
const host = u.hostname.toLowerCase();
|
|
119
|
+
const segs = u.pathname.split('/').filter((x) => x !== '');
|
|
120
|
+
const gitAt = segs.indexOf('_git');
|
|
121
|
+
if (gitAt < 0 || gitAt !== segs.length - 2)
|
|
122
|
+
return null;
|
|
123
|
+
if (host === 'dev.azure.com') {
|
|
124
|
+
if (gitAt !== 2)
|
|
125
|
+
return null;
|
|
126
|
+
[org, project, repo] = [segs[0], segs[1], segs[3]];
|
|
127
|
+
}
|
|
128
|
+
else if (host.endsWith('.visualstudio.com')) {
|
|
129
|
+
org = host.slice(0, -'.visualstudio.com'.length);
|
|
130
|
+
const rest = segs.slice(0, gitAt).filter((s, i) => !(i === 0 && s.toLowerCase() === 'defaultcollection'));
|
|
131
|
+
if (rest.length !== 1)
|
|
132
|
+
return null;
|
|
133
|
+
[project, repo] = [rest[0], segs[gitAt + 1]];
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
const parts = [org, project, repo.replace(/\.git$/i, '')].map(dec);
|
|
140
|
+
if (parts.some((p) => p === null || p === '' || !ADO_PART.test(p)))
|
|
141
|
+
return null;
|
|
142
|
+
const [o, p, r] = parts;
|
|
143
|
+
const e = encodeURIComponent;
|
|
144
|
+
const webUrl = `https://dev.azure.com/${e(o)}/${e(p)}/_git/${e(r)}`;
|
|
145
|
+
return {
|
|
146
|
+
org: o,
|
|
147
|
+
project: p,
|
|
148
|
+
repo: r,
|
|
149
|
+
gitUrl: webUrl,
|
|
150
|
+
apiBase: `https://dev.azure.com/${e(o)}/${e(p)}/_apis/git/repositories/${e(r)}`,
|
|
151
|
+
webUrl,
|
|
152
|
+
loginBase: 'https://login.microsoftonline.com',
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
/** The provider a delivery to `originUrl` uses, or `null` (push-only / local / unknown). */
|
|
156
|
+
export function deliverProviderOf(originUrl) {
|
|
157
|
+
const host = originRemoteHost((originUrl ?? '').trim());
|
|
158
|
+
if (host === null)
|
|
159
|
+
return null;
|
|
160
|
+
if (host === 'github.com' || host === 'ssh.github.com')
|
|
161
|
+
return 'github';
|
|
162
|
+
if (adoRepoOf(originUrl) !== null)
|
|
163
|
+
return 'azure_devops';
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
166
|
+
/** The credential preflight a deliver card shows for an origin; `null` when no provider applies. */
|
|
167
|
+
export function deliverCredentialsFor(originUrl, env, ghLogins) {
|
|
168
|
+
const provider = deliverProviderOf(originUrl);
|
|
169
|
+
if (provider === 'azure_devops')
|
|
170
|
+
return adoCredentials(env);
|
|
171
|
+
if (provider === 'github')
|
|
172
|
+
return githubCredentials(env, ghLogins);
|
|
173
|
+
return null;
|
|
174
|
+
}
|
|
175
|
+
/** `deliver: CREDENTIALS-MISSING <provider>` in a deliver transcript → that provider, else `null`.
|
|
176
|
+
* The LAST such line decides; the script prints it before anything reaches the remote. */
|
|
177
|
+
export function credentialsMissingIn(text) {
|
|
178
|
+
let found = null;
|
|
179
|
+
for (const line of text.split('\n')) {
|
|
180
|
+
const m = /^deliver: CREDENTIALS-MISSING (github|azure_devops)\b/.exec(line.trim());
|
|
181
|
+
if (m !== null)
|
|
182
|
+
found = m[1];
|
|
183
|
+
}
|
|
184
|
+
return found;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* {@link deliverCredentialsFor} with the gh probe run only when it can matter: a github.com origin
|
|
188
|
+
* with no exported GH_TOKEN (a bounded `gh auth status`, crew#737's probe). gh not installed reads
|
|
189
|
+
* `'absent'`; a probe that timed out reads unknown. Never throws.
|
|
190
|
+
*/
|
|
191
|
+
export async function deliverCredentialsProbe(originUrl, env, probe = ghLoginsOrAbsent) {
|
|
192
|
+
const provider = deliverProviderOf(originUrl);
|
|
193
|
+
if (provider === null)
|
|
194
|
+
return null;
|
|
195
|
+
if (provider === 'azure_devops' || present(env, 'GH_TOKEN'))
|
|
196
|
+
return deliverCredentialsFor(originUrl, env, null);
|
|
197
|
+
const logins = await probe().catch(() => null);
|
|
198
|
+
return deliverCredentialsFor(originUrl, env, logins);
|
|
199
|
+
}
|
|
200
|
+
/** `gh auth status --hostname github.com` → the logins, `'absent'` when gh is not installed (spawn
|
|
201
|
+
* ENOENT), `null` when it could not answer. Bounded to 4 s; one answer serves 30 s. */
|
|
202
|
+
let ghMemo = null;
|
|
203
|
+
/** How long one gh answer serves the launch composer and the gate card (a sign-in is rare). */
|
|
204
|
+
const GH_MEMO_MS = 30_000;
|
|
205
|
+
export function ghLoginsOrAbsent() {
|
|
206
|
+
const now = Date.now();
|
|
207
|
+
if (ghMemo !== null && now - ghMemo.at < GH_MEMO_MS)
|
|
208
|
+
return ghMemo.value;
|
|
209
|
+
const value = ghLoginsUncached();
|
|
210
|
+
ghMemo = { at: now, value };
|
|
211
|
+
return value;
|
|
212
|
+
}
|
|
213
|
+
function ghLoginsUncached() {
|
|
214
|
+
return new Promise((resolve) => {
|
|
215
|
+
execFile('gh', ['auth', 'status', '--hostname', 'github.com'], { timeout: 4_000, encoding: 'utf8', env: childEnvWithBootEstateDb(process.env) }, (err, stdout, stderr) => {
|
|
216
|
+
const code = err?.code;
|
|
217
|
+
if (code === 'ENOENT')
|
|
218
|
+
return resolve('absent');
|
|
219
|
+
// A non-numeric code (a timeout kill, another spawn failure) is no answer at all.
|
|
220
|
+
if (err !== null && typeof code !== 'number')
|
|
221
|
+
return resolve(null);
|
|
222
|
+
resolve(parseGhAuthStatusLogins(`${String(stdout ?? '')}\n${String(stderr ?? '')}`));
|
|
223
|
+
});
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
/** The canonical `missing` reading for a provider — what the run record says after the deliver
|
|
227
|
+
* phase refused for want of the credential (the phase read the environment it ran in). */
|
|
228
|
+
export function missingCredentials(provider) {
|
|
229
|
+
return provider === 'azure_devops' ? adoCredentials({}) : githubCredentials({}, []);
|
|
230
|
+
}
|
|
231
|
+
//# sourceMappingURL=deliver-credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deliver-credentials.js","sourceRoot":"","sources":["../../src/core/deliver-credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG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IAAI,GAAI,GAAiC,EAAE,IAAI,CAAC;YACtD,IAAI,IAAI,KAAK,QAAQ;gBAAE,OAAO,OAAO,CAAC,QAAQ,CAAC,CAAC;YAChD,kFAAkF;YAClF,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;gBAAE,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;YACnE,OAAO,CAAC,uBAAuB,CAAC,GAAG,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACvF,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED;2FAC2F;AAC3F,MAAM,UAAU,kBAAkB,CAAC,QAAyB;IAC1D,OAAO,QAAQ,KAAK,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AACtF,CAAC"}
|
package/dist/core/deliver.d.ts
CHANGED
|
@@ -84,6 +84,7 @@
|
|
|
84
84
|
* {@link deliverPrPhase}.
|
|
85
85
|
*/
|
|
86
86
|
import type { PhaseDef, WorkflowDef } from './types.js';
|
|
87
|
+
import { type AdoRepo, type DeliverCredentials } from './deliver-credentials.js';
|
|
87
88
|
import { type DeliverTextFacts } from './deliver-text.js';
|
|
88
89
|
/**
|
|
89
90
|
* The content-address of wicked-core's built-in evidence floor (`builtin_floors::EVIDENCE_FLOOR_PIN`,
|
|
@@ -213,6 +214,12 @@ export interface DeliverScriptOptions {
|
|
|
213
214
|
/** (crew#739) The sentinel nonce (16-64 hex digits). Absent ⇒ a fresh one per composition; a
|
|
214
215
|
* test passes one to read the sentinel deterministically. Refused at compose time otherwise. */
|
|
215
216
|
nonce?: string;
|
|
217
|
+
/** (crew#720) The Azure DevOps repository this delivery goes to. Absent ⇒ derived from
|
|
218
|
+
* `originUrl` ({@link adoRepoOf}); a test passes one to point the push and the REST calls at a
|
|
219
|
+
* local git server and a mocked API. `null` ⇒ not an Azure DevOps delivery. */
|
|
220
|
+
adoTarget?: AdoRepo | null;
|
|
221
|
+
/** (crew#720) The provider credential preflight read at compose time, for the gate card. */
|
|
222
|
+
credentials?: DeliverCredentials | null;
|
|
216
223
|
}
|
|
217
224
|
/**
|
|
218
225
|
* (crew#737) The configured push identity for a launch on `repoRef`: the repository's own pin
|
|
@@ -473,6 +480,8 @@ export interface DeliverTargetView {
|
|
|
473
480
|
githubRepo: string | null;
|
|
474
481
|
/** {@link newPrTargetSentence} for the launch (no run yet): the deliver gate's own sentence. */
|
|
475
482
|
sentence: string;
|
|
483
|
+
/** (crew#720) `org/project/repo` for an Azure DevOps origin; `null` otherwise. */
|
|
484
|
+
adoRepo: string | null;
|
|
476
485
|
}
|
|
477
486
|
/** The launch-time reading of the same origin preflight the deliver gate uses (R3, crew#730). */
|
|
478
487
|
export declare function deliverTargetView(originUrl: string | null | undefined): DeliverTargetView;
|
|
@@ -518,6 +527,8 @@ export interface DeliverLaunchContext {
|
|
|
518
527
|
deliverIdentitySource?: 'repo' | 'setting';
|
|
519
528
|
/** (crew#737) Whether it is signed in to gh here (`null`/absent = unknown). */
|
|
520
529
|
deliverIdentitySignedIn?: boolean | null;
|
|
530
|
+
/** (crew#720) The provider credential preflight for the gate card (`null`/absent = none read). */
|
|
531
|
+
credentials?: DeliverCredentials | null;
|
|
521
532
|
}
|
|
522
533
|
/**
|
|
523
534
|
* The `deliver` PLAN STEP a delivering PRESET launch hands the engine (DES-TEAMING-002 T3,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deliver.d.ts","sourceRoot":"","sources":["../../src/core/deliver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoFG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,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