@zivis/mcp 0.2.5 → 0.2.7
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/pattern-packs/zivis-public-0.2.0/manifest.json +1 -1
- package/dist/server.js +0 -2
- package/dist/tools/devx-run.js +5 -2
- package/dist/tools/diagram.d.ts +3 -1
- package/dist/tools/diagram.js +16 -3
- package/package.json +1 -1
- package/dist/tools/open-in-ide.d.ts +0 -27
- package/dist/tools/open-in-ide.js +0 -48
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"pack_id": "zivis-public",
|
|
4
4
|
"pack_name": "ZIVIS Public Pattern Pack",
|
|
5
5
|
"version": "0.2.0",
|
|
6
|
-
"built_at": "2026-09-
|
|
6
|
+
"built_at": "2026-09-13T20:31:19.033Z",
|
|
7
7
|
"tier": "customer_safe",
|
|
8
8
|
"description": "ZIVIS-curated public pattern pack — capsules + inference prompts evaluated locally on the user's machine.",
|
|
9
9
|
"capsules": [
|
package/dist/server.js
CHANGED
|
@@ -51,7 +51,6 @@ import { MEMORY_NAME, MEMORY_DESCRIPTION, MEMORY_SCHEMA, createMemoryHandler, }
|
|
|
51
51
|
import { RUN_START_NAME, RUN_START_DESCRIPTION, RUN_START_SCHEMA, createRunStartHandler, RUN_NAME, RUN_DESCRIPTION, RUN_SCHEMA, createRunHandler, } from "./tools/devx-run.js";
|
|
52
52
|
import { CHECK_PROJECT_NAME, CHECK_PROJECT_DESCRIPTION, CHECK_PROJECT_SCHEMA, createCheckProjectHandler, } from "./tools/check-project.js";
|
|
53
53
|
import { GET_ORG_ZAT_NAME, GET_ORG_ZAT_DESCRIPTION, GET_ORG_ZAT_SCHEMA, createGetOrgZatHandler } from "./tools/enterprise/get-org-zat.js";
|
|
54
|
-
import { OPEN_IN_IDE_NAME, OPEN_IN_IDE_DESCRIPTION, OPEN_IN_IDE_SCHEMA, createOpenInIdeHandler, } from "./tools/open-in-ide.js";
|
|
55
54
|
export async function startServer(incoming = DEFAULT_CONFIG) {
|
|
56
55
|
const workspacePath = incoming.workspacePath ?? process.cwd();
|
|
57
56
|
const detected = detectProjectBinding(workspacePath);
|
|
@@ -114,7 +113,6 @@ export async function startServer(incoming = DEFAULT_CONFIG) {
|
|
|
114
113
|
server.registerTool(MEMORY_NAME, { description: MEMORY_DESCRIPTION, inputSchema: MEMORY_SCHEMA }, createMemoryHandler(apiClient));
|
|
115
114
|
server.registerTool(RUN_START_NAME, { description: RUN_START_DESCRIPTION, inputSchema: RUN_START_SCHEMA }, createRunStartHandler(apiClient));
|
|
116
115
|
server.registerTool(RUN_NAME, { description: RUN_DESCRIPTION, inputSchema: RUN_SCHEMA }, createRunHandler(apiClient));
|
|
117
|
-
server.registerTool(OPEN_IN_IDE_NAME, { description: OPEN_IN_IDE_DESCRIPTION, inputSchema: OPEN_IN_IDE_SCHEMA }, createOpenInIdeHandler());
|
|
118
116
|
server.registerTool(CHECK_PROJECT_NAME, {
|
|
119
117
|
description: CHECK_PROJECT_DESCRIPTION,
|
|
120
118
|
inputSchema: CHECK_PROJECT_SCHEMA,
|
package/dist/tools/devx-run.js
CHANGED
|
@@ -97,9 +97,12 @@ const ItemArraySchema = z
|
|
|
97
97
|
export const RUN_SCHEMA = {
|
|
98
98
|
action: z.enum(["report", "complete", "cancel"]).describe("Which run-lifecycle operation to perform"),
|
|
99
99
|
run_id: z.string().min(1).describe("The runId returned by zivis_run_start. Must still be pending for report/complete."),
|
|
100
|
-
findings: ItemArraySchema.describe("Finding items — same shape as result.findings[] (title, severity, description, category, cweId, owaspId, disposition: 'open'|'fixed', ...). report only."),
|
|
100
|
+
findings: ItemArraySchema.describe("Finding items — same shape as result.findings[] (title, severity, description, category, cweId, owaspId, scopeId, local_key, disposition: 'open'|'fixed', ...). report only. ZIV-695: give a finding a `local_key` so an observation in the same batch can cite it via finding_refs."),
|
|
101
101
|
evidence: ItemArraySchema.describe("Evidence items — same shape as result.evidence[] (name, kind, content, description). report only."),
|
|
102
|
-
observations: ItemArraySchema.describe("Observation items — same shape as result.observations[] (test_id, scope_id, title, pack, target, executed, result, method,
|
|
102
|
+
observations: ItemArraySchema.describe("Observation items — same shape as result.observations[] (test_id, scope_id, title, pack, target, executed, result, method, finding_refs, evidence_refs, coverage_note). report only. " +
|
|
103
|
+
"ZIV-695: result='failed' MUST cite its proof via finding_refs: [{kind:'local',key:'<a findings[].local_key in this same batch>'}] or [{kind:'unified',id:'<a findingId a previous report returned>'}] — " +
|
|
104
|
+
"an uncited failure is recorded as 'inconclusive', which asserts nothing and moves no coverage. A co-submitted finding with a matching scopeId is linked for you. " +
|
|
105
|
+
"Check adjusted_observations in the response: anything reported 'downgraded' did NOT land as submitted."),
|
|
103
106
|
result: z
|
|
104
107
|
.record(z.string(), z.unknown())
|
|
105
108
|
.optional()
|
package/dist/tools/diagram.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import type { ApiClient } from "../api-client.js";
|
|
3
3
|
export declare const DIAGRAM_NAME = "zivis_diagram";
|
|
4
|
-
export declare const DIAGRAM_DESCRIPTION = "CRUD + link management for Mermaid diagrams (architecture, data flow, attack chain, sequence, trust boundary, network, deployment).\n\naction:\n- create: requires name, diagram_type, content (Mermaid source). Optional description, linked_threat_model_id.\n- get: requires diagram_id. Full Mermaid source + metadata \u2014 call before update_source.\n- list: optional diagram_type, search, linked_threat_model_id filters; limit (default 20, max 100).\n- update_metadata: requires diagram_id. Optional name/description/diagram_type.\n- update_source: requires diagram_id, mermaid_source (COMPLETE replacement source \u2014 get first, preserve unrelated nodes/edges/styles). Optional description of the change.\n- delete: requires diagram_id.\n- link_threat_model / unlink_threat_model: requires diagram_id, threat_model_id.";
|
|
4
|
+
export declare const DIAGRAM_DESCRIPTION = "CRUD + link management for Mermaid diagrams (architecture, data flow, attack chain, sequence, trust boundary, network, deployment).\n\naction:\n- create: requires application_id, name, diagram_type, content (Mermaid source). The diagram is linked to that application so it shows on the app's Diagrams tab. Optional description, linked_threat_model_id.\n- get: requires diagram_id. Full Mermaid source + metadata \u2014 call before update_source.\n- list: optional application_id, diagram_type, search, linked_threat_model_id filters; limit (default 20, max 100). List by application_id before create so you update an existing diagram instead of duplicating it.\n- update_metadata: requires diagram_id. Optional name/description/diagram_type.\n- update_source: requires diagram_id, mermaid_source (COMPLETE replacement source \u2014 get first, preserve unrelated nodes/edges/styles). Optional description of the change.\n- delete: requires diagram_id.\n- link_threat_model / unlink_threat_model: requires diagram_id, threat_model_id.";
|
|
5
5
|
export declare const DIAGRAM_SCHEMA: {
|
|
6
6
|
action: z.ZodEnum<{
|
|
7
7
|
list: "list";
|
|
@@ -14,6 +14,7 @@ export declare const DIAGRAM_SCHEMA: {
|
|
|
14
14
|
unlink_threat_model: "unlink_threat_model";
|
|
15
15
|
}>;
|
|
16
16
|
diagram_id: z.ZodOptional<z.ZodString>;
|
|
17
|
+
application_id: z.ZodOptional<z.ZodString>;
|
|
17
18
|
name: z.ZodOptional<z.ZodString>;
|
|
18
19
|
description: z.ZodOptional<z.ZodString>;
|
|
19
20
|
diagram_type: z.ZodOptional<z.ZodEnum<{
|
|
@@ -36,6 +37,7 @@ export declare const DIAGRAM_SCHEMA: {
|
|
|
36
37
|
type DiagramParams = {
|
|
37
38
|
action: "create" | "get" | "list" | "update_metadata" | "update_source" | "delete" | "link_threat_model" | "unlink_threat_model";
|
|
38
39
|
diagram_id?: string;
|
|
40
|
+
application_id?: string;
|
|
39
41
|
name?: string;
|
|
40
42
|
description?: string;
|
|
41
43
|
diagram_type?: string;
|
package/dist/tools/diagram.js
CHANGED
|
@@ -14,9 +14,9 @@ const DIAGRAM_TYPE_ENUM = [
|
|
|
14
14
|
export const DIAGRAM_DESCRIPTION = `CRUD + link management for Mermaid diagrams (architecture, data flow, attack chain, sequence, trust boundary, network, deployment).
|
|
15
15
|
|
|
16
16
|
action:
|
|
17
|
-
- create: requires name, diagram_type, content (Mermaid source). Optional description, linked_threat_model_id.
|
|
17
|
+
- create: requires application_id, name, diagram_type, content (Mermaid source). The diagram is linked to that application so it shows on the app's Diagrams tab. Optional description, linked_threat_model_id.
|
|
18
18
|
- get: requires diagram_id. Full Mermaid source + metadata — call before update_source.
|
|
19
|
-
- list: optional diagram_type, search, linked_threat_model_id filters; limit (default 20, max 100).
|
|
19
|
+
- list: optional application_id, diagram_type, search, linked_threat_model_id filters; limit (default 20, max 100). List by application_id before create so you update an existing diagram instead of duplicating it.
|
|
20
20
|
- update_metadata: requires diagram_id. Optional name/description/diagram_type.
|
|
21
21
|
- update_source: requires diagram_id, mermaid_source (COMPLETE replacement source — get first, preserve unrelated nodes/edges/styles). Optional description of the change.
|
|
22
22
|
- delete: requires diagram_id.
|
|
@@ -35,6 +35,10 @@ export const DIAGRAM_SCHEMA = {
|
|
|
35
35
|
])
|
|
36
36
|
.describe("Which diagram operation to perform"),
|
|
37
37
|
diagram_id: z.string().optional().describe("Diagram UUID. Required for every action except create/list."),
|
|
38
|
+
application_id: z
|
|
39
|
+
.string()
|
|
40
|
+
.optional()
|
|
41
|
+
.describe("Application UUID. Required for create — the diagram is linked to it and only then appears on that app's Diagrams tab. Optional filter for list."),
|
|
38
42
|
name: z.string().optional().describe("Diagram name. Required for create."),
|
|
39
43
|
description: z
|
|
40
44
|
.string()
|
|
@@ -70,6 +74,10 @@ export function createDiagramHandler(apiClient) {
|
|
|
70
74
|
return errorResult("diagram_type is required for create");
|
|
71
75
|
if (!params.content)
|
|
72
76
|
return errorResult("content is required for create");
|
|
77
|
+
const applicationId = params.application_id?.trim();
|
|
78
|
+
if (!applicationId) {
|
|
79
|
+
return errorResult("application_id is required for create. Diagrams are application artifacts: without the link the diagram lands at org level and no application view can show it. Use the applicationId from zivis_check_project or zivis_application(action=list).");
|
|
80
|
+
}
|
|
73
81
|
const data = await apiClient.post("/api/diagrams", {
|
|
74
82
|
name: params.name,
|
|
75
83
|
description: params.description,
|
|
@@ -77,6 +85,8 @@ export function createDiagramHandler(apiClient) {
|
|
|
77
85
|
contentType: "mermaid",
|
|
78
86
|
content: params.content,
|
|
79
87
|
sourceType: "manual",
|
|
88
|
+
entityType: "application",
|
|
89
|
+
entityId: applicationId,
|
|
80
90
|
});
|
|
81
91
|
const sanitized = sanitizeResponse(data);
|
|
82
92
|
const diagramId = sanitized.id;
|
|
@@ -95,8 +105,9 @@ export function createDiagramHandler(apiClient) {
|
|
|
95
105
|
diagram_id: diagramId,
|
|
96
106
|
name: sanitized.name,
|
|
97
107
|
diagram_type: sanitized.diagramType,
|
|
108
|
+
application_id: applicationId,
|
|
98
109
|
linked_threat_model_id: linkedThreatModelId,
|
|
99
|
-
_instruction: "Diagram created. Use zivis_diagram(action=get) to see full content, action=update_metadata to change metadata/links, or action=update_source to change the Mermaid source.",
|
|
110
|
+
_instruction: "Diagram created and linked to the application. Use zivis_diagram(action=get) to see full content, action=update_metadata to change metadata/links, or action=update_source to change the Mermaid source.",
|
|
100
111
|
});
|
|
101
112
|
}
|
|
102
113
|
case "get": {
|
|
@@ -122,6 +133,8 @@ export function createDiagramHandler(apiClient) {
|
|
|
122
133
|
}
|
|
123
134
|
case "list": {
|
|
124
135
|
const query = new URLSearchParams();
|
|
136
|
+
if (params.application_id?.trim())
|
|
137
|
+
query.set("applicationId", params.application_id.trim());
|
|
125
138
|
if (params.diagram_type)
|
|
126
139
|
query.set("diagramType", params.diagram_type);
|
|
127
140
|
if (params.search)
|
package/package.json
CHANGED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const OPEN_IN_IDE_NAME = "zivis_open_in_ide";
|
|
3
|
-
export declare const OPEN_IN_IDE_DESCRIPTION = "Build a vscode:// or cursor:// deep link that opens a ZIVIS artifact inside the ZIVIS Code IDE extension.\n\nReturns a URI like `vscode://zivisai.zivis-security/diagram?id=<uuid>` (or `cursor://...` when ide_client is cursor). When opened with the system's URL handler, it launches the matching desktop editor and opens the diagram, document, or threat model.\n\nSupported kinds:\n - diagram \u2014 opens the diagram in a webview panel\n - document \u2014 opens the document in a webview panel\n - threat-model \u2014 reveals the threat model in the ZIVIS sidebar tree\n\nRequires the ZIVIS Code extension (publisher: zivisai, name: zivis-security) to be installed in the user's IDE. If it isn't, the URI will prompt the user to install it.\n\nThis tool does not make any API calls and does not validate that the ID exists \u2014 it's a pure URI builder.";
|
|
4
|
-
export declare const OPEN_IN_IDE_SCHEMA: {
|
|
5
|
-
kind: z.ZodEnum<{
|
|
6
|
-
document: "document";
|
|
7
|
-
diagram: "diagram";
|
|
8
|
-
"threat-model": "threat-model";
|
|
9
|
-
}>;
|
|
10
|
-
id: z.ZodString;
|
|
11
|
-
label: z.ZodOptional<z.ZodString>;
|
|
12
|
-
ide_client: z.ZodOptional<z.ZodEnum<{
|
|
13
|
-
cursor: "cursor";
|
|
14
|
-
vscode: "vscode";
|
|
15
|
-
}>>;
|
|
16
|
-
};
|
|
17
|
-
export declare function createOpenInIdeHandler(): (params: {
|
|
18
|
-
kind: "diagram" | "document" | "threat-model";
|
|
19
|
-
id: string;
|
|
20
|
-
label?: string;
|
|
21
|
-
ide_client?: "vscode" | "cursor";
|
|
22
|
-
}) => Promise<{
|
|
23
|
-
content: {
|
|
24
|
-
type: "text";
|
|
25
|
-
text: string;
|
|
26
|
-
}[];
|
|
27
|
-
}>;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export const OPEN_IN_IDE_NAME = "zivis_open_in_ide";
|
|
3
|
-
export const OPEN_IN_IDE_DESCRIPTION = `Build a vscode:// or cursor:// deep link that opens a ZIVIS artifact inside the ZIVIS Code IDE extension.
|
|
4
|
-
|
|
5
|
-
Returns a URI like \`vscode://zivisai.zivis-security/diagram?id=<uuid>\` (or \`cursor://...\` when ide_client is cursor). When opened with the system's URL handler, it launches the matching desktop editor and opens the diagram, document, or threat model.
|
|
6
|
-
|
|
7
|
-
Supported kinds:
|
|
8
|
-
- diagram — opens the diagram in a webview panel
|
|
9
|
-
- document — opens the document in a webview panel
|
|
10
|
-
- threat-model — reveals the threat model in the ZIVIS sidebar tree
|
|
11
|
-
|
|
12
|
-
Requires the ZIVIS Code extension (publisher: zivisai, name: zivis-security) to be installed in the user's IDE. If it isn't, the URI will prompt the user to install it.
|
|
13
|
-
|
|
14
|
-
This tool does not make any API calls and does not validate that the ID exists — it's a pure URI builder.`;
|
|
15
|
-
export const OPEN_IN_IDE_SCHEMA = {
|
|
16
|
-
kind: z
|
|
17
|
-
.enum(["diagram", "document", "threat-model"])
|
|
18
|
-
.describe("Type of artifact the link should open."),
|
|
19
|
-
id: z.string().min(1).describe("UUID of the artifact (diagram_id, document_id, or threat_model_id)."),
|
|
20
|
-
label: z
|
|
21
|
-
.string()
|
|
22
|
-
.optional()
|
|
23
|
-
.describe("Optional human-readable label passed as ?name= for nicer panel titles."),
|
|
24
|
-
ide_client: z
|
|
25
|
-
.enum(["vscode", "cursor"])
|
|
26
|
-
.optional()
|
|
27
|
-
.describe("URI scheme: vscode (default) or cursor — match the user's desktop editor."),
|
|
28
|
-
};
|
|
29
|
-
export function createOpenInIdeHandler() {
|
|
30
|
-
return async (params) => {
|
|
31
|
-
const qs = new URLSearchParams();
|
|
32
|
-
qs.set("id", params.id);
|
|
33
|
-
if (params.label) {
|
|
34
|
-
qs.set(params.kind === "document" ? "title" : "name", params.label);
|
|
35
|
-
}
|
|
36
|
-
const scheme = params.ide_client === "cursor" ? "cursor" : "vscode";
|
|
37
|
-
const uri = `${scheme}://zivisai.zivis-security/${params.kind}?${qs.toString()}`;
|
|
38
|
-
const result = {
|
|
39
|
-
uri,
|
|
40
|
-
kind: params.kind,
|
|
41
|
-
id: params.id,
|
|
42
|
-
hint: "Open this URI to launch the ZIVIS Code IDE extension. Requires the zivisai.zivis-security extension to be installed.",
|
|
43
|
-
};
|
|
44
|
-
return {
|
|
45
|
-
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
}
|