@datasynx/agentic-ai-cartography 0.3.3 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # 🗺️ Datasynx Cartography
4
4
 
5
- **AI-powered Infrastructure Cartography**
5
+ **AI-powered Infrastructure Cartography & SOP Generation**
6
6
 
7
7
  [![npm version](https://img.shields.io/npm/v/@datasynx/agentic-ai-cartography?style=flat-square&color=CB3837&logo=npm&logoColor=white)](https://www.npmjs.com/package/@datasynx/agentic-ai-cartography)
8
8
  [![npm downloads](https://img.shields.io/npm/dm/@datasynx/agentic-ai-cartography?style=flat-square&color=CB3837&logo=npm&logoColor=white)](https://www.npmjs.com/package/@datasynx/agentic-ai-cartography)
@@ -13,7 +13,7 @@
13
13
 
14
14
  <br/>
15
15
 
16
- *Claude IS the agent — it decides which read-only commands to run, analyses the output, and stores results via custom MCP tools into SQLite. No hand-written parsers, diff logic, or decision trees. SOP generation is available separately via [@datasynx/cartography-shadow](https://github.com/datasynx-ai/agentic-ai-shadowing).*
16
+ *Claude IS the agent — it decides which read-only commands to run, analyses the output, and stores results via custom MCP tools into SQLite. No hand-written parsers, diff logic, or decision trees.*
17
17
 
18
18
  <br/>
19
19
 
@@ -59,7 +59,9 @@ $ datasynx-cartography discover
59
59
  | **Browser Bookmarks** | Chrome, Firefox, Safari, Brave, Edge — extracts business/SaaS domains automatically |
60
60
  | **Cloud Scanning** | AWS (EC2/RDS/EKS/S3), GCP (Compute/GKE/Cloud Run), Azure (AKS/WebApps), Kubernetes |
61
61
  | **Human-in-the-Loop** | Chat with the agent mid-discovery: type `"hubspot windsurf"` to search for specific tools |
62
- | **Export Formats** | Mermaid topology, D3.js interactive graph, Backstage YAML, JSON |
62
+ | **SOP Generation** | Automatically generates Standard Operating Procedures from observed workflows |
63
+ | **SOP Dashboard** | HTML dashboard with all SOPs, step details, frequency stats |
64
+ | **Export Formats** | Mermaid topology, D3.js interactive graph, Backstage YAML, JSON, SOP Markdown |
63
65
  | **Safety First** | `PreToolUse` hook blocks all destructive Bash commands — 100% read-only |
64
66
 
65
67
  ---
@@ -138,7 +140,7 @@ Discovery pipeline (automatic, in order):
138
140
 
139
141
  ```
140
142
  datasynx-cartography export [session-id] [options]
141
- --format <fmt...> mermaid, json, yaml, html (default: all)
143
+ --format <fmt...> mermaid, json, yaml, html, sops (default: all)
142
144
  -o, --output <dir> Output directory
143
145
  datasynx-cartography show [session-id] Session details + node list
144
146
  datasynx-cartography sessions List all sessions
@@ -158,16 +160,23 @@ datasynx-output/
158
160
  ├── catalog-info.yaml Backstage service catalog
159
161
  ├── topology.mermaid Infrastructure topology (graph TB)
160
162
  ├── dependencies.mermaid Service dependencies (graph LR)
161
- └── topology.html Interactive D3.js force graph
163
+ ├── topology.html Interactive D3.js force graph
164
+ ├── sop-dashboard.html HTML dashboard with all SOPs + frequency stats
165
+ ├── sops/
166
+ │ ├── deploy-check.md
167
+ │ └── db-migration.md
168
+ └── workflows/
169
+ └── workflow-001.mermaid
162
170
  ```
163
171
 
164
172
  ---
165
173
 
166
174
  ## Cost Estimate
167
175
 
168
- | Mode | Model | Interval | Typical Cost |
169
- |------|-------|----------|-------------|
170
- | Discover | Sonnet | one-shot | $0.15–0.50 |
176
+ | Mode | Model | Interval | per Hour | per 8h Day |
177
+ |------|-------|----------|----------|------------|
178
+ | Discover | Sonnet | one-shot | $0.15–0.50 | one-shot |
179
+ | SOP generation | Sonnet | one-shot | $0.01–0.03 | one-shot |
171
180
 
172
181
  ---
173
182
 
@@ -201,6 +210,7 @@ import {
201
210
  CartographyDB,
202
211
  runDiscovery,
203
212
  exportAll,
213
+ exportSOPDashboard,
204
214
  safetyHook,
205
215
  defaultConfig,
206
216
  } from '@datasynx/agentic-ai-cartography';
@@ -35,7 +35,10 @@ var NodeSchema = z.object({
35
35
  discoveredVia: z.string(),
36
36
  confidence: z.number().min(0).max(1).default(0.5),
37
37
  metadata: z.record(z.unknown()).default({}),
38
- tags: z.array(z.string()).default([])
38
+ tags: z.array(z.string()).default([]),
39
+ domain: z.string().optional().describe('Business domain, e.g. "Marketing", "Finance"'),
40
+ subDomain: z.string().optional().describe('Sub-domain, e.g. "Forecast client orders"'),
41
+ qualityScore: z.number().min(0).max(100).optional().describe("Data quality score 0\u2013100")
39
42
  });
40
43
  var EdgeSchema = z.object({
41
44
  sourceId: z.string(),
@@ -60,6 +63,63 @@ var SOPSchema = z.object({
60
63
  frequency: z.string(),
61
64
  confidence: z.number().min(0).max(1)
62
65
  });
66
+ var DataAssetSchema = z.object({
67
+ id: z.string(),
68
+ name: z.string(),
69
+ domain: z.string(),
70
+ subDomain: z.string().optional(),
71
+ qualityScore: z.number().min(0).max(100).optional(),
72
+ metadata: z.record(z.unknown()).default({}),
73
+ position: z.object({ q: z.number(), r: z.number() })
74
+ });
75
+ var ClusterSchema = z.object({
76
+ id: z.string(),
77
+ label: z.string(),
78
+ domain: z.string(),
79
+ color: z.string(),
80
+ assetIds: z.array(z.string()),
81
+ centroid: z.object({ x: z.number(), y: z.number() })
82
+ });
83
+ var ConnectionSchema = z.object({
84
+ id: z.string(),
85
+ sourceAssetId: z.string(),
86
+ targetAssetId: z.string(),
87
+ type: z.string().optional()
88
+ });
89
+ var DOMAIN_COLORS = {
90
+ "Quality Control": "#1a2744",
91
+ "Supply Chain": "#1e3a6e",
92
+ "Marketing": "#6a7fb5",
93
+ "Finance": "#3a8a8a",
94
+ "HR": "#2a5a9a",
95
+ "Logistics": "#0e7490",
96
+ "Sales": "#1d4ed8",
97
+ "Engineering": "#4338ca",
98
+ "Operations": "#0891b2",
99
+ "Data Layer": "#1e3352",
100
+ "Web / API": "#1a3a1a",
101
+ "Messaging": "#2a1a3a",
102
+ "Infrastructure": "#0f2a40",
103
+ "Other": "#374151"
104
+ };
105
+ var DOMAIN_PALETTE = [
106
+ "#1a2e5a",
107
+ "#1e3a8a",
108
+ "#1d4ed8",
109
+ "#2563eb",
110
+ "#3b82f6",
111
+ "#6366f1",
112
+ "#818cf8",
113
+ "#7c9fc3",
114
+ "#0e7490",
115
+ "#0891b2",
116
+ "#06b6d4",
117
+ "#22d3ee",
118
+ "#0d9488",
119
+ "#14b8a6",
120
+ "#2dd4bf",
121
+ "#5eead4"
122
+ ];
63
123
  function defaultConfig(overrides = {}) {
64
124
  const home = process.env.HOME ?? process.env.USERPROFILE ?? "/tmp";
65
125
  return {
@@ -81,6 +141,11 @@ export {
81
141
  EdgeSchema,
82
142
  SOPStepSchema,
83
143
  SOPSchema,
144
+ DataAssetSchema,
145
+ ClusterSchema,
146
+ ConnectionSchema,
147
+ DOMAIN_COLORS,
148
+ DOMAIN_PALETTE,
84
149
  defaultConfig
85
150
  };
86
- //# sourceMappingURL=chunk-FFNOC6HF.js.map
151
+ //# sourceMappingURL=chunk-A7FTULDM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/types.ts"],"sourcesContent":["import { z } from 'zod';\n\n// ── Enums ────────────────────────────────\n\nexport const NODE_TYPES = [\n 'host', 'database_server', 'database', 'table',\n 'web_service', 'api_endpoint', 'cache_server',\n 'message_broker', 'queue', 'topic',\n 'container', 'pod', 'k8s_cluster',\n 'config_file', 'saas_tool', 'unknown',\n] as const;\nexport type NodeType = typeof NODE_TYPES[number];\n\nexport const EDGE_RELATIONSHIPS = [\n 'connects_to', 'reads_from', 'writes_to',\n 'calls', 'contains', 'depends_on',\n] as const;\nexport type EdgeRelationship = typeof EDGE_RELATIONSHIPS[number];\n\n// ── Zod Schemas ──────────────────────────\n\nexport const NodeSchema = z.object({\n id: z.string().describe('Format: \"{type}:{host}:{port}\" oder \"{type}:{name}\"'),\n type: z.enum(NODE_TYPES),\n name: z.string(),\n discoveredVia: z.string(),\n confidence: z.number().min(0).max(1).default(0.5),\n metadata: z.record(z.unknown()).default({}),\n tags: z.array(z.string()).default([]),\n domain: z.string().optional().describe('Business domain, e.g. \"Marketing\", \"Finance\"'),\n subDomain: z.string().optional().describe('Sub-domain, e.g. \"Forecast client orders\"'),\n qualityScore: z.number().min(0).max(100).optional().describe('Data quality score 0–100'),\n});\nexport type DiscoveryNode = z.infer<typeof NodeSchema>;\n\nexport const EdgeSchema = z.object({\n sourceId: z.string(),\n targetId: z.string(),\n relationship: z.enum(EDGE_RELATIONSHIPS),\n evidence: z.string(),\n confidence: z.number().min(0).max(1).default(0.5),\n});\nexport type DiscoveryEdge = z.infer<typeof EdgeSchema>;\n\nexport const SOPStepSchema = z.object({\n order: z.number(),\n instruction: z.string(),\n tool: z.string(),\n target: z.string().optional(),\n notes: z.string().optional(),\n});\nexport type SOPStep = z.infer<typeof SOPStepSchema>;\n\nexport const SOPSchema = z.object({\n title: z.string(),\n description: z.string(),\n steps: z.array(SOPStepSchema),\n involvedSystems: z.array(z.string()),\n estimatedDuration: z.string(),\n frequency: z.string(),\n confidence: z.number().min(0).max(1),\n});\nexport type SOP = z.infer<typeof SOPSchema>;\n\n// ── Cartography Map Types ────────────────\n\nexport const DataAssetSchema = z.object({\n id: z.string(),\n name: z.string(),\n domain: z.string(),\n subDomain: z.string().optional(),\n qualityScore: z.number().min(0).max(100).optional(),\n metadata: z.record(z.unknown()).default({}),\n position: z.object({ q: z.number(), r: z.number() }),\n});\nexport type DataAsset = z.infer<typeof DataAssetSchema>;\n\nexport const ClusterSchema = z.object({\n id: z.string(),\n label: z.string(),\n domain: z.string(),\n color: z.string(),\n assetIds: z.array(z.string()),\n centroid: z.object({ x: z.number(), y: z.number() }),\n});\nexport type Cluster = z.infer<typeof ClusterSchema>;\n\nexport const ConnectionSchema = z.object({\n id: z.string(),\n sourceAssetId: z.string(),\n targetAssetId: z.string(),\n type: z.string().optional(),\n});\nexport type Connection = z.infer<typeof ConnectionSchema>;\n\nexport interface CartographyMapData {\n assets: DataAsset[];\n clusters: Cluster[];\n connections: Connection[];\n meta: { exportedAt: string; theme: 'light' | 'dark' };\n}\n\n/** Navy → medium blue → periwinkle → teal/cyan palette */\nexport const DOMAIN_COLORS: Record<string, string> = {\n 'Quality Control': '#1a2744',\n 'Supply Chain': '#1e3a6e',\n 'Marketing': '#6a7fb5',\n 'Finance': '#3a8a8a',\n 'HR': '#2a5a9a',\n 'Logistics': '#0e7490',\n 'Sales': '#1d4ed8',\n 'Engineering': '#4338ca',\n 'Operations': '#0891b2',\n 'Data Layer': '#1e3352',\n 'Web / API': '#1a3a1a',\n 'Messaging': '#2a1a3a',\n 'Infrastructure': '#0f2a40',\n 'Other': '#374151',\n};\n\n/** Ordered palette for dynamic domain assignment */\nexport const DOMAIN_PALETTE = [\n '#1a2e5a', '#1e3a8a', '#1d4ed8', '#2563eb', '#3b82f6',\n '#6366f1', '#818cf8', '#7c9fc3', '#0e7490', '#0891b2',\n '#06b6d4', '#22d3ee', '#0d9488', '#14b8a6', '#2dd4bf', '#5eead4',\n] as const;\n\n// ── DB Row Types ─────────────────────────\n\nexport interface NodeRow extends DiscoveryNode {\n sessionId: string;\n discoveredAt: string;\n depth: number;\n pathId?: string;\n}\n\nexport interface EdgeRow extends DiscoveryEdge {\n id: string;\n sessionId: string;\n discoveredAt: string;\n pathId?: string;\n}\n\nexport interface SessionRow {\n id: string;\n mode: 'discover';\n startedAt: string;\n completedAt?: string;\n config: string;\n}\n\n// ── Config ───────────────────────────────\n\nexport interface CartographyConfig {\n maxDepth: number;\n maxTurns: number;\n entryPoints: string[];\n agentModel: string;\n organization?: string;\n outputDir: string;\n dbPath: string;\n verbose: boolean;\n}\n\nexport function defaultConfig(overrides: Partial<CartographyConfig> = {}): CartographyConfig {\n const home = process.env.HOME ?? process.env.USERPROFILE ?? '/tmp';\n return {\n maxDepth: 8,\n maxTurns: 50,\n entryPoints: ['localhost'],\n agentModel: 'claude-sonnet-4-5-20250929',\n outputDir: './cartography-output',\n dbPath: `${home}/.cartography/cartography.db`,\n verbose: false,\n ...overrides,\n };\n}\n"],"mappings":";;;AAAA,SAAS,SAAS;AAIX,IAAM,aAAa;AAAA,EACxB;AAAA,EAAQ;AAAA,EA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