@dimassetoid/septum-mcp 0.0.0-stage → 0.2.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.
Files changed (108) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +124 -2
  3. package/bin/septum.ts +4 -0
  4. package/package.json +70 -4
  5. package/scripts/postinstall.ts +25 -0
  6. package/src/cli/commands/check.ts +122 -0
  7. package/src/cli/commands/hook.ts +268 -0
  8. package/src/cli/commands/init.ts +553 -0
  9. package/src/cli/commands/serve.ts +5 -0
  10. package/src/cli/commands/sync.ts +41 -0
  11. package/src/cli/commands/topology.ts +161 -0
  12. package/src/cli/index.ts +167 -0
  13. package/src/cli/scaffold/harness-config.ts +621 -0
  14. package/src/cli/templates/hooks.ts +75 -0
  15. package/src/cli/templates/rules.ts +50 -0
  16. package/src/cli/templates/skill.ts +51 -0
  17. package/src/cli/ui/prompts.ts +122 -0
  18. package/src/core/boundary/evaluator.ts +442 -0
  19. package/src/core/boundary/staged-auditor.ts +58 -0
  20. package/src/core/config/loader.ts +122 -0
  21. package/src/core/config/schema.ts +69 -0
  22. package/src/core/database/client.ts +60 -0
  23. package/src/core/database/repositories/dependency.repository.ts +712 -0
  24. package/src/core/database/repositories/domain.repository.ts +330 -0
  25. package/src/core/database/repositories/environment.repository.ts +207 -0
  26. package/src/core/database/repositories/file.repository.ts +117 -0
  27. package/src/core/database/repositories/meta.repository.ts +33 -0
  28. package/src/core/database/repositories/symbol.repository.ts +508 -0
  29. package/src/core/database/repository.ts +303 -0
  30. package/src/core/database/schema.ts +154 -0
  31. package/src/core/discovery/topology-detector.ts +805 -0
  32. package/src/core/ingestion/hasher.ts +5 -0
  33. package/src/core/ingestion/pipeline.ts +623 -0
  34. package/src/core/parser/behavioral-analyzer.ts +119 -0
  35. package/src/core/parser/boundary-tracker.ts +443 -0
  36. package/src/core/parser/extractors/base.ts +67 -0
  37. package/src/core/parser/extractors/blade.ts +159 -0
  38. package/src/core/parser/extractors/csharp.ts +244 -0
  39. package/src/core/parser/extractors/django-semantic.ts +687 -0
  40. package/src/core/parser/extractors/elysia-semantic.ts +538 -0
  41. package/src/core/parser/extractors/express-semantic.ts +444 -0
  42. package/src/core/parser/extractors/fastapi-semantic.ts +736 -0
  43. package/src/core/parser/extractors/fastify-semantic.ts +774 -0
  44. package/src/core/parser/extractors/flask-semantic.ts +515 -0
  45. package/src/core/parser/extractors/frontend.ts +149 -0
  46. package/src/core/parser/extractors/go-semantic.ts +611 -0
  47. package/src/core/parser/extractors/go.ts +491 -0
  48. package/src/core/parser/extractors/hono-semantic.ts +567 -0
  49. package/src/core/parser/extractors/java.ts +225 -0
  50. package/src/core/parser/extractors/laravel-semantic.ts +1122 -0
  51. package/src/core/parser/extractors/mcp-cli-semantic.ts +368 -0
  52. package/src/core/parser/extractors/nestjs-semantic.ts +543 -0
  53. package/src/core/parser/extractors/php.ts +569 -0
  54. package/src/core/parser/extractors/python.ts +498 -0
  55. package/src/core/parser/extractors/registry.ts +78 -0
  56. package/src/core/parser/extractors/ruby.ts +234 -0
  57. package/src/core/parser/extractors/rust.ts +286 -0
  58. package/src/core/parser/extractors/semantic-extractor.interface.ts +22 -0
  59. package/src/core/parser/extractors/symfony-semantic.ts +354 -0
  60. package/src/core/parser/extractors/typescript.ts +826 -0
  61. package/src/core/parser/language-capabilities.ts +71 -0
  62. package/src/core/parser/schema/providers/laravel-migration-provider.ts +216 -0
  63. package/src/core/parser/schema/providers/prisma-schema-provider.ts +90 -0
  64. package/src/core/parser/schema/schema-provider-registry.ts +43 -0
  65. package/src/core/parser/schema/schema-provider.interface.ts +33 -0
  66. package/src/core/parser/tree-sitter.ts +63 -0
  67. package/src/core/parser/wasm-assets.ts +25 -0
  68. package/src/core/parser/wasm-loader.ts +274 -0
  69. package/src/core/resolver/call-graph-tracer.ts +724 -0
  70. package/src/core/resolver/import-resolver.ts +437 -0
  71. package/src/core/resolver/module-resolver.ts +482 -0
  72. package/src/core/resolver/path-resolver.ts +200 -0
  73. package/src/core/resolver/symbol-locator.ts +276 -0
  74. package/src/core/resolver/symbol-reference.ts +53 -0
  75. package/src/core/resolver/vertical-slice-tracer.ts +366 -0
  76. package/src/core/resources/ignore.ts +123 -0
  77. package/src/core/resources/limits.ts +14 -0
  78. package/src/core/resources/source-files.ts +62 -0
  79. package/src/core/resources/work-queue.ts +74 -0
  80. package/src/core/session/session-manager.ts +107 -0
  81. package/src/core/telemetry/telemetry.ts +97 -0
  82. package/src/core/topology/environment-detector.ts +973 -0
  83. package/src/core/topology/types.ts +83 -0
  84. package/src/index.ts +21 -0
  85. package/src/mcp/schemas.ts +1105 -0
  86. package/src/mcp/server.ts +774 -0
  87. package/src/mcp/tools/boundary.ts +17 -0
  88. package/src/mcp/tools/check-boundary.ts +387 -0
  89. package/src/mcp/tools/domain.ts +40 -0
  90. package/src/mcp/tools/feature.ts +67 -0
  91. package/src/mcp/tools/get-domain-catalog.ts +226 -0
  92. package/src/mcp/tools/get-environment-topology.ts +138 -0
  93. package/src/mcp/tools/get-feature-context.ts +224 -0
  94. package/src/mcp/tools/get-symbol-hotspots.ts +54 -0
  95. package/src/mcp/tools/get-symbol-impact.ts +64 -0
  96. package/src/mcp/tools/get-symbol.ts +175 -0
  97. package/src/mcp/tools/locate-symbol.ts +196 -0
  98. package/src/mcp/tools/register-domain.ts +75 -0
  99. package/src/mcp/tools/register-feature.ts +110 -0
  100. package/src/mcp/tools/slice.ts +16 -0
  101. package/src/mcp/tools/symbol.ts +93 -0
  102. package/src/mcp/tools/trace-vertical-slice.ts +80 -0
  103. package/src/mcp/workspace-manager.ts +159 -0
  104. package/src/mcp/workspace-watcher.ts +202 -0
  105. package/src/types/index.ts +456 -0
  106. package/src/types/wasm.d.ts +4 -0
  107. package/src/utils/version-check.ts +209 -0
  108. package/src/version.ts +1 -0
