foldkit-agent-native 0.3.0 → 0.4.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.
Files changed (2) hide show
  1. package/README.md +18 -7
  2. package/package.json +9 -8
package/README.md CHANGED
@@ -42,12 +42,11 @@ dependencies.
42
42
 
43
43
  ## Sixty seconds: generate actions
44
44
 
45
- Assume the application already declared a protocol-neutral contract:
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: hostFor(context),
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.0",
3
+ "version": "0.4.0",
4
4
  "description": "Agent Native adapter for foldkit-agent. Compiles an exposed Foldkit contract into Agent Native actions.",
5
5
  "keywords": [
6
6
  "foldkit",
@@ -38,17 +38,18 @@
38
38
  ],
39
39
  "peerDependencies": {
40
40
  "@agent-native/core": "0.177.1",
41
- "effect": "^4.0.0-rc.112",
42
- "foldkit": "^0.158.2",
43
- "foldkit-agent": "^0.3.0"
41
+ "effect": "^4.0.0-rc.116",
42
+ "foldkit": "^0.163.0",
43
+ "foldkit-agent": "^0.4.0"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@agent-native/core": "0.177.1",
47
- "effect": "4.0.0-rc.112",
48
- "foldkit": "0.158.2",
47
+ "@effect/platform-browser": "4.0.0-rc.116",
48
+ "effect": "4.0.0-rc.116",
49
+ "foldkit": "0.163.0",
49
50
  "tsdown": "^0.23.0",
50
- "typescript": "^5.7.2",
51
- "foldkit-agent": "0.3.0"
51
+ "typescript": "5.9.3",
52
+ "foldkit-agent": "0.4.0"
52
53
  },
53
54
  "scripts": {
54
55
  "build": "tsdown",