@slopus/happy-agent-base 0.0.5 → 0.0.7

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 (92) hide show
  1. package/README.md +62 -9
  2. package/dist/Agent.d.ts +27 -22
  3. package/dist/Agent.d.ts.map +1 -1
  4. package/dist/Agent.js +120 -110
  5. package/dist/Agent.js.map +1 -1
  6. package/dist/AgentBase.d.ts +27 -13
  7. package/dist/AgentBase.d.ts.map +1 -1
  8. package/dist/AgentBase.js +657 -151
  9. package/dist/AgentBase.js.map +1 -1
  10. package/dist/AgentBaseHooks.d.ts +58 -32
  11. package/dist/AgentBaseHooks.d.ts.map +1 -1
  12. package/dist/AgentBasePending.d.ts +6 -2
  13. package/dist/AgentBasePending.d.ts.map +1 -1
  14. package/dist/AgentBasePending.js +7 -0
  15. package/dist/AgentBasePending.js.map +1 -1
  16. package/dist/AgentConfig.d.ts +20 -13
  17. package/dist/AgentConfig.d.ts.map +1 -1
  18. package/dist/AgentConfig.js +32 -12
  19. package/dist/AgentConfig.js.map +1 -1
  20. package/dist/AgentContexts.d.ts +18 -1
  21. package/dist/AgentContexts.d.ts.map +1 -1
  22. package/dist/AgentContexts.js +24 -1
  23. package/dist/AgentContexts.js.map +1 -1
  24. package/dist/AgentDatabase.d.ts +35 -0
  25. package/dist/AgentDatabase.d.ts.map +1 -0
  26. package/dist/AgentDatabase.js +30 -0
  27. package/dist/AgentDatabase.js.map +1 -0
  28. package/dist/AgentKV.d.ts +19 -6
  29. package/dist/AgentKV.d.ts.map +1 -1
  30. package/dist/AgentKV.js +110 -43
  31. package/dist/AgentKV.js.map +1 -1
  32. package/dist/AgentMessageAcceptance.d.ts +14 -0
  33. package/dist/AgentMessageAcceptance.d.ts.map +1 -0
  34. package/dist/AgentMessageAcceptance.js +2 -0
  35. package/dist/AgentMessageAcceptance.js.map +1 -0
  36. package/dist/AgentMetadata.d.ts +37 -0
  37. package/dist/AgentMetadata.d.ts.map +1 -0
  38. package/dist/AgentMetadata.js +74 -0
  39. package/dist/AgentMetadata.js.map +1 -0
  40. package/dist/AgentModule.d.ts +209 -0
  41. package/dist/AgentModule.d.ts.map +1 -0
  42. package/dist/AgentModule.js +2 -0
  43. package/dist/AgentModule.js.map +1 -0
  44. package/dist/{AgentFeatureAction.d.ts → AgentModuleAction.d.ts} +7 -2
  45. package/dist/AgentModuleAction.d.ts.map +1 -0
  46. package/dist/AgentModuleAction.js +2 -0
  47. package/dist/AgentModuleAction.js.map +1 -0
  48. package/dist/AgentPermissionMode.d.ts +1 -1
  49. package/dist/AgentPermissionMode.js +1 -1
  50. package/dist/AgentPersistence.d.ts +20 -7
  51. package/dist/AgentPersistence.d.ts.map +1 -1
  52. package/dist/AgentPersistenceDrizzle.d.ts +31 -0
  53. package/dist/AgentPersistenceDrizzle.d.ts.map +1 -0
  54. package/dist/AgentPersistenceDrizzle.js +99 -0
  55. package/dist/AgentPersistenceDrizzle.js.map +1 -0
  56. package/dist/AgentRef.d.ts +17 -9
  57. package/dist/AgentRef.d.ts.map +1 -1
  58. package/dist/AgentRef.js +16 -9
  59. package/dist/AgentRef.js.map +1 -1
  60. package/dist/AgentStorage.d.ts +33 -13
  61. package/dist/AgentStorage.d.ts.map +1 -1
  62. package/dist/AgentStorage.js +174 -3
  63. package/dist/AgentStorage.js.map +1 -1
  64. package/dist/AgentSystem.d.ts +34 -12
  65. package/dist/AgentSystem.d.ts.map +1 -1
  66. package/dist/AgentSystemContext.d.ts +3 -3
  67. package/dist/AgentSystemContext.d.ts.map +1 -1
  68. package/dist/AgentSystemContext.js +4 -4
  69. package/dist/AgentSystemContext.js.map +1 -1
  70. package/dist/AgentSystemLocal.d.ts +30 -21
  71. package/dist/AgentSystemLocal.d.ts.map +1 -1
  72. package/dist/AgentSystemLocal.js +226 -59
  73. package/dist/AgentSystemLocal.js.map +1 -1
  74. package/dist/AgentSystemRef.d.ts +21 -10
  75. package/dist/AgentSystemRef.d.ts.map +1 -1
  76. package/dist/AgentSystemRef.js +41 -9
  77. package/dist/AgentSystemRef.js.map +1 -1
  78. package/dist/AgentTool.d.ts +16 -1
  79. package/dist/AgentTool.d.ts.map +1 -1
  80. package/dist/AgentTool.js.map +1 -1
  81. package/dist/index.d.ts +10 -7
  82. package/dist/index.d.ts.map +1 -1
  83. package/dist/index.js +9 -6
  84. package/dist/index.js.map +1 -1
  85. package/package.json +4 -3
  86. package/dist/AgentFeature.d.ts +0 -177
  87. package/dist/AgentFeature.d.ts.map +0 -1
  88. package/dist/AgentFeature.js +0 -2
  89. package/dist/AgentFeature.js.map +0 -1
  90. package/dist/AgentFeatureAction.d.ts.map +0 -1
  91. package/dist/AgentFeatureAction.js +0 -2
  92. package/dist/AgentFeatureAction.js.map +0 -1
