septum 0.1.4 → 0.1.6
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/LICENSE +21 -21
- package/README.md +105 -105
- package/bin/septum.ts +4 -4
- package/package.json +63 -63
- package/src/cli/commands/check.ts +161 -161
- package/src/cli/commands/hook.ts +216 -188
- package/src/cli/commands/ingest.ts +29 -29
- package/src/cli/commands/init.ts +213 -211
- package/src/cli/commands/locate.ts +61 -61
- package/src/cli/commands/query.ts +104 -64
- package/src/cli/commands/serve.ts +5 -5
- package/src/cli/commands/slice.ts +50 -48
- package/src/cli/commands/sync.ts +31 -31
- package/src/cli/index.ts +220 -210
- package/src/cli/templates/hooks.ts +75 -75
- package/src/cli/templates/rules.ts +50 -38
- package/src/cli/templates/skill.ts +65 -69
- package/src/core/boundary/evaluator.ts +429 -210
- package/src/core/config/loader.ts +117 -97
- package/src/core/config/schema.ts +39 -39
- package/src/core/database/client.ts +44 -44
- package/src/core/database/repositories/dependency.repository.ts +552 -349
- package/src/core/database/repositories/domain.repository.ts +275 -198
- package/src/core/database/repositories/file.repository.ts +117 -106
- package/src/core/database/repositories/meta.repository.ts +33 -33
- package/src/core/database/repositories/symbol.repository.ts +482 -443
- package/src/core/database/repository.ts +281 -260
- package/src/core/database/schema.ts +154 -153
- package/src/core/discovery/topology-detector.ts +486 -486
- package/src/core/ingestion/hasher.ts +5 -5
- package/src/core/ingestion/pipeline.ts +606 -535
- package/src/core/parser/boundary-tracker.ts +433 -288
- package/src/core/parser/extractors/base.ts +62 -62
- package/src/core/parser/extractors/blade.ts +158 -158
- package/src/core/parser/extractors/frontend.ts +147 -194
- package/src/core/parser/extractors/go.ts +408 -180
- package/src/core/parser/extractors/laravel-semantic.ts +1045 -901
- package/src/core/parser/extractors/mcp-cli-semantic.ts +328 -199
- package/src/core/parser/extractors/nestjs-semantic.ts +134 -119
- package/src/core/parser/extractors/php.ts +415 -153
- package/src/core/parser/extractors/python.ts +460 -228
- package/src/core/parser/extractors/registry.ts +70 -70
- package/src/core/parser/extractors/semantic-extractor.interface.ts +21 -21
- package/src/core/parser/extractors/typescript.ts +668 -181
- package/src/core/parser/tree-sitter.ts +41 -41
- package/src/core/parser/wasm-loader.ts +271 -0
- package/src/core/resolver/call-graph-tracer.ts +698 -668
- package/src/core/resolver/module-resolver.ts +479 -342
- package/src/core/resolver/path-resolver.ts +147 -147
- package/src/core/resolver/symbol-locator.ts +543 -543
- package/src/core/resolver/vertical-slice-tracer.ts +323 -285
- package/src/core/session/session-manager.ts +56 -56
- package/src/core/telemetry/telemetry.ts +86 -86
- package/src/core/topology/environment-detector.ts +109 -6
- package/src/index.ts +21 -21
- package/src/mcp/schemas.ts +695 -286
- package/src/mcp/server.ts +927 -716
- package/src/mcp/tools/check-boundary.ts +307 -152
- package/src/mcp/tools/get-domain-catalog.ts +155 -121
- package/src/mcp/tools/get-environment-topology.ts +3 -6
- package/src/mcp/tools/get-feature-context.ts +227 -116
- package/src/mcp/tools/get-symbol-hotspots.ts +54 -59
- package/src/mcp/tools/get-symbol-impact.ts +28 -26
- package/src/mcp/tools/get-symbol.ts +65 -63
- package/src/mcp/tools/locate-symbol.ts +169 -190
- package/src/mcp/tools/register-domain.ts +59 -64
- package/src/mcp/tools/register-feature.ts +91 -0
- package/src/mcp/tools/trace-vertical-slice.ts +74 -48
- package/src/types/index.ts +366 -315
- package/src/version.ts +3 -3
|
@@ -1,48 +1,74 @@
|
|
|
1
|
-
import type { ValidatedSeptumConfig } from "../../core/config/schema.ts";
|
|
2
|
-
import type { SeptumRepository } from "../../core/database/repository.ts";
|
|
3
|
-
import { VerticalSliceTracer } from "../../core/resolver/vertical-slice-tracer.ts";
|
|
4
|
-
import type { VerticalSliceTraceResponse } from "../../types/index.ts";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
{
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
1
|
+
import type { ValidatedSeptumConfig } from "../../core/config/schema.ts";
|
|
2
|
+
import type { SeptumRepository } from "../../core/database/repository.ts";
|
|
3
|
+
import { VerticalSliceTracer } from "../../core/resolver/vertical-slice-tracer.ts";
|
|
4
|
+
import type { VerticalSliceTraceResponse } from "../../types/index.ts";
|
|
5
|
+
import type { TraceVerticalSliceArgs } from "../schemas.ts";
|
|
6
|
+
|
|
7
|
+
export type { TraceVerticalSliceArgs } from "../schemas.ts";
|
|
8
|
+
|
|
9
|
+
export function handleTraceVerticalSlice(
|
|
10
|
+
repo: SeptumRepository,
|
|
11
|
+
config: ValidatedSeptumConfig,
|
|
12
|
+
args: Partial<TraceVerticalSliceArgs> & { route?: string },
|
|
13
|
+
workspaceRoot?: string
|
|
14
|
+
) {
|
|
15
|
+
const query = (
|
|
16
|
+
args.query ||
|
|
17
|
+
args.symbol ||
|
|
18
|
+
args.route ||
|
|
19
|
+
""
|
|
20
|
+
).toString().trim();
|
|
21
|
+
|
|
22
|
+
if (!query) {
|
|
23
|
+
throw new Error(
|
|
24
|
+
"Missing required argument: 'query' (e.g. 'POST /orders/{id}/status', 'OrderController@updateStatus', or task intent 'Ubah status order di dashboard')"
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const root =
|
|
29
|
+
workspaceRoot ||
|
|
30
|
+
args.workspace_path ||
|
|
31
|
+
((config.settings as Record<string, unknown>)?.workspace_root as string) ||
|
|
32
|
+
process.cwd();
|
|
33
|
+
const maxDepth = Math.min(Math.max(Math.trunc(Number(args.max_depth ?? 5)), 1), 8);
|
|
34
|
+
const tracer = new VerticalSliceTracer(repo, root);
|
|
35
|
+
const result: VerticalSliceTraceResponse = (tracer.trace as any)(query, maxDepth);
|
|
36
|
+
const chain = result.chain || result.slice || [];
|
|
37
|
+
|
|
38
|
+
let summary = "";
|
|
39
|
+
if (result.found && chain.length > 0) {
|
|
40
|
+
summary = chain
|
|
41
|
+
.map((node) => `[${(node.stage || "STAGE").toUpperCase()}] ${node.symbol}`)
|
|
42
|
+
.join(" ➔ ");
|
|
43
|
+
} else if (result.found && result.entrypoint) {
|
|
44
|
+
summary = `[ENTRYPOINT] ${result.entrypoint.method} ${result.entrypoint.uri} ➔ ${result.entrypoint.controller}@${result.entrypoint.action}`;
|
|
45
|
+
} else {
|
|
46
|
+
summary = `[NOT FOUND] No vertical slice matching '${query}'`;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const payload = {
|
|
50
|
+
status: result.found ? "success" : "not_found",
|
|
51
|
+
query,
|
|
52
|
+
found: result.found,
|
|
53
|
+
confidence: result.confidence || (result.found ? "exact" : undefined),
|
|
54
|
+
is_exact_match: result.is_exact_match,
|
|
55
|
+
architecture_style: result.architecture_style,
|
|
56
|
+
max_depth_applied: result.max_depth_applied ?? maxDepth,
|
|
57
|
+
entrypoint: result.entrypoint || null,
|
|
58
|
+
chain,
|
|
59
|
+
alternatives: result.alternatives || [],
|
|
60
|
+
summary,
|
|
61
|
+
message: result.message || summary,
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
return {
|
|
65
|
+
content: [
|
|
66
|
+
{
|
|
67
|
+
type: "text" as const,
|
|
68
|
+
text: JSON.stringify(payload, null, 2),
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
metadata: payload,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|