@datasynx/agentic-ai-cartography 0.2.6 → 0.3.2
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 +14 -77
- package/dist/{chunk-EVJP2FWQ.js → chunk-FFNOC6HF.js} +1 -33
- package/dist/chunk-FFNOC6HF.js.map +1 -0
- package/dist/cli.js +793 -988
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +24 -118
- package/dist/index.js +3 -183
- package/dist/index.js.map +1 -1
- package/dist/{types-NKF6BRMZ.js → types-ROE3Z6HY.js} +2 -8
- package/package.json +2 -3
- package/dist/chunk-EVJP2FWQ.js.map +0 -1
- package/dist/chunk-LNMM7BTH.js +0 -989
- package/dist/chunk-LNMM7BTH.js.map +0 -1
- package/dist/exporter-PWVD7Y6T.js +0 -24
- package/dist/types-NKF6BRMZ.js.map +0 -1
- /package/dist/{exporter-PWVD7Y6T.js.map → types-ROE3Z6HY.js.map} +0 -0
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**
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/@datasynx/agentic-ai-cartography)
|
|
8
8
|
[](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.*
|
|
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).*
|
|
17
17
|
|
|
18
18
|
<br/>
|
|
19
19
|
|
|
@@ -59,10 +59,7 @@ $ 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
|
-
| **
|
|
63
|
-
| **SOP Generation** | Automatically generates Standard Operating Procedures from observed workflows |
|
|
64
|
-
| **SOP Dashboard** | HTML dashboard with all SOPs, step details, frequency stats |
|
|
65
|
-
| **Export Formats** | Mermaid topology, D3.js interactive graph, Backstage YAML, JSON, SOP Markdown |
|
|
62
|
+
| **Export Formats** | Mermaid topology, D3.js interactive graph, Backstage YAML, JSON |
|
|
66
63
|
| **Safety First** | `PreToolUse` hook blocks all destructive Bash commands — 100% read-only |
|
|
67
64
|
|
|
68
65
|
---
|
|
@@ -107,22 +104,6 @@ datasynx-cartography seed
|
|
|
107
104
|
# View all browser bookmarks
|
|
108
105
|
datasynx-cartography bookmarks
|
|
109
106
|
|
|
110
|
-
# Start background observer (Claude Haiku, every 30s)
|
|
111
|
-
datasynx-cartography shadow start
|
|
112
|
-
|
|
113
|
-
# Attach to live event feed
|
|
114
|
-
datasynx-cartography shadow attach # [P] pause [T] new task [D] detach [Q] stop
|
|
115
|
-
|
|
116
|
-
# Pause / resume the daemon
|
|
117
|
-
datasynx-cartography shadow pause
|
|
118
|
-
datasynx-cartography shadow resume
|
|
119
|
-
|
|
120
|
-
# Stop daemon + generate SOPs + open HTML dashboard
|
|
121
|
-
datasynx-cartography shadow stop
|
|
122
|
-
|
|
123
|
-
# Generate SOPs manually from a session
|
|
124
|
-
datasynx-cartography sops [session-id]
|
|
125
|
-
|
|
126
107
|
# Full feature reference
|
|
127
108
|
datasynx-cartography docs
|
|
128
109
|
```
|
|
@@ -153,31 +134,11 @@ Discovery pipeline (automatic, in order):
|
|
|
153
134
|
5. **Config files** — `.env`, `docker-compose.yml`, etc.
|
|
154
135
|
6. **Human-in-the-loop** — interactive follow-up after initial scan
|
|
155
136
|
|
|
156
|
-
### Shadow Daemon
|
|
157
|
-
|
|
158
|
-
```
|
|
159
|
-
datasynx-cartography shadow start [options]
|
|
160
|
-
|
|
161
|
-
--interval <ms> Poll interval (default: 30000, min: 15000)
|
|
162
|
-
--inactivity <ms> Task boundary gap (default: 300000)
|
|
163
|
-
--model <m> Claude model (default: claude-haiku-4-5-...)
|
|
164
|
-
--track-windows Track window focus (requires xdotool)
|
|
165
|
-
--auto-save Save nodes without prompting
|
|
166
|
-
--foreground Run in foreground (no fork)
|
|
167
|
-
|
|
168
|
-
datasynx-cartography shadow stop # stops + generates SOPs + opens dashboard
|
|
169
|
-
datasynx-cartography shadow pause # SIGUSR1
|
|
170
|
-
datasynx-cartography shadow resume # SIGUSR2
|
|
171
|
-
datasynx-cartography shadow status
|
|
172
|
-
datasynx-cartography shadow attach
|
|
173
|
-
```
|
|
174
|
-
|
|
175
137
|
### Analysis & Export
|
|
176
138
|
|
|
177
139
|
```
|
|
178
|
-
datasynx-cartography sops [session-id] Generate SOPs from observed workflows
|
|
179
140
|
datasynx-cartography export [session-id] [options]
|
|
180
|
-
--format <fmt...> mermaid, json, yaml, html
|
|
141
|
+
--format <fmt...> mermaid, json, yaml, html (default: all)
|
|
181
142
|
-o, --output <dir> Output directory
|
|
182
143
|
datasynx-cartography show [session-id] Session details + node list
|
|
183
144
|
datasynx-cartography sessions List all sessions
|
|
@@ -197,28 +158,16 @@ datasynx-output/
|
|
|
197
158
|
├── catalog-info.yaml Backstage service catalog
|
|
198
159
|
├── topology.mermaid Infrastructure topology (graph TB)
|
|
199
160
|
├── dependencies.mermaid Service dependencies (graph LR)
|
|
200
|
-
|
|
201
|
-
├── sop-dashboard.html HTML dashboard with all SOPs + frequency stats
|
|
202
|
-
├── sops/
|
|
203
|
-
│ ├── deploy-check.md
|
|
204
|
-
│ └── db-migration.md
|
|
205
|
-
└── workflows/
|
|
206
|
-
└── workflow-001.mermaid
|
|
161
|
+
└── topology.html Interactive D3.js force graph
|
|
207
162
|
```
|
|
208
163
|
|
|
209
164
|
---
|
|
210
165
|
|
|
211
166
|
## Cost Estimate
|
|
212
167
|
|
|
213
|
-
| Mode | Model | Interval |
|
|
214
|
-
|
|
215
|
-
| Discover | Sonnet | one-shot | $0.15–0.50 |
|
|
216
|
-
| Shadow | Haiku | 30s | $0.12–0.36 | $0.96–2.88 |
|
|
217
|
-
| Shadow | Haiku | 60s | $0.06–0.18 | $0.48–1.44 |
|
|
218
|
-
| Shadow (quiet)* | Haiku | 30s | ~$0.02 | ~$0.16 |
|
|
219
|
-
| SOP generation | Sonnet | one-shot | $0.01–0.03 | one-shot |
|
|
220
|
-
|
|
221
|
-
\* *quiet = diff-check skips ~90% of cycles when the system is idle*
|
|
168
|
+
| Mode | Model | Interval | Typical Cost |
|
|
169
|
+
|------|-------|----------|-------------|
|
|
170
|
+
| Discover | Sonnet | one-shot | $0.15–0.50 |
|
|
222
171
|
|
|
223
172
|
---
|
|
224
173
|
|
|
@@ -228,22 +177,13 @@ datasynx-output/
|
|
|
228
177
|
CLI (Commander.js)
|
|
229
178
|
└── Preflight: Claude CLI + API key + interval validation
|
|
230
179
|
└── Agent Orchestrator (src/agent.ts)
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
├── runShadowCycle() Claude Haiku + MCP Tools only (no Bash)
|
|
238
|
-
└── generateSOPs() Anthropic Messages API (no agent loop)
|
|
180
|
+
└── runDiscovery() Claude Sonnet + Bash + MCP Tools
|
|
181
|
+
├── scan_bookmarks() browser bookmark extraction
|
|
182
|
+
├── scan_installed_apps() /Applications, brew, dpkg, which
|
|
183
|
+
├── scan_k8s_resources() kubectl (readonly)
|
|
184
|
+
├── scan_aws/gcp/azure() cloud CLI scans (readonly)
|
|
185
|
+
└── ask_user() human-in-the-loop questions
|
|
239
186
|
└── Custom MCP Tools → CartographyDB (SQLite WAL)
|
|
240
|
-
|
|
241
|
-
Shadow Daemon (src/daemon.ts)
|
|
242
|
-
├── takeSnapshot() → ss + ps (no Claude!)
|
|
243
|
-
├── Diff-check → calls Claude only when something changed
|
|
244
|
-
├── SIGUSR1/2 → pause / resume
|
|
245
|
-
├── IPC Server → Unix socket ~/.cartography/daemon.sock
|
|
246
|
-
└── Notifications → desktop alerts when no client attached
|
|
247
187
|
```
|
|
248
188
|
|
|
249
189
|
### Safety
|
|
@@ -260,10 +200,7 @@ Every Bash call is guarded by a `PreToolUse` hook that blocks destructive comman
|
|
|
260
200
|
import {
|
|
261
201
|
CartographyDB,
|
|
262
202
|
runDiscovery,
|
|
263
|
-
runShadowCycle,
|
|
264
|
-
generateSOPs,
|
|
265
203
|
exportAll,
|
|
266
|
-
exportSOPDashboard,
|
|
267
204
|
safetyHook,
|
|
268
205
|
defaultConfig,
|
|
269
206
|
} from '@datasynx/agentic-ai-cartography';
|
|
@@ -28,14 +28,6 @@ var EDGE_RELATIONSHIPS = [
|
|
|
28
28
|
"contains",
|
|
29
29
|
"depends_on"
|
|
30
30
|
];
|
|
31
|
-
var EVENT_TYPES = [
|
|
32
|
-
"process_start",
|
|
33
|
-
"process_end",
|
|
34
|
-
"connection_open",
|
|
35
|
-
"connection_close",
|
|
36
|
-
"window_focus",
|
|
37
|
-
"tool_switch"
|
|
38
|
-
];
|
|
39
31
|
var NodeSchema = z.object({
|
|
40
32
|
id: z.string().describe('Format: "{type}:{host}:{port}" oder "{type}:{name}"'),
|
|
41
33
|
type: z.enum(NODE_TYPES),
|
|
@@ -52,15 +44,6 @@ var EdgeSchema = z.object({
|
|
|
52
44
|
evidence: z.string(),
|
|
53
45
|
confidence: z.number().min(0).max(1).default(0.5)
|
|
54
46
|
});
|
|
55
|
-
var EventSchema = z.object({
|
|
56
|
-
eventType: z.enum(EVENT_TYPES),
|
|
57
|
-
process: z.string(),
|
|
58
|
-
pid: z.number(),
|
|
59
|
-
target: z.string().optional(),
|
|
60
|
-
targetType: z.enum(NODE_TYPES).optional(),
|
|
61
|
-
protocol: z.string().optional(),
|
|
62
|
-
port: z.number().optional()
|
|
63
|
-
});
|
|
64
47
|
var SOPStepSchema = z.object({
|
|
65
48
|
order: z.number(),
|
|
66
49
|
instruction: z.string(),
|
|
@@ -77,27 +60,15 @@ var SOPSchema = z.object({
|
|
|
77
60
|
frequency: z.string(),
|
|
78
61
|
confidence: z.number().min(0).max(1)
|
|
79
62
|
});
|
|
80
|
-
var MIN_POLL_INTERVAL_MS = 15e3;
|
|
81
63
|
function defaultConfig(overrides = {}) {
|
|
82
64
|
const home = process.env.HOME ?? process.env.USERPROFILE ?? "/tmp";
|
|
83
65
|
return {
|
|
84
|
-
mode: "discover",
|
|
85
66
|
maxDepth: 8,
|
|
86
67
|
maxTurns: 50,
|
|
87
68
|
entryPoints: ["localhost"],
|
|
88
69
|
agentModel: "claude-sonnet-4-5-20250929",
|
|
89
|
-
shadowMode: "daemon",
|
|
90
|
-
pollIntervalMs: 3e4,
|
|
91
|
-
inactivityTimeoutMs: 3e5,
|
|
92
|
-
promptTimeoutMs: 6e4,
|
|
93
|
-
trackWindowFocus: false,
|
|
94
|
-
autoSaveNodes: false,
|
|
95
|
-
enableNotifications: true,
|
|
96
|
-
shadowModel: "claude-haiku-4-5-20251001",
|
|
97
70
|
outputDir: "./cartography-output",
|
|
98
71
|
dbPath: `${home}/.cartography/cartography.db`,
|
|
99
|
-
socketPath: `${home}/.cartography/daemon.sock`,
|
|
100
|
-
pidFile: `${home}/.cartography/daemon.pid`,
|
|
101
72
|
verbose: false,
|
|
102
73
|
...overrides
|
|
103
74
|
};
|
|
@@ -106,13 +77,10 @@ function defaultConfig(overrides = {}) {
|
|
|
106
77
|
export {
|
|
107
78
|
NODE_TYPES,
|
|
108
79
|
EDGE_RELATIONSHIPS,
|
|
109
|
-
EVENT_TYPES,
|
|
110
80
|
NodeSchema,
|
|
111
81
|
EdgeSchema,
|
|
112
|
-
EventSchema,
|
|
113
82
|
SOPStepSchema,
|
|
114
83
|
SOPSchema,
|
|
115
|
-
MIN_POLL_INTERVAL_MS,
|
|
116
84
|
defaultConfig
|
|
117
85
|
};
|
|
118
|
-
//# sourceMappingURL=chunk-
|
|
86
|
+
//# sourceMappingURL=chunk-FFNOC6HF.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});\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// ── 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,EAAmB;AAAA,EAAY;AAAA,EACvC;AAAA,EAAe;AAAA,EAAgB;AAAA,EAC/B;AAAA,EAAkB;AAAA,EAAS;AAAA,EAC3B;AAAA,EAAa;AAAA,EAAO;AAAA,EACpB;AAAA,EAAe;AAAA,EAAa;AAC9B;AAGO,IAAM,qBAAqB;AAAA,EAChC;AAAA,EAAe;AAAA,EAAc;AAAA,EAC7B;AAAA,EAAS;AAAA,EAAY;AACvB;AAKO,IAAM,aAAa,EAAE,OAAO;AAAA,EACjC,IAAI,EAAE,OAAO,EAAE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