passport-bridge 0.35.0 → 0.36.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 (108) hide show
  1. package/README.md +1 -1
  2. package/dist/cliAutopilotPolicy.d.ts +2 -0
  3. package/dist/cliExec.d.ts +1 -2
  4. package/dist/cliExec.js +17 -38
  5. package/dist/cliGitCredential.d.ts +2 -0
  6. package/dist/cliGitCredential.js +56 -14
  7. package/dist/cliHookDecide.js +36 -16
  8. package/dist/cliInit.js +4 -0
  9. package/dist/cliPolicyV2.js +6 -4
  10. package/dist/cliStatusGuard.js +4 -1
  11. package/dist/commandRepair.d.ts +13 -0
  12. package/dist/commandRepair.js +73 -0
  13. package/dist/connectorKit/cli.generated.d.ts +15 -0
  14. package/dist/connectorKit/cli.generated.js +244 -0
  15. package/dist/connectorKit/engine.generated.d.ts +50 -0
  16. package/dist/connectorKit/engine.generated.js +475 -0
  17. package/dist/connectorKit/manifest.generated.d.ts +317 -0
  18. package/dist/connectorKit/manifest.generated.js +18 -0
  19. package/dist/connectorKit/manifests/flagSpec.generated.d.ts +6 -0
  20. package/dist/connectorKit/manifests/flagSpec.generated.js +20 -0
  21. package/dist/connectorKit/manifests/github.generated.d.ts +17 -0
  22. package/dist/connectorKit/manifests/github.generated.js +82 -0
  23. package/dist/connectorKit/manifests/githubCapture.generated.d.ts +2 -0
  24. package/dist/connectorKit/manifests/githubCapture.generated.js +307 -0
  25. package/dist/connectorKit/manifests/githubHooks.generated.d.ts +23 -0
  26. package/dist/connectorKit/manifests/githubHooks.generated.js +401 -0
  27. package/dist/connectorKit/manifests/githubReads.generated.d.ts +6 -0
  28. package/dist/connectorKit/manifests/githubReads.generated.js +200 -0
  29. package/dist/connectorKit/manifests/railway.generated.d.ts +6 -0
  30. package/dist/connectorKit/manifests/railway.generated.js +121 -0
  31. package/dist/connectorKit/manifests/railwayCapture.generated.d.ts +3 -0
  32. package/dist/connectorKit/manifests/railwayCapture.generated.js +375 -0
  33. package/dist/connectorKit/manifests/railwayHooks.generated.d.ts +25 -0
  34. package/dist/connectorKit/manifests/railwayHooks.generated.js +487 -0
  35. package/dist/connectorKit/manifests/supabase.generated.d.ts +3 -0
  36. package/dist/connectorKit/manifests/supabase.generated.js +34 -0
  37. package/dist/connectorKit/manifests/supabaseApi.generated.d.ts +3 -0
  38. package/dist/connectorKit/manifests/supabaseApi.generated.js +632 -0
  39. package/dist/connectorKit/manifests/supabaseCapture.generated.d.ts +9 -0
  40. package/dist/connectorKit/manifests/supabaseCapture.generated.js +421 -0
  41. package/dist/connectorKit/manifests/supabaseCatalog.generated.d.ts +11 -0
  42. package/dist/connectorKit/manifests/supabaseCatalog.generated.js +70 -0
  43. package/dist/connectorKit/manifests/supabaseCli.generated.d.ts +10 -0
  44. package/dist/connectorKit/manifests/supabaseCli.generated.js +581 -0
  45. package/dist/connectorKit/manifests/supabasePlatform.generated.d.ts +7 -0
  46. package/dist/connectorKit/manifests/supabasePlatform.generated.js +283 -0
  47. package/dist/connectorKit/manifests/supabaseProbes.generated.d.ts +5 -0
  48. package/dist/connectorKit/manifests/supabaseProbes.generated.js +580 -0
  49. package/dist/connectorKit/params.generated.d.ts +25 -0
  50. package/dist/connectorKit/params.generated.js +193 -0
  51. package/dist/connectorKit/pgParser.d.ts +9 -0
  52. package/dist/connectorKit/pgParser.js +13 -0
  53. package/dist/connectorKit/shadow.generated.d.ts +58 -0
  54. package/dist/connectorKit/shadow.generated.js +184 -0
  55. package/dist/connectorKit/shell.generated.d.ts +73 -0
  56. package/dist/connectorKit/shell.generated.js +516 -0
  57. package/dist/connectorKit/sourcegen.generated.d.ts +50 -0
  58. package/dist/connectorKit/sourcegen.generated.js +208 -0
  59. package/dist/connectorKit/sources/supabase/api-operations.generated.d.ts +187 -0
  60. package/dist/connectorKit/sources/supabase/api-operations.generated.js +2 -0
  61. package/dist/connectorKit/sources/supabase/cli-flags.generated.d.ts +1236 -0
  62. package/dist/connectorKit/sources/supabase/cli-flags.generated.js +2 -0
  63. package/dist/connectorKit/sources/supabase/mcp-tools.generated.d.ts +35 -0
  64. package/dist/connectorKit/sources/supabase/mcp-tools.generated.js +2 -0
  65. package/dist/connectorKit/sql.generated.d.ts +29 -0
  66. package/dist/connectorKit/sql.generated.js +420 -0
  67. package/dist/connectorKit/sqlFingerprint.generated.d.ts +8 -0
  68. package/dist/connectorKit/sqlFingerprint.generated.js +105 -0
  69. package/dist/connectorKit/template.generated.d.ts +21 -0
  70. package/dist/connectorKit/template.generated.js +89 -0
  71. package/dist/connectorKit/types.generated.d.ts +81 -0
  72. package/dist/connectorKit/types.generated.js +6 -0
  73. package/dist/controlPlane.generated.d.ts +46 -2
  74. package/dist/controlPlane.generated.js +10 -1
  75. package/dist/controlPlaneExec.d.ts +21 -2
  76. package/dist/controlPlaneExec.js +83 -5
  77. package/dist/controlPlaneGithub.generated.js +4 -8
  78. package/dist/controlPlaneGuard.js +29 -4
  79. package/dist/controlPlaneIds.d.ts +39 -0
  80. package/dist/controlPlaneIds.js +175 -0
  81. package/dist/controlPlaneModel.generated.d.ts +67 -0
  82. package/dist/controlPlaneModel.generated.js +153 -0
  83. package/dist/controlPlaneRailwayGuard.js +13 -3
  84. package/dist/controlPlaneSupabase.d.ts +84 -0
  85. package/dist/controlPlaneSupabase.js +278 -0
  86. package/dist/execGithubRepo.d.ts +2 -0
  87. package/dist/execGithubRepo.js +30 -0
  88. package/dist/execShims.d.ts +4 -2
  89. package/dist/execShims.js +9 -3
  90. package/dist/gitCredentialSetup.d.ts +3 -0
  91. package/dist/gitCredentialSetup.js +19 -0
  92. package/dist/gitPush.d.ts +20 -0
  93. package/dist/gitPush.js +45 -7
  94. package/dist/initInstall.js +19 -13
  95. package/dist/kitShadow.d.ts +90 -0
  96. package/dist/kitShadow.js +261 -0
  97. package/dist/kitShadowBudget.d.ts +10 -0
  98. package/dist/kitShadowBudget.js +15 -0
  99. package/dist/launcherHealth.d.ts +11 -0
  100. package/dist/launcherHealth.js +49 -0
  101. package/dist/pluginPin.d.ts +1 -1
  102. package/dist/pluginPin.js +1 -1
  103. package/dist/supabaseDecisions.d.ts +9 -0
  104. package/dist/supabaseDecisions.js +98 -0
  105. package/dist/version.d.ts +1 -1
  106. package/dist/version.js +1 -1
  107. package/npm-shrinkwrap.json +2 -2
  108. package/package.json +1 -1
