passport-bridge 0.48.2 → 0.49.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.
- package/dist/cliHookAfter.js +10 -1
- package/dist/cliHookDecide.d.ts +9 -3
- package/dist/cliHookDecide.js +182 -28
- package/dist/cliHookSessionState.d.ts +4 -1
- package/dist/cliHookSessionState.js +1 -1
- package/dist/connectorKit/callEffects.generated.d.ts +36 -0
- package/dist/connectorKit/callEffects.generated.js +73 -0
- package/dist/connectorKit/cli.generated.js +5 -2
- package/dist/connectorKit/engine.generated.d.ts +1 -1
- package/dist/connectorKit/engine.generated.js +32 -13
- package/dist/connectorKit/githubIds.generated.d.ts +1 -1
- package/dist/connectorKit/githubIds.generated.js +3 -2
- package/dist/connectorKit/manifest.generated.d.ts +34 -14
- package/dist/connectorKit/manifests/cloudflare.generated.d.ts +2 -0
- package/dist/connectorKit/manifests/cloudflare.generated.js +186 -0
- package/dist/connectorKit/manifests/cloudflareApi.generated.d.ts +4 -0
- package/dist/connectorKit/manifests/cloudflareApi.generated.js +207 -0
- package/dist/connectorKit/manifests/cloudflareCatalog.generated.d.ts +18 -0
- package/dist/connectorKit/manifests/cloudflareCatalog.generated.js +83 -0
- package/dist/connectorKit/manifests/cloudflareCli.generated.d.ts +2 -0
- package/dist/connectorKit/manifests/cloudflareCli.generated.js +441 -0
- package/dist/connectorKit/manifests/githubCapture.generated.js +19 -1
- package/dist/connectorKit/manifests/githubReads.generated.js +0 -3
- package/dist/connectorKit/manifests/kubernetes.generated.d.ts +76 -0
- package/dist/connectorKit/manifests/kubernetes.generated.js +210 -0
- package/dist/connectorKit/manifests/kubernetesArgs.generated.d.ts +21 -0
- package/dist/connectorKit/manifests/kubernetesArgs.generated.js +82 -0
- package/dist/connectorKit/manifests/kubernetesCli.generated.d.ts +30 -0
- package/dist/connectorKit/manifests/kubernetesCli.generated.js +530 -0
- package/dist/connectorKit/manifests/kubernetesEffects.generated.d.ts +15 -0
- package/dist/connectorKit/manifests/kubernetesEffects.generated.js +111 -0
- package/dist/connectorKit/manifests/kubernetesObjects.generated.d.ts +24 -0
- package/dist/connectorKit/manifests/kubernetesObjects.generated.js +154 -0
- package/dist/connectorKit/manifests/railwayHooks.generated.js +11 -5
- package/dist/connectorKit/manifests/sentry.generated.d.ts +6 -0
- package/dist/connectorKit/manifests/sentry.generated.js +27 -0
- package/dist/connectorKit/manifests/sentryApi.generated.d.ts +6 -0
- package/dist/connectorKit/manifests/sentryApi.generated.js +282 -0
- package/dist/connectorKit/manifests/sentryCapture.generated.d.ts +2 -0
- package/dist/connectorKit/manifests/sentryCapture.generated.js +165 -0
- package/dist/connectorKit/manifests/sentryCatalog.generated.d.ts +5 -0
- package/dist/connectorKit/manifests/sentryCatalog.generated.js +70 -0
- package/dist/connectorKit/manifests/sentryCli.generated.d.ts +2 -0
- package/dist/connectorKit/manifests/sentryCli.generated.js +230 -0
- package/dist/connectorKit/manifests/sentryIssues.generated.d.ts +20 -0
- package/dist/connectorKit/manifests/sentryIssues.generated.js +204 -0
- package/dist/connectorKit/manifests/supabase.generated.js +3 -2
- package/dist/connectorKit/manifests/supabaseApi.generated.js +52 -52
- package/dist/connectorKit/manifests/supabaseCapture.generated.js +22 -21
- package/dist/connectorKit/manifests/supabaseCatalog.generated.d.ts +2 -2
- package/dist/connectorKit/manifests/supabaseCatalog.generated.js +8 -7
- package/dist/connectorKit/manifests/supabaseCli.generated.js +32 -32
- package/dist/connectorKit/manifests/supabaseProbes.generated.js +29 -29
- package/dist/connectorKit/manifests/terraform.generated.d.ts +5 -0
- package/dist/connectorKit/manifests/terraform.generated.js +214 -0
- package/dist/connectorKit/manifests/terraformLink.generated.d.ts +30 -0
- package/dist/connectorKit/manifests/terraformLink.generated.js +73 -0
- package/dist/connectorKit/manifests/terraformPlan.generated.d.ts +48 -0
- package/dist/connectorKit/manifests/terraformPlan.generated.js +192 -0
- package/dist/connectorKit/params.generated.js +2 -0
- package/dist/connectorKit/shell.generated.d.ts +5 -1
- package/dist/connectorKit/shell.generated.js +121 -20
- package/dist/connectorKit/sources/cloudflare/api-operations.generated.d.ts +37 -0
- package/dist/connectorKit/sources/cloudflare/api-operations.generated.js +2 -0
- package/dist/connectorKit/sources/cloudflare/cli-flags.generated.d.ts +617 -0
- package/dist/connectorKit/sources/cloudflare/cli-flags.generated.js +2 -0
- package/dist/connectorKit/sources/cloudflare/mcp-tools.generated.d.ts +16 -0
- package/dist/connectorKit/sources/cloudflare/mcp-tools.generated.js +2 -0
- package/dist/connectorKit/sources/sentry/api-operations.generated.d.ts +121 -0
- package/dist/connectorKit/sources/sentry/api-operations.generated.js +2 -0
- package/dist/connectorKit/sources/sentry/cli-commands.generated.d.ts +530 -0
- package/dist/connectorKit/sources/sentry/cli-commands.generated.js +2 -0
- package/dist/connectorKit/sources/sentry/mcp-tools.generated.d.ts +32 -0
- package/dist/connectorKit/sources/sentry/mcp-tools.generated.js +2 -0
- package/dist/connectorKit/template.generated.d.ts +8 -4
- package/dist/connectorKit/template.generated.js +19 -6
- package/dist/controlPlane.generated.d.ts +11 -2
- package/dist/controlPlaneActions.generated.d.ts +52 -12
- package/dist/controlPlaneActions.generated.js +40 -11
- package/dist/controlPlaneCloudflare.d.ts +70 -0
- package/dist/controlPlaneCloudflare.js +188 -0
- package/dist/controlPlaneKubernetes.d.ts +72 -0
- package/dist/controlPlaneKubernetes.js +260 -0
- package/dist/controlPlaneModel.generated.d.ts +6 -0
- package/dist/controlPlaneNpm.generated.d.ts +83 -0
- package/dist/controlPlaneNpm.generated.js +307 -0
- package/dist/controlPlaneNpmCommands.generated.d.ts +35 -0
- package/dist/controlPlaneNpmCommands.generated.js +567 -0
- package/dist/controlPlaneNpmGuard.d.ts +44 -0
- package/dist/controlPlaneNpmGuard.js +210 -0
- package/dist/controlPlaneOffline.d.ts +1 -1
- package/dist/controlPlaneRailway.generated.js +2 -2
- package/dist/controlPlaneRailwayCli.generated.js +13 -2
- package/dist/controlPlaneRailwayModel.generated.d.ts +5 -0
- package/dist/controlPlaneRailwayModel.generated.js +15 -1
- package/dist/controlPlaneSentry.d.ts +68 -0
- package/dist/controlPlaneSentry.js +205 -0
- package/dist/controlPlaneTerraform.d.ts +86 -0
- package/dist/controlPlaneTerraform.js +273 -0
- package/dist/controlPlaneUnnamed.generated.d.ts +41 -2
- package/dist/controlPlaneUnnamed.generated.js +148 -2
- package/dist/cpCli.d.ts +1 -1
- package/dist/cpCli.js +1 -1
- package/dist/pluginPin.d.ts +1 -1
- package/dist/pluginPin.js +1 -1
- package/dist/terraformPlans.d.ts +45 -0
- package/dist/terraformPlans.js +96 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/cpCli.js
CHANGED
|
@@ -30,7 +30,7 @@ const MAX_BLOCKED = 4096;
|
|
|
30
30
|
const ACTION_KEY = /^[a-z][a-z0-9_.:-]{0,119}$/;
|
|
31
31
|
const MAX_VENDORS = 64;
|
|
32
32
|
const VENDOR = /^[a-z0-9][a-z0-9_-]{0,31}$/;
|
|
33
|
-
const PLATFORMS = ["github", "railway", "supabase"];
|
|
33
|
+
const PLATFORMS = ["github", "railway", "supabase", "kubernetes", "terraform", "sentry", "cloudflare", "npm"];
|
|
34
34
|
/** The exact bytes `blocks` are signed over: a checked copy of shared/cpCli.ts `blocksSigningInput`. */
|
|
35
35
|
export function blocksSigningInput(ws, at, blocks) {
|
|
36
36
|
const platforms = Object.keys(blocks).sort();
|
package/dist/pluginPin.d.ts
CHANGED
package/dist/pluginPin.js
CHANGED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Terraform plans on this computer (2026-11-21): reading a saved plan with `terraform show -json` (or `tofu show
|
|
3
|
+
* -json`) and reducing it to counts and resource-type names (`terraformPlan.ts`), and remembering, per agent session,
|
|
4
|
+
* the last `plan -out` made in a folder and what it reduced to, so an apply that follows reads it at once. The plan's
|
|
5
|
+
* contents never leave this module: only the reduction does. Never throws.
|
|
6
|
+
*/
|
|
7
|
+
import { type TerraformPlan } from "./connectorKit/manifests/terraformPlan.generated.js";
|
|
8
|
+
/** `show -json` gets at most this long (it starts the providers to read their schemas). */
|
|
9
|
+
export declare const PLAN_READ_MS = 900;
|
|
10
|
+
/** The last plan counts for an apply without one for this long. */
|
|
11
|
+
export declare const LAST_PLAN_MS: number;
|
|
12
|
+
/** One plan this session made or read: where, which workspace, the file's identity, and its reduction when read. */
|
|
13
|
+
export type PlanMemo = {
|
|
14
|
+
folder: string;
|
|
15
|
+
workspace: string;
|
|
16
|
+
path: string;
|
|
17
|
+
at: number;
|
|
18
|
+
/** The file's size and modification time when it was reduced. */
|
|
19
|
+
size?: number;
|
|
20
|
+
mtimeMs?: number;
|
|
21
|
+
plan?: TerraformPlan;
|
|
22
|
+
};
|
|
23
|
+
export type PlanReader = (program: string, folder: string, path: string, timeoutMs: number) => Promise<unknown>;
|
|
24
|
+
/** `terraform show -json <plan>` in the plan's folder, its JSON parsed; undefined on any failure or timeout. */
|
|
25
|
+
export declare const showJson: PlanReader;
|
|
26
|
+
export declare const absolutePlan: (folder: string, path: string) => string;
|
|
27
|
+
/** What of a session's state this module reads and writes (`cliHookSessionState.ts` keeps the rest). */
|
|
28
|
+
export type PlanState = {
|
|
29
|
+
terraformPlans?: PlanMemo[];
|
|
30
|
+
};
|
|
31
|
+
/** A saved plan's reduction: remembered, else read now within `timeoutMs`; null when it can't be read. */
|
|
32
|
+
export declare function readPlan(state: PlanState, where: {
|
|
33
|
+
program: string;
|
|
34
|
+
folder: string;
|
|
35
|
+
workspace: string;
|
|
36
|
+
path: string;
|
|
37
|
+
timeoutMs: number;
|
|
38
|
+
}, reader?: PlanReader): Promise<{
|
|
39
|
+
plan: TerraformPlan;
|
|
40
|
+
memo: PlanMemo;
|
|
41
|
+
} | null>;
|
|
42
|
+
/** The last `plan -out` this session made in this folder and workspace, still fresh. */
|
|
43
|
+
export declare function lastPlan(state: PlanState, folder: string, workspace: string, now: number): PlanMemo | undefined;
|
|
44
|
+
/** The state with this memo kept (replacing one for the same file), the newest few only. */
|
|
45
|
+
export declare function remember<S extends PlanState>(state: S, memo: PlanMemo): S;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Terraform plans on this computer (2026-11-21): reading a saved plan with `terraform show -json` (or `tofu show
|
|
3
|
+
* -json`) and reducing it to counts and resource-type names (`terraformPlan.ts`), and remembering, per agent session,
|
|
4
|
+
* the last `plan -out` made in a folder and what it reduced to, so an apply that follows reads it at once. The plan's
|
|
5
|
+
* contents never leave this module: only the reduction does. Never throws.
|
|
6
|
+
*/
|
|
7
|
+
import { execFile } from "node:child_process";
|
|
8
|
+
import { statSync } from "node:fs";
|
|
9
|
+
import { isAbsolute, join } from "node:path";
|
|
10
|
+
import { terraformPlanOf } from "./connectorKit/manifests/terraformPlan.generated.js";
|
|
11
|
+
/** `show -json` gets at most this long (it starts the providers to read their schemas). */
|
|
12
|
+
export const PLAN_READ_MS = 900;
|
|
13
|
+
/** A plan's JSON bigger than this isn't read: the apply stays "may be destructive". */
|
|
14
|
+
const MAX_PLAN_JSON = 32 * 1024 * 1024;
|
|
15
|
+
/** The last plan counts for an apply without one for this long. */
|
|
16
|
+
export const LAST_PLAN_MS = 2 * 60 * 60 * 1000;
|
|
17
|
+
/** Few, so the session's state file stays small (16 KB). */
|
|
18
|
+
const MAX_MEMOS = 4;
|
|
19
|
+
/** `terraform show -json <plan>` in the plan's folder, its JSON parsed; undefined on any failure or timeout. */
|
|
20
|
+
export const showJson = (program, folder, path, timeoutMs) => new Promise((resolve) => {
|
|
21
|
+
if (timeoutMs <= 0) {
|
|
22
|
+
resolve(undefined);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
try {
|
|
26
|
+
execFile(program, ["show", "-json", "-no-color", path], {
|
|
27
|
+
cwd: folder,
|
|
28
|
+
timeout: timeoutMs,
|
|
29
|
+
maxBuffer: MAX_PLAN_JSON,
|
|
30
|
+
windowsHide: true,
|
|
31
|
+
// No prompts, no color, no checkpoint call: a read of a local file.
|
|
32
|
+
env: { ...process.env, TF_IN_AUTOMATION: "1", TF_INPUT: "0", CHECKPOINT_DISABLE: "1" }
|
|
33
|
+
}, (error, stdout) => {
|
|
34
|
+
if (error)
|
|
35
|
+
return resolve(undefined);
|
|
36
|
+
try {
|
|
37
|
+
resolve(JSON.parse(stdout));
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
resolve(undefined);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
resolve(undefined);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
export const absolutePlan = (folder, path) => (isAbsolute(path) ? path : join(folder, path));
|
|
49
|
+
function identity(path) {
|
|
50
|
+
try {
|
|
51
|
+
const stat = statSync(path);
|
|
52
|
+
return stat.isFile() ? { size: stat.size, mtimeMs: stat.mtimeMs } : null;
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const memos = (state) => (Array.isArray(state.terraformPlans) ? state.terraformPlans : []);
|
|
59
|
+
/** The memo for a plan file, when the file is the one that was reduced. */
|
|
60
|
+
function fresh(memo) {
|
|
61
|
+
if (!memo?.plan || memo.size === undefined)
|
|
62
|
+
return undefined;
|
|
63
|
+
const now = identity(memo.path);
|
|
64
|
+
return now && now.size === memo.size && now.mtimeMs === memo.mtimeMs ? memo.plan : undefined;
|
|
65
|
+
}
|
|
66
|
+
/** A saved plan's reduction: remembered, else read now within `timeoutMs`; null when it can't be read. */
|
|
67
|
+
export async function readPlan(state, where, reader = showJson) {
|
|
68
|
+
const path = absolutePlan(where.folder, where.path);
|
|
69
|
+
const known = fresh(memos(state).find((memo) => memo.path === path));
|
|
70
|
+
const file = identity(path);
|
|
71
|
+
if (!file)
|
|
72
|
+
return null;
|
|
73
|
+
const memo = (plan) => ({
|
|
74
|
+
folder: where.folder,
|
|
75
|
+
workspace: where.workspace,
|
|
76
|
+
path,
|
|
77
|
+
at: Date.now(),
|
|
78
|
+
...file,
|
|
79
|
+
plan
|
|
80
|
+
});
|
|
81
|
+
if (known)
|
|
82
|
+
return { plan: known, memo: memo(known) };
|
|
83
|
+
const plan = terraformPlanOf(await reader(where.program, where.folder, path, where.timeoutMs));
|
|
84
|
+
return plan ? { plan, memo: memo(plan) } : null;
|
|
85
|
+
}
|
|
86
|
+
/** The last `plan -out` this session made in this folder and workspace, still fresh. */
|
|
87
|
+
export function lastPlan(state, folder, workspace, now) {
|
|
88
|
+
return memos(state)
|
|
89
|
+
.filter((memo) => memo.folder === folder && memo.workspace === workspace && now - memo.at <= LAST_PLAN_MS)
|
|
90
|
+
.sort((a, b) => b.at - a.at)[0];
|
|
91
|
+
}
|
|
92
|
+
/** The state with this memo kept (replacing one for the same file), the newest few only. */
|
|
93
|
+
export function remember(state, memo) {
|
|
94
|
+
const kept = memos(state).filter((entry) => entry.path !== memo.path);
|
|
95
|
+
return { ...state, terraformPlans: [memo, ...kept].slice(0, MAX_MEMOS) };
|
|
96
|
+
}
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.49.0";
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Keep in lockstep with bridge/package.json.
|
|
2
|
-
export const VERSION = "0.
|
|
2
|
+
export const VERSION = "0.49.0";
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "passport-bridge",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.49.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "passport-bridge",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.49.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@modelcontextprotocol/sdk": "1.32.1"
|