foldkit-agent-native 0.3.0 → 0.4.1
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/README.md +18 -7
- package/package.json +10 -8
package/README.md
CHANGED
|
@@ -42,12 +42,11 @@ dependencies.
|
|
|
42
42
|
|
|
43
43
|
## Sixty seconds: generate actions
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
Start with the [Agent contract and host guide](../agent/README.md#usage).
|
|
46
|
+
The integration below assumes `AssistantAgent` is your declared contract and
|
|
47
|
+
`AgentBuilder` is its application-specialized builder. The host-specific
|
|
48
|
+
`runtimeFor(context)` below resolves the caller to that live application.
|
|
46
49
|
|
|
47
|
-
```ts
|
|
48
|
-
const AgentBuilder = Agent.forApplication(App).withPrincipal<Principal>()
|
|
49
|
-
const AssistantAgent = AgentBuilder.make({ ... })
|
|
50
|
-
```
|
|
51
50
|
|
|
52
51
|
Agent Native needs a static action registry, but the live Model and principal
|
|
53
52
|
belong to the caller. Register the contract once and resolve the bound runtime
|
|
@@ -72,8 +71,8 @@ application and principal:
|
|
|
72
71
|
const runtimeFor = (context: HostContext) =>
|
|
73
72
|
AgentBuilder.bind({
|
|
74
73
|
definition: AssistantAgent,
|
|
75
|
-
host
|
|
76
|
-
principal: () => principalFor(context),
|
|
74
|
+
// The principal is part of the host, beside `model` and `dispatch`.
|
|
75
|
+
host: { ...hostFor(context), principal: () => principalFor(context) },
|
|
77
76
|
})
|
|
78
77
|
```
|
|
79
78
|
|
|
@@ -102,6 +101,18 @@ availability -> authorization -> Message -> update
|
|
|
102
101
|
The registry describes capabilities. The bound runtime decides whether a
|
|
103
102
|
particular caller may use one **right now**.
|
|
104
103
|
|
|
104
|
+
## Verify one action before adding the registry
|
|
105
|
+
|
|
106
|
+
Start with one capability and a runtime bound to a known caller. Invoke the
|
|
107
|
+
generated action with valid input, then with a value its schema rejects.
|
|
108
|
+
The first must reach your existing Message handler; the second must leave the
|
|
109
|
+
Model unchanged. Next switch to a principal your contract refuses. Registration
|
|
110
|
+
is static, so an action's presence never implies that this caller may execute it.
|
|
111
|
+
|
|
112
|
+
`actions` builds descriptors. `registerPackageActions` installs them in the host.
|
|
113
|
+
`resolveRuntime` runs for an invocation, so resolve the verified caller there
|
|
114
|
+
rather than capturing one user's runtime in a process-wide registry.
|
|
115
|
+
|
|
105
116
|
## What a capability becomes
|
|
106
117
|
|
|
107
118
|
One exposed capability becomes one Agent Native action keyed by capability
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "foldkit-agent-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Agent Native adapter for foldkit-agent. Compiles an exposed Foldkit contract into Agent Native actions.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"foldkit",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"exports": {
|
|
29
29
|
".": {
|
|
30
|
+
"foldkit-plus:source": "./src/index.ts",
|
|
30
31
|
"types": "./dist/index.d.mts",
|
|
31
32
|
"import": "./dist/index.mjs"
|
|
32
33
|
}
|
|
@@ -38,17 +39,18 @@
|
|
|
38
39
|
],
|
|
39
40
|
"peerDependencies": {
|
|
40
41
|
"@agent-native/core": "0.177.1",
|
|
41
|
-
"effect": "
|
|
42
|
-
"foldkit": "^0.
|
|
43
|
-
"foldkit-agent": "^0.
|
|
42
|
+
"effect": ">=4.0.0-rc.116 <4.0.0-rc.118",
|
|
43
|
+
"foldkit": "^0.163.0",
|
|
44
|
+
"foldkit-agent": "^0.5.0"
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
46
47
|
"@agent-native/core": "0.177.1",
|
|
47
|
-
"effect": "4.0.0-rc.
|
|
48
|
-
"
|
|
48
|
+
"@effect/platform-browser": "4.0.0-rc.116",
|
|
49
|
+
"effect": "4.0.0-rc.116",
|
|
50
|
+
"foldkit": "0.163.0",
|
|
49
51
|
"tsdown": "^0.23.0",
|
|
50
|
-
"typescript": "
|
|
51
|
-
"foldkit-agent": "0.
|
|
52
|
+
"typescript": "5.9.3",
|
|
53
|
+
"foldkit-agent": "0.5.0"
|
|
52
54
|
},
|
|
53
55
|
"scripts": {
|
|
54
56
|
"build": "tsdown",
|