@datasynx/agentic-ai-cartography 0.1.8 → 0.2.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.
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ scanAllBookmarks
4
+ } from "./chunk-JAFRT2R6.js";
5
+ export {
6
+ scanAllBookmarks
7
+ };
8
+ //# sourceMappingURL=bookmarks-O7KNR7D3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,118 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/types.ts
4
+ import { z } from "zod";
5
+ var NODE_TYPES = [
6
+ "host",
7
+ "database_server",
8
+ "database",
9
+ "table",
10
+ "web_service",
11
+ "api_endpoint",
12
+ "cache_server",
13
+ "message_broker",
14
+ "queue",
15
+ "topic",
16
+ "container",
17
+ "pod",
18
+ "k8s_cluster",
19
+ "config_file",
20
+ "saas_tool",
21
+ "unknown"
22
+ ];
23
+ var EDGE_RELATIONSHIPS = [
24
+ "connects_to",
25
+ "reads_from",
26
+ "writes_to",
27
+ "calls",
28
+ "contains",
29
+ "depends_on"
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
+ var NodeSchema = z.object({
40
+ id: z.string().describe('Format: "{type}:{host}:{port}" oder "{type}:{name}"'),
41
+ type: z.enum(NODE_TYPES),
42
+ name: z.string(),
43
+ discoveredVia: z.string(),
44
+ confidence: z.number().min(0).max(1).default(0.5),
45
+ metadata: z.record(z.unknown()).default({}),
46
+ tags: z.array(z.string()).default([])
47
+ });
48
+ var EdgeSchema = z.object({
49
+ sourceId: z.string(),
50
+ targetId: z.string(),
51
+ relationship: z.enum(EDGE_RELATIONSHIPS),
52
+ evidence: z.string(),
53
+ confidence: z.number().min(0).max(1).default(0.5)
54
+ });
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
+ var SOPStepSchema = z.object({
65
+ order: z.number(),
66
+ instruction: z.string(),
67
+ tool: z.string(),
68
+ target: z.string().optional(),
69
+ notes: z.string().optional()
70
+ });
71
+ var SOPSchema = z.object({
72
+ title: z.string(),
73
+ description: z.string(),
74
+ steps: z.array(SOPStepSchema),
75
+ involvedSystems: z.array(z.string()),
76
+ estimatedDuration: z.string(),
77
+ frequency: z.string(),
78
+ confidence: z.number().min(0).max(1)
79
+ });
80
+ var MIN_POLL_INTERVAL_MS = 15e3;
81
+ function defaultConfig(overrides = {}) {
82
+ const home = process.env.HOME ?? process.env.USERPROFILE ?? "/tmp";
83
+ return {
84
+ mode: "discover",
85
+ maxDepth: 8,
86
+ maxTurns: 50,
87
+ entryPoints: ["localhost"],
88
+ 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
+ outputDir: "./cartography-output",
98
+ dbPath: `${home}/.cartography/cartography.db`,
99
+ socketPath: `${home}/.cartography/daemon.sock`,
100
+ pidFile: `${home}/.cartography/daemon.pid`,
101
+ verbose: false,
102
+ ...overrides
103
+ };
104
+ }
105
+
106
+ export {
107
+ NODE_TYPES,
108
+ EDGE_RELATIONSHIPS,
109
+ EVENT_TYPES,
110
+ NodeSchema,
111
+ EdgeSchema,
112
+ EventSchema,
113
+ SOPStepSchema,
114
+ SOPSchema,
115
+ MIN_POLL_INTERVAL_MS,
116
+ defaultConfig
117
+ };
118
+ //# sourceMappingURL=chunk-EVJP2FWQ.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\nexport const EVENT_TYPES = [\n 'process_start', 'process_end',\n 'connection_open', 'connection_close',\n 'window_focus', 'tool_switch',\n] as const;\nexport type EventType = typeof EVENT_TYPES[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 EventSchema = z.object({\n eventType: z.enum(EVENT_TYPES),\n process: z.string(),\n pid: z.number(),\n target: z.string().optional(),\n targetType: z.enum(NODE_TYPES).optional(),\n protocol: z.string().optional(),\n port: z.number().optional(),\n});\nexport type ActivityEvent = z.infer<typeof EventSchema>;\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 EventRow {\n id: string;\n sessionId: string;\n taskId?: string;\n timestamp: string;\n eventType: EventType;\n process: string;\n pid: number;\n target?: string;\n targetType?: NodeType;\n port?: number;\n durationMs?: number;\n}\n\nexport interface TaskRow {\n id: string;\n sessionId: string;\n description?: string;\n startedAt: string;\n completedAt?: string;\n steps: string;\n involvedServices: string;\n status: 'active' | 'completed' | 'cancelled';\n isSOPCandidate: boolean;\n}\n\nexport interface WorkflowRow {\n id: string;\n sessionId: string;\n name?: string;\n pattern: string;\n taskIds: string;\n occurrences: number;\n firstSeen: string;\n lastSeen: string;\n avgDurationMs: number;\n involvedServices: string;\n}\n\nexport interface SessionRow {\n id: string;\n mode: 'discover' | 'shadow';\n startedAt: string;\n completedAt?: string;\n config: string;\n}\n\n// ── IPC Protokoll ────────────────────────\n\nexport type DaemonMessage =\n | { type: 'event'; data: EventRow }\n | { type: 'prompt'; id: string; prompt: PendingPrompt }\n | { type: 'status'; data: ShadowStatus }\n | { type: 'agent-output'; text: string }\n | { type: 'info'; message: string };\n\nexport type ClientMessage =\n | { type: 'prompt-response'; id: string; answer: string }\n | { type: 'command'; command: 'new-task' | 'end-task' | 'status' | 'stop' | 'pause' | 'resume' }\n | { type: 'task-description'; description: string };\n\nexport interface PendingPrompt {\n kind: 'node-approval' | 'task-boundary' | 'task-end';\n context: Record<string, unknown>;\n options: string[];\n defaultAnswer: string;\n timeoutMs: number;\n createdAt: string;\n}\n\nexport interface ShadowStatus {\n pid: number;\n uptime: number;\n nodeCount: number;\n eventCount: number;\n taskCount: number;\n sopCount: number;\n pendingPrompts: number;\n autoSave: boolean;\n mode: 'foreground' | 'daemon';\n agentActive: boolean;\n paused: boolean;\n cyclesRun: number;\n cyclesSkipped: number;\n}\n\n// ── Config ───────────────────────────────\n\nexport const MIN_POLL_INTERVAL_MS = 15_000; // 15s Minimum (Agent SDK Overhead)\n\nexport interface CartographyConfig {\n mode: 'discover' | 'shadow';\n maxDepth: number;\n maxTurns: number;\n entryPoints: string[];\n agentModel: string;\n shadowMode: 'foreground' | 'daemon';\n pollIntervalMs: number;\n inactivityTimeoutMs: number;\n promptTimeoutMs: number;\n trackWindowFocus: boolean;\n autoSaveNodes: boolean;\n enableNotifications: boolean;\n shadowModel: string;\n organization?: string;\n outputDir: string;\n dbPath: string;\n socketPath: string;\n pidFile: 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 mode: 'discover',\n maxDepth: 8,\n maxTurns: 50,\n entryPoints: ['localhost'],\n agentModel: 'claude-sonnet-4-5-20250929',\n shadowMode: 'daemon',\n pollIntervalMs: 30_000,\n inactivityTimeoutMs: 300_000,\n promptTimeoutMs: 60_000,\n trackWindowFocus: false,\n autoSaveNodes: false,\n enableNotifications: true,\n shadowModel: 'claude-haiku-4-5-20251001',\n outputDir: './cartography-output',\n dbPath: `${home}/.cartography/cartography.db`,\n socketPath: `${home}/.cartography/daemon.sock`,\n pidFile: `${home}/.cartography/daemon.pid`,\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,EAAg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