package/dist/Agent.js CHANGED
@@ -1,55 +1,56 @@
1
+ import { agentConfig } from "./AgentConfig.js";
1
2
  import { AgentBase, } from "./AgentBase.js";
2
- import { agentEffort, agentKV, agentModel, agentPermissionMode, agentProvider, agentRunKV, agentServiceTier, withAgentKV, withAgentRunKV, } from "./AgentContexts.js";
3
+ import { agentDatabase, agentEffort, agentKV, agentModel, agentPermissionMode, agentProvider, agentRunKV, agentServiceTier, withAgentKV, withAgentRunKV, } from "./AgentContexts.js";
3
4
  /**
4
- * A thin wrapper around `AgentBase` that assembles its behavior from features. Each feature
5
+ * A thin wrapper around `AgentBase` that assembles its behavior from modules. Each module
5
6
  * implements any subset of the agent hooks on its own; the agent merges them into the singular
6
7
  * private hooks its internal base runs with.
7
8
  *
8
- * Features are independent. Observing hooks — events and lifecycle brackets — fan out to every
9
- * feature in array order with per-feature isolation, so one throwing feature never silences the
10
- * others, and lifecycle actions concatenate across features with a failing feature losing only
9
+ * Modules are independent. Observing hooks — events and lifecycle brackets — fan out to every
10
+ * module in array order with per-module isolation, so one throwing module never silences the
11
+ * others, and lifecycle actions concatenate across modules with a failing module losing only
11
12
  * its own actions. Correctness hooks are loud instead: instructions and tools concatenate in
12
- * feature order — extending the base state, which `AgentBase` puts first — and a failure there
13
+ * module order — extending the base state, which `AgentBase` puts first — and a failure there
13
14
  * fails the turn rather than running with a wrong configuration. For a model change, every
14
- * feature observes the change, the first returned handoff wins, and a feature failure during an
15
+ * module observes the change, the first returned handoff wins, and a module failure during an
15
16
  * incompatible change rejects the switch so the history survives.
16
17
  */
