@slopus/happy-agent-base 0.0.6 → 0.0.8

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