@rowan-agent/agent 0.8.4 → 0.8.6

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 CHANGED
@@ -21,8 +21,12 @@ const agentId = await runtime.createAgent({
21
21
  identity: "example:v1", // Stable config snapshot identity, not the Agent ID
22
22
  model: { provider: "openai", id: "gpt-4o" },
23
23
  stream,
24
- context: {
25
- systemPrompt: "You are helpful.",
24
+ definition: {
25
+ name: "workspace-assistant",
26
+ description: "Assist with the current workspace.",
27
+ content: "You are helpful.",
28
+ },
29
+ resources: {
26
30
  tools: createCoreTools({ root: process.cwd() }),
27
31
  skills: [],
28
32
  },
@@ -68,7 +72,8 @@ lifecycles, and Owner fencing.
68
72
 
69
73
  ## Tool lifecycle
70
74
 
71
- Tools are supplied through `AgentConfig.context.tools` and persist through:
75
+ Tools are supplied as `AgentConfig.resources.tools`, selected by the
76
+ Definition, and persist through:
72
77
 
73
78
  `pending → running → completed | failed | indeterminate`
74
79
 
@@ -101,5 +106,54 @@ checkpoints; transient events never enter the Durable Store.
101
106
 
102
107
  ## Resources
103
108
 
104
- `loadSkills()`, `loadPhases()`, and `loadExtensions()` load workspace resources.
105
- Pass the resulting resources through `AgentConfig.context` or `extensions`.
109
+ `AgentRuntime` owns a Resource Registry. Register Agent Definitions, Tools,
110
+ Skills, and Phases under stable `sourceId` values, then select the sources for
111
+ an Agent through `resourceView`:
112
+
113
+ ```ts
114
+ const runtime = await AgentRuntime.init({
115
+ store: new InMemoryStore(),
116
+ bootstrap: async (registry) => {
117
+ await registry.loadExtensions({
118
+ sourceId: "workspace.extensions",
119
+ directory: "./extensions",
120
+ });
121
+ },
122
+ });
123
+
124
+ await runtime.loadAgents({
125
+ sourceId: "workspace",
126
+ values: [{
127
+ name: "workspace-assistant",
128
+ description: "Assist with the current workspace.",
129
+ content: "You are helpful.",
130
+ }],
131
+ });
132
+ await runtime.loadTools({
133
+ sourceId: "workspace",
134
+ values: createCoreTools({ root: process.cwd() }),
135
+ });
136
+
137
+ const agentId = await runtime.createAgent({
138
+ identity: "workspace:v1",
139
+ definition: { name: "workspace-assistant" },
140
+ resourceView: {
141
+ agents: ["workspace"],
142
+ tools: ["workspace"],
143
+ skills: [],
144
+ phases: [],
145
+ },
146
+ model: { provider: "openai", id: "gpt-4o" },
147
+ stream,
148
+ });
149
+ ```
150
+
151
+ Each `load*()` call replaces one source atomically; use `directory` or inline
152
+ `values`. `resourceView` controls visibility, so same-name resources can live
153
+ in isolated sources but collide when selected together. The built-in `route`
154
+ Tool and `default` Phase are always available and cannot be overridden.
155
+
156
+ Extensions are Runtime-global. Load them only during `AgentRuntime.init()` via
157
+ `bootstrap`; after initialization they are frozen until the Runtime closes.
158
+ Definition name lists narrow the selected Tools, Skills, and Phases: omission
159
+ inherits all candidates, `[]` selects none, and missing names are skipped.