@@ -0,0 +1,317 @@
1
+ /**
2
+ * Connector manifests, schema 2 (integrations spike, round 2). A manifest is
3
+ * data: a platform's governed Actions, how each interface an agent uses names
4
+ * them (Level 1: CLI, MCP tools, API calls, SQL), and how the platform's
5
+ * read-only feed reports them (Level 2: snapshot probes and logs). One generic
6
+ * engine (`engine.ts`, `feed.ts`) runs every manifest; no platform names in it.
7
+ *
8
+ * Fails closed: anything the manifest doesn't name, and every condition no
9
+ * rule matches, is the manifest's Unclassified Action (kind delete, blocked by
10
+ * default). A read is a decision a reviewer makes, with evidence.
11
+ *
12
+ * Templates, one syntax everywhere: literal text with placeholders "{name}"
13
+ * or "{a|b}" (the first param that has a safe value). A NodeSpec key may list
14
+ * several templates, tried in order. `lint` checks every placeholder names a
15
+ * declared param.
16
+ */
17
+ import type { IdentityRule, Kind, PlatformKey, ResourceTypeDef, ServiceDef } from "../controlPlane.generated.js";
18
+ import type { OpInputs } from "./sourcegen.generated.js";
19
+ type PlatformSections = Readonly<Record<string, unknown>>;
20
+ import type { Template } from "./template.generated.js";
21
+ export type { OpInputs } from "./sourcegen.generated.js";
22
+ export declare const MANIFEST_SCHEMA = 2;
23
+ export type { Template };
24
+ /** A governed Action. `seenBy` is derived from the manifest's feeds, never hand-kept. */
25
+ export type ManifestAction = {
26
+ key: string;
27
+ kind: Kind;
28
+ appliesTo: string;
29
+ label: string;
30
+ icon: string;
31
+ exactTarget?: string;
32
+ };
33
+ /** How a node-depth type is named from params. `parent` is another type, or the type's service. */
34
+ export type NodeSpec = {
35
+ key: Template | readonly Template[];
36
+ name?: Template;
37
+ parent: {
38
+ type: string;
39
+ } | "service";
40
+ };
41
+ /** Param conditions: true = present and truthy, false = absent or falsy, a string or list = equals one of,
42
+ * { match } = a string value matching the regex, { present } = the field is sent at all (even as null).
43
+ * Under the name "*": { keys } = the body (API) or arguments (MCP) send a top-level field whose name matches
44
+ * the regex (Supabase's auth config: a provider field among 200 settings). */
45
+ export type When = Readonly<Record<string, boolean | string | readonly string[] | {
46
+ match: string;
47
+ } | {
48
+ present: boolean;
49
+ } | {
50
+ keys: string;
51
+ }>>;
52
+ export type TargetSpec = {
53
+ type: string;
54
+ key: Template;
55
+ name?: Template;
56
+ };
57
+ /** One way a request becomes an Action, a read, or a hook's answer. */
58
+ export type CaptureRule = {
59
+ /** CLI: the command words ("db reset"); MCP: the tool name; API: "METHOD /path/{param}". */
60
+ match: string;
61
+ when?: When;
62
+ /** An Action key; "sql:<param>" to classify the SQL in that param; "read" for a reviewed read. */
63
+ action: string;
64
+ /** Why it is a read, when `action` is "read". */
65
+ because?: string;
66
+ /** The node type it lands on (its NodeSpec names it). Not needed for a read. */
67
+ on?: string;
68
+ summary?: Template;
69
+ target?: TargetSpec;
70
+ /** A named hook in the platform's hooks module decides instead (staged changes, a read first). */
71
+ hook?: string;
72
+ /** API: the request body fields this rule reads, as dotted paths ("config.auth.site_url"). No other body
73
+ * field is ever read. */
74
+ body?: readonly string[];
75
+ /** CLI: names for positional arguments, in order ("slug"); a trailing "...name" takes the rest. */
76
+ args?: readonly string[];
77
+ /** CLI: acts on the local stack unless a remote flag is given (`db reset`); a read when local. */
78
+ localByDefault?: true;
79
+ /** One classification per value of this param when it holds a list (a rest argument, a repeatable flag,
80
+ * a list field): each value is classified as if the request named only it. Required wherever a param a
81
+ * rule's node, target or summary names can hold several values (`lint`); without it a list fails closed. */
82
+ each?: string;
83
+ /** Where this rule reads a canonical param from, when it isn't the usual alias: { domain: "name" }. */
84
+ from?: Readonly<Record<string, string>>;
85
+ /** Values a param takes when the request doesn't give one (a deploy with no target is a preview). */
86
+ defaults?: Readonly<Record<string, string>>;
87
+ /** Extra Actions the same request also takes, when their conditions hold. */
88
+ also?: ReadonlyArray<Omit<CaptureRule, "match" | "also" | "hook">>;
89
+ };
90
+ /** A param's value split by pattern ("--remote=<ref|branch|url>"): first match wins. `as` names the
91
+ * value, or each capture group in order; `drop` forgets it (a database URL holds a password). */
92
+ export type ParamSplit = {
93
+ from: string;
94
+ /** Which interfaces it applies to; default the CLI only (a split never reads another interface's params). */
95
+ in?: ReadonlyArray<"cli" | "mcp" | "api">;
96
+ cases: ReadonlyArray<{
97
+ match?: string;
98
+ as: string | readonly string[];
99
+ drop?: true;
100
+ }>;
101
+ };
102
+ /** Evidence that something is a read: "hint" (the vendor's readOnlyHint), "get" (an HTTP GET), or a
103
+ * reviewer's reason in words. */
104
+ export type ReadEvidence = string;
105
+ export type FlagSpec = {
106
+ long: string;
107
+ short?: string;
108
+ value: "none" | "required" | "optional";
109
+ /** Given more than once, every value counts (`-F a=1 -F b=2`). */
110
+ repeat?: boolean;
111
+ };
112
+ export type CliSpec = {
113
+ programs: readonly string[];
114
+ /** How the CLI parses flags. cobra: booleans take =1/t/T/true/TRUE/True or =0/f/F/false/FALSE/False.
115
+ * arg (Vercel's parser): a boolean takes no value at all; `--flag=x` on a boolean is an error. */
116
+ framework: "cobra" | "arg";
117
+ /** Other spellings of commands ("env rm" → "env remove", "ls" → "list"), from the vendor's spec. */
118
+ aliases?: Readonly<Record<string, string>>;
119
+ /** What the program does with no command, or with a first word that isn't one (`vercel` deploys). */
120
+ defaultCommand?: string;
121
+ /** Environment variables the CLI reads its target from, documented by the vendor: name → canonical param,
122
+ * or "@folder" for one that points at another folder (like --workdir). They win over the folder's link;
123
+ * a flag that names the target still wins over them. Read by the guard's resolver (`shell.ts`). */
124
+ env?: Readonly<Record<string, string>>;
125
+ /** Any other variable with one of these prefixes, set on the command line, may change the target: the
126
+ * command fails closed. Ambient variables are read only when `env` names them. */
127
+ envPrefixes?: readonly string[];
128
+ /** Variables with those prefixes that never change the target (a token). Their values are never read. */
129
+ envIgnore?: readonly string[];
130
+ /** Where a folder's link lives, relative to the folder; the guard looks in the folder and its parents.
131
+ * "text": the file is the value of `param`; "json": `fields` maps the file's keys to params. */
132
+ link?: {
133
+ file: string;
134
+ format: "text";
135
+ param: string;
136
+ } | {
137
+ file: string;
138
+ format: "json";
139
+ fields: Readonly<Record<string, string>>;
140
+ };
141
+ /** Commands that change the link (`link`, `unlink`): later commands in the same line have no link. */
142
+ linkCommands?: readonly string[];
143
+ /** Flags that only print (help, version): the command doesn't run. */
144
+ infoFlags?: readonly string[];
145
+ /** Flags that point the CLI at another folder or config (--workdir, --cwd): the folder's link no longer
146
+ * applies, so the request names its target or fails closed (unless the guard resolves that folder's link). */
147
+ contextFlags?: readonly string[];
148
+ /** Positional arguments that name another folder, by command and index (vercel <dir>). */
149
+ folderArgs?: Readonly<Record<string, number>>;
150
+ /** The vendor's usage line per command: more positional arguments than it allows fails closed. */
151
+ usage?: Readonly<Record<string, string>>;
152
+ /** Commands where the deprecated --local still means the local stack (the vendor's "selectable" ones). */
153
+ localCommands?: readonly string[];
154
+ /** Other program names for the same CLI (vc for vercel). */
155
+ aliasPrograms?: readonly string[];
156
+ /** Every flag the CLI accepts, from the vendor's spec: global, and per command. An unknown flag fails closed. */
157
+ flags: {
158
+ global: readonly FlagSpec[];
159
+ commands: Readonly<Record<string, readonly FlagSpec[]>>;
160
+ };
161
+ /** Flags the spec no longer lists that still work (deprecated), declared by a reviewer. */
162
+ legacyFlags?: readonly FlagSpec[];
163
+ /** Any of these present (and true) means the command acts on a remote project. */
164
+ remoteFlags: readonly string[];
165
+ /** Any of these present (and true) means it acts locally or changes nothing (a read). */
166
+ localFlags: readonly string[];
167
+ rules: readonly CaptureRule[];
168
+ reads: Readonly<Record<string, ReadEvidence>>;
169
+ };
170
+ export type CaptureSpec = {
171
+ /** Canonical param <- aliases, per interface. "@linked.<k>" reads the folder's link; a dotted alias
172
+ * ("requestBody.name") reads into a tool's nested arguments or a request body. */
173
+ params: Readonly<Record<string, Partial<Record<"cli" | "mcp" | "api", readonly string[]>>>>;
174
+ split?: readonly ParamSplit[];
175
+ cli: CliSpec;
176
+ mcp: {
177
+ prefixes: readonly string[];
178
+ rules: readonly CaptureRule[];
179
+ reads: Readonly<Record<string, ReadEvidence>>;
180
+ };
181
+ /**
182
+ * API calls: "METHOD /route/{param}" templates, path params, query-string params and the body fields a
183
+ * rule selects. Every API capture point produces the same request, so one set of rules serves them all:
184
+ * Passport's gateway or proxy, a `curl` line the guard parses, and later a customer's API proxy.
185
+ */
186
+ api: {
187
+ base: string;
188
+ rules: readonly CaptureRule[];
189
+ reads: Readonly<Record<string, ReadEvidence>>;
190
+ /** Query keys that name what a call acts on (Vercel's teamId); no other query key can set a node param. */
191
+ query?: readonly string[];
192
+ };
193
+ /** What each MCP tool and API route declares it takes, generated from the vendor's own schemas
194
+ * (`sourcegen.ts`), never written by hand. When an operation has one, a param is read only from a field
195
+ * it declares, in the place it declares it. */
196
+ inputs?: {
197
+ mcp?: Readonly<Record<string, OpInputs>>;
198
+ api?: Readonly<Record<string, OpInputs>>;
199
+ };
200
+ /** SQL categories (sql.ts) → Action keys; a category not listed is a read. */
201
+ sql: Readonly<Partial<Record<SqlCategory, string>>>;
202
+ /** What anything unnamed becomes: an Action of kind delete, so the default rules block it. */
203
+ unclassified: string;
204
+ };
205
+ export type SqlCategory = "drop_database" | "drop_schema" | "drop_table" | "truncate" | "delete_all" | "rls_off" | "grant" | "ddl" | "write" | "export" | "opaque"
206
+ /** Drops what holds data or what data depends on: a column, a view, a type, an extension, a function. */
207
+ | "drop_object"
208
+ /** Defines code that runs later: a function, view, trigger, rule or operator. */
209
+ | "code"
210
+ /** Weakens a protection: a permissive policy, disabled triggers, a function shadowing a built-in. */
211
+ | "policy"
212
+ /** Writes a bucket's `public` flag in the platform's storage schema. */
213
+ | "bucket_public"
214
+ /** Writes the platform's sign-in provider tables (SSO, SAML). */
215
+ | "auth_provider"
216
+ /** Any other write to a platform's own schema (auth, storage, vault...) or to a table of unknown schema. */
217
+ | "protected";
218
+ /** A change a snapshot probe reports, between two reads of the same item. */
219
+ export type ProbeChange = {
220
+ on: "added" | "removed" | "changed";
221
+ /** A kept field, or a dotted path into one ("currentConfig.database"). */
222
+ field?: string;
223
+ from?: unknown;
224
+ to?: unknown;
225
+ action: string;
226
+ summary: Template;
227
+ /** Actions on other platforms that can cause this one: the core's cause chain may mark it Followed. */
228
+ followsFrom?: readonly string[];
229
+ };
230
+ /** Level 2, no actor: read a list (or one object) every interval and compare. */
231
+ export type Probe = {
232
+ id: string;
233
+ label: string;
234
+ /** "GET /v1/projects/{ref}/functions". */
235
+ read: string;
236
+ /** The read-only grant it needs (OAuth scope). */
237
+ scope: string;
238
+ /** The array in the response, as a dotted path; absent: the response is the array; "." : one object. */
239
+ items?: string;
240
+ /** Paging: where the next cursor is in a response, and the query param that sends it back. */
241
+ page?: {
242
+ next: string;
243
+ param: string;
244
+ };
245
+ /** The item field that identifies it; ignored for one object (`items: "."`). */
246
+ key: string;
247
+ /** Canonical params from item fields (dotted paths), for node templates ({ branch: "id" }). */
248
+ fields?: Readonly<Record<string, string>>;
249
+ /** Values a param takes when an item doesn't give one (a deployment with no target is a preview). */
250
+ defaults?: Readonly<Record<string, string>>;
251
+ /** Other keys the same item is named by elsewhere ("name:{name}"): the inventory maps them to its node. */
252
+ aliases?: readonly Template[];
253
+ /** The platform's own ids for what changed (deployment id, commit SHA), for exact matching. */
254
+ ids?: Readonly<Record<string, string>>;
255
+ /** Fields kept (dotted paths allowed); everything else (values, keys, emails) is dropped before storage. */
256
+ keep: readonly string[];
257
+ /** Node of each item (templates over kept fields, `fields` and the scope). */
258
+ on: string;
259
+ target?: TargetSpec;
260
+ changes: readonly ProbeChange[];
261
+ plans: readonly string[];
262
+ };
263
+ /**
264
+ * Level 2 with an actor: a log or push feed mapped through a vocabulary.
265
+ * "json": each entry is an object; `event` and `params` are dotted paths into it.
266
+ * "pgaudit": each entry is a Postgres log line (pgAudit, or `log_statement` "statement:"); the
267
+ * manifest's `sql` map names the Action; the SQL is parsed in memory and never kept.
268
+ */
269
+ export type LogFeed = {
270
+ id: string;
271
+ label: string;
272
+ source: "log" | "webhook";
273
+ format: "json" | "pgaudit";
274
+ /** Whether entries name who did it (a platform user id); a database role doesn't count. */
275
+ actor: boolean;
276
+ plans: readonly string[];
277
+ /** Why it can't be used, when it can't (no read endpoint). */
278
+ unavailable?: string;
279
+ /** Set-up the customer does once (a guided Fix), when it needs one. */
280
+ setup?: string;
281
+ /** "pgaudit": the SQL categories its lines report. */
282
+ sees?: readonly SqlCategory[];
283
+ event?: string;
284
+ actorPath?: string;
285
+ /** Canonical param ← dotted path in the entry. */
286
+ params?: Readonly<Record<string, string>>;
287
+ /** Values a param takes when an entry doesn't give one. */
288
+ defaults?: Readonly<Record<string, string>>;
289
+ /** The platform's own ids carried by an entry (deployment id, commit SHA), for exact matching. */
290
+ ids?: Readonly<Record<string, string>>;
291
+ /** The platform's word → Action and node. For "pgaudit": the node and summary suffix under "*". */
292
+ vocabulary: Readonly<Record<string, {
293
+ action: string;
294
+ on: string;
295
+ summary: Template;
296
+ }>>;
297
+ };
298
+ export type Manifest = {
299
+ schema: typeof MANIFEST_SCHEMA;
300
+ platform: PlatformKey;
301
+ label: string;
302
+ /** Bump when Actions or node ids change; a node-id change also lists the old ids it replaces. */
303
+ version: number;
304
+ nodeIdChanges?: Readonly<Record<string, string>>;
305
+ plans: readonly string[];
306
+ identity: IdentityRule["rule"];
307
+ services: readonly ServiceDef[];
308
+ types: readonly ResourceTypeDef[];
309
+ /** Node-depth types: how their key and parent come from params. */
310
+ nodes: Readonly<Record<string, NodeSpec>>;
311
+ actions: readonly ManifestAction[];
312
+ capture: CaptureSpec;
313
+ probes: readonly Probe[];
314
+ logs: readonly LogFeed[];
315
+ /** Hook names the manifest's rules use; the platform's hooks module must provide each. */
316
+ hooks?: readonly string[];
317
+ } & Partial<PlatformSections>;
@@ -0,0 +1,18 @@
1
+ // Generated by scripts/generate-control-plane-classifier.mjs. Do not edit.
2
+ /**
3
+ * Connector manifests, schema 2 (integrations spike, round 2). A manifest is
4
+ * data: a platform's governed Actions, how each interface an agent uses names
5
+ * them (Level 1: CLI, MCP tools, API calls, SQL), and how the platform's
6
+ * read-only feed reports them (Level 2: snapshot probes and logs). One generic
7
+ * engine (`engine.ts`, `feed.ts`) runs every manifest; no platform names in it.
8
+ *
9
+ * Fails closed: anything the manifest doesn't name, and every condition no
10
+ * rule matches, is the manifest's Unclassified Action (kind delete, blocked by
11
+ * default). A read is a decision a reviewer makes, with evidence.
12
+ *
13
+ * Templates, one syntax everywhere: literal text with placeholders "{name}"
14
+ * or "{a|b}" (the first param that has a safe value). A NodeSpec key may list
15
+ * several templates, tried in order. `lint` checks every placeholder names a
16
+ * declared param.
17
+ */
18
+ export const MANIFEST_SCHEMA = 2;
@@ -0,0 +1,6 @@
1
+ import type { FlagSpec } from "../manifest.generated.js";
2
+ /**
3
+ * A CLI's options written the way its manual lists them, one word each: "-R/repo=" (short R, long repo,
4
+ * takes a value), "-w/web" (a switch), "latest?" (an optional value), "add-topic=+" (a value, repeatable).
5
+ */
6
+ export declare function flagSpecs(spec: string): FlagSpec[];
@@ -0,0 +1,20 @@
1
+ /**
2
+ * A CLI's options written the way its manual lists them, one word each: "-R/repo=" (short R, long repo,
3
+ * takes a value), "-w/web" (a switch), "latest?" (an optional value), "add-topic=+" (a value, repeatable).
4
+ */
5
+ export function flagSpecs(spec) {
6
+ return spec
7
+ .split(" ")
8
+ .filter(Boolean)
9
+ .map((word) => {
10
+ const [short, long] = word.includes("/") ? word.split("/") : [undefined, word];
11
+ const name = long.replace(/[=?+]+$/, "");
12
+ const value = long.includes("=") ? "required" : long.endsWith("?") ? "optional" : "none";
13
+ return {
14
+ long: name,
15
+ value,
16
+ ...(short ? { short: short.slice(1) } : {}),
17
+ ...(long.endsWith("+") ? { repeat: true } : {})
18
+ };
19
+ });
20
+ }
@@ -0,0 +1,17 @@
1
+ import { type Manifest, type ManifestAction, type NodeSpec } from "../manifest.generated.js";
2
+ import type { ResourceTypeDef } from "../../controlPlane.generated.js";
3
+ /**
4
+ * GitHub at Level 1, for the shadow run (integrations spike, 2026-11-14). Derived from today's classifier
5
+ * (`shared/controlPlaneGithub*.ts`) and its tests: the same action keys, node ids and exact targets, so the
6
+ * kit and today's classifier can be compared request by request before the kit decides anything. The keys
7
+ * and kinds are the server catalog's (`server/src/controlPlane/catalog/github.ts`); only the ones a request
8
+ * can name are listed (the webhook's are Level 2).
9
+ *
10
+ * A target's key is today's canonical exact target (`githubTarget`: JSON of the named fields), so a decision
11
+ * the kit makes ties an "Allow once" to the same digest. Branch nodes, lower-cased names and git refspecs
12
+ * are the hooks' (`githubHooks.ts`).
13
+ */
14
+ export declare const GITHUB_TYPES: readonly ResourceTypeDef[];
15
+ export declare const GITHUB_NODES: Readonly<Record<string, NodeSpec>>;
16
+ export declare const GITHUB_ACTIONS: readonly ManifestAction[];
17
+ export declare const GITHUB: Manifest;
@@ -0,0 +1,82 @@
1
+ // Generated by scripts/generate-control-plane-classifier.mjs. Do not edit.
2
+ import { MANIFEST_SCHEMA } from "../manifest.generated.js";
3
+ import { GITHUB_CAPTURE } from "./githubCapture.generated.js";
4
+ /**
5
+ * GitHub at Level 1, for the shadow run (integrations spike, 2026-11-14). Derived from today's classifier
6
+ * (`shared/controlPlaneGithub*.ts`) and its tests: the same action keys, node ids and exact targets, so the
7
+ * kit and today's classifier can be compared request by request before the kit decides anything. The keys
8
+ * and kinds are the server catalog's (`server/src/controlPlane/catalog/github.ts`); only the ones a request
9
+ * can name are listed (the webhook's are Level 2).
10
+ *
11
+ * A target's key is today's canonical exact target (`githubTarget`: JSON of the named fields), so a decision
12
+ * the kit makes ties an "Allow once" to the same digest. Branch nodes, lower-cased names and git refspecs
13
+ * are the hooks' (`githubHooks.ts`).
14
+ */
15
+ export const GITHUB_TYPES = [
16
+ { type: "repo", label: "Repository", service: "repos" },
17
+ { type: "branch", label: "Branch", service: "repos", depth: "target", targetOf: "repo", targetName: "name" },
18
+ { type: "org", label: "Organization", service: "org" },
19
+ { type: "secrets", label: "Secrets", service: "actions" }
20
+ ];
21
+ export const GITHUB_NODES = {
22
+ repo: { key: "{owner}/{repo}", parent: "service" },
23
+ branch: { key: "{owner}/{repo}@{branch}", name: "{branch}", parent: { type: "repo" } },
24
+ org: { key: "{org}", parent: "service" },
25
+ // A repository's secrets, else an organization's.
26
+ secrets: { key: ["{owner}/{repo}", "{org}"], parent: "service" }
27
+ };
28
+ export const GITHUB_ACTIONS = [
29
+ { key: "github.repo.merge", kind: "change", appliesTo: "repo", label: "Merge a pull request", icon: "GitMerge" },
30
+ { key: "github.repo.release", kind: "change", appliesTo: "repo", label: "Create a release", icon: "Tag" },
31
+ { key: "github.repo.tag", kind: "change", appliesTo: "repo", label: "Push a tag", icon: "Tag" },
32
+ {
33
+ key: "github.repo.collaborator",
34
+ kind: "grant",
35
+ appliesTo: "repo",
36
+ label: "Add or change a collaborator",
37
+ icon: "UserPlus"
38
+ },
39
+ { key: "github.repo.public", kind: "expose", appliesTo: "repo", label: "Make the repository public", icon: "Eye" },
40
+ { key: "github.repo.delete", kind: "delete", appliesTo: "repo", label: "Delete the repository", icon: "Trash2" },
41
+ { key: "github.branch.push", kind: "change", appliesTo: "branch", label: "Push commits", icon: "GitCommit" },
42
+ {
43
+ key: "github.branch.force",
44
+ kind: "delete",
45
+ appliesTo: "branch",
46
+ label: "Force-push (rewrites history)",
47
+ icon: "Trash2"
48
+ },
49
+ { key: "github.branch.delete", kind: "delete", appliesTo: "branch", label: "Delete the branch", icon: "Trash2" },
50
+ {
51
+ key: "github.branch.protection",
52
+ kind: "disarm",
53
+ appliesTo: "branch",
54
+ label: "Change or remove branch protection",
55
+ icon: "Shield"
56
+ },
57
+ { key: "github.org.invite", kind: "grant", appliesTo: "org", label: "Invite a member", icon: "UserPlus" },
58
+ { key: "github.secret.change", kind: "grant", appliesTo: "secrets", label: "Create or change a secret", icon: "Key" },
59
+ // The kit's own: anything the manifest can't name fails closed. Not in the server catalog until the switch.
60
+ { key: "github.unclassified", kind: "delete", appliesTo: "repo", label: "Unclassified action", icon: "CircleHelp" }
61
+ ];
62
+ export const GITHUB = {
63
+ schema: MANIFEST_SCHEMA,
64
+ platform: "github",
65
+ label: "GitHub",
66
+ // 1: the shadow run's first manifest (2026-11-14), node ids as today's classifier names them.
67
+ version: 1,
68
+ plans: ["free", "team", "enterprise"],
69
+ identity: "member",
70
+ services: [
71
+ { key: "repos", label: "Repositories" },
72
+ { key: "org", label: "Organization" },
73
+ { key: "actions", label: "Actions" }
74
+ ],
75
+ types: GITHUB_TYPES,
76
+ nodes: GITHUB_NODES,
77
+ actions: GITHUB_ACTIONS,
78
+ capture: GITHUB_CAPTURE,
79
+ probes: [],
80
+ logs: [],
81
+ hooks: ["branch", "ghRepo", "ghApi", "gitPush", "graphql"]
82
+ };
@@ -0,0 +1,2 @@
1
+ import type { CaptureSpec } from "../manifest.generated.js";
2
+ export declare const GITHUB_CAPTURE: CaptureSpec;