passport-bridge 0.48.2 → 0.50.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/cliHook.js +13 -0
- package/dist/cliHookAfter.js +10 -1
- package/dist/cliHookDecide.d.ts +9 -3
- package/dist/cliHookDecide.js +185 -28
- package/dist/cliHookDeliver.d.ts +2 -2
- package/dist/cliHookDeliver.js +8 -4
- 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/controlPlaneAnswer.d.ts +35 -0
- package/dist/controlPlaneAnswer.js +23 -0
- package/dist/controlPlaneCli.d.ts +1 -1
- package/dist/controlPlaneCloudflare.d.ts +70 -0
- package/dist/controlPlaneCloudflare.js +188 -0
- package/dist/controlPlaneGuard.d.ts +6 -31
- package/dist/controlPlaneGuard.js +17 -24
- 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/controlPlaneRailwayGuard.d.ts +1 -1
- package/dist/controlPlaneRailwayGuard.js +1 -1
- 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/controlPlaneSupabase.d.ts +1 -1
- package/dist/controlPlaneSupabase.js +1 -1
- 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/gitPush.d.ts +8 -3
- package/dist/gitPush.js +37 -12
- package/dist/githubMergeHold.d.ts +42 -0
- package/dist/githubMergeHold.js +134 -0
- package/dist/githubMergeIds.d.ts +18 -0
- package/dist/githubMergeIds.js +51 -0
- 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
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import MCP from "../sources/sentry/mcp-tools.generated.js";
|
|
2
|
+
import { ORG, PROJECT, SENTRY_API_READS, SENTRY_API_RULES } from "./sentryApi.generated.js";
|
|
3
|
+
import { SENTRY_CLI } from "./sentryCli.generated.js";
|
|
4
|
+
import { issueRules, r } from "./sentryIssues.generated.js";
|
|
5
|
+
/**
|
|
6
|
+
* Sentry capture (2026-11-21): its MCP server (mcp.sentry.dev, how agents use Sentry), its REST API (a `curl` the
|
|
7
|
+
* guard reads, or `passport exec`) and sentry-cli (`sentryCli.ts`). Drafted from Sentry's own sources
|
|
8
|
+
* (`sources/sentry/`) and reviewed against the catalog (`sentryCatalog.ts`).
|
|
9
|
+
*
|
|
10
|
+
* Issues: one call can resolve, archive, merge, assign, share or delete many issues at once (a bulk call's `?id=` list,
|
|
11
|
+
* sentry-cli's repeated `--id`). A bulk call's summary carries its size ("Resolve 40 issues"), which its effects
|
|
12
|
+
* count; a call by search ("every issue matching a search") has no size. Every request field read is one the
|
|
13
|
+
* operation declares; an email (a member invite) is never read.
|
|
14
|
+
*/
|
|
15
|
+
/* ------------------------------------------------------------------ */
|
|
16
|
+
/* The MCP server (mcp.sentry.dev) */
|
|
17
|
+
/* ------------------------------------------------------------------ */
|
|
18
|
+
const MCP_RULES = [
|
|
19
|
+
// `update_issue` changes one issue (by id or URL); `reason` is posted as a comment beside the change.
|
|
20
|
+
...issueRules("update_issue", "organization", false).map((rule) => ({
|
|
21
|
+
...rule,
|
|
22
|
+
also: [
|
|
23
|
+
...(rule.also ?? []),
|
|
24
|
+
{
|
|
25
|
+
action: "sentry.issue.comment",
|
|
26
|
+
on: "organization",
|
|
27
|
+
when: { reason: true },
|
|
28
|
+
summary: "Comment on issue {issue}",
|
|
29
|
+
target: { type: "issue", key: "{issue}" }
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
})),
|
|
33
|
+
r("add_issue_note", "sentry.issue.comment", "organization", "Comment on issue {issue}", {
|
|
34
|
+
target: { type: "issue", key: "{issue}" }
|
|
35
|
+
}),
|
|
36
|
+
r("analyze_issue_with_seer", PROJECT, "organization", "Ask Seer to analyze issue {issue}", {
|
|
37
|
+
target: { type: "issue", key: "{issue}" }
|
|
38
|
+
}),
|
|
39
|
+
r("link_issue", PROJECT, "organization", "Link issue {issue} to an external issue", {
|
|
40
|
+
target: { type: "issue", key: "{issue}" }
|
|
41
|
+
}),
|
|
42
|
+
r("unlink_issue", PROJECT, "organization", "Unlink issue {issue} from an external issue", {
|
|
43
|
+
target: { type: "issue", key: "{issue}" }
|
|
44
|
+
}),
|
|
45
|
+
r("create_project", ORG, "team", "Create project {name}"),
|
|
46
|
+
r("update_project", PROJECT, "project", "Change project {project}"),
|
|
47
|
+
r("create_team", ORG, "organization", "Create team {name}"),
|
|
48
|
+
r("add_team_to_project", PROJECT, "project", "Give team {team} access to project {project}"),
|
|
49
|
+
r("remove_team_from_project", PROJECT, "project", "Remove team {team} from project {project}"),
|
|
50
|
+
r("create_dsn", "sentry.project.key", "project", "Create client key {name}"),
|
|
51
|
+
r("update_dsn", "sentry.project.key", "project", "Turn off client key {key}", {
|
|
52
|
+
when: { isActive: "false" },
|
|
53
|
+
target: { type: "client_key", key: "{key}" }
|
|
54
|
+
}),
|
|
55
|
+
r("update_dsn", "sentry.project.key", "project", "Change the rate limit of client key {key}", {
|
|
56
|
+
when: { "*": { keys: "^(rateLimitWindow|rateLimitCount|disableRateLimit)$" } },
|
|
57
|
+
target: { type: "client_key", key: "{key}" }
|
|
58
|
+
}),
|
|
59
|
+
r("update_dsn", "sentry.project.key", "project", "Change client key {key}", {
|
|
60
|
+
target: { type: "client_key", key: "{key}" }
|
|
61
|
+
}),
|
|
62
|
+
r("create_alert_rule", "sentry.alert.change", "organization", "Create alert {name}"),
|
|
63
|
+
r("update_alert_rule", "sentry.alert.mute", "organization", "Turn off alert {alert}", {
|
|
64
|
+
when: { status: "disabled" }
|
|
65
|
+
}),
|
|
66
|
+
r("update_alert_rule", "sentry.alert.change", "organization", "Change alert {alert}"),
|
|
67
|
+
r("delete_alert_rule", "sentry.alert.mute", "project", "Delete alert {alert}", {
|
|
68
|
+
target: { type: "alert", key: "{alert}" }
|
|
69
|
+
}),
|
|
70
|
+
r("create_monitor", "sentry.monitor.change", "project", "Create monitor {name}"),
|
|
71
|
+
r("delete_monitor_environment", "sentry.monitor.change", "project", "Delete monitor {monitor} in {environment}", {
|
|
72
|
+
target: { type: "monitor", key: "{monitor}" }
|
|
73
|
+
}),
|
|
74
|
+
r("create_uptime_monitor", "sentry.monitor.change", "project", "Create monitor {name}"),
|
|
75
|
+
r("update_uptime_monitor", "sentry.monitor.change", "project", "Turn off monitor {monitor}", {
|
|
76
|
+
when: { status: "disabled" },
|
|
77
|
+
target: { type: "monitor", key: "{monitor}" }
|
|
78
|
+
}),
|
|
79
|
+
r("update_uptime_monitor", "sentry.monitor.change", "project", "Change monitor {monitor}", {
|
|
80
|
+
target: { type: "monitor", key: "{monitor}" }
|
|
81
|
+
}),
|
|
82
|
+
r("delete_uptime_monitor", "sentry.monitor.change", "project", "Delete monitor {monitor}", {
|
|
83
|
+
target: { type: "monitor", key: "{monitor}" }
|
|
84
|
+
}),
|
|
85
|
+
r("create_metric_monitor", "sentry.monitor.change", "project", "Create monitor {name}"),
|
|
86
|
+
r("update_metric_monitor", "sentry.monitor.change", "project", "Turn off monitor {monitor}", {
|
|
87
|
+
when: { status: "disabled" },
|
|
88
|
+
target: { type: "monitor", key: "{monitor}" }
|
|
89
|
+
}),
|
|
90
|
+
r("update_metric_monitor", "sentry.monitor.change", "project", "Change monitor {monitor}", {
|
|
91
|
+
target: { type: "monitor", key: "{monitor}" }
|
|
92
|
+
}),
|
|
93
|
+
r("delete_metric_monitor", "sentry.monitor.change", "project", "Delete monitor {monitor}", {
|
|
94
|
+
target: { type: "monitor", key: "{monitor}" }
|
|
95
|
+
}),
|
|
96
|
+
r("onboarding_status_update", ORG, "organization", "Update the setup status"),
|
|
97
|
+
r("submit_feedback_to_sentry_team", ORG, "platform", "Send feedback to Sentry")
|
|
98
|
+
];
|
|
99
|
+
/** Reads: the vendor's readOnlyHint, or (the search tools built by one shared helper) a reviewer's reason. */
|
|
100
|
+
const MCP_READS = Object.fromEntries(MCP.items
|
|
101
|
+
.filter((tool) => tool.readOnlyHint === true)
|
|
102
|
+
.map((tool) => [tool.name, "hintsFrom" in tool ? "Searches Sentry's events; it changes nothing" : "hint"]));
|
|
103
|
+
/* ------------------------------------------------------------------ */
|
|
104
|
+
/* The spec */
|
|
105
|
+
/* ------------------------------------------------------------------ */
|
|
106
|
+
export const SENTRY_CAPTURE = {
|
|
107
|
+
params: {
|
|
108
|
+
org: { cli: ["org", "@linked.org"], mcp: ["organizationSlug"], api: ["organization_id_or_slug"] },
|
|
109
|
+
project: {
|
|
110
|
+
cli: ["project", "@linked.project"],
|
|
111
|
+
mcp: ["projectSlug", "projectSlugOrId"],
|
|
112
|
+
api: ["project_id_or_slug", "project"]
|
|
113
|
+
},
|
|
114
|
+
team: { mcp: ["teamSlug"], api: ["team_id_or_slug"] },
|
|
115
|
+
environment: { cli: ["env", "environment"], mcp: ["environment"], api: ["environment"] },
|
|
116
|
+
issue: { cli: ["id"], mcp: ["issueId"], api: ["issue_id", "id"] },
|
|
117
|
+
event: { api: ["event_id"] },
|
|
118
|
+
version: { cli: ["version", "release", "@linked.release"], mcp: ["releaseVersion"], api: ["version"] },
|
|
119
|
+
alert: { mcp: ["ruleId", "ruleIdOrName"], api: ["rule_id", "alert_rule_id", "workflow_id"] },
|
|
120
|
+
monitor: {
|
|
121
|
+
cli: ["monitor"],
|
|
122
|
+
mcp: ["monitorSlug", "uptimeMonitorId", "monitorId"],
|
|
123
|
+
api: ["monitor_id_or_slug", "detector_id"]
|
|
124
|
+
},
|
|
125
|
+
key: { mcp: ["keyId"], api: ["key_id"] },
|
|
126
|
+
member: { api: ["member_id"] },
|
|
127
|
+
token: { api: ["token_id"] },
|
|
128
|
+
integration: { api: ["integration_id"] },
|
|
129
|
+
dashboard: { api: ["dashboard_id"] },
|
|
130
|
+
provider: { api: ["provider"] },
|
|
131
|
+
// A member's role on invite, never their email.
|
|
132
|
+
role: { api: ["orgRole", "role", "sentryOrgRole"] },
|
|
133
|
+
name: { mcp: ["name"], api: ["name", "displayName"] },
|
|
134
|
+
title: { api: ["title"] }
|
|
135
|
+
},
|
|
136
|
+
split: [
|
|
137
|
+
// An issue's URL names its organization and id: acme.sentry.io/issues/123 or sentry.io/organizations/acme/issues/123.
|
|
138
|
+
{
|
|
139
|
+
from: "issueUrl",
|
|
140
|
+
in: ["mcp"],
|
|
141
|
+
cases: [
|
|
142
|
+
{ match: "^https://([a-z0-9-]+)\\.sentry\\.io/issues/([A-Za-z0-9-]+)", as: ["org", "issue"] },
|
|
143
|
+
{
|
|
144
|
+
match: "^https://(?:[a-z]{2}\\.)?sentry\\.io/organizations/([a-z0-9-]+)/issues/([A-Za-z0-9-]+)",
|
|
145
|
+
as: ["org", "issue"]
|
|
146
|
+
}
|
|
147
|
+
]
|
|
148
|
+
}
|
|
149
|
+
],
|
|
150
|
+
cli: SENTRY_CLI,
|
|
151
|
+
mcp: {
|
|
152
|
+
prefixes: ["mcp__sentry__", "sentry__", "sentry."],
|
|
153
|
+
rules: MCP_RULES,
|
|
154
|
+
reads: MCP_READS
|
|
155
|
+
},
|
|
156
|
+
api: {
|
|
157
|
+
base: "https://sentry.io",
|
|
158
|
+
rules: SENTRY_API_RULES,
|
|
159
|
+
reads: SENTRY_API_READS,
|
|
160
|
+
// Bulk issue, monitor and alert calls name their items by a repeated `?id=`.
|
|
161
|
+
lists: ["id", "project", "environment"]
|
|
162
|
+
},
|
|
163
|
+
sql: {},
|
|
164
|
+
unclassified: "sentry.unclassified"
|
|
165
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ResourceTypeDef } from "../../controlPlane.generated.js";
|
|
2
|
+
import type { ManifestAction, NodeSpec } from "../manifest.generated.js";
|
|
3
|
+
export declare const SENTRY_ACTIONS: readonly ManifestAction[];
|
|
4
|
+
export declare const SENTRY_TYPES: readonly ResourceTypeDef[];
|
|
5
|
+
export declare const SENTRY_NODES: Readonly<Record<string, NodeSpec>>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sentry's governed actions and tree (2026-11-21): the part a person decides. Capture (`sentryCapture.ts`) is drafted
|
|
3
|
+
* from Sentry's own sources (`sources/sentry/`: its MCP server, sentry-cli and its REST API schema) and reviewed
|
|
4
|
+
* against this list. What each call does comes from its effects (`sentryEffects.ts`).
|
|
5
|
+
*
|
|
6
|
+
* The tree: organization › team, organization › project › environment. Sentry names a project by its organization
|
|
7
|
+
* and slug only, never by a team (a project can belong to several), so projects hang off the organization; a team is
|
|
8
|
+
* its own node beside them. Issues, events, releases, alerts, monitors, dashboards, members, auth tokens,
|
|
9
|
+
* integrations and client keys are targets, recorded on the event, never nodes of their own.
|
|
10
|
+
*/
|
|
11
|
+
const a = (key, kind, appliesTo, label, icon, exactTarget) => ({ key, kind, appliesTo, label, icon, ...(exactTarget ? { exactTarget } : {}) });
|
|
12
|
+
export const SENTRY_ACTIONS = [
|
|
13
|
+
// Issues: resolving, archiving or merging hides errors, so a real outage may go unseen.
|
|
14
|
+
a("sentry.issue.resolve", "change", "project", "Resolve issue", "CircleCheck"),
|
|
15
|
+
a("sentry.issue.ignore", "change", "project", "Archive issue", "Archive"),
|
|
16
|
+
a("sentry.issue.merge", "change", "project", "Merge issue", "Merge"),
|
|
17
|
+
a("sentry.issue.delete", "delete", "project", "Delete issue", "Trash2"),
|
|
18
|
+
a("sentry.event.delete", "delete", "project", "Delete event", "Trash2"),
|
|
19
|
+
a("sentry.issue.assign", "change", "project", "Assign issue", "UserPlus"),
|
|
20
|
+
a("sentry.issue.comment", "create", "project", "Comment on issue", "MessageSquare"),
|
|
21
|
+
// Alerts and monitors: muting or deleting one may stop anyone hearing about an outage.
|
|
22
|
+
a("sentry.alert.change", "change", "project", "Create or change an alert", "Siren"),
|
|
23
|
+
a("sentry.alert.mute", "change", "project", "Mute or delete an alert", "BellOff"),
|
|
24
|
+
a("sentry.monitor.change", "change", "project", "Create or change a monitor", "Timer"),
|
|
25
|
+
// Releases: Sentry only records them; nothing runs.
|
|
26
|
+
a("sentry.release.change", "change", "project", "Create or finalize a release", "Package"),
|
|
27
|
+
a("sentry.release.deploy", "create", "environment", "Record a deploy", "Rocket"),
|
|
28
|
+
a("sentry.release.upload", "create", "project", "Upload source maps", "FileUp"),
|
|
29
|
+
// Projects.
|
|
30
|
+
a("sentry.project.key", "create", "project", "Create or change a client key", "KeyRound"),
|
|
31
|
+
a("sentry.project.privacy", "change", "project", "Loosen data scrubbing", "ShieldOff"),
|
|
32
|
+
a("sentry.project.delete", "delete", "project", "Delete project", "Trash2"),
|
|
33
|
+
// Every other project write the manifest names; what each does comes call by call from its summary.
|
|
34
|
+
a("sentry.project.change", "change", "project", "Other change", "Settings"),
|
|
35
|
+
// The organization.
|
|
36
|
+
a("sentry.org.member", "create", "organization", "Invite or remove a member", "Users"),
|
|
37
|
+
a("sentry.org.token", "create", "organization", "Create or revoke an auth token", "Key"),
|
|
38
|
+
a("sentry.org.integration", "create", "organization", "Install an integration", "Plug"),
|
|
39
|
+
a("sentry.org.privacy", "change", "organization", "Loosen data scrubbing", "ShieldOff"),
|
|
40
|
+
a("sentry.org.quota", "change", "organization", "Change spike protection", "Gauge"),
|
|
41
|
+
a("sentry.org.change", "change", "organization", "Other change", "Settings"),
|
|
42
|
+
// Anything the manifest doesn't name: its own kind, Unclassified, with the tool, route or command words it hit.
|
|
43
|
+
a("sentry.unclassified", "unclassified", "organization", "Unclassified action", "CircleHelp")
|
|
44
|
+
];
|
|
45
|
+
const node = (type, label) => ({ type, label, service: "orgs", depth: "node" });
|
|
46
|
+
const target = (type, label, targetOf, targetName) => ({ type, label, service: "orgs", depth: "target", targetOf, targetName });
|
|
47
|
+
export const SENTRY_TYPES = [
|
|
48
|
+
node("organization", "Organization"),
|
|
49
|
+
node("team", "Team"),
|
|
50
|
+
node("project", "Project"),
|
|
51
|
+
node("environment", "Environment"),
|
|
52
|
+
target("issue", "Issue", "project", "id"),
|
|
53
|
+
target("event", "Event", "project", "id"),
|
|
54
|
+
target("release", "Release", "project", "name"),
|
|
55
|
+
target("alert", "Alert", "project", "id"),
|
|
56
|
+
target("monitor", "Monitor", "project", "id"),
|
|
57
|
+
target("client_key", "Client Key", "project", "id"),
|
|
58
|
+
target("dashboard", "Dashboard", "organization", "id"),
|
|
59
|
+
// A member by Sentry's id only: an invite names an email, which is never kept.
|
|
60
|
+
target("member", "Member", "organization", "id"),
|
|
61
|
+
target("auth_token", "Auth Token", "organization", "id"),
|
|
62
|
+
target("integration", "Integration", "organization", "id")
|
|
63
|
+
];
|
|
64
|
+
const underOrg = { type: "organization" };
|
|
65
|
+
export const SENTRY_NODES = {
|
|
66
|
+
organization: { key: "{org}", parent: "service" },
|
|
67
|
+
team: { key: "{org}/{team}", name: "{team}", parent: underOrg },
|
|
68
|
+
project: { key: "{org}/{project}", name: "{project}", parent: underOrg },
|
|
69
|
+
environment: { key: "{org}/{project}/{environment}", name: "{environment}", parent: { type: "project" } }
|
|
70
|
+
};
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import CLI from "../sources/sentry/cli-commands.generated.js";
|
|
2
|
+
/** One rule per project when `-p` repeats: a release or an upload can name several. */
|
|
3
|
+
const perProject = { each: "project" };
|
|
4
|
+
/** Issues picked by id (`-i`, repeatable), or all of a status (`--all`, `--status`). */
|
|
5
|
+
function issueRules(match, action, verb) {
|
|
6
|
+
return [
|
|
7
|
+
{
|
|
8
|
+
match,
|
|
9
|
+
action,
|
|
10
|
+
on: "project",
|
|
11
|
+
when: { issue: { many: true } },
|
|
12
|
+
summary: `${verb} {#issue} issues`
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
match,
|
|
16
|
+
action,
|
|
17
|
+
on: "project",
|
|
18
|
+
when: { issue: true },
|
|
19
|
+
summary: `${verb} issue {issue}`,
|
|
20
|
+
target: { type: "issue", key: "{issue}" },
|
|
21
|
+
// Several ids are the rule above; this one only ever sees one.
|
|
22
|
+
each: "issue"
|
|
23
|
+
},
|
|
24
|
+
{ match, action, on: "project", summary: `${verb} every issue matching a search` }
|
|
25
|
+
];
|
|
26
|
+
}
|
|
27
|
+
const RULES = [
|
|
28
|
+
// Issues.
|
|
29
|
+
...issueRules("issues resolve", "sentry.issue.resolve", "Resolve"),
|
|
30
|
+
...issueRules("issues mute", "sentry.issue.ignore", "Archive"),
|
|
31
|
+
...issueRules("issues unresolve", "sentry.project.change", "Reopen"),
|
|
32
|
+
// Releases: one per project the command names.
|
|
33
|
+
{
|
|
34
|
+
match: "releases new",
|
|
35
|
+
args: ["version"],
|
|
36
|
+
action: "sentry.release.change",
|
|
37
|
+
on: "project",
|
|
38
|
+
when: { finalize: true },
|
|
39
|
+
summary: "Create and finalize release {version}",
|
|
40
|
+
...perProject
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
match: "releases new",
|
|
44
|
+
args: ["version"],
|
|
45
|
+
action: "sentry.release.change",
|
|
46
|
+
on: "project",
|
|
47
|
+
summary: "Create release {version}",
|
|
48
|
+
...perProject
|
|
49
|
+
},
|
|
50
|
+
...[
|
|
51
|
+
["releases finalize", "Finalize release {version}"],
|
|
52
|
+
["releases delete", "Delete release {version}"],
|
|
53
|
+
["releases archive", "Archive release {version}"],
|
|
54
|
+
["releases restore", "Restore release {version}"],
|
|
55
|
+
["releases set-commits", "Set the commits of release {version}"]
|
|
56
|
+
].map(([match, summary]) => ({
|
|
57
|
+
match,
|
|
58
|
+
args: ["version"],
|
|
59
|
+
action: "sentry.release.change",
|
|
60
|
+
on: "project",
|
|
61
|
+
summary,
|
|
62
|
+
...perProject
|
|
63
|
+
})),
|
|
64
|
+
{
|
|
65
|
+
match: "deploys new",
|
|
66
|
+
action: "sentry.release.deploy",
|
|
67
|
+
on: "environment",
|
|
68
|
+
summary: "Record a deploy of {version} to {environment}",
|
|
69
|
+
summaryElse: ["Record a deploy of {version}"],
|
|
70
|
+
...perProject
|
|
71
|
+
},
|
|
72
|
+
// Uploads: files Sentry keeps beside a release or a project.
|
|
73
|
+
{
|
|
74
|
+
match: "sourcemaps upload",
|
|
75
|
+
args: ["...paths"],
|
|
76
|
+
action: "sentry.release.upload",
|
|
77
|
+
on: "project",
|
|
78
|
+
summary: "Upload source maps for {version}",
|
|
79
|
+
summaryElse: ["Upload source maps"],
|
|
80
|
+
...perProject
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
match: "debug-files upload",
|
|
84
|
+
args: ["...paths"],
|
|
85
|
+
action: "sentry.release.upload",
|
|
86
|
+
on: "project",
|
|
87
|
+
summary: "Upload debug files"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
match: "proguard upload",
|
|
91
|
+
args: ["...paths"],
|
|
92
|
+
action: "sentry.release.upload",
|
|
93
|
+
on: "project",
|
|
94
|
+
summary: "Upload ProGuard mappings"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
match: "dart-symbol-map upload",
|
|
98
|
+
args: ["...paths"],
|
|
99
|
+
action: "sentry.release.upload",
|
|
100
|
+
on: "project",
|
|
101
|
+
summary: "Upload Dart symbol maps"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
match: "react-native gradle",
|
|
105
|
+
action: "sentry.release.upload",
|
|
106
|
+
on: "project",
|
|
107
|
+
summary: "Upload React Native source maps"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
match: "react-native xcode",
|
|
111
|
+
args: ["...build"],
|
|
112
|
+
action: "sentry.release.upload",
|
|
113
|
+
on: "project",
|
|
114
|
+
summary: "Upload React Native source maps"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
match: "build upload",
|
|
118
|
+
args: ["...paths"],
|
|
119
|
+
action: "sentry.release.upload",
|
|
120
|
+
on: "project",
|
|
121
|
+
summary: "Upload a mobile build"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
match: "snapshots upload",
|
|
125
|
+
args: ["...paths"],
|
|
126
|
+
action: "sentry.release.upload",
|
|
127
|
+
on: "project",
|
|
128
|
+
summary: "Upload snapshots"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
match: "code-mappings upload",
|
|
132
|
+
args: ["...paths"],
|
|
133
|
+
action: "sentry.project.change",
|
|
134
|
+
on: "project",
|
|
135
|
+
summary: "Upload code mappings"
|
|
136
|
+
},
|
|
137
|
+
// Events, check-ins and metrics: records sent to Sentry.
|
|
138
|
+
{ match: "send-event", args: ["...paths"], action: "sentry.project.change", on: "project", summary: "Send an event" },
|
|
139
|
+
{
|
|
140
|
+
match: "send-envelope",
|
|
141
|
+
args: ["...paths"],
|
|
142
|
+
action: "sentry.project.change",
|
|
143
|
+
on: "project",
|
|
144
|
+
summary: "Send an event"
|
|
145
|
+
},
|
|
146
|
+
{ match: "send-metric increment", action: "sentry.project.change", on: "project", summary: "Send metrics" },
|
|
147
|
+
{ match: "send-metric set", action: "sentry.project.change", on: "project", summary: "Send metrics" },
|
|
148
|
+
{
|
|
149
|
+
match: "monitors run",
|
|
150
|
+
args: ["monitor", "...command"],
|
|
151
|
+
action: "sentry.monitor.change",
|
|
152
|
+
// It names no organization: the token or DSN it runs with does.
|
|
153
|
+
on: "platform",
|
|
154
|
+
when: { schedule: true },
|
|
155
|
+
summary: "Create or update monitor {monitor} from its schedule",
|
|
156
|
+
target: { type: "monitor", key: "{monitor}" }
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
match: "monitors run",
|
|
160
|
+
args: ["monitor", "...command"],
|
|
161
|
+
action: "sentry.project.change",
|
|
162
|
+
on: "platform",
|
|
163
|
+
summary: "Send check-ins for monitor {monitor}"
|
|
164
|
+
}
|
|
165
|
+
];
|
|
166
|
+
/** Commands that read Sentry, or touch only this computer, and why. */
|
|
167
|
+
const READS = {
|
|
168
|
+
info: "Prints the CLI's own configuration",
|
|
169
|
+
login: "Saves a token on this computer only",
|
|
170
|
+
"bash-hook": "Prints a shell hook; it sends nothing",
|
|
171
|
+
uninstall: "Removes the CLI from this computer",
|
|
172
|
+
update: "Updates the CLI on this computer",
|
|
173
|
+
"organizations list": "Lists organizations; it changes nothing",
|
|
174
|
+
"projects list": "Lists projects; it changes nothing",
|
|
175
|
+
"repos list": "Lists repositories; it changes nothing",
|
|
176
|
+
"releases list": "Lists releases; it changes nothing",
|
|
177
|
+
"releases info": "Shows a release; it changes nothing",
|
|
178
|
+
"releases propose-version": "Prints a version from the local repository",
|
|
179
|
+
"deploys list": "Lists deploys; it changes nothing",
|
|
180
|
+
"issues list": "Lists issues; it changes nothing",
|
|
181
|
+
"events list": "Lists events; it changes nothing",
|
|
182
|
+
"logs list": "Lists logs; it changes nothing",
|
|
183
|
+
"monitors list": "Lists monitors; it changes nothing",
|
|
184
|
+
"build download": "Downloads a build to this computer",
|
|
185
|
+
"snapshots download": "Downloads snapshots to this computer",
|
|
186
|
+
"snapshots diff": "Compares snapshot folders on this computer",
|
|
187
|
+
"sourcemaps inject": "Rewrites local build files; it sends nothing",
|
|
188
|
+
"sourcemaps resolve": "Resolves a position in a local source map",
|
|
189
|
+
"debug-files check": "Checks a local debug file",
|
|
190
|
+
"debug-files find": "Finds local debug files",
|
|
191
|
+
"debug-files print-sources": "Prints sources from a local debug file",
|
|
192
|
+
"debug-files bundle-sources": "Bundles sources into a local file",
|
|
193
|
+
"debug-files bundle-jvm": "Bundles sources into a local file",
|
|
194
|
+
"proguard uuid": "Prints the id of a local mapping file"
|
|
195
|
+
};
|
|
196
|
+
const flags = (list) => list;
|
|
197
|
+
export const SENTRY_CLI = {
|
|
198
|
+
programs: ["sentry-cli"],
|
|
199
|
+
// clap: a switch takes no value (`--finalize=true` is an error), as Vercel's parser.
|
|
200
|
+
framework: "arg",
|
|
201
|
+
// The legacy top-level upload commands run the newer ones.
|
|
202
|
+
aliases: {
|
|
203
|
+
"upload-dif": "debug-files upload",
|
|
204
|
+
"upload-dsym": "debug-files upload",
|
|
205
|
+
"upload-proguard": "proguard upload"
|
|
206
|
+
},
|
|
207
|
+
env: { SENTRY_ORG: "org", SENTRY_PROJECT: "project", SENTRY_RELEASE: "release" },
|
|
208
|
+
// Any other SENTRY_* variable on the line (SENTRY_URL points at another server) fails closed.
|
|
209
|
+
envPrefixes: ["SENTRY_"],
|
|
210
|
+
envIgnore: ["SENTRY_AUTH_TOKEN", "SENTRY_LOG_LEVEL", "SENTRY_DSN", "SENTRY_LOAD_DOTENV", "SENTRY_ALLOW_FAILURE"],
|
|
211
|
+
link: { file: ".sentryclirc", format: "ini", fields: { "defaults.org": "org", "defaults.project": "project" } },
|
|
212
|
+
infoFlags: ["help", "version"],
|
|
213
|
+
usage: {
|
|
214
|
+
"releases new": "<version>",
|
|
215
|
+
"releases finalize": "<version>",
|
|
216
|
+
"releases delete": "<version>",
|
|
217
|
+
"releases archive": "<version>",
|
|
218
|
+
"releases restore": "<version>",
|
|
219
|
+
"releases set-commits": "<version>",
|
|
220
|
+
"issues resolve": "",
|
|
221
|
+
"issues mute": "",
|
|
222
|
+
"issues unresolve": "",
|
|
223
|
+
"deploys new": ""
|
|
224
|
+
},
|
|
225
|
+
flags: { global: flags(CLI.global), commands: CLI.commands },
|
|
226
|
+
remoteFlags: [],
|
|
227
|
+
localFlags: [],
|
|
228
|
+
rules: RULES,
|
|
229
|
+
reads: READS
|
|
230
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CaptureRule } from "../manifest.generated.js";
|
|
2
|
+
/**
|
|
3
|
+
* Sentry's issue and settings rules (2026-11-21), shared by its REST API (`sentryApi.ts`) and MCP server
|
|
4
|
+
* (`sentryCapture.ts`): one call can resolve, archive, merge, assign, share or delete many issues at once (a bulk
|
|
5
|
+
* call's `?id=` list), and a settings call can loosen data scrubbing or access. Only fields the operation declares are
|
|
6
|
+
* tested.
|
|
7
|
+
*/
|
|
8
|
+
export type Rule = CaptureRule;
|
|
9
|
+
/**
|
|
10
|
+
* The rules for one route or tool that changes issues by its body: delete and discard, merge, a status, an assignee,
|
|
11
|
+
* a public link, else any other change (seen, bookmarked, priority). `bulk`: the route takes a list of ids. Only the
|
|
12
|
+
* fields the operation declares are tested.
|
|
13
|
+
*/
|
|
14
|
+
export declare function issueRules(match: string, on: string, bulk: boolean): Rule[];
|
|
15
|
+
/** Deleting issues: one, several by id, or every one a search matches. Never restorable. */
|
|
16
|
+
export declare function issueDeletes(match: string, on: string, bulk: boolean): Rule[];
|
|
17
|
+
/** Organization and project settings: scrubbing loosened first (Shares data), then access, then anything else. */
|
|
18
|
+
export declare function settingsRules(match: string, on: "organization" | "project", where: string): Rule[];
|
|
19
|
+
/** One rule: its match, action, node and summary. */
|
|
20
|
+
export declare const r: (match: string, action: string, on: string, summary: string, extra?: Partial<Rule>) => Rule;
|