experimental-ash 0.2.0-alpha.21 → 0.2.0-alpha.23

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 (199) hide show
  1. package/dist/src/channel/slack-channel.d.ts +14 -7
  2. package/dist/src/channel/slack-channel.d.ts.map +1 -1
  3. package/dist/src/channel/slack-channel.js +21 -11
  4. package/dist/src/channel/slack-channel.js.map +1 -1
  5. package/dist/src/channel/types.d.ts +14 -14
  6. package/dist/src/channel/types.d.ts.map +1 -1
  7. package/dist/src/channel/types.js +6 -0
  8. package/dist/src/channel/types.js.map +1 -1
  9. package/dist/src/context/accessors.d.ts +24 -10
  10. package/dist/src/context/accessors.d.ts.map +1 -1
  11. package/dist/src/context/accessors.js +34 -16
  12. package/dist/src/context/accessors.js.map +1 -1
  13. package/dist/src/context/container.d.ts +43 -20
  14. package/dist/src/context/container.d.ts.map +1 -1
  15. package/dist/src/context/container.js +54 -22
  16. package/dist/src/context/container.js.map +1 -1
  17. package/dist/src/context/key.d.ts +68 -39
  18. package/dist/src/context/key.d.ts.map +1 -1
  19. package/dist/src/context/key.js +49 -62
  20. package/dist/src/context/key.js.map +1 -1
  21. package/dist/src/context/keys.d.ts +6 -6
  22. package/dist/src/context/keys.d.ts.map +1 -1
  23. package/dist/src/context/keys.js +7 -9
  24. package/dist/src/context/keys.js.map +1 -1
  25. package/dist/src/context/node.d.ts +2 -2
  26. package/dist/src/context/node.d.ts.map +1 -1
  27. package/dist/src/context/node.js +1 -1
  28. package/dist/src/context/node.js.map +1 -1
  29. package/dist/src/context/provider.d.ts +24 -11
  30. package/dist/src/context/provider.d.ts.map +1 -1
  31. package/dist/src/context/providers/connection.d.ts +2 -2
  32. package/dist/src/context/providers/connection.d.ts.map +1 -1
  33. package/dist/src/context/providers/connection.js +1 -1
  34. package/dist/src/context/providers/connection.js.map +1 -1
  35. package/dist/src/context/providers/sandbox.d.ts +2 -2
  36. package/dist/src/context/providers/sandbox.d.ts.map +1 -1
  37. package/dist/src/context/providers/sandbox.js +2 -2
  38. package/dist/src/context/providers/sandbox.js.map +1 -1
  39. package/dist/src/context/providers/session.d.ts +2 -2
  40. package/dist/src/context/providers/session.d.ts.map +1 -1
  41. package/dist/src/context/providers/session.js +4 -4
  42. package/dist/src/context/providers/session.js.map +1 -1
  43. package/dist/src/context/providers/skill.d.ts +2 -2
  44. package/dist/src/context/providers/skill.d.ts.map +1 -1
  45. package/dist/src/context/providers/skill.js +2 -2
  46. package/dist/src/context/providers/skill.js.map +1 -1
  47. package/dist/src/context/run-step.d.ts +9 -8
  48. package/dist/src/context/run-step.d.ts.map +1 -1
  49. package/dist/src/context/run-step.js +32 -22
  50. package/dist/src/context/run-step.js.map +1 -1
  51. package/dist/src/context/seed-keys.d.ts +7 -7
  52. package/dist/src/context/seed-keys.d.ts.map +1 -1
  53. package/dist/src/context/seed-keys.js +7 -19
  54. package/dist/src/context/seed-keys.js.map +1 -1
  55. package/dist/src/context/serialize.d.ts +10 -9
  56. package/dist/src/context/serialize.d.ts.map +1 -1
  57. package/dist/src/context/serialize.js +18 -30
  58. package/dist/src/context/serialize.js.map +1 -1
  59. package/dist/src/execution/continuous-entry.d.ts +8 -6
  60. package/dist/src/execution/continuous-entry.d.ts.map +1 -1
  61. package/dist/src/execution/continuous-entry.js +27 -25
  62. package/dist/src/execution/continuous-entry.js.map +1 -1
  63. package/dist/src/execution/continuous-runtime.d.ts.map +1 -1
  64. package/dist/src/execution/continuous-runtime.js +1 -4
  65. package/dist/src/execution/continuous-runtime.js.map +1 -1
  66. package/dist/src/execution/node-step.js +1 -0
  67. package/dist/src/execution/node-step.js.map +1 -1
  68. package/dist/src/execution/runtime-context.d.ts +3 -3
  69. package/dist/src/execution/runtime-context.d.ts.map +1 -1
  70. package/dist/src/execution/runtime-context.js +3 -3
  71. package/dist/src/execution/runtime-context.js.map +1 -1
  72. package/dist/src/execution/sandboxes/read-file-tool.js +2 -2
  73. package/dist/src/execution/sandboxes/read-file-tool.js.map +1 -1
  74. package/dist/src/execution/sandboxes/require-sandbox.js +2 -2
  75. package/dist/src/execution/sandboxes/require-sandbox.js.map +1 -1
  76. package/dist/src/execution/sandboxes/write-file-tool.d.ts.map +1 -1
  77. package/dist/src/execution/sandboxes/write-file-tool.js +3 -3
  78. package/dist/src/execution/sandboxes/write-file-tool.js.map +1 -1
  79. package/dist/src/execution/subagent-tool.js +6 -6
  80. package/dist/src/execution/subagent-tool.js.map +1 -1
  81. package/dist/src/execution/tool-compaction.d.ts +3 -1
  82. package/dist/src/execution/tool-compaction.d.ts.map +1 -1
  83. package/dist/src/execution/tool-compaction.js +19 -8
  84. package/dist/src/execution/tool-compaction.js.map +1 -1
  85. package/dist/src/execution/types.d.ts +1 -0
  86. package/dist/src/execution/types.d.ts.map +1 -1
  87. package/dist/src/execution/workflow-entry.d.ts +5 -4
  88. package/dist/src/execution/workflow-entry.d.ts.map +1 -1
  89. package/dist/src/execution/workflow-entry.js +8 -3
  90. package/dist/src/execution/workflow-entry.js.map +1 -1
  91. package/dist/src/execution/workflow-runtime.d.ts.map +1 -1
  92. package/dist/src/execution/workflow-runtime.js +2 -3
  93. package/dist/src/execution/workflow-runtime.js.map +1 -1
  94. package/dist/src/execution/workflow-steps.d.ts +2 -2
  95. package/dist/src/execution/workflow-steps.d.ts.map +1 -1
  96. package/dist/src/execution/workflow-steps.js +42 -17
  97. package/dist/src/execution/workflow-steps.js.map +1 -1
  98. package/dist/src/harness/emission.d.ts +1 -1
  99. package/dist/src/harness/emission.js +3 -3
  100. package/dist/src/harness/emission.js.map +1 -1
  101. package/dist/src/harness/execute-tool.d.ts +1 -0
  102. package/dist/src/harness/execute-tool.d.ts.map +1 -1
  103. package/dist/src/harness/execute-tool.js.map +1 -1
  104. package/dist/src/harness/input-requests.d.ts +2 -22
  105. package/dist/src/harness/input-requests.d.ts.map +1 -1
  106. package/dist/src/harness/input-requests.js +47 -41
  107. package/dist/src/harness/input-requests.js.map +1 -1
  108. package/dist/src/harness/tool-loop.d.ts.map +1 -1
  109. package/dist/src/harness/tool-loop.js +19 -1
  110. package/dist/src/harness/tool-loop.js.map +1 -1
  111. package/dist/src/harness/tools.js +5 -1
  112. package/dist/src/harness/tools.js.map +1 -1
  113. package/dist/src/harness/types.d.ts +3 -15
  114. package/dist/src/harness/types.d.ts.map +1 -1
  115. package/dist/src/harness/types.js +1 -6
  116. package/dist/src/harness/types.js.map +1 -1
  117. package/dist/src/internal/application/package.js +1 -1
  118. package/dist/src/internal/authored-definition/connection.d.ts.map +1 -1
  119. package/dist/src/internal/authored-definition/connection.js +14 -1
  120. package/dist/src/internal/authored-definition/connection.js.map +1 -1
  121. package/dist/src/internal/nitro/routes/runtime-stack.d.ts +3 -3
  122. package/dist/src/internal/nitro/routes/runtime-stack.js +3 -3
  123. package/dist/src/public/channels/slack/index.d.ts +0 -5
  124. package/dist/src/public/channels/slack/index.d.ts.map +1 -1
  125. package/dist/src/public/channels/slack/index.js.map +1 -1
  126. package/dist/src/public/context/index.d.ts +17 -0
  127. package/dist/src/public/context/index.d.ts.map +1 -0
  128. package/dist/src/public/context/index.js +15 -0
  129. package/dist/src/public/context/index.js.map +1 -0
  130. package/dist/src/public/definitions/connections/mcp.d.ts +13 -0
  131. package/dist/src/public/definitions/connections/mcp.d.ts.map +1 -1
  132. package/dist/src/public/definitions/connections/mcp.js.map +1 -1
  133. package/dist/src/public/definitions/tool.d.ts +10 -6
  134. package/dist/src/public/definitions/tool.d.ts.map +1 -1
  135. package/dist/src/public/definitions/tool.js.map +1 -1
  136. package/dist/src/public/index.d.ts +1 -6
  137. package/dist/src/public/index.d.ts.map +1 -1
  138. package/dist/src/public/index.js +0 -3
  139. package/dist/src/public/index.js.map +1 -1
  140. package/dist/src/public/sandboxes/index.d.ts +1 -0
  141. package/dist/src/public/sandboxes/index.d.ts.map +1 -1
  142. package/dist/src/public/sandboxes/index.js +1 -0
  143. package/dist/src/public/sandboxes/index.js.map +1 -1
  144. package/dist/src/public/skills/index.d.ts +24 -0
  145. package/dist/src/public/skills/index.d.ts.map +1 -0
  146. package/dist/src/public/skills/index.js +23 -0
  147. package/dist/src/public/skills/index.js.map +1 -0
  148. package/dist/src/public/tools/defaults.d.ts +4 -4
  149. package/dist/src/public/tools/defaults.js +4 -4
  150. package/dist/src/runtime/connections/registry.d.ts +6 -0
  151. package/dist/src/runtime/connections/registry.d.ts.map +1 -1
  152. package/dist/src/runtime/connections/registry.js +8 -0
  153. package/dist/src/runtime/connections/registry.js.map +1 -1
  154. package/dist/src/runtime/connections/types.d.ts +2 -0
  155. package/dist/src/runtime/connections/types.d.ts.map +1 -1
  156. package/dist/src/runtime/framework-tools/connection-execute.d.ts.map +1 -1
  157. package/dist/src/runtime/framework-tools/connection-execute.js +17 -6
  158. package/dist/src/runtime/framework-tools/connection-execute.js.map +1 -1
  159. package/dist/src/runtime/framework-tools/connection-search.d.ts +2 -2
  160. package/dist/src/runtime/framework-tools/connection-search.d.ts.map +1 -1
  161. package/dist/src/runtime/framework-tools/connection-search.js +4 -4
  162. package/dist/src/runtime/framework-tools/connection-search.js.map +1 -1
  163. package/dist/src/runtime/framework-tools/file-state.d.ts +5 -7
  164. package/dist/src/runtime/framework-tools/file-state.d.ts.map +1 -1
  165. package/dist/src/runtime/framework-tools/file-state.js +4 -6
  166. package/dist/src/runtime/framework-tools/file-state.js.map +1 -1
  167. package/dist/src/runtime/framework-tools/skill.js +3 -3
  168. package/dist/src/runtime/framework-tools/skill.js.map +1 -1
  169. package/dist/src/runtime/framework-tools/todo.js +3 -3
  170. package/dist/src/runtime/framework-tools/todo.js.map +1 -1
  171. package/dist/src/runtime/prompt/connections.d.ts.map +1 -1
  172. package/dist/src/runtime/prompt/connections.js +3 -2
  173. package/dist/src/runtime/prompt/connections.js.map +1 -1
  174. package/dist/src/runtime/resolve-agent-graph.js +3 -2
  175. package/dist/src/runtime/resolve-agent-graph.js.map +1 -1
  176. package/dist/src/runtime/resolve-connection.d.ts.map +1 -1
  177. package/dist/src/runtime/resolve-connection.js +3 -0
  178. package/dist/src/runtime/resolve-connection.js.map +1 -1
  179. package/dist/src/runtime/sessions/auth.d.ts +1 -1
  180. package/dist/src/runtime/types.d.ts +13 -0
  181. package/dist/src/runtime/types.d.ts.map +1 -1
  182. package/docs/internals/context.md +257 -81
  183. package/docs/public/README.md +17 -19
  184. package/docs/public/channels/README.md +9 -3
  185. package/docs/public/sandboxes.md +1 -1
  186. package/docs/public/session-context.md +97 -51
  187. package/docs/public/skills.md +2 -2
  188. package/docs/public/tools.md +26 -18
  189. package/docs/public/typescript-api.md +34 -29
  190. package/package.json +11 -1
  191. package/dist/src/context/durable-context.d.ts +0 -18
  192. package/dist/src/context/durable-context.d.ts.map +0 -1
  193. package/dist/src/context/durable-context.js +0 -49
  194. package/dist/src/context/durable-context.js.map +0 -1
  195. package/dist/src/execution/step-context.d.ts +0 -27
  196. package/dist/src/execution/step-context.d.ts.map +0 -1
  197. package/dist/src/execution/step-context.js +0 -54
  198. package/dist/src/execution/step-context.js.map +0 -1
  199. package/docs/public/migration-guide.md +0 -71
