plugin-agent-orchestrator 1.0.38 → 1.1.2

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 (192) hide show
  1. package/dist/client/index.js +1 -1
  2. package/dist/client-v2/253.9f0537713cee9e6c.js +10 -0
  3. package/dist/client-v2/418.ce8f5b2b8a229d1d.js +10 -0
  4. package/dist/client-v2/53.7c29c28043e9112d.js +10 -0
  5. package/dist/client-v2/794.9bbb8d3a61b2bdf2.js +10 -0
  6. package/dist/client-v2/993.82778b6fd6db3cb1.js +10 -0
  7. package/dist/client-v2/index.js +1 -1
  8. package/dist/externalVersion.js +6 -6
  9. package/dist/locale/en-US.json +56 -2
  10. package/dist/locale/vi-VN.json +56 -2
  11. package/dist/locale/zh-CN.json +56 -2
  12. package/dist/node_modules/ajv/.tonic_example.js +20 -0
  13. package/dist/node_modules/ajv/LICENSE +22 -0
  14. package/dist/node_modules/ajv/dist/ajv.bundle.js +7189 -0
  15. package/dist/node_modules/ajv/dist/ajv.min.js +3 -0
  16. package/dist/node_modules/ajv/lib/ajv.d.ts +397 -0
  17. package/dist/node_modules/ajv/lib/ajv.js +3 -0
  18. package/dist/node_modules/ajv/lib/cache.js +26 -0
  19. package/dist/node_modules/ajv/lib/compile/async.js +90 -0
  20. package/dist/node_modules/ajv/lib/compile/equal.js +5 -0
  21. package/dist/node_modules/ajv/lib/compile/error_classes.js +34 -0
  22. package/dist/node_modules/ajv/lib/compile/formats.js +142 -0
  23. package/dist/node_modules/ajv/lib/compile/index.js +387 -0
  24. package/dist/node_modules/ajv/lib/compile/resolve.js +270 -0
  25. package/dist/node_modules/ajv/lib/compile/rules.js +66 -0
  26. package/dist/node_modules/ajv/lib/compile/schema_obj.js +9 -0
  27. package/dist/node_modules/ajv/lib/compile/ucs2length.js +20 -0
  28. package/dist/node_modules/ajv/lib/compile/util.js +239 -0
  29. package/dist/node_modules/ajv/lib/data.js +49 -0
  30. package/dist/node_modules/ajv/lib/definition_schema.js +37 -0
  31. package/dist/node_modules/ajv/lib/dot/_limit.jst +113 -0
  32. package/dist/node_modules/ajv/lib/dot/_limitItems.jst +12 -0
  33. package/dist/node_modules/ajv/lib/dot/_limitLength.jst +12 -0
  34. package/dist/node_modules/ajv/lib/dot/_limitProperties.jst +12 -0
  35. package/dist/node_modules/ajv/lib/dot/allOf.jst +32 -0
  36. package/dist/node_modules/ajv/lib/dot/anyOf.jst +46 -0
  37. package/dist/node_modules/ajv/lib/dot/coerce.def +51 -0
  38. package/dist/node_modules/ajv/lib/dot/comment.jst +9 -0
  39. package/dist/node_modules/ajv/lib/dot/const.jst +11 -0
  40. package/dist/node_modules/ajv/lib/dot/contains.jst +55 -0
  41. package/dist/node_modules/ajv/lib/dot/custom.jst +191 -0
  42. package/dist/node_modules/ajv/lib/dot/defaults.def +47 -0
  43. package/dist/node_modules/ajv/lib/dot/definitions.def +203 -0
  44. package/dist/node_modules/ajv/lib/dot/dependencies.jst +79 -0
  45. package/dist/node_modules/ajv/lib/dot/enum.jst +30 -0
  46. package/dist/node_modules/ajv/lib/dot/errors.def +194 -0
  47. package/dist/node_modules/ajv/lib/dot/format.jst +106 -0
  48. package/dist/node_modules/ajv/lib/dot/if.jst +73 -0
  49. package/dist/node_modules/ajv/lib/dot/items.jst +98 -0
  50. package/dist/node_modules/ajv/lib/dot/missing.def +39 -0
  51. package/dist/node_modules/ajv/lib/dot/multipleOf.jst +22 -0
  52. package/dist/node_modules/ajv/lib/dot/not.jst +43 -0
  53. package/dist/node_modules/ajv/lib/dot/oneOf.jst +54 -0
  54. package/dist/node_modules/ajv/lib/dot/pattern.jst +14 -0
  55. package/dist/node_modules/ajv/lib/dot/properties.jst +245 -0
  56. package/dist/node_modules/ajv/lib/dot/propertyNames.jst +52 -0
  57. package/dist/node_modules/ajv/lib/dot/ref.jst +85 -0
  58. package/dist/node_modules/ajv/lib/dot/required.jst +108 -0
  59. package/dist/node_modules/ajv/lib/dot/uniqueItems.jst +62 -0
  60. package/dist/node_modules/ajv/lib/dot/validate.jst +276 -0
  61. package/dist/node_modules/ajv/lib/dotjs/_limit.js +163 -0
  62. package/dist/node_modules/ajv/lib/dotjs/_limitItems.js +80 -0
  63. package/dist/node_modules/ajv/lib/dotjs/_limitLength.js +85 -0
  64. package/dist/node_modules/ajv/lib/dotjs/_limitProperties.js +80 -0
  65. package/dist/node_modules/ajv/lib/dotjs/allOf.js +42 -0
  66. package/dist/node_modules/ajv/lib/dotjs/anyOf.js +73 -0
  67. package/dist/node_modules/ajv/lib/dotjs/comment.js +14 -0
  68. package/dist/node_modules/ajv/lib/dotjs/const.js +56 -0
  69. package/dist/node_modules/ajv/lib/dotjs/contains.js +81 -0
  70. package/dist/node_modules/ajv/lib/dotjs/custom.js +228 -0
  71. package/dist/node_modules/ajv/lib/dotjs/dependencies.js +168 -0
  72. package/dist/node_modules/ajv/lib/dotjs/enum.js +66 -0
  73. package/dist/node_modules/ajv/lib/dotjs/format.js +150 -0
  74. package/dist/node_modules/ajv/lib/dotjs/if.js +103 -0
  75. package/dist/node_modules/ajv/lib/dotjs/index.js +33 -0
  76. package/dist/node_modules/ajv/lib/dotjs/items.js +140 -0
  77. package/dist/node_modules/ajv/lib/dotjs/multipleOf.js +80 -0
  78. package/dist/node_modules/ajv/lib/dotjs/not.js +84 -0
  79. package/dist/node_modules/ajv/lib/dotjs/oneOf.js +73 -0
  80. package/dist/node_modules/ajv/lib/dotjs/pattern.js +75 -0
  81. package/dist/node_modules/ajv/lib/dotjs/properties.js +335 -0
  82. package/dist/node_modules/ajv/lib/dotjs/propertyNames.js +81 -0
  83. package/dist/node_modules/ajv/lib/dotjs/ref.js +124 -0
  84. package/dist/node_modules/ajv/lib/dotjs/required.js +270 -0
  85. package/dist/node_modules/ajv/lib/dotjs/uniqueItems.js +86 -0
  86. package/dist/node_modules/ajv/lib/dotjs/validate.js +482 -0
  87. package/dist/node_modules/ajv/lib/keyword.js +146 -0
  88. package/dist/node_modules/ajv/lib/refs/data.json +17 -0
  89. package/dist/node_modules/ajv/lib/refs/json-schema-draft-04.json +149 -0
  90. package/dist/node_modules/ajv/lib/refs/json-schema-draft-06.json +154 -0
  91. package/dist/node_modules/ajv/lib/refs/json-schema-draft-07.json +168 -0
  92. package/dist/node_modules/ajv/lib/refs/json-schema-secure.json +94 -0
  93. package/dist/node_modules/ajv/node_modules/json-schema-traverse/.eslintrc.yml +27 -0
  94. package/dist/node_modules/ajv/node_modules/json-schema-traverse/.travis.yml +8 -0
  95. package/dist/node_modules/ajv/node_modules/json-schema-traverse/index.js +89 -0
  96. package/dist/node_modules/ajv/node_modules/json-schema-traverse/package.json +43 -0
  97. package/dist/node_modules/ajv/node_modules/json-schema-traverse/spec/.eslintrc.yml +6 -0
  98. package/dist/node_modules/ajv/node_modules/json-schema-traverse/spec/fixtures/schema.js +125 -0
  99. package/dist/node_modules/ajv/node_modules/json-schema-traverse/spec/index.spec.js +171 -0
  100. package/dist/node_modules/ajv/package.json +1 -0
  101. package/dist/node_modules/ajv/scripts/.eslintrc.yml +3 -0
  102. package/dist/node_modules/ajv/scripts/bundle.js +61 -0
  103. package/dist/node_modules/ajv/scripts/compile-dots.js +73 -0
  104. package/dist/node_modules/ajv/scripts/info +10 -0
  105. package/dist/node_modules/ajv/scripts/prepare-tests +12 -0
  106. package/dist/node_modules/ajv/scripts/publish-built-version +32 -0
  107. package/dist/node_modules/ajv/scripts/travis-gh-pages +23 -0
  108. package/dist/server/collections/skill-definitions.js +31 -0
  109. package/dist/server/collections/skill-executions.js +19 -0
  110. package/dist/server/collections/skill-registry-installations.js +70 -0
  111. package/dist/server/migrations/20260621000000-native-policy-profile-defaults.js +0 -3
  112. package/dist/server/migrations/20260727000000-remove-unused-knowledge-scopes.js +51 -0
  113. package/dist/server/migrations/20260727010000-backfill-skill-tool-names.js +66 -0
  114. package/dist/server/plugin.js +107 -2
  115. package/dist/server/resources/agent-knowledge-insights.js +273 -0
  116. package/dist/server/services/AgentExecutionContext.js +45 -0
  117. package/dist/server/services/AgentMemoryContextService.js +57 -19
  118. package/dist/server/services/CodeValidator.js +1 -0
  119. package/dist/server/services/ExecutionSpanService.js +10 -2
  120. package/dist/server/services/InputSchemaValidator.js +83 -0
  121. package/dist/server/services/NativeSubAgentObserver.js +63 -8
  122. package/dist/server/services/SandboxRunner.js +6 -2
  123. package/dist/server/services/SkillAccessService.js +109 -0
  124. package/dist/server/services/SkillManager.js +2 -0
  125. package/dist/server/services/SkillRepositoryService.js +70 -0
  126. package/dist/server/skill-hub/actions/git-import.js +479 -216
  127. package/dist/server/skill-hub/mcp/McpController.js +8 -5
  128. package/dist/server/skill-hub/middlewares/git-import-request-method-policy.js +69 -0
  129. package/dist/server/skill-hub/plugin.js +68 -14
  130. package/dist/server/skill-hub/services/RegistrySkillInstallationService.js +249 -0
  131. package/dist/server/skill-hub/services/RegistrySkillSnapshotService.js +228 -0
  132. package/dist/server/skill-hub/tasks/SkillExecutionTask.js +15 -3
  133. package/dist/server/tools/external-rag-search.js +152 -12
  134. package/dist/server/tools/skill-execute.js +23 -2
  135. package/dist/server/utils/ctx-utils.js +2 -2
  136. package/dist/server/utils/skill-tool-name.js +73 -0
  137. package/package.json +9 -3
  138. package/src/client-v2/components/AgentBindingsTab.tsx +269 -0
  139. package/src/client-v2/components/HarnessProfilesTab.tsx +1 -2
  140. package/src/client-v2/components/KnowledgeAccessTab.tsx +116 -0
  141. package/src/client-v2/components/MemoryInspectorTab.tsx +125 -0
  142. package/src/client-v2/components/RetrievalTraceTab.tsx +162 -0
  143. package/src/client-v2/pages/AgentBindingsPage.tsx +13 -0
  144. package/src/client-v2/pages/KnowledgeAccessPage.tsx +10 -0
  145. package/src/client-v2/pages/MemoryInspectorPage.tsx +13 -0
  146. package/src/client-v2/pages/RetrievalTracePage.tsx +10 -0
  147. package/src/client-v2/plugin.tsx +28 -0
  148. package/src/locale/en-US.json +56 -2
  149. package/src/locale/vi-VN.json +56 -2
  150. package/src/locale/zh-CN.json +56 -2
  151. package/src/server/__tests__/agent-execution-context.test.ts +18 -0
  152. package/src/server/__tests__/agent-knowledge-insights.test.ts +123 -0
  153. package/src/server/__tests__/external-rag-search.test.ts +107 -0
  154. package/src/server/__tests__/input-schema-validator.test.ts +26 -0
  155. package/src/server/__tests__/native-sub-agent-observer.test.ts +141 -9
  156. package/src/server/__tests__/skill-access-service.test.ts +64 -0
  157. package/src/server/__tests__/skill-execute.test.ts +37 -0
  158. package/src/server/__tests__/skill-tool-name.test.ts +23 -0
  159. package/src/server/collections/skill-definitions.ts +31 -0
  160. package/src/server/collections/skill-executions.ts +19 -0
  161. package/src/server/collections/skill-registry-installations.ts +41 -0
  162. package/src/server/migrations/20260621000000-native-policy-profile-defaults.ts +0 -3
  163. package/src/server/migrations/20260727000000-remove-unused-knowledge-scopes.ts +25 -0
  164. package/src/server/migrations/20260727010000-backfill-skill-tool-names.ts +45 -0
  165. package/src/server/plugin.ts +107 -1
  166. package/src/server/resources/agent-knowledge-insights.ts +304 -0
  167. package/src/server/services/AgentExecutionContext.ts +23 -0
  168. package/src/server/services/AgentMemoryContextService.ts +63 -19
  169. package/src/server/services/CodeValidator.ts +1 -0
  170. package/src/server/services/ExecutionSpanService.ts +119 -110
  171. package/src/server/services/InputSchemaValidator.ts +44 -0
  172. package/src/server/services/NativeSubAgentObserver.ts +592 -528
  173. package/src/server/services/SandboxRunner.ts +6 -0
  174. package/src/server/services/SkillAccessService.ts +100 -0
  175. package/src/server/services/SkillManager.ts +2 -0
  176. package/src/server/services/SkillRepositoryService.ts +98 -2
  177. package/src/server/services/__tests__/SkillRepositoryService.test.ts +33 -0
  178. package/src/server/skill-hub/actions/__tests__/git-import.test.ts +501 -0
  179. package/src/server/skill-hub/actions/git-import.ts +682 -236
  180. package/src/server/skill-hub/mcp/McpController.ts +8 -14
  181. package/src/server/skill-hub/middlewares/git-import-request-method-policy.ts +51 -0
  182. package/src/server/skill-hub/plugin.ts +79 -13
  183. package/src/server/skill-hub/services/RegistrySkillInstallationService.ts +281 -0
  184. package/src/server/skill-hub/services/RegistrySkillSnapshotService.ts +239 -0
  185. package/src/server/skill-hub/services/__tests__/RegistrySkillInstallationService.test.ts +295 -0
  186. package/src/server/skill-hub/services/__tests__/RegistrySkillSnapshotService.test.ts +63 -0
  187. package/src/server/skill-hub/tasks/SkillExecutionTask.ts +14 -2
  188. package/src/server/tools/external-rag-search.ts +215 -14
  189. package/src/server/tools/skill-execute.ts +24 -2
  190. package/src/server/utils/ctx-utils.ts +1 -1
  191. package/src/server/utils/skill-tool-name.ts +58 -0
  192. package/dist/client-v2/418.29e713f79131eece.js +0 -10
