@faapi/faapi 6.27.0 → 6.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +70 -7
- package/dist/cli/index.js.map +1 -1
- package/dist/{contextTypes-CBE86AO2.d.ts → contextTypes-DhagvRH_.d.ts} +2 -2
- package/dist/index.d.ts +35 -14
- package/dist/index.js +61 -5
- package/dist/index.js.map +1 -1
- package/dist/{routeTypes-DVSnH0jk.d.ts → routeTypes-0rwuIws-.d.ts} +1 -1
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +14 -1
- package/dist/testing.js.map +1 -1
- package/dist/workerEntry.d.ts +1 -1
- package/dist/workerEntry.js +2 -1
- package/dist/workerEntry.js.map +1 -1
- package/package.json +1 -1
package/dist/testing.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FaapiContext } from './contextTypes-
|
|
2
|
-
import { F as FaapiMiddleware, I as InjectorMap, R as RouteManifest, W as WsRouteManifest, C as CorsOptions, H as HelmetOptions } from './routeTypes-
|
|
1
|
+
import { F as FaapiContext } from './contextTypes-DhagvRH_.js';
|
|
2
|
+
import { F as FaapiMiddleware, I as InjectorMap, R as RouteManifest, W as WsRouteManifest, C as CorsOptions, H as HelmetOptions } from './routeTypes-0rwuIws-.js';
|
|
3
3
|
import { Server } from 'node:http';
|
|
4
4
|
import { WebSocket } from 'ws';
|
|
5
5
|
|
package/dist/testing.js
CHANGED
|
@@ -1055,6 +1055,19 @@ function createTaskRegistry() {
|
|
|
1055
1055
|
};
|
|
1056
1056
|
}
|
|
1057
1057
|
|
|
1058
|
+
// src/injection/subAgentToolName.ts
|
|
1059
|
+
var LLM_TOOL_NAME_PATTERN = /^[a-zA-Z0-9_-]+$/;
|
|
1060
|
+
var SUB_AGENT_TOOL_PREFIX = "agent-";
|
|
1061
|
+
function subAgentToolName(agentName) {
|
|
1062
|
+
const toolName = SUB_AGENT_TOOL_PREFIX + agentName;
|
|
1063
|
+
if (!LLM_TOOL_NAME_PATTERN.test(toolName)) {
|
|
1064
|
+
throw new Error(
|
|
1065
|
+
`Sub-agent tool name "${toolName}" (from agent name "${agentName}") violates the LLM tool name pattern ${LLM_TOOL_NAME_PATTERN} \u2014 rename the agent (allowed: a-z A-Z 0-9 '-' '_'; file-based agent directory segments allow a-z A-Z 0-9 '-' only, '_' is the nesting separator)`
|
|
1066
|
+
);
|
|
1067
|
+
}
|
|
1068
|
+
return toolName;
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1058
1071
|
// src/injection/registries.ts
|
|
1059
1072
|
function createToolRegistry() {
|
|
1060
1073
|
let registry = /* @__PURE__ */ new Map();
|
|
@@ -1102,7 +1115,7 @@ function createAgentRegistry(tool) {
|
|
|
1102
1115
|
if (!agent) return void 0;
|
|
1103
1116
|
return {
|
|
1104
1117
|
kind: "agent",
|
|
1105
|
-
name:
|
|
1118
|
+
name: subAgentToolName(agent.name),
|
|
1106
1119
|
agentName: agent.name,
|
|
1107
1120
|
description: agent.description,
|
|
1108
1121
|
metadata: agent
|