veryfront 0.1.758 → 0.1.761

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.
Files changed (223) hide show
  1. package/esm/cli/commands/init/catalog.d.ts.map +1 -1
  2. package/esm/cli/commands/init/catalog.js +116 -1
  3. package/esm/cli/shared/config.d.ts +0 -6
  4. package/esm/cli/shared/config.d.ts.map +1 -1
  5. package/esm/cli/shared/config.js +64 -8
  6. package/esm/cli/templates/integration-loader.d.ts.map +1 -1
  7. package/esm/cli/templates/integration-loader.js +2 -52
  8. package/esm/cli/templates/manifest.js +2 -2
  9. package/esm/deno.d.ts +5 -16
  10. package/esm/deno.js +6 -17
  11. package/esm/src/agent/ag-ui/tool-shared.d.ts.map +1 -1
  12. package/esm/src/agent/ag-ui/tool-shared.js +7 -1
  13. package/esm/src/agent/child-run/invoke-agent-child-runs.d.ts +0 -1
  14. package/esm/src/agent/child-run/invoke-agent-child-runs.d.ts.map +1 -1
  15. package/esm/src/agent/child-run/invoke-agent-child-runs.js +0 -1
  16. package/esm/src/agent/conversation/bootstrap.d.ts +0 -1
  17. package/esm/src/agent/conversation/bootstrap.d.ts.map +1 -1
  18. package/esm/src/agent/conversation/bootstrap.js +0 -1
  19. package/esm/src/agent/conversation/durable.d.ts +0 -1
  20. package/esm/src/agent/conversation/durable.d.ts.map +1 -1
  21. package/esm/src/agent/conversation/durable.js +0 -1
  22. package/esm/src/agent/factory.d.ts.map +1 -1
  23. package/esm/src/agent/factory.js +7 -1
  24. package/esm/src/agent/hosted/chat-preparation.d.ts +1 -1
  25. package/esm/src/agent/hosted/chat-preparation.d.ts.map +1 -1
  26. package/esm/src/agent/hosted/chat-preparation.js +17 -3
  27. package/esm/src/agent/hosted/chat-runtime-contract.d.ts +2 -0
  28. package/esm/src/agent/hosted/chat-runtime-contract.d.ts.map +1 -1
  29. package/esm/src/agent/hosted/default-chat-runtime.d.ts +2 -0
  30. package/esm/src/agent/hosted/default-chat-runtime.d.ts.map +1 -1
  31. package/esm/src/agent/hosted/default-chat-runtime.js +1 -0
  32. package/esm/src/agent/hosted/default-project-steering-refresh.js +1 -1
  33. package/esm/src/agent/hosted/project-steering-adapter.d.ts +7 -0
  34. package/esm/src/agent/hosted/project-steering-adapter.d.ts.map +1 -1
  35. package/esm/src/agent/hosted/project-steering-adapter.js +12 -1
  36. package/esm/src/agent/hosted/veryfront-cloud-agent-service.d.ts +4 -0
  37. package/esm/src/agent/hosted/veryfront-cloud-agent-service.d.ts.map +1 -1
  38. package/esm/src/agent/hosted/veryfront-cloud-agent-service.js +14 -12
  39. package/esm/src/agent/index.d.ts +1 -0
  40. package/esm/src/agent/index.d.ts.map +1 -1
  41. package/esm/src/agent/index.js +1 -0
  42. package/esm/src/agent/memory/index.d.ts +1 -1
  43. package/esm/src/agent/memory/index.d.ts.map +1 -1
  44. package/esm/src/agent/memory/index.js +1 -1
  45. package/esm/src/agent/memory/memory-interface.d.ts +7 -0
  46. package/esm/src/agent/memory/memory-interface.d.ts.map +1 -1
  47. package/esm/src/agent/memory/memory.d.ts +25 -0
  48. package/esm/src/agent/memory/memory.d.ts.map +1 -1
  49. package/esm/src/agent/memory/memory.js +38 -0
  50. package/esm/src/agent/project/context.d.ts +2 -0
  51. package/esm/src/agent/project/context.d.ts.map +1 -1
  52. package/esm/src/agent/project/context.js +1 -0
  53. package/esm/src/agent/project/steering-mutation.d.ts.map +1 -1
  54. package/esm/src/agent/project/steering-mutation.js +7 -1
  55. package/esm/src/agent/runtime/agent-definition.d.ts +6 -0
  56. package/esm/src/agent/runtime/agent-definition.d.ts.map +1 -1
  57. package/esm/src/agent/runtime/agent-definition.js +46 -0
  58. package/esm/src/agent/runtime/agent-delegation-names.d.ts +5 -0
  59. package/esm/src/agent/runtime/agent-delegation-names.d.ts.map +1 -0
  60. package/esm/src/agent/runtime/agent-delegation-names.js +8 -0
  61. package/esm/src/agent/runtime/agent-delegation.d.ts +32 -0
  62. package/esm/src/agent/runtime/agent-delegation.d.ts.map +1 -0
  63. package/esm/src/agent/runtime/agent-delegation.js +57 -0
  64. package/esm/src/agent/runtime/agent-markdown-adapter.d.ts.map +1 -1
  65. package/esm/src/agent/runtime/agent-markdown-adapter.js +24 -0
  66. package/esm/src/agent/runtime/defaults.d.ts +0 -2
  67. package/esm/src/agent/runtime/defaults.d.ts.map +1 -1
  68. package/esm/src/agent/runtime/defaults.js +0 -2
  69. package/esm/src/agent/runtime/index.d.ts +9 -0
  70. package/esm/src/agent/runtime/index.d.ts.map +1 -1
  71. package/esm/src/agent/runtime/index.js +45 -20
  72. package/esm/src/agent/runtime/local-tool.d.ts +6 -0
  73. package/esm/src/agent/runtime/local-tool.d.ts.map +1 -0
  74. package/esm/src/agent/runtime/local-tool.js +15 -0
  75. package/esm/src/agent/runtime/project-skill-catalog.d.ts.map +1 -1
  76. package/esm/src/agent/runtime/project-skill-catalog.js +67 -0
  77. package/esm/src/agent/runtime/project-skill-loader.d.ts +9 -0
  78. package/esm/src/agent/runtime/project-skill-loader.d.ts.map +1 -1
  79. package/esm/src/agent/runtime/project-skill-loader.js +44 -6
  80. package/esm/src/agent/runtime/skill-metadata.d.ts +23 -0
  81. package/esm/src/agent/runtime/skill-metadata.d.ts.map +1 -1
  82. package/esm/src/agent/runtime/skill-metadata.js +11 -0
  83. package/esm/src/agent/runtime/tool-helpers.d.ts +3 -1
  84. package/esm/src/agent/runtime/tool-helpers.d.ts.map +1 -1
  85. package/esm/src/agent/runtime/tool-helpers.js +45 -11
  86. package/esm/src/agent/schemas/agent.schema.d.ts +1 -0
  87. package/esm/src/agent/schemas/agent.schema.d.ts.map +1 -1
  88. package/esm/src/agent/schemas/agent.schema.js +3 -0
  89. package/esm/src/agent/service/request-auth-cache.d.ts +0 -1
  90. package/esm/src/agent/service/request-auth-cache.d.ts.map +1 -1
  91. package/esm/src/agent/service/request-auth-cache.js +0 -1
  92. package/esm/src/agent/types.d.ts +8 -0
  93. package/esm/src/agent/types.d.ts.map +1 -1
  94. package/esm/src/channels/control-plane.d.ts +1 -0
  95. package/esm/src/channels/control-plane.d.ts.map +1 -1
  96. package/esm/src/channels/control-plane.js +4 -2
  97. package/esm/src/chat/ag-ui.d.ts.map +1 -1
  98. package/esm/src/chat/conversation.d.ts.map +1 -1
  99. package/esm/src/chat/final-step-fallback.d.ts.map +1 -1
  100. package/esm/src/chat/protocol.d.ts.map +1 -1
  101. package/esm/src/chat/protocol.js +1 -0
  102. package/esm/src/chat/provider-errors.d.ts.map +1 -1
  103. package/esm/src/chat/provider-errors.js +0 -1
  104. package/esm/src/chat/stream-watchdog.d.ts +0 -1
  105. package/esm/src/chat/stream-watchdog.d.ts.map +1 -1
  106. package/esm/src/chat/stream-watchdog.js +0 -1
  107. package/esm/src/config/environment-config.d.ts +1 -0
  108. package/esm/src/config/environment-config.d.ts.map +1 -1
  109. package/esm/src/config/environment-config.js +4 -0
  110. package/esm/src/discovery/agent-scoped-capabilities.d.ts +54 -0
  111. package/esm/src/discovery/agent-scoped-capabilities.d.ts.map +1 -0
  112. package/esm/src/discovery/agent-scoped-capabilities.js +228 -0
  113. package/esm/src/discovery/discovery-engine.d.ts.map +1 -1
  114. package/esm/src/discovery/discovery-engine.js +19 -15
  115. package/esm/src/discovery/file-discovery.d.ts +10 -0
  116. package/esm/src/discovery/file-discovery.d.ts.map +1 -1
  117. package/esm/src/discovery/file-discovery.js +46 -0
  118. package/esm/src/discovery/handlers/runtime-agent-markdown-handler.d.ts +12 -0
  119. package/esm/src/discovery/handlers/runtime-agent-markdown-handler.d.ts.map +1 -1
  120. package/esm/src/discovery/handlers/runtime-agent-markdown-handler.js +99 -22
  121. package/esm/src/errors/error-registry/agent.d.ts +2 -0
  122. package/esm/src/errors/error-registry/agent.d.ts.map +1 -1
  123. package/esm/src/errors/error-registry/agent.js +8 -0
  124. package/esm/src/errors/error-registry.d.ts +1 -0
  125. package/esm/src/errors/error-registry.d.ts.map +1 -1
  126. package/esm/src/extensions/errors.d.ts +2 -0
  127. package/esm/src/extensions/errors.d.ts.map +1 -1
  128. package/esm/src/extensions/errors.js +8 -0
  129. package/esm/src/extensions/loader.d.ts +9 -6
  130. package/esm/src/extensions/loader.d.ts.map +1 -1
  131. package/esm/src/extensions/loader.js +39 -4
  132. package/esm/src/extensions/orchestrate.d.ts +3 -0
  133. package/esm/src/extensions/orchestrate.d.ts.map +1 -1
  134. package/esm/src/extensions/orchestrate.js +3 -1
  135. package/esm/src/integrations/_data.d.ts.map +1 -1
  136. package/esm/src/integrations/_data.js +31348 -7875
  137. package/esm/src/integrations/_tool_summaries.d.ts.map +1 -1
  138. package/esm/src/integrations/_tool_summaries.js +1737 -11
  139. package/esm/src/integrations/feature-flags.d.ts +1 -1
  140. package/esm/src/integrations/feature-flags.d.ts.map +1 -1
  141. package/esm/src/integrations/feature-flags.js +83 -0
  142. package/esm/src/integrations/schema.d.ts +129 -4
  143. package/esm/src/integrations/schema.d.ts.map +1 -1
  144. package/esm/src/integrations/schema.js +126 -1
  145. package/esm/src/internal-agents/run-stream.d.ts +4 -0
  146. package/esm/src/internal-agents/run-stream.d.ts.map +1 -1
  147. package/esm/src/internal-agents/run-stream.js +18 -5
  148. package/esm/src/mcp/server.d.ts.map +1 -1
  149. package/esm/src/mcp/server.js +5 -0
  150. package/esm/src/platform/adapters/base.d.ts +7 -0
  151. package/esm/src/platform/adapters/base.d.ts.map +1 -1
  152. package/esm/src/platform/adapters/runtime/deno/adapter.d.ts.map +1 -1
  153. package/esm/src/platform/adapters/runtime/deno/adapter.js +7 -2
  154. package/esm/src/registry/project-scoped-registry-manager.d.ts +7 -0
  155. package/esm/src/registry/project-scoped-registry-manager.d.ts.map +1 -1
  156. package/esm/src/registry/project-scoped-registry-manager.js +10 -0
  157. package/esm/src/registry/scoped-registry-facade.d.ts +2 -0
  158. package/esm/src/registry/scoped-registry-facade.d.ts.map +1 -1
  159. package/esm/src/registry/scoped-registry-facade.js +4 -0
  160. package/esm/src/rendering/layouts/utils/component-loader.d.ts +1 -1
  161. package/esm/src/rendering/layouts/utils/component-loader.d.ts.map +1 -1
  162. package/esm/src/rendering/layouts/utils/component-loader.js +82 -3
  163. package/esm/src/rendering/orchestrator/css-cache.d.ts +3 -0
  164. package/esm/src/rendering/orchestrator/css-cache.d.ts.map +1 -1
  165. package/esm/src/rendering/orchestrator/css-cache.js +16 -8
  166. package/esm/src/rendering/orchestrator/mdx.d.ts.map +1 -1
  167. package/esm/src/rendering/orchestrator/mdx.js +12 -1
  168. package/esm/src/server/bootstrap.d.ts.map +1 -1
  169. package/esm/src/server/bootstrap.js +3 -0
  170. package/esm/src/server/handlers/dev/dashboard/api.js +6 -3
  171. package/esm/src/server/handlers/request/agent-stream.handler.d.ts.map +1 -1
  172. package/esm/src/server/handlers/request/agent-stream.handler.js +10 -0
  173. package/esm/src/server/handlers/request/channel-invoke.handler.d.ts.map +1 -1
  174. package/esm/src/server/handlers/request/channel-invoke.handler.js +8 -0
  175. package/esm/src/server/handlers/request/runtime-shutdown-response.d.ts +13 -0
  176. package/esm/src/server/handlers/request/runtime-shutdown-response.d.ts.map +1 -0
  177. package/esm/src/server/handlers/request/runtime-shutdown-response.js +16 -0
  178. package/esm/src/server/production-server.d.ts.map +1 -1
  179. package/esm/src/server/production-server.js +7 -1
  180. package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.d.ts.map +1 -1
  181. package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.js +2 -2
  182. package/esm/src/server/shutdown-state.d.ts +16 -0
  183. package/esm/src/server/shutdown-state.d.ts.map +1 -0
  184. package/esm/src/server/shutdown-state.js +22 -0
  185. package/esm/src/skill/index.d.ts +1 -1
  186. package/esm/src/skill/index.d.ts.map +1 -1
  187. package/esm/src/skill/index.js +1 -1
  188. package/esm/src/skill/registry.d.ts +29 -3
  189. package/esm/src/skill/registry.d.ts.map +1 -1
  190. package/esm/src/skill/registry.js +57 -8
  191. package/esm/src/skill/tools.d.ts.map +1 -1
  192. package/esm/src/skill/tools.js +27 -25
  193. package/esm/src/skill/types.d.ts +8 -0
  194. package/esm/src/skill/types.d.ts.map +1 -1
  195. package/esm/src/tool/executor.d.ts +7 -1
  196. package/esm/src/tool/executor.d.ts.map +1 -1
  197. package/esm/src/tool/executor.js +12 -1
  198. package/esm/src/tool/index.d.ts +1 -1
  199. package/esm/src/tool/index.d.ts.map +1 -1
  200. package/esm/src/tool/index.js +1 -1
  201. package/esm/src/tool/registry.d.ts +1 -0
  202. package/esm/src/tool/registry.d.ts.map +1 -1
  203. package/esm/src/tool/registry.js +25 -0
  204. package/esm/src/tool/types.d.ts +9 -0
  205. package/esm/src/tool/types.d.ts.map +1 -1
  206. package/esm/src/utils/constants/cache.d.ts +8 -0
  207. package/esm/src/utils/constants/cache.d.ts.map +1 -1
  208. package/esm/src/utils/constants/cache.js +8 -0
  209. package/esm/src/utils/constants/index.d.ts +1 -1
  210. package/esm/src/utils/constants/index.d.ts.map +1 -1
  211. package/esm/src/utils/constants/index.js +1 -1
  212. package/esm/src/utils/index.d.ts +1 -1
  213. package/esm/src/utils/index.d.ts.map +1 -1
  214. package/esm/src/utils/index.js +1 -1
  215. package/esm/src/utils/lru-wrapper.d.ts +2 -0
  216. package/esm/src/utils/lru-wrapper.d.ts.map +1 -1
  217. package/esm/src/utils/lru-wrapper.js +1 -0
  218. package/esm/src/utils/version-constant.d.ts +1 -1
  219. package/esm/src/utils/version-constant.js +1 -1
  220. package/package.json +1 -45
  221. package/esm/src/chat/compat.d.ts +0 -782
  222. package/esm/src/chat/compat.d.ts.map +0 -1
  223. package/esm/src/chat/compat.js +0 -113