17
18
  export class Agent {
18
19
  /** The session this agent is a facade over; every operation delegates straight to it. */
19
20
  #base;
20
- /** The features whose hooks were merged into the base, kept in the order they were given. */
21
- #features;
21
+ /** The modules whose hooks were merged into the base, kept in the order they were given. */
22
+ #modules;
22
23
  /**
23
- * A new agent over a fresh identity, with its features' hooks merged into one set. Touches
24
+ * A new agent over a fresh identity, with its modules' hooks merged into one set. Touches
24
25
  * no storage.
25
26
  */
26
27
  static async create(ctx, options) {
27
- const { features, base } = split(options);
28
- return new Agent(await AgentBase.create(ctx, base), features);
28
+ const { modules, base } = split(options);
29
+ return new Agent(await AgentBase.create(ctx, base), modules);
29
30
  }
30
31
  /**
31
32
  * An agent over an identity that may already have durable state, with that state's one
32
33
  * externally meaningful fact — whether it has work left — read before it is handed back.
33
34
  */
34
35
  static async load(ctx, options) {
35
- const { features, base } = split(options);
36
- return new Agent(await AgentBase.load(ctx, base), features);
36
+ const { modules, base } = split(options);
37
+ return new Agent(await AgentBase.load(ctx, base), modules);
37
38
  }
38
39
  /**
39
40
  * Load the agent and set it going again if it has work left, or answer with nothing when it
40
41
  * has none — how an owner coming up carries on what an earlier process was in the middle of.
41
42
  */
42
43
  static async loadActive(ctx, options) {
43
- const { features, base } = split(options);
44
+ const { modules, base } = split(options);
44
45
  const loaded = await AgentBase.loadActive(ctx, base);
45
- return loaded === undefined ? undefined : new Agent(loaded, features);
46
+ return loaded === undefined ? undefined : new Agent(loaded, modules);
46
47
  }
47
48
  /**
48
49
  * Wrap an already-built base. Private, because an agent is made by `create` or by `load`,
49
50
  * and which of the two the caller means is worth saying.
50
51
  */
51
- constructor(base, features) {
52
- this.#features = features;
52
+ constructor(base, modules) {
53
+ this.#modules = modules;
53
54
  this.#base = base;
54
55
  }
55
56
  /** The stable session identity this agent was created with. */
@@ -61,16 +62,16 @@ export class Agent {
61
62
  return this.#base.active;
62
63
  }
63
64
  /**
64
- * The feature this agent runs under `name`, when it has one. An individual feature holds the
65
+ * The module this agent runs under `name`, when it has one. An individual module holds the
65
66
  * state of the single agent it was built for, so this is how that agent's owner reaches what
66
- * belongs to it — a goal to pause, for instance. A shared feature is answered here too, but
67
+ * belongs to it — a goal to pause, for instance. A shared module is answered here too, but
67
68
  * it is the collection's instance, serving every agent at once.
68
69
  */
69
- feature(name) {
70
- return this.#features.find((feature) => feature.name === name);
70
+ module(name) {
71
+ return this.#modules.find((module) => module.name === name);
71
72
  }
72
73
  /**
73
- * The base's mutable instructions and tools, which every inference reads and every feature's
74
+ * The base's mutable instructions and tools, which every inference reads and every module's
74
75
  * own contribution extends.
75
76
  */
76
77
  get state() {
@@ -78,11 +79,15 @@ export class Agent {
78
79
  }
79
80
  /** Queue a user message that injects as soon as the current response and tool batch finish. */
80
81
  async steer(ctx, message, options) {
81
- await this.#base.steer(ctx, message, options);
82
+ return await this.#base.steer(ctx, message, options);
82
83
  }
83
84
  /** Queue a user message that injects only when the agent would otherwise stop. */
84
85
  async send(ctx, message, options) {
85
- await this.#base.send(ctx, message, options);
86
+ return await this.#base.send(ctx, message, options);
87
+ }
88
+ /** Shallow-merge fields into this agent's immutable metadata. */
89
+ async updateMetadata(ctx, update) {
90
+ await this.#base.updateMetadata(ctx, update);
86
91
  }
87
92
  /** Start the loop without a new message, continuing a turn an earlier run left unfinished. */
88
93
  start() {
@@ -113,75 +118,75 @@ export class Agent {
113
118
  }
114
119
  }
115
120
  /**
116
- * Merge every feature's hook implementations into one `AgentBaseHooks`. A hook is provided only
117
- * when at least one feature implements it, so the base's own behavior — the mutable state alone
121
+ * Merge every module's hook implementations into one `AgentBaseHooks`. A hook is provided only
122
+ * when at least one module implements it, so the base's own behavior — the mutable state alone
118
123
  * for instructions and tools — stays in effect otherwise.
119
124
  */
120
125
  /**
121
- * Separate the features from the options the base is built with, and merge their hooks into the
126
+ * Separate the modules from the options the base is built with, and merge their hooks into the
122
127
  * one set the base observes the run through. Both factories need exactly this, and the merge has
123
128
  * to happen before the base exists.
124
129
  */
125
130
  function split(options) {
126
- const { features, sharedKV, ...rest } = options;
127
- const resolved = features ?? [];
131
+ const { modules, sharedKV, ...rest } = options;
132
+ const resolved = modules ?? [];
128
133
  return {
129
- features: resolved,
130
- base: { ...rest, hooks: mergeFeatures(resolved, options, sharedKV) },
134
+ modules: resolved,
135
+ base: { ...rest, hooks: mergeModules(resolved, options, sharedKV) },
131
136
  };
132
137
  }
133
- function mergeFeatures(features, options, sharedKV) {
134
- /** What one feature's hook is handed alongside the context, for this call. */
135
- const scopeOf = (ctx, feature) => featureScope(ctx, feature, options, sharedKV);
136
- const withInstructions = features.filter((feature) => feature.instructions !== undefined);
137
- const withTools = features.filter((feature) => feature.tools !== undefined);
138
- const withBeforeToolCall = features.filter((feature) => feature.beforeToolCall !== undefined);
139
- const withModelChanged = features.filter((feature) => feature.modelChanged !== undefined);
140
- const withEvents = features.filter((feature) => feature.onEvent !== undefined);
141
- // Observing hooks fan out with per-feature isolation: one throwing feature must never
142
- // prevent the features after it from observing.
138
+ function mergeModules(modules, options, sharedKV) {
139
+ /** What one module's hook is handed alongside the context, for this call. */
140
+ const scopeOf = (ctx, module) => moduleScope(ctx, module, options, sharedKV);
141
+ const withInstructions = modules.filter((module) => module.instructions !== undefined);
142
+ const withTools = modules.filter((module) => module.tools !== undefined);
143
+ const withBeforeToolCall = modules.filter((module) => module.beforeToolCall !== undefined);
144
+ const withModelChanged = modules.filter((module) => module.modelChanged !== undefined);
145
+ const withEvents = modules.filter((module) => module.onEvent !== undefined);
146
+ // Observing hooks fan out with per-module isolation: one throwing module must never
147
+ // prevent the modules after it from observing.
143
148
  const fanOut = (pick) => {
144
- const implemented = features.filter((feature) => pick(feature) !== undefined);
149
+ const implemented = modules.filter((module) => pick(module) !== undefined);
145
150
  if (implemented.length === 0)
146
151
  return undefined;
147
152
  return async (ctx, ...args) => {
148
- for (const feature of implemented) {
153
+ for (const module of implemented) {
149
154
  try {
150
- await pick(feature)?.(featureCtx(ctx, feature), scopeOf(ctx, feature), ...args);
155
+ await pick(module)?.(moduleCtx(ctx, module), scopeOf(ctx, module), ...args);
151
156
  }
152
157
  catch {
153
- // Features observe independently; one failing never silences the rest.
158
+ // Modules observe independently; one failing never silences the rest.
154
159
  }
155
160
  }
156
161
  };
157
162
  };
158
163
  // Transactional hooks run in order inside one transaction, and a failure propagates: the
159
- // features here are writing alongside the fact being committed, so containing one feature's
164
+ // modules here are writing alongside the fact being committed, so containing one module's
160
165
  // failure would commit a conclusion the rest of the transaction contradicts.
161
166
  const chain = (pick) => {
162
- const implemented = features.filter((feature) => pick(feature) !== undefined);
167
+ const implemented = modules.filter((module) => pick(module) !== undefined);
163
168
  if (implemented.length === 0)
164
169
  return undefined;
165
170
  return async (ctx, ...args) => {
166
- for (const feature of implemented) {
167
- await pick(feature)?.(featureCtx(ctx, feature), scopeOf(ctx, feature), ...args);
171
+ for (const module of implemented) {
172
+ await pick(module)?.(moduleCtx(ctx, module), scopeOf(ctx, module), ...args);
168
173
  }
169
174
  };
170
175
  };
171
- // Action hooks concatenate what every feature asks for; a failing feature loses only its
176
+ // Action hooks concatenate what every module asks for; a failing module loses only its
172
177
  // own actions.
173
178
  const collect = (pick) => {
174
- const implemented = features.filter((feature) => pick(feature) !== undefined);
179
+ const implemented = modules.filter((module) => pick(module) !== undefined);
175
180
  if (implemented.length === 0)
176
181
  return undefined;
177
182
  return async (ctx, ...args) => {
178
183
  const actions = [];
179
- for (const feature of implemented) {
184
+ for (const module of implemented) {
180
185
  try {
181
- actions.push(...((await pick(feature)?.(featureCtx(ctx, feature), scopeOf(ctx, feature), ...args)) ?? []));
186
+ actions.push(...((await pick(module)?.(moduleCtx(ctx, module), scopeOf(ctx, module), ...args)) ?? []));
182
187
  }
183
188
  catch {
184
- // Features act independently; one failing never discards the rest.
189
+ // Modules act independently; one failing never discards the rest.
185
190
  }
186
191
  }
187
192
  return actions;
@@ -191,27 +196,27 @@ function mergeFeatures(features, options, sharedKV) {
191
196
  ...(withEvents.length === 0
192
197
  ? {}
193
198
  : {
194
- onEvent: ((ctx, event) => {
195
- for (const feature of withEvents) {
199
+ onEvent: (async (ctx, event) => {
200
+ for (const module of withEvents) {
196
201
  try {
197
- feature.onEvent?.(featureCtx(ctx, feature), scopeOf(ctx, feature), event);
202
+ await module.onEvent?.(moduleCtx(ctx, module), scopeOf(ctx, module), event);
198
203
  }
199
204
  catch {
200
- // Features observe independently; one failing never silences
205
+ // Modules observe independently; one failing never silences
201
206
  // the rest.
202
207
  }
203
208
  }
204
209
  }),
205
210
  }),
206
- ...spread("onEventTransact", chain((feature) => feature.onEventTransact)),
211
+ ...spread("onEventTransact", chain((module) => module.onEventTransact)),
207
212
  ...(withInstructions.length === 0
208
213
  ? {}
209
214
  : {
210
- // Correctness hook: a failing feature propagates and fails the turn.
215
+ // Correctness hook: a failing module propagates and fails the turn.
211
216
  instructions: async (ctx) => {
212
217
  const texts = [];
213
- for (const feature of withInstructions) {
214
- texts.push((await feature.instructions?.(featureCtx(ctx, feature), scopeOf(ctx, feature))) ?? "");
218
+ for (const module of withInstructions) {
219
+ texts.push((await module.instructions?.(moduleCtx(ctx, module), scopeOf(ctx, module))) ?? "");
215
220
  }
216
221
  return texts.filter((text) => text.length > 0).join("\n\n");
217
222
  },
@@ -219,34 +224,34 @@ function mergeFeatures(features, options, sharedKV) {
219
224
  ...(withTools.length === 0
220
225
  ? {}
221
226
  : {
222
- // Correctness hook: a failing feature propagates and fails the turn; the
227
+ // Correctness hook: a failing module propagates and fails the turn; the
223
228
  // base validates the merged list against duplicate names.
224
229
  tools: async (ctx) => {
225
230
  const tools = [];
226
- for (const feature of withTools) {
227
- tools.push(...((await feature.tools?.(featureCtx(ctx, feature), scopeOf(ctx, feature))) ?? []));
231
+ for (const module of withTools) {
232
+ tools.push(...((await module.tools?.(moduleCtx(ctx, module), scopeOf(ctx, module))) ?? []));
228
233
  }
229
234
  return tools;
230
235
  },
231
236
  }),
232
- ...spread("beforeToolCallTransact", chain((feature) => feature.beforeToolCallTransact)),
237
+ ...spread("beforeToolCallTransact", chain((module) => module.beforeToolCallTransact)),
233
238
  ...(withBeforeToolCall.length === 0
234
239
  ? {}
235
240
  : {
236
- // Correctness hook: features decide in array order, each seeing the call as the
241
+ // Correctness hook: modules decide in array order, each seeing the call as the
237
242
  // one before it left it, and a failure propagates to the base so it becomes
238
243
  // this call's error result.
239
244
  beforeToolCall: async (ctx, call) => {
240
245
  let current = call;
241
- // Nothing carries a mode into the next feature's view of the call, so the
242
- // last feature to name one is the one that meant it about the run itself.
246
+ // Nothing carries a mode into the next module's view of the call, so the
247
+ // last module to name one is the one that meant it about the run itself.
243
248
  let permissionMode;
244
- for (const feature of withBeforeToolCall) {
245
- const decision = await feature.beforeToolCall?.(featureCtx(ctx, feature), scopeOf(ctx, feature), current);
249
+ for (const module of withBeforeToolCall) {
250
+ const decision = await module.beforeToolCall?.(moduleCtx(ctx, module), scopeOf(ctx, module), current);
246
251
  if (decision === undefined)
247
252
  continue;
248
253
  // An answer settles the call: there is no longer a run for the
249
- // features after it to have an opinion about.
254
+ // modules after it to have an opinion about.
250
255
  if (decision.type === "answer")
251
256
  return decision;
252
257
  current = {
@@ -271,8 +276,8 @@ function mergeFeatures(features, options, sharedKV) {
271
276
  };
272
277
  },
273
278
  }),
274
- ...spread("afterToolCall", fanOut((feature) => feature.afterToolCall)),
275
- ...spread("afterToolCallTransact", chain((feature) => feature.afterToolCallTransact)),
279
+ ...spread("afterToolCall", fanOut((module) => module.afterToolCall)),
280
+ ...spread("afterToolCallTransact", chain((module) => module.afterToolCallTransact)),
276
281
  ...(withModelChanged.length === 0
277
282
  ? {}
278
283
  : {
@@ -280,11 +285,11 @@ function mergeFeatures(features, options, sharedKV) {
280
285
  let injected;
281
286
  let failed = false;
282
287
  let failure;
283
- // Every feature observes the change even when an earlier one fails;
288
+ // Every module observes the change even when an earlier one fails;
284
289
  // the first returned handoff wins.
285
- for (const feature of withModelChanged) {
290
+ for (const module of withModelChanged) {
286
291
  try {
287
- const message = await feature.modelChanged?.(featureCtx(ctx, feature), scopeOf(ctx, feature), change);
292
+ const message = await module.modelChanged?.(moduleCtx(ctx, module), scopeOf(ctx, module), change);
288
293
  injected ??= message;
289
294
  }
290
295
  catch (error) {
@@ -294,62 +299,67 @@ function mergeFeatures(features, options, sharedKV) {
294
299
  }
295
300
  }
296
301
  }
297
- // A failing feature during an incompatible change rejects the switch,
302
+ // A failing module during an incompatible change rejects the switch,
298
303
  // preserving the history; on a compatible change it merely observed.
299
304
  if (failed && change.wasReset)
300
305
  throw failure;
301
306
  return injected;
302
307
  },
303
308
  }),
304
- ...spread("messageAcceptedTransact", chain((feature) => feature.messageAcceptedTransact)),
305
- ...spread("messageAccepted", fanOut((feature) => feature.messageAccepted)),
306
- ...spread("permissionModeChangedTransact", chain((feature) => feature.permissionModeChangedTransact)),
307
- ...spread("permissionModeChanged", fanOut((feature) => feature.permissionModeChanged)),
308
- ...spread("beforeAgentLoopTransact", chain((feature) => feature.beforeAgentLoopTransact)),
309
- ...spread("beforeAgentLoop", fanOut((feature) => feature.beforeAgentLoop)),
310
- ...spread("beforeTurnTransact", chain((feature) => feature.beforeTurnTransact)),
311
- ...spread("beforeTurn", collect((feature) => feature.beforeTurn)),
312
- ...spread("beforeInferenceTransact", chain((feature) => feature.beforeInferenceTransact)),
313
- ...spread("beforeInference", fanOut((feature) => feature.beforeInference)),
314
- ...spread("afterInferenceTransact", chain((feature) => feature.afterInferenceTransact)),
315
- ...spread("afterInference", fanOut((feature) => feature.afterInference)),
316
- ...spread("afterTurnTransact", chain((feature) => feature.afterTurnTransact)),
317
- ...spread("afterTurn", collect((feature) => feature.afterTurn)),
318
- ...spread("afterAgentLoopTransact", chain((feature) => feature.afterAgentLoopTransact)),
319
- ...spread("afterAgentLoop", collect((feature) => feature.afterAgentLoop)),
320
- ...spread("afterAgentSettledTransact", chain((feature) => feature.afterAgentSettledTransact)),
321
- ...spread("afterAgentSettled", fanOut((feature) => feature.afterAgentSettled)),
309
+ ...spread("messageAcceptedTransact", chain((module) => module.messageAcceptedTransact)),
310
+ ...spread("messageAccepted", fanOut((module) => module.messageAccepted)),
311
+ ...spread("permissionModeChangedTransact", chain((module) => module.permissionModeChangedTransact)),
312
+ ...spread("permissionModeChanged", fanOut((module) => module.permissionModeChanged)),
313
+ ...spread("metadataChangedTransact", chain((module) => module.metadataChangedTransact)),
314
+ ...spread("metadataChanged", fanOut((module) => module.metadataChanged)),
315
+ ...spread("beforeAgentLoopTransact", chain((module) => module.beforeAgentLoopTransact)),
316
+ ...spread("beforeAgentLoop", fanOut((module) => module.beforeAgentLoop)),
317
+ ...spread("beforeTurnTransact", chain((module) => module.beforeTurnTransact)),
318
+ ...spread("beforeTurn", collect((module) => module.beforeTurn)),
319
+ ...spread("beforeInferenceTransact", chain((module) => module.beforeInferenceTransact)),
320
+ ...spread("beforeInference", fanOut((module) => module.beforeInference)),
321
+ ...spread("afterInferenceTransact", chain((module) => module.afterInferenceTransact)),
322
+ ...spread("afterInference", fanOut((module) => module.afterInference)),
323
+ ...spread("afterTurnTransact", chain((module) => module.afterTurnTransact)),
324
+ ...spread("afterTurn", collect((module) => module.afterTurn)),
325
+ ...spread("afterAgentLoopTransact", chain((module) => module.afterAgentLoopTransact)),
326
+ ...spread("afterAgentLoop", collect((module) => module.afterAgentLoop)),
327
+ ...spread("afterAgentSettledTransact", chain((module) => module.afterAgentSettledTransact)),
328
+ ...spread("afterAgentSettled", fanOut((module) => module.afterAgentSettled)),
322
329
  };
323
330
  }
324
331
  /**
325
- * The context a feature's hooks run on: the agent's context with both key-value stores narrowed
326
- * to the feature's own name, so features never see each other's persisted entries — and neither
332
+ * The context a module's hooks run on: the agent's context with both key-value stores narrowed
333
+ * to the module's own name, so modules never see each other's persisted entries — and neither
327
334
  * does a tool one of them runs.
328
335
  */
329
- function featureCtx(ctx, feature) {
336
+ function moduleCtx(ctx, module) {
330
337
  const kv = agentKV(ctx);
331
338
  const runKV = agentRunKV(ctx);
332
- const scoped = kv === undefined ? ctx : withAgentKV(ctx, kv.scoped("feature", feature.name));
339
+ const scoped = kv === undefined ? ctx : withAgentKV(ctx, kv.scoped("module", module.name));
333
340
  return runKV === undefined
334
341
  ? scoped
335
- : withAgentRunKV(scoped, runKV.scoped("feature", feature.name));
342
+ : withAgentRunKV(scoped, runKV.scoped("module", module.name));
336
343
  }
337
344
  /**
338
- * What a feature's hook is handed alongside the context: the agent it is serving, and its own
345
+ * What a module's hook is handed alongside the context: the agent it is serving, and its own
339
346
  * scope of each of the three stores. The selection comes from the context the agent derived for
340
347
  * this call, so a hook always sees the model, effort, and tier the work is actually running on
341
348
  * rather than the ones the agent was built with.
342
349
  */
343
- function featureScope(ctx, feature, options, sharedKV) {
350
+ function moduleScope(ctx, module, options, sharedKV) {
344
351
  const kv = agentKV(ctx);
345
352
  const runKV = agentRunKV(ctx);
346
- if (kv === undefined || runKV === undefined) {
347
- throw new Error(`The feature "${feature.name}" was called on a context carrying no agent stores.`);
353
+ const database = agentDatabase(ctx);
354
+ if (kv === undefined || runKV === undefined || database === undefined) {
355
+ throw new Error(`The module "${module.name}" was called without its agent storage context.`);
348
356
  }
349
357
  const provider = agentProvider(ctx) ?? options.provider;
350
358
  return {
359
+ database: database,
351
360
  agent: {
352
361
  id: options.id,
362
+ metadata: agentConfig(ctx)?.metadata,
353
363
  provider,
354
364
  providerKind: options.providers.typeOf(provider) ?? undefined,
355
365
  model: agentModel(ctx) ?? options.model,
@@ -357,14 +367,14 @@ function featureScope(ctx, feature, options, sharedKV) {
357
367
  tier: agentServiceTier(ctx) ?? options.serviceTier,
358
368
  permissionMode: agentPermissionMode(ctx),
359
369
  },
360
- kv: kv.scoped("feature", feature.name),
361
- sharedKV: sharedKV.scoped(feature.name),
362
- runKV: runKV.scoped("feature", feature.name),
370
+ kv: kv.scoped("module", module.name),
371
+ sharedKV: sharedKV.scoped(module.name),
372
+ runKV: runKV.scoped("module", module.name),
363
373
  };
364
374
  }
365
375
  /**
366
376
  * One optional entry to spread into the merged hooks: the key when a merged implementation
367
- * exists, and nothing at all when no feature implemented it, so the base keeps its own behavior.
377
+ * exists, and nothing at all when no module implemented it, so the base keeps its own behavior.
368
378
  */
369
379
  function spread(key, value) {
370
380
  return value === undefined ? {} : { [key]: value };
package/dist/Agent.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Agent.js","sourceRoot":"","sources":["../sources/Agent.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,SAAS,GAIZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACH,WAAW,EACX,OAAO,EACP,UAAU,EACV,mBAAmB,EACnB,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,cAAc,GACjB,MAAM,oBAAoB,CAAC;AA0B5B;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,KAAK;IACd,yFAAyF;IAChF,KAAK,CAAY;IAC1B,6FAA6F;IACpF,SAAS,CAAgC;IAElD;;;OAGG;IACH,MAAM,CAAC,KAAK,CAAC,MAAM,CACf,GAAY,EACZ,OAA2B;QAE3B,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;QAC1C,OAAO,IAAI,KAAK,CAAC,MAAM,SAAS,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,QAAQ,CAAC,CAAC;IAClE,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,KAAK,CAAC,IAAI,CACb,GAAY,EACZ,OAA2B;QAE3B,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;QAC1C,OAAO,IAAI,KAAK,CAAC,MAAM,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,QAA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,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC;QACpC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;QACtC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC;KAC7C,CAAC;AACN,CAAC;AAED;;;GAGG;AACH,SAAS,MAAM,CACX,GAAQ,EACR,KAAwB;IAExB,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAE,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,EAA4B,CAAC;AAClF,CAAC"}
@@ -2,6 +2,8 @@ import type { SessionReasoningEffort, SessionServiceTier, SessionUserMessage } f
2
2
  import { type Context } from "@steve.kite/stdlib";
3
3
  import type { AgentBaseHooks } from "./AgentBaseHooks.js";
4
4
  import type { AgentPersistence } from "./AgentPersistence.js";
5
+ import { type AgentMessageMetadata, type AgentMetadata } from "./AgentMetadata.js";
6
+ import type { AgentMessageAcceptance } from "./AgentMessageAcceptance.js";
5
7
  import { type AgentPermissionMode } from "./AgentPermissionMode.js";
6
8
  import type { AgentBaseState } from "./AgentBaseState.js";
7
9
  import { AgentProviders } from "./AgentProviders.js";
@@ -13,6 +15,10 @@ export type AgentBaseQueueMode = "one-at-a-time" | "all";
13
15
  * though relying on that default is discouraged — prefer sending settings with the message.
14
16
  */
15
17
  export interface AgentBaseMessageOptions {
18
+ /** Stable cuid2 identity for idempotent delivery; generated when omitted. */
19
+ readonly id?: string;
20
+ /** Immutable module-owned metadata that travels with this one message. */
21
+ readonly metadata?: AgentMessageMetadata;
16
22
  /** The registry ID of the provider to switch to. */
17
23
  readonly provider?: string;
18
24
  /** The model to switch to; an incompatible one resets the conversation. */
@@ -31,7 +37,9 @@ export interface AgentBaseMessageOptions {
31
37
  /**
32
38
  * Whether an operation resolves once the agent has taken the request on, or once the agent has
33
39
  * carried it out. Every operation that asks something of an agent accepts this, and every one of
34
- * them defaults to the first: asking is the operation, and waiting is opt-in.
40
+ * most of them default to the first: asking is the operation, and waiting is opt-in. Message
41
+ * acceptance defaults to the durable result except inside the target's own loop, where waiting
42
+ * would deadlock.
35
43
  *
36
44
  * The reason is re-entrancy. An agent does its work in one run loop, and while a hook or a tool
37
45
  * runs, that loop is waiting for it — so code in that position that waits for its own agent waits
@@ -42,8 +50,9 @@ export interface AgentBaseMessageOptions {
42
50
  */
43
51
  export interface AgentBaseAwaitOptions {
44
52
  /**
45
- * Wait for the operation to finish rather than for it to be accepted. Refused from inside the
46
- * agent's own run loop.
53
+ * Wait for the operation to finish rather than for it to be accepted. Message delivery uses
54
+ * this to request the durable created/existing result. Refused from inside the agent's own
55
+ * run loop.
47
56
  */
48
57
  readonly await?: boolean;
49
58
  }
@@ -57,7 +66,7 @@ export interface AgentBaseOptions {
57
66
  readonly provider: string;
58
67
  /** The append-only store the conversation, the queues, and the settings live in. */
59
68
  readonly persistence: AgentPersistence;
60
- /** Observers and correctness hooks the run is assembled from; `Agent` merges features here. */
69
+ /** Observers and correctness hooks the run is assembled from; `Agent` merges modules here. */
61
70
  readonly hooks?: AgentBaseHooks;
62
71
  /** Copied into the agent's own mutable `state`. */
63
72
  readonly initialState?: Partial<AgentBaseState>;
@@ -160,7 +169,7 @@ export interface AgentBaseOptions {
160
169
  * running under rather than being told.
161
170
  *
162
171
  * The loop enforces nothing. It has no idea what any particular tool touches, and a runtime that
163
- * guessed would be wrong about tools it has never seen. Enforcement belongs to the features and
172
+ * guessed would be wrong about tools it has never seen. Enforcement belongs to the modules and
164
173
  * tools that do know; the loop's whole part is to carry the mode, make its changes durable, and
165
174
  * report them.
166
175
  *
@@ -286,19 +295,24 @@ export declare class AgentBase {
286
295
  /**
287
296
  * Queue a user message that injects as soon as the current assistant response and its tool
288
297
  * batch finish; steering always takes precedence over sent messages. Returns once the message
289
- * has been handed to the agent, which never waits for the turn that answers it; with
290
- * `await: true` it returns once the durable write has landed instead, and a failed write both
291
- * rejects and keeps the message out of the conversation entirely.
298
+ * has been handed to the agent and returns its acceptance identity. Outside the target's own
299
+ * loop it waits for the durable created/existing result by default; a failed write rejects and
300
+ * keeps the message out of the conversation entirely.
292
301
  */
293
- steer(ctx: Context, message: SessionUserMessage, options?: AgentBaseMessageOptions & AgentBaseAwaitOptions): Promise<void>;
302
+ steer(ctx: Context, message: SessionUserMessage, options?: AgentBaseMessageOptions & AgentBaseAwaitOptions): Promise<AgentMessageAcceptance>;
294
303
  /**
295
304
  * Queue a user message that waits until the agent would otherwise stop — no tool calls or
296
305
  * steering remain — before injecting. Returns once the message has been handed to the agent,
297
- * which never waits for the turn that answers it; with `await: true` it returns once the
298
- * durable write has landed instead, and a failed write both rejects and keeps the message out
299
- * of the conversation entirely.
306
+ * without waiting for the turn that answers it and returns its acceptance identity. Outside
307
+ * the target's own loop it waits for the durable created/existing result by default; a failed
308
+ * write rejects and keeps the message out of the conversation entirely.
300
309
  */
301
- send(ctx: Context, message: SessionUserMessage, options?: AgentBaseMessageOptions & AgentBaseAwaitOptions): Promise<void>;
310
+ send(ctx: Context, message: SessionUserMessage, options?: AgentBaseMessageOptions & AgentBaseAwaitOptions): Promise<AgentMessageAcceptance>;
311
+ /**
312
+ * Shallow-merge fields into this agent's immutable metadata. The complete AgentConfig and
313
+ * transactional hook writes commit together; observing hooks run only after that commit.
314
+ */
315
+ updateMetadata(ctx: Context, update: AgentMetadata): Promise<void>;
302
316
  /**
303
317
  * Start the loop without a new message: load the durable state and, if a turn was cut off —
304
318
  * queued messages, a dispatched tool batch without results, or an unanswered user or tool
@@ -1 +1 @@
1
- {"version":3,"file":"AgentBase.d.ts","sourceRoot":"","sources":["../sources/AgentBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAMR,sBAAsB,EACtB,kBAAkB,EAKlB,kBAAkB,EACrB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAMH,KAAK,OAAO,EACf,MAAM,oBAAoB,CAAC;AAgB5B,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