@_tc/template-core 0.4.0 → 0.4.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/.skills/tc-component-usage-skills/reference/component-api.md +27 -0
- package/.skills/tc-generator/SKILL.md +1 -1
- package/.skills/tc-generator/reference/project-template/ssr/apps/hello/hello.entry.tsx +6 -1
- package/.skills/tc-generator/reference/runtime-extensions.md +10 -0
- package/AGENT_README.md +8 -2
- package/CHANGE.md +27 -0
- package/README.md +157 -8
- package/cjs/app/ai/agent/agent-scanner.service.js +1 -1
- package/cjs/app/ai/agent/agent.module.js +1 -1
- package/cjs/app/ai/ai-config.module.js +1 -1
- package/cjs/app/ai/ai-config.service.js +1 -1
- package/cjs/app/ai/ai.controller.js +1 -1
- package/cjs/app/ai/ai.module.js +1 -1
- package/cjs/app/ai/guardrail/guardrail.module.js +1 -1
- package/cjs/app/ai/guardrail/guardrail.service.js +1 -1
- package/cjs/app/ai/index.js +1 -0
- package/cjs/app/ai/mcp/internal/read-sse-response.js +2 -0
- package/cjs/app/ai/mcp/internal/stdio-process.js +1 -0
- package/cjs/app/ai/mcp/mcp-registry.service.js +2 -2
- package/cjs/app/ai/mcp/mcp.client.js +2 -3
- package/cjs/app/ai/mcp/mcp.loader.js +1 -1
- package/cjs/app/ai/mcp/mcp.module.js +1 -1
- package/cjs/app/ai/memory/checkpoint.service.js +1 -1
- package/cjs/app/ai/memory/memory.module.js +1 -1
- package/cjs/app/ai/memory/thread.service.js +1 -1
- package/cjs/app/ai/models/chat-sse.js +4 -0
- package/cjs/app/ai/models/chat.js +1 -0
- package/cjs/app/ai/models/http.js +1 -0
- package/cjs/app/ai/models/image.js +1 -0
- package/cjs/app/ai/models/video.js +1 -0
- package/cjs/app/ai/nest-service-provider.js +1 -0
- package/cjs/app/ai/rag/rag.module.js +1 -1
- package/cjs/app/ai/rag/retriever.service.js +1 -1
- package/cjs/app/ai/retention/conversation-retention.service.js +1 -1
- package/cjs/app/ai/runtime/ai-runtime-startup.validator.js +1 -1
- package/cjs/app/ai/runtime/ai-runtime.js +1 -0
- package/cjs/app/ai/runtime/internal/context-compaction.service.js +3 -3
- package/cjs/app/ai/runtime/internal/declaration-snapshot.js +1 -0
- package/cjs/app/ai/runtime/internal/owned-runtime-resources.js +1 -0
- package/cjs/app/ai/runtime/langchain/langchain-planner.service.js +1 -1
- package/cjs/app/ai/runtime/langgraph/langgraph-orchestrator.service.js +1 -1
- package/cjs/app/ai/runtime/runtime.module.js +1 -1
- package/cjs/app/ai/skill/skill-scanner.service.js +1 -1
- package/cjs/app/ai/skill/skill.module.js +1 -1
- package/cjs/app/ai/snapshot-data.js +1 -0
- package/cjs/app/ai/store/internal/create-vector-store.js +1 -0
- package/cjs/app/ai/store/store.module.js +1 -1
- package/cjs/app/ai/tool/builtin/index.js +1 -1
- package/cjs/app/ai/tool/builtin/invoke-agent.tool.js +1 -1
- package/cjs/app/ai/tool/builtin/retrieve.tool.js +1 -1
- package/cjs/app/ai/tool/executor.service.js +1 -1
- package/cjs/app/ai/tool/tool-registry.service.js +1 -1
- package/cjs/app/ai/tool/tool.module.js +1 -1
- package/cjs/app/ai/trace/trace.service.js +1 -1
- package/cjs/app/csr/controller.js +1 -1
- package/cjs/app/csr/types.js +0 -0
- package/cjs/app/html/browser-options.js +1 -1
- package/cjs/app/html/shell.js +31 -16
- package/cjs/app/http/api-signing.js +1 -0
- package/cjs/app/http/body-parser.middleware.js +1 -1
- package/cjs/app/http/csp-nonce.js +1 -0
- package/cjs/app/http/error-response.js +1 -1
- package/cjs/app/http/exception-filter.js +1 -1
- package/cjs/app/http/request-body-parser-policy.js +1 -0
- package/cjs/app/http/security.guard.js +1 -1
- package/cjs/app/project/controller.js +1 -1
- package/cjs/app/project/service.js +1 -1
- package/cjs/app/providers/foundation.js +1 -1
- package/cjs/app/ssr/artifacts.js +1 -1
- package/cjs/app/ssr/controller.js +1 -1
- package/cjs/app/ssr/html.js +17 -17
- package/cjs/app/ssr/stream.js +1 -1
- package/cjs/app/static-assets.middleware.js +1 -1
- package/cjs/app/template-core.module.js +1 -1
- package/cjs/app/view/entry.tpl +2 -2
- package/cjs/bundler/buildSSR.js +1 -1
- package/cjs/bundler/entryCollect.js +1 -1
- package/cjs/bundler/feSharedConfig.js +1 -1
- package/cjs/bundler/utils.js +3 -3
- package/cjs/config/config.default.js +1 -1
- package/cjs/packages/common/index.js +1 -1
- package/cjs/packages/core/bootstrap.js +1 -1
- package/cjs/packages/core/startup.js +1 -1
- package/esm/app/ai/agent/agent-scanner.service.js +33 -36
- package/esm/app/ai/agent/agent.module.js +9 -7
- package/esm/app/ai/ai-config.module.js +14 -7
- package/esm/app/ai/ai-config.service.js +24 -20
- package/esm/app/ai/ai.controller.js +41 -41
- package/esm/app/ai/ai.module.js +15 -15
- package/esm/app/ai/guardrail/guardrail.module.js +11 -9
- package/esm/app/ai/guardrail/guardrail.service.js +5 -10
- package/esm/app/ai/index.js +2 -0
- package/esm/app/ai/mcp/internal/read-sse-response.js +35 -0
- package/esm/app/ai/mcp/internal/stdio-process.js +59 -0
- package/esm/app/ai/mcp/mcp-registry.service.js +10 -15
- package/esm/app/ai/mcp/mcp.client.js +77 -78
- package/esm/app/ai/mcp/mcp.loader.js +64 -42
- package/esm/app/ai/mcp/mcp.module.js +62 -22
- package/esm/app/ai/memory/checkpoint.service.js +18 -28
- package/esm/app/ai/memory/memory.module.js +15 -12
- package/esm/app/ai/memory/thread.service.js +21 -26
- package/esm/app/ai/models/chat-sse.js +44 -0
- package/esm/app/ai/models/chat.js +60 -0
- package/esm/app/ai/models/http.js +52 -0
- package/esm/app/ai/models/image.js +37 -0
- package/esm/app/ai/models/video.js +32 -0
- package/esm/app/ai/nest-service-provider.js +10 -0
- package/esm/app/ai/rag/rag.module.js +24 -15
- package/esm/app/ai/rag/retriever.service.js +37 -54
- package/esm/app/ai/retention/conversation-retention.service.js +16 -34
- package/esm/app/ai/runtime/ai-runtime-startup.validator.js +2 -19
- package/esm/app/ai/runtime/ai-runtime.js +104 -0
- package/esm/app/ai/runtime/internal/context-compaction.service.js +139 -145
- package/esm/app/ai/runtime/internal/declaration-snapshot.js +32 -0
- package/esm/app/ai/runtime/internal/owned-runtime-resources.js +21 -0
- package/esm/app/ai/runtime/langchain/langchain-planner.service.js +43 -49
- package/esm/app/ai/runtime/langgraph/langgraph-orchestrator.service.js +273 -225
- package/esm/app/ai/runtime/runtime.module.js +56 -35
- package/esm/app/ai/skill/skill-scanner.service.js +11 -16
- package/esm/app/ai/skill/skill.module.js +11 -9
- package/esm/app/ai/snapshot-data.js +24 -0
- package/esm/app/ai/store/internal/create-vector-store.js +10 -0
- package/esm/app/ai/store/store.module.js +9 -13
- package/esm/app/ai/tool/builtin/index.js +16 -4
- package/esm/app/ai/tool/builtin/invoke-agent.tool.js +30 -34
- package/esm/app/ai/tool/builtin/retrieve.tool.js +9 -13
- package/esm/app/ai/tool/executor.service.js +22 -29
- package/esm/app/ai/tool/tool-registry.service.js +6 -16
- package/esm/app/ai/tool/tool.module.js +26 -12
- package/esm/app/ai/trace/trace.service.js +15 -28
- package/esm/app/csr/controller.js +114 -63
- package/esm/app/csr/types.js +0 -0
- package/esm/app/html/browser-options.js +2 -2
- package/esm/app/html/shell.js +173 -32
- package/esm/app/http/api-signing.js +13 -0
- package/esm/app/http/body-parser.middleware.js +47 -27
- package/esm/app/http/csp-nonce.js +13 -0
- package/esm/app/http/error-response.js +8 -5
- package/esm/app/http/exception-filter.js +4 -4
- package/esm/app/http/request-body-parser-policy.js +46 -0
- package/esm/app/http/security.guard.js +23 -21
- package/esm/app/project/controller.js +15 -15
- package/esm/app/project/service.js +3 -3
- package/esm/app/providers/foundation.js +5 -5
- package/esm/app/ssr/artifacts.js +25 -21
- package/esm/app/ssr/controller.js +148 -75
- package/esm/app/ssr/html.js +49 -44
- package/esm/app/ssr/stream.js +25 -24
- package/esm/app/static-assets.middleware.js +4 -4
- package/esm/app/template-core.module.js +57 -52
- package/esm/app/view/entry.tpl +2 -2
- package/esm/bundler/buildSSR.js +1 -1
- package/esm/bundler/entryCollect.js +9 -9
- package/esm/bundler/feSharedConfig.js +42 -42
- package/esm/bundler/utils.js +78 -90
- package/esm/config/config.default.js +4 -3
- package/esm/packages/common/index.js +6 -6
- package/esm/packages/core/bootstrap.js +5 -5
- package/esm/packages/core/startup.js +69 -46
- package/fe/frontend/src/common/request.js +5 -2
- package/fe/frontend/src/hooks/useRouterParams.d.ts +4 -2
- package/fe/packages/common/ssr/hydration.d.ts +9 -0
- package/fe/packages/react/core/Label/Label.d.ts +1 -0
- package/fe/packages/react/core/Label/Label.js +3 -1
- package/fe/packages/react/core/internal/i18n/default.d.ts +13 -0
- package/fe/packages/react/core/internal/i18n/default.js +16 -1
- package/fe/packages/react/core/internal/i18n/en-US.d.ts +13 -0
- package/fe/packages/react/core/internal/i18n/en-US.js +16 -1
- package/fe/packages/react/forms/DataTable/index.d.ts +2 -0
- package/fe/packages/react/forms/DataTable/index.js +43 -29
- package/fe/packages/react/forms/Form/FormItem.js +39 -12
- package/fe/packages/react/forms/MultiSelect/MultiSelect.d.ts +26 -0
- package/fe/packages/react/forms/MultiSelect/MultiSelect.js +218 -0
- package/fe/packages/react/forms/MultiSelect/index.d.ts +1 -0
- package/fe/packages/react/forms/MultiSelect/index.js +2 -0
- package/fe/packages/react/forms/Pagination/Pagination.d.ts +6 -1
- package/fe/packages/react/forms/Pagination/Pagination.js +13 -4
- package/fe/packages/react/forms/Select/Select.d.ts +11 -0
- package/fe/packages/react/forms/Select/Select.js +20 -7
- package/fe/packages/react/forms/index.d.ts +1 -0
- package/fe/packages/react/forms/index.js +3 -1
- package/fe/packages/react/i18n/getUiReactLocale.d.ts +26 -0
- package/fe/packages/react/index.js +2 -1
- package/fe/packages/react/overlays/Drawer/Drawer.d.ts +3 -2
- package/fe/packages/react/overlays/Drawer/Drawer.js +16 -2
- package/fe/packages/react/overlays/Dropdown/Dropdown.d.ts +12 -2
- package/fe/packages/react/overlays/Dropdown/Dropdown.js +27 -14
- package/fe/packages/react/overlays/Modal/Modal.d.ts +11 -3
- package/fe/packages/react/overlays/Modal/Modal.js +26 -2
- package/fe/packages/react/overlays/Modal/ModalManager.d.ts +13 -12
- package/fe/packages/react/overlays/Modal/ModalManager.js +15 -5
- package/fe/packages/react/overlays/Modal/index.d.ts +1 -0
- package/fe/packages/react/overlays/Overlay/Overlay.d.ts +6 -2
- package/fe/packages/react/overlays/Overlay/Overlay.js +31 -14
- package/fe/packages/react/overlays/Overlay/focusTypes.d.ts +8 -0
- package/fe/packages/react/overlays/Overlay/focusTypes.js +0 -0
- package/fe/packages/react/overlays/Overlay/index.d.ts +1 -0
- package/fe/packages/react/overlays/Overlay/overlayStack.d.ts +16 -0
- package/fe/packages/react/overlays/Overlay/overlayStack.js +290 -0
- package/fe/packages/react/overlays/Popup/Popup.d.ts +5 -4
- package/fe/packages/react/overlays/Popup/Popup.js +28 -11
- package/fe/packages/react/ui/components/index.js +2 -1
- package/fe/packages/react/ui/index.js +2 -1
- package/fe/ssr/components/StreamingRender/StreamingCache.d.ts +1 -0
- package/fe/ssr/components/StreamingRender/StreamingCache.js +5 -1
- package/fe/ssr/components/StreamingRender/StreamingRender.js +1 -1
- package/fe/ssr/components/StreamingRender/StreamingScript.d.ts +1 -0
- package/fe/ssr/components/StreamingRender/StreamingScript.js +9 -1
- package/fe/ssr/createSSREntry.d.ts +9 -3
- package/fe/ssr/createSSREntry.js +43 -19
- package/fe/ssr/index.d.ts +4 -1
- package/fe/ssr/index.js +2 -1
- package/fe/ssr/router.d.ts +76 -0
- package/fe/ssr/router.js +349 -0
- package/fe/ssr/types.d.ts +1 -1
- package/models/packages/common/ssr/hydration.d.ts +9 -0
- package/models/packages/react/core/Label/Label.d.ts +1 -0
- package/models/packages/react/core/internal/i18n/default.d.ts +13 -0
- package/models/packages/react/core/internal/i18n/en-US.d.ts +13 -0
- package/models/packages/react/forms/DataTable/index.d.ts +2 -0
- package/models/packages/react/forms/MultiSelect/MultiSelect.d.ts +26 -0
- package/models/packages/react/forms/MultiSelect/index.d.ts +1 -0
- package/models/packages/react/forms/Pagination/Pagination.d.ts +6 -1
- package/models/packages/react/forms/Select/Select.d.ts +11 -0
- package/models/packages/react/forms/index.d.ts +1 -0
- package/models/packages/react/i18n/getUiReactLocale.d.ts +26 -0
- package/models/packages/react/overlays/Drawer/Drawer.d.ts +3 -2
- package/models/packages/react/overlays/Dropdown/Dropdown.d.ts +12 -2
- package/models/packages/react/overlays/Modal/Modal.d.ts +11 -3
- package/models/packages/react/overlays/Modal/ModalManager.d.ts +13 -12
- package/models/packages/react/overlays/Modal/index.d.ts +1 -0
- package/models/packages/react/overlays/Overlay/Overlay.d.ts +6 -2
- package/models/packages/react/overlays/Overlay/focusTypes.d.ts +8 -0
- package/models/packages/react/overlays/Overlay/index.d.ts +1 -0
- package/models/packages/react/overlays/Overlay/overlayStack.d.ts +16 -0
- package/models/packages/react/overlays/Popup/Popup.d.ts +5 -4
- package/package.json +26 -1
- package/types/app/ai/agent/agent-scanner.service.d.ts +4 -4
- package/types/app/ai/ai-config.service.d.ts +7 -3
- package/types/app/ai/guardrail/guardrail.service.d.ts +2 -2
- package/types/app/ai/index.d.ts +9 -0
- package/types/app/ai/mcp/internal/load-mcp-config.d.ts +2 -2
- package/types/app/ai/mcp/internal/read-sse-response.d.ts +2 -0
- package/types/app/ai/mcp/internal/stdio-process.d.ts +5 -0
- package/types/app/ai/mcp/mcp-registry.service.d.ts +5 -3
- package/types/app/ai/mcp/mcp.client.d.ts +7 -4
- package/types/app/ai/mcp/mcp.loader.d.ts +11 -11
- package/types/app/ai/mcp/mcp.module.d.ts +5 -5
- package/types/app/ai/memory/thread.service.d.ts +3 -3
- package/types/app/ai/models/chat-sse.d.ts +5 -0
- package/types/app/ai/models/chat.d.ts +22 -0
- package/types/app/ai/models/http.d.ts +20 -0
- package/types/app/ai/models/image.d.ts +69 -0
- package/types/app/ai/models/video.d.ts +99 -0
- package/types/app/ai/nest-service-provider.d.ts +6 -0
- package/types/app/ai/retention/conversation-retention.service.d.ts +3 -4
- package/types/app/ai/runtime/ai-runtime-startup.validator.d.ts +2 -3
- package/types/app/ai/runtime/ai-runtime.d.ts +46 -0
- package/types/app/ai/runtime/internal/agent-run-context.d.ts +4 -0
- package/types/app/ai/runtime/internal/context-compaction.service.d.ts +2 -2
- package/types/app/ai/runtime/internal/declaration-snapshot.d.ts +8 -0
- package/types/app/ai/runtime/internal/owned-runtime-resources.d.ts +5 -0
- package/types/app/ai/runtime/langchain/langchain-planner.service.d.ts +1 -1
- package/types/app/ai/runtime/langgraph/langgraph-orchestrator.service.d.ts +33 -16
- package/types/app/ai/skill/skill-scanner.service.d.ts +3 -4
- package/types/app/ai/snapshot-data.d.ts +1 -0
- package/types/app/ai/store/internal/create-vector-store.d.ts +4 -0
- package/types/app/ai/tool/builtin/index.d.ts +1 -1
- package/types/app/ai/tool/builtin/invoke-agent.tool.d.ts +10 -3
- package/types/app/ai/tool/builtin/retrieve.tool.d.ts +4 -3
- package/types/app/ai/tool/executor.service.d.ts +3 -3
- package/types/app/ai/tool/tool-registry.service.d.ts +2 -7
- package/types/app/ai/tool/tool.interface.d.ts +1 -1
- package/types/app/ai/tool/tool.module.d.ts +8 -1
- package/types/app/ai/trace/trace.service.d.ts +4 -5
- package/types/app/csr/types.d.ts +10 -0
- package/types/app/html/browser-options.d.ts +1 -1
- package/types/app/html/shell.d.ts +37 -10
- package/types/app/http/api-signing.d.ts +16 -0
- package/types/app/http/body-parser.middleware.d.ts +6 -2
- package/types/app/http/csp-nonce.d.ts +3 -0
- package/types/app/http/error-response.d.ts +1 -0
- package/types/app/http/request-body-parser-policy.d.ts +8 -0
- package/types/app/http/security.guard.d.ts +1 -0
- package/types/app/ssr/artifacts.d.ts +6 -3
- package/types/app/ssr/html.d.ts +7 -0
- package/types/app/ssr/stream.d.ts +1 -1
- package/types/app/ssr/types.d.ts +56 -0
- package/types/bundler/buildSSR.d.ts +2 -1
- package/types/bundler/index.d.ts +1 -1
- package/types/bundler/state.d.ts +13 -0
- package/types/bundler/utils.d.ts +3 -14
- package/types/config/config.default.d.ts +9 -3
- package/types/index.d.ts +4 -1
- package/types/packages/common/ssr/hydration.d.ts +13 -0
- package/types/packages/core/index.d.ts +1 -1
- package/types/packages/core/startup.d.ts +41 -0
|
@@ -1,47 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import r from "node:
|
|
5
|
-
import i from "node:path";
|
|
6
|
-
import { pathToFileURL as a } from "node:url";
|
|
7
|
-
import o from "@oxc-project/runtime/helpers/decorateMetadata";
|
|
8
|
-
import s from "@oxc-project/runtime/helpers/decorate";
|
|
1
|
+
import { findAiDeclarationFiles as e } from "../declaration-paths.js";
|
|
2
|
+
import t from "node:fs";
|
|
3
|
+
import n from "node:path";
|
|
4
|
+
import { pathToFileURL as r } from "node:url";
|
|
9
5
|
//#region app/ai/agent/agent-scanner.service.ts
|
|
10
|
-
var
|
|
6
|
+
var i = new Set([
|
|
11
7
|
".cjs",
|
|
12
8
|
".js",
|
|
13
9
|
".mjs"
|
|
14
10
|
]);
|
|
15
|
-
function
|
|
11
|
+
function a(e) {
|
|
16
12
|
if (typeof e != "object" || !e) return !1;
|
|
17
13
|
let t = e;
|
|
18
14
|
return typeof t.name == "string" && t.name.trim() !== "" && Array.isArray(t.skills) && Array.isArray(t.tools);
|
|
19
15
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return [t?.default, ...Object.values(t ?? {})].find((e) => typeof e == "string" && e.trim() !== "");
|
|
16
|
+
function o(e) {
|
|
17
|
+
return typeof e == "string" && e !== "" && e.trim() === e;
|
|
23
18
|
}
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return r.existsSync(a) ? a : i.resolve(n, t);
|
|
19
|
+
async function s(e) {
|
|
20
|
+
let t = await import(r(e).href);
|
|
21
|
+
return [t?.default, ...Object.values(t ?? {})].find((e) => typeof e == "string" && e.trim() !== "");
|
|
28
22
|
}
|
|
29
|
-
async function
|
|
30
|
-
let
|
|
31
|
-
if (typeof
|
|
32
|
-
let
|
|
23
|
+
async function c(e, r, a) {
|
|
24
|
+
let o = e.promptFile;
|
|
25
|
+
if (typeof o != "string" || o.trim() === "") return e;
|
|
26
|
+
let c = a && n.resolve(n.dirname(a), o), l = c && t.existsSync(c) ? c : n.resolve(r, o);
|
|
33
27
|
try {
|
|
34
|
-
let
|
|
35
|
-
return
|
|
36
|
-
...
|
|
37
|
-
prompt:
|
|
38
|
-
} :
|
|
39
|
-
} catch (
|
|
40
|
-
let
|
|
41
|
-
return console.log(`[ai] agent promptFile unreadable: ${e} - ${
|
|
28
|
+
let r = i.has(n.extname(l)) ? await s(l) : t.readFileSync(l, "utf8").trim();
|
|
29
|
+
return r ? {
|
|
30
|
+
...e,
|
|
31
|
+
prompt: r
|
|
32
|
+
} : e;
|
|
33
|
+
} catch (t) {
|
|
34
|
+
let n = t instanceof Error ? t.message : String(t);
|
|
35
|
+
return console.log(`[ai] agent promptFile unreadable: ${a ?? e.name} - ${l} (${n})`), e;
|
|
42
36
|
}
|
|
43
37
|
}
|
|
44
|
-
var
|
|
38
|
+
var l = class {
|
|
45
39
|
agents = /* @__PURE__ */ new Map();
|
|
46
40
|
constructor(e) {
|
|
47
41
|
this.configService = e;
|
|
@@ -58,15 +52,15 @@ var m = class {
|
|
|
58
52
|
async scan() {
|
|
59
53
|
for (let e of this.findAgentFiles()) {
|
|
60
54
|
let t = await this.loadAgent(e);
|
|
61
|
-
t && this.
|
|
55
|
+
t && this.add(await c(t, this.configService.baseDir, e));
|
|
62
56
|
}
|
|
63
57
|
}
|
|
64
58
|
findAgentFiles() {
|
|
65
|
-
return
|
|
59
|
+
return e(this.configService, "agent");
|
|
66
60
|
}
|
|
67
61
|
async loadAgent(e) {
|
|
68
62
|
try {
|
|
69
|
-
let t = await import(
|
|
63
|
+
let t = await import(r(e).href), n = [t?.default, t].find(a);
|
|
70
64
|
if (!n) {
|
|
71
65
|
console.log(`[ai] agent skipped, invalid definition: ${e}`);
|
|
72
66
|
return;
|
|
@@ -78,7 +72,11 @@ var m = class {
|
|
|
78
72
|
return;
|
|
79
73
|
}
|
|
80
74
|
}
|
|
81
|
-
register(e) {
|
|
75
|
+
async register(e) {
|
|
76
|
+
if (!a(e) || !o(e.name) || !e.tools.every(o) || !e.skills.every(o)) throw Error("[ai] agent register fail: definition requires a non-empty name, skills, and tools");
|
|
77
|
+
this.add(await c(e, this.configService.baseDir));
|
|
78
|
+
}
|
|
79
|
+
add(e) {
|
|
82
80
|
this.agents.has(e.name) && console.log(`[ai] agent overwritten: ${e.name}`), this.agents.set(e.name, e);
|
|
83
81
|
}
|
|
84
82
|
logRegisteredAgents() {
|
|
@@ -86,6 +84,5 @@ var m = class {
|
|
|
86
84
|
console.log(`[ai] agents registered (${e.length}): ${e.join(", ")}`);
|
|
87
85
|
}
|
|
88
86
|
};
|
|
89
|
-
m = s([n(), o("design:paramtypes", [typeof (c = e !== void 0 && e) == "function" ? c : Object])], m);
|
|
90
87
|
//#endregion
|
|
91
|
-
export {
|
|
88
|
+
export { l as AgentScannerService };
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { AgentScannerService as e } from "./agent-scanner.service.js";
|
|
2
|
-
import {
|
|
3
|
-
import n from "
|
|
2
|
+
import { AiConfigService as t } from "../ai-config.service.js";
|
|
3
|
+
import { provideAiService as n } from "../nest-service-provider.js";
|
|
4
|
+
import { Module as r } from "@nestjs/common";
|
|
5
|
+
import i from "@oxc-project/runtime/helpers/decorate";
|
|
4
6
|
//#region app/ai/agent/agent.module.ts
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
providers: [e],
|
|
7
|
+
var a = class {};
|
|
8
|
+
a = i([r({
|
|
9
|
+
providers: [n(e, t)],
|
|
8
10
|
exports: [e]
|
|
9
|
-
})],
|
|
11
|
+
})], a);
|
|
10
12
|
//#endregion
|
|
11
|
-
export {
|
|
13
|
+
export { a as AgentModule };
|
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
import { AiConfigService as e } from "./ai-config.service.js";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
2
|
+
import { TC_CONFIG as t } from "../../packages/core/tokens.js";
|
|
3
|
+
import { TemplateCoreRuntime as n } from "../../packages/core/startup.js";
|
|
4
|
+
import "../../packages/core/index.js";
|
|
5
|
+
import { Global as r, Module as i } from "@nestjs/common";
|
|
6
|
+
import a from "@oxc-project/runtime/helpers/decorate";
|
|
4
7
|
//#region app/ai/ai-config.module.ts
|
|
5
|
-
var
|
|
8
|
+
var o, s = o = class {
|
|
6
9
|
static register() {
|
|
7
10
|
return {
|
|
8
|
-
module:
|
|
11
|
+
module: o,
|
|
9
12
|
global: !0,
|
|
10
|
-
providers: [
|
|
13
|
+
providers: [{
|
|
14
|
+
provide: e,
|
|
15
|
+
inject: [t, n],
|
|
16
|
+
useFactory: (t, n) => new e(t, n)
|
|
17
|
+
}],
|
|
11
18
|
exports: [e]
|
|
12
19
|
};
|
|
13
20
|
}
|
|
14
21
|
};
|
|
15
|
-
|
|
22
|
+
s = o = a([r(), i({})], s);
|
|
16
23
|
//#endregion
|
|
17
|
-
export {
|
|
24
|
+
export { s as AiConfigModule };
|
|
@@ -1,19 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { TemplateCoreRuntime as n } from "../../packages/core/startup.js";
|
|
4
|
-
import "../../packages/core/index.js";
|
|
5
|
-
import { Inject as r, Injectable as i } from "@nestjs/common";
|
|
6
|
-
import a from "node:path";
|
|
7
|
-
import o from "@oxc-project/runtime/helpers/decorateMetadata";
|
|
8
|
-
import s from "@oxc-project/runtime/helpers/decorate";
|
|
9
|
-
import c from "@oxc-project/runtime/helpers/decorateParam";
|
|
1
|
+
import { snapshotData as e } from "./snapshot-data.js";
|
|
2
|
+
import t from "node:path";
|
|
10
3
|
//#region app/ai/ai-config.service.ts
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
function n(e) {
|
|
5
|
+
return typeof e.baseDir == "string" && typeof e.config == "object" && e.config !== null;
|
|
6
|
+
}
|
|
7
|
+
function r(e, t) {
|
|
8
|
+
return Object.prototype.hasOwnProperty.call(e, t) ? e[t] : t.split(".").reduce((e, t) => {
|
|
9
|
+
if (!(typeof e != "object" || !e)) return e[t];
|
|
10
|
+
}, e);
|
|
11
|
+
}
|
|
12
|
+
var i = class {
|
|
13
|
+
configuration;
|
|
14
|
+
resolvedBaseDir;
|
|
15
|
+
constructor(i, a) {
|
|
16
|
+
if (n(i)) {
|
|
17
|
+
let n = e(i.config);
|
|
18
|
+
this.configuration = { get: (e) => r(n, e) }, this.resolvedBaseDir = t.resolve(i.baseDir);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
if (!a) throw Error("[ai] TemplateCoreRuntime is required for Nest AI configuration");
|
|
22
|
+
this.configuration = i, this.resolvedBaseDir = typeof a.options?.baseDir == "string" ? a.options.baseDir : process.cwd();
|
|
14
23
|
}
|
|
15
24
|
get baseDir() {
|
|
16
|
-
return this.
|
|
25
|
+
return this.resolvedBaseDir;
|
|
17
26
|
}
|
|
18
27
|
get(e) {
|
|
19
28
|
let t = this.configuration.get(e);
|
|
@@ -26,13 +35,8 @@ var l, u, d = class {
|
|
|
26
35
|
return i;
|
|
27
36
|
}
|
|
28
37
|
resolvePath(e) {
|
|
29
|
-
return
|
|
38
|
+
return t.resolve(this.baseDir, e);
|
|
30
39
|
}
|
|
31
40
|
};
|
|
32
|
-
d = s([
|
|
33
|
-
i(),
|
|
34
|
-
c(0, r(t)),
|
|
35
|
-
o("design:paramtypes", [typeof (l = e !== void 0 && e) == "function" ? l : Object, typeof (u = n !== void 0 && n) == "function" ? u : Object])
|
|
36
|
-
], d);
|
|
37
41
|
//#endregion
|
|
38
|
-
export {
|
|
42
|
+
export { i as AiConfigService };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { AgentScannerService as e } from "./agent/agent-scanner.service.js";
|
|
2
|
+
import { AiConfigService as t } from "./ai-config.service.js";
|
|
3
|
+
import { LangGraphOrchestratorService as n } from "./runtime/langgraph/langgraph-orchestrator.service.js";
|
|
4
|
+
import { ToolRegistryService as r } from "./tool/tool-registry.service.js";
|
|
5
|
+
import { TraceService as i } from "./trace/trace.service.js";
|
|
6
6
|
import { Body as a, Controller as o, Get as s, HttpCode as c, Param as l, Post as u, Res as d } from "@nestjs/common";
|
|
7
|
-
import f from "@oxc-project/runtime/helpers/
|
|
8
|
-
import p from "@oxc-project/runtime/helpers/
|
|
7
|
+
import f from "@oxc-project/runtime/helpers/decorate";
|
|
8
|
+
import p from "@oxc-project/runtime/helpers/decorateMetadata";
|
|
9
9
|
import m from "@oxc-project/runtime/helpers/decorateParam";
|
|
10
10
|
//#region app/ai/ai.controller.ts
|
|
11
11
|
function h(e) {
|
|
@@ -109,53 +109,53 @@ function y(y) {
|
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
111
|
};
|
|
112
|
-
return
|
|
112
|
+
return f([
|
|
113
113
|
s("tool/list"),
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
], T.prototype, "toolList", null),
|
|
114
|
+
p("design:type", Function),
|
|
115
|
+
p("design:paramtypes", []),
|
|
116
|
+
p("design:returntype", void 0)
|
|
117
|
+
], T.prototype, "toolList", null), f([
|
|
118
118
|
s("agent/list"),
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
], T.prototype, "agentList", null),
|
|
119
|
+
p("design:type", Function),
|
|
120
|
+
p("design:paramtypes", []),
|
|
121
|
+
p("design:returntype", void 0)
|
|
122
|
+
], T.prototype, "agentList", null), f([
|
|
123
123
|
s("agent/config"),
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
], T.prototype, "agentConfig", null),
|
|
124
|
+
p("design:type", Function),
|
|
125
|
+
p("design:paramtypes", []),
|
|
126
|
+
p("design:returntype", void 0)
|
|
127
|
+
], T.prototype, "agentConfig", null), f([
|
|
128
128
|
s("agent/graph"),
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
], T.prototype, "agentGraph", null),
|
|
129
|
+
p("design:type", Function),
|
|
130
|
+
p("design:paramtypes", []),
|
|
131
|
+
p("design:returntype", void 0)
|
|
132
|
+
], T.prototype, "agentGraph", null), f([
|
|
133
133
|
u("agent/run"),
|
|
134
134
|
c(200),
|
|
135
135
|
m(0, a()),
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
], T.prototype, "agentRun", null),
|
|
136
|
+
p("design:type", Function),
|
|
137
|
+
p("design:paramtypes", [Object]),
|
|
138
|
+
p("design:returntype", Promise)
|
|
139
|
+
], T.prototype, "agentRun", null), f([
|
|
140
140
|
u("agent/run/stream"),
|
|
141
141
|
c(200),
|
|
142
142
|
m(0, a()),
|
|
143
143
|
m(1, d()),
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
], T.prototype, "agentRunStream", null),
|
|
144
|
+
p("design:type", Function),
|
|
145
|
+
p("design:paramtypes", [Object, Object]),
|
|
146
|
+
p("design:returntype", Promise)
|
|
147
|
+
], T.prototype, "agentRunStream", null), f([
|
|
148
148
|
s("trace/:runId"),
|
|
149
149
|
m(0, l("runId")),
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
], T.prototype, "trace", null), T =
|
|
154
|
-
typeof (b =
|
|
155
|
-
typeof (x =
|
|
156
|
-
typeof (S =
|
|
157
|
-
typeof (C =
|
|
158
|
-
typeof (w =
|
|
150
|
+
p("design:type", Function),
|
|
151
|
+
p("design:paramtypes", [String]),
|
|
152
|
+
p("design:returntype", Promise)
|
|
153
|
+
], T.prototype, "trace", null), T = f([o(`${y}/ai`), p("design:paramtypes", [
|
|
154
|
+
typeof (b = r !== void 0 && r) == "function" ? b : Object,
|
|
155
|
+
typeof (x = e !== void 0 && e) == "function" ? x : Object,
|
|
156
|
+
typeof (S = n !== void 0 && n) == "function" ? S : Object,
|
|
157
|
+
typeof (C = i !== void 0 && i) == "function" ? C : Object,
|
|
158
|
+
typeof (w = t !== void 0 && t) == "function" ? w : Object
|
|
159
159
|
])], T), T;
|
|
160
160
|
}
|
|
161
161
|
//#endregion
|
package/esm/app/ai/ai.module.js
CHANGED
|
@@ -2,13 +2,13 @@ import { AgentModule as e } from "./agent/agent.module.js";
|
|
|
2
2
|
import { AiConfigModule as t } from "./ai-config.module.js";
|
|
3
3
|
import { createAiController as n } from "./ai.controller.js";
|
|
4
4
|
import { GuardrailModule as r } from "./guardrail/guardrail.module.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
5
|
+
import { StoreModule as i } from "./store/store.module.js";
|
|
6
|
+
import { MemoryModule as a } from "./memory/memory.module.js";
|
|
7
|
+
import { SkillModule as o } from "./skill/skill.module.js";
|
|
8
|
+
import { ToolModule as s } from "./tool/tool.module.js";
|
|
9
|
+
import { RuntimeModule as c } from "./runtime/runtime.module.js";
|
|
10
|
+
import { McpModule as l } from "./mcp/mcp.module.js";
|
|
11
|
+
import { RagModule as u } from "./rag/rag.module.js";
|
|
12
12
|
import { Global as d, Module as f } from "@nestjs/common";
|
|
13
13
|
import p from "@oxc-project/runtime/helpers/decorate";
|
|
14
14
|
//#region app/ai/ai.module.ts
|
|
@@ -16,13 +16,13 @@ var m, h = [
|
|
|
16
16
|
t.register(),
|
|
17
17
|
e,
|
|
18
18
|
r,
|
|
19
|
-
o,
|
|
20
|
-
c,
|
|
21
19
|
l,
|
|
20
|
+
a,
|
|
22
21
|
u,
|
|
22
|
+
c,
|
|
23
|
+
o,
|
|
23
24
|
i,
|
|
24
|
-
s
|
|
25
|
-
a
|
|
25
|
+
s
|
|
26
26
|
], g = m = class {
|
|
27
27
|
static register(t) {
|
|
28
28
|
return {
|
|
@@ -32,13 +32,13 @@ var m, h = [
|
|
|
32
32
|
controllers: [n(t)],
|
|
33
33
|
exports: [
|
|
34
34
|
e,
|
|
35
|
-
o,
|
|
36
|
-
c,
|
|
37
35
|
l,
|
|
36
|
+
a,
|
|
38
37
|
u,
|
|
38
|
+
c,
|
|
39
|
+
o,
|
|
39
40
|
i,
|
|
40
|
-
s
|
|
41
|
-
a
|
|
41
|
+
s
|
|
42
42
|
]
|
|
43
43
|
};
|
|
44
44
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import n from "
|
|
1
|
+
import { AiConfigService as e } from "../ai-config.service.js";
|
|
2
|
+
import { provideAiService as t } from "../nest-service-provider.js";
|
|
3
|
+
import { GuardrailService as n } from "./guardrail.service.js";
|
|
4
|
+
import { Module as r } from "@nestjs/common";
|
|
5
|
+
import i from "@oxc-project/runtime/helpers/decorate";
|
|
4
6
|
//#region app/ai/guardrail/guardrail.module.ts
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
providers: [e],
|
|
8
|
-
exports: [
|
|
9
|
-
})],
|
|
7
|
+
var a = class {};
|
|
8
|
+
a = i([r({
|
|
9
|
+
providers: [t(n, e)],
|
|
10
|
+
exports: [n]
|
|
11
|
+
})], a);
|
|
10
12
|
//#endregion
|
|
11
|
-
export {
|
|
13
|
+
export { a as GuardrailModule };
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { resolveGuardrailRules as t } from "./internal/load-guardrail-config.js";
|
|
3
|
-
import { Injectable as n } from "@nestjs/common";
|
|
4
|
-
import r from "@oxc-project/runtime/helpers/decorateMetadata";
|
|
5
|
-
import i from "@oxc-project/runtime/helpers/decorate";
|
|
1
|
+
import { resolveGuardrailRules as e } from "./internal/load-guardrail-config.js";
|
|
6
2
|
//#region app/ai/guardrail/guardrail.service.ts
|
|
7
|
-
var
|
|
3
|
+
var t = class {
|
|
8
4
|
constructor(e) {
|
|
9
5
|
this.configService = e;
|
|
10
6
|
}
|
|
11
|
-
check(
|
|
12
|
-
let n = typeof
|
|
7
|
+
check(t) {
|
|
8
|
+
let n = typeof t == "string" ? t : String(t ?? ""), { blockedKeywords: r, blockedPatterns: i } = e(this.configService);
|
|
13
9
|
for (let e of r ?? []) if (n.toLowerCase().includes(e.toLowerCase())) return {
|
|
14
10
|
safe: !1,
|
|
15
11
|
reason: `命中禁用关键词:${e}`
|
|
@@ -30,6 +26,5 @@ var a, o = class {
|
|
|
30
26
|
return { safe: !0 };
|
|
31
27
|
}
|
|
32
28
|
};
|
|
33
|
-
o = i([n(), r("design:paramtypes", [typeof (a = e !== void 0 && e) == "function" ? a : Object])], o);
|
|
34
29
|
//#endregion
|
|
35
|
-
export {
|
|
30
|
+
export { t as GuardrailService };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { createInterface as e } from "node:readline";
|
|
2
|
+
import { Readable as t } from "node:stream";
|
|
3
|
+
//#region app/ai/mcp/internal/read-sse-response.ts
|
|
4
|
+
function n(e, t) {
|
|
5
|
+
if (!e.length) return;
|
|
6
|
+
let n;
|
|
7
|
+
try {
|
|
8
|
+
n = JSON.parse(e.join("\n"));
|
|
9
|
+
} catch {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
if (!(!n || typeof n != "object" || "method" in n || !("id" in n)) && !(n.id !== t && n.id !== String(t)) && ("result" in n || "error" in n)) return n;
|
|
13
|
+
}
|
|
14
|
+
async function r(r, i, a) {
|
|
15
|
+
if (!r.body) throw Error("MCP SSE response has no body");
|
|
16
|
+
let o = t.fromWeb(r.body, { signal: a }), s = e({
|
|
17
|
+
input: o,
|
|
18
|
+
crlfDelay: Infinity
|
|
19
|
+
}), c = [];
|
|
20
|
+
try {
|
|
21
|
+
for await (let e of s) if (e === "") {
|
|
22
|
+
let e = n(c, i);
|
|
23
|
+
if (e) return e;
|
|
24
|
+
c = [];
|
|
25
|
+
} else e.startsWith("data:") ? c.push(e.slice(5).replace(/^ /, "")) : e === "data" && c.push("");
|
|
26
|
+
a.throwIfAborted();
|
|
27
|
+
let e = n(c, i);
|
|
28
|
+
if (e) return e;
|
|
29
|
+
throw Error(`MCP SSE stream ended before response ${i}`);
|
|
30
|
+
} finally {
|
|
31
|
+
s.close(), o.destroy();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { r as readSseResponse };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { spawn as e } from "node:child_process";
|
|
2
|
+
import { setTimeout as t } from "node:timers/promises";
|
|
3
|
+
//#region app/ai/mcp/internal/stdio-process.ts
|
|
4
|
+
var n = 250, r = 1e3;
|
|
5
|
+
function i(i) {
|
|
6
|
+
if (!i.command) throw Error(`MCP stdio command missing: ${i.name}`);
|
|
7
|
+
let a = process.platform !== "win32", o = e(i.command, i.args ?? [], {
|
|
8
|
+
cwd: i.cwd,
|
|
9
|
+
env: {
|
|
10
|
+
...process.env,
|
|
11
|
+
...i.env
|
|
12
|
+
},
|
|
13
|
+
stdio: [
|
|
14
|
+
"pipe",
|
|
15
|
+
"pipe",
|
|
16
|
+
"pipe"
|
|
17
|
+
],
|
|
18
|
+
detached: a
|
|
19
|
+
}), s = o.pid, c = a && s !== void 0 && s > 1 && s !== process.pid ? s : void 0, l = !1, u;
|
|
20
|
+
function d(e) {
|
|
21
|
+
if (c === void 0) return !1;
|
|
22
|
+
try {
|
|
23
|
+
return process.kill(-c, e);
|
|
24
|
+
} catch (e) {
|
|
25
|
+
let { code: t } = e;
|
|
26
|
+
if (t === "EPERM") return !0;
|
|
27
|
+
if (t !== "ESRCH") throw e;
|
|
28
|
+
return c = void 0, !1;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function f(e) {
|
|
32
|
+
a ? d(e) : o.exitCode === null && o.signalCode === null && o.kill(e);
|
|
33
|
+
}
|
|
34
|
+
async function p(e) {
|
|
35
|
+
let n = performance.now() + e;
|
|
36
|
+
for (; d(0) || !l;) {
|
|
37
|
+
let e = n - performance.now();
|
|
38
|
+
if (e <= 0) return !1;
|
|
39
|
+
await t(Math.min(20, e));
|
|
40
|
+
}
|
|
41
|
+
return !0;
|
|
42
|
+
}
|
|
43
|
+
async function m() {
|
|
44
|
+
if (o.stdin.end(), !await p(n) && (f("SIGTERM"), !await p(n) && (f("SIGKILL"), o.stdin.destroy(), o.stdout.destroy(), o.stderr.destroy(), !await p(r)))) throw Error(`MCP stdio processes did not exit: ${i.name}`);
|
|
45
|
+
}
|
|
46
|
+
function h() {
|
|
47
|
+
return u ??= m();
|
|
48
|
+
}
|
|
49
|
+
return o.once("exit", () => {
|
|
50
|
+
h().catch(() => void 0);
|
|
51
|
+
}), o.once("close", () => {
|
|
52
|
+
l = !0;
|
|
53
|
+
}), {
|
|
54
|
+
child: o,
|
|
55
|
+
close: h
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
export { i as spawnStdioProcess };
|
|
@@ -1,25 +1,20 @@
|
|
|
1
|
-
import { McpLoader as e } from "./mcp.loader.js";
|
|
2
|
-
import { Injectable as t } from "@nestjs/common";
|
|
3
|
-
import n from "@oxc-project/runtime/helpers/decorateMetadata";
|
|
4
|
-
import r from "@oxc-project/runtime/helpers/decorate";
|
|
5
1
|
//#region app/ai/mcp/mcp-registry.service.ts
|
|
6
|
-
var
|
|
2
|
+
var e = class {
|
|
7
3
|
constructor(e) {
|
|
8
4
|
this.loader = e;
|
|
9
5
|
}
|
|
10
6
|
registerAll(e) {
|
|
11
|
-
let t =
|
|
12
|
-
for (let
|
|
13
|
-
for (let
|
|
14
|
-
if (
|
|
15
|
-
e.register(
|
|
7
|
+
let t = [];
|
|
8
|
+
for (let n of this.loader.connections) {
|
|
9
|
+
for (let r of n.tools) {
|
|
10
|
+
if (r.source !== "mcp") throw Error(`[ai] mcp registry 只接受 source=mcp 的 tool:${r.name}`);
|
|
11
|
+
e.register(r), t.push(r.name);
|
|
16
12
|
}
|
|
17
|
-
let
|
|
18
|
-
console.log(`[ai] mcp server ${
|
|
13
|
+
let r = n.tools.map((e) => e.name);
|
|
14
|
+
console.log(`[ai] mcp server ${n.name}: ${r.length > 0 ? r.join(", ") : "(无 tool)"}`);
|
|
19
15
|
}
|
|
20
|
-
console.log(`[ai] mcp tools registered (${
|
|
16
|
+
console.log(`[ai] mcp tools registered (${t.length}): \n ${t.join(", \n")}`);
|
|
21
17
|
}
|
|
22
18
|
};
|
|
23
|
-
a = r([t(), n("design:paramtypes", [typeof (i = e !== void 0 && e) == "function" ? i : Object])], a);
|
|
24
19
|
//#endregion
|
|
25
|
-
export {
|
|
20
|
+
export { e as McpRegistryService };
|