@_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,44 +1,65 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
1
|
+
import { AgentScannerService as e } from "../agent/agent-scanner.service.js";
|
|
2
|
+
import { AiConfigService as t } from "../ai-config.service.js";
|
|
3
|
+
import { provideAiService as n } from "../nest-service-provider.js";
|
|
4
|
+
import { AgentModule as r } from "../agent/agent.module.js";
|
|
5
|
+
import { THREAD_EXECUTION_COORDINATOR as i, resolveThreadExecutionCoordinator as a } from "./thread-execution-coordinator.js";
|
|
6
|
+
import { LangGraphOrchestratorService as o } from "./langgraph/langgraph-orchestrator.service.js";
|
|
7
|
+
import { ToolRegistryService as s } from "../tool/tool-registry.service.js";
|
|
8
|
+
import { TraceService as c } from "../trace/trace.service.js";
|
|
9
|
+
import { GuardrailService as l } from "../guardrail/guardrail.service.js";
|
|
10
|
+
import { GuardrailModule as u } from "../guardrail/guardrail.module.js";
|
|
11
|
+
import { CheckpointService as d } from "../memory/checkpoint.service.js";
|
|
12
|
+
import { THREAD_STATE_STORE as f, TRACE_STORE as p } from "../store/store.interface.js";
|
|
13
|
+
import { StoreModule as m } from "../store/store.module.js";
|
|
14
|
+
import { ThreadService as h } from "../memory/thread.service.js";
|
|
15
|
+
import { MemoryModule as g } from "../memory/memory.module.js";
|
|
16
|
+
import { ConversationRetentionService as _ } from "../retention/conversation-retention.service.js";
|
|
17
|
+
import { SkillScannerService as v } from "../skill/skill-scanner.service.js";
|
|
18
|
+
import { SkillModule as y } from "../skill/skill.module.js";
|
|
19
|
+
import { ExecutorService as b } from "../tool/executor.service.js";
|
|
20
|
+
import { ToolModule as x } from "../tool/tool.module.js";
|
|
21
|
+
import { AiRuntimeStartupValidator as S } from "./ai-runtime-startup.validator.js";
|
|
22
|
+
import { ContextCompactionService as C } from "./internal/context-compaction.service.js";
|
|
23
|
+
import { LangChainPlannerService as w } from "./langchain/langchain-planner.service.js";
|
|
24
|
+
import { Logger as T, Module as E } from "@nestjs/common";
|
|
25
|
+
import D from "@oxc-project/runtime/helpers/decorate";
|
|
17
26
|
//#region app/ai/runtime/runtime.module.ts
|
|
18
|
-
var
|
|
19
|
-
|
|
27
|
+
var O = class {};
|
|
28
|
+
O = D([E({
|
|
20
29
|
imports: [
|
|
21
|
-
|
|
30
|
+
r,
|
|
31
|
+
y,
|
|
32
|
+
x,
|
|
33
|
+
g,
|
|
22
34
|
u,
|
|
23
|
-
|
|
24
|
-
p,
|
|
25
|
-
l,
|
|
26
|
-
f
|
|
35
|
+
m
|
|
27
36
|
],
|
|
28
37
|
providers: [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
a,
|
|
32
|
-
c,
|
|
33
|
-
n,
|
|
38
|
+
n(w, t),
|
|
39
|
+
n(C, w, d),
|
|
34
40
|
{
|
|
35
|
-
provide:
|
|
36
|
-
useFactory:
|
|
37
|
-
inject: [
|
|
41
|
+
provide: i,
|
|
42
|
+
useFactory: a,
|
|
43
|
+
inject: [t]
|
|
38
44
|
},
|
|
39
|
-
|
|
45
|
+
n(S, t, f, i),
|
|
46
|
+
{
|
|
47
|
+
provide: _,
|
|
48
|
+
inject: [
|
|
49
|
+
t,
|
|
50
|
+
f,
|
|
51
|
+
i
|
|
52
|
+
],
|
|
53
|
+
useFactory: (e, t, n) => new _(e, t, n, new T(_.name))
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
provide: c,
|
|
57
|
+
inject: [p, t],
|
|
58
|
+
useFactory: (e, t) => new c(e, t, new T(c.name))
|
|
59
|
+
},
|
|
60
|
+
n(o, w, b, e, v, s, c, l, h, d, t, C, i, _)
|
|
40
61
|
],
|
|
41
|
-
exports: [
|
|
42
|
-
})],
|
|
62
|
+
exports: [o, c]
|
|
63
|
+
})], O);
|
|
43
64
|
//#endregion
|
|
44
|
-
export {
|
|
65
|
+
export { O as RuntimeModule };
|
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { Injectable as n } from "@nestjs/common";
|
|
4
|
-
import { pathToFileURL as r } from "node:url";
|
|
5
|
-
import i from "@oxc-project/runtime/helpers/decorateMetadata";
|
|
6
|
-
import a from "@oxc-project/runtime/helpers/decorate";
|
|
1
|
+
import { findAiDeclarationFiles as e } from "../declaration-paths.js";
|
|
2
|
+
import { pathToFileURL as t } from "node:url";
|
|
7
3
|
//#region app/ai/skill/skill-scanner.service.ts
|
|
8
|
-
|
|
9
|
-
function s(e) {
|
|
4
|
+
function n(e) {
|
|
10
5
|
if (typeof e != "object" || !e) return !1;
|
|
11
6
|
let t = e;
|
|
12
|
-
return typeof t.name == "string" && t.name.trim() !== "" && typeof t.description == "string" && typeof t.inputSchema == "object" && t.inputSchema !== null && typeof t.execute == "function";
|
|
7
|
+
return typeof t.name == "string" && t.name.trim() !== "" && t.name.trim() === t.name && typeof t.description == "string" && typeof t.inputSchema == "object" && t.inputSchema !== null && !Array.isArray(t.inputSchema) && typeof t.execute == "function";
|
|
13
8
|
}
|
|
14
|
-
var
|
|
9
|
+
var r = class {
|
|
15
10
|
skills = /* @__PURE__ */ new Map();
|
|
16
11
|
constructor(e) {
|
|
17
12
|
this.configService = e;
|
|
@@ -42,16 +37,16 @@ var c = class {
|
|
|
42
37
|
}
|
|
43
38
|
}
|
|
44
39
|
findSkillFiles() {
|
|
45
|
-
return
|
|
40
|
+
return e(this.configService, "skill");
|
|
46
41
|
}
|
|
47
42
|
async loadSkill(e) {
|
|
48
43
|
try {
|
|
49
|
-
let
|
|
50
|
-
if (!
|
|
44
|
+
let r = await import(t(e).href), i = [r?.default, r].find(n);
|
|
45
|
+
if (!i) {
|
|
51
46
|
console.log(`[ai] skill skipped, invalid definition: ${e}`);
|
|
52
47
|
return;
|
|
53
48
|
}
|
|
54
|
-
return
|
|
49
|
+
return i;
|
|
55
50
|
} catch (t) {
|
|
56
51
|
let n = t instanceof Error ? t.message : String(t);
|
|
57
52
|
console.log(`[ai] skill skipped, load failed: ${e} - ${n}`);
|
|
@@ -59,6 +54,7 @@ var c = class {
|
|
|
59
54
|
}
|
|
60
55
|
}
|
|
61
56
|
register(e) {
|
|
57
|
+
if (!n(e)) throw Error("[ai] invalid Skill definition: name, description, inputSchema and execute are required");
|
|
62
58
|
this.skills.has(e.name) && console.log(`[ai] skill overwritten: ${e.name}`), this.skills.set(e.name, e);
|
|
63
59
|
}
|
|
64
60
|
logRegisteredSkills() {
|
|
@@ -66,6 +62,5 @@ var c = class {
|
|
|
66
62
|
console.log(`[ai] skills registered (${e.length}): ${e.join(", ")}`);
|
|
67
63
|
}
|
|
68
64
|
};
|
|
69
|
-
c = a([n(), i("design:paramtypes", [typeof (o = e !== void 0 && e) == "function" ? o : Object])], c);
|
|
70
65
|
//#endregion
|
|
71
|
-
export {
|
|
66
|
+
export { r as SkillScannerService };
|
|
@@ -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 { SkillScannerService as n } from "./skill-scanner.service.js";
|
|
4
|
+
import { Module as r } from "@nestjs/common";
|
|
5
|
+
import i from "@oxc-project/runtime/helpers/decorate";
|
|
4
6
|
//#region app/ai/skill/skill.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 SkillModule };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region app/ai/snapshot-data.ts
|
|
2
|
+
function e(t, n = /* @__PURE__ */ new WeakMap()) {
|
|
3
|
+
if (typeof t != "object" || !t) return t;
|
|
4
|
+
if (n.has(t)) return n.get(t);
|
|
5
|
+
if (Array.isArray(t)) {
|
|
6
|
+
let r = [];
|
|
7
|
+
n.set(t, r);
|
|
8
|
+
for (let i of t) r.push(e(i, n));
|
|
9
|
+
return r;
|
|
10
|
+
}
|
|
11
|
+
let r = Object.getPrototypeOf(t);
|
|
12
|
+
if (r !== Object.prototype && r !== null) return t;
|
|
13
|
+
let i = Object.create(r);
|
|
14
|
+
n.set(t, i);
|
|
15
|
+
for (let [r, a] of Object.entries(t)) Object.defineProperty(i, r, {
|
|
16
|
+
value: e(a, n),
|
|
17
|
+
enumerable: !0,
|
|
18
|
+
writable: !0,
|
|
19
|
+
configurable: !0
|
|
20
|
+
});
|
|
21
|
+
return i;
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { e as snapshotData };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { resolveVectorStoreConfig as e } from "./load-store-config.js";
|
|
2
|
+
import { FileVectorStore as t } from "../reference/file-vector.store.js";
|
|
3
|
+
import { QdrantVectorStore as n } from "../reference/qdrant-vector.store.js";
|
|
4
|
+
//#region app/ai/store/internal/create-vector-store.ts
|
|
5
|
+
function r(r) {
|
|
6
|
+
let i = e(r);
|
|
7
|
+
return i.driver === "qdrant" ? new n(i.url, i.collection) : new t(i.path);
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { r as createVectorStore };
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { AiConfigService as e } from "../ai-config.service.js";
|
|
2
2
|
import { THREAD_STATE_STORE as t, TRACE_STORE as n, VECTOR_STORE as r } from "./store.interface.js";
|
|
3
|
-
import { resolveTraceStorePath as i
|
|
3
|
+
import { resolveTraceStorePath as i } from "./internal/load-store-config.js";
|
|
4
|
+
import { createVectorStore as a } from "./internal/create-vector-store.js";
|
|
4
5
|
import { resolveThreadStateStore as o } from "./internal/load-thread-state-store.js";
|
|
5
6
|
import { FileTraceStore as s } from "./reference/file-trace.store.js";
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import { Module as u } from "@nestjs/common";
|
|
9
|
-
import d from "@oxc-project/runtime/helpers/decorate";
|
|
7
|
+
import { Module as c } from "@nestjs/common";
|
|
8
|
+
import l from "@oxc-project/runtime/helpers/decorate";
|
|
10
9
|
//#region app/ai/store/store.module.ts
|
|
11
|
-
var
|
|
12
|
-
|
|
10
|
+
var u = class {};
|
|
11
|
+
u = l([c({
|
|
13
12
|
providers: [
|
|
14
13
|
{
|
|
15
14
|
provide: n,
|
|
@@ -18,10 +17,7 @@ f = d([u({
|
|
|
18
17
|
},
|
|
19
18
|
{
|
|
20
19
|
provide: r,
|
|
21
|
-
useFactory:
|
|
22
|
-
let t = a(e);
|
|
23
|
-
return t.driver === "qdrant" ? new l(t.url, t.collection) : new c(t.path);
|
|
24
|
-
},
|
|
20
|
+
useFactory: a,
|
|
25
21
|
inject: [e]
|
|
26
22
|
},
|
|
27
23
|
{
|
|
@@ -35,6 +31,6 @@ f = d([u({
|
|
|
35
31
|
r,
|
|
36
32
|
t
|
|
37
33
|
]
|
|
38
|
-
})],
|
|
34
|
+
})], u);
|
|
39
35
|
//#endregion
|
|
40
|
-
export {
|
|
36
|
+
export { u as StoreModule };
|
|
@@ -1,6 +1,18 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "
|
|
1
|
+
import { AgentScannerService as e } from "../../agent/agent-scanner.service.js";
|
|
2
|
+
import { AiConfigService as t } from "../../ai-config.service.js";
|
|
3
|
+
import { resolveMaxDelegationDepth as n } from "../../runtime/internal/load-runtime-config.js";
|
|
4
|
+
import { resolveRagOptions as r } from "../../rag/internal/load-rag-config.js";
|
|
5
|
+
import { RetrieverService as i } from "../../rag/retriever.service.js";
|
|
6
|
+
import { createInvokeAgentTool as a } from "./invoke-agent.tool.js";
|
|
7
|
+
import { createRetrieveTool as o } from "./retrieve.tool.js";
|
|
3
8
|
//#region app/ai/tool/builtin/index.ts
|
|
4
|
-
var
|
|
9
|
+
var s = [({ moduleRef: e }) => o(r(e.get(t, { strict: !1 })).tool, (t) => e.get(i, { strict: !1 }).retrieve(t)), ({ moduleRef: r }) => a({
|
|
10
|
+
maxDepth: n(r.get(t, { strict: !1 })),
|
|
11
|
+
findAgent: (t) => r.get(e, { strict: !1 }).get(t),
|
|
12
|
+
async run(...e) {
|
|
13
|
+
let { LangGraphOrchestratorService: t } = await import("../../runtime/langgraph/langgraph-orchestrator.service.js");
|
|
14
|
+
return r.get(t, { strict: !1 }).run(...e);
|
|
15
|
+
}
|
|
16
|
+
})];
|
|
5
17
|
//#endregion
|
|
6
|
-
export {
|
|
18
|
+
export { s as builtinTools };
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AgentScannerService as t } from "../../agent/agent-scanner.service.js";
|
|
3
|
-
import { agentRunContext as n } from "../../runtime/internal/agent-run-context.js";
|
|
4
|
-
import { resolveMaxDelegationDepth as r } from "../../runtime/internal/load-runtime-config.js";
|
|
1
|
+
import { agentRunContext as e } from "../../runtime/internal/agent-run-context.js";
|
|
5
2
|
//#region app/ai/tool/builtin/invoke-agent.tool.ts
|
|
6
|
-
var
|
|
3
|
+
var t = (t) => ({
|
|
7
4
|
name: "invoke_agent",
|
|
8
5
|
description: "按名字调用一个已注册的 Agent,返回本次运行的 runId 和 output。",
|
|
9
6
|
source: "builtin",
|
|
@@ -21,55 +18,54 @@ var i = ({ moduleRef: i }) => ({
|
|
|
21
18
|
},
|
|
22
19
|
required: ["agent", "input"]
|
|
23
20
|
},
|
|
24
|
-
async execute(
|
|
25
|
-
let
|
|
21
|
+
async execute(n) {
|
|
22
|
+
let r = e.getStore(), i = typeof n == "object" && n ? n : {}, a = typeof i.agent == "string" ? i.agent.trim() : "", o = {
|
|
26
23
|
type: "delegation",
|
|
27
24
|
name: "invoke_agent",
|
|
28
25
|
source: "builtin",
|
|
29
|
-
...
|
|
30
|
-
input:
|
|
26
|
+
...a ? { agent: a } : {},
|
|
27
|
+
input: i.input,
|
|
31
28
|
status: "running",
|
|
32
29
|
startedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
33
|
-
},
|
|
30
|
+
}, s = async (e, t) => (o.status = "error", o.error = t, o.endedAt = (/* @__PURE__ */ new Date()).toISOString(), await r?.record(o), {
|
|
34
31
|
ok: !1,
|
|
35
32
|
error: {
|
|
36
33
|
code: e,
|
|
37
34
|
message: t,
|
|
38
|
-
...
|
|
35
|
+
...a ? { agent: a } : {}
|
|
39
36
|
}
|
|
40
37
|
});
|
|
41
38
|
try {
|
|
42
|
-
if (!
|
|
43
|
-
if (
|
|
44
|
-
if (
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
o.emit?.({
|
|
39
|
+
if (!r) return await s("NO_RUN_CONTEXT", "invoke_agent 需要在 Agent 运行中调用");
|
|
40
|
+
if (a === "") return await s("INVALID_AGENT", "agent 必须是非空字符串");
|
|
41
|
+
if (a === r.agent || r.stack.includes(a)) return await s("DELEGATION_CYCLE", `禁止调用栈内的 Agent:${a}`);
|
|
42
|
+
if (r.stack.length - 1 >= t.maxDepth) return await s("MAX_DELEGATION_DEPTH", "已达到最大委派深度");
|
|
43
|
+
let e = t.findAgent(a);
|
|
44
|
+
if (!e) return await s("UNKNOWN_AGENT", `Agent 未注册:${a}`);
|
|
45
|
+
let n = typeof i.input == "string" ? i.input : JSON.stringify(i.input);
|
|
46
|
+
if (n === void 0) return await s("INVALID_INPUT", "input 必须能序列化为字符串");
|
|
47
|
+
let c = r.emit ? (t) => {
|
|
48
|
+
if (t.type !== "step") return;
|
|
49
|
+
let n = t.step;
|
|
50
|
+
r.emit?.({
|
|
55
51
|
type: "step",
|
|
56
52
|
step: {
|
|
57
|
-
...
|
|
58
|
-
agent:
|
|
59
|
-
parentRunId:
|
|
53
|
+
...n,
|
|
54
|
+
agent: n.agent ?? e.name,
|
|
55
|
+
parentRunId: n.parentRunId ?? r.runId
|
|
60
56
|
}
|
|
61
57
|
});
|
|
62
|
-
} : void 0,
|
|
63
|
-
|
|
58
|
+
} : void 0, l = await t.run(e.name, n, void 0, c, { onStart: async (e) => {
|
|
59
|
+
o.childRunId = e, await r.record(o);
|
|
64
60
|
} });
|
|
65
|
-
return
|
|
66
|
-
runId:
|
|
67
|
-
output:
|
|
61
|
+
return o.childRunId = l.runId, o.steps = l.steps, o.output = l.output, o.status = "done", o.endedAt = (/* @__PURE__ */ new Date()).toISOString(), await r.record(o), {
|
|
62
|
+
runId: l.runId,
|
|
63
|
+
output: l.output
|
|
68
64
|
};
|
|
69
65
|
} catch (e) {
|
|
70
66
|
let t = e instanceof Error ? e.message : String(e);
|
|
71
67
|
try {
|
|
72
|
-
return await
|
|
68
|
+
return await s("DELEGATION_FAILED", t);
|
|
73
69
|
} catch {
|
|
74
70
|
return {
|
|
75
71
|
ok: !1,
|
|
@@ -83,4 +79,4 @@ var i = ({ moduleRef: i }) => ({
|
|
|
83
79
|
}
|
|
84
80
|
});
|
|
85
81
|
//#endregion
|
|
86
|
-
export {
|
|
82
|
+
export { t as createInvokeAgentTool };
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import { AiConfigService as e } from "../../ai-config.service.js";
|
|
2
|
-
import { resolveRagOptions as t } from "../../rag/internal/load-rag-config.js";
|
|
3
|
-
import { RetrieverService as n } from "../../rag/retriever.service.js";
|
|
4
1
|
//#region app/ai/tool/builtin/retrieve.tool.ts
|
|
5
|
-
|
|
6
|
-
let i = t(r.get(e, { strict: !1 }));
|
|
2
|
+
function e(e, t) {
|
|
7
3
|
return {
|
|
8
|
-
name:
|
|
9
|
-
description:
|
|
4
|
+
name: e.name,
|
|
5
|
+
description: e.description,
|
|
10
6
|
source: "builtin",
|
|
11
7
|
inputSchema: {
|
|
12
8
|
type: "object",
|
|
@@ -18,14 +14,14 @@ var r = ({ moduleRef: r }) => {
|
|
|
18
14
|
},
|
|
19
15
|
async execute(e) {
|
|
20
16
|
if (typeof e != "object" || !e) throw Error("[retrieve] 参数错误:input 必须是 { query: string }");
|
|
21
|
-
let
|
|
22
|
-
if (typeof
|
|
17
|
+
let n = e.query;
|
|
18
|
+
if (typeof n != "string" || n.trim() === "") throw Error("[retrieve] 参数错误:缺少 query(非空字符串)");
|
|
23
19
|
return {
|
|
24
|
-
query:
|
|
25
|
-
hits: await
|
|
20
|
+
query: n,
|
|
21
|
+
hits: await t(n)
|
|
26
22
|
};
|
|
27
23
|
}
|
|
28
24
|
};
|
|
29
|
-
}
|
|
25
|
+
}
|
|
30
26
|
//#endregion
|
|
31
|
-
export {
|
|
27
|
+
export { e as createRetrieveTool };
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import { SkillScannerService as e } from "../skill/skill-scanner.service.js";
|
|
2
|
-
import { ToolRegistryService as t } from "./tool-registry.service.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";
|
|
6
1
|
//#region app/ai/tool/executor.service.ts
|
|
7
|
-
|
|
8
|
-
function s(e) {
|
|
2
|
+
function e(e) {
|
|
9
3
|
if (e == null) return { ok: !0 };
|
|
10
4
|
if (typeof e != "string") return {
|
|
11
5
|
ok: !0,
|
|
@@ -27,7 +21,7 @@ function s(e) {
|
|
|
27
21
|
};
|
|
28
22
|
}
|
|
29
23
|
}
|
|
30
|
-
var
|
|
24
|
+
var t = class {
|
|
31
25
|
constructor(e, t) {
|
|
32
26
|
this.skillScanner = e, this.toolRegistry = t;
|
|
33
27
|
}
|
|
@@ -42,37 +36,36 @@ var c = class {
|
|
|
42
36
|
error: `未注册的 skill / tool:${e}`
|
|
43
37
|
};
|
|
44
38
|
}
|
|
45
|
-
async invoke(
|
|
46
|
-
let
|
|
47
|
-
if (!
|
|
39
|
+
async invoke(t, n, r, i, a) {
|
|
40
|
+
let o = e(r);
|
|
41
|
+
if (!o.ok) return {
|
|
48
42
|
ok: !1,
|
|
49
|
-
kind:
|
|
50
|
-
name:
|
|
51
|
-
source:
|
|
52
|
-
error:
|
|
43
|
+
kind: t,
|
|
44
|
+
name: n,
|
|
45
|
+
source: a,
|
|
46
|
+
error: o.error
|
|
53
47
|
};
|
|
54
|
-
let
|
|
48
|
+
let s = o.value;
|
|
55
49
|
try {
|
|
56
50
|
return {
|
|
57
51
|
ok: !0,
|
|
58
|
-
kind:
|
|
59
|
-
name:
|
|
60
|
-
source:
|
|
61
|
-
input:
|
|
62
|
-
output: await
|
|
52
|
+
kind: t,
|
|
53
|
+
name: n,
|
|
54
|
+
source: a,
|
|
55
|
+
input: s,
|
|
56
|
+
output: await i(s)() ?? null
|
|
63
57
|
};
|
|
64
|
-
} catch (
|
|
58
|
+
} catch (e) {
|
|
65
59
|
return {
|
|
66
60
|
ok: !1,
|
|
67
|
-
kind:
|
|
68
|
-
name:
|
|
69
|
-
source:
|
|
70
|
-
input:
|
|
71
|
-
error:
|
|
61
|
+
kind: t,
|
|
62
|
+
name: n,
|
|
63
|
+
source: a,
|
|
64
|
+
input: s,
|
|
65
|
+
error: e instanceof Error ? e.message : String(e)
|
|
72
66
|
};
|
|
73
67
|
}
|
|
74
68
|
}
|
|
75
69
|
};
|
|
76
|
-
c = i([n(), r("design:paramtypes", [typeof (a = e !== void 0 && e) == "function" ? a : Object, typeof (o = t !== void 0 && t) == "function" ? o : Object])], c);
|
|
77
70
|
//#endregion
|
|
78
|
-
export {
|
|
71
|
+
export { t as ExecutorService };
|
|
@@ -1,21 +1,12 @@
|
|
|
1
|
-
import { builtinTools as e } from "./builtin/index.js";
|
|
2
|
-
import { Injectable as t } from "@nestjs/common";
|
|
3
|
-
import { ModuleRef as n } from "@nestjs/core";
|
|
4
|
-
import r from "@oxc-project/runtime/helpers/decorateMetadata";
|
|
5
|
-
import i from "@oxc-project/runtime/helpers/decorate";
|
|
6
1
|
//#region app/ai/tool/tool-registry.service.ts
|
|
7
|
-
var
|
|
2
|
+
var e = class {
|
|
8
3
|
tools = /* @__PURE__ */ new Map();
|
|
9
|
-
constructor(e) {
|
|
10
|
-
this.moduleRef = e;
|
|
11
|
-
}
|
|
12
|
-
onModuleInit() {
|
|
13
|
-
for (let t of e) this.register(t({ moduleRef: this.moduleRef }));
|
|
14
|
-
let t = this.listNames();
|
|
15
|
-
console.log(`[ai] tools registered (${t.length}): ${t.join(", ")}`);
|
|
16
|
-
}
|
|
17
4
|
register(e) {
|
|
18
5
|
if (typeof e?.name != "string" || e.name.trim() === "") throw Error("[ai] tool register fail: name 必填(非空字符串)");
|
|
6
|
+
if (e.name.trim() !== e.name) throw Error(`[ai] tool register fail: name must not include surrounding whitespace (${e.name})`);
|
|
7
|
+
if (typeof e.description != "string") throw Error(`[ai] tool register fail: description must be a string (${e.name})`);
|
|
8
|
+
if (typeof e.inputSchema != "object" || e.inputSchema === null || Array.isArray(e.inputSchema)) throw Error(`[ai] tool register fail: inputSchema must be an object (${e.name})`);
|
|
9
|
+
if (typeof e.execute != "function") throw Error(`[ai] tool register fail: execute must be a function (${e.name})`);
|
|
19
10
|
this.tools.has(e.name) && console.log(`[ai] tool overwritten: ${e.name}`), this.tools.set(e.name, e);
|
|
20
11
|
}
|
|
21
12
|
get(e) {
|
|
@@ -28,6 +19,5 @@ var a, o = class {
|
|
|
28
19
|
return [...this.tools.keys()];
|
|
29
20
|
}
|
|
30
21
|
};
|
|
31
|
-
o = i([t(), r("design:paramtypes", [typeof (a = n !== void 0 && n) == "function" ? a : Object])], o);
|
|
32
22
|
//#endregion
|
|
33
|
-
export {
|
|
23
|
+
export { e as ToolRegistryService };
|
|
@@ -1,14 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import i from "
|
|
1
|
+
import { provideAiService as e } from "../nest-service-provider.js";
|
|
2
|
+
import { ToolRegistryService as t } from "./tool-registry.service.js";
|
|
3
|
+
import { SkillScannerService as n } from "../skill/skill-scanner.service.js";
|
|
4
|
+
import { SkillModule as r } from "../skill/skill.module.js";
|
|
5
|
+
import { ExecutorService as i } from "./executor.service.js";
|
|
6
|
+
import { builtinTools as a } from "./builtin/index.js";
|
|
7
|
+
import { Module as o } from "@nestjs/common";
|
|
8
|
+
import s from "@oxc-project/runtime/helpers/decorate";
|
|
9
|
+
import { ModuleRef as c } from "@nestjs/core";
|
|
10
|
+
import l from "@oxc-project/runtime/helpers/decorateMetadata";
|
|
6
11
|
//#region app/ai/tool/tool.module.ts
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
var u, d, f = class {
|
|
13
|
+
constructor(e, t) {
|
|
14
|
+
this.registry = e, this.moduleRef = t;
|
|
15
|
+
}
|
|
16
|
+
onModuleInit() {
|
|
17
|
+
for (let e of a) this.registry.register(e({ moduleRef: this.moduleRef }));
|
|
18
|
+
let e = this.registry.listNames();
|
|
19
|
+
console.log(`[ai] tools registered (${e.length}): ${e.join(", ")}`);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
f = s([o({
|
|
23
|
+
imports: [r],
|
|
24
|
+
providers: [t, e(i, n, t)],
|
|
25
|
+
exports: [t, i]
|
|
26
|
+
}), l("design:paramtypes", [typeof (u = t !== void 0 && t) == "function" ? u : Object, typeof (d = c !== void 0 && c) == "function" ? d : Object])], f);
|
|
13
27
|
//#endregion
|
|
14
|
-
export {
|
|
28
|
+
export { f as ToolModule };
|