@zivis/mcp 0.1.0-alpha.9 → 0.1.6
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/LICENSE +201 -0
- package/README.md +19 -0
- package/dist/api-client.d.ts +1 -31
- package/dist/api-client.js +26 -66
- package/dist/auth/index.d.ts +1 -22
- package/dist/auth/index.js +15 -46
- package/dist/auth/jwt.d.ts +0 -16
- package/dist/auth/jwt.js +0 -13
- package/dist/auth/keychain.d.ts +6 -32
- package/dist/auth/keychain.js +83 -114
- package/dist/auth/oauth.d.ts +1 -42
- package/dist/auth/oauth.js +22 -64
- package/dist/auth/sessions.d.ts +5 -25
- package/dist/auth/sessions.js +20 -39
- package/dist/auth/token-refresh.d.ts +2 -22
- package/dist/auth/token-refresh.js +12 -47
- package/dist/cli.d.ts +1 -18
- package/dist/cli.js +30 -908
- package/dist/index.d.ts +0 -6
- package/dist/index.js +0 -7
- package/dist/lib/inspect-cache.d.ts +10 -0
- package/dist/lib/inspect-cache.js +75 -0
- package/dist/lib/next-steps.d.ts +27 -0
- package/dist/lib/next-steps.js +21 -0
- package/dist/matcher/ast-eval.d.ts +8 -0
- package/dist/matcher/ast-eval.js +95 -0
- package/dist/matcher/finding.d.ts +55 -0
- package/dist/matcher/finding.js +1 -0
- package/dist/matcher/index.d.ts +8 -0
- package/dist/matcher/index.js +202 -0
- package/dist/matcher/inference-candidates.d.ts +26 -0
- package/dist/matcher/inference-candidates.js +81 -0
- package/dist/matcher/walker.d.ts +7 -0
- package/dist/matcher/walker.js +71 -0
- package/dist/pattern-pack/index.d.ts +125 -0
- package/dist/pattern-pack/index.js +189 -0
- package/dist/pattern-packs/zivis-public-0.2.0/capsules/agents/privilege-separation.yaml +224 -0
- package/dist/pattern-packs/zivis-public-0.2.0/capsules/prompting/self-consistency-no-isolation.yaml +237 -0
- package/dist/pattern-packs/zivis-public-0.2.0/capsules/retrieval/context-injection-no-validator.yaml +348 -0
- package/dist/pattern-packs/zivis-public-0.2.0/capsules/security/late-org-filter.yaml +266 -0
- package/dist/pattern-packs/zivis-public-0.2.0/controls/external_validator_on_facts.yaml +37 -0
- package/dist/pattern-packs/zivis-public-0.2.0/controls/fact_validator_present.yaml +68 -0
- package/dist/pattern-packs/zivis-public-0.2.0/controls/human_approval_gate.yaml +44 -0
- package/dist/pattern-packs/zivis-public-0.2.0/controls/langgraph_state_machine_with_per_node_tools.yaml +35 -0
- package/dist/pattern-packs/zivis-public-0.2.0/controls/per_sample_retrieval_diversification.yaml +38 -0
- package/dist/pattern-packs/zivis-public-0.2.0/controls/prisma_extension_or_middleware_attaching_org_filter.yaml +31 -0
- package/dist/pattern-packs/zivis-public-0.2.0/controls/row_level_security_policy.yaml +37 -0
- package/dist/pattern-packs/zivis-public-0.2.0/controls/source_attribution_present.yaml +58 -0
- package/dist/pattern-packs/zivis-public-0.2.0/manifest.json +167 -0
- package/dist/pattern-packs/zivis-public-0.2.0/prompts/agents/privilege-separation/identify.md +54 -0
- package/dist/pattern-packs/zivis-public-0.2.0/prompts/prompting/self-consistency-no-isolation/identify.md +60 -0
- package/dist/pattern-packs/zivis-public-0.2.0/prompts/retrieval/context-injection-no-validator/identify.md +109 -0
- package/dist/pattern-packs/zivis-public-0.2.0/prompts/security/late-org-filter/identify.md +78 -0
- package/dist/project-binding.d.ts +2 -19
- package/dist/project-binding.js +38 -21
- package/dist/prompts/audit-dependencies.d.ts +2 -0
- package/dist/prompts/audit-dependencies.js +47 -0
- package/dist/prompts/getting-started.d.ts +2 -0
- package/dist/prompts/getting-started.js +37 -0
- package/dist/prompts/index.d.ts +2 -0
- package/dist/prompts/index.js +6 -0
- package/dist/resolve-application-id.d.ts +0 -4
- package/dist/resolve-application-id.js +0 -5
- package/dist/sanitize.d.ts +1 -21
- package/dist/sanitize.js +7 -41
- package/dist/server.d.ts +1 -13
- package/dist/server.js +134 -253
- package/dist/tools/artifacts.d.ts +76 -0
- package/dist/tools/artifacts.js +178 -0
- package/dist/tools/check-project.d.ts +5 -18
- package/dist/tools/check-project.js +120 -111
- package/dist/tools/check-repo-trust.d.ts +4 -19
- package/dist/tools/check-repo-trust.js +56 -47
- package/dist/tools/create-diagram.d.ts +0 -5
- package/dist/tools/create-diagram.js +0 -10
- package/dist/tools/create-document.d.ts +0 -5
- package/dist/tools/create-document.js +3 -9
- package/dist/tools/create-finding.d.ts +85 -0
- package/dist/tools/create-finding.js +136 -0
- package/dist/tools/delete-finding.d.ts +19 -0
- package/dist/tools/delete-finding.js +36 -0
- package/dist/tools/discover-local-infra.d.ts +0 -10
- package/dist/tools/discover-local-infra.js +3 -73
- package/dist/tools/enterprise/get-org-zat.d.ts +0 -5
- package/dist/tools/enterprise/get-org-zat.js +0 -6
- package/dist/tools/enterprise/get-threat-model.d.ts +1 -8
- package/dist/tools/enterprise/get-threat-model.js +9 -31
- package/dist/tools/enterprise/list-attack-scenarios.d.ts +24 -0
- package/dist/tools/enterprise/list-attack-scenarios.js +63 -0
- package/dist/tools/enterprise/list-threat-models.d.ts +1 -6
- package/dist/tools/enterprise/list-threat-models.js +1 -9
- package/dist/tools/enterprise/manage-actor.d.ts +2 -7
- package/dist/tools/enterprise/manage-actor.js +13 -7
- package/dist/tools/enterprise/manage-attack-scenario.d.ts +1 -6
- package/dist/tools/enterprise/manage-attack-scenario.js +12 -7
- package/dist/tools/enterprise/manage-data-asset.d.ts +2 -7
- package/dist/tools/enterprise/manage-data-asset.js +16 -7
- package/dist/tools/enterprise/manage-security-control.d.ts +1 -6
- package/dist/tools/enterprise/manage-security-control.js +17 -7
- package/dist/tools/explain-signal-for-diff.d.ts +34 -0
- package/dist/tools/explain-signal-for-diff.js +75 -0
- package/dist/tools/generate-diagram.d.ts +0 -6
- package/dist/tools/generate-diagram.js +21 -13
- package/dist/tools/get-application-overview.d.ts +0 -5
- package/dist/tools/get-application-overview.js +0 -6
- package/dist/tools/get-application.d.ts +0 -5
- package/dist/tools/get-application.js +0 -6
- package/dist/tools/get-diagram.d.ts +0 -5
- package/dist/tools/get-diagram.js +1 -11
- package/dist/tools/get-document.d.ts +0 -5
- package/dist/tools/get-document.js +0 -6
- package/dist/tools/get-oss-zat.d.ts +0 -5
- package/dist/tools/get-oss-zat.js +0 -7
- package/dist/tools/get-signal.d.ts +24 -0
- package/dist/tools/get-signal.js +75 -0
- package/dist/tools/get-started.d.ts +18 -0
- package/dist/tools/get-started.js +470 -0
- package/dist/tools/get-trust-keys.d.ts +0 -5
- package/dist/tools/get-trust-keys.js +0 -6
- package/dist/tools/import-openapi-endpoints.d.ts +0 -5
- package/dist/tools/import-openapi-endpoints.js +0 -6
- package/dist/tools/inspect-zat.d.ts +0 -5
- package/dist/tools/inspect-zat.js +0 -19
- package/dist/tools/inspect.d.ts +21 -0
- package/dist/tools/inspect.js +222 -0
- package/dist/tools/list-applications.d.ts +1 -6
- package/dist/tools/list-applications.js +0 -6
- package/dist/tools/list-diagrams.d.ts +0 -5
- package/dist/tools/list-diagrams.js +0 -6
- package/dist/tools/list-documents.d.ts +0 -5
- package/dist/tools/list-documents.js +0 -6
- package/dist/tools/list-endpoints.d.ts +1 -6
- package/dist/tools/list-endpoints.js +0 -6
- package/dist/tools/list-signals.d.ts +37 -0
- package/dist/tools/list-signals.js +83 -0
- package/dist/tools/manage-application.d.ts +64 -0
- package/dist/tools/manage-application.js +129 -0
- package/dist/tools/manage-diagram.d.ts +0 -5
- package/dist/tools/manage-diagram.js +0 -16
- package/dist/tools/manage-endpoint-lifecycle.d.ts +80 -0
- package/dist/tools/manage-endpoint-lifecycle.js +180 -0
- package/dist/tools/open-in-ide.d.ts +2 -14
- package/dist/tools/open-in-ide.js +0 -13
- package/dist/tools/review-change.d.ts +34 -0
- package/dist/tools/review-change.js +93 -0
- package/dist/tools/security-review.d.ts +0 -16
- package/dist/tools/security-review.js +63 -77
- package/dist/tools/threat-get-capsule.d.ts +15 -0
- package/dist/tools/threat-get-capsule.js +53 -0
- package/dist/tools/threat-get-inference-prompt.d.ts +15 -0
- package/dist/tools/threat-get-inference-prompt.js +73 -0
- package/dist/tools/threat-list-relevant-capsules.d.ts +17 -0
- package/dist/tools/threat-list-relevant-capsules.js +158 -0
- package/dist/tools/threat-run-matcher.d.ts +17 -0
- package/dist/tools/threat-run-matcher.js +145 -0
- package/dist/tools/update-document.d.ts +0 -5
- package/dist/tools/update-document.js +3 -9
- package/dist/tools/update-endpoint.d.ts +1 -6
- package/dist/tools/update-endpoint.js +0 -7
- package/dist/tools/update-finding.d.ts +61 -0
- package/dist/tools/update-finding.js +80 -0
- package/dist/tools/update-mermaid-source.d.ts +0 -13
- package/dist/tools/update-mermaid-source.js +0 -14
- package/dist/tools/verify-trust-mark.d.ts +0 -5
- package/dist/tools/verify-trust-mark.js +0 -6
- package/dist/types.d.ts +13 -13
- package/dist/types.js +22 -28
- package/package.json +28 -5
- package/dist/api-client.js.map +0 -1
- package/dist/auth/index.js.map +0 -1
- package/dist/auth/jwt.js.map +0 -1
- package/dist/auth/keychain.js.map +0 -1
- package/dist/auth/oauth.js.map +0 -1
- package/dist/auth/sessions.js.map +0 -1
- package/dist/auth/token-refresh.js.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/project-binding.js.map +0 -1
- package/dist/resolve-application-id.js.map +0 -1
- package/dist/sanitize.js.map +0 -1
- package/dist/server.js.map +0 -1
- package/dist/tools/check-project.js.map +0 -1
- package/dist/tools/check-repo-trust.js.map +0 -1
- package/dist/tools/create-diagram.js.map +0 -1
- package/dist/tools/create-document.js.map +0 -1
- package/dist/tools/discover-local-infra.js.map +0 -1
- package/dist/tools/enterprise/capture-evidence.d.ts +0 -54
- package/dist/tools/enterprise/capture-evidence.js +0 -72
- package/dist/tools/enterprise/capture-evidence.js.map +0 -1
- package/dist/tools/enterprise/create-report-ticket.d.ts +0 -34
- package/dist/tools/enterprise/create-report-ticket.js +0 -44
- package/dist/tools/enterprise/create-report-ticket.js.map +0 -1
- package/dist/tools/enterprise/end-pentest-session.d.ts +0 -33
- package/dist/tools/enterprise/end-pentest-session.js +0 -42
- package/dist/tools/enterprise/end-pentest-session.js.map +0 -1
- package/dist/tools/enterprise/generate-report.d.ts +0 -55
- package/dist/tools/enterprise/generate-report.js +0 -111
- package/dist/tools/enterprise/generate-report.js.map +0 -1
- package/dist/tools/enterprise/get-org-zat.js.map +0 -1
- package/dist/tools/enterprise/get-report-status.d.ts +0 -27
- package/dist/tools/enterprise/get-report-status.js +0 -38
- package/dist/tools/enterprise/get-report-status.js.map +0 -1
- package/dist/tools/enterprise/get-threat-model.js.map +0 -1
- package/dist/tools/enterprise/list-agents.d.ts +0 -42
- package/dist/tools/enterprise/list-agents.js +0 -95
- package/dist/tools/enterprise/list-agents.js.map +0 -1
- package/dist/tools/enterprise/list-report-issues.d.ts +0 -36
- package/dist/tools/enterprise/list-report-issues.js +0 -50
- package/dist/tools/enterprise/list-report-issues.js.map +0 -1
- package/dist/tools/enterprise/list-threat-models.js.map +0 -1
- package/dist/tools/enterprise/manage-actor.js.map +0 -1
- package/dist/tools/enterprise/manage-attack-scenario.js.map +0 -1
- package/dist/tools/enterprise/manage-component.d.ts +0 -58
- package/dist/tools/enterprise/manage-component.js +0 -90
- package/dist/tools/enterprise/manage-component.js.map +0 -1
- package/dist/tools/enterprise/manage-data-asset.js.map +0 -1
- package/dist/tools/enterprise/manage-data-flow.d.ts +0 -57
- package/dist/tools/enterprise/manage-data-flow.js +0 -98
- package/dist/tools/enterprise/manage-data-flow.js.map +0 -1
- package/dist/tools/enterprise/manage-finding.d.ts +0 -69
- package/dist/tools/enterprise/manage-finding.js +0 -106
- package/dist/tools/enterprise/manage-finding.js.map +0 -1
- package/dist/tools/enterprise/manage-security-control.js.map +0 -1
- package/dist/tools/enterprise/manage-test-case.d.ts +0 -88
- package/dist/tools/enterprise/manage-test-case.js +0 -119
- package/dist/tools/enterprise/manage-test-case.js.map +0 -1
- package/dist/tools/enterprise/promote-finding-to-issue.d.ts +0 -36
- package/dist/tools/enterprise/promote-finding-to-issue.js +0 -65
- package/dist/tools/enterprise/promote-finding-to-issue.js.map +0 -1
- package/dist/tools/enterprise/publish-report-version.d.ts +0 -34
- package/dist/tools/enterprise/publish-report-version.js +0 -75
- package/dist/tools/enterprise/publish-report-version.js.map +0 -1
- package/dist/tools/enterprise/publish-test-to-library.d.ts +0 -31
- package/dist/tools/enterprise/publish-test-to-library.js +0 -40
- package/dist/tools/enterprise/publish-test-to-library.js.map +0 -1
- package/dist/tools/enterprise/record-test-result.d.ts +0 -67
- package/dist/tools/enterprise/record-test-result.js +0 -75
- package/dist/tools/enterprise/record-test-result.js.map +0 -1
- package/dist/tools/enterprise/start-pentest-session.d.ts +0 -35
- package/dist/tools/enterprise/start-pentest-session.js +0 -50
- package/dist/tools/enterprise/start-pentest-session.js.map +0 -1
- package/dist/tools/enterprise/sync-report-section.d.ts +0 -41
- package/dist/tools/enterprise/sync-report-section.js +0 -79
- package/dist/tools/enterprise/sync-report-section.js.map +0 -1
- package/dist/tools/enterprise/update-report-issue.d.ts +0 -55
- package/dist/tools/enterprise/update-report-issue.js +0 -69
- package/dist/tools/enterprise/update-report-issue.js.map +0 -1
- package/dist/tools/generate-diagram.js.map +0 -1
- package/dist/tools/get-agent-test-results.d.ts +0 -41
- package/dist/tools/get-agent-test-results.js +0 -86
- package/dist/tools/get-agent-test-results.js.map +0 -1
- package/dist/tools/get-application-overview.js.map +0 -1
- package/dist/tools/get-application.js.map +0 -1
- package/dist/tools/get-artifact-content.d.ts +0 -29
- package/dist/tools/get-artifact-content.js +0 -86
- package/dist/tools/get-artifact-content.js.map +0 -1
- package/dist/tools/get-diagram.js.map +0 -1
- package/dist/tools/get-document.js.map +0 -1
- package/dist/tools/get-finding-details.d.ts +0 -28
- package/dist/tools/get-finding-details.js +0 -43
- package/dist/tools/get-finding-details.js.map +0 -1
- package/dist/tools/get-findings.d.ts +0 -57
- package/dist/tools/get-findings.js +0 -103
- package/dist/tools/get-findings.js.map +0 -1
- package/dist/tools/get-oss-zat.js.map +0 -1
- package/dist/tools/get-recon-scan.d.ts +0 -27
- package/dist/tools/get-recon-scan.js +0 -46
- package/dist/tools/get-recon-scan.js.map +0 -1
- package/dist/tools/get-scan-output.d.ts +0 -27
- package/dist/tools/get-scan-output.js +0 -64
- package/dist/tools/get-scan-output.js.map +0 -1
- package/dist/tools/get-scenario-details.d.ts +0 -27
- package/dist/tools/get-scenario-details.js +0 -46
- package/dist/tools/get-scenario-details.js.map +0 -1
- package/dist/tools/get-test-case-results.d.ts +0 -37
- package/dist/tools/get-test-case-results.js +0 -66
- package/dist/tools/get-test-case-results.js.map +0 -1
- package/dist/tools/get-test-details.d.ts +0 -29
- package/dist/tools/get-test-details.js +0 -49
- package/dist/tools/get-test-details.js.map +0 -1
- package/dist/tools/get-trust-keys.js.map +0 -1
- package/dist/tools/import-openapi-endpoints.js.map +0 -1
- package/dist/tools/inspect-zat.js.map +0 -1
- package/dist/tools/list-agent-test-cases.d.ts +0 -41
- package/dist/tools/list-agent-test-cases.js +0 -73
- package/dist/tools/list-agent-test-cases.js.map +0 -1
- package/dist/tools/list-applications.js.map +0 -1
- package/dist/tools/list-diagrams.js.map +0 -1
- package/dist/tools/list-documents.js.map +0 -1
- package/dist/tools/list-endpoints.js.map +0 -1
- package/dist/tools/list-recon-scans.d.ts +0 -36
- package/dist/tools/list-recon-scans.js +0 -74
- package/dist/tools/list-recon-scans.js.map +0 -1
- package/dist/tools/list-scan-artifacts.d.ts +0 -41
- package/dist/tools/list-scan-artifacts.js +0 -63
- package/dist/tools/list-scan-artifacts.js.map +0 -1
- package/dist/tools/list-scans.d.ts +0 -44
- package/dist/tools/list-scans.js +0 -91
- package/dist/tools/list-scans.js.map +0 -1
- package/dist/tools/list-test-library.d.ts +0 -44
- package/dist/tools/list-test-library.js +0 -83
- package/dist/tools/list-test-library.js.map +0 -1
- package/dist/tools/list-test-scenarios.d.ts +0 -31
- package/dist/tools/list-test-scenarios.js +0 -66
- package/dist/tools/list-test-scenarios.js.map +0 -1
- package/dist/tools/local-scan.d.ts +0 -40
- package/dist/tools/local-scan.js +0 -261
- package/dist/tools/local-scan.js.map +0 -1
- package/dist/tools/manage-diagram.js.map +0 -1
- package/dist/tools/open-in-ide.js.map +0 -1
- package/dist/tools/run-test-scenario.d.ts +0 -37
- package/dist/tools/run-test-scenario.js +0 -70
- package/dist/tools/run-test-scenario.js.map +0 -1
- package/dist/tools/scan-pr.d.ts +0 -27
- package/dist/tools/scan-pr.js +0 -51
- package/dist/tools/scan-pr.js.map +0 -1
- package/dist/tools/security-review.js.map +0 -1
- package/dist/tools/setup-red-team-target.d.ts +0 -79
- package/dist/tools/setup-red-team-target.js +0 -430
- package/dist/tools/setup-red-team-target.js.map +0 -1
- package/dist/tools/triage-finding.d.ts +0 -47
- package/dist/tools/triage-finding.js +0 -116
- package/dist/tools/triage-finding.js.map +0 -1
- package/dist/tools/update-document.js.map +0 -1
- package/dist/tools/update-endpoint.js.map +0 -1
- package/dist/tools/update-mermaid-source.js.map +0 -1
- package/dist/tools/verify-trust-mark.js.map +0 -1
- package/dist/types.js.map +0 -1
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* zivis_manage_actor — Create, update, or delete threat actors in a threat model
|
|
3
|
-
*
|
|
4
|
-
* Maps to: POST/PATCH/DELETE /api/threat-models/:id/actors
|
|
5
|
-
*/
|
|
6
1
|
import { z } from "zod";
|
|
7
2
|
import type { ApiClient } from "../../api-client.js";
|
|
8
3
|
export declare const MANAGE_ACTOR_NAME = "zivis_manage_actor";
|
|
9
|
-
export declare const MANAGE_ACTOR_DESCRIPTION = "Create, update, or delete a threat actor in a threat model.\n\nThreat actors represent entities that interact with or threaten the system
|
|
4
|
+
export declare const MANAGE_ACTOR_DESCRIPTION = "Create, update, or delete a threat actor in a threat model.\n\nWhen to use (plain English): call this when the user describes who interacts with or threatens the app. Common phrasings:\n- \"users / end users / customers / our users can ...\"\n- \"admins / support team / internal employees ...\"\n- \"attacker / adversary / bad actor / malicious user ...\"\n- \"insider / rogue employee ...\"\n- \"vendor / partner / integration partner ...\"\n- \"bot / scraper / automated agent ...\"\n- \"<external service> calls our API\" (the external service is an actor too)\n\n\nThreat actors represent entities that interact with or threaten the system. Each actor has a trust level, type, and capabilities.\n\nAfter create: ask which components this actor interacts with so a data flow can be modeled.\n\nActions:\n- create: Add a new threat actor (requires name, actor_type, trust_level)\n- update: Modify an existing actor (requires actor_id)\n- delete: Remove an actor (requires actor_id)";
|
|
10
5
|
export declare const MANAGE_ACTOR_SCHEMA: {
|
|
11
6
|
threat_model_id: z.ZodString;
|
|
12
7
|
action: z.ZodEnum<{
|
|
@@ -17,10 +12,10 @@ export declare const MANAGE_ACTOR_SCHEMA: {
|
|
|
17
12
|
actor_id: z.ZodOptional<z.ZodString>;
|
|
18
13
|
name: z.ZodOptional<z.ZodString>;
|
|
19
14
|
actor_type: z.ZodOptional<z.ZodEnum<{
|
|
15
|
+
third_party: "third_party";
|
|
20
16
|
external: "external";
|
|
21
17
|
internal: "internal";
|
|
22
18
|
system: "system";
|
|
23
|
-
third_party: "third_party";
|
|
24
19
|
}>>;
|
|
25
20
|
trust_level: z.ZodOptional<z.ZodEnum<{
|
|
26
21
|
high: "high";
|
|
@@ -1,14 +1,21 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* zivis_manage_actor — Create, update, or delete threat actors in a threat model
|
|
3
|
-
*
|
|
4
|
-
* Maps to: POST/PATCH/DELETE /api/threat-models/:id/actors
|
|
5
|
-
*/
|
|
6
1
|
import { z } from "zod";
|
|
7
2
|
import { sanitizeResponse } from "../../sanitize.js";
|
|
8
3
|
export const MANAGE_ACTOR_NAME = "zivis_manage_actor";
|
|
9
4
|
export const MANAGE_ACTOR_DESCRIPTION = `Create, update, or delete a threat actor in a threat model.
|
|
10
5
|
|
|
11
|
-
|
|
6
|
+
When to use (plain English): call this when the user describes who interacts with or threatens the app. Common phrasings:
|
|
7
|
+
- "users / end users / customers / our users can ..."
|
|
8
|
+
- "admins / support team / internal employees ..."
|
|
9
|
+
- "attacker / adversary / bad actor / malicious user ..."
|
|
10
|
+
- "insider / rogue employee ..."
|
|
11
|
+
- "vendor / partner / integration partner ..."
|
|
12
|
+
- "bot / scraper / automated agent ..."
|
|
13
|
+
- "<external service> calls our API" (the external service is an actor too)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
Threat actors represent entities that interact with or threaten the system. Each actor has a trust level, type, and capabilities.
|
|
17
|
+
|
|
18
|
+
After create: ask which components this actor interacts with so a data flow can be modeled.
|
|
12
19
|
|
|
13
20
|
Actions:
|
|
14
21
|
- create: Add a new threat actor (requires name, actor_type, trust_level)
|
|
@@ -96,4 +103,3 @@ export function createManageActorHandler(apiClient) {
|
|
|
96
103
|
}
|
|
97
104
|
};
|
|
98
105
|
}
|
|
99
|
-
//# sourceMappingURL=manage-actor.js.map
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* zivis_manage_attack_scenario — Create, update, or delete attack scenarios
|
|
3
|
-
*
|
|
4
|
-
* Maps to: POST/PATCH/DELETE /api/threat-models/:id/attack-scenarios
|
|
5
|
-
*/
|
|
6
1
|
import { z } from "zod";
|
|
7
2
|
import type { ApiClient } from "../../api-client.js";
|
|
8
3
|
export declare const MANAGE_ATTACK_SCENARIO_NAME = "zivis_manage_attack_scenario";
|
|
9
|
-
export declare const MANAGE_ATTACK_SCENARIO_DESCRIPTION = "Create, update, or delete an attack scenario in a threat model.\n\
|
|
4
|
+
export declare const MANAGE_ATTACK_SCENARIO_DESCRIPTION = "Create, update, or delete an attack scenario in a threat model.\n\nWhen to use (plain English): call this when the user describes a security worry, \"what if\" question, or specific failure mode. Common phrasings:\n- \"what if <bad thing happens>\"\n- \"could someone <attack action>\"\n- \"I'm worried about <X> being abused / leaked / hacked\"\n- \"how would an attacker <do X>\"\n- \"is <Y> safe from <Z>\"\n- mentions of: prompt injection, jailbreak, data exfiltration, privilege escalation, account takeover, supply chain, abuse\n\nBefore creating a scenario, the threat model needs at least one entry_point component (where the attack starts) and a target component (where the attacker wants to go). If either is missing, model components first.\n\nThe narrative should be a 2\u20135 sentence story: who attacks, where they enter, what they exploit, what they achieve. Don't write a textbook chapter.\n\n\nActions:\n- create: Add a new scenario (requires title, narrative, entry_point_id, target_id)\n- update: Update scenario status/notes (requires scenario_id)\n- delete: Remove a scenario (requires scenario_id)";
|
|
10
5
|
export declare const MANAGE_ATTACK_SCENARIO_SCHEMA: {
|
|
11
6
|
threat_model_id: z.ZodString;
|
|
12
7
|
action: z.ZodEnum<{
|
|
@@ -1,14 +1,20 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* zivis_manage_attack_scenario — Create, update, or delete attack scenarios
|
|
3
|
-
*
|
|
4
|
-
* Maps to: POST/PATCH/DELETE /api/threat-models/:id/attack-scenarios
|
|
5
|
-
*/
|
|
6
1
|
import { z } from "zod";
|
|
7
2
|
import { sanitizeResponse } from "../../sanitize.js";
|
|
8
3
|
export const MANAGE_ATTACK_SCENARIO_NAME = "zivis_manage_attack_scenario";
|
|
9
4
|
export const MANAGE_ATTACK_SCENARIO_DESCRIPTION = `Create, update, or delete an attack scenario in a threat model.
|
|
10
5
|
|
|
11
|
-
|
|
6
|
+
When to use (plain English): call this when the user describes a security worry, "what if" question, or specific failure mode. Common phrasings:
|
|
7
|
+
- "what if <bad thing happens>"
|
|
8
|
+
- "could someone <attack action>"
|
|
9
|
+
- "I'm worried about <X> being abused / leaked / hacked"
|
|
10
|
+
- "how would an attacker <do X>"
|
|
11
|
+
- "is <Y> safe from <Z>"
|
|
12
|
+
- mentions of: prompt injection, jailbreak, data exfiltration, privilege escalation, account takeover, supply chain, abuse
|
|
13
|
+
|
|
14
|
+
Before creating a scenario, the threat model needs at least one entry_point component (where the attack starts) and a target component (where the attacker wants to go). If either is missing, model components first.
|
|
15
|
+
|
|
16
|
+
The narrative should be a 2–5 sentence story: who attacks, where they enter, what they exploit, what they achieve. Don't write a textbook chapter.
|
|
17
|
+
|
|
12
18
|
|
|
13
19
|
Actions:
|
|
14
20
|
- create: Add a new scenario (requires title, narrative, entry_point_id, target_id)
|
|
@@ -86,4 +92,3 @@ export function createManageAttackScenarioHandler(apiClient) {
|
|
|
86
92
|
}
|
|
87
93
|
};
|
|
88
94
|
}
|
|
89
|
-
//# sourceMappingURL=manage-attack-scenario.js.map
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* zivis_manage_data_asset — Create, update, or delete data assets
|
|
3
|
-
*
|
|
4
|
-
* Maps to: POST/PATCH/DELETE /api/threat-models/:id/data-assets
|
|
5
|
-
*/
|
|
6
1
|
import { z } from "zod";
|
|
7
2
|
import type { ApiClient } from "../../api-client.js";
|
|
8
3
|
export declare const MANAGE_DATA_ASSET_NAME = "zivis_manage_data_asset";
|
|
9
|
-
export declare const MANAGE_DATA_ASSET_DESCRIPTION = "Create, update, or delete a data asset in a threat model.\n\
|
|
4
|
+
export declare const MANAGE_DATA_ASSET_DESCRIPTION = "Create, update, or delete a data asset in a threat model.\n\nWhen to use (plain English): call this when the user names something the app stores or processes. Common phrasings:\n- \"we store <PII / credit card / passwords / session tokens / api keys / audit logs>\"\n- \"the <user / customer / patient> data is in <storage>\"\n- \"we keep <emails / phone numbers / SSN / addresses>\"\n- \"<asset> is encrypted at rest\" \u2014 model the asset, then a security control on top of it\n- \"we hold cardholder data\" / \"we handle payment cards\" \u2192 classification=restricted, data_type=payment_data\n\nPick classification:\n- public \u2014 anyone can see (marketing copy)\n- internal \u2014 employees only (org chart, internal docs)\n- confidential \u2014 PII, business confidential\n- restricted \u2014 payment data, health records, anything regulated\n- critical \u2014 credentials, secrets, root keys, anything an attacker would target first\n\n\nAfter create: ask which components store, process, or transmit this asset so coverage can be linked. If the asset is sensitive (confidential or higher) and no security control covers it, surface that gap.\n\nActions:\n- create: Add a new data asset (requires name, classification)\n- update: Modify an existing data asset (requires asset_id)\n- delete: Remove a data asset (requires asset_id)";
|
|
10
5
|
export declare const MANAGE_DATA_ASSET_SCHEMA: {
|
|
11
6
|
threat_model_id: z.ZodString;
|
|
12
7
|
action: z.ZodEnum<{
|
|
@@ -18,8 +13,8 @@ export declare const MANAGE_DATA_ASSET_SCHEMA: {
|
|
|
18
13
|
name: z.ZodOptional<z.ZodString>;
|
|
19
14
|
classification: z.ZodOptional<z.ZodEnum<{
|
|
20
15
|
critical: "critical";
|
|
21
|
-
internal: "internal";
|
|
22
16
|
public: "public";
|
|
17
|
+
internal: "internal";
|
|
23
18
|
confidential: "confidential";
|
|
24
19
|
restricted: "restricted";
|
|
25
20
|
}>>;
|
|
@@ -1,14 +1,24 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* zivis_manage_data_asset — Create, update, or delete data assets
|
|
3
|
-
*
|
|
4
|
-
* Maps to: POST/PATCH/DELETE /api/threat-models/:id/data-assets
|
|
5
|
-
*/
|
|
6
1
|
import { z } from "zod";
|
|
7
2
|
import { sanitizeResponse } from "../../sanitize.js";
|
|
8
3
|
export const MANAGE_DATA_ASSET_NAME = "zivis_manage_data_asset";
|
|
9
4
|
export const MANAGE_DATA_ASSET_DESCRIPTION = `Create, update, or delete a data asset in a threat model.
|
|
10
5
|
|
|
11
|
-
|
|
6
|
+
When to use (plain English): call this when the user names something the app stores or processes. Common phrasings:
|
|
7
|
+
- "we store <PII / credit card / passwords / session tokens / api keys / audit logs>"
|
|
8
|
+
- "the <user / customer / patient> data is in <storage>"
|
|
9
|
+
- "we keep <emails / phone numbers / SSN / addresses>"
|
|
10
|
+
- "<asset> is encrypted at rest" — model the asset, then a security control on top of it
|
|
11
|
+
- "we hold cardholder data" / "we handle payment cards" → classification=restricted, data_type=payment_data
|
|
12
|
+
|
|
13
|
+
Pick classification:
|
|
14
|
+
- public — anyone can see (marketing copy)
|
|
15
|
+
- internal — employees only (org chart, internal docs)
|
|
16
|
+
- confidential — PII, business confidential
|
|
17
|
+
- restricted — payment data, health records, anything regulated
|
|
18
|
+
- critical — credentials, secrets, root keys, anything an attacker would target first
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
After create: ask which components store, process, or transmit this asset so coverage can be linked. If the asset is sensitive (confidential or higher) and no security control covers it, surface that gap.
|
|
12
22
|
|
|
13
23
|
Actions:
|
|
14
24
|
- create: Add a new data asset (requires name, classification)
|
|
@@ -87,4 +97,3 @@ export function createManageDataAssetHandler(apiClient) {
|
|
|
87
97
|
}
|
|
88
98
|
};
|
|
89
99
|
}
|
|
90
|
-
//# sourceMappingURL=manage-data-asset.js.map
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* zivis_manage_security_control — Create, update, or delete security controls
|
|
3
|
-
*
|
|
4
|
-
* Maps to: POST/PATCH/DELETE /api/threat-models/:id/security-controls
|
|
5
|
-
*/
|
|
6
1
|
import { z } from "zod";
|
|
7
2
|
import type { ApiClient } from "../../api-client.js";
|
|
8
3
|
export declare const MANAGE_SECURITY_CONTROL_NAME = "zivis_manage_security_control";
|
|
9
|
-
export declare const MANAGE_SECURITY_CONTROL_DESCRIPTION = "Create, update, or delete a security control in a threat model.\n\
|
|
4
|
+
export declare const MANAGE_SECURITY_CONTROL_DESCRIPTION = "Create, update, or delete a security control in a threat model.\n\nWhen to use (plain English): call this when the user mentions a protective mechanism that's in place (or planned). Common phrasings:\n- \"we have <rate limiting / WAF / firewall / MFA / 2FA / encryption>\"\n- \"we sanitize / validate <inputs>\"\n- \"we encrypt <X> at rest / in transit\"\n- \"we audit log all <Y>\"\n- \"<Z> is behind auth / behind a VPN\"\n- \"we use TLS for everything\"\n\nPick control_type:\n- preventive \u2014 stops the threat before it happens (input validation, rate limiting, encryption, MFA)\n- detective \u2014 notices when something bad happens (audit logging, monitoring, alerts, anomaly detection)\n- responsive \u2014 reacts to a known incident (auto-block, key rotation, account lockout)\n\nSet component_id when the control applies to one specific component. Leave it blank for org-wide controls (e.g., \"we use a WAF in front of everything\").\n\n\nAfter create: if a sensitive data asset (PII / payment / credentials) exists with no controls covering it, that's a high-priority gap \u2014 flag it.\n\nActions:\n- create: Add a new control (requires name, control_type)\n- update: Modify an existing control (requires control_id)\n- delete: Remove a control (requires control_id)";
|
|
10
5
|
export declare const MANAGE_SECURITY_CONTROL_SCHEMA: {
|
|
11
6
|
threat_model_id: z.ZodString;
|
|
12
7
|
action: z.ZodEnum<{
|
|
@@ -1,14 +1,25 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* zivis_manage_security_control — Create, update, or delete security controls
|
|
3
|
-
*
|
|
4
|
-
* Maps to: POST/PATCH/DELETE /api/threat-models/:id/security-controls
|
|
5
|
-
*/
|
|
6
1
|
import { z } from "zod";
|
|
7
2
|
import { sanitizeResponse } from "../../sanitize.js";
|
|
8
3
|
export const MANAGE_SECURITY_CONTROL_NAME = "zivis_manage_security_control";
|
|
9
4
|
export const MANAGE_SECURITY_CONTROL_DESCRIPTION = `Create, update, or delete a security control in a threat model.
|
|
10
5
|
|
|
11
|
-
|
|
6
|
+
When to use (plain English): call this when the user mentions a protective mechanism that's in place (or planned). Common phrasings:
|
|
7
|
+
- "we have <rate limiting / WAF / firewall / MFA / 2FA / encryption>"
|
|
8
|
+
- "we sanitize / validate <inputs>"
|
|
9
|
+
- "we encrypt <X> at rest / in transit"
|
|
10
|
+
- "we audit log all <Y>"
|
|
11
|
+
- "<Z> is behind auth / behind a VPN"
|
|
12
|
+
- "we use TLS for everything"
|
|
13
|
+
|
|
14
|
+
Pick control_type:
|
|
15
|
+
- preventive — stops the threat before it happens (input validation, rate limiting, encryption, MFA)
|
|
16
|
+
- detective — notices when something bad happens (audit logging, monitoring, alerts, anomaly detection)
|
|
17
|
+
- responsive — reacts to a known incident (auto-block, key rotation, account lockout)
|
|
18
|
+
|
|
19
|
+
Set component_id when the control applies to one specific component. Leave it blank for org-wide controls (e.g., "we use a WAF in front of everything").
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
After create: if a sensitive data asset (PII / payment / credentials) exists with no controls covering it, that's a high-priority gap — flag it.
|
|
12
23
|
|
|
13
24
|
Actions:
|
|
14
25
|
- create: Add a new control (requires name, control_type)
|
|
@@ -93,4 +104,3 @@ export function createManageSecurityControlHandler(apiClient) {
|
|
|
93
104
|
}
|
|
94
105
|
};
|
|
95
106
|
}
|
|
96
|
-
//# sourceMappingURL=manage-security-control.js.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { ApiClient } from "../api-client.js";
|
|
3
|
+
export declare const EXPLAIN_SIGNAL_FOR_DIFF_NAME = "zivis_explain_signal_for_my_diff";
|
|
4
|
+
export declare const EXPLAIN_SIGNAL_FOR_DIFF_DESCRIPTION = "Check whether your proposed change would affect a specific SIGNAL.\n\nYou have a SIGNAL flagged in your application's threat model. You're about to make a code change that may or may not address it. Use this tool to see whether your diff touches the files that triggered the signal \u2014 and a heuristic verdict on impact.\n\nReturns:\n - all_evidence_files \u2014 every file the signal cites\n - evidence_files_in_diff \u2014 the subset that your proposed change touches\n - verdict: \"may_resolve\" | \"may_persist\" | \"no_impact\"\n\nThe verdict is a heuristic (file overlap), not a guarantee. Run zivis_review_change for the broader picture, or push and let the canonical extraction confirm.";
|
|
5
|
+
export declare const EXPLAIN_SIGNAL_FOR_DIFF_SCHEMA: {
|
|
6
|
+
application_id: z.ZodOptional<z.ZodString>;
|
|
7
|
+
signal_id: z.ZodString;
|
|
8
|
+
changes: z.ZodArray<z.ZodObject<{
|
|
9
|
+
file_path: z.ZodString;
|
|
10
|
+
after_content: z.ZodOptional<z.ZodString>;
|
|
11
|
+
before_content: z.ZodOptional<z.ZodString>;
|
|
12
|
+
}, z.core.$strip>>;
|
|
13
|
+
};
|
|
14
|
+
export declare function createExplainSignalForDiffHandler(apiClient: ApiClient): (params: {
|
|
15
|
+
application_id?: string;
|
|
16
|
+
signal_id: string;
|
|
17
|
+
changes: Array<{
|
|
18
|
+
file_path: string;
|
|
19
|
+
before_content?: string;
|
|
20
|
+
after_content?: string;
|
|
21
|
+
}>;
|
|
22
|
+
}) => Promise<{
|
|
23
|
+
content: {
|
|
24
|
+
type: "text";
|
|
25
|
+
text: string;
|
|
26
|
+
}[];
|
|
27
|
+
isError: boolean;
|
|
28
|
+
} | {
|
|
29
|
+
content: {
|
|
30
|
+
type: "text";
|
|
31
|
+
text: string;
|
|
32
|
+
}[];
|
|
33
|
+
isError?: undefined;
|
|
34
|
+
}>;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { requireApplicationId } from "../resolve-application-id.js";
|
|
3
|
+
import { sanitizeResponse } from "../sanitize.js";
|
|
4
|
+
export const EXPLAIN_SIGNAL_FOR_DIFF_NAME = "zivis_explain_signal_for_my_diff";
|
|
5
|
+
export const EXPLAIN_SIGNAL_FOR_DIFF_DESCRIPTION = `Check whether your proposed change would affect a specific SIGNAL.
|
|
6
|
+
|
|
7
|
+
You have a SIGNAL flagged in your application's threat model. You're about to make a code change that may or may not address it. Use this tool to see whether your diff touches the files that triggered the signal — and a heuristic verdict on impact.
|
|
8
|
+
|
|
9
|
+
Returns:
|
|
10
|
+
- all_evidence_files — every file the signal cites
|
|
11
|
+
- evidence_files_in_diff — the subset that your proposed change touches
|
|
12
|
+
- verdict: "may_resolve" | "may_persist" | "no_impact"
|
|
13
|
+
|
|
14
|
+
The verdict is a heuristic (file overlap), not a guarantee. Run zivis_review_change for the broader picture, or push and let the canonical extraction confirm.`;
|
|
15
|
+
export const EXPLAIN_SIGNAL_FOR_DIFF_SCHEMA = {
|
|
16
|
+
application_id: z
|
|
17
|
+
.string()
|
|
18
|
+
.optional()
|
|
19
|
+
.describe("Application UUID. If omitted, uses applicationId from .zivis/project.json."),
|
|
20
|
+
signal_id: z.string().describe("Signal logical id (from zivis_list_signals)"),
|
|
21
|
+
changes: z
|
|
22
|
+
.array(z.object({
|
|
23
|
+
file_path: z.string(),
|
|
24
|
+
after_content: z.string().optional(),
|
|
25
|
+
before_content: z.string().optional(),
|
|
26
|
+
}))
|
|
27
|
+
.min(1)
|
|
28
|
+
.describe("Proposed changes"),
|
|
29
|
+
};
|
|
30
|
+
export function createExplainSignalForDiffHandler(apiClient) {
|
|
31
|
+
return async (params) => {
|
|
32
|
+
const req = requireApplicationId(params.application_id);
|
|
33
|
+
if (!req.ok) {
|
|
34
|
+
return {
|
|
35
|
+
content: [{ type: "text", text: `Error: ${req.message}` }],
|
|
36
|
+
isError: true,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
const application_id = req.id;
|
|
40
|
+
try {
|
|
41
|
+
const data = await apiClient.post(`/api/apps/${application_id}/signals/${params.signal_id}/explain-for-diff`, {
|
|
42
|
+
changes: params.changes.map((c) => ({
|
|
43
|
+
filePath: c.file_path,
|
|
44
|
+
beforeContent: c.before_content,
|
|
45
|
+
afterContent: c.after_content,
|
|
46
|
+
})),
|
|
47
|
+
});
|
|
48
|
+
const result = {
|
|
49
|
+
application_id: data.applicationId,
|
|
50
|
+
signal_id: data.signalLogicalId,
|
|
51
|
+
title: data.title,
|
|
52
|
+
severity: data.severity,
|
|
53
|
+
verdict: data.verdict,
|
|
54
|
+
evidence_files_in_diff: data.evidenceFilesInDiff,
|
|
55
|
+
all_evidence_files: data.allEvidenceFiles,
|
|
56
|
+
caveats: data.caveats,
|
|
57
|
+
};
|
|
58
|
+
return {
|
|
59
|
+
content: [
|
|
60
|
+
{
|
|
61
|
+
type: "text",
|
|
62
|
+
text: JSON.stringify(sanitizeResponse(result), null, 2),
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
catch (err) {
|
|
68
|
+
const message = err instanceof Error ? err.message : "Failed to explain signal for diff";
|
|
69
|
+
return {
|
|
70
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
71
|
+
isError: true,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
}
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MCP Tool: Generate Diagram from Infrastructure Source
|
|
3
|
-
*
|
|
4
|
-
* Reads a local docker-compose file and sends it to the ZIVIS API
|
|
5
|
-
* for server-side parsing and canvas diagram generation.
|
|
6
|
-
*/
|
|
7
1
|
import { z } from "zod";
|
|
8
2
|
import type { ApiClient } from "../api-client.js";
|
|
9
3
|
export declare const GENERATE_DIAGRAM_NAME = "zivis_generate_diagram";
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MCP Tool: Generate Diagram from Infrastructure Source
|
|
3
|
-
*
|
|
4
|
-
* Reads a local docker-compose file and sends it to the ZIVIS API
|
|
5
|
-
* for server-side parsing and canvas diagram generation.
|
|
6
|
-
*/
|
|
7
1
|
import { z } from "zod";
|
|
8
2
|
import { readFile } from "fs/promises";
|
|
9
|
-
import { join } from "path";
|
|
3
|
+
import { join, relative, resolve } from "path";
|
|
10
4
|
import { sanitizeResponse } from "../sanitize.js";
|
|
5
|
+
function resolveWithinProjectDir(projectDir, candidate) {
|
|
6
|
+
const base = resolve(projectDir);
|
|
7
|
+
const target = resolve(base, candidate);
|
|
8
|
+
const rel = relative(base, target);
|
|
9
|
+
if (rel.startsWith(".."))
|
|
10
|
+
return null;
|
|
11
|
+
return target;
|
|
12
|
+
}
|
|
11
13
|
export const GENERATE_DIAGRAM_NAME = "zivis_generate_diagram";
|
|
12
14
|
export const GENERATE_DIAGRAM_DESCRIPTION = `Generate a visual architecture diagram from a Docker Compose file.
|
|
13
15
|
|
|
@@ -52,13 +54,21 @@ export function createGenerateDiagramHandler(apiClient) {
|
|
|
52
54
|
return async (params) => {
|
|
53
55
|
const projectDir = params.project_dir || process.cwd();
|
|
54
56
|
const sourceFormat = params.source_format || "docker-compose";
|
|
55
|
-
// Find and read the compose file
|
|
56
57
|
let filePath = params.file_path;
|
|
57
58
|
let content = null;
|
|
58
59
|
if (filePath) {
|
|
59
|
-
const resolved = filePath
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
const resolved = resolveWithinProjectDir(projectDir, filePath);
|
|
61
|
+
if (!resolved) {
|
|
62
|
+
return {
|
|
63
|
+
content: [
|
|
64
|
+
{
|
|
65
|
+
type: "text",
|
|
66
|
+
text: `Error: file_path must resolve inside project_dir (got: ${filePath})`,
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
isError: true,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
62
72
|
try {
|
|
63
73
|
content = await readFile(resolved, "utf-8");
|
|
64
74
|
}
|
|
@@ -82,7 +92,6 @@ export function createGenerateDiagramHandler(apiClient) {
|
|
|
82
92
|
break;
|
|
83
93
|
}
|
|
84
94
|
catch {
|
|
85
|
-
/* continue */
|
|
86
95
|
}
|
|
87
96
|
}
|
|
88
97
|
if (!content) {
|
|
@@ -150,4 +159,3 @@ export function createGenerateDiagramHandler(apiClient) {
|
|
|
150
159
|
}
|
|
151
160
|
};
|
|
152
161
|
}
|
|
153
|
-
//# sourceMappingURL=generate-diagram.js.map
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* zivis_get_application_overview — Rich application context with endpoints & threat model
|
|
3
|
-
*
|
|
4
|
-
* Maps to: GET /api/rt/applications/:id/overview
|
|
5
|
-
*/
|
|
6
1
|
import { z } from "zod";
|
|
7
2
|
import type { ApiClient } from "../api-client.js";
|
|
8
3
|
export declare const GET_APPLICATION_OVERVIEW_NAME = "zivis_get_application_overview";
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* zivis_get_application_overview — Rich application context with endpoints & threat model
|
|
3
|
-
*
|
|
4
|
-
* Maps to: GET /api/rt/applications/:id/overview
|
|
5
|
-
*/
|
|
6
1
|
import { z } from "zod";
|
|
7
2
|
import { requireApplicationId } from "../resolve-application-id.js";
|
|
8
3
|
import { sanitizeResponse } from "../sanitize.js";
|
|
@@ -140,4 +135,3 @@ export function createGetApplicationOverviewHandler(apiClient) {
|
|
|
140
135
|
}
|
|
141
136
|
};
|
|
142
137
|
}
|
|
143
|
-
//# sourceMappingURL=get-application-overview.js.map
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* zivis_get_application — Get details of a specific application
|
|
3
|
-
*
|
|
4
|
-
* Maps to: GET /api/rt/applications/:id
|
|
5
|
-
*/
|
|
6
1
|
import { z } from "zod";
|
|
7
2
|
import type { ApiClient } from "../api-client.js";
|
|
8
3
|
export declare const GET_APPLICATION_NAME = "zivis_get_application";
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* zivis_get_application — Get details of a specific application
|
|
3
|
-
*
|
|
4
|
-
* Maps to: GET /api/rt/applications/:id
|
|
5
|
-
*/
|
|
6
1
|
import { z } from "zod";
|
|
7
2
|
import { requireApplicationId } from "../resolve-application-id.js";
|
|
8
3
|
import { sanitizeResponse } from "../sanitize.js";
|
|
@@ -80,4 +75,3 @@ export function createGetApplicationHandler(apiClient) {
|
|
|
80
75
|
}
|
|
81
76
|
};
|
|
82
77
|
}
|
|
83
|
-
//# sourceMappingURL=get-application.js.map
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* zivis_get_diagram — Get full diagram content
|
|
3
|
-
*
|
|
4
|
-
* Maps to: GET /api/diagrams/:id
|
|
5
|
-
*/
|
|
6
1
|
import { z } from "zod";
|
|
7
2
|
import { sanitizeResponse } from "../sanitize.js";
|
|
8
3
|
export const GET_DIAGRAM_NAME = "zivis_get_diagram";
|
|
@@ -23,7 +18,6 @@ export function createGetDiagramHandler(apiClient) {
|
|
|
23
18
|
try {
|
|
24
19
|
const data = await apiClient.get(`/api/diagrams/${params.diagram_id}`);
|
|
25
20
|
const sanitized = sanitizeResponse(data);
|
|
26
|
-
// Format nodes with clear structure
|
|
27
21
|
const nodes = Array.isArray(sanitized.nodes)
|
|
28
22
|
? sanitized.nodes.map((n) => ({
|
|
29
23
|
node_id: n.id,
|
|
@@ -43,7 +37,6 @@ export function createGetDiagramHandler(apiClient) {
|
|
|
43
37
|
linked_evidence_ids: n.linkedEvidenceIds || [],
|
|
44
38
|
}))
|
|
45
39
|
: [];
|
|
46
|
-
// Format connections
|
|
47
40
|
const connections = Array.isArray(sanitized.connections)
|
|
48
41
|
? sanitized.connections.map((c) => ({
|
|
49
42
|
connection_id: c.id,
|
|
@@ -56,7 +49,6 @@ export function createGetDiagramHandler(apiClient) {
|
|
|
56
49
|
metadata: c.metadata || null,
|
|
57
50
|
}))
|
|
58
51
|
: [];
|
|
59
|
-
// Format boundaries
|
|
60
52
|
const boundaries = Array.isArray(sanitized.boundaries)
|
|
61
53
|
? sanitized.boundaries.map((b) => ({
|
|
62
54
|
boundary_id: b.id,
|
|
@@ -69,7 +61,6 @@ export function createGetDiagramHandler(apiClient) {
|
|
|
69
61
|
height: b.height,
|
|
70
62
|
}))
|
|
71
63
|
: [];
|
|
72
|
-
// Extract linked entity IDs
|
|
73
64
|
const linkedThreatModelIds = Array.isArray(sanitized.threatModelLinks)
|
|
74
65
|
? sanitized.threatModelLinks.map((l) => l.threatModelId)
|
|
75
66
|
: [];
|
|
@@ -79,7 +70,7 @@ export function createGetDiagramHandler(apiClient) {
|
|
|
79
70
|
description: sanitized.description || null,
|
|
80
71
|
diagram_type: sanitized.diagramType,
|
|
81
72
|
content_type: sanitized.contentType,
|
|
82
|
-
content: sanitized.content || null,
|
|
73
|
+
content: sanitized.content || null,
|
|
83
74
|
source_type: sanitized.sourceType,
|
|
84
75
|
created_at: sanitized.createdAt,
|
|
85
76
|
updated_at: sanitized.updatedAt,
|
|
@@ -106,4 +97,3 @@ export function createGetDiagramHandler(apiClient) {
|
|
|
106
97
|
}
|
|
107
98
|
};
|
|
108
99
|
}
|
|
109
|
-
//# sourceMappingURL=get-diagram.js.map
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* zivis_get_document — Fetch a document by ID, including its full markdown content.
|
|
3
|
-
*
|
|
4
|
-
* Maps to: GET /api/documents/:id
|
|
5
|
-
*/
|
|
6
1
|
import { z } from "zod";
|
|
7
2
|
import type { ApiClient } from "../api-client.js";
|
|
8
3
|
export declare const GET_DOCUMENT_NAME = "zivis_get_document";
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* zivis_get_document — Fetch a document by ID, including its full markdown content.
|
|
3
|
-
*
|
|
4
|
-
* Maps to: GET /api/documents/:id
|
|
5
|
-
*/
|
|
6
1
|
import { z } from "zod";
|
|
7
2
|
import { sanitizeResponse } from "../sanitize.js";
|
|
8
3
|
export const GET_DOCUMENT_NAME = "zivis_get_document";
|
|
@@ -40,4 +35,3 @@ export function createGetDocumentHandler(apiClient) {
|
|
|
40
35
|
}
|
|
41
36
|
};
|
|
42
37
|
}
|
|
43
|
-
//# sourceMappingURL=get-document.js.map
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* zivis_get_oss_zat — Get the signed attestation token (ZAT) for a GitHub repo
|
|
3
|
-
*
|
|
4
|
-
* Maps to: GET /api/oss-trust/repos/:owner/:repo/zat (public, no auth required)
|
|
5
|
-
*/
|
|
6
1
|
import { z } from "zod";
|
|
7
2
|
import type { ZivisConfig } from "../types.js";
|
|
8
3
|
export declare const GET_OSS_ZAT_NAME = "zivis_get_oss_zat";
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* zivis_get_oss_zat — Get the signed attestation token (ZAT) for a GitHub repo
|
|
3
|
-
*
|
|
4
|
-
* Maps to: GET /api/oss-trust/repos/:owner/:repo/zat (public, no auth required)
|
|
5
|
-
*/
|
|
6
1
|
import { z } from "zod";
|
|
7
2
|
export const GET_OSS_ZAT_NAME = "zivis_get_oss_zat";
|
|
8
3
|
export const GET_OSS_ZAT_DESCRIPTION = `Get the ZIVIS Attestation Token (ZAT) for a GitHub repository — a cryptographically signed, machine-verifiable supply chain credential.
|
|
@@ -32,7 +27,6 @@ export const GET_OSS_ZAT_SCHEMA = {
|
|
|
32
27
|
.string()
|
|
33
28
|
.describe("GitHub repo URL (https://github.com/owner/repo) or owner/repo string"),
|
|
34
29
|
};
|
|
35
|
-
/** Parse GitHub URL or owner/repo into components */
|
|
36
30
|
function parseRepo(input) {
|
|
37
31
|
const trimmed = input.trim();
|
|
38
32
|
const urlMatch = trimmed.match(/^https?:\/\/(?:www\.)?github\.com\/([a-zA-Z0-9._-]+)\/([a-zA-Z0-9._-]+)/);
|
|
@@ -102,4 +96,3 @@ export function createGetOssZatHandler(config) {
|
|
|
102
96
|
}
|
|
103
97
|
};
|
|
104
98
|
}
|
|
105
|
-
//# sourceMappingURL=get-oss-zat.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { ApiClient } from "../api-client.js";
|
|
3
|
+
export declare const GET_SIGNAL_NAME = "zivis_get_signal";
|
|
4
|
+
export declare const GET_SIGNAL_DESCRIPTION = "Get full detail on a single Signal by its id.\n\nReturns the qualified narrative \u2014 description, mitigation, attack-chain context, taxonomy (STRIDE / ATPS layer / MITRE / OWASP / compliance mappings), detected safeguards and what breaks them, and the polymorphic source-artifact reference for drilling into the native subsystem.\n\nPass `signal_id` from a `zivis_list_signals` response.\n\nSECURITY: Display-shaped output only. No raw graph data.";
|
|
5
|
+
export declare const GET_SIGNAL_SCHEMA: {
|
|
6
|
+
application_id: z.ZodOptional<z.ZodString>;
|
|
7
|
+
signal_id: z.ZodString;
|
|
8
|
+
};
|
|
9
|
+
export declare function createGetSignalHandler(apiClient: ApiClient): (params: {
|
|
10
|
+
application_id?: string;
|
|
11
|
+
signal_id: string;
|
|
12
|
+
}) => Promise<{
|
|
13
|
+
content: {
|
|
14
|
+
type: "text";
|
|
15
|
+
text: string;
|
|
16
|
+
}[];
|
|
17
|
+
isError: boolean;
|
|
18
|
+
} | {
|
|
19
|
+
content: {
|
|
20
|
+
type: "text";
|
|
21
|
+
text: string;
|
|
22
|
+
}[];
|
|
23
|
+
isError?: undefined;
|
|
24
|
+
}>;
|