foldkit-agent-native 0.8.0 → 0.10.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 +24 -0
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -52,6 +52,30 @@ Agent Native needs a static action registry, but the live Model and principal
52
52
  belong to the caller. Register the contract once and resolve the bound runtime
53
53
  per invocation:
54
54
 
55
+ <!-- docs-check
56
+ import { Agent } from 'foldkit-agent'
57
+ import { Option, Schema } from 'effect'
58
+ import { defineMessageUnion } from 'foldkit/message'
59
+ const Message = defineMessageUnion({ RequestedCreateTodo: { title: Schema.String } })
60
+ type Message = typeof Message.Type
61
+ interface Model {
62
+ readonly selectedTodoId: Option.Option<string>
63
+ }
64
+ import type { ActionRunContext as HostContext } from 'foldkit-agent-native'
65
+ interface Caller {
66
+ readonly email: string
67
+ }
68
+ const AgentBuilder = Agent.forModel<Model>()
69
+ const AssistantAgent = AgentBuilder.make({
70
+ messages: AgentBuilder.expose(Message, { RequestedCreateTodo: 'Create a todo' }),
71
+ })
72
+ declare const hostFor: (context: HostContext) => {
73
+ readonly model: () => Model
74
+ readonly dispatch: (message: Message) => void
75
+ }
76
+ declare const principalFor: (context: HostContext) => Caller
77
+ -->
78
+
55
79
  ```ts
56
80
  import { AgentNative } from 'foldkit-agent-native'
57
81
  import { registerPackageActions } from '@agent-native/core/server'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foldkit-agent-native",
3
- "version": "0.8.0",
3
+ "version": "0.10.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",
@@ -41,7 +41,7 @@
41
41
  "@agent-native/core": "0.214.0",
42
42
  "effect": "^4.1.0",
43
43
  "foldkit": "^0.170.0",
44
- "foldkit-agent": "^0.10.0"
44
+ "foldkit-agent": "^0.12.0"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@agent-native/core": "0.214.0",
@@ -50,7 +50,7 @@
50
50
  "foldkit": "0.170.0",
51
51
  "tsdown": "^0.23.1",
52
52
  "typescript": "7.0.2",
53
- "foldkit-agent": "0.10.0"
53
+ "foldkit-agent": "0.12.0"
54
54
  },
55
55
  "scripts": {
56
56
  "build": "node ../../scripts/declarations.mjs . && tsdown && node ../../scripts/declared-any.mjs .",