@hazeljs/inspector 0.2.0-rc.5
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 +192 -0
- package/README.md +97 -0
- package/dist/config/inspector.config.d.ts +8 -0
- package/dist/config/inspector.config.d.ts.map +1 -0
- package/dist/config/inspector.config.js +38 -0
- package/dist/contracts/types.d.ts +253 -0
- package/dist/contracts/types.d.ts.map +1 -0
- package/dist/contracts/types.js +5 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/inspector.module.d.ts +25 -0
- package/dist/inspector.module.d.ts.map +1 -0
- package/dist/inspector.module.js +489 -0
- package/dist/plugins/agent.inspector.d.ts +8 -0
- package/dist/plugins/agent.inspector.d.ts.map +1 -0
- package/dist/plugins/agent.inspector.js +51 -0
- package/dist/plugins/ai.inspector.d.ts +8 -0
- package/dist/plugins/ai.inspector.d.ts.map +1 -0
- package/dist/plugins/ai.inspector.js +87 -0
- package/dist/plugins/core.inspector.d.ts +8 -0
- package/dist/plugins/core.inspector.d.ts.map +1 -0
- package/dist/plugins/core.inspector.js +203 -0
- package/dist/plugins/cron.inspector.d.ts +8 -0
- package/dist/plugins/cron.inspector.d.ts.map +1 -0
- package/dist/plugins/cron.inspector.js +74 -0
- package/dist/plugins/data.inspector.d.ts +8 -0
- package/dist/plugins/data.inspector.d.ts.map +1 -0
- package/dist/plugins/data.inspector.js +50 -0
- package/dist/plugins/event-emitter.inspector.d.ts +8 -0
- package/dist/plugins/event-emitter.inspector.d.ts.map +1 -0
- package/dist/plugins/event-emitter.inspector.js +53 -0
- package/dist/plugins/flow.inspector.d.ts +8 -0
- package/dist/plugins/flow.inspector.d.ts.map +1 -0
- package/dist/plugins/flow.inspector.js +112 -0
- package/dist/plugins/graphql.inspector.d.ts +8 -0
- package/dist/plugins/graphql.inspector.d.ts.map +1 -0
- package/dist/plugins/graphql.inspector.js +75 -0
- package/dist/plugins/grpc.inspector.d.ts +8 -0
- package/dist/plugins/grpc.inspector.d.ts.map +1 -0
- package/dist/plugins/grpc.inspector.js +53 -0
- package/dist/plugins/kafka.inspector.d.ts +8 -0
- package/dist/plugins/kafka.inspector.d.ts.map +1 -0
- package/dist/plugins/kafka.inspector.js +59 -0
- package/dist/plugins/ml.inspector.d.ts +8 -0
- package/dist/plugins/ml.inspector.d.ts.map +1 -0
- package/dist/plugins/ml.inspector.js +78 -0
- package/dist/plugins/prompts.inspector.d.ts +7 -0
- package/dist/plugins/prompts.inspector.d.ts.map +1 -0
- package/dist/plugins/prompts.inspector.js +41 -0
- package/dist/plugins/queue.inspector.d.ts +8 -0
- package/dist/plugins/queue.inspector.d.ts.map +1 -0
- package/dist/plugins/queue.inspector.js +55 -0
- package/dist/plugins/rag.inspector.d.ts +8 -0
- package/dist/plugins/rag.inspector.d.ts.map +1 -0
- package/dist/plugins/rag.inspector.js +72 -0
- package/dist/plugins/serverless.inspector.d.ts +8 -0
- package/dist/plugins/serverless.inspector.d.ts.map +1 -0
- package/dist/plugins/serverless.inspector.js +53 -0
- package/dist/plugins/websocket.inspector.d.ts +8 -0
- package/dist/plugins/websocket.inspector.d.ts.map +1 -0
- package/dist/plugins/websocket.inspector.js +73 -0
- package/dist/registry/registry.d.ts +12 -0
- package/dist/registry/registry.d.ts.map +1 -0
- package/dist/registry/registry.js +43 -0
- package/dist/runtime/inspector-runtime.d.ts +66 -0
- package/dist/runtime/inspector-runtime.d.ts.map +1 -0
- package/dist/runtime/inspector-runtime.js +97 -0
- package/dist/service/inspector.service.d.ts +37 -0
- package/dist/service/inspector.service.d.ts.map +1 -0
- package/dist/service/inspector.service.js +146 -0
- package/package.json +124 -0
- package/ui-dist/assets/index-BN8Zr7QX.css +1 -0
- package/ui-dist/assets/index-DLS5TpZI.js +80 -0
- package/ui-dist/index.html +316 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* GraphQL inspector plugin - inspects @Resolver with @Query/@Mutation
|
|
4
|
+
* Optional: requires @hazeljs/graphql to be installed
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.graphqlInspector = void 0;
|
|
8
|
+
require("reflect-metadata");
|
|
9
|
+
const core_1 = require("@hazeljs/core");
|
|
10
|
+
function createId(...parts) {
|
|
11
|
+
return parts.filter(Boolean).join(':');
|
|
12
|
+
}
|
|
13
|
+
function tryGetGraphQLModule() {
|
|
14
|
+
try {
|
|
15
|
+
return require('@hazeljs/graphql');
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.graphqlInspector = {
|
|
22
|
+
name: 'graphql',
|
|
23
|
+
version: '1.0.0',
|
|
24
|
+
supports: () => tryGetGraphQLModule() !== null,
|
|
25
|
+
inspect: async (context) => {
|
|
26
|
+
const gqlMod = tryGetGraphQLModule();
|
|
27
|
+
if (!gqlMod)
|
|
28
|
+
return [];
|
|
29
|
+
const entries = [];
|
|
30
|
+
const controllers = (0, core_1.collectControllersFromModule)(context.moduleType);
|
|
31
|
+
const tokens = context.container.getTokens?.() ?? [];
|
|
32
|
+
const allClasses = [
|
|
33
|
+
...controllers,
|
|
34
|
+
...tokens.filter((t) => typeof t === 'function'),
|
|
35
|
+
];
|
|
36
|
+
for (const ctrl of allClasses) {
|
|
37
|
+
if (typeof ctrl !== 'function')
|
|
38
|
+
continue;
|
|
39
|
+
const resolverMeta = gqlMod.getResolverMetadata(ctrl);
|
|
40
|
+
const queries = gqlMod.getQueryMetadata(ctrl) ?? [];
|
|
41
|
+
const mutations = gqlMod.getMutationMetadata(ctrl) ?? [];
|
|
42
|
+
if (queries.length === 0 && mutations.length === 0)
|
|
43
|
+
continue;
|
|
44
|
+
const className = ctrl.name ?? 'Unknown';
|
|
45
|
+
const resolverName = resolverMeta?.name ?? className;
|
|
46
|
+
for (const q of queries) {
|
|
47
|
+
entries.push({
|
|
48
|
+
id: createId('graphql', 'query', resolverName, q.name ?? q.method ?? ''),
|
|
49
|
+
kind: 'graphql',
|
|
50
|
+
packageName: '@hazeljs/graphql',
|
|
51
|
+
sourceType: 'method',
|
|
52
|
+
className,
|
|
53
|
+
methodName: q.method,
|
|
54
|
+
resolverName,
|
|
55
|
+
operationType: 'query',
|
|
56
|
+
operationName: q.name ?? q.method ?? 'unknown',
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
for (const m of mutations) {
|
|
60
|
+
entries.push({
|
|
61
|
+
id: createId('graphql', 'mutation', resolverName, m.name ?? m.method ?? ''),
|
|
62
|
+
kind: 'graphql',
|
|
63
|
+
packageName: '@hazeljs/graphql',
|
|
64
|
+
sourceType: 'method',
|
|
65
|
+
className,
|
|
66
|
+
methodName: m.method,
|
|
67
|
+
resolverName,
|
|
68
|
+
operationType: 'mutation',
|
|
69
|
+
operationName: m.name ?? m.method ?? 'unknown',
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return entries;
|
|
74
|
+
},
|
|
75
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* gRPC inspector plugin - inspects @GrpcMethod handlers
|
|
3
|
+
* Optional: requires @hazeljs/grpc to be installed
|
|
4
|
+
*/
|
|
5
|
+
import 'reflect-metadata';
|
|
6
|
+
import type { HazelInspectorPlugin } from '../contracts/types';
|
|
7
|
+
export declare const grpcInspector: HazelInspectorPlugin;
|
|
8
|
+
//# sourceMappingURL=grpc.inspector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grpc.inspector.d.ts","sourceRoot":"","sources":["../../src/plugins/grpc.inspector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAsC,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAkBnG,eAAO,MAAM,aAAa,EAAE,oBAkC3B,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* gRPC inspector plugin - inspects @GrpcMethod handlers
|
|
4
|
+
* Optional: requires @hazeljs/grpc to be installed
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.grpcInspector = void 0;
|
|
8
|
+
require("reflect-metadata");
|
|
9
|
+
function createId(...parts) {
|
|
10
|
+
return parts.filter(Boolean).join(':');
|
|
11
|
+
}
|
|
12
|
+
function tryGetGrpcModule() {
|
|
13
|
+
try {
|
|
14
|
+
return require('@hazeljs/grpc');
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.grpcInspector = {
|
|
21
|
+
name: 'grpc',
|
|
22
|
+
version: '1.0.0',
|
|
23
|
+
supports: () => tryGetGrpcModule() !== null,
|
|
24
|
+
inspect: async (context) => {
|
|
25
|
+
const grpcMod = tryGetGrpcModule();
|
|
26
|
+
if (!grpcMod)
|
|
27
|
+
return [];
|
|
28
|
+
const entries = [];
|
|
29
|
+
const tokens = context.container.getTokens?.() ?? [];
|
|
30
|
+
for (const token of tokens) {
|
|
31
|
+
if (typeof token !== 'function')
|
|
32
|
+
continue;
|
|
33
|
+
// getGrpcMethodMetadata expects target.constructor to be the class; pass prototype when token is a class
|
|
34
|
+
const target = token.prototype ?? token;
|
|
35
|
+
const methods = grpcMod.getGrpcMethodMetadata(target);
|
|
36
|
+
if (!methods?.length)
|
|
37
|
+
continue;
|
|
38
|
+
const className = token.name ?? 'Unknown';
|
|
39
|
+
for (const m of methods) {
|
|
40
|
+
entries.push({
|
|
41
|
+
id: createId('grpc', m.service, m.method),
|
|
42
|
+
kind: 'grpc',
|
|
43
|
+
packageName: '@hazeljs/grpc',
|
|
44
|
+
sourceType: 'method',
|
|
45
|
+
className,
|
|
46
|
+
methodName: m.method,
|
|
47
|
+
serviceName: m.service,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return entries;
|
|
52
|
+
},
|
|
53
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kafka inspector plugin - inspects @KafkaConsumer and @KafkaSubscribe
|
|
3
|
+
* Optional: requires @hazeljs/kafka to be installed
|
|
4
|
+
*/
|
|
5
|
+
import 'reflect-metadata';
|
|
6
|
+
import type { HazelInspectorPlugin } from '../contracts/types';
|
|
7
|
+
export declare const kafkaInspector: HazelInspectorPlugin;
|
|
8
|
+
//# sourceMappingURL=kafka.inspector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kafka.inspector.d.ts","sourceRoot":"","sources":["../../src/plugins/kafka.inspector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAuC,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAkBpG,eAAO,MAAM,cAAc,EAAE,oBAwC5B,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Kafka inspector plugin - inspects @KafkaConsumer and @KafkaSubscribe
|
|
4
|
+
* Optional: requires @hazeljs/kafka to be installed
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.kafkaInspector = void 0;
|
|
8
|
+
require("reflect-metadata");
|
|
9
|
+
function createId(...parts) {
|
|
10
|
+
return parts.filter(Boolean).join(':');
|
|
11
|
+
}
|
|
12
|
+
function tryGetKafkaModule() {
|
|
13
|
+
try {
|
|
14
|
+
return require('@hazeljs/kafka');
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.kafkaInspector = {
|
|
21
|
+
name: 'kafka',
|
|
22
|
+
version: '1.0.0',
|
|
23
|
+
supports: () => tryGetKafkaModule() !== null,
|
|
24
|
+
inspect: async (context) => {
|
|
25
|
+
const kafkaMod = tryGetKafkaModule();
|
|
26
|
+
if (!kafkaMod)
|
|
27
|
+
return [];
|
|
28
|
+
const entries = [];
|
|
29
|
+
const tokens = context.container.getTokens?.() ?? [];
|
|
30
|
+
for (const token of tokens) {
|
|
31
|
+
if (typeof token !== 'function')
|
|
32
|
+
continue;
|
|
33
|
+
const ctor = token;
|
|
34
|
+
if (!kafkaMod.isKafkaConsumer(ctor))
|
|
35
|
+
continue;
|
|
36
|
+
const consumerMeta = kafkaMod.getKafkaConsumerMetadata(ctor);
|
|
37
|
+
// getKafkaSubscribeMetadata expects target.constructor to be the class; pass prototype
|
|
38
|
+
const target = ctor.prototype ?? ctor;
|
|
39
|
+
const subs = kafkaMod.getKafkaSubscribeMetadata(target);
|
|
40
|
+
if (!subs?.length)
|
|
41
|
+
continue;
|
|
42
|
+
const className = token.name ?? 'Unknown';
|
|
43
|
+
for (const s of subs) {
|
|
44
|
+
entries.push({
|
|
45
|
+
id: createId('kafka', className, s.topic, s.methodName),
|
|
46
|
+
kind: 'kafka',
|
|
47
|
+
packageName: '@hazeljs/kafka',
|
|
48
|
+
sourceType: 'method',
|
|
49
|
+
className,
|
|
50
|
+
methodName: s.methodName,
|
|
51
|
+
consumerName: className,
|
|
52
|
+
groupId: consumerMeta?.groupId,
|
|
53
|
+
topic: s.topic,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return entries;
|
|
58
|
+
},
|
|
59
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ML inspector plugin - inspects @Model and ModelRegistry
|
|
3
|
+
* Optional: requires @hazeljs/ml to be installed
|
|
4
|
+
*/
|
|
5
|
+
import 'reflect-metadata';
|
|
6
|
+
import type { HazelInspectorPlugin } from '../contracts/types';
|
|
7
|
+
export declare const mlInspector: HazelInspectorPlugin;
|
|
8
|
+
//# sourceMappingURL=ml.inspector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ml.inspector.d.ts","sourceRoot":"","sources":["../../src/plugins/ml.inspector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAGV,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAkB5B,eAAO,MAAM,WAAW,EAAE,oBA0DzB,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ML inspector plugin - inspects @Model and ModelRegistry
|
|
4
|
+
* Optional: requires @hazeljs/ml to be installed
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.mlInspector = void 0;
|
|
8
|
+
require("reflect-metadata");
|
|
9
|
+
function createId(...parts) {
|
|
10
|
+
return parts.filter(Boolean).join(':');
|
|
11
|
+
}
|
|
12
|
+
function tryGetMLModule() {
|
|
13
|
+
try {
|
|
14
|
+
return require('@hazeljs/ml');
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.mlInspector = {
|
|
21
|
+
name: 'ml',
|
|
22
|
+
version: '1.0.0',
|
|
23
|
+
supports: () => tryGetMLModule() !== null,
|
|
24
|
+
inspect: async (context) => {
|
|
25
|
+
const mlMod = tryGetMLModule();
|
|
26
|
+
if (!mlMod)
|
|
27
|
+
return [];
|
|
28
|
+
const entries = [];
|
|
29
|
+
const seen = new Set();
|
|
30
|
+
// From container tokens with @Model
|
|
31
|
+
const tokens = context.container.getTokens?.() ?? [];
|
|
32
|
+
for (const token of tokens) {
|
|
33
|
+
if (typeof token !== 'function')
|
|
34
|
+
continue;
|
|
35
|
+
if (!mlMod.hasModelMetadata(token))
|
|
36
|
+
continue;
|
|
37
|
+
const meta = mlMod.getModelMetadata(token);
|
|
38
|
+
const className = token.name ?? 'Unknown';
|
|
39
|
+
const key = `${meta?.name ?? className}@${meta?.version ?? 'latest'}`;
|
|
40
|
+
if (seen.has(key))
|
|
41
|
+
continue;
|
|
42
|
+
seen.add(key);
|
|
43
|
+
entries.push({
|
|
44
|
+
id: createId('ml', meta?.name ?? className, meta?.version ?? ''),
|
|
45
|
+
kind: 'ml',
|
|
46
|
+
packageName: '@hazeljs/ml',
|
|
47
|
+
sourceType: 'class',
|
|
48
|
+
className,
|
|
49
|
+
modelName: meta?.name ?? className,
|
|
50
|
+
version: meta?.version,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
// From ModelRegistry if available
|
|
54
|
+
try {
|
|
55
|
+
const registry = context.container.resolve(mlMod.ModelRegistry);
|
|
56
|
+
if (registry?.list) {
|
|
57
|
+
const models = registry.list();
|
|
58
|
+
for (const m of models) {
|
|
59
|
+
const key = `${m.name}@${m.version ?? 'latest'}`;
|
|
60
|
+
if (seen.has(key))
|
|
61
|
+
continue;
|
|
62
|
+
seen.add(key);
|
|
63
|
+
entries.push({
|
|
64
|
+
id: createId('ml', m.name ?? 'unknown', m.version ?? ''),
|
|
65
|
+
kind: 'ml',
|
|
66
|
+
packageName: '@hazeljs/ml',
|
|
67
|
+
modelName: m.name ?? 'unknown',
|
|
68
|
+
version: m.version,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
// ModelRegistry not in container
|
|
75
|
+
}
|
|
76
|
+
return entries;
|
|
77
|
+
},
|
|
78
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prompts inspector plugin - inspects registered prompts in PromptRegistry
|
|
3
|
+
* Optional: requires @hazeljs/prompts to be installed
|
|
4
|
+
*/
|
|
5
|
+
import type { HazelInspectorPlugin } from '../contracts/types';
|
|
6
|
+
export declare const promptsInspector: HazelInspectorPlugin;
|
|
7
|
+
//# sourceMappingURL=prompts.inspector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.inspector.d.ts","sourceRoot":"","sources":["../../src/plugins/prompts.inspector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAGV,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAc5B,eAAO,MAAM,gBAAgB,EAAE,oBAuB9B,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Prompts inspector plugin - inspects registered prompts in PromptRegistry
|
|
4
|
+
* Optional: requires @hazeljs/prompts to be installed
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.promptsInspector = void 0;
|
|
8
|
+
function createId(...parts) {
|
|
9
|
+
return parts.filter(Boolean).join(':');
|
|
10
|
+
}
|
|
11
|
+
function tryGetPromptsModule() {
|
|
12
|
+
try {
|
|
13
|
+
return require('@hazeljs/prompts');
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.promptsInspector = {
|
|
20
|
+
name: 'prompts',
|
|
21
|
+
version: '1.0.0',
|
|
22
|
+
supports: () => tryGetPromptsModule() !== null,
|
|
23
|
+
inspect: async () => {
|
|
24
|
+
const promptsMod = tryGetPromptsModule();
|
|
25
|
+
if (!promptsMod)
|
|
26
|
+
return [];
|
|
27
|
+
const keys = promptsMod.PromptRegistry.list();
|
|
28
|
+
const entries = keys.map((key) => {
|
|
29
|
+
const parts = key.split(':');
|
|
30
|
+
const scope = parts.length >= 2 ? parts[0] : undefined;
|
|
31
|
+
return {
|
|
32
|
+
id: createId('prompt', key),
|
|
33
|
+
kind: 'prompt',
|
|
34
|
+
packageName: '@hazeljs/prompts',
|
|
35
|
+
promptKey: key,
|
|
36
|
+
scope,
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
return entries;
|
|
40
|
+
},
|
|
41
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Queue inspector plugin - inspects @Queue decorated methods
|
|
3
|
+
* Optional: requires @hazeljs/queue to be installed
|
|
4
|
+
*/
|
|
5
|
+
import 'reflect-metadata';
|
|
6
|
+
import type { HazelInspectorPlugin } from '../contracts/types';
|
|
7
|
+
export declare const queueInspector: HazelInspectorPlugin;
|
|
8
|
+
//# sourceMappingURL=queue.inspector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queue.inspector.d.ts","sourceRoot":"","sources":["../../src/plugins/queue.inspector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAuC,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAkBpG,eAAO,MAAM,cAAc,EAAE,oBAoC5B,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Queue inspector plugin - inspects @Queue decorated methods
|
|
4
|
+
* Optional: requires @hazeljs/queue to be installed
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.queueInspector = void 0;
|
|
8
|
+
require("reflect-metadata");
|
|
9
|
+
function createId(...parts) {
|
|
10
|
+
return parts.filter(Boolean).join(':');
|
|
11
|
+
}
|
|
12
|
+
function tryGetQueueModule() {
|
|
13
|
+
try {
|
|
14
|
+
return require('@hazeljs/queue');
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.queueInspector = {
|
|
21
|
+
name: 'queue',
|
|
22
|
+
version: '1.0.0',
|
|
23
|
+
supports: (_context) => {
|
|
24
|
+
return tryGetQueueModule() !== null;
|
|
25
|
+
},
|
|
26
|
+
inspect: async (_context) => {
|
|
27
|
+
const queueMod = tryGetQueueModule();
|
|
28
|
+
if (!queueMod)
|
|
29
|
+
return [];
|
|
30
|
+
const entries = [];
|
|
31
|
+
const tokens = _context.container.getTokens?.() ?? [];
|
|
32
|
+
for (const token of tokens) {
|
|
33
|
+
if (typeof token !== 'function')
|
|
34
|
+
continue;
|
|
35
|
+
const processors = queueMod.getQueueProcessorMetadata(token.prototype ?? token);
|
|
36
|
+
if (!processors?.length)
|
|
37
|
+
continue;
|
|
38
|
+
const className = token.name ?? 'Unknown';
|
|
39
|
+
for (const p of processors) {
|
|
40
|
+
entries.push({
|
|
41
|
+
id: createId('queue', p.queueName, className, p.methodName),
|
|
42
|
+
kind: 'queue',
|
|
43
|
+
packageName: '@hazeljs/queue',
|
|
44
|
+
sourceType: 'method',
|
|
45
|
+
className,
|
|
46
|
+
methodName: p.methodName,
|
|
47
|
+
queueName: p.queueName,
|
|
48
|
+
consumerName: p.options?.name ?? `${className}.${p.methodName}`,
|
|
49
|
+
jobName: p.methodName,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return entries;
|
|
54
|
+
},
|
|
55
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RAG inspector plugin - inspects @RAG and RAG-related modules
|
|
3
|
+
* Optional: requires @hazeljs/rag to be installed
|
|
4
|
+
*/
|
|
5
|
+
import 'reflect-metadata';
|
|
6
|
+
import type { HazelInspectorPlugin } from '../contracts/types';
|
|
7
|
+
export declare const ragInspector: HazelInspectorPlugin;
|
|
8
|
+
//# sourceMappingURL=rag.inspector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rag.inspector.d.ts","sourceRoot":"","sources":["../../src/plugins/rag.inspector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAqC,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAmBlG,eAAO,MAAM,YAAY,EAAE,oBAqD1B,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* RAG inspector plugin - inspects @RAG and RAG-related modules
|
|
4
|
+
* Optional: requires @hazeljs/rag to be installed
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.ragInspector = void 0;
|
|
8
|
+
require("reflect-metadata");
|
|
9
|
+
const core_1 = require("@hazeljs/core");
|
|
10
|
+
function createId(...parts) {
|
|
11
|
+
return parts.filter(Boolean).join(':');
|
|
12
|
+
}
|
|
13
|
+
function tryGetRagModule() {
|
|
14
|
+
try {
|
|
15
|
+
return require('@hazeljs/rag');
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.ragInspector = {
|
|
22
|
+
name: 'rag',
|
|
23
|
+
version: '1.0.0',
|
|
24
|
+
supports: () => tryGetRagModule() !== null,
|
|
25
|
+
inspect: async (context) => {
|
|
26
|
+
const ragMod = tryGetRagModule();
|
|
27
|
+
if (!ragMod)
|
|
28
|
+
return [];
|
|
29
|
+
const entries = [];
|
|
30
|
+
const modules = (0, core_1.collectModulesFromModule)(context.moduleType);
|
|
31
|
+
for (const { moduleType: modRef, name } of modules) {
|
|
32
|
+
const modType = modRef.module ?? modRef;
|
|
33
|
+
const config = ragMod.getRAGConfig(modType);
|
|
34
|
+
if (!config)
|
|
35
|
+
continue;
|
|
36
|
+
entries.push({
|
|
37
|
+
id: createId('rag', name),
|
|
38
|
+
kind: 'rag',
|
|
39
|
+
packageName: '@hazeljs/rag',
|
|
40
|
+
sourceType: 'class',
|
|
41
|
+
pipelineName: name,
|
|
42
|
+
vectorStore: config.vectorDB,
|
|
43
|
+
embeddingProvider: config.embeddingModel,
|
|
44
|
+
chunkingStrategy: config.chunkSize ? `${config.chunkSize} chars` : undefined,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
// Also check container for RAGService or similar
|
|
48
|
+
const tokens = context.container.getTokens?.() ?? [];
|
|
49
|
+
for (const token of tokens) {
|
|
50
|
+
if (typeof token !== 'function')
|
|
51
|
+
continue;
|
|
52
|
+
const config = ragMod.getRAGConfig(token);
|
|
53
|
+
if (!config)
|
|
54
|
+
continue;
|
|
55
|
+
const className = token.name ?? 'Unknown';
|
|
56
|
+
if (entries.some((e) => e.id === createId('rag', className)))
|
|
57
|
+
continue;
|
|
58
|
+
entries.push({
|
|
59
|
+
id: createId('rag', className),
|
|
60
|
+
kind: 'rag',
|
|
61
|
+
packageName: '@hazeljs/rag',
|
|
62
|
+
sourceType: 'class',
|
|
63
|
+
className,
|
|
64
|
+
pipelineName: className,
|
|
65
|
+
vectorStore: config.vectorDB,
|
|
66
|
+
embeddingProvider: config.embeddingModel,
|
|
67
|
+
chunkingStrategy: config.chunkSize ? `${config.chunkSize} chars` : undefined,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return entries;
|
|
71
|
+
},
|
|
72
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Serverless inspector plugin - inspects @Serverless controllers
|
|
3
|
+
* Optional: requires @hazeljs/serverless to be installed
|
|
4
|
+
*/
|
|
5
|
+
import 'reflect-metadata';
|
|
6
|
+
import type { HazelInspectorPlugin } from '../contracts/types';
|
|
7
|
+
export declare const serverlessInspector: HazelInspectorPlugin;
|
|
8
|
+
//# sourceMappingURL=serverless.inspector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serverless.inspector.d.ts","sourceRoot":"","sources":["../../src/plugins/serverless.inspector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAGV,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAqB5B,eAAO,MAAM,mBAAmB,EAAE,oBAgCjC,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Serverless inspector plugin - inspects @Serverless controllers
|
|
4
|
+
* Optional: requires @hazeljs/serverless to be installed
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.serverlessInspector = void 0;
|
|
8
|
+
require("reflect-metadata");
|
|
9
|
+
const core_1 = require("@hazeljs/core");
|
|
10
|
+
const _SERVERLESS_METADATA_KEY = 'hazel:serverless';
|
|
11
|
+
function createId(...parts) {
|
|
12
|
+
return parts.filter(Boolean).join(':');
|
|
13
|
+
}
|
|
14
|
+
function tryGetServerlessModule() {
|
|
15
|
+
try {
|
|
16
|
+
return require('@hazeljs/serverless');
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.serverlessInspector = {
|
|
23
|
+
name: 'serverless',
|
|
24
|
+
version: '1.0.0',
|
|
25
|
+
supports: () => tryGetServerlessModule() !== null,
|
|
26
|
+
inspect: async (context) => {
|
|
27
|
+
const slsMod = tryGetServerlessModule();
|
|
28
|
+
if (!slsMod)
|
|
29
|
+
return [];
|
|
30
|
+
const entries = [];
|
|
31
|
+
const controllers = (0, core_1.collectControllersFromModule)(context.moduleType);
|
|
32
|
+
for (const ctrl of controllers) {
|
|
33
|
+
if (typeof ctrl !== 'function')
|
|
34
|
+
continue;
|
|
35
|
+
const meta = slsMod.getServerlessMetadata(ctrl);
|
|
36
|
+
if (!meta)
|
|
37
|
+
continue;
|
|
38
|
+
const className = ctrl.name ?? 'Unknown';
|
|
39
|
+
entries.push({
|
|
40
|
+
id: createId('serverless', className),
|
|
41
|
+
kind: 'serverless',
|
|
42
|
+
packageName: '@hazeljs/serverless',
|
|
43
|
+
sourceType: 'class',
|
|
44
|
+
className,
|
|
45
|
+
controllerName: className,
|
|
46
|
+
runtime: meta.runtime,
|
|
47
|
+
memory: meta.memory,
|
|
48
|
+
timeout: meta.timeout,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return entries;
|
|
52
|
+
},
|
|
53
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WebSocket inspector plugin - inspects @Realtime gateways and @Subscribe handlers
|
|
3
|
+
* Optional: requires @hazeljs/websocket to be installed
|
|
4
|
+
*/
|
|
5
|
+
import 'reflect-metadata';
|
|
6
|
+
import type { HazelInspectorPlugin } from '../contracts/types';
|
|
7
|
+
export declare const websocketInspector: HazelInspectorPlugin;
|
|
8
|
+
//# sourceMappingURL=websocket.inspector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"websocket.inspector.d.ts","sourceRoot":"","sources":["../../src/plugins/websocket.inspector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAGV,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAkB5B,eAAO,MAAM,kBAAkB,EAAE,oBA0DhC,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* WebSocket inspector plugin - inspects @Realtime gateways and @Subscribe handlers
|
|
4
|
+
* Optional: requires @hazeljs/websocket to be installed
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.websocketInspector = void 0;
|
|
8
|
+
require("reflect-metadata");
|
|
9
|
+
function createId(...parts) {
|
|
10
|
+
return parts.filter(Boolean).join(':');
|
|
11
|
+
}
|
|
12
|
+
function tryGetWebSocketModule() {
|
|
13
|
+
try {
|
|
14
|
+
return require('@hazeljs/websocket');
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.websocketInspector = {
|
|
21
|
+
name: 'websocket',
|
|
22
|
+
version: '1.0.0',
|
|
23
|
+
supports: (_context) => {
|
|
24
|
+
return tryGetWebSocketModule() !== null;
|
|
25
|
+
},
|
|
26
|
+
inspect: async (_context) => {
|
|
27
|
+
const wsMod = tryGetWebSocketModule();
|
|
28
|
+
if (!wsMod)
|
|
29
|
+
return [];
|
|
30
|
+
const entries = [];
|
|
31
|
+
const tokens = _context.container.getTokens?.() ?? [];
|
|
32
|
+
for (const token of tokens) {
|
|
33
|
+
if (typeof token !== 'function')
|
|
34
|
+
continue;
|
|
35
|
+
if (!wsMod.isRealtimeGateway(token))
|
|
36
|
+
continue;
|
|
37
|
+
const meta = wsMod.getRealtimeMetadata(token);
|
|
38
|
+
const className = token.name ?? 'Unknown';
|
|
39
|
+
const gatewayEntry = {
|
|
40
|
+
id: createId('websocket', className),
|
|
41
|
+
kind: 'websocket',
|
|
42
|
+
packageName: '@hazeljs/websocket',
|
|
43
|
+
sourceType: 'class',
|
|
44
|
+
className,
|
|
45
|
+
gatewayName: className,
|
|
46
|
+
namespace: meta?.namespace ?? meta?.path ?? '/',
|
|
47
|
+
};
|
|
48
|
+
entries.push(gatewayEntry);
|
|
49
|
+
// Scan for @Subscribe handlers
|
|
50
|
+
const proto = token.prototype;
|
|
51
|
+
if (proto) {
|
|
52
|
+
const methods = Object.getOwnPropertyNames(proto).filter((n) => n !== 'constructor' && typeof proto[n] === 'function');
|
|
53
|
+
for (const methodName of methods) {
|
|
54
|
+
const event = wsMod.getSubscribeMetadata(proto, methodName);
|
|
55
|
+
if (event) {
|
|
56
|
+
entries.push({
|
|
57
|
+
id: createId('websocket', className, methodName, event),
|
|
58
|
+
kind: 'websocket',
|
|
59
|
+
packageName: '@hazeljs/websocket',
|
|
60
|
+
sourceType: 'method',
|
|
61
|
+
className,
|
|
62
|
+
methodName,
|
|
63
|
+
gatewayName: className,
|
|
64
|
+
namespace: meta?.namespace ?? meta?.path ?? '/',
|
|
65
|
+
eventName: event,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return entries;
|
|
72
|
+
},
|
|
73
|
+
};
|