veryfront 0.1.759 → 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 (205) 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/deno.d.ts +5 -16
  9. package/esm/deno.js +6 -17
  10. package/esm/src/agent/ag-ui/tool-shared.d.ts.map +1 -1
  11. package/esm/src/agent/ag-ui/tool-shared.js +7 -1
  12. package/esm/src/agent/child-run/invoke-agent-child-runs.d.ts +0 -1
  13. package/esm/src/agent/child-run/invoke-agent-child-runs.d.ts.map +1 -1
  14. package/esm/src/agent/child-run/invoke-agent-child-runs.js +0 -1
  15. package/esm/src/agent/conversation/bootstrap.d.ts +0 -1
  16. package/esm/src/agent/conversation/bootstrap.d.ts.map +1 -1
  17. package/esm/src/agent/conversation/bootstrap.js +0 -1
  18. package/esm/src/agent/conversation/durable.d.ts +0 -1
  19. package/esm/src/agent/conversation/durable.d.ts.map +1 -1
  20. package/esm/src/agent/conversation/durable.js +0 -1
  21. package/esm/src/agent/factory.d.ts.map +1 -1
  22. package/esm/src/agent/factory.js +7 -1
  23. package/esm/src/agent/hosted/chat-preparation.d.ts +1 -1
  24. package/esm/src/agent/hosted/chat-preparation.d.ts.map +1 -1
  25. package/esm/src/agent/hosted/chat-preparation.js +17 -3
  26. package/esm/src/agent/hosted/chat-runtime-contract.d.ts +2 -0
  27. package/esm/src/agent/hosted/chat-runtime-contract.d.ts.map +1 -1
  28. package/esm/src/agent/hosted/default-chat-runtime.d.ts +2 -0
  29. package/esm/src/agent/hosted/default-chat-runtime.d.ts.map +1 -1
  30. package/esm/src/agent/hosted/default-chat-runtime.js +1 -0
  31. package/esm/src/agent/hosted/default-project-steering-refresh.js +1 -1
  32. package/esm/src/agent/hosted/project-steering-adapter.d.ts +7 -0
  33. package/esm/src/agent/hosted/project-steering-adapter.d.ts.map +1 -1
  34. package/esm/src/agent/hosted/project-steering-adapter.js +12 -1
  35. package/esm/src/agent/hosted/veryfront-cloud-agent-service.d.ts +4 -0
  36. package/esm/src/agent/hosted/veryfront-cloud-agent-service.d.ts.map +1 -1
  37. package/esm/src/agent/hosted/veryfront-cloud-agent-service.js +14 -12
  38. package/esm/src/agent/index.d.ts +1 -0
  39. package/esm/src/agent/index.d.ts.map +1 -1
  40. package/esm/src/agent/index.js +1 -0
  41. package/esm/src/agent/project/context.d.ts +2 -0
  42. package/esm/src/agent/project/context.d.ts.map +1 -1
  43. package/esm/src/agent/project/context.js +1 -0
  44. package/esm/src/agent/project/steering-mutation.d.ts.map +1 -1
  45. package/esm/src/agent/project/steering-mutation.js +7 -1
  46. package/esm/src/agent/runtime/agent-definition.d.ts +6 -0
  47. package/esm/src/agent/runtime/agent-definition.d.ts.map +1 -1
  48. package/esm/src/agent/runtime/agent-definition.js +46 -0
  49. package/esm/src/agent/runtime/agent-delegation-names.d.ts +5 -0
  50. package/esm/src/agent/runtime/agent-delegation-names.d.ts.map +1 -0
  51. package/esm/src/agent/runtime/agent-delegation-names.js +8 -0
  52. package/esm/src/agent/runtime/agent-delegation.d.ts +32 -0
  53. package/esm/src/agent/runtime/agent-delegation.d.ts.map +1 -0
  54. package/esm/src/agent/runtime/agent-delegation.js +57 -0
  55. package/esm/src/agent/runtime/agent-markdown-adapter.d.ts.map +1 -1
  56. package/esm/src/agent/runtime/agent-markdown-adapter.js +24 -0
  57. package/esm/src/agent/runtime/index.d.ts.map +1 -1
  58. package/esm/src/agent/runtime/index.js +8 -0
  59. package/esm/src/agent/runtime/local-tool.d.ts +6 -0
  60. package/esm/src/agent/runtime/local-tool.d.ts.map +1 -0
  61. package/esm/src/agent/runtime/local-tool.js +15 -0
  62. package/esm/src/agent/runtime/project-skill-catalog.d.ts.map +1 -1
  63. package/esm/src/agent/runtime/project-skill-catalog.js +67 -0
  64. package/esm/src/agent/runtime/project-skill-loader.d.ts +9 -0
  65. package/esm/src/agent/runtime/project-skill-loader.d.ts.map +1 -1
  66. package/esm/src/agent/runtime/project-skill-loader.js +44 -6
  67. package/esm/src/agent/runtime/skill-metadata.d.ts +23 -0
  68. package/esm/src/agent/runtime/skill-metadata.d.ts.map +1 -1
  69. package/esm/src/agent/runtime/skill-metadata.js +11 -0
  70. package/esm/src/agent/runtime/tool-helpers.d.ts +3 -1
  71. package/esm/src/agent/runtime/tool-helpers.d.ts.map +1 -1
  72. package/esm/src/agent/runtime/tool-helpers.js +45 -11
  73. package/esm/src/agent/service/request-auth-cache.d.ts +0 -1
  74. package/esm/src/agent/service/request-auth-cache.d.ts.map +1 -1
  75. package/esm/src/agent/service/request-auth-cache.js +0 -1
  76. package/esm/src/channels/control-plane.d.ts +1 -0
  77. package/esm/src/channels/control-plane.d.ts.map +1 -1
  78. package/esm/src/channels/control-plane.js +4 -2
  79. package/esm/src/chat/ag-ui.d.ts.map +1 -1
  80. package/esm/src/chat/conversation.d.ts.map +1 -1
  81. package/esm/src/chat/final-step-fallback.d.ts.map +1 -1
  82. package/esm/src/chat/protocol.d.ts.map +1 -1
  83. package/esm/src/chat/protocol.js +1 -0
  84. package/esm/src/chat/provider-errors.d.ts.map +1 -1
  85. package/esm/src/chat/provider-errors.js +0 -1
  86. package/esm/src/chat/stream-watchdog.d.ts +0 -1
  87. package/esm/src/chat/stream-watchdog.d.ts.map +1 -1
  88. package/esm/src/chat/stream-watchdog.js +0 -1
  89. package/esm/src/config/environment-config.d.ts +1 -0
  90. package/esm/src/config/environment-config.d.ts.map +1 -1
  91. package/esm/src/config/environment-config.js +4 -0
  92. package/esm/src/discovery/agent-scoped-capabilities.d.ts +54 -0
  93. package/esm/src/discovery/agent-scoped-capabilities.d.ts.map +1 -0
  94. package/esm/src/discovery/agent-scoped-capabilities.js +228 -0
  95. package/esm/src/discovery/discovery-engine.d.ts.map +1 -1
  96. package/esm/src/discovery/discovery-engine.js +19 -15
  97. package/esm/src/discovery/file-discovery.d.ts +10 -0
  98. package/esm/src/discovery/file-discovery.d.ts.map +1 -1
  99. package/esm/src/discovery/file-discovery.js +46 -0
  100. package/esm/src/discovery/handlers/runtime-agent-markdown-handler.d.ts +12 -0
  101. package/esm/src/discovery/handlers/runtime-agent-markdown-handler.d.ts.map +1 -1
  102. package/esm/src/discovery/handlers/runtime-agent-markdown-handler.js +99 -22
  103. package/esm/src/errors/error-registry/agent.d.ts +2 -0
  104. package/esm/src/errors/error-registry/agent.d.ts.map +1 -1
  105. package/esm/src/errors/error-registry/agent.js +8 -0
  106. package/esm/src/errors/error-registry.d.ts +1 -0
  107. package/esm/src/errors/error-registry.d.ts.map +1 -1
  108. package/esm/src/extensions/errors.d.ts +2 -0
  109. package/esm/src/extensions/errors.d.ts.map +1 -1
  110. package/esm/src/extensions/errors.js +8 -0
  111. package/esm/src/extensions/loader.d.ts +9 -6
  112. package/esm/src/extensions/loader.d.ts.map +1 -1
  113. package/esm/src/extensions/loader.js +39 -4
  114. package/esm/src/extensions/orchestrate.d.ts +3 -0
  115. package/esm/src/extensions/orchestrate.d.ts.map +1 -1
  116. package/esm/src/extensions/orchestrate.js +3 -1
  117. package/esm/src/integrations/_data.d.ts.map +1 -1
  118. package/esm/src/integrations/_data.js +31348 -7873
  119. package/esm/src/integrations/_tool_summaries.d.ts.map +1 -1
  120. package/esm/src/integrations/_tool_summaries.js +1737 -11
  121. package/esm/src/integrations/feature-flags.d.ts +1 -1
  122. package/esm/src/integrations/feature-flags.d.ts.map +1 -1
  123. package/esm/src/integrations/feature-flags.js +83 -0
  124. package/esm/src/integrations/schema.d.ts +129 -4
  125. package/esm/src/integrations/schema.d.ts.map +1 -1
  126. package/esm/src/integrations/schema.js +126 -1
  127. package/esm/src/internal-agents/run-stream.d.ts +4 -0
  128. package/esm/src/internal-agents/run-stream.d.ts.map +1 -1
  129. package/esm/src/internal-agents/run-stream.js +18 -5
  130. package/esm/src/mcp/server.d.ts.map +1 -1
  131. package/esm/src/mcp/server.js +5 -0
  132. package/esm/src/platform/adapters/base.d.ts +7 -0
  133. package/esm/src/platform/adapters/base.d.ts.map +1 -1
  134. package/esm/src/platform/adapters/runtime/deno/adapter.d.ts.map +1 -1
  135. package/esm/src/platform/adapters/runtime/deno/adapter.js +7 -2
  136. package/esm/src/registry/project-scoped-registry-manager.d.ts +7 -0
  137. package/esm/src/registry/project-scoped-registry-manager.d.ts.map +1 -1
  138. package/esm/src/registry/project-scoped-registry-manager.js +10 -0
  139. package/esm/src/registry/scoped-registry-facade.d.ts +2 -0
  140. package/esm/src/registry/scoped-registry-facade.d.ts.map +1 -1
  141. package/esm/src/registry/scoped-registry-facade.js +4 -0
  142. package/esm/src/rendering/layouts/utils/component-loader.d.ts +1 -1
  143. package/esm/src/rendering/layouts/utils/component-loader.d.ts.map +1 -1
  144. package/esm/src/rendering/layouts/utils/component-loader.js +82 -3
  145. package/esm/src/rendering/orchestrator/css-cache.d.ts +3 -0
  146. package/esm/src/rendering/orchestrator/css-cache.d.ts.map +1 -1
  147. package/esm/src/rendering/orchestrator/css-cache.js +16 -8
  148. package/esm/src/rendering/orchestrator/mdx.d.ts.map +1 -1
  149. package/esm/src/rendering/orchestrator/mdx.js +12 -1
  150. package/esm/src/server/bootstrap.d.ts.map +1 -1
  151. package/esm/src/server/bootstrap.js +3 -0
  152. package/esm/src/server/handlers/dev/dashboard/api.js +6 -3
  153. package/esm/src/server/handlers/request/agent-stream.handler.d.ts.map +1 -1
  154. package/esm/src/server/handlers/request/agent-stream.handler.js +10 -0
  155. package/esm/src/server/handlers/request/channel-invoke.handler.d.ts.map +1 -1
  156. package/esm/src/server/handlers/request/channel-invoke.handler.js +8 -0
  157. package/esm/src/server/handlers/request/runtime-shutdown-response.d.ts +13 -0
  158. package/esm/src/server/handlers/request/runtime-shutdown-response.d.ts.map +1 -0
  159. package/esm/src/server/handlers/request/runtime-shutdown-response.js +16 -0
  160. package/esm/src/server/production-server.d.ts.map +1 -1
  161. package/esm/src/server/production-server.js +7 -1
  162. package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.d.ts.map +1 -1
  163. package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.js +2 -2
  164. package/esm/src/server/shutdown-state.d.ts +16 -0
  165. package/esm/src/server/shutdown-state.d.ts.map +1 -0
  166. package/esm/src/server/shutdown-state.js +22 -0
  167. package/esm/src/skill/index.d.ts +1 -1
  168. package/esm/src/skill/index.d.ts.map +1 -1
  169. package/esm/src/skill/index.js +1 -1
  170. package/esm/src/skill/registry.d.ts +29 -3
  171. package/esm/src/skill/registry.d.ts.map +1 -1
  172. package/esm/src/skill/registry.js +57 -8
  173. package/esm/src/skill/tools.d.ts.map +1 -1
  174. package/esm/src/skill/tools.js +27 -25
  175. package/esm/src/skill/types.d.ts +8 -0
  176. package/esm/src/skill/types.d.ts.map +1 -1
  177. package/esm/src/tool/executor.d.ts +7 -1
  178. package/esm/src/tool/executor.d.ts.map +1 -1
  179. package/esm/src/tool/executor.js +12 -1
  180. package/esm/src/tool/index.d.ts +1 -1
  181. package/esm/src/tool/index.d.ts.map +1 -1
  182. package/esm/src/tool/index.js +1 -1
  183. package/esm/src/tool/registry.d.ts +1 -0
  184. package/esm/src/tool/registry.d.ts.map +1 -1
  185. package/esm/src/tool/registry.js +25 -0
  186. package/esm/src/tool/types.d.ts +9 -0
  187. package/esm/src/tool/types.d.ts.map +1 -1
  188. package/esm/src/utils/constants/cache.d.ts +8 -0
  189. package/esm/src/utils/constants/cache.d.ts.map +1 -1
  190. package/esm/src/utils/constants/cache.js +8 -0
  191. package/esm/src/utils/constants/index.d.ts +1 -1
  192. package/esm/src/utils/constants/index.d.ts.map +1 -1
  193. package/esm/src/utils/constants/index.js +1 -1
  194. package/esm/src/utils/index.d.ts +1 -1
  195. package/esm/src/utils/index.d.ts.map +1 -1
  196. package/esm/src/utils/index.js +1 -1
  197. package/esm/src/utils/lru-wrapper.d.ts +2 -0
  198. package/esm/src/utils/lru-wrapper.d.ts.map +1 -1
  199. package/esm/src/utils/lru-wrapper.js +1 -0
  200. package/esm/src/utils/version-constant.d.ts +1 -1
  201. package/esm/src/utils/version-constant.js +1 -1
  202. package/package.json +1 -45
  203. package/esm/src/chat/compat.d.ts +0 -782
  204. package/esm/src/chat/compat.d.ts.map +0 -1
  205. package/esm/src/chat/compat.js +0 -113
