@datasynx/agentic-ai-cartography 0.2.5 → 0.3.1

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/index.d.ts CHANGED
@@ -5,8 +5,6 @@ declare const NODE_TYPES: readonly ["host", "database_server", "database", "tabl
5
5
  type NodeType = typeof NODE_TYPES[number];
6
6
  declare const EDGE_RELATIONSHIPS: readonly ["connects_to", "reads_from", "writes_to", "calls", "contains", "depends_on"];
7
7
  type EdgeRelationship = typeof EDGE_RELATIONSHIPS[number];
8
- declare const EVENT_TYPES: readonly ["process_start", "process_end", "connection_open", "connection_close", "window_focus", "tool_switch"];
9
- type EventType = typeof EVENT_TYPES[number];
10
8
  declare const NodeSchema: z.ZodObject<{
11
9
  id: z.ZodString;
12
10
  type: z.ZodEnum<["host", "database_server", "database", "table", "web_service", "api_endpoint", "cache_server", "message_broker", "queue", "topic", "container", "pod", "k8s_cluster", "config_file", "saas_tool", "unknown"]>;
@@ -53,32 +51,6 @@ declare const EdgeSchema: z.ZodObject<{
53
51
  confidence?: number | undefined;
54
52
  }>;
55
53
  type DiscoveryEdge = z.infer<typeof EdgeSchema>;
56
- declare const EventSchema: z.ZodObject<{
57
- eventType: z.ZodEnum<["process_start", "process_end", "connection_open", "connection_close", "window_focus", "tool_switch"]>;
58
- process: z.ZodString;
59
- pid: z.ZodNumber;
60
- target: z.ZodOptional<z.ZodString>;
61
- targetType: z.ZodOptional<z.ZodEnum<["host", "database_server", "database", "table", "web_service", "api_endpoint", "cache_server", "message_broker", "queue", "topic", "container", "pod", "k8s_cluster", "config_file", "saas_tool", "unknown"]>>;
62
- protocol: z.ZodOptional<z.ZodString>;
63
- port: z.ZodOptional<z.ZodNumber>;
64
- }, "strip", z.ZodTypeAny, {
65
- eventType: "process_start" | "process_end" | "connection_open" | "connection_close" | "window_focus" | "tool_switch";
66
- process: string;
67
- pid: number;
68
- target?: string | undefined;
69
- targetType?: "host" | "database_server" | "database" | "table" | "web_service" | "api_endpoint" | "cache_server" | "message_broker" | "queue" | "topic" | "container" | "pod" | "k8s_cluster" | "config_file" | "saas_tool" | "unknown" | undefined;
70
- protocol?: string | undefined;
71
- port?: number | undefined;
72
- }, {
73
- eventType: "process_start" | "process_end" | "connection_open" | "connection_close" | "window_focus" | "tool_switch";
74
- process: string;
75
- pid: number;
76
- target?: string | undefined;
77
- targetType?: "host" | "database_server" | "database" | "table" | "web_service" | "api_endpoint" | "cache_server" | "message_broker" | "queue" | "topic" | "container" | "pod" | "k8s_cluster" | "config_file" | "saas_tool" | "unknown" | undefined;
78
- protocol?: string | undefined;
79
- port?: number | undefined;
80
- }>;
81
- type ActivityEvent = z.infer<typeof EventSchema>;
82
54
  declare const SOPStepSchema: z.ZodObject<{
83
55
  order: z.ZodNumber;
84
56
  instruction: z.ZodString;
@@ -167,16 +139,35 @@ interface EdgeRow extends DiscoveryEdge {
167
139
  discoveredAt: string;
168
140
  pathId?: string;
169
141
  }
142
+ interface SessionRow {
143
+ id: string;
144
+ mode: 'discover';
145
+ startedAt: string;
146
+ completedAt?: string;
147
+ config: string;
148
+ }
149
+ interface CartographyConfig {
150
+ maxDepth: number;
151
+ maxTurns: number;
152
+ entryPoints: string[];
153
+ agentModel: string;
154
+ organization?: string;
155
+ outputDir: string;
156
+ dbPath: string;
157
+ verbose: boolean;
158
+ }
159
+ declare function defaultConfig(overrides?: Partial<CartographyConfig>): CartographyConfig;
160
+
170
161
  interface EventRow {
171
162
  id: string;
172
163
  sessionId: string;
173
164
  taskId?: string;
174
165
  timestamp: string;
175
- eventType: EventType;
166
+ eventType: string;
176
167
  process: string;
177
168
  pid: number;
178
169
  target?: string;
179
- targetType?: NodeType;
170
+ targetType?: string;
180
171
  port?: number;
181
172
  durationMs?: number;
182
173
  }
@@ -203,94 +194,12 @@ interface WorkflowRow {
203
194
  avgDurationMs: number;
204
195
  involvedServices: string;
205
196
  }
206
- interface SessionRow {
207
- id: string;
208
- mode: 'discover' | 'shadow';
209
- startedAt: string;
210
- completedAt?: string;
211
- config: string;
212
- }
213
- type DaemonMessage = {
214
- type: 'event';
215
- data: EventRow;
216
- } | {
217
- type: 'prompt';
218
- id: string;
219
- prompt: PendingPrompt;
220
- } | {
221
- type: 'status';
222
- data: ShadowStatus;
223
- } | {
224
- type: 'agent-output';
225
- text: string;
226
- } | {
227
- type: 'info';
228
- message: string;
229
- };
230
- type ClientMessage = {
231
- type: 'prompt-response';
232
- id: string;
233
- answer: string;
234
- } | {
235
- type: 'command';
236
- command: 'new-task' | 'end-task' | 'status' | 'stop' | 'pause' | 'resume';
237
- } | {
238
- type: 'task-description';
239
- description: string;
240
- };
241
- interface PendingPrompt {
242
- kind: 'node-approval' | 'task-boundary' | 'task-end';
243
- context: Record<string, unknown>;
244
- options: string[];
245
- defaultAnswer: string;
246
- timeoutMs: number;
247
- createdAt: string;
248
- }
249
- interface ShadowStatus {
250
- pid: number;
251
- uptime: number;
252
- nodeCount: number;
253
- eventCount: number;
254
- taskCount: number;
255
- sopCount: number;
256
- pendingPrompts: number;
257
- autoSave: boolean;
258
- mode: 'foreground' | 'daemon';
259
- agentActive: boolean;
260
- paused: boolean;
261
- cyclesRun: number;
262
- cyclesSkipped: number;
263
- }
264
- declare const MIN_POLL_INTERVAL_MS = 15000;
265
- interface CartographyConfig {
266
- mode: 'discover' | 'shadow';
267
- maxDepth: number;
268
- maxTurns: number;
269
- entryPoints: string[];
270
- agentModel: string;
271
- shadowMode: 'foreground' | 'daemon';
272
- pollIntervalMs: number;
273
- inactivityTimeoutMs: number;
274
- promptTimeoutMs: number;
275
- trackWindowFocus: boolean;
276
- autoSaveNodes: boolean;
277
- enableNotifications: boolean;
278
- shadowModel: string;
279
- organization?: string;
280
- outputDir: string;
281
- dbPath: string;
282
- socketPath: string;
283
- pidFile: string;
284
- verbose: boolean;
285
- }
286
- declare function defaultConfig(overrides?: Partial<CartographyConfig>): CartographyConfig;
287
-
288
197
  declare class CartographyDB {
289
198
  private db;
290
199
  constructor(dbPath: string);
291
200
  private migrate;
292
201
  close(): void;
293
- createSession(mode: 'discover' | 'shadow', config: CartographyConfig): string;
202
+ createSession(mode: 'discover', config: CartographyConfig): string;
294
203
  endSession(id: string): void;
295
204
  getSession(id: string): SessionRow | undefined;
296
205
  getLatestSession(mode?: string): SessionRow | undefined;
@@ -301,7 +210,7 @@ declare class CartographyDB {
301
210
  deleteNode(sessionId: string, nodeId: string): void;
302
211
  insertEdge(sessionId: string, edge: DiscoveryEdge): void;
303
212
  getEdges(sessionId: string): EdgeRow[];
304
- insertEvent(sessionId: string, event: ActivityEvent, taskId?: string): void;
213
+ insertEvent(sessionId: string, event: Pick<EventRow, 'eventType' | 'process' | 'pid' | 'target' | 'targetType' | 'port'>, taskId?: string): void;
305
214
  getEvents(sessionId: string, since?: string): EventRow[];
306
215
  startTask(sessionId: string, description?: string): string;
307
216
  endCurrentTask(sessionId: string): void;
@@ -363,8 +272,6 @@ type DiscoveryEvent = {
363
272
  };
364
273
  type AskUserFn = (question: string, context?: string) => Promise<string>;
365
274
  declare function runDiscovery(config: CartographyConfig, db: CartographyDB, sessionId: string, onEvent?: (event: DiscoveryEvent) => void, onAskUser?: AskUserFn, hint?: string): Promise<void>;
366
- declare function runShadowCycle(config: CartographyConfig, db: CartographyDB, sessionId: string, prevSnapshot: string, currSnapshot: string, onOutput?: (msg: unknown) => void): Promise<void>;
367
- declare function generateSOPs(db: CartographyDB, sessionId: string): Promise<number>;
368
275
 
369
276
  declare function generateTopologyMermaid(nodes: NodeRow[], edges: EdgeRow[]): string;
370
277
  declare function generateDependencyMermaid(nodes: NodeRow[], edges: EdgeRow[]): string;
@@ -381,6 +288,5 @@ declare function exportSOPDashboard(sops: Array<SOP & {
381
288
  declare function exportAll(db: CartographyDB, sessionId: string, outputDir: string, formats?: string[]): void;
382
289
 
383
290
  declare function checkPrerequisites(): void;
384
- declare function checkPollInterval(intervalMs: number): number;
385
291
 
386
- export { type ActivityEvent, type CartographyConfig, CartographyDB, type ClientMessage, type DaemonMessage, type DiscoveryEdge, type DiscoveryEvent, type DiscoveryNode, EDGE_RELATIONSHIPS, EVENT_TYPES, type EdgeRelationship, type EdgeRow, EdgeSchema, type EventRow, EventSchema, type EventType, MIN_POLL_INTERVAL_MS, NODE_TYPES, type NodeRow, NodeSchema, type NodeType, type PendingPrompt, type SOP, SOPSchema, type SOPStep, SOPStepSchema, type SessionRow, type ShadowStatus, type TaskRow, type WorkflowRow, checkPollInterval, checkPrerequisites, createCartographyTools, CartographyDB as default, defaultConfig, exportAll, exportBackstageYAML, exportHTML, exportJSON, exportSOPDashboard, exportSOPMarkdown, generateDependencyMermaid, generateSOPs, generateTopologyMermaid, generateWorkflowMermaid, runDiscovery, runShadowCycle, safetyHook, stripSensitive };
292
+ export { type CartographyConfig, CartographyDB, type DiscoveryEdge, type DiscoveryEvent, type DiscoveryNode, EDGE_RELATIONSHIPS, type EdgeRelationship, type EdgeRow, EdgeSchema, NODE_TYPES, type NodeRow, NodeSchema, type NodeType, type SOP, SOPSchema, type SOPStep, SOPStepSchema, type SessionRow, checkPrerequisites, createCartographyTools, CartographyDB as default, defaultConfig, exportAll, exportBackstageYAML, exportHTML, exportJSON, exportSOPDashboard, exportSOPMarkdown, generateDependencyMermaid, generateTopologyMermaid, generateWorkflowMermaid, runDiscovery, safetyHook, stripSensitive };