@finalai/agents 0.1.3 → 0.1.4
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/HOSTING.md +69 -0
- package/dist/modules/public.d.mts +1 -1
- package/dist/modules/public.mjs.map +2 -2
- package/package.json +6 -6
package/HOSTING.md
CHANGED
|
@@ -66,6 +66,75 @@ other hosted connection. `binding`
|
|
|
66
66
|
selects another name. Existing explicit `url` calls remain static and compatible;
|
|
67
67
|
they always point at that URL. There is no Final-specific compiler rewrite.
|
|
68
68
|
|
|
69
|
+
## Connection tool policy
|
|
70
|
+
|
|
71
|
+
`tools.allow`, `tools.deny` and `tools.approval` keys are tool names or `*`
|
|
72
|
+
patterns, so a definition can scope a connection whose tool list it does not know:
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
export default defineFinalConnection({
|
|
76
|
+
tools: {
|
|
77
|
+
allow: ['github.*', 'list_goals'],
|
|
78
|
+
deny: ['github.delete_repo'],
|
|
79
|
+
approval: { 'github.delete_*': always() },
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
`*` matches any run of characters; everything else matches literally. `deny` wins
|
|
85
|
+
over `allow`. The most specific key governs a tool: an exact name, else the matching
|
|
86
|
+
pattern with the most literal characters, with ties resolved toward `ask`. Hosts
|
|
87
|
+
enforce this through `isToolExposed` and `toolApprovalOf` from
|
|
88
|
+
`@finalai/agent-provider`, and look up a tool's input-approval predicate under the
|
|
89
|
+
key `resolveToolApprovalKey` returns.
|
|
90
|
+
|
|
91
|
+
## Loaded and searchable tools
|
|
92
|
+
|
|
93
|
+
A connection that can expose many tools, such as Final's with every service the
|
|
94
|
+
person has connected, can name the ones the harness should list up front:
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
export default defineFinalConnection({
|
|
98
|
+
tools: { load: ['list_goals', 'get_goal', 'draft_goal', 'notify_user'] },
|
|
99
|
+
});
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Without `load`, the harness lists every exposed tool, as before. With it, the host
|
|
103
|
+
lists only the loaded tools and must keep every other exposed tool reachable: it
|
|
104
|
+
serves a search over the connection's remaining exposed tools (name, description,
|
|
105
|
+
input schema) and a call that runs a found tool by its real name, with the same
|
|
106
|
+
exposure and approval checks as a direct call. A host may instead add a found tool
|
|
107
|
+
to the list and send `notifications/tools/list_changed`; harnesses that ignore that
|
|
108
|
+
notification still need the call path. `load: []` leaves every tool to search.
|
|
109
|
+
Entries are tool names or `*` patterns. `isToolLoaded` from `@finalai/agent-provider`
|
|
110
|
+
applies the rule after exposure.
|
|
111
|
+
|
|
112
|
+
## Selecting tools by annotation
|
|
113
|
+
|
|
114
|
+
`tools.allow` and `tools.deny` entries can be MCP annotation selectors as well as
|
|
115
|
+
tool names, so a definition can scope tools it cannot name in advance:
|
|
116
|
+
|
|
117
|
+
```ts
|
|
118
|
+
export default defineFinalConnection({
|
|
119
|
+
tools: {
|
|
120
|
+
allow: ['list_goals', 'draft_goal', { readOnlyHint: true }],
|
|
121
|
+
deny: [{ destructiveHint: true, readOnlyHint: false }],
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
A selector matches when every hint it sets equals the tool's hint, reading hints the
|
|
127
|
+
tool omits as the MCP spec's defaults (not read-only, destructive, not idempotent,
|
|
128
|
+
open world). The annotations come from the connection's server, so select on them
|
|
129
|
+
only for servers trusted to classify their own tools.
|
|
130
|
+
|
|
131
|
+
Selectors lower to `allowAnnotations` (each with the connection default approval and
|
|
132
|
+
input predicate) and `denyAnnotations`. A host exposes a tool when nothing in `deny`
|
|
133
|
+
or `denyAnnotations` matches it and either an `approvals` key (name or pattern)
|
|
134
|
+
governs it, `approvals` is null, or `toolAnnotationRuleFor` finds a rule; a tool an
|
|
135
|
+
`approvals` key governs keeps that approval, otherwise it runs under the rule's. `tools.approval` overrides apply only to
|
|
136
|
+
named tools.
|
|
137
|
+
|
|
69
138
|
## Resources and provider packages
|
|
70
139
|
|
|
71
140
|
`HostedBindingsIface` is the shared `@finalai/agent-provider` contract. Hosting
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { CredentialOwner, CredentialPayer, DELETE, GET, HookEvent, POST, PUT, SandboxWire, WS, always, baseTools, credentials, defineAgent, defineChannel, disableChannel, defineProviderChannel, defineDynamic, defineHarness, defineHostedConnection, defineHook, defineInstructions, defineMcpClientConnection, defineSandbox, defineSandboxProvider, defineSchedule, defineSkill, defineTool, harnessHost, never, toolResultFrom, whenInput, } from "./authoring/index.mjs";
|
|
2
2
|
export type { AgentDefinitionInputIface, AgentSessionInfoIface, ApprovalPolicyIface, AuthoredChannelDefinitionIface, AuthoredHarnessCloseContextIface, AuthoredHarnessDescriptionIface, AuthoredHarnessEndpointIface, AuthoredHarnessHealthIface, AuthoredHarnessIface, AuthoredHarnessOpenArgsIface, AuthoredHarnessRefContextIface, AuthoredHarnessResumeArgsIface, BaseToolsValueIface, ConversationInfoIface, CredentialNode, CredentialPolicyIface, DefinedAuthoredHarnessIface, DefinedToolIface, DynamicDefinitionIface, DynamicResolveContextIface, DynamicSentinelIface, FinalPlatformClientIface, HarnessHostIface, HookContextIface, HookDefinitionIface, HookEventIface, HostedConnectionDefinitionIface, McpClientConnectionDefinitionIface, SandboxSelectorContextIface, ScheduleInputIface, SkillDefinitionIface, ToolContextIface, ToolDefinitionIface, } from "./authoring/index.mjs";
|
|
3
3
|
export * from "./authoring/providers.mjs";
|
|
4
|
-
export type { AgentManifestIface, ChannelDefinitionIface, ChannelPlatformIface, ChannelSocketIface, HarnessDescriptionIface, HarnessEndpointIface, HarnessIface, HarnessSessionRefIface, HostedBindingsIface, McpChannelIface, NetworkSandboxSessionIface, ResolvedAgentManifestIface, RouteDefinitionIface, SandboxMcpEndpoint, SandboxPrepareContextIface, SandboxProcessIface, SandboxProviderHandleIface, SandboxProviderIface, SandboxProviderImplementationIface, SandboxSessionIface, SandboxStartContextIface, ScreenSessionIface, } from '@finalai/agent-provider';
|
|
4
|
+
export type { AgentAvatarIface, AvatarMedia, AvatarState, AgentManifestIface, ChannelDefinitionIface, ChannelPlatformIface, ChannelSocketIface, HarnessDescriptionIface, HarnessEndpointIface, HarnessIface, HarnessSessionRefIface, HostedBindingsIface, McpChannelIface, NetworkSandboxSessionIface, ResolvedAgentManifestIface, RouteDefinitionIface, SandboxMcpEndpoint, SandboxPrepareContextIface, SandboxProcessIface, SandboxProviderHandleIface, SandboxProviderIface, SandboxProviderImplementationIface, SandboxSessionIface, SandboxStartContextIface, ScreenSessionIface, } from '@finalai/agent-provider';
|
|
5
5
|
export { requireHostedBinding } from '@finalai/agent-provider';
|
|
6
6
|
export { validateHostedBindings } from '@finalai/agent-definition';
|
|
7
7
|
export type { HostedBindingRequirementIface } from '@finalai/agent-provider';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/public.ts"],
|
|
4
|
-
"sourcesContent": ["// Agent authoring.\nexport {\n CredentialOwner,\n CredentialPayer,\n DELETE,\n GET,\n HookEvent,\n POST,\n PUT,\n SandboxWire,\n WS,\n always,\n baseTools,\n credentials,\n defineAgent,\n defineChannel,\n disableChannel,\n defineProviderChannel,\n defineDynamic,\n defineHarness,\n defineHostedConnection,\n defineHook,\n defineInstructions,\n defineMcpClientConnection,\n defineSandbox,\n defineSandboxProvider,\n defineSchedule,\n defineSkill,\n defineTool,\n harnessHost,\n never,\n toolResultFrom,\n whenInput,\n} from \"./authoring/index.mjs\";\nexport type {\n AgentDefinitionInputIface,\n AgentSessionInfoIface,\n ApprovalPolicyIface,\n AuthoredChannelDefinitionIface,\n AuthoredHarnessCloseContextIface,\n AuthoredHarnessDescriptionIface,\n AuthoredHarnessEndpointIface,\n AuthoredHarnessHealthIface,\n AuthoredHarnessIface,\n AuthoredHarnessOpenArgsIface,\n AuthoredHarnessRefContextIface,\n AuthoredHarnessResumeArgsIface,\n BaseToolsValueIface,\n ConversationInfoIface,\n CredentialNode,\n CredentialPolicyIface,\n DefinedAuthoredHarnessIface,\n DefinedToolIface,\n DynamicDefinitionIface,\n DynamicResolveContextIface,\n DynamicSentinelIface,\n FinalPlatformClientIface,\n HarnessHostIface,\n HookContextIface,\n HookDefinitionIface,\n HookEventIface,\n HostedConnectionDefinitionIface,\n McpClientConnectionDefinitionIface,\n SandboxSelectorContextIface,\n ScheduleInputIface,\n SkillDefinitionIface,\n ToolContextIface,\n ToolDefinitionIface,\n} from \"./authoring/index.mjs\";\nexport * from \"./authoring/providers.mjs\";\n\nexport type {\n AgentManifestIface,\n ChannelDefinitionIface,\n ChannelPlatformIface,\n ChannelSocketIface,\n HarnessDescriptionIface,\n HarnessEndpointIface,\n HarnessIface,\n HarnessSessionRefIface,\n HostedBindingsIface,\n McpChannelIface,\n NetworkSandboxSessionIface,\n ResolvedAgentManifestIface,\n RouteDefinitionIface,\n SandboxMcpEndpoint,\n SandboxPrepareContextIface,\n SandboxProcessIface,\n SandboxProviderHandleIface,\n SandboxProviderIface,\n SandboxProviderImplementationIface,\n SandboxSessionIface,\n SandboxStartContextIface,\n ScreenSessionIface,\n} from '@finalai/agent-provider';\n\nexport { requireHostedBinding } from '@finalai/agent-provider';\nexport { validateHostedBindings } from '@finalai/agent-definition';\nexport type { HostedBindingRequirementIface } from '@finalai/agent-provider';\n\nexport { defineFinalConnection } from '@finalai/final-agent-provider/connections';\nexport type {\n FinalConnectionDefinitionIface,\n FinalHostedConnectionDefinitionIface,\n} from '@finalai/final-agent-provider/connections';\n"],
|
|
5
|
-
"mappings": "AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAoCP,cAAc;
|
|
4
|
+
"sourcesContent": ["// Agent authoring.\nexport {\n CredentialOwner,\n CredentialPayer,\n DELETE,\n GET,\n HookEvent,\n POST,\n PUT,\n SandboxWire,\n WS,\n always,\n baseTools,\n credentials,\n defineAgent,\n defineChannel,\n disableChannel,\n defineProviderChannel,\n defineDynamic,\n defineHarness,\n defineHostedConnection,\n defineHook,\n defineInstructions,\n defineMcpClientConnection,\n defineSandbox,\n defineSandboxProvider,\n defineSchedule,\n defineSkill,\n defineTool,\n harnessHost,\n never,\n toolResultFrom,\n whenInput,\n} from \"./authoring/index.mjs\";\nexport type {\n AgentDefinitionInputIface,\n AgentSessionInfoIface,\n ApprovalPolicyIface,\n AuthoredChannelDefinitionIface,\n AuthoredHarnessCloseContextIface,\n AuthoredHarnessDescriptionIface,\n AuthoredHarnessEndpointIface,\n AuthoredHarnessHealthIface,\n AuthoredHarnessIface,\n AuthoredHarnessOpenArgsIface,\n AuthoredHarnessRefContextIface,\n AuthoredHarnessResumeArgsIface,\n BaseToolsValueIface,\n ConversationInfoIface,\n CredentialNode,\n CredentialPolicyIface,\n DefinedAuthoredHarnessIface,\n DefinedToolIface,\n DynamicDefinitionIface,\n DynamicResolveContextIface,\n DynamicSentinelIface,\n FinalPlatformClientIface,\n HarnessHostIface,\n HookContextIface,\n HookDefinitionIface,\n HookEventIface,\n HostedConnectionDefinitionIface,\n McpClientConnectionDefinitionIface,\n SandboxSelectorContextIface,\n ScheduleInputIface,\n SkillDefinitionIface,\n ToolContextIface,\n ToolDefinitionIface,\n} from \"./authoring/index.mjs\";\nexport * from \"./authoring/providers.mjs\";\n\nexport type {\n AgentAvatarIface,\n AvatarMedia,\n AvatarState,\n AgentManifestIface,\n ChannelDefinitionIface,\n ChannelPlatformIface,\n ChannelSocketIface,\n HarnessDescriptionIface,\n HarnessEndpointIface,\n HarnessIface,\n HarnessSessionRefIface,\n HostedBindingsIface,\n McpChannelIface,\n NetworkSandboxSessionIface,\n ResolvedAgentManifestIface,\n RouteDefinitionIface,\n SandboxMcpEndpoint,\n SandboxPrepareContextIface,\n SandboxProcessIface,\n SandboxProviderHandleIface,\n SandboxProviderIface,\n SandboxProviderImplementationIface,\n SandboxSessionIface,\n SandboxStartContextIface,\n ScreenSessionIface,\n} from '@finalai/agent-provider';\n\nexport { requireHostedBinding } from '@finalai/agent-provider';\nexport { validateHostedBindings } from '@finalai/agent-definition';\nexport type { HostedBindingRequirementIface } from '@finalai/agent-provider';\n\nexport { defineFinalConnection } from '@finalai/final-agent-provider/connections';\nexport type {\n FinalConnectionDefinitionIface,\n FinalHostedConnectionDefinitionIface,\n} from '@finalai/final-agent-provider/connections';\n"],
|
|
5
|
+
"mappings": "AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAoCP,cAAc;AA8Bd,SAAS,4BAA4B;AACrC,SAAS,8BAA8B;AAGvC,SAAS,6BAA6B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finalai/agents",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Agent authoring, client APIs, and CLI.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -110,11 +110,11 @@
|
|
|
110
110
|
},
|
|
111
111
|
"dependencies": {
|
|
112
112
|
"@agentclientprotocol/sdk": "1.8.0",
|
|
113
|
-
"@finalai/agent-definition": "0.1.
|
|
114
|
-
"@finalai/agent-protocol": "0.1.
|
|
115
|
-
"@finalai/agent-provider": "0.1.
|
|
116
|
-
"@finalai/final-agent-provider": "0.1.
|
|
117
|
-
"@finalai/websockets": "0.1.
|
|
113
|
+
"@finalai/agent-definition": "0.1.4",
|
|
114
|
+
"@finalai/agent-protocol": "0.1.4",
|
|
115
|
+
"@finalai/agent-provider": "0.1.4",
|
|
116
|
+
"@finalai/final-agent-provider": "0.1.4",
|
|
117
|
+
"@finalai/websockets": "0.1.4",
|
|
118
118
|
"ws": "^8.21.3",
|
|
119
119
|
"zod": "4.6.5"
|
|
120
120
|
},
|