@zivis/mcp 0.1.0-alpha.26 → 0.1.0-alpha.3
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/api-client.d.ts +24 -1
- package/dist/api-client.js +52 -29
- package/dist/api-client.js.map +1 -0
- package/dist/auth/index.d.ts +22 -1
- package/dist/auth/index.js +38 -17
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/jwt.d.ts +16 -0
- package/dist/auth/jwt.js +13 -0
- package/dist/auth/jwt.js.map +1 -0
- package/dist/auth/keychain.d.ts +32 -6
- package/dist/auth/keychain.js +114 -83
- package/dist/auth/keychain.js.map +1 -0
- package/dist/auth/oauth.d.ts +37 -2
- package/dist/auth/oauth.js +48 -38
- package/dist/auth/oauth.js.map +1 -0
- package/dist/auth/sessions.d.ts +25 -5
- package/dist/auth/sessions.js +39 -20
- package/dist/auth/sessions.js.map +1 -0
- package/dist/auth/token-refresh.d.ts +22 -2
- package/dist/auth/token-refresh.js +35 -32
- package/dist/auth/token-refresh.js.map +1 -0
- package/dist/cli.d.ts +18 -1
- package/dist/cli.js +908 -30
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/project-binding.d.ts +19 -2
- package/dist/project-binding.js +21 -38
- package/dist/project-binding.js.map +1 -0
- package/dist/resolve-application-id.d.ts +4 -0
- package/dist/resolve-application-id.js +5 -0
- package/dist/resolve-application-id.js.map +1 -0
- package/dist/sanitize.d.ts +21 -0
- package/dist/sanitize.js +41 -0
- package/dist/sanitize.js.map +1 -0
- package/dist/server.d.ts +13 -1
- package/dist/server.js +247 -122
- package/dist/server.js.map +1 -0
- package/dist/tools/check-project.d.ts +18 -5
- package/dist/tools/check-project.js +110 -122
- package/dist/tools/check-project.js.map +1 -0
- package/dist/tools/check-repo-trust.d.ts +19 -4
- package/dist/tools/check-repo-trust.js +47 -56
- package/dist/tools/check-repo-trust.js.map +1 -0
- package/dist/tools/create-diagram.d.ts +5 -0
- package/dist/tools/create-diagram.js +10 -0
- package/dist/tools/create-diagram.js.map +1 -0
- package/dist/tools/create-document.d.ts +5 -0
- package/dist/tools/create-document.js +6 -0
- package/dist/tools/create-document.js.map +1 -0
- package/dist/tools/discover-local-infra.d.ts +10 -0
- package/dist/tools/discover-local-infra.js +73 -3
- package/dist/tools/discover-local-infra.js.map +1 -0
- package/dist/tools/enterprise/capture-evidence.d.ts +54 -0
- package/dist/tools/enterprise/capture-evidence.js +72 -0
- package/dist/tools/enterprise/capture-evidence.js.map +1 -0
- package/dist/tools/enterprise/create-report-ticket.d.ts +34 -0
- package/dist/tools/enterprise/create-report-ticket.js +44 -0
- package/dist/tools/enterprise/create-report-ticket.js.map +1 -0
- package/dist/tools/enterprise/end-pentest-session.d.ts +33 -0
- package/dist/tools/enterprise/end-pentest-session.js +42 -0
- package/dist/tools/enterprise/end-pentest-session.js.map +1 -0
- package/dist/tools/enterprise/generate-report.d.ts +55 -0
- package/dist/tools/enterprise/generate-report.js +111 -0
- package/dist/tools/enterprise/generate-report.js.map +1 -0
- package/dist/tools/enterprise/get-org-zat.d.ts +5 -0
- package/dist/tools/enterprise/get-org-zat.js +6 -0
- package/dist/tools/enterprise/get-org-zat.js.map +1 -0
- package/dist/tools/enterprise/get-report-status.d.ts +27 -0
- package/dist/tools/enterprise/get-report-status.js +38 -0
- package/dist/tools/enterprise/get-report-status.js.map +1 -0
- package/dist/tools/enterprise/get-threat-model.d.ts +6 -1
- package/dist/tools/enterprise/get-threat-model.js +17 -52
- package/dist/tools/enterprise/get-threat-model.js.map +1 -0
- package/dist/tools/enterprise/list-agents.d.ts +42 -0
- package/dist/tools/enterprise/list-agents.js +95 -0
- package/dist/tools/enterprise/list-agents.js.map +1 -0
- package/dist/tools/enterprise/list-report-issues.d.ts +36 -0
- package/dist/tools/enterprise/list-report-issues.js +50 -0
- package/dist/tools/enterprise/list-report-issues.js.map +1 -0
- package/dist/tools/enterprise/list-threat-models.d.ts +5 -0
- package/dist/tools/enterprise/list-threat-models.js +8 -0
- package/dist/tools/enterprise/list-threat-models.js.map +1 -0
- package/dist/tools/enterprise/manage-actor.d.ts +6 -1
- package/dist/tools/enterprise/manage-actor.js +7 -14
- package/dist/tools/enterprise/manage-actor.js.map +1 -0
- package/dist/tools/enterprise/manage-attack-scenario.d.ts +6 -1
- package/dist/tools/enterprise/manage-attack-scenario.js +7 -13
- package/dist/tools/enterprise/manage-attack-scenario.js.map +1 -0
- package/dist/tools/enterprise/manage-component.d.ts +6 -1
- package/dist/tools/enterprise/manage-component.js +7 -20
- package/dist/tools/enterprise/manage-component.js.map +1 -0
- package/dist/tools/enterprise/manage-data-asset.d.ts +7 -2
- package/dist/tools/enterprise/manage-data-asset.js +7 -17
- package/dist/tools/enterprise/manage-data-asset.js.map +1 -0
- package/dist/tools/enterprise/manage-data-flow.d.ts +7 -2
- package/dist/tools/enterprise/manage-data-flow.js +7 -19
- package/dist/tools/enterprise/manage-data-flow.js.map +1 -0
- package/dist/tools/enterprise/manage-finding.d.ts +69 -0
- package/dist/tools/enterprise/manage-finding.js +106 -0
- package/dist/tools/enterprise/manage-finding.js.map +1 -0
- package/dist/tools/enterprise/manage-security-control.d.ts +6 -1
- package/dist/tools/enterprise/manage-security-control.js +7 -18
- package/dist/tools/enterprise/manage-security-control.js.map +1 -0
- package/dist/tools/enterprise/manage-test-case.d.ts +7 -2
- package/dist/tools/enterprise/manage-test-case.js +6 -8
- package/dist/tools/enterprise/manage-test-case.js.map +1 -0
- package/dist/tools/enterprise/promote-finding-to-issue.d.ts +36 -0
- package/dist/tools/enterprise/promote-finding-to-issue.js +65 -0
- package/dist/tools/enterprise/promote-finding-to-issue.js.map +1 -0
- package/dist/tools/enterprise/publish-report-version.d.ts +34 -0
- package/dist/tools/enterprise/publish-report-version.js +75 -0
- package/dist/tools/enterprise/publish-report-version.js.map +1 -0
- package/dist/tools/enterprise/publish-test-to-library.d.ts +31 -0
- package/dist/tools/enterprise/publish-test-to-library.js +40 -0
- package/dist/tools/enterprise/publish-test-to-library.js.map +1 -0
- package/dist/tools/enterprise/record-test-result.d.ts +67 -0
- package/dist/tools/enterprise/record-test-result.js +75 -0
- package/dist/tools/enterprise/record-test-result.js.map +1 -0
- package/dist/tools/enterprise/start-pentest-session.d.ts +35 -0
- package/dist/tools/enterprise/start-pentest-session.js +50 -0
- package/dist/tools/enterprise/start-pentest-session.js.map +1 -0
- package/dist/tools/enterprise/sync-report-section.d.ts +41 -0
- package/dist/tools/enterprise/sync-report-section.js +79 -0
- package/dist/tools/enterprise/sync-report-section.js.map +1 -0
- package/dist/tools/enterprise/update-report-issue.d.ts +55 -0
- package/dist/tools/enterprise/update-report-issue.js +69 -0
- package/dist/tools/enterprise/update-report-issue.js.map +1 -0
- package/dist/tools/generate-diagram.d.ts +6 -0
- package/dist/tools/generate-diagram.js +9 -0
- package/dist/tools/generate-diagram.js.map +1 -0
- package/dist/tools/get-agent-test-results.d.ts +41 -0
- package/dist/tools/get-agent-test-results.js +86 -0
- package/dist/tools/get-agent-test-results.js.map +1 -0
- package/dist/tools/get-application-overview.d.ts +5 -0
- package/dist/tools/get-application-overview.js +6 -0
- package/dist/tools/get-application-overview.js.map +1 -0
- package/dist/tools/get-application.d.ts +5 -0
- package/dist/tools/get-application.js +6 -0
- package/dist/tools/get-application.js.map +1 -0
- package/dist/tools/get-artifact-content.d.ts +29 -0
- package/dist/tools/get-artifact-content.js +86 -0
- package/dist/tools/get-artifact-content.js.map +1 -0
- package/dist/tools/get-diagram.d.ts +5 -0
- package/dist/tools/get-diagram.js +11 -1
- package/dist/tools/get-diagram.js.map +1 -0
- package/dist/tools/get-document.d.ts +5 -0
- package/dist/tools/get-document.js +6 -0
- package/dist/tools/get-document.js.map +1 -0
- package/dist/tools/get-finding-details.d.ts +28 -0
- package/dist/tools/get-finding-details.js +43 -0
- package/dist/tools/get-finding-details.js.map +1 -0
- package/dist/tools/get-findings.d.ts +57 -0
- package/dist/tools/get-findings.js +103 -0
- package/dist/tools/get-findings.js.map +1 -0
- package/dist/tools/get-oss-zat.d.ts +5 -0
- package/dist/tools/get-oss-zat.js +7 -0
- package/dist/tools/get-oss-zat.js.map +1 -0
- package/dist/tools/get-recon-scan.d.ts +27 -0
- package/dist/tools/get-recon-scan.js +46 -0
- package/dist/tools/get-recon-scan.js.map +1 -0
- package/dist/tools/get-scan-output.d.ts +27 -0
- package/dist/tools/get-scan-output.js +64 -0
- package/dist/tools/get-scan-output.js.map +1 -0
- package/dist/tools/get-scenario-details.d.ts +27 -0
- package/dist/tools/get-scenario-details.js +46 -0
- package/dist/tools/get-scenario-details.js.map +1 -0
- package/dist/tools/get-test-case-results.d.ts +37 -0
- package/dist/tools/get-test-case-results.js +66 -0
- package/dist/tools/get-test-case-results.js.map +1 -0
- package/dist/tools/get-test-details.d.ts +29 -0
- package/dist/tools/get-test-details.js +49 -0
- package/dist/tools/get-test-details.js.map +1 -0
- package/dist/tools/get-trust-keys.d.ts +5 -0
- package/dist/tools/get-trust-keys.js +6 -0
- package/dist/tools/get-trust-keys.js.map +1 -0
- package/dist/tools/import-openapi-endpoints.d.ts +5 -0
- package/dist/tools/import-openapi-endpoints.js +6 -0
- package/dist/tools/import-openapi-endpoints.js.map +1 -0
- package/dist/tools/inspect-zat.d.ts +5 -0
- package/dist/tools/inspect-zat.js +19 -0
- package/dist/tools/inspect-zat.js.map +1 -0
- package/dist/tools/list-agent-test-cases.d.ts +41 -0
- package/dist/tools/list-agent-test-cases.js +73 -0
- package/dist/tools/list-agent-test-cases.js.map +1 -0
- package/dist/tools/list-applications.d.ts +6 -1
- package/dist/tools/list-applications.js +6 -0
- package/dist/tools/list-applications.js.map +1 -0
- package/dist/tools/list-diagrams.d.ts +5 -0
- package/dist/tools/list-diagrams.js +6 -0
- package/dist/tools/list-diagrams.js.map +1 -0
- package/dist/tools/list-documents.d.ts +5 -0
- package/dist/tools/list-documents.js +6 -0
- package/dist/tools/list-documents.js.map +1 -0
- package/dist/tools/list-endpoints.d.ts +5 -0
- package/dist/tools/list-endpoints.js +6 -0
- package/dist/tools/list-endpoints.js.map +1 -0
- package/dist/tools/list-recon-scans.d.ts +36 -0
- package/dist/tools/list-recon-scans.js +74 -0
- package/dist/tools/list-recon-scans.js.map +1 -0
- package/dist/tools/list-scan-artifacts.d.ts +41 -0
- package/dist/tools/list-scan-artifacts.js +63 -0
- package/dist/tools/list-scan-artifacts.js.map +1 -0
- package/dist/tools/list-scans.d.ts +44 -0
- package/dist/tools/list-scans.js +91 -0
- package/dist/tools/list-scans.js.map +1 -0
- package/dist/tools/list-test-library.d.ts +44 -0
- package/dist/tools/list-test-library.js +83 -0
- package/dist/tools/list-test-library.js.map +1 -0
- package/dist/tools/list-test-scenarios.d.ts +31 -0
- package/dist/tools/list-test-scenarios.js +66 -0
- package/dist/tools/list-test-scenarios.js.map +1 -0
- package/dist/tools/local-scan.d.ts +40 -0
- package/dist/tools/local-scan.js +261 -0
- package/dist/tools/local-scan.js.map +1 -0
- package/dist/tools/manage-diagram.d.ts +5 -0
- package/dist/tools/manage-diagram.js +16 -0
- package/dist/tools/manage-diagram.js.map +1 -0
- package/dist/tools/open-in-ide.d.ts +13 -1
- package/dist/tools/open-in-ide.js +13 -0
- package/dist/tools/open-in-ide.js.map +1 -0
- package/dist/tools/run-test-scenario.d.ts +37 -0
- package/dist/tools/run-test-scenario.js +70 -0
- package/dist/tools/run-test-scenario.js.map +1 -0
- package/dist/tools/scan-pr.d.ts +27 -0
- package/dist/tools/scan-pr.js +51 -0
- package/dist/tools/scan-pr.js.map +1 -0
- package/dist/tools/security-review.d.ts +16 -0
- package/dist/tools/security-review.js +77 -63
- package/dist/tools/security-review.js.map +1 -0
- package/dist/tools/setup-red-team-target.d.ts +79 -0
- package/dist/tools/setup-red-team-target.js +430 -0
- package/dist/tools/setup-red-team-target.js.map +1 -0
- package/dist/tools/triage-finding.d.ts +47 -0
- package/dist/tools/triage-finding.js +116 -0
- package/dist/tools/triage-finding.js.map +1 -0
- package/dist/tools/update-document.d.ts +5 -0
- package/dist/tools/update-document.js +6 -0
- package/dist/tools/update-document.js.map +1 -0
- package/dist/tools/update-endpoint.d.ts +5 -0
- package/dist/tools/update-endpoint.js +7 -0
- package/dist/tools/update-endpoint.js.map +1 -0
- package/dist/tools/update-mermaid-source.d.ts +13 -0
- package/dist/tools/update-mermaid-source.js +14 -0
- package/dist/tools/update-mermaid-source.js.map +1 -0
- package/dist/tools/verify-trust-mark.d.ts +5 -0
- package/dist/tools/verify-trust-mark.js +6 -0
- package/dist/tools/verify-trust-mark.js.map +1 -0
- package/dist/types.d.ts +14 -14
- package/dist/types.js +28 -22
- package/dist/types.js.map +1 -0
- package/package.json +4 -24
- package/LICENSE +0 -201
- package/README.md +0 -19
- package/dist/lib/inspect-cache.d.ts +0 -10
- package/dist/lib/inspect-cache.js +0 -75
- package/dist/lib/next-steps.d.ts +0 -27
- package/dist/lib/next-steps.js +0 -21
- package/dist/matcher/ast-eval.d.ts +0 -8
- package/dist/matcher/ast-eval.js +0 -95
- package/dist/matcher/finding.d.ts +0 -55
- package/dist/matcher/finding.js +0 -1
- package/dist/matcher/index.d.ts +0 -8
- package/dist/matcher/index.js +0 -202
- package/dist/matcher/inference-candidates.d.ts +0 -26
- package/dist/matcher/inference-candidates.js +0 -81
- package/dist/matcher/walker.d.ts +0 -7
- package/dist/matcher/walker.js +0 -71
- package/dist/pattern-pack/index.d.ts +0 -125
- package/dist/pattern-pack/index.js +0 -189
- package/dist/pattern-packs/zivis-public-0.2.0/capsules/agents/privilege-separation.yaml +0 -224
- package/dist/pattern-packs/zivis-public-0.2.0/capsules/prompting/self-consistency-no-isolation.yaml +0 -237
- package/dist/pattern-packs/zivis-public-0.2.0/capsules/retrieval/context-injection-no-validator.yaml +0 -348
- package/dist/pattern-packs/zivis-public-0.2.0/capsules/security/late-org-filter.yaml +0 -266
- package/dist/pattern-packs/zivis-public-0.2.0/controls/external_validator_on_facts.yaml +0 -37
- package/dist/pattern-packs/zivis-public-0.2.0/controls/fact_validator_present.yaml +0 -68
- package/dist/pattern-packs/zivis-public-0.2.0/controls/human_approval_gate.yaml +0 -44
- package/dist/pattern-packs/zivis-public-0.2.0/controls/langgraph_state_machine_with_per_node_tools.yaml +0 -35
- package/dist/pattern-packs/zivis-public-0.2.0/controls/per_sample_retrieval_diversification.yaml +0 -38
- package/dist/pattern-packs/zivis-public-0.2.0/controls/prisma_extension_or_middleware_attaching_org_filter.yaml +0 -31
- package/dist/pattern-packs/zivis-public-0.2.0/controls/row_level_security_policy.yaml +0 -37
- package/dist/pattern-packs/zivis-public-0.2.0/controls/source_attribution_present.yaml +0 -58
- package/dist/pattern-packs/zivis-public-0.2.0/manifest.json +0 -167
- package/dist/pattern-packs/zivis-public-0.2.0/prompts/agents/privilege-separation/identify.md +0 -54
- package/dist/pattern-packs/zivis-public-0.2.0/prompts/prompting/self-consistency-no-isolation/identify.md +0 -60
- package/dist/pattern-packs/zivis-public-0.2.0/prompts/retrieval/context-injection-no-validator/identify.md +0 -109
- package/dist/pattern-packs/zivis-public-0.2.0/prompts/security/late-org-filter/identify.md +0 -78
- package/dist/prompts/audit-dependencies.d.ts +0 -2
- package/dist/prompts/audit-dependencies.js +0 -47
- package/dist/prompts/getting-started.d.ts +0 -2
- package/dist/prompts/getting-started.js +0 -37
- package/dist/prompts/index.d.ts +0 -2
- package/dist/prompts/index.js +0 -6
- package/dist/tools/enterprise/get-threat-model-artifact.d.ts +0 -24
- package/dist/tools/enterprise/get-threat-model-artifact.js +0 -68
- package/dist/tools/enterprise/list-attack-scenarios.d.ts +0 -24
- package/dist/tools/enterprise/list-attack-scenarios.js +0 -63
- package/dist/tools/enterprise/list-attack-step-library-tests.d.ts +0 -24
- package/dist/tools/enterprise/list-attack-step-library-tests.js +0 -55
- package/dist/tools/enterprise/list-threat-model-artifacts.d.ts +0 -55
- package/dist/tools/enterprise/list-threat-model-artifacts.js +0 -108
- package/dist/tools/enterprise/list-threat-model-review-items.d.ts +0 -30
- package/dist/tools/enterprise/list-threat-model-review-items.js +0 -54
- package/dist/tools/enterprise/list-threat-model-versions.d.ts +0 -24
- package/dist/tools/enterprise/list-threat-model-versions.js +0 -54
- package/dist/tools/enterprise/manage-threat-model-analysis.d.ts +0 -44
- package/dist/tools/enterprise/manage-threat-model-analysis.js +0 -83
- package/dist/tools/enterprise/manage-threat-model-review.d.ts +0 -38
- package/dist/tools/enterprise/manage-threat-model-review.js +0 -72
- package/dist/tools/get-started.d.ts +0 -18
- package/dist/tools/get-started.js +0 -470
- package/dist/tools/inspect.d.ts +0 -21
- package/dist/tools/inspect.js +0 -222
- package/dist/tools/manage-application.d.ts +0 -64
- package/dist/tools/manage-application.js +0 -129
- package/dist/tools/manage-endpoint-lifecycle.d.ts +0 -80
- package/dist/tools/manage-endpoint-lifecycle.js +0 -180
- package/dist/tools/threat-get-capsule.d.ts +0 -15
- package/dist/tools/threat-get-capsule.js +0 -53
- package/dist/tools/threat-get-inference-prompt.d.ts +0 -15
- package/dist/tools/threat-get-inference-prompt.js +0 -73
- package/dist/tools/threat-guide.d.ts +0 -28
- package/dist/tools/threat-guide.js +0 -175
- package/dist/tools/threat-list-relevant-capsules.d.ts +0 -17
- package/dist/tools/threat-list-relevant-capsules.js +0 -158
- package/dist/tools/threat-run-matcher.d.ts +0 -17
- package/dist/tools/threat-run-matcher.js +0 -145
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zivis_update_endpoint — Update a specific endpoint's configuration
|
|
3
|
+
*
|
|
4
|
+
* Maps to: PATCH /api/rt/applications/:id/endpoints/:endpointId
|
|
5
|
+
*/
|
|
1
6
|
import { z } from "zod";
|
|
2
7
|
import { requireApplicationId } from "../resolve-application-id.js";
|
|
3
8
|
import { sanitizeResponse } from "../sanitize.js";
|
|
@@ -74,6 +79,7 @@ export function createUpdateEndpointHandler(apiClient) {
|
|
|
74
79
|
}
|
|
75
80
|
const application_id = req.id;
|
|
76
81
|
const apiPath = `/api/rt/applications/${application_id}/endpoints/${params.endpoint_id}`;
|
|
82
|
+
// Map snake_case params to camelCase API fields, only including provided values
|
|
77
83
|
const body = {};
|
|
78
84
|
if (params.path !== undefined)
|
|
79
85
|
body.path = params.path;
|
|
@@ -136,3 +142,4 @@ export function createUpdateEndpointHandler(apiClient) {
|
|
|
136
142
|
}
|
|
137
143
|
};
|
|
138
144
|
}
|
|
145
|
+
//# sourceMappingURL=update-endpoint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-endpoint.js","sourceRoot":"","sources":["../../src/tools/update-endpoint.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,CAAC,MAAM,oBAAoB,GAAG,uBAAuB,CAAC;AAE5D,MAAM,CAAC,MAAM,2BAA2B,GAAG;;;;;;;+CAOI,CAAC;AAEhD,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,cAAc,EAAE,CAAC;SACd,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,qFAAqF,CACtF;IACH,WAAW,EAAE,CAAC;SACX,MAAM,EAAE;SACR,QAAQ,CAAC,uDAAuD,CAAC;IACpE,IAAI,EAAE,CAAC;SACJ,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,oCAAoC,CAAC;IACjD,MAAM,EAAE,CAAC;SACN,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;SAClE,QAAQ,EAAE;SACV,QAAQ,CAAC,aAAa,CAAC;IAC1B,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,8CAA8C,CAAC;IAC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AC;gBAC/D,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zivis_update_mermaid_source — Update the Mermaid source of a diagram
|
|
3
|
+
*
|
|
4
|
+
* Maps to: PATCH /api/diagrams/:id with { content: <mermaidSource> }
|
|
5
|
+
*
|
|
6
|
+
* Workflow for an editing AI:
|
|
7
|
+
* 1. Call zivis_get_diagram with the diagram_id — returns current content (Mermaid text) + metadata.
|
|
8
|
+
* 2. Reason about the change the user requested. Produce a new Mermaid source string.
|
|
9
|
+
* 3. Call this tool with the new source to persist it.
|
|
10
|
+
*
|
|
11
|
+
* Use this for diagrams whose contentType is "mermaid". For canvas/node diagrams
|
|
12
|
+
* (contentType = "canvas"), use zivis_manage_diagram instead.
|
|
13
|
+
*/
|
|
1
14
|
import { z } from "zod";
|
|
2
15
|
import type { ApiClient } from "../api-client.js";
|
|
3
16
|
export declare const UPDATE_MERMAID_SOURCE_NAME = "zivis_update_mermaid_source";
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zivis_update_mermaid_source — Update the Mermaid source of a diagram
|
|
3
|
+
*
|
|
4
|
+
* Maps to: PATCH /api/diagrams/:id with { content: <mermaidSource> }
|
|
5
|
+
*
|
|
6
|
+
* Workflow for an editing AI:
|
|
7
|
+
* 1. Call zivis_get_diagram with the diagram_id — returns current content (Mermaid text) + metadata.
|
|
8
|
+
* 2. Reason about the change the user requested. Produce a new Mermaid source string.
|
|
9
|
+
* 3. Call this tool with the new source to persist it.
|
|
10
|
+
*
|
|
11
|
+
* Use this for diagrams whose contentType is "mermaid". For canvas/node diagrams
|
|
12
|
+
* (contentType = "canvas"), use zivis_manage_diagram instead.
|
|
13
|
+
*/
|
|
1
14
|
import { z } from "zod";
|
|
2
15
|
import { sanitizeResponse } from "../sanitize.js";
|
|
3
16
|
export const UPDATE_MERMAID_SOURCE_NAME = "zivis_update_mermaid_source";
|
|
@@ -60,3 +73,4 @@ export function createUpdateMermaidSourceHandler(apiClient) {
|
|
|
60
73
|
}
|
|
61
74
|
};
|
|
62
75
|
}
|
|
76
|
+
//# sourceMappingURL=update-mermaid-source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-mermaid-source.js","sourceRoot":"","sources":["../../src/tools/update-mermaid-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,CAAC,MAAM,0BAA0B,GAAG,6BAA6B,CAAC;AAExE,MAAM,CAAC,MAAM,iCAAiC,GAAG;;;;;;;;;;;;iIAYgF,CAAC;AAElI,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,+BAA+B,CAAC;IAChE,cAAc,EAAE,CAAC;SACd,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CAAC,8EAA8E,CAAC;IAC3F,WAAW,EAAE,CAAC;SACX,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,sGAAsG,CAAC;CACpH,CAAC;AAQF,SAAS,WAAW,CAAC,OAAe;IAClC,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,UAAU,OAAO,EAAE,EAAE,CAAC;QAC/D,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,IAAa;IAClC,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;KAC5F,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,gCAAgC,CAAC,SAAoB;IACnE,OAAO,KAAK,EAAE,MAAiC,EAAE,EAAE;QACjD,IAAI,CAAC;YACH,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;YAC3D,IAAI,CAAC,UAAU;gBAAE,OAAO,WAAW,CAAC,wBAAwB,CAAC,CAAC;YAC9D,IAAI,CAAC,cAAc,IAAI,cAAc,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC1D,OAAO,WAAW,CAAC,gDAAgD,CAAC,CAAC;YACvE,CAAC;YAED,MAAM,IAAI,GAA4B,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC;YAClE,IAAI,WAAW;gBAAE,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;YAEhD,MAAM,OAAO,GAAG,MAAM,SAAS,CAAC,KAAK,CAAC,iBAAiB,UAAU,EAAE,EAAE,IAAI,CAAC,CAAC;YAC3E,OAAO,aAAa,CAAC;gBACnB,EAAE,EAAE,IAAI;gBACR,UAAU;gBACV,OAAO;aACR,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,OAAO,WAAW,CAAC,GAAG,EAAE,OAAO,IAAI,iCAAiC,CAAC,CAAC;QACxE,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zivis_verify_trust_mark — Verify a trust mark by hash or compact token
|
|
3
|
+
*
|
|
4
|
+
* Maps to: GET /api/verify/:hash OR GET /api/verify-token/:token (public, no auth)
|
|
5
|
+
*/
|
|
1
6
|
import { z } from "zod";
|
|
2
7
|
import type { ZivisConfig } from "../types.js";
|
|
3
8
|
export declare const VERIFY_TRUST_MARK_NAME = "zivis_verify_trust_mark";
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zivis_verify_trust_mark — Verify a trust mark by hash or compact token
|
|
3
|
+
*
|
|
4
|
+
* Maps to: GET /api/verify/:hash OR GET /api/verify-token/:token (public, no auth)
|
|
5
|
+
*/
|
|
1
6
|
import { z } from "zod";
|
|
2
7
|
export const VERIFY_TRUST_MARK_NAME = "zivis_verify_trust_mark";
|
|
3
8
|
export const VERIFY_TRUST_MARK_DESCRIPTION = `Verify a ZIVIS Trust Mark by its SHA-256 hash or Ed25519 compact token.
|
|
@@ -100,3 +105,4 @@ export function createVerifyTrustMarkHandler(config) {
|
|
|
100
105
|
}
|
|
101
106
|
};
|
|
102
107
|
}
|
|
108
|
+
//# sourceMappingURL=verify-trust-mark.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-trust-mark.js","sourceRoot":"","sources":["../../src/tools/verify-trust-mark.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,CAAC,MAAM,sBAAsB,GAAG,yBAAyB,CAAC;AAEhE,MAAM,CAAC,MAAM,6BAA6B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;+DAwBkB,CAAC;AAEhE,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,IAAI,EAAE,CAAC;SACJ,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,gEAAgE,CAAC;IAC7E,aAAa,EAAE,CAAC;SACb,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,0DAA0D,CAAC;CACxE,CAAC;AAEF,MAAM,UAAU,4BAA4B,CAAC,MAAmB;IAC9D,OAAO,KAAK,EAAE,MAAiD,EAAE,EAAE;QACjE,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;YAC7D,MAAM,QAAQ,GAAG,MA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,IAAI;iBACd,CAAC;YACJ,CAAC;YAED,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;qBACpC;iBACF;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,OAAO,GACX,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,6BAA6B,CAAC;YACrE,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,UAAU,OAAO,EAAE,EAAE,CAAC;gBAC/D,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types for the ZIVIS MCP Security Server
|
|
3
|
+
*/
|
|
1
4
|
export interface OAuthTokens {
|
|
2
5
|
access_token: string;
|
|
3
|
-
refresh_token
|
|
6
|
+
refresh_token: string;
|
|
4
7
|
expires_at: number;
|
|
5
8
|
id_token?: string;
|
|
6
9
|
}
|
|
7
10
|
export type AuthMethod = "oauth" | "apikey" | "none";
|
|
8
11
|
export interface AuthCredentials {
|
|
9
12
|
method: AuthMethod;
|
|
13
|
+
/** OAuth access token (when method === "oauth") */
|
|
10
14
|
accessToken?: string;
|
|
15
|
+
/** WorkOS API key (when method === "apikey") */
|
|
11
16
|
apiKey?: string;
|
|
12
17
|
}
|
|
13
18
|
export interface AuthStatus {
|
|
@@ -181,31 +186,26 @@ export interface SessionInfo {
|
|
|
181
186
|
}
|
|
182
187
|
export type SessionIndex = Record<string, SessionInfo>;
|
|
183
188
|
export interface ProjectBinding {
|
|
189
|
+
/** Expected ZIVIS_SESSION value (e.g., "zivis", "acme-corp") */
|
|
184
190
|
session: string;
|
|
191
|
+
/** Zivis org UUID (API) */
|
|
185
192
|
orgId?: string;
|
|
193
|
+
/** WorkOS org id — OAuth login and JWT org_id use this boundary */
|
|
186
194
|
workosOrgId?: string;
|
|
195
|
+
/** Human-readable org name */
|
|
187
196
|
orgName?: string;
|
|
197
|
+
/** RT application UUID when this project is tied to a single app in the org */
|
|
188
198
|
applicationId?: string;
|
|
199
|
+
/** Display name for that application (optional) */
|
|
189
200
|
applicationName?: string;
|
|
190
|
-
apiBaseUrl?: string;
|
|
191
|
-
oauthApiUrl?: string;
|
|
192
|
-
oauthClientId?: string;
|
|
193
|
-
keychainPrefix?: string;
|
|
194
|
-
configDir?: string;
|
|
195
|
-
}
|
|
196
|
-
export interface CredentialStorage {
|
|
197
|
-
keychainPrefix: string;
|
|
198
|
-
configDir: string;
|
|
199
201
|
}
|
|
200
202
|
export interface ZivisConfig {
|
|
201
203
|
apiBaseUrl: string;
|
|
202
204
|
oauthClientId: string;
|
|
203
205
|
oauthApiUrl: string;
|
|
204
206
|
callbackPort: number;
|
|
207
|
+
/** Named session for multi-tenant isolation (from ZIVIS_SESSION env var) */
|
|
205
208
|
session?: string;
|
|
206
|
-
keychainPrefix?: string;
|
|
207
|
-
configDir?: string;
|
|
208
|
-
workspacePath?: string;
|
|
209
209
|
}
|
|
210
210
|
interface EnvConfig {
|
|
211
211
|
apiBaseUrl: string;
|
|
@@ -214,7 +214,7 @@ interface EnvConfig {
|
|
|
214
214
|
keychainPrefix: string;
|
|
215
215
|
configDir: string;
|
|
216
216
|
}
|
|
217
|
+
export declare const BUILD_ENV: "staging" | "production";
|
|
217
218
|
export declare const ENV_CONFIG: EnvConfig;
|
|
218
219
|
export declare const DEFAULT_CONFIG: ZivisConfig;
|
|
219
|
-
export declare function credentialStorageFromConfig(config?: ZivisConfig): CredentialStorage;
|
|
220
220
|
export {};
|
package/dist/types.js
CHANGED
|
@@ -1,27 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Shared types for the ZIVIS MCP Security Server
|
|
3
|
+
*/
|
|
4
|
+
const ENVIRONMENT_CONFIGS = {
|
|
5
|
+
staging: {
|
|
6
|
+
apiBaseUrl: "https://staging.zivis.ai",
|
|
7
|
+
oauthClientId: "client_01KGCMZ482H9SJPKTVRCC213K0",
|
|
8
|
+
oauthApiUrl: "https://delightful-abundance-65-staging.authkit.app",
|
|
9
|
+
keychainPrefix: "io.zivis.mcp.staging",
|
|
10
|
+
configDir: "zivis-staging",
|
|
11
|
+
},
|
|
12
|
+
production: {
|
|
13
|
+
apiBaseUrl: "https://app.zivis.ai",
|
|
14
|
+
oauthClientId: "client_01KGCPA567YEEVXV307AERCB93",
|
|
15
|
+
oauthApiUrl: "https://api.workos.com",
|
|
16
|
+
keychainPrefix: "io.zivis.mcp",
|
|
17
|
+
configDir: "zivis",
|
|
18
|
+
},
|
|
14
19
|
};
|
|
20
|
+
// Build-time environment (defaults to staging for development)
|
|
21
|
+
export const BUILD_ENV = (process.env.ZIVIS_BUILD_ENV || "staging");
|
|
22
|
+
// Get the config for the current build environment
|
|
23
|
+
export const ENV_CONFIG = ENVIRONMENT_CONFIGS[BUILD_ENV] || ENVIRONMENT_CONFIGS.staging;
|
|
15
24
|
export const DEFAULT_CONFIG = {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
25
|
+
// Runtime env vars override build-time defaults (useful for testing)
|
|
26
|
+
apiBaseUrl: process.env.ZIVIS_API_URL || ENV_CONFIG.apiBaseUrl,
|
|
27
|
+
oauthClientId: process.env.ZIVIS_OAUTH_CLIENT_ID || ENV_CONFIG.oauthClientId,
|
|
28
|
+
oauthApiUrl: process.env.ZIVIS_OAUTH_API_URL || ENV_CONFIG.oauthApiUrl,
|
|
19
29
|
callbackPort: 8741,
|
|
30
|
+
// Session isolation for multi-tenant safety
|
|
20
31
|
session: process.env.ZIVIS_SESSION || undefined,
|
|
21
32
|
};
|
|
22
|
-
|
|
23
|
-
return {
|
|
24
|
-
keychainPrefix: config?.keychainPrefix ?? ENV_CONFIG.keychainPrefix,
|
|
25
|
-
configDir: config?.configDir ?? ENV_CONFIG.configDir,
|
|
26
|
-
};
|
|
27
|
-
}
|
|
33
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAoPH,MAAM,mBAAmB,GAA8B;IACrD,OAAO,EAAE;QACP,UAAU,EAAE,0BAA0B;QACtC,aAAa,EAAE,mCAAmC;QAClD,WAAW,EAAE,qDAAqD;QAClE,cAAc,EAAE,sBAAsB;QACtC,SAAS,EAAE,eAAe;KAC3B;IACD,UAAU,EAAE;QACV,UAAU,EAAE,sBAAsB;QAClC,aAAa,EAAE,mCAAmC;QAClD,WAAW,EAAE,wBAAwB;QACrC,cAAc,EAAE,cAAc;QAC9B,SAAS,EAAE,OAAO;KACnB;CACF,CAAC;AAEF,+DAA+D;AAC/D,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,SAAS,CAElD,CAAC;AAEjB,mDAAmD;AACnD,MAAM,CAAC,MAAM,UAAU,GACrB,mBAAmB,CAAC,SAAS,CAAC,IAAI,mBAAmB,CAAC,OAAO,CAAC;AAEhE,MAAM,CAAC,MAAM,cAAc,GAAgB;IACzC,qEAAqE;IACrE,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,UAAU,CAAC,UAAU;IAC9D,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,UAAU,CAAC,aAAa;IAC5E,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,UAAU,CAAC,WAAW;IACtE,YAAY,EAAE,IAAI;IAClB,4CAA4C;IAC5C,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,SAAS;CAChD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zivis/mcp",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.3",
|
|
4
4
|
"description": "ZIVIS MCP server — threat modeling, security scans, and AI red team tools for IDE integration",
|
|
5
|
-
"license": "Apache-2.0",
|
|
6
|
-
"homepage": "https://zivis.ai",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "https://github.com/zivisai/zivis-platform.git",
|
|
10
|
-
"directory": "zivis-mcp-security"
|
|
11
|
-
},
|
|
12
5
|
"type": "module",
|
|
13
6
|
"bin": {
|
|
14
7
|
"zivis-mcp": "./dist/index.js"
|
|
@@ -22,15 +15,11 @@
|
|
|
22
15
|
"./project-binding": "./dist/project-binding.js",
|
|
23
16
|
"./server": "./dist/server.js",
|
|
24
17
|
"./types": "./dist/types.js",
|
|
25
|
-
"./cli": "./dist/cli.js"
|
|
26
|
-
"./pattern-pack": "./dist/pattern-pack/index.js",
|
|
27
|
-
"./matcher": "./dist/matcher/index.js"
|
|
18
|
+
"./cli": "./dist/cli.js"
|
|
28
19
|
},
|
|
29
20
|
"files": [
|
|
30
21
|
"dist",
|
|
31
|
-
"package.json"
|
|
32
|
-
"README.md",
|
|
33
|
-
"LICENSE"
|
|
22
|
+
"package.json"
|
|
34
23
|
],
|
|
35
24
|
"publishConfig": {
|
|
36
25
|
"access": "restricted"
|
|
@@ -39,27 +28,18 @@
|
|
|
39
28
|
"node": ">=20.0.0"
|
|
40
29
|
},
|
|
41
30
|
"dependencies": {
|
|
42
|
-
"@ast-grep/lang-go": "^0.0.6",
|
|
43
|
-
"@ast-grep/lang-python": "^0.0.6",
|
|
44
|
-
"@ast-grep/napi": "^0.42.1",
|
|
45
31
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
46
|
-
"js-yaml": "^4.1.0",
|
|
47
32
|
"open": "^10.1.0",
|
|
48
33
|
"zod": "^4.0.0"
|
|
49
34
|
},
|
|
50
35
|
"devDependencies": {
|
|
51
|
-
"@types/js-yaml": "^4.0.9",
|
|
52
36
|
"@types/node": "^22.0.0",
|
|
53
|
-
"ajv": "^8.17.1",
|
|
54
|
-
"ajv-formats": "^3.0.1",
|
|
55
37
|
"husky": "^9.1.7",
|
|
56
|
-
"tsx": "^4.19.2",
|
|
57
38
|
"typescript": "^5.7.0",
|
|
58
39
|
"vitest": "^3.0.0"
|
|
59
40
|
},
|
|
60
41
|
"scripts": {
|
|
61
|
-
"build
|
|
62
|
-
"build": "tsc -p tsconfig.build.json && pnpm run build:pattern-pack && node scripts/ensure-symlink.cjs",
|
|
42
|
+
"build": "tsc && node scripts/ensure-symlink.cjs",
|
|
63
43
|
"dev": "tsc --watch",
|
|
64
44
|
"start": "node dist/index.js",
|
|
65
45
|
"test": "vitest run",
|
package/LICENSE
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
Apache License
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
http://www.apache.org/licenses/
|
|
4
|
-
|
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
-
|
|
7
|
-
1. Definitions.
|
|
8
|
-
|
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
-
|
|
12
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
-
the copyright owner that is granting the License.
|
|
14
|
-
|
|
15
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
-
other entities that control, are controlled by, or are under common
|
|
17
|
-
control with that entity. For the purposes of this definition,
|
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
-
direction or management of such entity, whether by contract or
|
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for describing the origin of the Work and
|
|
141
|
-
reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|
|
177
|
-
|
|
178
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
-
|
|
180
|
-
To apply the Apache License to your work, attach the following
|
|
181
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
-
replaced with your own identifying information. (Don't include
|
|
183
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
-
comment syntax for the file format. We also recommend that a
|
|
185
|
-
file or class name and description of purpose be included on the
|
|
186
|
-
same "printed page" as the copyright notice for easier
|
|
187
|
-
identification within third-party archives.
|
|
188
|
-
|
|
189
|
-
Copyright 2026 ZIVIS, Inc.
|
|
190
|
-
|
|
191
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
-
you may not use this file except in compliance with the License.
|
|
193
|
-
You may obtain a copy of the License at
|
|
194
|
-
|
|
195
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
-
|
|
197
|
-
Unless required by applicable law or agreed to in writing, software
|
|
198
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
-
See the License for the specific language governing permissions and
|
|
201
|
-
limitations under the License.
|
package/README.md
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# @zivis/mcp
|
|
2
|
-
|
|
3
|
-
The ZIVIS Model Context Protocol (MCP) server. Exposes ZIVIS's threat modeling, security scanning, and AI red-team tools to AI assistants in your IDE (Cursor, Claude Code, VS Code Copilot, Cline, Windsurf).
|
|
4
|
-
|
|
5
|
-
You usually don't install or invoke this directly — it's the engine behind [`@zivis/cli`](https://www.npmjs.com/package/@zivis/cli). When you run `zivis mcp serve` (or your IDE calls it automatically), this package is what runs.
|
|
6
|
-
|
|
7
|
-
## What is ZIVIS?
|
|
8
|
-
|
|
9
|
-
ZIVIS is an architecture-inspection security platform — it looks at the components in your app, how they connect, and what trust boundaries exist between them. See <https://zivis.ai>.
|
|
10
|
-
|
|
11
|
-
## Use via the CLI
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
npx @zivis/cli init # interactive setup, configures your IDE's mcp.json
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## License
|
|
18
|
-
|
|
19
|
-
Apache 2.0 — see [`LICENSE`](./LICENSE).
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export interface LocatedArtifact {
|
|
2
|
-
path: string;
|
|
3
|
-
mtimeMs: number;
|
|
4
|
-
}
|
|
5
|
-
export declare function userCacheRoot(): string;
|
|
6
|
-
export declare function deriveRepoId(cwd: string): Promise<string>;
|
|
7
|
-
export declare function locateLatestArtifact(cwd: string): Promise<LocatedArtifact | undefined>;
|
|
8
|
-
export declare const DEFAULT_INSPECT_CACHE_TTL_MS: number;
|
|
9
|
-
export declare function inspectCacheTtlMs(): number;
|
|
10
|
-
export declare function isFresh(mtimeMs: number, now?: number): boolean;
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import * as fs from "node:fs/promises";
|
|
2
|
-
import * as fssync from "node:fs";
|
|
3
|
-
import * as os from "node:os";
|
|
4
|
-
import * as path from "node:path";
|
|
5
|
-
import * as crypto from "node:crypto";
|
|
6
|
-
import { exec } from "node:child_process";
|
|
7
|
-
import { promisify } from "node:util";
|
|
8
|
-
const execAsync = promisify(exec);
|
|
9
|
-
export function userCacheRoot() {
|
|
10
|
-
const home = os.homedir();
|
|
11
|
-
if (process.platform === "darwin") {
|
|
12
|
-
return path.join(home, "Library", "Caches", "zivis");
|
|
13
|
-
}
|
|
14
|
-
if (process.platform === "win32") {
|
|
15
|
-
const localAppData = process.env.LOCALAPPDATA ?? path.join(home, "AppData", "Local");
|
|
16
|
-
return path.join(localAppData, "zivis", "Cache");
|
|
17
|
-
}
|
|
18
|
-
const xdg = process.env.XDG_CACHE_HOME;
|
|
19
|
-
return path.join(xdg ?? path.join(home, ".cache"), "zivis");
|
|
20
|
-
}
|
|
21
|
-
export async function deriveRepoId(cwd) {
|
|
22
|
-
const remote = await tryGit(cwd, "remote get-url origin");
|
|
23
|
-
if (remote) {
|
|
24
|
-
return "remote-" + sha256Short(remote);
|
|
25
|
-
}
|
|
26
|
-
return "path-" + sha256Short(cwd);
|
|
27
|
-
}
|
|
28
|
-
async function tryGit(cwd, args) {
|
|
29
|
-
try {
|
|
30
|
-
const { stdout } = await execAsync(`git ${args}`, { cwd });
|
|
31
|
-
const value = stdout.trim();
|
|
32
|
-
return value || undefined;
|
|
33
|
-
}
|
|
34
|
-
catch {
|
|
35
|
-
return undefined;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
function sha256Short(value) {
|
|
39
|
-
return crypto.createHash("sha256").update(value).digest("hex").slice(0, 16);
|
|
40
|
-
}
|
|
41
|
-
export async function locateLatestArtifact(cwd) {
|
|
42
|
-
const repoId = await deriveRepoId(cwd);
|
|
43
|
-
const runsDir = path.join(userCacheRoot(), "repos", repoId, "inspect", "runs");
|
|
44
|
-
if (!fssync.existsSync(runsDir))
|
|
45
|
-
return undefined;
|
|
46
|
-
const candidates = [];
|
|
47
|
-
for (const entry of await fs.readdir(runsDir)) {
|
|
48
|
-
if (!entry.endsWith(".json"))
|
|
49
|
-
continue;
|
|
50
|
-
const full = path.join(runsDir, entry);
|
|
51
|
-
try {
|
|
52
|
-
const stat = await fs.stat(full);
|
|
53
|
-
candidates.push({ path: full, mtimeMs: stat.mtimeMs });
|
|
54
|
-
}
|
|
55
|
-
catch {
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
if (candidates.length === 0)
|
|
59
|
-
return undefined;
|
|
60
|
-
candidates.sort((a, b) => b.mtimeMs - a.mtimeMs);
|
|
61
|
-
return candidates[0];
|
|
62
|
-
}
|
|
63
|
-
export const DEFAULT_INSPECT_CACHE_TTL_MS = 15 * 60 * 1000;
|
|
64
|
-
export function inspectCacheTtlMs() {
|
|
65
|
-
const raw = process.env.ZIVIS_INSPECT_CACHE_TTL_MS;
|
|
66
|
-
if (!raw)
|
|
67
|
-
return DEFAULT_INSPECT_CACHE_TTL_MS;
|
|
68
|
-
const parsed = Number.parseInt(raw, 10);
|
|
69
|
-
if (!Number.isFinite(parsed) || parsed <= 0)
|
|
70
|
-
return DEFAULT_INSPECT_CACHE_TTL_MS;
|
|
71
|
-
return parsed;
|
|
72
|
-
}
|
|
73
|
-
export function isFresh(mtimeMs, now = Date.now()) {
|
|
74
|
-
return now - mtimeMs <= inspectCacheTtlMs();
|
|
75
|
-
}
|
package/dist/lib/next-steps.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export interface NextStep {
|
|
2
|
-
id: string;
|
|
3
|
-
label: string;
|
|
4
|
-
tool: string;
|
|
5
|
-
args_hint?: Record<string, unknown>;
|
|
6
|
-
why: string;
|
|
7
|
-
requires_tier?: "free" | "pro" | "enterprise";
|
|
8
|
-
}
|
|
9
|
-
export interface ZivisToolPayload<T> {
|
|
10
|
-
result: T;
|
|
11
|
-
next_steps?: NextStep[];
|
|
12
|
-
summary?: string;
|
|
13
|
-
}
|
|
14
|
-
export declare function withNextSteps<T>(result: T, nextSteps: NextStep[], summary?: string): {
|
|
15
|
-
content: Array<{
|
|
16
|
-
type: "text";
|
|
17
|
-
text: string;
|
|
18
|
-
}>;
|
|
19
|
-
isError?: boolean;
|
|
20
|
-
};
|
|
21
|
-
export declare function withNextStepsError(message: string, nextSteps: NextStep[], summary?: string): {
|
|
22
|
-
content: Array<{
|
|
23
|
-
type: "text";
|
|
24
|
-
text: string;
|
|
25
|
-
}>;
|
|
26
|
-
isError: true;
|
|
27
|
-
};
|