veryfront 0.1.689 → 0.1.690
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/esm/deno.js +1 -1
- package/esm/src/agent/hosted/chat-runtime-tool-assembly.d.ts +3 -1
- package/esm/src/agent/hosted/chat-runtime-tool-assembly.d.ts.map +1 -1
- package/esm/src/agent/hosted/chat-runtime-tool-assembly.js +7 -8
- package/esm/src/agent/hosted/runtime-essential-tools.d.ts +13 -0
- package/esm/src/agent/hosted/runtime-essential-tools.d.ts.map +1 -0
- package/esm/src/agent/hosted/runtime-essential-tools.js +32 -0
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +1 -1
package/esm/deno.js
CHANGED
|
@@ -4,6 +4,7 @@ import { type DefaultResearchArtifactContext } from "../artifacts/default-resear
|
|
|
4
4
|
import { type AgentServiceMcpServerConfig } from "../service/mcp-server-config.js";
|
|
5
5
|
import { type HostedProjectRemoteToolSourceMutationHandler, type HostedProjectRemoteToolSourcePrepareToolInput, type HostedProjectRemoteToolSourceProjectSwitchHandler, type HostedProjectRemoteToolSourceRetryPolicy } from "./project-remote-tool-source.js";
|
|
6
6
|
import { type RuntimeClientProfile } from "../runtime/client-profile.js";
|
|
7
|
+
import { type HostedRuntimeAllowedToolNames } from "./runtime-essential-tools.js";
|
|
7
8
|
/** Context for hosted chat runtime tool assembly. */
|
|
8
9
|
export type HostedChatRuntimeToolAssemblyContext = DefaultResearchArtifactContext & {
|
|
9
10
|
authToken: string;
|
|
@@ -12,10 +13,11 @@ export type HostedChatRuntimeToolAssemblyContext = DefaultResearchArtifactContex
|
|
|
12
13
|
model?: string;
|
|
13
14
|
clientProfile?: RuntimeClientProfile | null;
|
|
14
15
|
availableToolNames?: string[];
|
|
16
|
+
availableSkillIds?: readonly string[];
|
|
15
17
|
userId?: string | null;
|
|
16
18
|
};
|
|
17
19
|
/** Public API contract for hosted chat runtime allowed tool names. */
|
|
18
|
-
export type HostedChatRuntimeAllowedToolNames =
|
|
20
|
+
export type HostedChatRuntimeAllowedToolNames = HostedRuntimeAllowedToolNames;
|
|
19
21
|
/** Result returned from hosted chat runtime tool assembly. */
|
|
20
22
|
export type HostedChatRuntimeToolAssemblyResult = {
|
|
21
23
|
runtimeTools: ToolSet;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-runtime-tool-assembly.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/hosted/chat-runtime-tool-assembly.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAE5B,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,OAAO,EAEZ,KAAK,qBAAqB,EAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,KAAK,8BAA8B,EAGpC,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AACnF,OAAO,EAEL,KAAK,4CAA4C,EACjD,KAAK,6CAA6C,EAClD,KAAK,iDAAiD,EACtD,KAAK,wCAAwC,EAC9C,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"chat-runtime-tool-assembly.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/hosted/chat-runtime-tool-assembly.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAE5B,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,OAAO,EAEZ,KAAK,qBAAqB,EAC3B,MAAM,qBA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GAAG,uBAAuB,EAE1E,KAAK,EAAE,yCAAyC,CAAC,gBAAgB,CAAC,GACjE,OAAO,CAAC,mCAAmC,CAAC,CAmF9C"}
|
|
@@ -4,12 +4,7 @@ import { createHostedProjectRemoteToolSources, } from "./project-remote-tool-sou
|
|
|
4
4
|
import { selectProviderCompatibleToolNames } from "../runtime/provider-tool-compat.js";
|
|
5
5
|
import { getProviderNativeToolNames } from "../runtime/provider-native-tool-inventory.js";
|
|
6
6
|
import { flattenSystemInstructions, withRuntimeToolInventory } from "../runtime/tool-inventory.js";
|
|
7
|
-
|
|
8
|
-
if (!toolNames) {
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
|
-
return new Set(toolNames);
|
|
12
|
-
}
|
|
7
|
+
import { normalizeHostedRuntimeAllowedToolNames, resolveHostedRuntimeAllowedToolNames, } from "./runtime-essential-tools.js";
|
|
13
8
|
function activeProjectId(taskContext) {
|
|
14
9
|
return taskContext.projectId || null;
|
|
15
10
|
}
|
|
@@ -18,13 +13,17 @@ function activeBranchId(taskContext) {
|
|
|
18
13
|
}
|
|
19
14
|
/** Filter hosted chat runtime local tools. */
|
|
20
15
|
export function filterHostedChatRuntimeLocalTools(input) {
|
|
21
|
-
const allowedToolNames =
|
|
16
|
+
const allowedToolNames = normalizeHostedRuntimeAllowedToolNames(input.allowedToolNames);
|
|
22
17
|
const entries = Object.entries(input.tools).filter(([toolName]) => allowedToolNames ? allowedToolNames.has(toolName) : true);
|
|
23
18
|
return Object.fromEntries(entries.sort(([left], [right]) => left.localeCompare(right)));
|
|
24
19
|
}
|
|
25
20
|
/** Prepare hosted chat runtime tool assembly. */
|
|
26
21
|
export async function prepareHostedChatRuntimeToolAssembly(input) {
|
|
27
|
-
const allowedToolNames =
|
|
22
|
+
const allowedToolNames = resolveHostedRuntimeAllowedToolNames({
|
|
23
|
+
allowedToolNames: input.allowedToolNames,
|
|
24
|
+
localToolNames: Object.keys(input.localTools),
|
|
25
|
+
availableSkillIds: input.taskContext.availableSkillIds,
|
|
26
|
+
});
|
|
28
27
|
const sortedLocalTools = filterHostedChatRuntimeLocalTools({
|
|
29
28
|
tools: input.localTools,
|
|
30
29
|
allowedToolNames,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Public API contract for hosted runtime allowed tool names. */
|
|
2
|
+
export type HostedRuntimeAllowedToolNames = readonly string[] | ReadonlySet<string> | null;
|
|
3
|
+
/** Input payload for resolving hosted runtime allowed tools. */
|
|
4
|
+
export type ResolveHostedRuntimeAllowedToolNamesInput = {
|
|
5
|
+
allowedToolNames?: HostedRuntimeAllowedToolNames;
|
|
6
|
+
localToolNames: Iterable<string>;
|
|
7
|
+
availableSkillIds?: readonly string[];
|
|
8
|
+
};
|
|
9
|
+
/** Normalize hosted runtime allowed tools. */
|
|
10
|
+
export declare function normalizeHostedRuntimeAllowedToolNames(toolNames: HostedRuntimeAllowedToolNames | undefined): ReadonlySet<string> | null;
|
|
11
|
+
/** Resolve allowed tools after applying runtime-essential hosted tool policy. */
|
|
12
|
+
export declare function resolveHostedRuntimeAllowedToolNames(input: ResolveHostedRuntimeAllowedToolNamesInput): ReadonlySet<string> | null;
|
|
13
|
+
//# sourceMappingURL=runtime-essential-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-essential-tools.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/hosted/runtime-essential-tools.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,MAAM,MAAM,6BAA6B,GAAG,SAAS,MAAM,EAAE,GAAG,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AAE3F,gEAAgE;AAChE,MAAM,MAAM,yCAAyC,GAAG;IACtD,gBAAgB,CAAC,EAAE,6BAA6B,CAAC;IACjD,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjC,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC,CAAC;AAKF,8CAA8C;AAC9C,wBAAgB,sCAAsC,CACpD,SAAS,EAAE,6BAA6B,GAAG,SAAS,GACnD,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI,CAM5B;AAED,iFAAiF;AACjF,wBAAgB,oCAAoC,CAClD,KAAK,EAAE,yCAAyC,GAC/C,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI,CA0B5B"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const SKILL_RUNTIME_TOOL_NAMES = ["load_skill", "load_skill_reference"];
|
|
2
|
+
const SKILL_DELEGATION_TOOL_NAMES = ["invoke_agent"];
|
|
3
|
+
/** Normalize hosted runtime allowed tools. */
|
|
4
|
+
export function normalizeHostedRuntimeAllowedToolNames(toolNames) {
|
|
5
|
+
if (!toolNames) {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
return new Set(toolNames);
|
|
9
|
+
}
|
|
10
|
+
/** Resolve allowed tools after applying runtime-essential hosted tool policy. */
|
|
11
|
+
export function resolveHostedRuntimeAllowedToolNames(input) {
|
|
12
|
+
const allowedToolNames = normalizeHostedRuntimeAllowedToolNames(input.allowedToolNames);
|
|
13
|
+
if (!allowedToolNames || allowedToolNames.size === 0) {
|
|
14
|
+
return allowedToolNames;
|
|
15
|
+
}
|
|
16
|
+
if (!input.availableSkillIds?.length) {
|
|
17
|
+
return allowedToolNames;
|
|
18
|
+
}
|
|
19
|
+
const localToolNames = new Set(input.localToolNames);
|
|
20
|
+
const resolvedToolNames = new Set(allowedToolNames);
|
|
21
|
+
for (const toolName of SKILL_RUNTIME_TOOL_NAMES) {
|
|
22
|
+
if (localToolNames.has(toolName)) {
|
|
23
|
+
resolvedToolNames.add(toolName);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
for (const toolName of SKILL_DELEGATION_TOOL_NAMES) {
|
|
27
|
+
if (localToolNames.has(toolName)) {
|
|
28
|
+
resolvedToolNames.add(toolName);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return resolvedToolNames;
|
|
32
|
+
}
|