@@ -2,8 +2,6 @@ export declare const AGENT_DEFAULTS: {
2
2
  readonly maxTokens: 4096;
3
3
  readonly temperature: 0;
4
4
  readonly maxSteps: 20;
5
- readonly memoryType: "conversation";
6
- readonly memoryMaxTokens: 4000;
7
5
  };
8
6
  export declare const STREAMING_DEFAULTS: {
9
7
  readonly maxBufferSize: number;
@@ -1 +1 @@
1
- {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/defaults.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc;;;;;;CAMjB,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;CAGrB,CAAC"}
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/defaults.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc;;;;CAIjB,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;CAGrB,CAAC"}
@@ -2,8 +2,6 @@ export const AGENT_DEFAULTS = {
2
2
  maxTokens: 4_096,
3
3
  temperature: 0,
4
4
  maxSteps: 20,
5
- memoryType: "conversation",
6
- memoryMaxTokens: 4_000,
7
5
  };
8
6
  export const STREAMING_DEFAULTS = {
9
7
  maxBufferSize: 1_024 * 1_024, // 1 MB
@@ -31,6 +31,15 @@ export declare class AgentRuntime {
31
31
  private memory;
32
32
  private status;
33
33
  constructor(id: string, config: AgentConfig);
34
+ /**
35
+ * Persist this turn's input, then resolve the messages to run on. Configured
36
+ * memory returns the full persisted conversation (this turn + history); the
37
+ * stateless default persists nothing and returns empty, so we fall back to
38
+ * this turn's input. That fallback is what keeps concurrent stream()/
39
+ * generate() calls on a shared instance isolated instead of interleaving into
40
+ * one conversation.
41
+ */
42
+ private prepareTurnMessages;
34
43
  private resolveModelTransport;
35
44
  private resolveRuntimeState;
36
45
  private notifyToolResult;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,aAAa,EAGlB,KAAK,OAAO,EAGZ,KAAK,QAAQ,EAGd,MAAM,aAAa,CAAC;AAIrB,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAiD/D,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,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EAChC,WAAW,CAAC,EAAE,WAAW,GACxB,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;IAwJtC;;OAEG;YACW,gBAAgB;IAuS9B;;;;OAIG;YACW,yBAAyB;IAiavC;;OAEG;YACW,eAAe;IAgC7B;;OAEG;YACW,mBAAmB;IAOjC;;OAEG;IACH,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,kBAAkB;IAO1B,OAAO,CAAC,sBAAsB;IAoB9B;;OAEG;IACH,SAAS,IAAI,MAAM,CAAC,OAAO,CAAC;IAI5B;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC;QAC9B,aAAa,EAAE,MAAM,CAAC;QACtB,eAAe,EAAE,MAAM,CAAC;QACxB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IAIF;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;CAGnC"}
@@ -14,7 +14,7 @@ import { getTextFromParts, } from "../types.js";
14
14
  import { ensureModelReady, resolveModel } from "../../provider/index.js";
15
15
  import { generateId } from "../../utils/id.js";
16
16
  import { detectPlatform, getPlatformCapabilities } from "../../platform/core-platform.js";
17
- import { createMemory } from "../memory/index.js";
17
+ import { createAgentMemory } from "../memory/index.js";
18
18
  import { serverLogger } from "../../utils/index.js";
19
19
  import { addSpanEvent, setSpanAttributes, withSpan, } from "../../observability/tracing/index.js";
20
20
  import { convertToTextGenerationRuntimeMessages } from "./text-generation-runtime-message-converter.js";
@@ -24,7 +24,6 @@ import { getRuntimeRemoteToolSources } from "./mcp-server-tool-sources.js";
24
24
  import { createStreamState, processStream, } from "./chat-stream-handler.js";
25
25
  import { repairToolCall } from "./repair-tool-call.js";
26
26
  import { MiddlewareChain } from "../middleware/chain.js";
27
- import { AGENT_DEFAULTS } from "./defaults.js";
28
27
  import { tryGetCacheKeyContext } from "../../cache/cache-key-builder.js";
29
28
  import { isLocalModelRuntime } from "../../provider/runtime-inspection.js";
30
29
  import { generateText, streamText } from "../../runtime/runtime-bridge.js";
@@ -59,7 +58,7 @@ function isAbortError(error, abortSignal) {
59
58
  }
60
59
  function warnLocalToolSkipping(agentId, modelId) {
61
60
  logger.warn(`Agent "${agentId}" has tools configured but is using local model "${modelId}". ` +
62
- "Local models don't support tool calling tools will be skipped. " +
61
+ "Local models don't support tool calling. Tools will be skipped. " +
63
62
  "Set VERYFRONT_API_TOKEN and VERYFRONT_PROJECT_SLUG, or configure " +
64
63
  "OPENAI_API_KEY, ANTHROPIC_API_KEY, or GOOGLE_API_KEY for full tool support.");
65
64
  }
@@ -72,9 +71,25 @@ export class AgentRuntime {
72
71
  constructor(id, config) {
73
72
  this.id = id;
74
73
  this.config = config;
75
- const memoryConfig = config.memory ||
76
- { type: "conversation", maxTokens: AGENT_DEFAULTS.memoryMaxTokens };
77
- this.memory = createMemory(memoryConfig);
74
+ // Agents are stateless by default (see docs/guides/memory-and-streaming.md):
75
+ // with no `memory` config, calls never share conversation history, so
76
+ // concurrent stream()/generate() on a shared instance stay isolated.
77
+ // Providing `memory` opts in to cross-call persistence.
78
+ this.memory = createAgentMemory(config.memory);
79
+ }
80
+ /**
81
+ * Persist this turn's input, then resolve the messages to run on. Configured
82
+ * memory returns the full persisted conversation (this turn + history); the
83
+ * stateless default persists nothing and returns empty, so we fall back to
84
+ * this turn's input. That fallback is what keeps concurrent stream()/
85
+ * generate() calls on a shared instance isolated instead of interleaving into
86
+ * one conversation.
87
+ */
88
+ async prepareTurnMessages(inputMessages) {
89
+ for (const msg of inputMessages)
90
+ await this.memory.add(msg);
91
+ const persisted = await this.memory.getMessages();
92
+ return persisted.length > 0 ? persisted : inputMessages;
78
93
  }
79
94
  async resolveModelTransport(context, modelOverride, mode) {
80
95
  const requestedModel = resolveConfiguredAgentModel(modelOverride || this.config.model);
@@ -130,9 +145,7 @@ export class AgentRuntime {
130
145
  "agent.model": resolvedModelString,
131
146
  });
132
147
  const inputMessages = normalizeInput(input);
133
- for (const msg of inputMessages)
134
- await this.memory.add(msg);
135
- const messages = await this.memory.getMessages();
148
+ const messages = await this.prepareTurnMessages(inputMessages);
136
149
  const systemPrompt = await this.resolveSystemPrompt();
137
150
  const agentContext = {
138
151
  agentId: this.id,
@@ -159,9 +172,7 @@ export class AgentRuntime {
159
172
  if (resolvedModelString !== requestedModel) {
160
173
  logger.info(`⚡ Using runtime model "${resolvedModelString}" instead of "${requestedModel}".`);
161
174
  }
162
- for (const msg of messages)
163
- await this.memory.add(msg);
164
- const memoryMessages = await this.memory.getMessages();
175
+ const memoryMessages = await this.prepareTurnMessages(messages);
165
176
  const systemPrompt = await this.resolveSystemPrompt();
166
177
  const encoder = new TextEncoder();
167
178
  const streamAbortController = new AbortController();
@@ -185,7 +196,7 @@ export class AgentRuntime {
185
196
  ...context,
186
197
  };
187
198
  const textPartId = generateId("text");
188
- // Resolve model BEFORE creating the ReadableStream if this throws
199
+ // Resolve model BEFORE creating the ReadableStream. If this throws
189
200
  // (e.g., no_ai_available), the error propagates to the caller who can
190
201
  // return a proper error response (503) instead of a 200 with an error event.
191
202
  const languageModel = transport.languageModel;
@@ -210,7 +221,7 @@ export class AgentRuntime {
210
221
  // no-op rejection handler. When the client cancels, we abort the shared
211
222
  // signal; the loop (model fetch / tool execution) then rejects with an
212
223
  // AbortError. The `start` body awaits it, but cancellation can land after
213
- // that await settles, leaving the rejection without a consumer fatal as
224
+ // that await settles, leaving the rejection without a consumer, fatal as
214
225
  // an unhandled rejection under Deno (#2334).
215
226
  let inFlight;
216
227
  return new ReadableStream({
@@ -220,7 +231,7 @@ export class AgentRuntime {
220
231
  this.status = "streaming";
221
232
  const messageId = generateMessageId();
222
233
  sendSSE(controller, encoder, { type: "message-start", messageId });
223
- // Report the effective model when resolveModel falls back from
234
+ // Report the effective model. When resolveModel falls back from
224
235
  // cloud to local (e.g. missing API key), use the resolved object's
225
236
  // modelId so the client avatar matches the actual provider.
226
237
  const effectiveModel = isLocal && !resolvedModelString.startsWith("local/")
@@ -287,7 +298,7 @@ export class AgentRuntime {
287
298
  const toolCalls = [];
288
299
  const currentMessages = [...messages];
289
300
  const totalUsage = { promptTokens: 0, completionTokens: 0, totalTokens: 0 };
290
- // Local models can't reliably do function calling skip tools gracefully.
301
+ // Local models can't reliably do function calling, so skip tools gracefully.
291
302
  const isLocal = isLocalModelRuntime(languageModel);
292
303
  if (isLocal && this.config.tools) {
293
304
  warnLocalToolSkipping(this.id, effectiveModel);
@@ -310,6 +321,7 @@ export class AgentRuntime {
310
321
  currentRuntimeContext = runtimeState.context;
311
322
  const toolContext = { ...toolContextBase, ...currentRuntimeContext };
312
323
  let tools = isLocal ? [] : await getAvailableTools(this.config.tools, {
324
+ callerAgentId: this.id,
313
325
  includeSkillTools: Boolean(this.config.skills),
314
326
  allowedRemoteToolNames,
315
327
  forwardedRemoteToolDefinitions,
@@ -446,6 +458,9 @@ export class AgentRuntime {
446
458
  toolCallId: tc.toolCallId,
447
459
  ...toolContext,
448
460
  projectId: cacheCtx?.projectId ?? toolContext?.projectId,
461
+ // Caller identity for capability scoping. Stamped after the
462
+ // spreads so caller-supplied context cannot spoof it.
463
+ agentId: this.id,
449
464
  };
450
465
  const result = await executeConfiguredTool(tc.toolName, toolCall.args, this.config.tools, executionContext, allowedRemoteToolNames, remoteToolSources);
451
466
  await this.notifyToolResult({
@@ -507,7 +522,7 @@ export class AgentRuntime {
507
522
  const toolCalls = [];
508
523
  const currentMessages = [...messages];
509
524
  const totalUsage = { promptTokens: 0, completionTokens: 0, totalTokens: 0 };
510
- // Local models can't reliably do function calling skip tools gracefully.
525
+ // Local models can't reliably do function calling, so skip tools gracefully.
511
526
  const isLocalStreaming = isLocalModelRuntime(languageModel);
512
527
  if (isLocalStreaming && this.config.tools) {
513
528
  warnLocalToolSkipping(this.id, effectiveModel);
@@ -533,6 +548,7 @@ export class AgentRuntime {
533
548
  currentRuntimeContext = runtimeState.context;
534
549
  const toolContext = { ...toolContextBase, ...currentRuntimeContext };
535
550
  let tools = isLocalStreaming ? [] : await getAvailableTools(this.config.tools, {
551
+ callerAgentId: this.id,
536
552
  includeSkillTools: Boolean(this.config.skills),
537
553
  allowedRemoteToolNames,
538
554
  forwardedRemoteToolDefinitions,
@@ -662,13 +678,13 @@ export class AgentRuntime {
662
678
  if (isRecoverablePlaceholderToolCall(tc)) {
663
679
  // Provisional empty-object placeholder that never finalized. The
664
680
  // model never committed arguments, so we neither execute it nor
665
- // surface a stream-termination error the loop continues and the
681
+ // surface a stream-termination error, so the loop continues and the
666
682
  // next model call recovers the real tool call.
667
683
  continue;
668
684
  }
669
685
  if (isStreamedToolCallIncomplete(tc)) {
670
686
  // Stream ended before the provider finalized this tool call. We
671
- // cannot execute it record a distinct stream-termination error
687
+ // cannot execute it, so record a distinct stream-termination error
672
688
  // (not a tool-argument parse error) so the parent step and any
673
689
  // upstream orchestrator (e.g. the child-fork watchdog) see a
674
690
  // completed step with a clearly-labelled failure and can recover.
@@ -744,6 +760,9 @@ export class AgentRuntime {
744
760
  const executionContext = {
745
761
  toolCallId: tc.id,
746
762
  ...toolContext,
763
+ // Caller identity for capability scoping. Stamped after the
764
+ // spread so caller-supplied context cannot spoof it.
765
+ agentId: this.id,
747
766
  };
748
767
  const result = await executeConfiguredTool(tc.name, toolCall.args, this.config.tools, executionContext, allowedRemoteToolNames, remoteToolSources);
749
768
  throwIfAborted(abortSignal);
@@ -850,7 +869,13 @@ export class AgentRuntime {
850
869
  maxOutputTokensOverride > 0) {
851
870
  return Math.floor(maxOutputTokensOverride);
852
871
  }
853
- return this.config.memory?.maxTokens ??
872
+ // A disabled memory config contributes nothing, exactly like omitting
873
+ // `memory`, so its maxTokens (a conversation-window size) must not cap
874
+ // model output.
875
+ const memoryMaxTokens = this.config.memory?.enabled === false
876
+ ? undefined
877
+ : this.config.memory?.maxTokens;
878
+ return memoryMaxTokens ??
854
879
  (modelString ? getModelMaxOutputTokens(modelString) : undefined) ??
855
880
  DEFAULT_MAX_TOKENS;
856
881
  }
@@ -0,0 +1,6 @@
1
+ import type { Tool } from "../../tool/index.js";
2
+ /** Mark a framework-created tool as local to one agent runtime. */
3
+ export declare function markRuntimeLocalTool(tool: Tool): Tool;
4
+ /** Check whether a tool must stay out of the project-wide tool registry. */
5
+ export declare function isRuntimeLocalTool(value: unknown): boolean;
6
+ //# sourceMappingURL=local-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-tool.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/local-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAQhD,mEAAmE;AACnE,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAMrD;AAED,4EAA4E;AAC5E,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAM1D"}
@@ -0,0 +1,15 @@
1
+ const AGENT_RUNTIME_LOCAL_TOOL = Symbol("veryfront.agent.runtimeLocalTool");
2
+ /** Mark a framework-created tool as local to one agent runtime. */
3
+ export function markRuntimeLocalTool(tool) {
4
+ Object.defineProperty(tool, AGENT_RUNTIME_LOCAL_TOOL, {
5
+ value: true,
6
+ enumerable: false,
7
+ });
8
+ return tool;
9
+ }
10
+ /** Check whether a tool must stay out of the project-wide tool registry. */
11
+ export function isRuntimeLocalTool(value) {
12
+ return Boolean(value &&
13
+ typeof value === "object" &&
14
+ value[AGENT_RUNTIME_LOCAL_TOOL] === true);
15
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"project-skill-catalog.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/project-skill-catalog.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACV,4BAA4B,EAC5B,kBAAkB,EAClB,0BAA0B,EAC1B,6BAA6B,EAC9B,MAAM,2BAA2B,CAAC;AAOnC,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAChC,MAAM,qBAAqB,CAA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ClB,MAAM,CAAC,EAAE,0BAA0B,CAAC;CACrC,GAAG,sBAAsB,EAAE,CA+C3B;AAED,2CAA2C;AAC3C,wBAAsB,6BAA6B,CACjD,KAAK,EAAE,4BAA4B,GAAG,iCAAiC,GACtE,OAAO,CAAC,MAAM,CAAC,CAejB;AAED,4CAA4C;AAC5C,wBAAsB,6BAA6B,CACjD,KAAK,EAAE,4BAA4B,GAAG,iCAAiC,GACtE,OAAO,CAAC,sBAAsB,EAAE,CAAC,CA+HnC"}
@@ -114,6 +114,44 @@ export async function getRuntimeProjectSkillCatalog(input) {
114
114
  id,
115
115
  content: file.content,
116
116
  references: getProjectSkillReferences({ allFiles, file, isFlat }),
117
+ sourcePath: file.path,
118
+ logger: input.logger,
119
+ });
120
+ if (definition && !projectSkillsById.has(definition.id)) {
121
+ projectSkillsById.set(definition.id, definition);
122
+ }
123
+ }
124
+ }
125
+ // Colocated (agent-owned) skills: agents/{id}/SKILL.md (the agent's own
126
+ // skill) and agents/{id}/skills/{sub}/SKILL.md. Registered with owner
127
+ // metadata so per-run filtering and the source-path loader can apply the
128
+ // one owner-aware rule; ids match framework/control-plane discovery.
129
+ const colocatedPaths = allFiles
130
+ .map((file) => file.path)
131
+ .filter((path) => getColocatedSkillIdentity(path) !== null)
132
+ .sort();
133
+ if (colocatedPaths.length > 0) {
134
+ const colocatedFiles = await Promise.all(colocatedPaths.map((path) => input.getProjectFile({
135
+ projectId: input.projectId,
136
+ authToken: input.authToken,
137
+ branchId: input.branchId,
138
+ path,
139
+ })));
140
+ for (const file of colocatedFiles) {
141
+ if (!file?.content) {
142
+ continue;
143
+ }
144
+ const identity = getColocatedSkillIdentity(file.path);
145
+ if (!identity) {
146
+ continue;
147
+ }
148
+ const definition = buildRuntimeSkillDefinition({
149
+ id: identity.id,
150
+ content: file.content,
151
+ references: getProjectSkillReferences({ allFiles, file, isFlat: false }),
152
+ ownerAgentId: identity.ownerAgentId,
153
+ shortName: identity.shortName,
154
+ sourcePath: file.path,
117
155
  logger: input.logger,
118
156
  });
119
157
  if (definition && !projectSkillsById.has(definition.id)) {
@@ -130,6 +168,35 @@ export async function getRuntimeProjectSkillCatalog(input) {
130
168
  }
131
169
  return sortSkillsById(mergedSkillsById.values());
132
170
  }
171
+ /**
172
+ * Owned-capability namespace rule. Mirrors discovery
173
+ * (src/discovery/agent-scoped-capabilities.ts) and the control plane's skill
174
+ * source derivation; duplicated locally because the runtime layer must not
175
+ * import from discovery.
176
+ */
177
+ const AGENT_CAPABILITY_NAMESPACE_SEPARATOR = "--";
178
+ function sanitizeCapabilityNamespace(agentId) {
179
+ return agentId.replace(/[^A-Za-z0-9_-]/g, "_");
180
+ }
181
+ const COLOCATED_OWN_SKILL_REGEX = /^agents\/([^/]+)\/SKILL\.md$/;
182
+ const COLOCATED_NESTED_SKILL_REGEX = /^agents\/([^/]+)\/skills\/([^/]+)\/SKILL\.md$/;
183
+ function getColocatedSkillIdentity(path) {
184
+ const nested = path.match(COLOCATED_NESTED_SKILL_REGEX);
185
+ const nestedAgentId = nested?.[1];
186
+ const nestedShortName = nested?.[2];
187
+ if (nestedAgentId && nestedShortName) {
188
+ return {
189
+ id: `${sanitizeCapabilityNamespace(nestedAgentId)}${AGENT_CAPABILITY_NAMESPACE_SEPARATOR}${nestedShortName}`,
190
+ ownerAgentId: nestedAgentId,
191
+ shortName: nestedShortName,
192
+ };
193
+ }
194
+ const ownAgentId = path.match(COLOCATED_OWN_SKILL_REGEX)?.[1];
195
+ if (ownAgentId) {
196
+ return { id: ownAgentId, ownerAgentId: ownAgentId, shortName: ownAgentId };
197
+ }
198
+ return null;
199
+ }
133
200
  function getProjectSkillId(path, isFlat) {
134
201
  const pathParts = path.split("/");
135
202
  const fileName = pathParts.at(-1);
@@ -5,6 +5,15 @@ export type RuntimeProjectSkillContext = {
5
5
  projectId?: string | null;
6
6
  authToken: string;
7
7
  branchId?: string | null;
8
+ /**
9
+ * Per-run map of skill id to its discovered SKILL.md source path (from the
10
+ * owner-aware catalog). When present for an id, the loader resolves the
11
+ * skill and its references at that real path instead of probing
12
+ * `{skillsPath}/{skillId}/...` — required for colocated skills whose
13
+ * namespaced ids (e.g. `researcher--cite`) do not correspond to a
14
+ * `skills/{id}/` directory.
15
+ */
16
+ skillSourcePaths?: Readonly<Record<string, string>>;
8
17
  };
9
18
  /** Public API contract for runtime loaded project skill. */
10
19
  export type RuntimeLoadedProjectSkill = {
@@ -1 +1 @@
1
- {"version":3,"file":"project-skill-loader.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/project-skill-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACV,4BAA4B,EAC5B,kBAAkB,EAClB,0BAA0B,EAC1B,6BAA6B,EAC9B,MAAM,2BAA2B,CAAC;AAGnC,yCAAyC;AACzC,MAAM,MAAM,0BAA0B,GAAG;IACvC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CAAC;AAEF,4DAA4D;AAC5D,MAAM,MAAM,yBAAyB,GAAG;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF,mEAAmE;AACnE,MAAM,MAAM,+BAA+B,GAAG;IAC5C,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;CACtE,CAAC;AAEF,wDAAwD;AACxD,MAAM,MAAM,gCAAgC,GAAG;IAC7C,cAAc,EAAE,CAAC,OAAO,EAAE,4BAA4B,KAAK,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;IAC9F,eAAe,EAAE,CACf,OAAO,EAAE,6BAA6B,KACnC,OAAO,CAAC,0BA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;CAC7B,CAAC;AAoQF,2CAA2C;AAC3C,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,gCAAgC,GACxC,yBAAyB,CAQ3B"}
@@ -6,11 +6,33 @@ function getSkillPaths(options) {
6
6
  function isAccessDeniedError(error, options) {
7
7
  return options.isAccessDeniedError?.(error) ?? false;
8
8
  }
9
+ /** Directory containing the skill's files, per source kind. */
10
+ function getSkillDir(source, skillId) {
11
+ if (source.kind === "explicit") {
12
+ return source.skillDir;
13
+ }
14
+ if (source.kind === "directory") {
15
+ return `${source.skillsPath}/${skillId}`;
16
+ }
17
+ return null;
18
+ }
19
+ /** Resolves a skill's directory from the per-run catalog source path, if any. */
20
+ function resolveCatalogSkillDir(context, skillId) {
21
+ const sourcePath = context.skillSourcePaths?.[skillId];
22
+ if (!sourcePath || !sourcePath.endsWith("/SKILL.md")) {
23
+ return null;
24
+ }
25
+ return sourcePath.slice(0, -"/SKILL.md".length);
26
+ }
9
27
  async function findProjectSkillSource(input) {
10
28
  const projectId = input.context.projectId;
11
29
  if (!projectId) {
12
30
  return null;
13
31
  }
32
+ const catalogSkillDir = resolveCatalogSkillDir(input.context, input.skillId);
33
+ if (catalogSkillDir) {
34
+ return { kind: "explicit", skillDir: catalogSkillDir };
35
+ }
14
36
  for (const skillsPath of getSkillPaths(input.options)) {
15
37
  const directorySkill = await input.options.getProjectFile({
16
38
  projectId,
@@ -34,7 +56,7 @@ async function findProjectSkillSource(input) {
34
56
  return null;
35
57
  }
36
58
  function collectProjectSkillReferences(input) {
37
- const skillPrefix = `${input.skillsPath}/${input.skillId}/`;
59
+ const skillPrefix = `${input.skillDir}/`;
38
60
  const refsPrefix = `${skillPrefix}references/`;
39
61
  const references = new Set();
40
62
  for (const file of input.allFiles) {
@@ -60,7 +82,8 @@ async function listProjectSkillReferences(input) {
60
82
  const source = input.skillsPath
61
83
  ? { kind: "directory", skillsPath: input.skillsPath }
62
84
  : await findProjectSkillSource(input);
63
- if (source?.kind !== "directory") {
85
+ const skillDir = source ? getSkillDir(source, input.skillId) : null;
86
+ if (!skillDir) {
64
87
  return [];
65
88
  }
66
89
  const allFiles = await input.options.getProjectFiles({
@@ -70,8 +93,7 @@ async function listProjectSkillReferences(input) {
70
93
  });
71
94
  return collectProjectSkillReferences({
72
95
  allFiles,
73
- skillsPath: source.skillsPath,
74
- skillId: input.skillId,
96
+ skillDir,
75
97
  });
76
98
  }
77
99
  async function loadProjectSkill(input) {
@@ -80,6 +102,21 @@ async function loadProjectSkill(input) {
80
102
  return null;
81
103
  }
82
104
  try {
105
+ const catalogSkillDir = resolveCatalogSkillDir(input.context, input.skillId);
106
+ if (catalogSkillDir) {
107
+ const catalogSkill = await input.options.getProjectFile({
108
+ projectId,
109
+ authToken: input.context.authToken,
110
+ branchId: input.context.branchId,
111
+ path: `${catalogSkillDir}/SKILL.md`,
112
+ });
113
+ if (catalogSkill?.content) {
114
+ return {
115
+ instructions: catalogSkill.content,
116
+ references: await listProjectSkillReferences(input),
117
+ };
118
+ }
119
+ }
83
120
  for (const skillsPath of getSkillPaths(input.options)) {
84
121
  const directorySkill = await input.options.getProjectFile({
85
122
  projectId,
@@ -127,14 +164,15 @@ async function loadProjectSkillReference(input) {
127
164
  }
128
165
  try {
129
166
  const source = await findProjectSkillSource(input);
130
- if (source?.kind !== "directory") {
167
+ const skillDir = source ? getSkillDir(source, input.skillId) : null;
168
+ if (!skillDir) {
131
169
  return null;
132
170
  }
133
171
  const projectFile = await input.options.getProjectFile({
134
172
  projectId,
135
173
  authToken: input.context.authToken,
136
174
  branchId: input.context.branchId,
137
- path: `${source.skillsPath}/${input.skillId}/${input.normalizedFile}`,
175
+ path: `${skillDir}/${input.normalizedFile}`,
138
176
  });
139
177
  if (projectFile?.content) {
140
178
  return projectFile.content;
@@ -23,7 +23,27 @@ export type RuntimeSkillDefinition = {
23
23
  thinking?: false | number;
24
24
  maxSteps?: number;
25
25
  references?: string[];
26
+ /**
27
+ * Owning agent id for agent-scoped (colocated) skills. Unowned (undefined)
28
+ * skills are project-global; owned skills are visible only to their owner.
29
+ */
30
+ ownerAgentId?: string;
31
+ /** Short name used by the owning agent's `skills:` selector (e.g. "cite"). */
32
+ shortName?: string;
33
+ /**
34
+ * Actual discovered source path of the skill's SKILL.md. Consumers must use
35
+ * this instead of reconstructing paths from (possibly namespaced) ids.
36
+ */
37
+ sourcePath?: string;
26
38
  };
39
+ /**
40
+ * Whether a runtime skill definition is visible to the caller identified by
41
+ * the scope — the same owner-aware rule as the local skill registry: unowned
42
+ * skills plus the caller's own.
43
+ */
44
+ export declare function isRuntimeSkillVisibleTo(definition: Pick<RuntimeSkillDefinition, "ownerAgentId">, scope?: {
45
+ agentId?: string;
46
+ }): boolean;
27
47
  /** Public API contract for runtime loaded skill response messages. */
28
48
  export type RuntimeLoadedSkillResponseMessages = {
29
49
  allowedToolsNote: string;
@@ -71,6 +91,9 @@ export declare function buildRuntimeSkillDefinition(input: {
71
91
  id: string;
72
92
  content: string;
73
93
  references?: readonly string[];
94
+ ownerAgentId?: string;
95
+ shortName?: string;
96
+ sourcePath?: string;
74
97
  logger?: RuntimeSkillMetadataLogger;
75
98
  }): RuntimeSkillDefinition | null;
76
99
  /** Normalizes runtime skill reference path. */
@@ -1 +1 @@
1
- {"version":3,"file":"skill-metadata.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/skill-metadata.ts"],"names":[],"mappings":"AAmBA,yDAAyD;AACzD,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,QAAQ,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS,CAAC;IACrC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B;AAED,eAAO,MAAM,gCAAgC,iFAuB5C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM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AAM,CAAC,EAAE,0BAA0B,CAAA;CAAO,GACpD,0BAA0B,GAAG,IAAI,CAsBnC;AAED,qCAAqC;AACrC,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,0BAA0B,CAAA;CAAO,GACpD,uBAAuB,GAAG,IAAI,CAEhC;AAED,0CAA0C;AAC1C,wBAAgB,2BAA2B,CAAC,KAAK,EAAE;IACjD,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,0BAA0B,CAAC;CACrC,GAAG,sBAAsB,GAAG,IAAI,CAwBhC;AAED,+CAA+C;AAC/C,wBAAgB,kCAAkC,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAa9E;AAED,uDAAuD;AACvD,wBAAgB,+BAA+B,CAAC,KAAK,EAAE;IACrD,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,kCAAkC,CAAC;IAC7C,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,kBAAkB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,MAAM,CAAC,EAAE,0BAA0B,CAAC;CACrC,GAAG,0BAA0B,CAkD7B"}
@@ -37,6 +37,14 @@ export const getRuntimeSkillFrontmatterSchema = defineSchema((v) => v
37
37
  * @deprecated Use getRuntimeSkillFrontmatterSchema()
38
38
  */
39
39
  export const RuntimeSkillFrontmatterSchema = lazySchema(getRuntimeSkillFrontmatterSchema);
40
+ /**
41
+ * Whether a runtime skill definition is visible to the caller identified by
42
+ * the scope — the same owner-aware rule as the local skill registry: unowned
43
+ * skills plus the caller's own.
44
+ */
45
+ export function isRuntimeSkillVisibleTo(definition, scope) {
46
+ return definition.ownerAgentId === undefined || definition.ownerAgentId === scope?.agentId;
47
+ }
40
48
  function extractDescriptionFromMarkdown(content, fallback) {
41
49
  const lines = content.split("\n");
42
50
  for (const line of lines) {
@@ -99,6 +107,9 @@ export function buildRuntimeSkillDefinition(input) {
99
107
  ...(input.references && input.references.length > 0
100
108
  ? { references: [...input.references] }
101
109
  : {}),
110
+ ...(input.ownerAgentId === undefined ? {} : { ownerAgentId: input.ownerAgentId }),
111
+ ...(input.shortName === undefined ? {} : { shortName: input.shortName }),
112
+ ...(input.sourcePath === undefined ? {} : { sourcePath: input.sourcePath }),
102
113
  };
103
114
  }
104
115
  /** Normalizes runtime skill reference path. */
@@ -27,7 +27,7 @@ export declare function isDynamicTool(name: string): boolean;
27
27
  * Can be a boolean (true to enable from registry) or a Tool instance.
28
28
  */
29
29
  export type ToolConfigEntry = Tool<any, any> | boolean;
30
- export declare function resolveConfiguredTool(toolsConfig: true | Record<string, ToolConfigEntry> | undefined, toolName: string): Tool | null;
30
+ export declare function resolveConfiguredTool(toolsConfig: true | Record<string, ToolConfigEntry> | undefined, toolName: string, context?: ToolExecutionContext): Tool | null;
31
31
  export declare function executeConfiguredTool(toolName: string, input: Record<string, unknown>, toolsConfig: true | Record<string, ToolConfigEntry> | undefined, context?: ToolExecutionContext, allowedRemoteToolNames?: string[], remoteToolSources?: RemoteToolSource[]): Promise<unknown>;
32
32
  /**
33
33
  * Get available tools based on agent configuration.
@@ -44,5 +44,7 @@ export declare function getAvailableTools(toolsConfig: true | Record<string, Too
44
44
  forwardedRemoteToolDefinitions?: ToolDefinition[];
45
45
  remoteToolSources?: RemoteToolSource[];
46
46
  remoteToolContext?: ToolExecutionContext;
47
+ /** Calling agent id for owner-aware tool visibility. */
48
+ callerAgentId?: string;
47
49
  }): Promise<ToolDefinition[]>;
48
50
  //# source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