@@ -1,39 +1,63 @@
1
1
  import { AsyncLocalStorage } from "node:async_hooks";
2
+ import { resolveKey } from "./key.js";
2
3
  /**
3
4
  * Default mutable implementation of {@link AshContext}.
4
5
  */
5
- export class AshContextImpl {
6
- _store = new Map();
6
+ export class ContextContainer {
7
+ _durableValues = new Map();
8
+ _virtualValues = new Map();
7
9
  get(key) {
8
- const entry = this._store.get(key.name);
9
- if (entry === undefined) {
10
- throw new Error(`Context key "${key.name}" is not set.`);
10
+ if (this._virtualValues.has(key.name)) {
11
+ return this._virtualValues.get(key.name);
11
12
  }
12
- return entry.value;
13
+ return this._durableValues.get(key.name);
13
14
  }
14
- tryGet(key) {
15
- return this._store.get(key.name)?.value;
15
+ require(key) {
16
+ if (!this.has(key)) {
17
+ throw new Error(`Context key "${key.name}" is not set.`);
18
+ }
19
+ return this.get(key);
16
20
  }
17
21
  has(key) {
18
- return this._store.has(key.name);
22
+ return this._virtualValues.has(key.name) || this._durableValues.has(key.name);
19
23
  }
20
- set(key, valueOrFactory) {
21
- const value = typeof valueOrFactory === "function"
22
- ? valueOrFactory(this.tryGet(key))
23
- : valueOrFactory;
24
- this._store.set(key.name, { key: key, value });
24
+ set(key, valueOrUpdater) {
25
+ const value = typeof valueOrUpdater === "function"
26
+ ? valueOrUpdater(this.get(key))
27
+ : valueOrUpdater;
28
+ this._durableValues.set(key.name, value);
25
29
  return value;
26
30
  }
27
- ensure(key, factory) {
28
- const entry = this._store.get(key.name);
29
- if (entry !== undefined) {
30
- return entry.value;
31
+ ensure(key, create) {
32
+ if (this.has(key)) {
33
+ return this.require(key);
31
34
  }
32
- return this.set(key, factory());
35
+ return this.set(key, create());
36
+ }
37
+ /**
38
+ * Clears all step-local provider values from the context.
39
+ *
40
+ * The runtime calls this before rebuilding context providers for a new
41
+ * step.
42
+ */
43
+ clearVirtualContext() {
44
+ this._virtualValues.clear();
45
+ }
46
+ /**
47
+ * Stores a step-local provider value for one key.
48
+ *
49
+ * Virtual values shadow durable values for the lifetime of the current
50
+ * step and are excluded from serialization.
51
+ */
52
+ setVirtualContext(key, value) {
53
+ this._virtualValues.set(key.name, value);
33
54
  }
34
55
  *entries() {
35
- for (const { key, value } of this._store.values()) {
36
- yield [key, value];
56
+ for (const [name, value] of this._durableValues) {
57
+ const key = resolveKey(name);
58
+ if (key !== undefined) {
59
+ yield [key, value];
60
+ }
37
61
  }
38
62
  }
39
63
  }
@@ -41,7 +65,7 @@ export const contextStorage = new AsyncLocalStorage();
41
65
  /**
42
66
  * Returns the active context, throwing when called outside a managed scope.
43
67
  */
44
- export function requireContext() {
68
+ export function loadContext() {
45
69
  const ctx = contextStorage.getStore();
46
70
  if (ctx === undefined) {
47
71
  throw new Error("No active Ash context. " +
@@ -49,4 +73,12 @@ export function requireContext() {
49
73
  }
50
74
  return ctx;
51
75
  }
76
+ /**
77
+ * Narrows a {@link ContextContainer} to the {@link ContextAccessor}
78
+ * interface. Used by runtime entry points to pass the context to channel
79
+ * `onDeliver` callbacks without exposing implementation details.
80
+ */
81
+ export function toContextAccessor(ctx) {
82
+ return ctx;
83
+ }
52
84
  //# sourceMappingURL=container.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"container.js","sourceRoot":"","sources":["../../../src/context/container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAoBrD;;GAEG;AACH,MAAM,OAAO,cAAc;IACR,MAAM,GAAG,IAAI,GAAG,EAA6D,CAAC;IAE/F,GAAG,CAAI,GAAuB;QAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,gBAAgB,GAAG,CAAC,IAAI,eAAe,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,KAAK,CAAC,KAAU,CAAC;IAC1B,CAAC;IAED,MAAM,CAAI,GAAuB;QAC/B,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,KAAsB,CAAC;IAC3D,CAAC;IAED,GAAG,CAAI,GAAuB;QAC5B,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,GAAG,CAAI,GAAuB,EAAE,cAA6C;QAC3E,MAAM,KAAK,GACT,OAAO,cAAc,KAAK,UAAU;YAClC,CAAC,CAAE,cAA0C,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAC/D,CAAC,CAAC,cAAc,CAAC;QACrB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,GAA+B,EAAE,KAAK,EAAE,CAAC,CAAC;QAC3E,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,CAAI,GAAu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iBAAiB,CAAI,GAAkB,EAAE,KAAQ;QAC/C,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC3C,CAAC;IAED,CAAC,OAAO;QACN,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YAChD,MAAM,GAAG,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;YAC7B,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;gBACtB,MAAM,CAAC,GAAG,EAAE,KAAK,CAAU,CAAC;YAC9B,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,iBAAiB,EAAc,CAAC;AAElE;;GAEG;AACH,MAAM,UAAU,WAAW;IACzB,MAAM,GAAG,GAAG,cAAc,CAAC,QAAQ,EAAE,CAAC;IACtC,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CACb,yBAAyB;YACvB,+FAA+F,CAClG,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,GAAqB;IACrD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -1,60 +1,89 @@
1
- export interface ContextDecodeContext {
2
- get<T>(key: ContextStoreKey<T>): T;
3
- tryGet<T>(key: ContextStoreKey<T>): T | undefined;
1
+ /**
2
+ * Read-only view over the active context.
3
+ *
4
+ * Used by context providers and codec deserialization to read values
5
+ * without mutating durable context.
6
+ */
7
+ export interface ContextReader {
8
+ get<T>(key: ContextKey<T>): T | undefined;
9
+ require<T>(key: ContextKey<T>): T;
10
+ has<T>(key: ContextKey<T>): boolean;
11
+ }
12
+ /**
13
+ * Read/write view over the active context.
14
+ *
15
+ * Extends {@link ContextReader} with durable write operations. This is
16
+ * the narrow contract shared by {@link AshContext} and the channel-facing
17
+ * `ContextAccessor`.
18
+ */
19
+ export interface ContextAccessor extends ContextReader {
20
+ set<T>(key: ContextKey<T>, updater: T | ((current: T | undefined) => T)): T;
21
+ ensure<T>(key: ContextKey<T>, create: () => T): T;
4
22
  }
5
23
  /**
6
24
  * Serialization hooks for one context key.
7
25
  *
8
- * `deserialize` receives the already-hydrated context so codecs can depend on
9
- * earlier runtime values such as the compiled runtime bundle.
26
+ * `deserialize` receives the already-hydrated durable context so codecs can
27
+ * depend on earlier durable keys such as the compiled runtime bundle.
10
28
  */
11
29
  export interface ContextKeyCodec<T> {
12
30
  serialize(value: T): unknown;
13
- deserialize(data: unknown, ctx: ContextDecodeContext): T | Promise<T>;
31
+ deserialize(data: unknown, ctx: ContextReader): T | Promise<T>;
14
32
  }
15
33
  export interface ContextKeyOptions<T> {
16
34
  readonly codec?: ContextKeyCodec<T>;
17
35
  }
18
- interface RuntimeContextKeyOptions<T> extends ContextKeyOptions<T> {
19
- readonly serializable?: boolean;
20
- }
21
36
  /**
22
- * Public durable context key.
37
+ * Typed key that identifies a named context slot.
38
+ *
39
+ * `ContextKey` is the single authored lookup identity for Ash context.
40
+ * Durable values are written explicitly through `set()` / `ensure()`.
41
+ * Virtual values may also be derived each step by a `ContextProvider` and
42
+ * read through the same key.
43
+ *
44
+ * When a key stores a durable value that is not already JSON-safe, declare a
45
+ * `codec` so the runtime can serialize and deserialize that durable value at
46
+ * step boundaries.
47
+ *
48
+ * @example Declare a durable context key and use it from a tool
49
+ * ```ts
50
+ * import { ContextKey, getContext, setContext } from "experimental-ash/context";
51
+ * import { defineTool } from "experimental-ash/tools";
52
+ * import { z } from "zod";
53
+ *
54
+ * interface NoteListContext {
55
+ * readonly notes: readonly string[];
56
+ * }
57
+ *
58
+ * const NoteListKey = new ContextKey<NoteListContext>("notes");
23
59
  *
24
- * Values stored under a `ContextKey` are session-durable. The runtime
25
- * hydrates them from `session.context` before each step and commits them back
26
- * after the step completes.
60
+ * export default defineTool({
61
+ * description: "Append a note, or read the running list.",
62
+ * inputSchema: z.object({ note: z.string().optional() }),
63
+ * async execute({ note }) {
64
+ * if (note) {
65
+ * setContext(NoteListKey, (current) => ({
66
+ * notes: [...(current?.notes ?? []), note],
67
+ * }));
68
+ * }
69
+ *
70
+ * return getContext(NoteListKey);
71
+ * },
72
+ * });
73
+ * ```
74
+ *
75
+ * Every key self-registers in a global registry so the serialization layer
76
+ * can resolve string names back to typed keys without an explicit list.
77
+ * Construct each key exactly once at module scope; constructing the same
78
+ * key name twice is a programmer error.
27
79
  */
28
80
  export declare class ContextKey<T> {
29
- readonly codec?: ContextKeyCodec<T>;
30
81
  readonly name: string;
31
- constructor(name: string, options?: ContextKeyOptions<T>);
32
- }
33
- /**
34
- * Private runtime-only key used for seed values, providers, and other
35
- * framework internals that must not be persisted on `session.context`.
36
- */
37
- export declare class RuntimeContextKey<T> {
38
82
  readonly codec?: ContextKeyCodec<T>;
39
- readonly name: string;
40
- readonly serializable: boolean;
41
- constructor(name: string, options?: RuntimeContextKeyOptions<T>);
83
+ constructor(name: string, options?: ContextKeyOptions<T>);
42
84
  }
43
- export type ContextStoreKey<T> = ContextKey<T> | RuntimeContextKey<T>;
44
- export declare function isDurableContextKey(key: ContextStoreKey<unknown>): key is ContextKey<unknown>;
45
- export declare function isRuntimeContextKey(key: ContextStoreKey<unknown>): key is RuntimeContextKey<unknown>;
46
- /**
47
- * Looks up one registered durable key by name.
48
- */
49
- export declare function resolveContextKey(name: string): ContextKey<unknown> | undefined;
50
- /**
51
- * Looks up one registered runtime key by name.
52
- */
53
- export declare function resolveRuntimeContextKey(name: string): RuntimeContextKey<unknown> | undefined;
54
85
  /**
55
- * Returns all registered runtime keys that participate in runtime-seed
56
- * serialization across durable workflow boundaries.
86
+ * Looks up a registered key by name. Returns `undefined` for unknown names.
57
87
  */
58
- export declare function getSerializableRuntimeContextKeys(): Iterable<RuntimeContextKey<unknown>>;
59
- export {};
88
+ export declare function resolveKey(name: string): ContextKey<unknown> | undefined;
60
89
  //# sourceMapp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G,CAAC,CAAC,OAAO,EAAE,CAAC,GAAG,SAAS,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;IAC5E,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;CACnD;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,SAAS,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC;IAC7B,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,aAAa,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CAChE;AAED,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,QAAQ,CAAC,KAAK,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;CACrC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,qBAAa,UAAU,CAAC,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;gBAExB,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,iBAAiB,CAAC,CAAC,CAAM;CAK7D;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,SAAS,CAExE"}
@@ -1,79 +1,66 @@
1
1
  /**
2
- * Global registries mapping key names to instances.
3
- *
4
- * Durable context keys are public/authored keys persisted on `session.context`.
5
- * Runtime context keys are private framework keys used for seed values,
6
- * providers, and runtime-only bookkeeping inside one step.
2
+ * Global registry mapping key names to instances. Populated automatically
3
+ * by the {@link ContextKey} constructor so `deserializeContext` can resolve
4
+ * string names back to typed keys without an explicit list.
7
5
  */
8
- const durableKeyRegistry = new Map();
9
- const runtimeKeyRegistry = new Map();
10
- const serializableRuntimeKeyRegistry = new Map();
11
- const registeredKeyNames = new Set();
12
- function registerKeyName(name) {
13
- if (registeredKeyNames.has(name)) {
14
- throw new Error(`Context key "${name}" was registered more than once.`);
15
- }
16
- registeredKeyNames.add(name);
17
- }
6
+ const keyRegistry = new Map();
18
7
  /**
19
- * Public durable context key.
8
+ * Typed key that identifies a named context slot.
9
+ *
10
+ * `ContextKey` is the single authored lookup identity for Ash context.
11
+ * Durable values are written explicitly through `set()` / `ensure()`.
12
+ * Virtual values may also be derived each step by a `ContextProvider` and
13
+ * read through the same key.
14
+ *
15
+ * When a key stores a durable value that is not already JSON-safe, declare a
16
+ * `codec` so the runtime can serialize and deserialize that durable value at
17
+ * step boundaries.
18
+ *
19
+ * @example Declare a durable context key and use it from a tool
20
+ * ```ts
21
+ * import { ContextKey, getContext, setContext } from "experimental-ash/context";
22
+ * import { defineTool } from "experimental-ash/tools";
23
+ * import { z } from "zod";
24
+ *
25
+ * interface NoteListContext {
26
+ * readonly notes: readonly string[];
27
+ * }
20
28
  *
21
- * Values stored under a `ContextKey` are session-durable. The runtime
22
- * hydrates them from `session.context` before each step and commits them back
23
- * after the step completes.
29
+ * const NoteListKey = new ContextKey<NoteListContext>("notes");
30
+ *
31
+ * export default defineTool({
32
+ * description: "Append a note, or read the running list.",
33
+ * inputSchema: z.object({ note: z.string().optional() }),
34
+ * async execute({ note }) {
35
+ * if (note) {
36
+ * setContext(NoteListKey, (current) => ({
37
+ * notes: [...(current?.notes ?? []), note],
38
+ * }));
39
+ * }
40
+ *
41
+ * return getContext(NoteListKey);
42
+ * },
43
+ * });
44
+ * ```
45
+ *
46
+ * Every key self-registers in a global registry so the serialization layer
47
+ * can resolve string names back to typed keys without an explicit list.
48
+ * Construct each key exactly once at module scope; constructing the same
49
+ * key name twice is a programmer error.
24
50
  */
25
51
  export class ContextKey {
26
- codec;
27
52
  name;
28
- constructor(name, options = {}) {
29
- registerKeyName(name);
30
- this.name = name;
31
- this.codec = options.codec;
32
- durableKeyRegistry.set(name, this);
33
- }
34
- }
35
- /**
36
- * Private runtime-only key used for seed values, providers, and other
37
- * framework internals that must not be persisted on `session.context`.
38
- */
39
- export class RuntimeContextKey {
40
53
  codec;
41
- name;
42
- serializable;
43
54
  constructor(name, options = {}) {
44
- registerKeyName(name);
45
55
  this.name = name;
46
56
  this.codec = options.codec;
47
- this.serializable = options.serializable ?? false;
48
- runtimeKeyRegistry.set(name, this);
49
- if (this.serializable) {
50
- serializableRuntimeKeyRegistry.set(name, this);
51
- }
57
+ keyRegistry.set(name, this);
52
58
  }
53
59
  }
54
- export function isDurableContextKey(key) {
55
- return key instanceof ContextKey;
56
- }
57
- export function isRuntimeContextKey(key) {
58
- return key instanceof RuntimeContextKey;
59
- }
60
- /**
61
- * Looks up one registered durable key by name.
62
- */
63
- export function resolveContextKey(name) {
64
- return durableKeyRegistry.get(name);
65
- }
66
- /**
67
- * Looks up one registered runtime key by name.
68
- */
69
- export function resolveRuntimeContextKey(name) {
70
- return runtimeKeyRegistry.get(name);
71
- }
72
60
  /**
73
- * Returns all registered runtime keys that participate in runtime-seed
74
- * serialization across durable workflow boundaries.
61
+ * Looks up a registered key by name. Returns `undefined` for unknown names.
75
62
  */
76
- export function getSerializableRuntimeContextKeys() {
77
- return serializableRuntimeKeyRegistry.values();
63
+ export function resolveKey(name) {
64
+ return keyRegistry.get(name);
78
65
  }
79
66
  //# sourceMappingURL=key.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"key.js","sourceRoot":"","sources":["../../../src/context/key.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAA+B,CAAC;AAClE,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAsC,CAAC;AACzE,MAAM,8BAA8B,GAAG,IAAI,GAAG,EAAsC,CAAC;AACrF,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAU,CAAC;AA0B7C,SAAS,eAAe,CAAC,IAAY;IACnC,IAAI,kBAAkB,CAAC,GA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ACH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,OAAO,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACtC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,wBAAwB,CAAC,IAAY;IACnD,OAAO,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACtC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iCAAiC;IAC/C,OAAO,8BAA8B,CAAC,MAAM,EAAE,CAAC;AACjD,CAAC"}
1
+ {"version":3,"file":"key.js","sourceRoot":"","sources":["../../../src/context/key.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,GAAG,IAAI,GAAG,EAA+B,CAAC;AAyC3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,MAAM,OAAO,UAAU;IACZ,IAAI,CAAS;IACb,KAAK,CAAsB;IAEpC,YAAY,IAAY,EAAE,UAAgC,EAAE;QAC1D,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC3B,WAAW,CAAC,GAAG,CAAC,IAAI,EAAE,IAA2B,CAAC,CAAC;IACrD,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC"}
@@ -2,7 +2,7 @@ import { type Channel, type SessionAuthContext, type SessionParent, type Session
2
2
  import type { SandboxAccess } from "../execution/sandboxes/types.js";
3
3
  import type { SkillAccess } from "../execution/skills/types.js";
4
4
  import { getCompiledRuntimeAgentBundle } from "../runtime/sessions/compiled-agent-cache.js";
5
- import { RuntimeContextKey } from "./key.js";
5
+ import { ContextKey } from "./key.js";
6
6
  export type { SessionAuthContext, SessionParent, SessionTurn } from "../channel/types.js";
7
7
  export { AuthKey, ContinuationTokenKey, InitiatorAuthKey, ModeKey, ParentSessionKey, SessionIdKey, } from "./seed-keys.js";
8
8
  /**
@@ -25,14 +25,14 @@ export interface Session {
25
25
  readonly sessionId: string;
26
26
  readonly turn: SessionTurn;
27
27
  }
28
- export declare const ChannelKey: RuntimeContextKey<Channel>;
28
+ export declare const ChannelKey: ContextKey<Channel>;
29
29
  /**
30
30
  * Bundle returned by the compiled-agent cache. Carries the resolved agent
31
31
  * graph, registries, and the active node's turn agent.
32
32
  */
33
33
  export type CompiledBundle = Awaited<ReturnType<typeof getCompiledRuntimeAgentBundle>>;
34
- export declare const BundleKey: RuntimeContextKey<import("../runtime/sessions/compiled-agent-cache.js").CompiledRuntimeAgentBundle>;
35
- export declare const SessionKey: RuntimeContextKey<Session>;
36
- export declare const SandboxKey: RuntimeContextKey<SandboxAccess>;
37
- export declare const SkillKey: RuntimeContextKey<SkillAccess>;
34
+ export declare const BundleKey: ContextKey<import("../runtime/sessions/compiled-agent-cache.js").CompiledRuntimeAgentBundle>;
35
+ export declare const SessionKey: ContextKey<Session>;
36
+ export declare const SandboxKey: ContextKey<SandboxAccess>;
37
+ export declare const SkillKey: ContextKey<SkillAccess>;
38
38
  //# sourceMappingURL=keys.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../../src/context/keys.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EAGZ,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,WAAW,EACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAGhE,OAAO,EAAE,6BAA6B,EAAE,MAAM,6CAA6C,CAAC;AAC5F,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,YAAY,EAAE,kBAAkB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,qB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EAAE,kBAAkB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAE1F,OAAO,EACL,OAAO,EACP,oBAAoB,EACpB,gBAAgB,EAChB,OAAO,EACP,gBAAgB,EAChB,YAAY,GACb,MAAM,gBAAgB,CAAC;AAMxB;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAC5C,QAAQ,CAAC,SAAS,EAAE,kBAAkB,GAAG,IAAI,CAAC;CAC/C;AAED;;;GAGG;AACH,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;CAC5B;AAWD,eAAO,MAAM,UAAU,qBAoBrB,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,6BAA6B,CAAC,CAAC,CAAC;AAOvF,eAAO,MAAM,SAAS,8FAcpB,CAAC;AAMH,eAAO,MAAM,UAAU,qBAAyC,CAAC;AACjE,eAAO,MAAM,UAAU,2BAA+C,CAAC;AACvE,eAAO,MAAM,QAAQ,yBAA2C,CAAC"}
@@ -1,10 +1,10 @@
1
1
  import { getChannelClassKind, } from "../channel/types.js";
2
2
  import { deserializeRuntimeChannel } from "../runtime/channels/registry.js";
3
3
  import { getCompiledRuntimeAgentBundle } from "../runtime/sessions/compiled-agent-cache.js";
4
- import { RuntimeContextKey } from "./key.js";
4
+ import { ContextKey } from "./key.js";
5
5
  // Re-export seed keys so existing consumers of `context/keys` keep working.
6
6
  export { AuthKey, ContinuationTokenKey, InitiatorAuthKey, ModeKey, ParentSessionKey, SessionIdKey, } from "./seed-keys.js";
7
- export const ChannelKey = new RuntimeContextKey("ash.channel", {
7
+ export const ChannelKey = new ContextKey("ash.channel", {
8
8
  codec: {
9
9
  serialize(channel) {
10
10
  return {
@@ -13,16 +13,15 @@ export const ChannelKey = new RuntimeContextKey("ash.channel", {
13
13
  };
14
14
  },
15
15
  deserialize(data, ctx) {
16
- const bundle = ctx.tryGet(BundleKey);
16
+ const bundle = ctx.get(BundleKey);
17
17
  if (bundle === undefined) {
18
18
  throw new Error('Cannot deserialize "ash.channel" before "ash.bundle". The runtime bundle must be present in context.');
19
19
  }
20
20
  return deserializeRuntimeChannel(bundle.channelRegistry, data);
21
21
  },
22
22
  },
23
- serializable: true,
24
23
  });
25
- export const BundleKey = new RuntimeContextKey("ash.bundle", {
24
+ export const BundleKey = new ContextKey("ash.bundle", {
26
25
  codec: {
27
26
  serialize: (bundle) => ({
28
27
  nodeSelector: bundle.nodeSelector,
@@ -36,12 +35,11 @@ export const BundleKey = new RuntimeContextKey("ash.bundle", {
36
35
  });
37
36
  },
38
37
  },
39
- serializable: true,
40
38
  });
41
39
  // ---------------------------------------------------------------------------
42
40
  // Derived keys — reconstructed by providers each step, never serialized
43
41
  // ---------------------------------------------------------------------------
44
- export const SessionKey = new RuntimeContextKey("ash.session");
45
- export const SandboxKey = new RuntimeContextKey("ash.sandbox");
46
- export const SkillKey = new RuntimeContextKey("ash.skill");
42
+ export const SessionKey = new ContextKey("ash.session");
43
+ export const SandboxKey = new ContextKey("ash.sandbox");
44
+ export const SkillKey = new ContextKey("ash.skill");
47
45
  //# sourceMappingURL=keys.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"keys.js","sourceRoot":"","sources":["../../../src/context/keys.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,mBAAmB,GAIpB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAE5E,OAAO,EAAE,6BAA6B,EAAE,MAAM,6CAA6C,CAAC;AAC5F,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;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AAI,UAAU,CAAiB,YAAY,EAAE;IACpE,KAAK,EAAE;QACL,SAAS,EAAE,CAAC,MAAM,EAAoB,EAAE,CAAC,CAAC;YACxC,YAAY,EAAE,MAAM,CAAC,YAAY;YACjC,MAAM,EAAE,MAAM,CAAC,uBAAuB;SACvC,CAAC;QACF,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE;YACpB,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,IAAwB,CAAC;YAC1D,OAAO,6BAA6B,CAAC;gBACnC,uBAAuB,EAAE,MAAM;gBAC/B,YAAY;aACb,CAAC,CAAC;QACL,CAAC;KACF;CACF,CAAC,CAAC;AAEH,8EAA8E;AAC9E,wEAAwE;AACxE,8EAA8E;AAE9E,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,UAAU,CAAU,aAAa,CAAC,CAAC;AACjE,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,UAAU,CAAgB,aAAa,CAAC,CAAC;AACvE,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,UAAU,CAAc,WAAW,CAAC,CAAC"}
@@ -1,8 +1,8 @@
1
- import type { AshContext } from "./container.js";
1
+ import type { ContextReader } from "./provider.js";
2
2
  /**
3
3
  * Returns the active runtime node from the compiled bundle on the
4
4
  * context. The bundle is already resolved to the correct node (root or
5
5
  * subagent) at run start.
6
6
  */
7
- export declare function getActiveRuntimeNode(ctx: AshContext): import("../runtime/graph.js").ResolvedRuntimeAgentNode;
7
+ export declare function getActiveRuntimeNode(ctx: ContextReader): import("../runtime/graph.js").ResolvedRuntimeAgentNode;
8
8
  //# sourceMappingURL=node.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/context/node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGjD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,UAAU,0DAEnD"}
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/context/node.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,aAAa,0DAEtD"}
@@ -5,6 +5,6 @@ import { BundleKey } from "./keys.js";
5
5
  * subagent) at run start.
6
6
  */
7
7
  export function getActiveRuntimeNode(ctx) {
8
- return ctx.get(BundleKey).graph.root;
8
+ return ctx.require(BundleKey).graph.root;
9
9
  }
10
10
  //# sourceMappingURL=node.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"node.js","sourceRoot":"","sources":["../../../src/context/node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,GAAe;IAClD,OAAO,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC;AACvC,CAAC"}
1
+ {"version":3,"file":"node.js","sourceRoot":"","sources":["../../../src/context/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAGtC;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,GAAkB;IACrD,OAAO,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC;AAC3C,CAAC"}
@@ -1,24 +1,37 @@
1
1
  import type { HarnessSession } from "../harness/types.js";
2
- import type { AshContext } from "./container.js";
3
- import type { ContextStoreKey } from "./key.js";
2
+ import type { ContextKey, ContextReader } from "./key.js";
3
+ export type { ContextReader } from "./key.js";
4
4
  /**
5
- * Value returned by a provider's `create` method.
5
+ * Public derive-only provider that rebuilds one virtual value each step.
6
6
  *
7
- * `value` is the live instance stored on the context. `session` is an
8
- * optionally modified harness session (e.g. with enriched instructions).
7
+ * Provider output is available through `require(key)` for the current
8
+ * step and is never serialized.
9
+ */
10
+ export interface ContextProvider<T> {
11
+ readonly key: ContextKey<T>;
12
+ create(ctx: ContextReader): T | undefined | Promise<T | undefined>;
13
+ }
14
+ /**
15
+ * Value returned by a framework provider's `create` method.
16
+ *
17
+ * `value` is the live step-local instance stored on the context. `session`
18
+ * carries an optional harness session patch produced while deriving that
19
+ * value.
9
20
  */
10
21
  export interface ProviderResult<T> {
11
22
  readonly value: T;
12
23
  readonly session?: HarnessSession;
13
24
  }
14
25
  /**
15
- * Provider that creates a derived value from seed keys and the harness
16
- * session. Providers that mutate state during a step implement `commit`
17
- * to persist changes back onto the harness session.
26
+ * Framework-only provider contract.
27
+ *
28
+ * Framework providers may derive virtual values from context, observe the
29
+ * current harness session, and optionally commit mutable provider-owned state
30
+ * back onto the harness session after the authored step completes.
18
31
  */
19
- export interface ContextProvider<T> {
20
- readonly key: ContextStoreKey<T>;
21
- create(ctx: AshContext, session: HarnessSession): ProviderResult<T> | undefined | Promise<ProviderResult<T> | undefined>;
32
+ export interface FrameworkContextProvider<T> {
33
+ readonly key: ContextKey<T>;
34
+ create(ctx: ContextReader, session: HarnessSession): ProviderResult<T> | undefined | Promise<ProviderResult<T> | undefined>;
22
35
  commit?(value: T, session: HarnessSession): HarnessSession | Promise<HarnessSession>;
23
36
  }
24
37
  //# sourceMappingURL=provider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/context/provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;IAClB,QAAQ,CAAC,OAAO,CAAC,EAAE,cA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c,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;IAE1E,MAAM,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,cAAc,GAAG,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CACtF"}
@@ -1,4 +1,4 @@
1
1
  import type { ConnectionRegistry } from "../../runtime/connections/types.js";
2
- import type { ContextProvider } from "../provider.js";
3
- export declare const connectionProvider: ContextProvider<ConnectionRegistry>;
2
+ import type { FrameworkContextProvider } from "../provider.js";
3
+ export declare const connectionProvider: FrameworkContextProvider<ConnectionRegistry>;
4
4
  //# sourceMappingURL=connection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../../../src/context/providers/connection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAI7E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,eAAO,MAAM,kBAAkB,EAAE,eAAe,CAAC,kBAAkB,CAYlE,CAAC"}
1
+ {"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../../../src/context/providers/connection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAI7E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAE/D,eAAO,MAAM,kBAAkB,EAAE,wBAAwB,CAAC,kBAAkB,CAY3E,CAAC"}
@@ -5,7 +5,7 @@ import { getActiveRuntimeNode } from "../node.js";
5
5
  export const connectionProvider = {
6
6
  key: ConnectionRegistryKey,
7
7
  create(ctx, _session) {
8
- const bundle = ctx.tryGet(BundleKey);
8
+ const bundle = ctx.get(BundleKey);
9
9
  if (bundle === undefined)
10
10
  return undefined;
11
11
  const node = getActiveRuntimeNode(ctx);
@@ -1 +1 @@
1
- {"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../../src/context/providers/connection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAE/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAC;AAC3F,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAGlD,MAAM,CAAC,MAAM,kBAAkB,GAAwC;IACrE,GAAG,EAAE,qBAAqB;IAE1B,MAAM,CAAC,GAAG,EAAE,QAAQ;QAClB,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACrC,IAAI,MAAM,KAAK,SAAS;YAAE,OAAO,SAAS,CAAC;QAC3C,MAAM,IAAI,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC;QACvC,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,EAAE,WAAW,CAAC;QAC5C,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,SAAS,CAAC;QAE/D,OAAO,EAAE,KAAK,EAAE,IAAI,sBAAsB,CAAC,WAAW,CAAC,EAAE,CAAC;IAC5D,CAAC;CACF,CAAC"}
1
+ {"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../../src/context/providers/connection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAE/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAC;AAC3F,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAGlD,MAAM,CAAC,MAAM,kBAAkB,GAAiD;IAC9E,GAAG,EAAE,qBAAqB;IAE1B,MAAM,CAAC,GAAG,EAAE,QAAQ;QAClB,MAAM,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAClC,IAAI,MAAM,KAAK,SAAS;YAAE,OAAO,SAAS,CAAC;QAC3C,MAAM,IAAI,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC;QACvC,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,EAAE,WAAW,CAAC;QAC5C,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,SAAS,CAAC;QAE/D,OAAO,EAAE,KAAK,EAAE,IAAI,sBAAsB,CAAC,WAAW,CAAC,EAAE,CAAC;IAC5D,CAAC;CACF,CAAC"}
@@ -1,4 +1,4 @@
1
1
  import type { SandboxAccess } from "../../execution/sandboxes/types.js";
2
- import type { ContextProvider } from "../provider.js";
3
- export declare const sandboxProvider: ContextProvider<SandboxAccess>;
2
+ import type { FrameworkContextProvider } from "../provider.js";
3
+ export declare const sandboxProvider: FrameworkContextProvider<SandboxAccess>;
4
4
  //# sourceMappingURL=sandbox.d.ts.map