@capybara-hq/kernel 0.1.0-rc.2 → 0.1.0-rc.4
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/dist/admin/admin.controller.d.ts +9 -4
- package/dist/admin/admin.controller.js +13 -4
- package/dist/admin/extensions.controller.d.ts +8 -1
- package/dist/admin/extensions.controller.js +22 -2
- package/dist/agents/agent-lookup.d.ts +3 -0
- package/dist/agents/agent-lookup.js +20 -2
- package/dist/agents/agent-profile.service.d.ts +29 -0
- package/dist/agents/agent-profile.service.js +117 -0
- package/dist/agents/agents.controller.d.ts +93 -3
- package/dist/agents/agents.controller.js +114 -4
- package/dist/agents/agents.module.js +6 -2
- package/dist/agents/agents.service.d.ts +13 -5
- package/dist/agents/agents.service.js +49 -13
- package/dist/agents/definition.d.ts +35 -8
- package/dist/agents/definition.js +203 -17
- package/dist/agents/instruction-files.d.ts +60 -0
- package/dist/agents/instruction-files.js +111 -0
- package/dist/agents/models.controller.d.ts +9 -3
- package/dist/agents/models.controller.js +19 -4
- package/dist/agents/profile.d.ts +96 -0
- package/dist/agents/profile.js +51 -0
- package/dist/agents/readiness.controller.d.ts +26 -0
- package/dist/agents/readiness.controller.js +56 -0
- package/dist/agents/templates.js +20 -5
- package/dist/background/background.controller.d.ts +38 -0
- package/dist/background/background.controller.js +87 -0
- package/dist/background/background.module.d.ts +10 -0
- package/dist/background/background.module.js +32 -0
- package/dist/background/finish.d.ts +43 -0
- package/dist/background/finish.js +94 -0
- package/dist/background/launch-lock.d.ts +14 -0
- package/dist/background/launch-lock.js +39 -0
- package/dist/background/launch.d.ts +36 -0
- package/dist/background/launch.js +70 -0
- package/dist/background/poll.job.d.ts +53 -0
- package/dist/background/poll.job.js +182 -0
- package/dist/background/render.d.ts +23 -0
- package/dist/background/render.js +48 -0
- package/dist/background/session.d.ts +37 -0
- package/dist/background/session.js +66 -0
- package/dist/background/status.d.ts +35 -0
- package/dist/background/status.js +57 -0
- package/dist/background/stop.d.ts +62 -0
- package/dist/background/stop.js +225 -0
- package/dist/background/store.d.ts +150 -0
- package/dist/background/store.js +351 -0
- package/dist/background/store.module.d.ts +6 -0
- package/dist/background/store.module.js +22 -0
- package/dist/background/tasks.service.d.ts +67 -0
- package/dist/background/tasks.service.js +186 -0
- package/dist/background/wake-rules.d.ts +57 -0
- package/dist/background/wake-rules.js +83 -0
- package/dist/background/wake.d.ts +28 -0
- package/dist/background/wake.js +57 -0
- package/dist/catalog/catalog-content.js +4 -1
- package/dist/catalog/claude/agents.js +15 -10
- package/dist/catalog/marketplaces.service.d.ts +1 -1
- package/dist/catalog/plugin-import.js +1 -1
- package/dist/catalog/plugin-upgrade.js +1 -1
- package/dist/channels/cards.d.ts +8 -2
- package/dist/channels/cards.js +17 -9
- package/dist/channels/connections.service.d.ts +16 -1
- package/dist/channels/connections.service.js +38 -4
- package/dist/channels/threads.d.ts +5 -0
- package/dist/channels/threads.js +8 -0
- package/dist/config/schema.d.ts +18 -0
- package/dist/config/schema.js +104 -2
- package/dist/conversations/access.js +2 -0
- package/dist/conversations/artifacts.d.ts +1 -1
- package/dist/conversations/artifacts.js +1 -1
- package/dist/conversations/attachments.service.d.ts +30 -0
- package/dist/conversations/attachments.service.js +130 -5
- package/dist/conversations/conversations.controller.d.ts +36 -5
- package/dist/conversations/conversations.controller.js +62 -12
- package/dist/conversations/conversations.module.js +3 -0
- package/dist/conversations/conversations.service.d.ts +44 -2
- package/dist/conversations/conversations.service.js +140 -12
- package/dist/conversations/event-log.d.ts +12 -1
- package/dist/conversations/event-log.js +29 -1
- package/dist/conversations/events.d.ts +81 -3
- package/dist/conversations/events.js +83 -16
- package/dist/conversations/queue.d.ts +3 -1
- package/dist/conversations/queue.js +13 -2
- package/dist/conversations/queue.service.js +3 -1
- package/dist/conversations/titles.d.ts +7 -0
- package/dist/conversations/titles.js +15 -0
- package/dist/db/kernel-schema.d.ts +60 -4
- package/dist/db/pool.d.ts +5 -0
- package/dist/db/pool.js +3 -0
- package/dist/errors.d.ts +8 -0
- package/dist/errors.js +8 -0
- package/dist/evals/recorded-tools.d.ts +27 -1
- package/dist/evals/recorded-tools.js +85 -10
- package/dist/evals/run-replay.d.ts +10 -2
- package/dist/evals/run-replay.js +49 -12
- package/dist/evals/step-replay.js +12 -6
- package/dist/evals/trajectory.d.ts +2 -2
- package/dist/evals/trajectory.js +1 -1
- package/dist/extensions/admin-ops.js +2 -0
- package/dist/extensions/admin-view.d.ts +3 -1
- package/dist/extensions/admin-view.js +10 -2
- package/dist/extensions/blobs.js +1 -0
- package/dist/extensions/config-issues.d.ts +13 -1
- package/dist/extensions/config-issues.js +22 -5
- package/dist/extensions/config-json-schema.d.ts +43 -7
- package/dist/extensions/config-json-schema.js +124 -58
- package/dist/extensions/deployment-config-store.d.ts +6 -0
- package/dist/extensions/deployment-config.d.ts +50 -3
- package/dist/extensions/deployment-config.js +125 -28
- package/dist/extensions/display-name.d.ts +22 -0
- package/dist/extensions/display-name.js +77 -0
- package/dist/extensions/extensions.module.js +6 -0
- package/dist/extensions/host.d.ts +26 -1
- package/dist/extensions/host.js +82 -9
- package/dist/extensions/org-config.controller.d.ts +11 -3
- package/dist/extensions/org-config.controller.js +14 -6
- package/dist/extensions/org-config.d.ts +6 -0
- package/dist/extensions/org-config.js +12 -13
- package/dist/extensions/package.d.ts +14 -1
- package/dist/extensions/package.js +51 -2
- package/dist/extensions/permission-view.d.ts +3 -0
- package/dist/extensions/point-defaults.controller.d.ts +34 -0
- package/dist/extensions/point-defaults.controller.js +71 -0
- package/dist/extensions/point-defaults.d.ts +64 -0
- package/dist/extensions/point-defaults.js +206 -0
- package/dist/extensions/registry.d.ts +1 -1
- package/dist/extensions/registry.js +2 -0
- package/dist/http/api.module.js +8 -0
- package/dist/http/nest-logger.d.ts +6 -5
- package/dist/http/nest-logger.js +24 -10
- package/dist/identity/auth.controller.js +9 -5
- package/dist/identity/cookies.d.ts +20 -5
- package/dist/identity/cookies.js +44 -6
- package/dist/identity/me.controller.d.ts +5 -1
- package/dist/identity/me.controller.js +12 -3
- package/dist/identity/sessions.d.ts +12 -0
- package/dist/identity/sessions.js +45 -0
- package/dist/identity/settings.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/infra/config/kernel-config.service.js +6 -0
- package/dist/infra/database/database.module.js +1 -0
- package/dist/infra/events/kernel-events.d.ts +8 -0
- package/dist/infra/lifecycle/process-guards.js +4 -0
- package/dist/infra/logging/logging.module.d.ts +4 -2
- package/dist/infra/logging/logging.module.js +24 -6
- package/dist/infra/queue/redis-connection.d.ts +6 -0
- package/dist/infra/queue/redis-connection.js +7 -0
- package/dist/infra/redis/redis.module.js +6 -2
- package/dist/infra/tokens.d.ts +6 -1
- package/dist/infra/tokens.js +6 -1
- package/dist/lifecycle/kernel-lifecycle.js +5 -0
- package/dist/log.d.ts +13 -1
- package/dist/log.js +93 -17
- package/dist/models/purposes.d.ts +23 -0
- package/dist/models/purposes.js +31 -10
- package/dist/orgs/offboarding.d.ts +3 -1
- package/dist/orgs/offboarding.js +26 -16
- package/dist/orgs/settings.service.d.ts +7 -2
- package/dist/orgs/settings.service.js +15 -4
- package/dist/roles/worker.module.js +6 -0
- package/dist/runtime/context/build.d.ts +15 -13
- package/dist/runtime/context/build.js +45 -27
- package/dist/runtime/context/claude-tools.d.ts +3 -1
- package/dist/runtime/context/claude-tools.js +12 -12
- package/dist/runtime/context/compaction.js +4 -0
- package/dist/runtime/context/legacy-text.d.ts +22 -0
- package/dist/runtime/context/legacy-text.js +37 -0
- package/dist/runtime/context/skills.d.ts +29 -11
- package/dist/runtime/context/skills.js +37 -30
- package/dist/runtime/langgraph-loop.js +3 -2
- package/dist/runtime/loop.d.ts +5 -4
- package/dist/runtime/maintenance.d.ts +4 -2
- package/dist/runtime/maintenance.js +17 -5
- package/dist/runtime/model-call.d.ts +17 -1
- package/dist/runtime/model-call.js +4 -3
- package/dist/runtime/providers.d.ts +6 -0
- package/dist/runtime/providers.js +8 -0
- package/dist/runtime/run-finish.d.ts +1 -1
- package/dist/runtime/run-queue.d.ts +28 -5
- package/dist/runtime/run-queue.js +131 -35
- package/dist/runtime/run-worker.d.ts +2 -2
- package/dist/runtime/run-worker.js +20 -7
- package/dist/runtime/runtime.module.js +8 -3
- package/dist/runtime/step-log.d.ts +6 -0
- package/dist/runtime/step-log.js +16 -2
- package/dist/runtime/subagents/definition.d.ts +1 -6
- package/dist/runtime/subagents/definition.js +14 -13
- package/dist/runtime/subagents/dispatch.d.ts +2 -2
- package/dist/runtime/subagents/dispatch.js +2 -2
- package/dist/runtime/subagents/org-agents.js +2 -1
- package/dist/runtime/subagents/roster.d.ts +1 -1
- package/dist/runtime/subagents/roster.js +1 -1
- package/dist/runtime/subagents/skill-fork.d.ts +2 -2
- package/dist/runtime/subagents/skill-fork.js +2 -2
- package/dist/runtime/subagents/subagents.service.d.ts +3 -3
- package/dist/runtime/subagents/subagents.service.js +3 -3
- package/dist/runtime/usage-report.d.ts +2 -1
- package/dist/runtime/usage-report.js +2 -1
- package/dist/runtime/waits.d.ts +13 -7
- package/dist/runtime/waits.js +42 -16
- package/dist/sandbox/sandbox.module.js +6 -1
- package/dist/sandbox/sandbox.service.d.ts +61 -3
- package/dist/sandbox/sandbox.service.js +141 -7
- package/dist/skills/catalog.d.ts +4 -4
- package/dist/skills/catalog.js +4 -4
- package/dist/skills/changes.service.d.ts +2 -2
- package/dist/skills/changes.service.js +5 -4
- package/dist/skills/invocation-keys.d.ts +1 -1
- package/dist/skills/invocation-keys.js +1 -1
- package/dist/skills/invoke.d.ts +1 -1
- package/dist/skills/invoke.js +5 -4
- package/dist/tools/approvals.service.d.ts +6 -0
- package/dist/tools/approvals.service.js +21 -1
- package/dist/tools/builtin-names.d.ts +91 -0
- package/dist/tools/builtin-names.js +143 -0
- package/dist/tools/builtins/agent.d.ts +7 -7
- package/dist/tools/builtins/agent.js +7 -11
- package/dist/tools/builtins/ask-user.d.ts +1 -1
- package/dist/tools/builtins/ask-user.js +2 -2
- package/dist/tools/builtins/builtin-tools.d.ts +17 -3
- package/dist/tools/builtins/builtin-tools.js +36 -4
- package/dist/tools/builtins/read-tool-output.d.ts +1 -1
- package/dist/tools/builtins/read-tool-output.js +2 -2
- package/dist/tools/builtins/sandbox/bash.d.ts +4 -4
- package/dist/tools/builtins/sandbox/bash.js +259 -29
- package/dist/tools/builtins/sandbox/common.d.ts +30 -7
- package/dist/tools/builtins/sandbox/common.js +9 -5
- package/dist/tools/builtins/sandbox/deliver.d.ts +1 -1
- package/dist/tools/builtins/sandbox/deliver.js +12 -12
- package/dist/tools/builtins/sandbox/edit.d.ts +1 -1
- package/dist/tools/builtins/sandbox/edit.js +41 -30
- package/dist/tools/builtins/sandbox/file-state.d.ts +34 -0
- package/dist/tools/builtins/sandbox/file-state.js +34 -0
- package/dist/tools/builtins/sandbox/glob-match.d.ts +1 -1
- package/dist/tools/builtins/sandbox/glob-match.js +1 -1
- package/dist/tools/builtins/sandbox/glob.d.ts +1 -1
- package/dist/tools/builtins/sandbox/glob.js +4 -4
- package/dist/tools/builtins/sandbox/grep.d.ts +7 -4
- package/dist/tools/builtins/sandbox/grep.js +147 -30
- package/dist/tools/builtins/sandbox/index.d.ts +3 -1
- package/dist/tools/builtins/sandbox/index.js +7 -1
- package/dist/tools/builtins/sandbox/read.d.ts +2 -2
- package/dist/tools/builtins/sandbox/read.js +21 -14
- package/dist/tools/builtins/sandbox/task-output.d.ts +63 -0
- package/dist/tools/builtins/sandbox/task-output.js +304 -0
- package/dist/tools/builtins/sandbox/task-stop.d.ts +10 -0
- package/dist/tools/builtins/sandbox/task-stop.js +112 -0
- package/dist/tools/builtins/sandbox/write.d.ts +1 -1
- package/dist/tools/builtins/sandbox/write.js +37 -33
- package/dist/tools/builtins/skill-load.d.ts +3 -3
- package/dist/tools/builtins/skill-load.js +32 -16
- package/dist/tools/builtins/skill-write.d.ts +4 -4
- package/dist/tools/builtins/skill-write.js +10 -10
- package/dist/tools/builtins/tool-search.d.ts +13 -9
- package/dist/tools/builtins/tool-search.js +25 -14
- package/dist/tools/builtins/web/errors.d.ts +8 -0
- package/dist/tools/builtins/web/errors.js +53 -0
- package/dist/tools/builtins/web/extract.d.ts +62 -0
- package/dist/tools/builtins/web/extract.js +267 -0
- package/dist/tools/builtins/web/fetch.d.ts +55 -0
- package/dist/tools/builtins/web/fetch.js +174 -0
- package/dist/tools/builtins/web/index.d.ts +13 -0
- package/dist/tools/builtins/web/index.js +12 -0
- package/dist/tools/builtins/web/page-cache.d.ts +25 -0
- package/dist/tools/builtins/web/page-cache.js +77 -0
- package/dist/tools/builtins/web/search.d.ts +25 -0
- package/dist/tools/builtins/web/search.js +209 -0
- package/dist/tools/builtins/web/url.d.ts +17 -0
- package/dist/tools/builtins/web/url.js +43 -0
- package/dist/tools/connectors.service.js +4 -4
- package/dist/tools/display-names.d.ts +9 -0
- package/dist/tools/display-names.js +24 -0
- package/dist/tools/drift.js +5 -5
- package/dist/tools/elicitation.js +1 -1
- package/dist/tools/info.d.ts +20 -4
- package/dist/tools/info.js +55 -32
- package/dist/tools/legacy-data.d.ts +34 -0
- package/dist/tools/legacy-data.js +76 -0
- package/dist/tools/legacy-keys.d.ts +51 -0
- package/dist/tools/legacy-keys.js +115 -0
- package/dist/tools/naming.d.ts +1 -5
- package/dist/tools/naming.js +1 -7
- package/dist/tools/oauth/flow-paths.d.ts +1 -1
- package/dist/tools/oauth/flow-paths.js +1 -1
- package/dist/tools/outputs.js +1 -1
- package/dist/tools/pipeline.d.ts +13 -7
- package/dist/tools/pipeline.js +112 -39
- package/dist/tools/policy.d.ts +1 -14
- package/dist/tools/policy.js +13 -19
- package/dist/tools/questions.controller.d.ts +1 -1
- package/dist/tools/questions.controller.js +1 -1
- package/dist/tools/questions.service.d.ts +1 -1
- package/dist/tools/registry.d.ts +38 -24
- package/dist/tools/registry.js +54 -47
- package/dist/tools/resources.d.ts +1 -1
- package/dist/tools/resources.js +1 -1
- package/dist/tools/tools.module.js +13 -1
- package/dist/tools/validate.js +1 -1
- package/package.json +3 -3
- package/src/migrations/0063_tool_keys_claude_code.sql +220 -0
- package/src/migrations/0064_account_last_org.sql +7 -0
- package/src/migrations/0065_conversation_archive.sql +8 -0
- package/src/migrations/0066_extension_display_name.sql +4 -0
- package/src/migrations/0067_agent_profiles.sql +20 -0
- package/src/migrations/0068_agent_avatar_uploads.sql +7 -0
- package/src/migrations/0069_attachments_agent_idx.sql +3 -0
- package/src/migrations/0070_background_tasks.sql +37 -0
- package/src/migrations/0071_background_tasks_reserve.sql +6 -0
- package/src/migrations/0072_background_tasks_stopping.sql +5 -0
- package/src/migrations/0073_org_extension_point_defaults.sql +11 -0
- package/dist/tools/builtins/sandbox/names.d.ts +0 -7
- package/dist/tools/builtins/sandbox/names.js +0 -20
package/dist/tools/registry.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Connector, InputRequired, ToolAnnotations, ToolCallContext, ToolResult, ToolSpec } from "@capybara-hq/plugin-sdk";
|
|
1
|
+
import type { Connector, HookParentScope, InputRequired, ToolAnnotations, ToolCallContext, ToolResult, ToolSpec } from "@capybara-hq/plugin-sdk";
|
|
2
2
|
import type { AgentDefinition } from "../agents/definition.js";
|
|
3
3
|
import type { ToolView } from "../conversations/events.js";
|
|
4
4
|
import { ExtensionHost } from "../extensions/host.js";
|
|
@@ -6,14 +6,10 @@ import { ExtensionRegistry } from "../extensions/registry.js";
|
|
|
6
6
|
import { KernelConfigService } from "../infra/config/kernel-config.service.js";
|
|
7
7
|
import { KernelDb } from "../infra/database/kernel-db.js";
|
|
8
8
|
import type { OrgRole } from "../orgs/roles.js";
|
|
9
|
+
import type { ConversationKindForHooks } from "../runtime/hook-calls.js";
|
|
9
10
|
import { BuiltinTools } from "./builtins/builtin-tools.js";
|
|
11
|
+
export { BUILTIN_TOOL_NAMES } from "./builtin-names.js";
|
|
10
12
|
export { canonicalJson } from "./canonical-json.js";
|
|
11
|
-
/**
|
|
12
|
-
* 内核内置工具的名字(Task 10 / Task 19 实现;M5 T8 加沙箱工具)。保存 agent 时内置工具引用按这份清单校验,
|
|
13
|
-
* 不依赖当前是否已注册,避免实现落地顺序影响已保存的定义;运行时未注册的照常报不可用。
|
|
14
|
-
* `skill_write`(M5 T15)由 agent 定义显式引用才可用(负责人决定 agent 能否改自己的技能)。
|
|
15
|
-
*/
|
|
16
|
-
export declare const BUILTIN_TOOL_NAMES: readonly ["ask_user", "read_tool_output", "tool_search", "skill_load", "skill_write", "sandbox_bash", "sandbox_read", "sandbox_write", "sandbox_edit", "sandbox_glob", "sandbox_grep", "sandbox_deliver", "agent"];
|
|
17
13
|
/** 保存 agent 时引用校验的问题(`path` 为 `tools.<i>`)。 */
|
|
18
14
|
export interface ToolRefIssue {
|
|
19
15
|
path: string;
|
|
@@ -21,7 +17,7 @@ export interface ToolRefIssue {
|
|
|
21
17
|
}
|
|
22
18
|
/**
|
|
23
19
|
* 内置工具处理函数的上下文:在 SDK 的 `ToolCallContext` 之上,管线额外传入本步解析出的工具
|
|
24
|
-
* (`
|
|
20
|
+
* (`ToolSearch` 据此搜索)。插件处理函数收到的仍是 `ToolCallContext`。
|
|
25
21
|
*/
|
|
26
22
|
export interface BuiltinCallContext extends ToolCallContext {
|
|
27
23
|
tools?: readonly ResolvedTool[];
|
|
@@ -37,9 +33,21 @@ export interface BuiltinCallContext extends ToolCallContext {
|
|
|
37
33
|
* for a sub-agent's call, the conversation itself otherwise (the default when absent).
|
|
38
34
|
*/
|
|
39
35
|
sandboxConversationId?: string;
|
|
36
|
+
/** The parent run of a sub-agent's run (absent for a top-level run). */
|
|
37
|
+
parentRunId?: string;
|
|
38
|
+
/**
|
|
39
|
+
* The rest of the run's hook scope, for a builtin that makes a model call of its own (the
|
|
40
|
+
* `WebFetch` extraction fires `model.request` / `model.response`): the step of the call, the
|
|
41
|
+
* agent version of the run, the conversation kind (hooks fire for `chat` and `subagent` only)
|
|
42
|
+
* and, for a sub-agent, where it was dispatched from.
|
|
43
|
+
*/
|
|
44
|
+
step?: number;
|
|
45
|
+
agentVersion?: number;
|
|
46
|
+
conversationKind?: ConversationKindForHooks;
|
|
47
|
+
parent?: HookParentScope;
|
|
40
48
|
}
|
|
41
49
|
/**
|
|
42
|
-
* 内置工具的结果:`ToolResult` 之外可带 `loadedTools`(`
|
|
50
|
+
* 内置工具的结果:`ToolResult` 之外可带 `loadedTools`(`ToolSearch` 加载的工具 key,
|
|
43
51
|
* 管线写进 `tool_result.loadedTools`)。
|
|
44
52
|
*/
|
|
45
53
|
export type BuiltinResult = (ToolResult & {
|
|
@@ -52,7 +60,7 @@ export type BuiltinResult = (ToolResult & {
|
|
|
52
60
|
}) | InputRequired;
|
|
53
61
|
/** 内置工具的处理函数(插件的 `ToolHandler` 可直接赋给它)。 */
|
|
54
62
|
export type BuiltinHandler = (input: unknown, ctx: BuiltinCallContext) => Promise<BuiltinResult>;
|
|
55
|
-
/** 内核内置工具(`
|
|
63
|
+
/** 内核内置工具(`AskUserQuestion` 等,Task 10 实现具体工具);key 就是 `spec.name`。 */
|
|
56
64
|
export interface BuiltinTool {
|
|
57
65
|
spec: ToolSpec;
|
|
58
66
|
defaultPolicy: "allow" | "ask";
|
|
@@ -63,8 +71,14 @@ export interface BuiltinTool {
|
|
|
63
71
|
timeoutMs?: (input: unknown) => number;
|
|
64
72
|
/** 结果转存阈值(字符):与 `tools.outputSpillChars` 取小者。缺省只用配置。 */
|
|
65
73
|
spillChars?: number;
|
|
66
|
-
/**
|
|
67
|
-
|
|
74
|
+
/**
|
|
75
|
+
* The factual reason this tool is unavailable for the org right now (English, actionable; it goes
|
|
76
|
+
* into the "tool unavailable" reminder), or null when it is available. May be async (e.g. a
|
|
77
|
+
* per-org extension-point default).
|
|
78
|
+
*/
|
|
79
|
+
unavailable?: (ctx: {
|
|
80
|
+
orgId: string;
|
|
81
|
+
}) => Promise<string | null> | string | null;
|
|
68
82
|
}
|
|
69
83
|
/**
|
|
70
84
|
* agent 定义里对工具的引用(Task 6 在 `AgentDefinitionSchema` 中落地同形的 zod schema)。
|
|
@@ -116,7 +130,7 @@ export interface ResolvedTool {
|
|
|
116
130
|
*/
|
|
117
131
|
requiredRole?: OrgRole;
|
|
118
132
|
}
|
|
119
|
-
/** 不可用的引用:`ref` 尽量写成模型认识的工具 key(`
|
|
133
|
+
/** 不可用的引用:`ref` 尽量写成模型认识的工具 key(`mcp__docs__search`、`mcp__docs__*`),否则 `app:<id>`。 */
|
|
120
134
|
export interface UnavailableTool {
|
|
121
135
|
ref: string;
|
|
122
136
|
reason: string;
|
|
@@ -148,7 +162,7 @@ export interface AgentTools {
|
|
|
148
162
|
*/
|
|
149
163
|
hidden?: UnavailableTool[];
|
|
150
164
|
/**
|
|
151
|
-
* 本步是否启用 `
|
|
165
|
+
* 本步是否启用 `ToolSearch`(spec 5.5):启用时 `tools` 末尾含 `ToolSearch`,构建请求时只放内置工具
|
|
152
166
|
* 与已加载工具的完整定义,其余进目录。缺省视为未启用。
|
|
153
167
|
*/
|
|
154
168
|
toolSearch?: boolean;
|
|
@@ -178,7 +192,7 @@ export declare class ToolRegistry {
|
|
|
178
192
|
private readonly extensions;
|
|
179
193
|
private readonly builtinTools;
|
|
180
194
|
/**
|
|
181
|
-
* `tools.searchThreshold*` and the sub-agent limits. Absent (some tests): `
|
|
195
|
+
* `tools.searchThreshold*` and the sub-agent limits. Absent (some tests): `ToolSearch` is never
|
|
182
196
|
* offered and the sub-agent limits are the schema defaults.
|
|
183
197
|
*/
|
|
184
198
|
private readonly config?;
|
|
@@ -188,11 +202,11 @@ export declare class ToolRegistry {
|
|
|
188
202
|
/** The installed connectors (`connector@1`, from the extension registry). */
|
|
189
203
|
extensions: Pick<ExtensionRegistry, "list">, builtinTools: Pick<BuiltinTools, "list">,
|
|
190
204
|
/**
|
|
191
|
-
* `tools.searchThreshold*` and the sub-agent limits. Absent (some tests): `
|
|
205
|
+
* `tools.searchThreshold*` and the sub-agent limits. Absent (some tests): `ToolSearch` is never
|
|
192
206
|
* offered and the sub-agent limits are the schema defaults.
|
|
193
207
|
*/
|
|
194
208
|
config?: Pick<KernelConfigService, "get"> | undefined);
|
|
195
|
-
/** The kernel's builtin tools (`
|
|
209
|
+
/** The kernel's builtin tools (`ToolSearch` is added by {@link forAgent}, not by definitions). */
|
|
196
210
|
private get builtins();
|
|
197
211
|
/** `host.list("connector")` 中 `kind` 匹配的第一个实现;未安装返回 undefined。 */
|
|
198
212
|
findConnector(kind: string): Connector | undefined;
|
|
@@ -228,23 +242,23 @@ export declare class ToolRegistry {
|
|
|
228
242
|
issues: ToolRefIssue[];
|
|
229
243
|
}>;
|
|
230
244
|
/**
|
|
231
|
-
* 解析 agent 引用的工具(见类注释),再判定是否启用 `
|
|
245
|
+
* 解析 agent 引用的工具(见类注释),再判定是否启用 `ToolSearch`:组织设置 `toolSearch === "on"`,且
|
|
232
246
|
* 可用工具数 > `tools.searchThresholdTools` 或其定义的估算 token > `tools.searchThresholdTokens`。
|
|
233
|
-
* 启用时把内置 `
|
|
234
|
-
* `skillLoad`:对话日志里有技能目录快照(`skills_catalog`,Ruling M17)→ 加入内置 `
|
|
235
|
-
* 定义里显式引用的 `
|
|
247
|
+
* 启用时把内置 `ToolSearch` 追加到末尾。定义里显式引用的 `ToolSearch` 忽略(由这里按设置管理)。
|
|
248
|
+
* `skillLoad`:对话日志里有技能目录快照(`skills_catalog`,Ruling M17)→ 加入内置 `Skill`(始终完整加载);
|
|
249
|
+
* 定义里显式引用的 `Skill` 同样忽略。
|
|
236
250
|
*/
|
|
237
251
|
forAgent(orgId: string, def: {
|
|
238
252
|
tools: readonly AgentToolRef[];
|
|
239
253
|
skillLoad?: boolean;
|
|
240
|
-
/** The definition's sub-agent roster source: the `
|
|
254
|
+
/** The definition's sub-agent roster source: the `Agent` tool's description lists it. */
|
|
241
255
|
subagents?: AgentDefinition["subagents"];
|
|
242
256
|
}): Promise<AgentTools>;
|
|
243
|
-
/** 是否启用 `
|
|
257
|
+
/** 是否启用 `ToolSearch`(见 {@link forAgent});先比阈值,超过才读组织设置。 */
|
|
244
258
|
private searchActive;
|
|
245
259
|
private resolve;
|
|
246
260
|
/**
|
|
247
|
-
* `subagents.maxConcurrentPerRun` with the organization's override, for the `
|
|
261
|
+
* `subagents.maxConcurrentPerRun` with the organization's override, for the `Agent` tool's
|
|
248
262
|
* description (§4.3). A change of the limit changes the tool's spec hash; replays read the
|
|
249
263
|
* definition logged by hash, so no drift reason is involved. Without config (some tests): the
|
|
250
264
|
* schema default.
|
package/dist/tools/registry.js
CHANGED
|
@@ -8,6 +8,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
8
8
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
9
9
|
};
|
|
10
10
|
import { createHash } from "node:crypto";
|
|
11
|
+
import { connectorToolKey, extensionToolKey } from "@capybara-hq/plugin-sdk";
|
|
11
12
|
import { Inject, Injectable } from "@nestjs/common";
|
|
12
13
|
import { ExtensionHost } from "../extensions/host.js";
|
|
13
14
|
import { ExtensionRegistry } from "../extensions/registry.js";
|
|
@@ -17,27 +18,14 @@ import { readOrgSettings } from "../orgs/settings.service.js";
|
|
|
17
18
|
import { estimateTokens } from "../runtime/context/tokens.js";
|
|
18
19
|
import { SUBAGENT_LIMIT_DEFAULTS, subagentLimits } from "../runtime/subagents/limits.js";
|
|
19
20
|
import { resolveRoster } from "../runtime/subagents/roster.js";
|
|
20
|
-
import { AGENT_TOOL,
|
|
21
|
+
import { AGENT_TOOL, BASH_COMPANION_TOOLS, BUILTIN, BUILTIN_TOOL_NAMES, SKILL_LOAD, TOOL_SEARCH, } from "./builtin-names.js";
|
|
22
|
+
import { agentToolSpec } from "./builtins/agent.js";
|
|
21
23
|
import { BuiltinTools } from "./builtins/builtin-tools.js";
|
|
22
|
-
import { SANDBOX_TOOL_NAMES } from "./builtins/sandbox/names.js";
|
|
23
24
|
import { canonicalJson } from "./canonical-json.js";
|
|
24
|
-
import {
|
|
25
|
+
import { legacyKeySaveText } from "./legacy-keys.js";
|
|
26
|
+
import { toolKeyIssue } from "./naming.js";
|
|
27
|
+
export { BUILTIN_TOOL_NAMES } from "./builtin-names.js";
|
|
25
28
|
export { canonicalJson } from "./canonical-json.js";
|
|
26
|
-
/**
|
|
27
|
-
* 内核内置工具的名字(Task 10 / Task 19 实现;M5 T8 加沙箱工具)。保存 agent 时内置工具引用按这份清单校验,
|
|
28
|
-
* 不依赖当前是否已注册,避免实现落地顺序影响已保存的定义;运行时未注册的照常报不可用。
|
|
29
|
-
* `skill_write`(M5 T15)由 agent 定义显式引用才可用(负责人决定 agent 能否改自己的技能)。
|
|
30
|
-
*/
|
|
31
|
-
export const BUILTIN_TOOL_NAMES = [
|
|
32
|
-
"ask_user",
|
|
33
|
-
"read_tool_output",
|
|
34
|
-
"tool_search",
|
|
35
|
-
"skill_load",
|
|
36
|
-
"skill_write",
|
|
37
|
-
...SANDBOX_TOOL_NAMES,
|
|
38
|
-
// phase C: dispatches sub-agents; its description is built per agent from the roster
|
|
39
|
-
"agent",
|
|
40
|
-
];
|
|
41
29
|
/** The first 16 hex digits of sha256(canonicalJson(v)): a fingerprint independent of key order. */
|
|
42
30
|
export function contentHash(v) {
|
|
43
31
|
return createHash("sha256").update(canonicalJson(v)).digest("hex").slice(0, 16);
|
|
@@ -68,10 +56,8 @@ export function specHash(spec) {
|
|
|
68
56
|
export function policyFromAnnotations(a) {
|
|
69
57
|
return a?.readOnlyHint === true ? "allow" : "ask";
|
|
70
58
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
/** 内置 `skill_load` 的名字(对话日志里有技能目录快照时由注册表自动加入,不进 agent 定义)。 */
|
|
74
|
-
const SKILL_LOAD = "skill_load";
|
|
59
|
+
// `ToolSearch` is added by the registry by org setting and threshold, `Skill` when the log has a
|
|
60
|
+
// skills catalog snapshot; neither comes from agent definitions (`./builtin-names.ts`).
|
|
75
61
|
/** 工具定义(模型可见三项)的估算 token 数(与请求估算同一口径)。 */
|
|
76
62
|
function estimateToolTokens(tools) {
|
|
77
63
|
return estimateTokens([], [], tools.map((t) => ({
|
|
@@ -85,6 +71,16 @@ const sourceId = (s) => s.kind === "builtin"
|
|
|
85
71
|
: s.kind === "plugin"
|
|
86
72
|
? `plugin:${s.plugin}:${s.name}`
|
|
87
73
|
: `connector:${s.connectorId}:${s.name}`;
|
|
74
|
+
/** A builtin as a resolved tool (with `spec`, which `Agent` builds per definition). */
|
|
75
|
+
const builtinTool = (b, spec) => ({
|
|
76
|
+
key: b.spec.name,
|
|
77
|
+
source: { kind: "builtin", name: b.spec.name },
|
|
78
|
+
spec,
|
|
79
|
+
specHash: specHash(spec),
|
|
80
|
+
defaultPolicy: b.defaultPolicy,
|
|
81
|
+
...(b.timeoutMs !== undefined && { timeoutMs: b.timeoutMs }),
|
|
82
|
+
...(b.spillChars !== undefined && { spillChars: b.spillChars }),
|
|
83
|
+
});
|
|
88
84
|
/**
|
|
89
85
|
* Tool registry: resolves the references in an agent definition into the tools available for this
|
|
90
86
|
* run. Not cached (reads PG and the host live every time), so changes take effect right away across
|
|
@@ -114,7 +110,7 @@ let ToolRegistry = class ToolRegistry {
|
|
|
114
110
|
/** The installed connectors (`connector@1`, from the extension registry). */
|
|
115
111
|
extensions, builtinTools,
|
|
116
112
|
/**
|
|
117
|
-
* `tools.searchThreshold*` and the sub-agent limits. Absent (some tests): `
|
|
113
|
+
* `tools.searchThreshold*` and the sub-agent limits. Absent (some tests): `ToolSearch` is never
|
|
118
114
|
* offered and the sub-agent limits are the schema defaults.
|
|
119
115
|
*/
|
|
120
116
|
config) {
|
|
@@ -124,7 +120,7 @@ let ToolRegistry = class ToolRegistry {
|
|
|
124
120
|
this.builtinTools = builtinTools;
|
|
125
121
|
this.config = config;
|
|
126
122
|
}
|
|
127
|
-
/** The kernel's builtin tools (`
|
|
123
|
+
/** The kernel's builtin tools (`ToolSearch` is added by {@link forAgent}, not by definitions). */
|
|
128
124
|
get builtins() {
|
|
129
125
|
return this.builtinTools.list();
|
|
130
126
|
}
|
|
@@ -205,13 +201,24 @@ let ToolRegistry = class ToolRegistry {
|
|
|
205
201
|
const path = `tools.${i}`;
|
|
206
202
|
if (ref.kind === "builtin") {
|
|
207
203
|
if (!BUILTIN_TOOL_NAMES.includes(ref.name)) {
|
|
208
|
-
|
|
204
|
+
const renamed = legacyKeySaveText(ref.name);
|
|
205
|
+
issues.push({
|
|
206
|
+
path,
|
|
207
|
+
message: renamed === null
|
|
208
|
+
? `Built-in tool "${ref.name}" does not exist`
|
|
209
|
+
: `Built-in tool ${renamed}`,
|
|
210
|
+
});
|
|
209
211
|
return;
|
|
210
212
|
}
|
|
211
213
|
claim(path, ref.name, `builtin:${ref.name}`);
|
|
214
|
+
// offered with Bash (see resolve), so their policies validate too
|
|
215
|
+
if (ref.name === BUILTIN.Bash) {
|
|
216
|
+
for (const c of BASH_COMPANION_TOOLS)
|
|
217
|
+
claim(path, c, `builtin:${c}`);
|
|
218
|
+
}
|
|
212
219
|
}
|
|
213
220
|
else if (ref.kind === "plugin") {
|
|
214
|
-
const key =
|
|
221
|
+
const key = extensionToolKey(ref.plugin, ref.name);
|
|
215
222
|
if (!pluginTools.some((x) => x.plugin === ref.plugin && x.spec.name === ref.name)) {
|
|
216
223
|
issues.push({ path, message: `Plugin tool "${key}" does not exist` });
|
|
217
224
|
return;
|
|
@@ -238,18 +245,18 @@ let ToolRegistry = class ToolRegistry {
|
|
|
238
245
|
});
|
|
239
246
|
continue;
|
|
240
247
|
}
|
|
241
|
-
claim(path,
|
|
248
|
+
claim(path, connectorToolKey(app.slug, name), `connector:${app.id}:${name}`);
|
|
242
249
|
}
|
|
243
250
|
}
|
|
244
251
|
});
|
|
245
252
|
return { keys: new Set(owner.keys()), issues };
|
|
246
253
|
}
|
|
247
254
|
/**
|
|
248
|
-
* 解析 agent 引用的工具(见类注释),再判定是否启用 `
|
|
255
|
+
* 解析 agent 引用的工具(见类注释),再判定是否启用 `ToolSearch`:组织设置 `toolSearch === "on"`,且
|
|
249
256
|
* 可用工具数 > `tools.searchThresholdTools` 或其定义的估算 token > `tools.searchThresholdTokens`。
|
|
250
|
-
* 启用时把内置 `
|
|
251
|
-
* `skillLoad`:对话日志里有技能目录快照(`skills_catalog`,Ruling M17)→ 加入内置 `
|
|
252
|
-
* 定义里显式引用的 `
|
|
257
|
+
* 启用时把内置 `ToolSearch` 追加到末尾。定义里显式引用的 `ToolSearch` 忽略(由这里按设置管理)。
|
|
258
|
+
* `skillLoad`:对话日志里有技能目录快照(`skills_catalog`,Ruling M17)→ 加入内置 `Skill`(始终完整加载);
|
|
259
|
+
* 定义里显式引用的 `Skill` 同样忽略。
|
|
253
260
|
*/
|
|
254
261
|
async forAgent(orgId, def) {
|
|
255
262
|
const { tools, unavailable, hidden } = await this.resolve(orgId, def);
|
|
@@ -277,7 +284,7 @@ let ToolRegistry = class ToolRegistry {
|
|
|
277
284
|
}
|
|
278
285
|
return { tools, unavailable, hidden, toolSearch };
|
|
279
286
|
}
|
|
280
|
-
/** 是否启用 `
|
|
287
|
+
/** 是否启用 `ToolSearch`(见 {@link forAgent});先比阈值,超过才读组织设置。 */
|
|
281
288
|
async searchActive(orgId, tools) {
|
|
282
289
|
const cfg = this.config?.get().tools;
|
|
283
290
|
if (!cfg || !this.builtins.some((b) => b.spec.name === TOOL_SEARCH))
|
|
@@ -324,12 +331,12 @@ let ToolRegistry = class ToolRegistry {
|
|
|
324
331
|
unavailable.push({ ref: ref.name, reason: "Built-in tool does not exist" });
|
|
325
332
|
continue;
|
|
326
333
|
}
|
|
327
|
-
const why = b.unavailable?.() ?? null;
|
|
334
|
+
const why = (await b.unavailable?.({ orgId })) ?? null;
|
|
328
335
|
if (why !== null) {
|
|
329
336
|
unavailable.push({ ref: ref.name, reason: why });
|
|
330
337
|
continue;
|
|
331
338
|
}
|
|
332
|
-
// `
|
|
339
|
+
// `Agent`: the description lists this definition's roster (sub-agents spec §4.3); with an
|
|
333
340
|
// empty roster there is nothing to dispatch, so the tool is not offered at all
|
|
334
341
|
let spec = b.spec;
|
|
335
342
|
if (b.spec.name === AGENT_TOOL) {
|
|
@@ -338,18 +345,18 @@ let ToolRegistry = class ToolRegistry {
|
|
|
338
345
|
continue;
|
|
339
346
|
spec = agentToolSpec(roster, await this.maxConcurrentSubagents(orgId));
|
|
340
347
|
}
|
|
341
|
-
add(
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
}
|
|
348
|
+
add(builtinTool(b, spec));
|
|
349
|
+
// `TaskOutput` and `TaskStop` come with an available `Bash` (background Bash spec §2)
|
|
350
|
+
if (b.spec.name === BUILTIN.Bash) {
|
|
351
|
+
for (const name of BASH_COMPANION_TOOLS) {
|
|
352
|
+
const c = this.builtins.find((x) => x.spec.name === name);
|
|
353
|
+
if (c && ((await c.unavailable?.({ orgId })) ?? null) === null)
|
|
354
|
+
add(builtinTool(c, c.spec));
|
|
355
|
+
}
|
|
356
|
+
}
|
|
350
357
|
}
|
|
351
358
|
else if (ref.kind === "plugin") {
|
|
352
|
-
const key =
|
|
359
|
+
const key = extensionToolKey(ref.plugin, ref.name);
|
|
353
360
|
const t = pluginTools.find((x) => x.plugin === ref.plugin && x.spec.name === ref.name);
|
|
354
361
|
if (!t) {
|
|
355
362
|
unavailable.push({ ref: key, reason: "Plugin tool does not exist" });
|
|
@@ -381,7 +388,7 @@ let ToolRegistry = class ToolRegistry {
|
|
|
381
388
|
unavailable.push({ ref: `app:${ref.connectorId}`, reason: "App does not exist" });
|
|
382
389
|
continue;
|
|
383
390
|
}
|
|
384
|
-
const all =
|
|
391
|
+
const all = connectorToolKey(app.slug, "*");
|
|
385
392
|
if (app.deleted) {
|
|
386
393
|
unavailable.push({ ref: all, reason: `App ${app.slug} was deleted` });
|
|
387
394
|
continue;
|
|
@@ -403,7 +410,7 @@ let ToolRegistry = class ToolRegistry {
|
|
|
403
410
|
// 「all」里未启用的工具不算 agent 点名要的,不进 unavailable(不提醒),只记进 hidden 备查
|
|
404
411
|
const notEnabled = ref.tools === "all" ? hidden : unavailable;
|
|
405
412
|
for (const t of wanted) {
|
|
406
|
-
const key =
|
|
413
|
+
const key = connectorToolKey(app.slug, t.name);
|
|
407
414
|
// 远端已不再提供(漂移检测置停用并标记,见 drift.ts):与「没有这一行」同一个事实
|
|
408
415
|
if ("missing" in t || t.gone) {
|
|
409
416
|
notEnabled.push({ ref: key, reason: `Tool no longer exists in app ${app.slug}` });
|
|
@@ -440,7 +447,7 @@ let ToolRegistry = class ToolRegistry {
|
|
|
440
447
|
return { tools, unavailable, hidden };
|
|
441
448
|
}
|
|
442
449
|
/**
|
|
443
|
-
* `subagents.maxConcurrentPerRun` with the organization's override, for the `
|
|
450
|
+
* `subagents.maxConcurrentPerRun` with the organization's override, for the `Agent` tool's
|
|
444
451
|
* description (§4.3). A change of the limit changes the tool's spec hash; replays read the
|
|
445
452
|
* definition logged by hash, so no drift reason is involved. Without config (some tests): the
|
|
446
453
|
* schema default.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ConnectorSession, type ToolResult, type ToolSpec } from "@capybara-hq/plugin-sdk";
|
|
2
2
|
/**
|
|
3
|
-
* 连接器 resources 的两个内核工具(brief
|
|
3
|
+
* 连接器 resources 的两个内核工具(brief:`mcp__<slug>__list_resources`、`mcp__<slug>__read_resource {uri}`)。
|
|
4
4
|
*
|
|
5
5
|
* 设计:安装 / 刷新连接器时,连接器会话带 `listResources` 方法即视为支持 resources(不额外调用,免得多一次外连
|
|
6
6
|
* 和多一种失败),内核把这两个工具作为 `source = 'resources'` 的行写进 `connector_tools`(迁移 0013)。这样它们和
|
package/dist/tools/resources.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ToolError, } from "@capybara-hq/plugin-sdk";
|
|
2
2
|
/**
|
|
3
|
-
* 连接器 resources 的两个内核工具(brief
|
|
3
|
+
* 连接器 resources 的两个内核工具(brief:`mcp__<slug>__list_resources`、`mcp__<slug>__read_resource {uri}`)。
|
|
4
4
|
*
|
|
5
5
|
* 设计:安装 / 刷新连接器时,连接器会话带 `listResources` 方法即视为支持 resources(不额外调用,免得多一次外连
|
|
6
6
|
* 和多一种失败),内核把这两个工具作为 `source = 'resources'` 的行写进 `connector_tools`(迁移 0013)。这样它们和
|
|
@@ -5,20 +5,25 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { Module } from "@nestjs/common";
|
|
8
|
+
import { BackgroundModule } from "../background/background.module.js";
|
|
8
9
|
import { ConversationAccessModule } from "../conversations/access.js";
|
|
9
10
|
import { AttachmentsModule } from "../conversations/attachments.module.js";
|
|
10
11
|
import { EventLogModule } from "../conversations/event-log.js";
|
|
11
12
|
import { ExtensionsModule } from "../extensions/extensions.module.js";
|
|
12
13
|
import { QueueModule } from "../infra/queue/queue.module.js";
|
|
14
|
+
import { ModelsModule } from "../models/models.module.js";
|
|
13
15
|
import { OrgLockModule } from "../orgs/org-lock.js";
|
|
14
16
|
import { MAINTENANCE_QUEUE_NAME } from "../runtime/maintenance-queue.js";
|
|
17
|
+
import { StepLogModule } from "../runtime/step-log.js";
|
|
15
18
|
import { SubagentsModule } from "../runtime/subagents/subagents.service.js";
|
|
19
|
+
import { UsageReportModule } from "../runtime/usage-report.js";
|
|
16
20
|
import { SandboxModule } from "../sandbox/sandbox.module.js";
|
|
17
21
|
import { SkillsModule } from "../skills/skills.module.js";
|
|
18
22
|
import { StorageModule } from "../storage/storage.module.js";
|
|
19
23
|
import { ApprovalsService } from "./approvals.service.js";
|
|
20
24
|
import { Breaker } from "./breaker.js";
|
|
21
25
|
import { BuiltinTools } from "./builtins/builtin-tools.js";
|
|
26
|
+
import { WebPages } from "./builtins/web/page-cache.js";
|
|
22
27
|
import { ConnectorContent } from "./connector-content.js";
|
|
23
28
|
import { ConnectorsService } from "./connectors.service.js";
|
|
24
29
|
import { Credentials } from "./credentials.js";
|
|
@@ -48,18 +53,25 @@ ToolsModule = __decorate([
|
|
|
48
53
|
StorageModule,
|
|
49
54
|
SkillsModule,
|
|
50
55
|
OrgLockModule,
|
|
51
|
-
// the `
|
|
56
|
+
// the `Agent` tool's dispatch
|
|
52
57
|
SubagentsModule,
|
|
53
58
|
// the builtin sandbox and skill tools run in the conversation's sandbox
|
|
54
59
|
SandboxModule,
|
|
60
|
+
// `Bash` with run_in_background records its task; TaskOutput / TaskStop finish and stop it
|
|
61
|
+
BackgroundModule,
|
|
55
62
|
// the conversation page's tool metadata reads only what the viewer may see
|
|
56
63
|
ConversationAccessModule,
|
|
64
|
+
// the WebFetch extraction call: its purpose, usage report and step writes
|
|
65
|
+
ModelsModule,
|
|
66
|
+
UsageReportModule,
|
|
67
|
+
StepLogModule,
|
|
57
68
|
QueueModule.registerQueue(MAINTENANCE_QUEUE_NAME),
|
|
58
69
|
],
|
|
59
70
|
providers: [
|
|
60
71
|
Credentials,
|
|
61
72
|
ToolOutputs,
|
|
62
73
|
BuiltinTools,
|
|
74
|
+
WebPages,
|
|
63
75
|
ToolRegistry,
|
|
64
76
|
ApprovalsService,
|
|
65
77
|
QuestionsService,
|
package/dist/tools/validate.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capybara-hq/kernel",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.4",
|
|
4
4
|
"description": "Capybara kernel: config, database, plugin host and HTTP API of the Capybara agent platform",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -64,14 +64,14 @@
|
|
|
64
64
|
"yaml": "^2.9.1",
|
|
65
65
|
"yauzl": "3.4.0",
|
|
66
66
|
"zod": "^4.6.7",
|
|
67
|
-
"@capybara-hq/plugin-sdk": "^0.1.0-rc.
|
|
67
|
+
"@capybara-hq/plugin-sdk": "^0.1.0-rc.2"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@langchain/langgraph-checkpoint-validation": "^1.2.0",
|
|
71
71
|
"@types/pg": "^8.23.1",
|
|
72
72
|
"@types/semver": "^7.8.0",
|
|
73
73
|
"@types/yauzl": "3.4.0",
|
|
74
|
-
"@capybara-hq/testing": "0.1.0-rc.
|
|
74
|
+
"@capybara-hq/testing": "0.1.0-rc.4"
|
|
75
75
|
},
|
|
76
76
|
"scripts": {
|
|
77
77
|
"build": "tsc -b"
|