@@ -1 +1 @@
1
- {"version":3,"file":"steering-mutation.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/project/steering-mutation.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,eAAO,MAAM,8BAA8B;;;CAGjC,CAAC;AAEX,8DAA8D;AAC9D,eAAO,MAAM,yCAAyC,qEAK5C,CAAC;AAEX,sDAAsD;AACtD,MAAM,MAAM,oBAAoB,GAAG;IACjC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3B,CAAC;AAEF,mDAAmD;AACnD,MAAM,MAAM,4BAA4B,GAAG;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,aAAa,CAAC,EAAE,oBAAoB,CAAC;CACtC,CAAC;AAEF,sDAAsD;AACtD,MAAM,MAAM,6BAA6B,GAAG;IAC1C,mBAAmB,EAAE,OAAO,CAAC;IAC7B,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AAgDF,wCAAwC;AACxC,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,4BAA4B,GAClC,6BAA6B,CA8B/B;AAMD,oEAAoE;AACpE,wBAAgB,yCAAyC,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAWlF"}
1
+ {"version":3,"file":"steering-mutation.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/project/steering-mutation.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,eAAO,MAAM,8BAA8B;;;CAGjC,CAAC;AAEX,8DAA8D;AAC9D,eAAO,MAAM,yCAAyC,qEAK5C,CAAC;AAEX,sDAAsD;AACtD,MAAM,MAAM,oBAAoB,GAAG;IACjC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3B,CAAC;AAEF,mDAAmD;AACnD,MAAM,MAAM,4BAA4B,GAAG;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,aAAa,CAAC,EAAE,oBAAoB,CAAC;CACtC,CAAC;AAEF,sDAAsD;AACtD,MAAM,MAAM,6BAA6B,GAAG;IAC1C,mBAAmB,EAAE,OAAO,CAAC;IAC7B,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AAyDF,wCAAwC;AACxC,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,4BAA4B,GAClC,6BAA6B,CA8B/B;AAMD,oEAAoE;AACpE,wBAAgB,yCAAyC,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAWlF"}
@@ -17,9 +17,15 @@ const NO_MUTATION = {
17
17
  function getPathMutationFlags(path, steeringPaths) {
18
18
  return {
19
19
  instructionsChanged: steeringPaths.instructions.includes(path),
20
- skillsChanged: steeringPaths.skills.some((prefix) => path === prefix || path.startsWith(`${prefix}/`)),
20
+ skillsChanged: isProjectSkillMutationPath(path, steeringPaths),
21
21
  };
22
22
  }
23
+ function isProjectSkillMutationPath(path, steeringPaths) {
24
+ if (steeringPaths.skills.some((prefix) => path === prefix || path.startsWith(`${prefix}/`))) {
25
+ return true;
26
+ }
27
+ return /^agents\/[^/]+\/(?:SKILL\.md|references\/|skills\/[^/]+\/)/.test(path);
28
+ }
23
29
  function mergeMutationFlags(flags) {
24
30
  return {
25
31
  instructionsChanged: flags.some((flag) => flag.instructionsChanged),
@@ -29,6 +29,9 @@ export declare const getRuntimeAgentMarkdownDefinitionSchema: () => import("../.
29
29
  temperature: import("../../internal-agents/schema.js").Schema<number | undefined>;
30
30
  maxSteps: import("../../internal-agents/schema.js").Schema<number | undefined>;
31
31
  providerTools: import("../../internal-agents/schema.js").Schema<string[] | undefined>;
32
+ skills: import("../../internal-agents/schema.js").Schema<true | string[] | undefined>;
33
+ tools: import("../../internal-agents/schema.js").Schema<true | string[] | undefined>;
34
+ delegates: import("../../internal-agents/schema.js").Schema<string[] | undefined>;
32
35
  }>>;
33
36
  /** Default value for runtime agent context marker. */
34
37
  export declare const DEFAULT_RUNTIME_AGENT_CONTEXT_MARKER = "<!-- veryfront-runtime-context -->";
@@ -48,6 +51,9 @@ export declare const runtimeAgentMarkdownDefinitionSchema: import("../../interna
48
51
  temperature: import("../../internal-agents/schema.js").Schema<number | undefined>;
49
52
  maxSteps: import("../../internal-agents/schema.js").Schema<number | undefined>;
50
53
  providerTools: import("../../internal-agents/schema.js").Schema<string[] | undefined>;
54
+ skills: import("../../internal-agents/schema.js").Schema<true | string[] | undefined>;
55
+ tools: import("../../internal-agents/schema.js").Schema<true | string[] | undefined>;
56
+ delegates: import("../../internal-agents/schema.js").Schema<string[] | undefined>;
51
57
  }>>;
52
58
  /** Definition for runtime agent markdown. */
53
59
  export type RuntimeAgentMarkdownDefinition = InferSchema<ReturnType<typeof getRuntimeAgentMarkdownDefinitionSchema>>;
@@ -1 +1 @@
1
- {"version":3,"file":"agent-definition.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/agent-definition.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MA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M,CAAC,EAAE,SAAS,sBAAsB,EAAE,CAAC;IAC3C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AA+DF,mDAAmD;AACnD,wBAAgB,mCAAmC,CACjD,KAAK,EAAE,wCAAwC,GAC9C,8BAA8B,CA6BhC;AAkBD,4CAA4C;AAC5C,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,qCAAqC,GAC3C,iBAAiB,EAAE,CA2CrB"}
@@ -2,6 +2,7 @@ import { extract } from "../../platform/compat/std/front-matter-yaml.js";
2
2
  import { defineSchema, lazySchema } from "../../schemas/index.js";
3
3
  import { createRuntimePromptBlock } from "./prompt-block.js";
4
4
  import { buildRuntimeAvailableSkillsPromptBlock } from "./skill-prompt.js";
5
+ import { AGENT_DELEGATE_TOOL_PREFIX, isProviderSafeDelegateId } from "./agent-delegation-names.js";
5
6
  /** Zod schema for get runtime agent thinking config. */
6
7
  export const getRuntimeAgentThinkingConfigSchema = defineSchema((v) => v.object({
7
8
  enabled: v.boolean(),
@@ -22,6 +23,9 @@ export const getRuntimeAgentMarkdownDefinitionSchema = defineSchema((v) => v.obj
22
23
  temperature: v.number().min(0).max(2).optional(),
23
24
  maxSteps: v.number().optional(),
24
25
  providerTools: v.array(v.string().min(1)).optional(),
26
+ skills: v.union([v.literal(true), v.array(v.string().min(1))]).optional(),
27
+ tools: v.union([v.literal(true), v.array(v.string().min(1))]).optional(),
28
+ delegates: v.array(v.string().min(1)).optional(),
25
29
  }));
26
30
  /** Default value for runtime agent context marker. */
27
31
  export const DEFAULT_RUNTIME_AGENT_CONTEXT_MARKER = "<!-- veryfront-runtime-context -->";
@@ -56,6 +60,41 @@ function parseProviderTools(value) {
56
60
  }
57
61
  return value;
58
62
  }
63
+ function parseCapabilitySelector(value) {
64
+ if (value === true) {
65
+ return true;
66
+ }
67
+ if (Array.isArray(value)) {
68
+ const ids = value
69
+ .filter((entry) => typeof entry === "string" && entry.trim().length > 0)
70
+ .map((entry) => entry.trim());
71
+ return ids.length > 0 ? ids : undefined;
72
+ }
73
+ return undefined;
74
+ }
75
+ function parseDelegates(value) {
76
+ if (!Array.isArray(value)) {
77
+ return undefined;
78
+ }
79
+ const ids = value
80
+ .filter((entry) => typeof entry === "string" && entry.trim().length > 0)
81
+ .map((entry) => entry.trim());
82
+ return ids.length > 0 ? ids : undefined;
83
+ }
84
+ function validateDelegates(agentId, delegates) {
85
+ if (!delegates) {
86
+ return;
87
+ }
88
+ for (const delegateId of delegates) {
89
+ if (delegateId === agentId) {
90
+ throw new Error(`Agent "${agentId}" cannot delegate to itself.`);
91
+ }
92
+ if (!isProviderSafeDelegateId(delegateId)) {
93
+ throw new Error(`Delegate id "${delegateId}" for agent "${agentId}" produces an invalid tool name ` +
94
+ `"${AGENT_DELEGATE_TOOL_PREFIX}${delegateId}" (must match [A-Za-z0-9_-], max 64 chars).`);
95
+ }
96
+ }
97
+ }
59
98
  /** Definition for parse runtime agent markdown. */
60
99
  export function parseRuntimeAgentMarkdownDefinition(input) {
61
100
  const parsedInput = getParseRuntimeAgentMarkdownDefinitionInputSchema().parse(input);
@@ -67,6 +106,10 @@ export function parseRuntimeAgentMarkdownDefinition(input) {
67
106
  const temperature = typeof attrs.temperature === "number" ? attrs.temperature : undefined;
68
107
  const maxSteps = typeof attrs["max-steps"] === "number" ? attrs["max-steps"] : undefined;
69
108
  const providerTools = parseProviderTools(attrs["provider-tools"]);
109
+ const skills = parseCapabilitySelector(attrs.skills);
110
+ const tools = parseCapabilitySelector(attrs.tools);
111
+ const delegates = parseDelegates(attrs.delegates);
112
+ validateDelegates(parsedInput.id, delegates);
70
113
  return getRuntimeAgentMarkdownDefinitionSchema().parse({
71
114
  id: parsedInput.id,
72
115
  name,
@@ -77,6 +120,9 @@ export function parseRuntimeAgentMarkdownDefinition(input) {
77
120
  ...(temperature === undefined ? {} : { temperature }),
78
121
  ...(maxSteps === undefined ? {} : { maxSteps }),
79
122
  ...(providerTools ? { providerTools } : {}),
123
+ ...(skills === undefined ? {} : { skills }),
124
+ ...(tools === undefined ? {} : { tools }),
125
+ ...(delegates === undefined ? {} : { delegates }),
80
126
  });
81
127
  }
82
128
  function splitRuntimeAgentInstructions(input) {
@@ -0,0 +1,5 @@
1
+ /** Prefix used for the delegate tool exposed to the coordinator agent. */
2
+ export declare const AGENT_DELEGATE_TOOL_PREFIX = "agent_";
3
+ /** Whether a delegate id produces a provider-safe `agent_{id}` tool name. */
4
+ export declare function isProviderSafeDelegateId(delegateId: string): boolean;
5
+ //# sourceMappingURL=agent-delegation-names.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-delegation-names.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/agent-delegation-names.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,eAAO,MAAM,0BAA0B,WAAW,CAAC;AAKnD,6EAA6E;AAC7E,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAEpE"}
@@ -0,0 +1,8 @@
1
+ /** Prefix used for the delegate tool exposed to the coordinator agent. */
2
+ export const AGENT_DELEGATE_TOOL_PREFIX = "agent_";
3
+ /** Provider tool-call names allow only this charset, max 64 chars. */
4
+ const PROVIDER_TOOL_NAME_REGEX = /^[A-Za-z0-9_-]{1,64}$/;
5
+ /** Whether a delegate id produces a provider-safe `agent_{id}` tool name. */
6
+ export function isProviderSafeDelegateId(delegateId) {
7
+ return PROVIDER_TOOL_NAME_REGEX.test(`${AGENT_DELEGATE_TOOL_PREFIX}${delegateId}`);
8
+ }
@@ -0,0 +1,32 @@
1
+ import type { Tool } from "../../tool/types.js";
2
+ import type { Agent } from "../types.js";
3
+ import { AGENT_DELEGATE_TOOL_PREFIX, isProviderSafeDelegateId } from "./agent-delegation-names.js";
4
+ export { AGENT_DELEGATE_TOOL_PREFIX, isProviderSafeDelegateId };
5
+ /** Resolves a registered agent by id (defaults to the global registry). */
6
+ export type DelegateAgentResolver = (id: string) => Agent | undefined;
7
+ /** Input payload for build agent delegate tools. */
8
+ export type BuildAgentDelegateToolsInput = {
9
+ /** Specialist agent ids this coordinator is allowed to delegate to. */
10
+ delegates: readonly string[];
11
+ /** Id of the delegating agent, excluded to prevent self-delegation. */
12
+ selfId?: string;
13
+ /** Override the agent resolver (testing / custom registries). */
14
+ resolveAgent?: DelegateAgentResolver;
15
+ };
16
+ /**
17
+ * Builds the opt-in delegate tools for a coordinator agent.
18
+ *
19
+ * Each entry in `delegates` becomes an `agent_{id}` tool that runs the named
20
+ * specialist agent. Agents are resolved lazily at execution time so discovery
21
+ * order does not matter. Self-delegation, duplicates, and ids that would
22
+ * produce a provider-unsafe tool name are skipped defensively here; markdown
23
+ * parsing rejects the latter two cases up front with an explicit diagnostic.
24
+ * Returns an empty map when `delegates` is empty — i.e. an agent with no
25
+ * `delegates` runs with no orchestration.
26
+ *
27
+ * Delegation chains are intentionally not cycle-detected here. Each delegated
28
+ * call is a separate agent run with its own maxSteps budget; keep delegate
29
+ * graphs acyclic until a runtime chain-depth cap exists.
30
+ */
31
+ export declare function buildAgentDelegateTools(input: BuildAgentDelegateToolsInput): Record<string, Tool>;
32
+ //# sourceMappingURL=agent-delegation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-delegation.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/agent-delegation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAGnG,OAAO,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,CAAC;AAEhE,2EAA2E;AAC3E,MAAM,MAAM,qBAAqB,GAAG,CAAC,EAAE,EAAE,MAAM,KAAK,KAAK,GAAG,SAAS,CAAC;AAEtE,oDAAoD;AACpD,MAAM,MAAM,4BAA4B,GAAG;IACzC,uEAAuE;IACvE,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iEAAiE;IACjE,YAAY,CAAC,EAAE,qBAAqB,CAAC;CACtC,CAAC;AA2BF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,4BAA4B,GAClC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAkBtB"}
@@ -0,0 +1,57 @@
1
+ import { agentAsTool, getAgent } from "../composition/index.js";
2
+ import { getAgentToolInputSchema } from "../schemas/index.js";
3
+ import { AGENT_DELEGATE_TOOL_PREFIX, isProviderSafeDelegateId } from "./agent-delegation-names.js";
4
+ import { markRuntimeLocalTool } from "./local-tool.js";
5
+ export { AGENT_DELEGATE_TOOL_PREFIX, isProviderSafeDelegateId };
6
+ function createLazyDelegateTool(delegateId, resolveAgent) {
7
+ return markRuntimeLocalTool({
8
+ id: `${AGENT_DELEGATE_TOOL_PREFIX}${delegateId}`,
9
+ type: "function",
10
+ description: `Delegate a self-contained subtask to the "${delegateId}" specialist agent, ` +
11
+ `which runs with its own settings and skills. Provide a complete, standalone instruction.`,
12
+ inputSchema: getAgentToolInputSchema(),
13
+ execute(input, context) {
14
+ const target = resolveAgent(delegateId);
15
+ if (!target) {
16
+ return Promise.resolve({
17
+ text: `Delegate agent "${delegateId}" is not available.`,
18
+ toolCalls: 0,
19
+ status: "error",
20
+ });
21
+ }
22
+ return agentAsTool(target, `Delegate to ${delegateId}`).execute(input, context);
23
+ },
24
+ });
25
+ }
26
+ /**
27
+ * Builds the opt-in delegate tools for a coordinator agent.
28
+ *
29
+ * Each entry in `delegates` becomes an `agent_{id}` tool that runs the named
30
+ * specialist agent. Agents are resolved lazily at execution time so discovery
31
+ * order does not matter. Self-delegation, duplicates, and ids that would
32
+ * produce a provider-unsafe tool name are skipped defensively here; markdown
33
+ * parsing rejects the latter two cases up front with an explicit diagnostic.
34
+ * Returns an empty map when `delegates` is empty — i.e. an agent with no
35
+ * `delegates` runs with no orchestration.
36
+ *
37
+ * Delegation chains are intentionally not cycle-detected here. Each delegated
38
+ * call is a separate agent run with its own maxSteps budget; keep delegate
39
+ * graphs acyclic until a runtime chain-depth cap exists.
40
+ */
41
+ export function buildAgentDelegateTools(input) {
42
+ const resolveAgent = input.resolveAgent ?? getAgent;
43
+ const tools = {};
44
+ const seen = new Set();
45
+ for (const delegateId of input.delegates) {
46
+ const id = delegateId.trim();
47
+ if (id.length === 0 || id === input.selfId || seen.has(id)) {
48
+ continue;
49
+ }
50
+ if (!isProviderSafeDelegateId(id)) {
51
+ continue;
52
+ }
53
+ seen.add(id);
54
+ tools[`${AGENT_DELEGATE_TOOL_PREFIX}${id}`] = createLazyDelegateTool(id, resolveAgent);
55
+ }
56
+ return tools;
57
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"agent-markdown-adapter.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/agent-markdown-adapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAI5E,yDAAyD;AACzD,wBAAgB,wCAAwC,CACtD,UAAU,EAAE,8BAA8B,GACzC,KAAK,CAcP;AAED,iDAAiD;AACjD,wBAAgB,iCAAiC,CAC/C,YAAY,EAAE,KAAK,GAClB,8BAA8B,GAAG,IAAI,CAEvC;AAED,iEAAiE;AACjE,wBAAgB,2BAA2B,CAAC,YAAY,EAAE,KAAK,GAAG,OAAO,CAExE"}
1
+ {"version":3,"file":"agent-markdown-adapter.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/agent-markdown-adapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAK5E,yDAAyD;AACzD,wBAAgB,wCAAwC,CACtD,UAAU,EAAE,8BAA8B,GACzC,KAAK,CAuCP;AAED,iDAAiD;AACjD,wBAAgB,iCAAiC,CAC/C,YAAY,EAAE,KAAK,GAClB,8BAA8B,GAAG,IAAI,CAEvC;AAED,iEAAiE;AACjE,wBAAgB,2BAA2B,CAAC,YAAY,EAAE,KAAK,GAAG,OAAO,CAExE"}
@@ -1,7 +1,26 @@
1
1
  import { agent } from "../factory.js";
2
+ import { buildAgentDelegateTools } from "./agent-delegation.js";
2
3
  const markdownDefinitionByAgent = new WeakMap();
3
4
  /** Definition for create runtime agent from markdown. */
4
5
  export function createRuntimeAgentFromMarkdownDefinition(definition) {
6
+ const delegateTools = definition.delegates && definition.delegates.length > 0
7
+ ? buildAgentDelegateTools({ delegates: definition.delegates, selfId: definition.id })
8
+ : undefined;
9
+ // `tools:` is a binding selector resolved at invocation time by the
10
+ // owner-aware resolver: `true` binds all visible tools; a list binds each
11
+ // entry (own short name first, then exact global id). Delegate tools merge
12
+ // on top; on key collision the delegate tool wins (keys never overlap in
13
+ // practice: selectors use tool ids, delegates use `agent_{id}`).
14
+ const selectedTools = definition.tools === true
15
+ ? true
16
+ : definition.tools
17
+ ? Object.fromEntries(definition.tools.map((name) => [name, true]))
18
+ : undefined;
19
+ const mergedTools = selectedTools === true
20
+ ? true
21
+ : selectedTools || delegateTools
22
+ ? { ...(selectedTools ?? {}), ...(delegateTools ?? {}) }
23
+ : undefined;
5
24
  const runtimeAgent = agent({
6
25
  id: definition.id,
7
26
  name: definition.name,
@@ -11,6 +30,11 @@ export function createRuntimeAgentFromMarkdownDefinition(definition) {
11
30
  ...(definition.temperature === undefined ? {} : { temperature: definition.temperature }),
12
31
  ...(definition.maxSteps === undefined ? {} : { maxSteps: definition.maxSteps }),
13
32
  ...(definition.providerTools ? { providerTools: definition.providerTools } : {}),
33
+ ...(definition.skills === undefined ? {} : { skills: definition.skills }),
34
+ ...(mergedTools !== undefined &&
35
+ (mergedTools === true || Object.keys(mergedTools).length > 0)
36
+ ? { tools: mergedTools }
37
+ : {}),
14
38
  });
15
39
  markdownDefinitionByAgent.set(runtimeAgent, definition);
16
40
  return runtimeAgent;
@@ -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,EAAqB,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAgDpE,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,uBAAuB,EACvB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,8BAA8B,EAC9B,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,EACb,aAAa,GACd,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EACL,sBAAsB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,mBAAmB,EACxB,0BAA0B,EAC1B,iCAAiC,EACjC,6BAA6B,GAC9B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC5E,YAAY,EACV,mBAAmB,EACnB,eAAe,EACf,iBAAiB,GAClB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OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,aAAa,CAAC,EAAE,MAAM,EACtB,uBAAuB,CAAC,EAAE,MAAM,GAC/B,OAAO,CAAC,aAAa,CAAC;IAoDzB;;;OAGG;IACG,MAAM,CACV,QAAQ,EAAE,OAAO,EAAE,EACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,SAAS,CAAC,EAAE;QACV,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;QAC1C,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;QAClC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;KAC9C,EACD,aAAa,CAAC,EAAE,MAAM,EACtB,uBAAuB,CAAC,EAAE,MAAM,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"}
@@ -321,6 +321,7 @@ export class AgentRuntime {
321
321
  currentRuntimeContext = runtimeState.context;
322
322
  const toolContext = { ...toolContextBase, ...currentRuntimeContext };
323
323
  let tools = isLocal ? [] : await getAvailableTools(this.config.tools, {
324
+ callerAgentId: this.id,
324
325
  includeSkillTools: Boolean(this.config.skills),
325
326
  allowedRemoteToolNames,
326
327
  forwardedRemoteToolDefinitions,
@@ -457,6 +458,9 @@ export class AgentRuntime {
457
458
  toolCallId: tc.toolCallId,
458
459
  ...toolContext,
459
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,
460
464
  };
461
465
  const result = await executeConfiguredTool(tc.toolName, toolCall.args, this.config.tools, executionContext, allowedRemoteToolNames, remoteToolSources);
462
466
  await this.notifyToolResult({
@@ -544,6 +548,7 @@ export class AgentRuntime {
544
548
  currentRuntimeContext = runtimeState.context;
545
549
  const toolContext = { ...toolContextBase, ...currentRuntimeContext };
546
550
  let tools = isLocalStreaming ? [] : await getAvailableTools(this.config.tools, {
551
+ callerAgentId: this.id,
547
552
  includeSkillTools: Boolean(this.config.skills),
548
553
  allowedRemoteToolNames,
549
554
  forwardedRemoteToolDefinitions,
@@ -755,6 +760,9 @@ export class AgentRuntime {
755
760
  const executionContext = {
756
761
  toolCallId: tc.id,
757
762
  ...toolContext,
763
+ // Caller identity for capability scoping. Stamped after the
764
+ // spread so caller-supplied context cannot spoof it.
765
+ agentId: this.id,
758
766
  };
759
767
  const result = await executeConfiguredTool(tc.name, toolCall.args, this.config.tools, executionContext, allowedRemoteToolNames, remoteToolSources);
760
768
  throwIfAborted(abortSignal);
@@ -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,CAAC;AAE7B,+DAA+D;AAC/D,MAAM,MAAM,4BAA4B,GAAG;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CAAC;AAEF,yDAAyD;AACzD,MAAM,MAAM,iCAAiC,GAAG;IAC9C,cAAc,EAAE,CAAC,OAAO,EAAE,4BAA4B,KAAK,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;IAC9F,eAAe,EAAE,CACf,OAAO,EAAE,6BAA6B,KACnC,OAAO,CAAC,SAAS,0BAA0B,EAAE,GAAG,IAAI,CAAC,CAAC;IAC3D,aAAa,EAAE,SAAS,sBAAsB,EAAE,CAAC;IACjD,aAAa,CAAC,EAAE,IAAI,CAAC,oBAAoB,EAAE,QAAQ,CAAC,CAAC;IACrD,MAAM,CAAC,EAAE,0BAA0B,CAAC;CACrC,CAAC;AAEF,wDAAwD;AACxD,MAAM,MAAM,iCAAiC,GAAG;IAC9C,cAAc,EAAE,CAAC,OAAO,EAAE,4BAA4B,KAAK,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;IAC9F,aAAa,CAAC,EAAE,IAAI,CAAC,oBAAoB,EAAE,cAAc,CAAC,CAAC;CAC5D,CAAC;AAcF,2CAA2C;AAC3C,wBAAgB,8BAA8B,CAAC,KAAK,EAAE;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB,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,CAgFnC"}
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,2BA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AAE,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,0BAA0B,EAAE,CAAC,CAAC;IAC3C,aAAa,CAAC,EAAE,IAAI,CAAC,oBAAoB,EAAE,QAAQ,CAAC,CAAC;IACrD,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;IAClD,MAAM,CAAC,EAAE,+BAA+B,CAAC;CAC1C,CAAC;AAEF,4DAA4D;AAC5D,MAAM,MAAM,yBAAyB,GAAG;IACtC,0BAA0B,EAAE,CAC1B,OAAO,EAAE,0BAA0B,EACnC,OAAO,EAAE,MAAM,KACZ,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACvB,gBAAgB,EAAE,CAChB,OAAO,EAAE,0BAA0B,EACnC,OAAO,EAAE,MAAM,KACZ,OAAO,CAAC,yBAAyB,GAAG,IAAI,CAAC,CAAC;IAC/C,yBAAyB,EAAE,CACzB,OAAO,EAAE,0BAA0B,EACnC,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,MAAM,KACnB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAC7B,CAAC;AAuNF,2CAA2C;AAC3C,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,gCAAgC,GACxC,yBAAyB,CAQ3B"}
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;IACzB;;;;;;;OAOG;IACH,gBAAgB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACrD,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,0BAA0B,EAAE,CAAC,CAAC;IAC3C,aAAa,CAAC,EAAE,IAAI,CAAC,oBAAoB,EAAE,QAAQ,CAAC,CAAC;IACrD,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;IAClD,MAAM,CAAC,EAAE,+BAA+B,CAAC;CAC1C,CAAC;AAEF,4DAA4D;AAC5D,MAAM,MAAM,yBAAyB,GAAG;IACtC,0BAA0B,EAAE,CAC1B,OAAO,EAAE,0BAA0B,EACnC,OAAO,EAAE,MAAM,KACZ,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACvB,gBAAgB,EAAE,CAChB,OAAO,EAAE,0BAA0B,EACnC,OAAO,EAAE,MAAM,KACZ,OAAO,CAAC,yBAAyB,GAAG,IAAI,CAAC,CAAC;IAC/C,yBAAyB,EAAE,CACzB,OAAO,EAAE,0BAA0B,EACnC,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,MAAM,KACnB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;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. */