passport-bridge 0.47.0 → 0.48.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/cliExec.js +2 -2
  2. package/dist/cliGitCredential.js +3 -9
  3. package/dist/cliHookDecide.d.ts +1 -0
  4. package/dist/cliHookDecide.js +21 -3
  5. package/dist/connectorKit/engine.generated.js +16 -6
  6. package/dist/connectorKit/githubDecide.generated.d.ts +57 -0
  7. package/dist/connectorKit/githubDecide.generated.js +247 -0
  8. package/dist/{controlPlaneGithubCatalog.generated.d.ts → connectorKit/githubIds.generated.d.ts} +8 -12
  9. package/dist/{controlPlaneGithubCatalog.generated.js → connectorKit/githubIds.generated.js} +2 -33
  10. package/dist/connectorKit/http.generated.d.ts +33 -0
  11. package/dist/connectorKit/http.generated.js +399 -0
  12. package/dist/connectorKit/manifest.generated.d.ts +10 -1
  13. package/dist/connectorKit/manifests/github.generated.d.ts +1 -0
  14. package/dist/connectorKit/manifests/github.generated.js +39 -3
  15. package/dist/connectorKit/manifests/githubActionList.generated.d.ts +30 -0
  16. package/dist/connectorKit/manifests/githubActionList.generated.js +22 -0
  17. package/dist/connectorKit/manifests/githubCapture.generated.js +150 -84
  18. package/dist/connectorKit/manifests/githubGenerated.generated.d.ts +40 -0
  19. package/dist/connectorKit/manifests/githubGenerated.generated.js +143 -0
  20. package/dist/connectorKit/manifests/githubHooks.generated.d.ts +8 -0
  21. package/dist/connectorKit/manifests/githubHooks.generated.js +229 -29
  22. package/dist/connectorKit/manifests/githubReads.generated.js +23 -24
  23. package/dist/connectorKit/shadow.generated.d.ts +4 -10
  24. package/dist/connectorKit/shadow.generated.js +4 -40
  25. package/dist/connectorKit/sources/github/actions.generated.d.ts +35 -0
  26. package/dist/connectorKit/sources/github/actions.generated.js +2 -0
  27. package/dist/connectorKit/sources/github/catalog.generated.d.ts +2220 -0
  28. package/dist/connectorKit/sources/github/catalog.generated.js +2 -0
  29. package/dist/controlPlane.generated.d.ts +5 -8
  30. package/dist/controlPlane.generated.js +5 -3
  31. package/dist/controlPlaneGuard.d.ts +7 -7
  32. package/dist/controlPlaneGuard.js +28 -40
  33. package/dist/cpCli.d.ts +2 -0
  34. package/dist/cpCli.js +7 -1
  35. package/dist/execGithubRepo.js +6 -5
  36. package/dist/gitPush.d.ts +1 -11
  37. package/dist/gitPush.js +2 -5
  38. package/dist/kitShadow.d.ts +2 -11
  39. package/dist/kitShadow.js +2 -7
  40. package/dist/pluginPin.d.ts +1 -1
  41. package/dist/pluginPin.js +1 -1
  42. package/dist/version.d.ts +1 -1
  43. package/dist/version.js +1 -1
  44. package/npm-shrinkwrap.json +2 -2
  45. package/package.json +1 -1
  46. package/dist/controlPlaneGithub.generated.d.ts +0 -45
  47. package/dist/controlPlaneGithub.generated.js +0 -101
  48. package/dist/controlPlaneGithubApi.generated.d.ts +0 -17
  49. package/dist/controlPlaneGithubApi.generated.js +0 -172
  50. package/dist/controlPlaneGithubCli.generated.d.ts +0 -104
  51. package/dist/controlPlaneGithubCli.generated.js +0 -367
  52. package/dist/controlPlaneGithubWebhook.generated.d.ts +0 -30
  53. package/dist/controlPlaneGithubWebhook.generated.js +0 -105
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Raw HTTP command lines (docs/design/v23/github-kit.md, Phase 3): `curl`, `wget` and httpie (`http`, `https`), read
3
+ * the way each tool reads its arguments, into one request: method, URL and, only to decide, a body. Generic: no app
4
+ * names; an app's hooks say which hosts are its own. Headers, cookies, credentials and query strings are never
5
+ * returned: only what decides the action (the method, the URL's path, and a body's fields).
6
+ */
7
+ export type HttpTool = "curl" | "wget" | "httpie";
8
+ export type HttpLine = {
9
+ tool: HttpTool;
10
+ method: string;
11
+ /** The one URL the line sends to; absent when it names none it can read (`problem` says why). */
12
+ url?: string;
13
+ /** The body's fields when the line spells them out (inline JSON, `name=value`), to decide only; never kept. */
14
+ body?: Record<string, unknown>;
15
+ /** The line sends a body it can't read (a file, standard input, a binary): it may decide the action. */
16
+ opaque?: true;
17
+ /** Why the line's target can't be read: a URL the shell expands (a variable, a substitution, curl's globs), several
18
+ * URLs, none, or a line Passport can't read (a config file, a positional that isn't a URL). */
19
+ problem?: "variable" | "several" | "none" | "unreadable";
20
+ };
21
+ /** The tool a line runs, by its program's name ("/usr/bin/curl", "curl.exe"), or null. */
22
+ export declare function httpToolOf(program: string | undefined): HttpTool | null;
23
+ /** What a command line sends, when its program is curl, wget or httpie; null for any other program. `stdin`: the
24
+ * line reads standard input (a pipe into it, `<`, a heredoc), which httpie sends as the body. */
25
+ export declare function httpLineOf(argv: readonly string[], stdin?: boolean): HttpLine | null;
26
+ /**
27
+ * A URL's host and path (no query string, no fragment, no credentials), or null when it isn't an http(s) URL.
28
+ * httpie's shorthand (`:3000/x`, `example.com/x`) and a bare host get `https://`.
29
+ */
30
+ export declare function urlParts(url: string): {
31
+ host: string;
32
+ path: string;
33
+ } | null;
@@ -0,0 +1,399 @@
1
+ // Generated by scripts/generate-control-plane-classifier.mjs. Do not edit.
2
+ /**
3
+ * Raw HTTP command lines (docs/design/v23/github-kit.md, Phase 3): `curl`, `wget` and httpie (`http`, `https`), read
4
+ * the way each tool reads its arguments, into one request: method, URL and, only to decide, a body. Generic: no app
5
+ * names; an app's hooks say which hosts are its own. Headers, cookies, credentials and query strings are never
6
+ * returned: only what decides the action (the method, the URL's path, and a body's fields).
7
+ */
8
+ const PROGRAMS = { curl: "curl", wget: "wget", http: "httpie", https: "httpie" };
9
+ /** The tool a line runs, by its program's name ("/usr/bin/curl", "curl.exe"), or null. */
10
+ export function httpToolOf(program) {
11
+ const name = (program ?? "")
12
+ .replace(/^.*[/\\]/, "")
13
+ .replace(/\.exe$/i, "")
14
+ .toLowerCase();
15
+ return Object.hasOwn(PROGRAMS, name) ? PROGRAMS[name] : null;
16
+ }
17
+ /** A word the shell would expand: a variable, a command substitution, a glob of braces. */
18
+ const EXPANDS = /\$|`/;
19
+ /** curl's options that take a value, short and long (`-X POST`, `--request=POST`, `-XPOST`). */
20
+ const CURL_VALUE = new Set([
21
+ "-X",
22
+ "--request",
23
+ "-H",
24
+ "--header",
25
+ "-d",
26
+ "--data",
27
+ "--data-raw",
28
+ "--data-binary",
29
+ "--data-urlencode",
30
+ "--data-ascii",
31
+ "--json",
32
+ "-F",
33
+ "--form",
34
+ "--form-string",
35
+ "-T",
36
+ "--upload-file",
37
+ "-u",
38
+ "--user",
39
+ "-o",
40
+ "--output",
41
+ "-A",
42
+ "--user-agent",
43
+ "-e",
44
+ "--referer",
45
+ "-b",
46
+ "--cookie",
47
+ "-c",
48
+ "--cookie-jar",
49
+ "--url",
50
+ "-w",
51
+ "--write-out",
52
+ "-m",
53
+ "--max-time",
54
+ "--connect-timeout",
55
+ "--retry",
56
+ "--retry-delay",
57
+ "--retry-max-time",
58
+ "-x",
59
+ "--proxy",
60
+ "-U",
61
+ "--proxy-user",
62
+ "--oauth2-bearer",
63
+ "-K",
64
+ "--config",
65
+ "--cacert",
66
+ "--capath",
67
+ "--cert",
68
+ "-E",
69
+ "--key",
70
+ "--resolve",
71
+ "--connect-to",
72
+ "--interface",
73
+ "-r",
74
+ "--range",
75
+ "-z",
76
+ "--time-cond",
77
+ "-Y",
78
+ "--speed-limit",
79
+ "-y",
80
+ "--speed-time",
81
+ "--limit-rate",
82
+ "--max-filesize",
83
+ "--variable",
84
+ "--url-query",
85
+ "-D",
86
+ "--dump-header",
87
+ "--trace",
88
+ "--trace-ascii",
89
+ "--stderr",
90
+ "-Q",
91
+ "--quote",
92
+ "--max-redirs",
93
+ "--aws-sigv4",
94
+ "--service-name",
95
+ "--unix-socket",
96
+ "--abstract-unix-socket",
97
+ "--hostpubsha256",
98
+ "--pinnedpubkey",
99
+ "--ciphers",
100
+ "--expect100-timeout"
101
+ ]);
102
+ /** curl's URL globs (`{a,b}`, `[1-9]`): several URLs, unless `-g`/`--globoff`. */
103
+ const GLOB = /[{}[\]]/;
104
+ /** curl's options that send a body (`-T` uploads with PUT). */
105
+ const CURL_DATA = new Set([
106
+ "-d",
107
+ "--data",
108
+ "--data-raw",
109
+ "--data-binary",
110
+ "--data-urlencode",
111
+ "--data-ascii",
112
+ "--json",
113
+ "-F",
114
+ "--form",
115
+ "--form-string",
116
+ "-T",
117
+ "--upload-file"
118
+ ]);
119
+ /** curl's short options that take no value, so a cluster (`-sSL`) is read letter by letter. */
120
+ const CURL_SHORT_VALUE = new Set([..."XHdFTuoAebcwmxUKErzYyDQ"]);
121
+ /** wget's options that take a value (`--header=…` or `--header …`). */
122
+ const WGET_VALUE = new Set([
123
+ "--method",
124
+ "--header",
125
+ "--body-data",
126
+ "--body-file",
127
+ "--post-data",
128
+ "--post-file",
129
+ "-O",
130
+ "--output-document",
131
+ "-o",
132
+ "--output-file",
133
+ "-a",
134
+ "--append-output",
135
+ "-U",
136
+ "--user-agent",
137
+ "--user",
138
+ "--password",
139
+ "--http-user",
140
+ "--http-password",
141
+ "-e",
142
+ "--execute",
143
+ "-t",
144
+ "--tries",
145
+ "-T",
146
+ "--timeout",
147
+ "-P",
148
+ "--directory-prefix",
149
+ "--load-cookies",
150
+ "--save-cookies",
151
+ "--referer",
152
+ "-i",
153
+ "--input-file",
154
+ "--ca-certificate",
155
+ "--certificate",
156
+ "--private-key",
157
+ "--limit-rate",
158
+ "-w",
159
+ "--wait",
160
+ "-Q",
161
+ "--quota",
162
+ "--bind-address"
163
+ ]);
164
+ /** httpie's options that take a value. */
165
+ const HTTPIE_VALUE = new Set([
166
+ "-a",
167
+ "--auth",
168
+ "-A",
169
+ "--auth-type",
170
+ "--session",
171
+ "--session-read-only",
172
+ "-o",
173
+ "--output",
174
+ "--pretty",
175
+ "-s",
176
+ "--style",
177
+ "-p",
178
+ "--print",
179
+ "-P",
180
+ "--history-print",
181
+ "--proxy",
182
+ "--cert",
183
+ "--cert-key",
184
+ "--cert-key-pass",
185
+ "--verify",
186
+ "--timeout",
187
+ "--max-redirects",
188
+ "--max-headers",
189
+ "--format-options",
190
+ "--response-charset",
191
+ "--response-mime",
192
+ "--default-scheme",
193
+ "--ssl",
194
+ "--ciphers",
195
+ "--raw",
196
+ "--boundary"
197
+ ]);
198
+ /** What httpie reads as its URL: a scheme, `:port`/`:/path` (localhost), localhost, or a dotted host. */
199
+ const HTTPIE_URL = /^(?:https?:\/\/|:\d|:\/|localhost\b|[\w-]+(?:\.[\w-]+)+\.?(?::\d+)?(?:\/|$))/i;
200
+ const HTTPIE_METHODS = new Set(["GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"]);
201
+ /** A JSON object, or undefined. */
202
+ function objectOf(text) {
203
+ try {
204
+ const value = JSON.parse(text);
205
+ return value && typeof value === "object" && !Array.isArray(value) ? value : undefined;
206
+ }
207
+ catch {
208
+ return undefined;
209
+ }
210
+ }
211
+ /** `a=1&b=two` as fields (a form body), or undefined when it isn't one. */
212
+ function formOf(text) {
213
+ const pairs = text.split("&").map((pair) => pair.split("="));
214
+ if (!pairs.every((pair) => pair.length >= 2 && /^[\w.[\]-]+$/.test(pair[0])))
215
+ return undefined;
216
+ return Object.fromEntries(pairs.map(([name, ...value]) => [name, value.join("=")]));
217
+ }
218
+ function splitOptions(argv, takesValue, shortCluster) {
219
+ const options = [];
220
+ const words = [];
221
+ for (let index = 1; index < argv.length; index += 1) {
222
+ const word = argv[index];
223
+ if (word === "--") {
224
+ words.push(...argv.slice(index + 1));
225
+ break;
226
+ }
227
+ if (word.startsWith("--")) {
228
+ const eq = word.indexOf("=");
229
+ const name = eq > 0 ? word.slice(0, eq) : word;
230
+ if (eq > 0)
231
+ options.push({ name, value: word.slice(eq + 1) });
232
+ else if (takesValue(name))
233
+ options.push({ name, value: argv[++index] });
234
+ else
235
+ options.push({ name });
236
+ continue;
237
+ }
238
+ if (word.startsWith("-") && word.length > 1) {
239
+ // A cluster: each letter a flag until one that takes a value, which takes the rest (or the next word).
240
+ for (let at = 1; at < word.length; at += 1) {
241
+ const name = `-${word[at]}`;
242
+ const valued = shortCluster ? shortCluster.has(word[at]) : takesValue(name);
243
+ if (!valued) {
244
+ options.push({ name });
245
+ continue;
246
+ }
247
+ const rest = word.slice(at + 1);
248
+ options.push({ name, value: rest || argv[++index] });
249
+ break;
250
+ }
251
+ continue;
252
+ }
253
+ words.push(word);
254
+ }
255
+ return { options, words };
256
+ }
257
+ /** The one URL among the URL sources, or the problem: none, several, or one the shell would expand. */
258
+ function oneUrl(sources) {
259
+ if (sources.some((source) => EXPANDS.test(source)))
260
+ return { problem: "variable" };
261
+ const distinct = [...new Set(sources)];
262
+ if (distinct.length === 0)
263
+ return { problem: "none" };
264
+ if (distinct.length > 1)
265
+ return { problem: "several" };
266
+ return { url: distinct[0] };
267
+ }
268
+ /** A body option's value: inline JSON or a form as fields; a file (`@file`, `@-`) or anything else is opaque. */
269
+ function bodyOf(values) {
270
+ if (values.length === 0)
271
+ return {};
272
+ if (values.length > 1 || values[0].startsWith("@") || values[0].startsWith("<"))
273
+ return { opaque: true };
274
+ const fields = objectOf(values[0]) ?? formOf(values[0]);
275
+ return fields ? { body: fields } : { opaque: true };
276
+ }
277
+ function curl(argv) {
278
+ const { options, words } = splitOptions(argv, (name) => CURL_VALUE.has(name), CURL_SHORT_VALUE);
279
+ const value = (...names) => options.filter((option) => names.includes(option.name)).map((option) => option.value ?? "");
280
+ const urls = value("--url");
281
+ const has = (...names) => options.some((option) => names.includes(option.name));
282
+ // A repeated --url is a conflict, whatever the URLs; a config file (-K) may hold anything; a glob is several URLs.
283
+ const read = urls.length > 1 ? { problem: "several" } : oneUrl([...urls, ...words]);
284
+ // A config file (-K) may hold anything, and --next starts another request with its own options: unreadable.
285
+ const target = has("-K", "--config", "--next", "-:")
286
+ ? { problem: "unreadable" }
287
+ : read.url && GLOB.test(read.url) && !has("-g", "--globoff")
288
+ ? { problem: "variable" }
289
+ : read;
290
+ const data = options.filter((option) => CURL_DATA.has(option.name));
291
+ const forms = data.filter((option) => ["-F", "--form", "--form-string"].includes(option.name));
292
+ const uploads = data.filter((option) => ["-T", "--upload-file"].includes(option.name));
293
+ const explicit = value("-X", "--request").at(-1);
294
+ // An upload is a PUT even with -G (which only moves data to the query string).
295
+ const method = (explicit ??
296
+ (uploads.length ? "PUT" : has("-I", "--head") ? "HEAD" : has("-G", "--get") ? "GET" : data.length ? "POST" : "GET")).toUpperCase();
297
+ // -G sends the data in the query string: no body.
298
+ const sent = has("-G", "--get") ? [] : data;
299
+ let body = {};
300
+ if (uploads.length)
301
+ body = { opaque: true };
302
+ else if (forms.length) {
303
+ const fields = {};
304
+ let opaque = false;
305
+ for (const form of forms) {
306
+ const eq = (form.value ?? "").indexOf("=");
307
+ const raw = eq > 0 ? form.value.slice(eq + 1) : "";
308
+ if (eq <= 0 || (form.name !== "--form-string" && /^[@<]/.test(raw)))
309
+ opaque = true;
310
+ else
311
+ fields[form.value.slice(0, eq)] = raw;
312
+ }
313
+ body = opaque ? { opaque: true } : { body: fields };
314
+ }
315
+ else if (sent.length) {
316
+ const binary = sent.some((option) => option.name === "--data-binary" && (option.value ?? "").startsWith("@"));
317
+ body = binary ? { opaque: true } : bodyOf(sent.map((option) => option.value ?? ""));
318
+ }
319
+ return { tool: "curl", method, ...target, ...body };
320
+ }
321
+ function wget(argv) {
322
+ const { options, words } = splitOptions(argv, (name) => WGET_VALUE.has(name));
323
+ const value = (...names) => options.filter((option) => names.includes(option.name)).map((option) => option.value ?? "");
324
+ const files = value("--post-file", "--body-file");
325
+ const inline = value("--post-data", "--body-data");
326
+ const explicit = value("--method").at(-1);
327
+ const method = (explicit ?? (files.length || inline.length ? "POST" : "GET")).toUpperCase();
328
+ const body = files.length ? { opaque: true } : bodyOf(inline);
329
+ return { tool: "wget", method, ...oneUrl(words), ...body };
330
+ }
331
+ function httpie(argv, stdin) {
332
+ const { options, words } = splitOptions(argv, (name) => HTTPIE_VALUE.has(name));
333
+ const rest = [...words];
334
+ const explicit = rest[0] && HTTPIE_METHODS.has(rest[0].toUpperCase()) ? rest.shift().toUpperCase() : undefined;
335
+ const url = rest.shift();
336
+ const fields = {};
337
+ // Standard input (a pipe, `<`) is the body unless --ignore-stdin says otherwise: unreadable here.
338
+ const ignoreStdin = options.some((option) => option.name === "-I" || option.name === "--ignore-stdin");
339
+ let opaque = options.some((option) => option.name === "--raw") || (stdin && !ignoreStdin);
340
+ // Request items: `name=value` (a string), `name:=json`, `name@file` / `name=@file` (a file); `Header:value` and
341
+ // `name==value` (the query string) are not the body.
342
+ for (const item of rest) {
343
+ const json = /^([\w.[\]-]+):=(.*)$/s.exec(item);
344
+ const field = /^([\w.[\]-]+)=(?!=)(.*)$/s.exec(item);
345
+ if (/^[\w.[\]-]+(?::=@|=@|@)/.test(item))
346
+ opaque = true;
347
+ else if (json) {
348
+ try {
349
+ fields[json[1]] = JSON.parse(json[2]);
350
+ }
351
+ catch {
352
+ opaque = true;
353
+ }
354
+ }
355
+ else if (field && !item.includes("=="))
356
+ fields[field[1]] = field[2];
357
+ }
358
+ const sends = opaque || Object.keys(fields).length > 0;
359
+ const method = explicit ?? (sends ? "POST" : "GET");
360
+ const body = opaque
361
+ ? { opaque: true }
362
+ : Object.keys(fields).length
363
+ ? { body: fields }
364
+ : {};
365
+ const target = oneUrl(url === undefined ? [] : [url]);
366
+ // A positional httpie wouldn't read as a URL (an option it doesn't know took its place): fail closed.
367
+ if (target.url && !HTTPIE_URL.test(target.url))
368
+ return { tool: "httpie", method, problem: "unreadable", ...body };
369
+ return { tool: "httpie", method, ...target, ...body };
370
+ }
371
+ /** What a command line sends, when its program is curl, wget or httpie; null for any other program. `stdin`: the
372
+ * line reads standard input (a pipe into it, `<`, a heredoc), which httpie sends as the body. */
373
+ export function httpLineOf(argv, stdin = false) {
374
+ const tool = httpToolOf(argv[0]);
375
+ if (tool === "curl")
376
+ return curl(argv);
377
+ if (tool === "wget")
378
+ return wget(argv);
379
+ if (tool === "httpie")
380
+ return httpie(argv, stdin);
381
+ return null;
382
+ }
383
+ /**
384
+ * A URL's host and path (no query string, no fragment, no credentials), or null when it isn't an http(s) URL.
385
+ * httpie's shorthand (`:3000/x`, `example.com/x`) and a bare host get `https://`.
386
+ */
387
+ export function urlParts(url) {
388
+ const full = /^[a-z][a-z0-9+.-]*:\/\//i.test(url) ? url : `https://${url.replace(/^\/\//, "")}`;
389
+ try {
390
+ const parsed = new URL(full);
391
+ if (parsed.protocol !== "https:" && parsed.protocol !== "http:")
392
+ return null;
393
+ // A trailing dot names the same host ("api.github.com.").
394
+ return { host: parsed.hostname.toLowerCase().replace(/\.$/, ""), path: decodeURIComponent(parsed.pathname) || "/" };
395
+ }
396
+ catch {
397
+ return null;
398
+ }
399
+ }
@@ -63,9 +63,11 @@ export type CaptureRule = {
63
63
  action: string;
64
64
  /** Why it is a read, when `action` is "read". */
65
65
  because?: string;
66
- /** The node type it lands on (its NodeSpec names it). Not needed for a read. */
66
+ /** The node type it lands on (its NodeSpec names it; "platform": the platform's own node). Not needed for a read. */
67
67
  on?: string;
68
68
  summary?: Template;
69
+ /** Summaries tried in order when `summary` can't be filled; the last is rendered with "(unknown)" if none fills. */
70
+ summaryElse?: readonly Template[];
69
71
  target?: TargetSpec;
70
72
  /** A named hook in the platform's hooks module decides instead (staged changes, a read first). */
71
73
  hook?: string;
@@ -109,8 +111,13 @@ export type FlagSpec = {
109
111
  /** Given more than once, every value counts (`-F a=1 -F b=2`). */
110
112
  repeat?: boolean;
111
113
  };
114
+ /** A command, tool or route the manifest neither names nor lists as a read: Unclassified (the default, fail closed),
115
+ * or "none": not decided at all, for a platform whose lists don't yet cover its vendor's sources (GitHub's `gh`
116
+ * commands and REST routes until its generated catalog). A known one with a bad flag or field still fails closed. */
117
+ export type UnknownOp = "unclassified" | "none";
112
118
  export type CliSpec = {
113
119
  programs: readonly string[];
120
+ unknown?: UnknownOp;
114
121
  /** How the CLI parses flags. cobra: booleans take =1/t/T/true/TRUE/True or =0/f/F/false/FALSE/False.
115
122
  * arg (Vercel's parser): a boolean takes no value at all; `--flag=x` on a boolean is an error. */
116
123
  framework: "cobra" | "arg";
@@ -177,6 +184,7 @@ export type CaptureSpec = {
177
184
  prefixes: readonly string[];
178
185
  rules: readonly CaptureRule[];
179
186
  reads: Readonly<Record<string, ReadEvidence>>;
187
+ unknown?: UnknownOp;
180
188
  };
181
189
  /**
182
190
  * API calls: "METHOD /route/{param}" templates, path params, query-string params and the body fields a
@@ -187,6 +195,7 @@ export type CaptureSpec = {
187
195
  base: string;
188
196
  rules: readonly CaptureRule[];
189
197
  reads: Readonly<Record<string, ReadEvidence>>;
198
+ unknown?: UnknownOp;
190
199
  /** Query keys that name what a call acts on (Vercel's teamId); no other query key can set a node param. */
191
200
  query?: readonly string[];
192
201
  };
@@ -13,5 +13,6 @@ import type { ResourceTypeDef } from "../../controlPlane.generated.js";
13
13
  */
14
14
  export declare const GITHUB_TYPES: readonly ResourceTypeDef[];
15
15
  export declare const GITHUB_NODES: Readonly<Record<string, NodeSpec>>;
16
+ /** The hand-written actions, then every action GitHub's sources name (`githubGenerated.ts`, Phase 2). */
16
17
  export declare const GITHUB_ACTIONS: readonly ManifestAction[];
17
18
  export declare const GITHUB: Manifest;
@@ -1,6 +1,7 @@
1
1
  // Generated by scripts/generate-control-plane-classifier.mjs. Do not edit.
2
2
  import { MANIFEST_SCHEMA } from "../manifest.generated.js";
3
3
  import { GITHUB_CAPTURE } from "./githubCapture.generated.js";
4
+ import { generatedActions } from "./githubGenerated.generated.js";
4
5
  /**
5
6
  * GitHub at Level 1, for the shadow run (integrations spike, 2026-11-14). Derived from today's classifier
6
7
  * (`shared/controlPlaneGithub*.ts`) and its tests: the same action keys, node ids and exact targets, so the
@@ -25,7 +26,7 @@ export const GITHUB_NODES = {
25
26
  // A repository's secrets, else an organization's.
26
27
  secrets: { key: ["{owner}/{repo}", "{org}"], parent: "service" }
27
28
  };
28
- export const GITHUB_ACTIONS = [
29
+ const HAND_ACTIONS = [
29
30
  { key: "github.repo.merge", kind: "change", appliesTo: "repo", label: "Merge a pull request", icon: "GitMerge" },
30
31
  { key: "github.repo.release", kind: "create", appliesTo: "repo", label: "Create a release", icon: "Tag" },
31
32
  { key: "github.repo.tag", kind: "change", appliesTo: "repo", label: "Push a tag", icon: "Tag" },
@@ -55,6 +56,38 @@ export const GITHUB_ACTIONS = [
55
56
  icon: "Shield"
56
57
  },
57
58
  { key: "github.org.invite", kind: "create", appliesTo: "org", label: "Invite a member", icon: "UserPlus" },
59
+ // Named by generated routes (Phase 2): the review table aliases GitHub's operations to these keys.
60
+ {
61
+ key: "github.repo.deploykey",
62
+ kind: "create",
63
+ appliesTo: "repo",
64
+ label: "Add a deploy key or webhook",
65
+ icon: "KeyRound"
66
+ },
67
+ {
68
+ key: "github.repo.transfer",
69
+ kind: "delete",
70
+ appliesTo: "repo",
71
+ label: "Transfer the repository",
72
+ icon: "ArrowRightLeft"
73
+ },
74
+ {
75
+ key: "github.org.owner",
76
+ kind: "create",
77
+ appliesTo: "org",
78
+ label: "Make a member an owner",
79
+ icon: "Crown"
80
+ },
81
+ { key: "github.repo.workflow", kind: "change", appliesTo: "repo", label: "Change a workflow file", icon: "Workflow" },
82
+ // A team's actions land on its organization (the kit has no team node).
83
+ { key: "github.team.member", kind: "create", appliesTo: "org", label: "Add a member", icon: "UserPlus" },
84
+ {
85
+ key: "github.team.repo",
86
+ kind: "create",
87
+ appliesTo: "org",
88
+ label: "Give the team access to a repository",
89
+ icon: "Users"
90
+ },
58
91
  {
59
92
  key: "github.secret.change",
60
93
  kind: "change",
@@ -88,12 +121,15 @@ export const GITHUB_ACTIONS = [
88
121
  icon: "CircleHelp"
89
122
  }
90
123
  ];
124
+ /** The hand-written actions, then every action GitHub's sources name (`githubGenerated.ts`, Phase 2). */
125
+ export const GITHUB_ACTIONS = [...HAND_ACTIONS, ...generatedActions(HAND_ACTIONS)];
91
126
  export const GITHUB = {
92
127
  schema: MANIFEST_SCHEMA,
93
128
  platform: "github",
94
129
  label: "GitHub",
95
130
  // 1: the shadow run's first manifest (2026-11-14), node ids as today's classifier names them.
96
- version: 4,
131
+ // 5: the generated catalog (Phase 2, 2026-11-18).
132
+ version: 5,
97
133
  plans: ["free", "team", "enterprise"],
98
134
  identity: "member",
99
135
  services: [
@@ -107,5 +143,5 @@ export const GITHUB = {
107
143
  capture: GITHUB_CAPTURE,
108
144
  probes: [],
109
145
  logs: [],
110
- hooks: ["branch", "ghRepo", "ghApi", "gitPush", "graphql"]
146
+ hooks: ["branch", "ref", "tagRef", "collaborator", "secret", "ghRepo", "ghAction", "ghApi", "gitPush", "graphql"]
111
147
  };
@@ -0,0 +1,30 @@
1
+ import type { ActionDef } from "../../controlPlane.generated.js";
2
+ /**
3
+ * GitHub's generated action list (`sources/github/actions.json`, docs/design/v23/github-kit.md, Phase 2), as data
4
+ * only: the server catalog and the web app read it without loading the routes or the classifier.
5
+ */
6
+ /** `sources/github/actions.json` (written by `githubImport.ts` githubActionsFile): `on` is the resource type a rule
7
+ * on the action sits on. */
8
+ export type GithubActionsFile = {
9
+ about: string;
10
+ actions: Array<{
11
+ key: string;
12
+ kind: string;
13
+ label: string;
14
+ on: string;
15
+ hand?: true;
16
+ common?: true;
17
+ }>;
18
+ /** Every common action's key, in the review table's order. */
19
+ common: string[];
20
+ /** Keys the review table renamed, old to new (the server treats the old one as a removed action). */
21
+ renamed: Record<string, string>;
22
+ };
23
+ /** Every action GitHub's sources name, the hand-written ones (`hand`) included. */
24
+ export declare const GITHUB_ACTION_LIST: GithubActionsFile["actions"];
25
+ /** The actions the rules picker shows first (why each is common: `manifests/github/review.json`). */
26
+ export declare const GITHUB_COMMON_KEYS: ReadonlySet<string>;
27
+ /** Generated keys renamed in the review table, old to new: events and rules on the old key follow the new one. */
28
+ export declare const GITHUB_RENAMED: Readonly<Record<string, string>>;
29
+ /** The generated actions the hand-written catalog doesn't list, as catalog actions. */
30
+ export declare const GITHUB_GENERATED_DEFS: readonly ActionDef[];
@@ -0,0 +1,22 @@
1
+ import LIST from "../sources/github/actions.generated.js";
2
+ const FILE = LIST;
3
+ /** Every action GitHub's sources name, the hand-written ones (`hand`) included. */
4
+ export const GITHUB_ACTION_LIST = FILE.actions;
5
+ /** The actions the rules picker shows first (why each is common: `manifests/github/review.json`). */
6
+ export const GITHUB_COMMON_KEYS = new Set(FILE.common);
7
+ /** Generated keys renamed in the review table, old to new: events and rules on the old key follow the new one. */
8
+ export const GITHUB_RENAMED = FILE.renamed ?? {};
9
+ /** The catch-all a write on a repository or organization was recorded as before it had a key of its own: a rule on
10
+ * it keeps covering the write until a rule names it (`resolveRule`). GitHub-wide writes had none. */
11
+ const PARENT = { repo: "github.repo.change", org: "github.org.change" };
12
+ /** The generated actions the hand-written catalog doesn't list, as catalog actions. */
13
+ export const GITHUB_GENERATED_DEFS = FILE.actions
14
+ .filter((action) => !action.hand)
15
+ .map((action) => ({
16
+ key: action.key,
17
+ kind: action.kind,
18
+ appliesTo: action.on,
19
+ label: action.label,
20
+ ...(PARENT[action.on] ? { parent: PARENT[action.on] } : {}),
21
+ ...(action.common ? { common: true } : {})
22
+ }));