@@ -1,110 +1,119 @@
1
- import { toPlain } from '../utils/ctx-utils';
2
-
3
- export const ORCHESTRATOR_TRACE_CONTEXT_KEY = '__orchestratorTraceContext';
4
-
5
- export type OrchestratorTraceContext = {
6
- rootRunId: string;
7
- spanId?: string;
8
- parentSpanId?: string;
9
- toolCallId?: string;
10
- leaderUsername?: string;
11
- employeeUsername?: string;
12
- toolName?: string;
13
- agentLoopRunId?: string;
14
- agentLoopStepId?: string;
15
- };
16
-
17
- type SpanValues = {
18
- rootRunId: string;
19
- parentSpanId?: string;
20
- source?: string;
21
- parentSessionId?: string;
22
- subSessionId?: string;
23
- toolCallId?: string;
24
- type: string;
25
- status: string;
26
- leaderUsername?: string;
27
- employeeUsername?: string;
28
- toolName?: string;
29
- title?: string;
30
- input?: any;
31
- output?: string;
32
- error?: string;
33
- durationMs?: number;
34
- startedAt?: Date;
35
- endedAt?: Date;
36
- orchestratorLogId?: string | number;
37
- skillExecutionId?: string | number;
38
- metadata?: any;
39
- userId?: string | number;
40
- };
41
-
42
- export class ExecutionSpanService {
43
- constructor(private readonly plugin: any) {}
44
-
45
- async create(values: SpanValues) {
46
- try {
47
- const repo = this.plugin.db.getRepository('agentExecutionSpans');
48
- if (!repo) return null;
49
-
50
- const record = await repo.create({
51
- values: {
52
- ...values,
53
- startedAt: values.startedAt || new Date(),
54
- createdAt: new Date(),
55
- },
56
- });
57
- return toPlain(record);
58
- } catch (error) {
59
- this.plugin.app.logger?.warn?.('[AgentOrchestrator] Failed to create execution span', error);
60
- return null;
61
- }
62
- }
63
-
64
- async update(spanId: string | number | undefined, values: Record<string, any>) {
65
- if (!spanId) return null;
66
- try {
67
- const repo = this.plugin.db.getRepository('agentExecutionSpans');
68
- if (!repo) return null;
69
- await repo.update({
70
- filterByTk: spanId,
71
- values: {
72
- ...values,
73
- updatedAt: new Date(),
74
- },
75
- });
76
- return { id: spanId };
77
- } catch (error) {
78
- this.plugin.app.logger?.warn?.(`[AgentOrchestrator] Failed to update execution span ${spanId}`, error);
79
- return null;
80
- }
81
- }
82
-
83
- async finish(
84
- spanId: string | number | undefined,
85
- status: 'success' | 'error' | 'canceled' | 'timeout',
86
- startedAt: number,
87
- values: Record<string, any> = {},
88
- ) {
89
- return this.update(spanId, {
90
- ...values,
91
- status,
92
- endedAt: new Date(),
93
- durationMs: Date.now() - startedAt,
94
- });
95
- }
96
- }
97
-
98
- export function getOrchestratorTraceContext(ctx: any): OrchestratorTraceContext | null {
99
- return (
100
- ctx?.[ORCHESTRATOR_TRACE_CONTEXT_KEY] ||
101
- ctx?.state?.orchestratorTraceContext ||
102
- ctx?.runtime?.context?.orchestratorTraceContext ||
103
- null
104
- );
105
- }
106
-
107
- export function setOrchestratorTraceContext(ctx: any, traceContext: OrchestratorTraceContext) {
108
- ctx[ORCHESTRATOR_TRACE_CONTEXT_KEY] = traceContext;
109
- return ctx;
110
- }
1
+ import { toPlain } from '../utils/ctx-utils';
2
+ import { getAgentExecutionContext } from './AgentExecutionContext';
3
+
4
+ export const ORCHESTRATOR_TRACE_CONTEXT_KEY = '__orchestratorTraceContext';
5
+
6
+ export type OrchestratorTraceContext = {
7
+ rootRunId: string;
8
+ spanId?: string;
9
+ parentSpanId?: string;
10
+ toolCallId?: string;
11
+ leaderUsername?: string;
12
+ employeeUsername?: string;
13
+ toolName?: string;
14
+ agentLoopRunId?: string;
15
+ agentLoopStepId?: string;
16
+ sessionId?: string;
17
+ };
18
+
19
+ type SpanValues = {
20
+ rootRunId: string;
21
+ parentSpanId?: string;
22
+ source?: string;
23
+ parentSessionId?: string;
24
+ subSessionId?: string;
25
+ toolCallId?: string;
26
+ type: string;
27
+ status: string;
28
+ leaderUsername?: string;
29
+ employeeUsername?: string;
30
+ toolName?: string;
31
+ title?: string;
32
+ input?: any;
33
+ output?: string;
34
+ error?: string;
35
+ durationMs?: number;
36
+ startedAt?: Date;
37
+ endedAt?: Date;
38
+ orchestratorLogId?: string | number;
39
+ skillExecutionId?: string | number;
40
+ metadata?: any;
41
+ userId?: string | number;
42
+ };
43
+
44
+ export class ExecutionSpanService {
45
+ constructor(private readonly plugin: any) {}
46
+
47
+ async create(values: SpanValues) {
48
+ try {
49
+ const repo = this.plugin.db.getRepository('agentExecutionSpans');
50
+ if (!repo) return null;
51
+
52
+ const record = await repo.create({
53
+ values: {
54
+ ...values,
55
+ startedAt: values.startedAt || new Date(),
56
+ createdAt: new Date(),
57
+ },
58
+ });
59
+ return toPlain(record);
60
+ } catch (error) {
61
+ this.plugin.app.logger?.warn?.('[AgentOrchestrator] Failed to create execution span', error);
62
+ return null;
63
+ }
64
+ }
65
+
66
+ async update(spanId: string | number | undefined, values: Record<string, any>) {
67
+ if (!spanId) return null;
68
+ try {
69
+ const repo = this.plugin.db.getRepository('agentExecutionSpans');
70
+ if (!repo) return null;
71
+ await repo.update({
72
+ filterByTk: spanId,
73
+ values: {
74
+ ...values,
75
+ updatedAt: new Date(),
76
+ },
77
+ });
78
+ return { id: spanId };
79
+ } catch (error) {
80
+ this.plugin.app.logger?.warn?.(`[AgentOrchestrator] Failed to update execution span ${spanId}`, error);
81
+ return null;
82
+ }
83
+ }
84
+
85
+ async finish(
86
+ spanId: string | number | undefined,
87
+ status: 'success' | 'error' | 'canceled' | 'timeout',
88
+ startedAt: number,
89
+ values: Record<string, any> = {},
90
+ ) {
91
+ return this.update(spanId, {
92
+ ...values,
93
+ status,
94
+ endedAt: new Date(),
95
+ durationMs: Date.now() - startedAt,
96
+ });
97
+ }
98
+ }
99
+
100
+ export function getOrchestratorTraceContext(ctx: any): OrchestratorTraceContext | null {
101
+ const requestContext =
102
+ ctx?.[ORCHESTRATOR_TRACE_CONTEXT_KEY] ||
103
+ ctx?.state?.orchestratorTraceContext ||
104
+ ctx?.runtime?.context?.orchestratorTraceContext ||
105
+ null;
106
+ const agentContext = getAgentExecutionContext();
107
+ if (!requestContext && !agentContext) return null;
108
+
109
+ return {
110
+ ...(agentContext || {}),
111
+ ...(requestContext || {}),
112
+ toolCallId: ctx?.runtime?.toolCallId || requestContext?.toolCallId || agentContext?.toolCallId,
113
+ };
114
+ }
115
+
116
+ export function setOrchestratorTraceContext(ctx: any, traceContext: OrchestratorTraceContext) {
117
+ ctx[ORCHESTRATOR_TRACE_CONTEXT_KEY] = traceContext;
118
+ return ctx;
119
+ }
@@ -0,0 +1,44 @@
1
+ import Ajv from 'ajv';
2
+ import { parseJsonText } from '../skill-hub/utils/json-fields';
3
+
4
+ type JsonSchema = Record<string, unknown> | boolean;
5
+
6
+ const ajv = new Ajv({
7
+ allErrors: true,
8
+ jsonPointers: true,
9
+ });
10
+
11
+ function parseSchema(value: unknown): JsonSchema | null {
12
+ if (value === undefined || value === null || value === '') return null;
13
+ const schema = parseJsonText<unknown>(value, undefined);
14
+ if (typeof schema === 'boolean') return schema;
15
+ if (schema && typeof schema === 'object' && !Array.isArray(schema)) {
16
+ return schema as Record<string, unknown>;
17
+ }
18
+ throw new Error('Input Schema must be a valid JSON Schema object.');
19
+ }
20
+
21
+ export function validateInputSchemaDefinition(value: unknown): void {
22
+ const schema = parseSchema(value);
23
+ if (schema === null) return;
24
+ try {
25
+ ajv.compile(schema);
26
+ } catch (error) {
27
+ throw new Error(`Invalid Input Schema: ${error instanceof Error ? error.message : String(error)}`);
28
+ }
29
+ }
30
+
31
+ export function validateSkillInput(schemaValue: unknown, input: unknown): void {
32
+ const schema = parseSchema(schemaValue);
33
+ if (schema === null) return;
34
+
35
+ let validate;
36
+ try {
37
+ validate = ajv.compile(schema);
38
+ } catch (error) {
39
+ throw new Error(`Invalid Input Schema: ${error instanceof Error ? error.message : String(error)}`);
40
+ }
41
+
42
+ if (validate(input)) return;
43
+ throw new Error(`Skill input validation failed: ${ajv.errorsText(validate.errors, { separator: '; ' })}`);
44
+ }