@datasynx/agentic-ai-cartography 2.2.0 → 2.4.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/dist/cli.js CHANGED
@@ -1,26 +1,31 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
- CartographyDB,
4
- buildCartographyToolHandlers,
5
- createCartographyTools,
6
- deriveSessionName,
7
- diffTopology,
8
3
  getRuleset,
9
4
  isPersonalHost,
10
5
  listRulesets,
11
6
  loadOrgKey,
12
- normalizeTenant,
13
7
  pseudonymize,
14
8
  pseudonymizeString,
15
- redactValue,
16
9
  reversePseudonym,
17
10
  rotateOrgKey,
18
11
  runDrift,
19
12
  runLocalDiscovery,
13
+ startMcp
14
+ } from "./chunk-B4QWX7CP.js";
15
+ import {
16
+ startApi
17
+ } from "./chunk-L4OSL7I6.js";
18
+ import {
19
+ CartographyDB,
20
+ buildCartographyToolHandlers,
21
+ createCartographyTools,
22
+ deriveSessionName,
23
+ diffTopology,
24
+ normalizeTenant,
25
+ redactValue,
20
26
  stableStringify,
21
- startMcp,
22
27
  stripSensitive
23
- } from "./chunk-BNDCY2RI.js";
28
+ } from "./chunk-X5JA2UDT.js";
24
29
  import {
25
30
  ConfigFileSchema,
26
31
  CostEntrySchema,
@@ -31,7 +36,7 @@ import {
31
36
  SharingLevelSchema,
32
37
  centralDbFromEnv,
33
38
  defaultConfig
34
- } from "./chunk-WCR47QA2.js";
39
+ } from "./chunk-QQOQBE2A.js";
35
40
  import {
36
41
  IS_MAC,
37
42
  IS_WIN,
@@ -4503,7 +4508,7 @@ ${infraSummary.substring(0, 12e3)}`;
4503
4508
  `);
4504
4509
  return;
4505
4510
  }
4506
- const { NODE_TYPES } = await import("./types-TJWXAQ2L.js");
4511
+ const { NODE_TYPES } = await import("./types-5L3AGZLG.js");
4507
4512
  if (!process.stdin.isTTY) {
4508
4513
  w(red("\n \u2717 Interactive mode requires a terminal (use --file for non-interactive)\n\n"));
4509
4514
  process.exitCode = 1;
@@ -4983,6 +4988,26 @@ error: --anon-mode must be 'reject' or 'strip' (got '${anonMode}')
4983
4988
  } catch (err) {
4984
4989
  process.stderr.write(`
4985
4990
  error: ${err instanceof Error ? err.message : String(err)}
4991
+ `);
4992
+ process.exitCode = 1;
4993
+ }
4994
+ });
4995
+ program.command("api").description("Run the read-only REST/GraphQL API server over the topology store (4.2)").option("--http", "Use HTTP transport (default; kept for symmetry with mcp)", true).option("--port <n>", "HTTP port", "3737").option("--host <h>", "HTTP host", "127.0.0.1").option("--allowed-hosts <list>", "Comma-separated Host allowlist (required for non-loopback --host)").option("--allowed-origins <list>", "Comma-separated CORS Origin allowlist (default: same-origin only)").option("--token <secret>", "Bearer token required on requests (or CARTOGRAPHY_HTTP_TOKEN); mandatory for non-loopback --host").option("--db <path>", "DB path").option("--session <id>", 'Session to serve (id or "latest")', "latest").option("--tenant <id>", "Default tenant whose topology to serve (alias: --org; default: local)").option("--org <id>", "Alias for --tenant").option("--no-graphql", "Disable the /graphql endpoint (REST only)").action(async (opts) => {
4996
+ try {
4997
+ await startApi({
4998
+ port: parseInt(opts.port, 10),
4999
+ host: opts.host,
5000
+ allowedHosts: opts.allowedHosts ? String(opts.allowedHosts).split(",").map((h) => h.trim()).filter(Boolean) : void 0,
5001
+ allowedOrigins: opts.allowedOrigins ? String(opts.allowedOrigins).split(",").map((o2) => o2.trim()).filter(Boolean) : void 0,
5002
+ token: opts.token,
5003
+ dbPath: opts.db,
5004
+ session: opts.session,
5005
+ tenant: opts.tenant ?? opts.org,
5006
+ graphql: opts.graphql
5007
+ });
5008
+ } catch (err) {
5009
+ process.stderr.write(`
5010
+ error: ${err instanceof Error ? err.message : String(err)}
4986
5011
  `);
4987
5012
  process.exitCode = 1;
4988
5013
  }