@@ -0,0 +1,83 @@
1
+ export type EnvironmentLayer =
2
+ | "edge"
3
+ | "gateway"
4
+ | "host"
5
+ | "runtime"
6
+ | "storage"
7
+ | "telemetry";
8
+
9
+ export type LayerResolutionStatus = "DETECTED" | "AMBIGUOUS" | "UNRESOLVED" | "VERIFIED";
10
+
11
+ export type CanonicalPlatformTag =
12
+ | "shared_hosting"
13
+ | "vps"
14
+ | "docker"
15
+ | "serverless"
16
+ | "kubernetes"
17
+ | "managed_db"
18
+ | "cdn_edge"
19
+ | "paas"
20
+ | "static_cdn"
21
+ | "unspecified";
22
+
23
+ export interface EnvironmentLayerInfo {
24
+ layer: EnvironmentLayer;
25
+ platform?: string;
26
+ canonical_tag?: CanonicalPlatformTag;
27
+ status: LayerResolutionStatus;
28
+ detected_from?: string[];
29
+ evidence?: string[];
30
+ constraints?: string[];
31
+ unresolved_inquiry?: string;
32
+ }
33
+
34
+ export interface TopologyNode {
35
+ id: string; // e.g. "edge:cloudflare", "host:api-vps", "host:worker-vps", "storage:central-db"
36
+ layer: EnvironmentLayer;
37
+ name: string; // e.g. "Cloudflare Perimeter", "API Backend VPS", "Postgres Cluster"
38
+ platform: string; // e.g. "Cloudflare WAF", "Hostinger VPS", "AWS RDS Postgres"
39
+ canonical_tag: CanonicalPlatformTag;
40
+ domain_or_ip?: string; // e.g. "api.example.com", "10.0.0.5"
41
+ role?: string; // e.g. "web_api", "queue_worker", "frontend_spa", "database_primary"
42
+ status: LayerResolutionStatus;
43
+ detected_from: string[];
44
+ constraints: string[];
45
+ connected_to?: string[]; // IDs of nodes this node interacts with
46
+ unresolved_inquiry?: string;
47
+ }
48
+
49
+ export interface CrossLayerInterplay {
50
+ title: string;
51
+ involved_layers: EnvironmentLayer[];
52
+ involved_node_ids?: string[];
53
+ risk_or_rule: string;
54
+ required_action: string;
55
+ }
56
+
57
+ export interface EnvironmentTopology {
58
+ is_distributed: boolean;
59
+ nodes: TopologyNode[];
60
+ layers: Record<EnvironmentLayer, EnvironmentLayerInfo>;
61
+ overall_status: "RESOLVED" | "NEEDS_CLARIFICATION";
62
+ interplays: CrossLayerInterplay[];
63
+ pending_inquiries: string[];
64
+ architectural_summary: string;
65
+ }
66
+
67
+ export interface ResolveLayerInput {
68
+ layer: EnvironmentLayer;
69
+ platform: string;
70
+ constraints?: string[];
71
+ }
72
+
73
+ export interface ResolveNodeInput {
74
+ id: string;
75
+ layer: EnvironmentLayer;
76
+ name: string;
77
+ platform: string;
78
+ canonical_tag?: CanonicalPlatformTag;
79
+ domain_or_ip?: string;
80
+ role?: string;
81
+ constraints?: string[];
82
+ connected_to?: string[];
83
+ }
package/src/index.ts ADDED
@@ -0,0 +1,21 @@
1
+ export * from "./types/index.ts";
2
+ export * from "./core/config/schema.ts";
3
+ export * from "./core/config/loader.ts";
4
+ export * from "./core/database/client.ts";
5
+ export * from "./core/database/repository.ts";
6
+ export * from "./core/parser/extractors/base.ts";
7
+ export * from "./core/parser/tree-sitter.ts";
8
+ export * from "./core/ingestion/pipeline.ts";
9
+ export * from "./core/boundary/evaluator.ts";
10
+ export * from "./core/resolver/call-graph-tracer.ts";
11
+ export * from "./core/resolver/vertical-slice-tracer.ts";
12
+ export * from "./core/topology/types.ts";
13
+ export * from "./core/topology/environment-detector.ts";
14
+ export * from "./mcp/tools/get-environment-topology.ts";
15
+ export * from "./mcp/server.ts";
16
+ export * from "./cli/index.ts";
17
+
18
+ import { runCLI } from "./cli/index.ts";
19
+ if (import.meta.main) {
20
+ runCLI(process.argv);
21
+ }