experimental-ash 0.24.2 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/docs/public/typescript-api.md +0 -12
  3. package/dist/src/channel/adapter.d.ts +5 -18
  4. package/dist/src/channel/adapter.js +2 -8
  5. package/dist/src/channel/cross-channel-receive.d.ts +10 -1
  6. package/dist/src/channel/cross-channel-receive.js +21 -3
  7. package/dist/src/channel/routes.d.ts +2 -1
  8. package/dist/src/channel/routes.js +6 -3
  9. package/dist/src/channel/schedule.js +2 -2
  10. package/dist/src/channel/types.d.ts +1 -1
  11. package/dist/src/chunks/{client-DLHAGI2g.js → client-BShLWzR6.js} +3 -3
  12. package/dist/src/chunks/compile-agent-75wLLW-E.js +5 -0
  13. package/dist/src/chunks/dev-authored-source-watcher-DqoJsDup.js +1 -0
  14. package/dist/src/chunks/host-JVy7fewA.js +70 -0
  15. package/dist/src/chunks/paths-DNjq5JOy.js +85 -0
  16. package/dist/src/chunks/{token-D98SQdvs.js → token-BOkIxJeV.js} +1 -1
  17. package/dist/src/chunks/types-CjIyrcYo.js +1 -0
  18. package/dist/src/cli/commands/info.js +1 -1
  19. package/dist/src/cli/dev/environment.d.ts +0 -5
  20. package/dist/src/cli/dev/environment.js +1 -1
  21. package/dist/src/cli/dev/repl.d.ts +1 -1
  22. package/dist/src/cli/dev/repl.js +3 -3
  23. package/dist/src/cli/run.d.ts +0 -1
  24. package/dist/src/cli/run.js +2 -2
  25. package/dist/src/client/message-reducer.js +13 -25
  26. package/dist/src/client/message-response.d.ts +2 -1
  27. package/dist/src/client/open-stream.d.ts +3 -3
  28. package/dist/src/client/open-stream.js +1 -2
  29. package/dist/src/client/session.d.ts +2 -1
  30. package/dist/src/client/session.js +0 -3
  31. package/dist/src/client/types.d.ts +3 -2
  32. package/dist/src/compiler/artifacts.d.ts +7 -10
  33. package/dist/src/compiler/artifacts.js +3 -3
  34. package/dist/src/compiler/manifest.d.ts +6 -15
  35. package/dist/src/compiler/manifest.js +3 -3
  36. package/dist/src/compiler/normalize-agent-config.js +12 -10
  37. package/dist/src/compiler/normalize-manifest.js +3 -2
  38. package/dist/src/context/container.d.ts +1 -16
  39. package/dist/src/context/container.js +1 -24
  40. package/dist/src/context/hook-lifecycle.d.ts +2 -7
  41. package/dist/src/context/hook-lifecycle.js +0 -6
  42. package/dist/src/context/provider.d.ts +1 -11
  43. package/dist/src/context/providers/sandbox.js +4 -1
  44. package/dist/src/context/run-step.d.ts +2 -4
  45. package/dist/src/context/run-step.js +4 -17
  46. package/dist/src/context/seed-keys.d.ts +1 -1
  47. package/dist/src/discover/connections.d.ts +2 -1
  48. package/dist/src/discover/diagnostics.d.ts +0 -8
  49. package/dist/src/discover/diagnostics.js +4 -16
  50. package/dist/src/discover/discover-agent.d.ts +3 -13
  51. package/dist/src/discover/discover-agent.js +1 -11
  52. package/dist/src/discover/discover-subagent.d.ts +3 -2
  53. package/dist/src/discover/discover-subagent.js +1 -1
  54. package/dist/src/discover/filesystem.d.ts +0 -37
  55. package/dist/src/discover/filesystem.js +0 -115
  56. package/dist/src/discover/grammar.d.ts +10 -20
  57. package/dist/src/discover/grammar.js +11 -33
  58. package/dist/src/discover/lib.d.ts +3 -2
  59. package/dist/src/discover/manifest.d.ts +3 -3
  60. package/dist/src/discover/markdown.d.ts +2 -1
  61. package/dist/src/discover/sandbox.d.ts +2 -1
  62. package/dist/src/discover/schedules.d.ts +3 -2
  63. package/dist/src/discover/schedules.js +1 -1
  64. package/dist/src/discover/skills.d.ts +3 -2
  65. package/dist/src/discover/skills.js +1 -1
  66. package/dist/src/discover/slots.d.ts +3 -2
  67. package/dist/src/evals/cli/eval.d.ts +0 -6
  68. package/dist/src/evals/cli/eval.js +1 -1
  69. package/dist/src/evals/loaders/index.d.ts +2 -22
  70. package/dist/src/evals/loaders/index.js +1 -1
  71. package/dist/src/evals/reporters/index.d.ts +2 -14
  72. package/dist/src/evals/reporters/index.js +1 -1
  73. package/dist/src/evals/runner/discover.d.ts +0 -6
  74. package/dist/src/evals/runner/discover.js +1 -1
  75. package/dist/src/evals/runner/execute-case.d.ts +2 -1
  76. package/dist/src/evals/runner/execute-suite.d.ts +2 -1
  77. package/dist/src/evals/runner/reporters/braintrust.js +1 -1
  78. package/dist/src/evals/runner/resolve-git-metadata.d.ts +3 -3
  79. package/dist/src/evals/scorers/autoevals-client.d.ts +2 -2
  80. package/dist/src/execution/connection-auth-steps.d.ts +1 -5
  81. package/dist/src/execution/connection-auth-steps.js +4 -5
  82. package/dist/src/execution/node-step.d.ts +1 -1
  83. package/dist/src/execution/skills/instructions.d.ts +2 -1
  84. package/dist/src/execution/subagent-hitl-proxy.d.ts +1 -1
  85. package/dist/src/execution/subagent-tool.d.ts +0 -8
  86. package/dist/src/execution/subagent-tool.js +9 -16
  87. package/dist/src/execution/tool-compaction.js +0 -2
  88. package/dist/src/execution/turn-workflow.d.ts +1 -1
  89. package/dist/src/execution/turn-workflow.js +2 -2
  90. package/dist/src/execution/web-fetch/tool.js +1 -1
  91. package/dist/src/execution/workflow-steps.d.ts +17 -1
  92. package/dist/src/execution/workflow-steps.js +5 -6
  93. package/dist/src/harness/action-result-helpers.d.ts +0 -12
  94. package/dist/src/harness/action-result-helpers.js +1 -1
  95. package/dist/src/harness/emission.d.ts +2 -2
  96. package/dist/src/harness/execute-tool.d.ts +2 -1
  97. package/dist/src/harness/input-requests.d.ts +2 -1
  98. package/dist/src/harness/prompt-cache.d.ts +1 -9
  99. package/dist/src/harness/prompt-cache.js +0 -12
  100. package/dist/src/harness/runtime-actions.d.ts +2 -11
  101. package/dist/src/harness/runtime-actions.js +1 -1
  102. package/dist/src/harness/step-hooks.d.ts +3 -2
  103. package/dist/src/harness/step-hooks.js +3 -7
  104. package/dist/src/harness/tool-loop.js +0 -2
  105. package/dist/src/harness/types.d.ts +1 -1
  106. package/dist/src/internal/application/package.js +2 -2
  107. package/dist/src/internal/application/runtime-compiled-artifacts-source.js +0 -1
  108. package/dist/src/internal/attachments/errors.d.ts +8 -2
  109. package/dist/src/internal/attachments/url-refs.d.ts +0 -1
  110. package/dist/src/internal/attachments/url-refs.js +1 -1
  111. package/dist/src/internal/authored-definition/channel.d.ts +0 -5
  112. package/dist/src/internal/authored-definition/channel.js +1 -10
  113. package/dist/src/internal/authored-definition/sandbox.d.ts +2 -1
  114. package/dist/src/internal/authored-definition/schema-backed.d.ts +3 -2
  115. package/dist/src/internal/authored-module-loader.d.ts +0 -6
  116. package/dist/src/internal/authored-module-loader.js +0 -9
  117. package/dist/src/internal/authored-module.d.ts +0 -4
  118. package/dist/src/internal/authored-module.js +0 -10
  119. package/dist/src/internal/bundler/nitro-rolldown.d.ts +2 -10
  120. package/dist/src/internal/bundler/nitro-rolldown.js +1 -1
  121. package/dist/src/{public → internal}/helpers/markdown.d.ts +2 -23
  122. package/dist/src/{public → internal}/helpers/markdown.js +1 -1
  123. package/dist/src/internal/logging.d.ts +2 -8
  124. package/dist/src/internal/nitro/host/build-vercel-agent-summary.d.ts +1 -1
  125. package/dist/src/internal/nitro/host/build-vercel-agent-summary.js +1 -1
  126. package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
  127. package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +2 -2
  128. package/dist/src/internal/nitro/routes/channel-dispatch.js +2 -2
  129. package/dist/src/internal/nitro/routes/runtime-artifacts.js +0 -1
  130. package/dist/src/internal/node-esm-compat-banner.d.ts +1 -1
  131. package/dist/src/internal/runtime-registry.d.ts +2 -1
  132. package/dist/src/{protocol → internal}/vercel-agent-summary.d.ts +1 -1
  133. package/dist/src/protocol/message.d.ts +0 -34
  134. package/dist/src/protocol/message.js +0 -30
  135. package/dist/src/public/channels/index.d.ts +1 -1
  136. package/dist/src/public/channels/index.js +1 -1
  137. package/dist/src/public/channels/slack/api.d.ts +1 -7
  138. package/dist/src/public/channels/slack/api.js +1 -1
  139. package/dist/src/public/channels/slack/connections.d.ts +2 -6
  140. package/dist/src/public/channels/slack/hitl.d.ts +3 -2
  141. package/dist/src/public/channels/slack/inbound.d.ts +0 -35
  142. package/dist/src/public/definitions/channel.d.ts +2 -2
  143. package/dist/src/public/definitions/channel.js +1 -1
  144. package/dist/src/public/definitions/defineChannel.d.ts +1 -1
  145. package/dist/src/public/definitions/defineChannel.js +1 -1
  146. package/dist/src/public/definitions/instructions.d.ts +0 -11
  147. package/dist/src/public/definitions/instructions.js +0 -5
  148. package/dist/src/public/definitions/tool.d.ts +3 -7
  149. package/dist/src/public/definitions/tool.js +1 -1
  150. package/dist/src/public/instructions/index.d.ts +1 -5
  151. package/dist/src/public/instructions/index.js +1 -3
  152. package/dist/src/public/tool-result-narrowing.d.ts +2 -1
  153. package/dist/src/react/use-ash-agent.d.ts +2 -1
  154. package/dist/src/react/use-ash-agent.js +1 -5
  155. package/dist/src/runtime/actions/types.d.ts +8 -50
  156. package/dist/src/runtime/actions/types.js +5 -21
  157. package/dist/src/runtime/agent/bootstrap-model-utils.d.ts +2 -1
  158. package/dist/src/runtime/agent/mock-model-adapter.js +1 -1
  159. package/dist/src/runtime/channels/registry.js +3 -8
  160. package/dist/src/runtime/compiled-artifacts-source.d.ts +4 -11
  161. package/dist/src/runtime/compiled-artifacts-source.js +3 -7
  162. package/dist/src/runtime/connections/authorization-tokens.d.ts +1 -14
  163. package/dist/src/runtime/connections/authorization-tokens.js +2 -28
  164. package/dist/src/runtime/connections/principal-context.d.ts +3 -2
  165. package/dist/src/runtime/connections/validate-authorization.d.ts +0 -11
  166. package/dist/src/runtime/connections/validate-authorization.js +0 -16
  167. package/dist/src/runtime/framework-channels/index.d.ts +0 -1
  168. package/dist/src/runtime/framework-channels/index.js +1 -1
  169. package/dist/src/runtime/framework-tools/index.d.ts +2 -1
  170. package/dist/src/runtime/framework-tools/index.js +2 -1
  171. package/dist/src/runtime/framework-tools/skill.d.ts +0 -13
  172. package/dist/src/runtime/framework-tools/skill.js +1 -1
  173. package/dist/src/runtime/governance/auth/token-claims.d.ts +1 -16
  174. package/dist/src/runtime/governance/auth/token-claims.js +3 -3
  175. package/dist/src/runtime/governance/auth/types.d.ts +0 -4
  176. package/dist/src/runtime/governance/network/ip-allow-list.d.ts +0 -17
  177. package/dist/src/runtime/governance/network/ip-allow-list.js +0 -39
  178. package/dist/src/runtime/hooks/registry.d.ts +7 -4
  179. package/dist/src/runtime/hooks/registry.js +4 -2
  180. package/dist/src/runtime/loaders/bundled-artifacts.d.ts +0 -5
  181. package/dist/src/runtime/loaders/bundled-artifacts.js +0 -7
  182. package/dist/src/runtime/loaders/compile-metadata.d.ts +3 -10
  183. package/dist/src/runtime/loaders/compile-metadata.js +6 -8
  184. package/dist/src/runtime/loaders/manifest.d.ts +2 -2
  185. package/dist/src/runtime/loaders/manifest.js +4 -5
  186. package/dist/src/runtime/loaders/module-map.d.ts +2 -2
  187. package/dist/src/runtime/loaders/module-map.js +3 -4
  188. package/dist/src/runtime/prompt/compose.d.ts +2 -1
  189. package/dist/src/runtime/resolve-agent-graph.d.ts +2 -15
  190. package/dist/src/runtime/resolve-agent-graph.js +1 -1
  191. package/dist/src/runtime/sandbox/keys.d.ts +2 -1
  192. package/dist/src/runtime/sandbox/registry.d.ts +3 -3
  193. package/dist/src/runtime/schedules/resolve-schedule.d.ts +3 -12
  194. package/dist/src/runtime/schedules/resolve-schedule.js +1 -1
  195. package/dist/src/runtime/sessions/auth.d.ts +2 -13
  196. package/dist/src/runtime/sessions/auth.js +1 -11
  197. package/dist/src/runtime/sessions/compiled-agent-cache.js +1 -1
  198. package/dist/src/runtime/sessions/runtime-session.d.ts +0 -6
  199. package/dist/src/runtime/sessions/runtime-session.js +0 -13
  200. package/dist/src/runtime/sessions/turn.d.ts +2 -2
  201. package/dist/src/runtime/subagents/registry.d.ts +2 -5
  202. package/dist/src/runtime/subagents/registry.js +0 -6
  203. package/dist/src/runtime/tools/registry.d.ts +2 -1
  204. package/dist/src/runtime/tools/registry.js +1 -4
  205. package/dist/src/runtime/types.d.ts +4 -3
  206. package/dist/src/runtime/workspace/seed-files.d.ts +2 -1
  207. package/dist/src/services/dev-client/request-headers.d.ts +37 -8
  208. package/dist/src/services/dev-client/request-headers.js +71 -46
  209. package/dist/src/services/dev-client/stream.d.ts +0 -19
  210. package/dist/src/services/dev-client/stream.js +0 -37
  211. package/dist/src/services/dev-client/url.d.ts +3 -7
  212. package/dist/src/services/dev-client/url.js +4 -10
  213. package/dist/src/services/dev-client.d.ts +0 -12
  214. package/dist/src/services/dev-client.js +6 -92
  215. package/dist/src/shared/agent-definition.d.ts +1 -1
  216. package/dist/src/shared/json.d.ts +0 -4
  217. package/dist/src/shared/json.js +0 -38
  218. package/dist/src/shared/skill-definition.d.ts +0 -2
  219. package/package.json +1 -6
  220. package/dist/src/chunks/dev-authored-source-watcher-CBID_Dwh.js +0 -1
  221. package/dist/src/chunks/host-zBy9FyyX.js +0 -70
  222. package/dist/src/chunks/package-HUaeub_D.js +0 -1
  223. package/dist/src/chunks/paths-CebY5GCi.js +0 -89
  224. package/dist/src/chunks/types-DDA2QUED.js +0 -1
  225. package/dist/src/compiler/resource-files.d.ts +0 -19
  226. package/dist/src/compiler/resource-files.js +0 -28
  227. package/dist/src/execution/subagent-invocation.d.ts +0 -19
  228. package/dist/src/execution/subagent-invocation.js +0 -17
  229. package/dist/src/execution/task-mode.d.ts +0 -9
  230. package/dist/src/execution/task-mode.js +0 -12
  231. package/dist/src/execution/types.d.ts +0 -20
  232. package/dist/src/execution/types.js +0 -1
  233. package/dist/src/internal/logical-paths.d.ts +0 -13
  234. package/dist/src/internal/logical-paths.js +0 -25
  235. package/dist/src/runtime/sessions/messages.d.ts +0 -140
  236. package/dist/src/runtime/sessions/messages.js +0 -170
  237. package/dist/src/runtime/standard-schema.d.ts +0 -27
  238. package/dist/src/runtime/standard-schema.js +0 -64
  239. package/dist/src/services/dev-client/live-stream.d.ts +0 -35
  240. package/dist/src/services/dev-client/live-stream.js +0 -157
  241. package/dist/src/services/dev-client/send-message.d.ts +0 -24
  242. package/dist/src/services/dev-client/send-message.js +0 -185
  243. package/dist/src/services/dev-client/session.d.ts +0 -54
  244. package/dist/src/services/dev-client/session.js +0 -52
  245. package/dist/src/services/host.d.ts +0 -14
  246. package/dist/src/services/host.js +0 -13
  247. /package/dist/src/{package-name.d.ts → internal/package-name.d.ts} +0 -0
  248. /package/dist/src/{package-name.js → internal/package-name.js} +0 -0
  249. /package/dist/src/{protocol → internal}/vercel-agent-summary.js +0 -0
  250. /package/dist/src/{run-mode.d.ts → shared/run-mode.d.ts} +0 -0
  251. /package/dist/src/{run-mode.js → shared/run-mode.js} +0 -0
@@ -93,7 +93,7 @@ export async function accumulateRuntimeActionResults(input) {
93
93
  * batch when every action has a matching result. Unknown and duplicate results
94
94
  * are ignored.
95
95
  */
96
- export function resolveReadyRuntimeActionResults(input) {
96
+ function resolveReadyRuntimeActionResults(input) {
97
97
  const batch = getPendingRuntimeActionBatch(input.session);
98
98
  if (batch === undefined) {
99
99
  return undefined;
@@ -12,7 +12,7 @@ export type HarnessStepResult = Pick<StepResult<ToolSet>, "content" | "finishRea
12
12
  /**
13
13
  * Input for {@link buildStepHooks}.
14
14
  */
15
- export interface StepHooksInput {
15
+ interface StepHooksInput {
16
16
  readonly cachePath: PromptCachePath;
17
17
  readonly emit?: HarnessEmitFn;
18
18
  readonly emissionState: HarnessEmissionState;
@@ -43,7 +43,7 @@ export interface StepHooksInput {
43
43
  /**
44
44
  * Composable hooks returned by {@link buildStepHooks}.
45
45
  */
46
- export interface StepHooks {
46
+ interface StepHooks {
47
47
  /**
48
48
  * `ToolLoopAgent` `onStepFinish` callback.
49
49
  *
@@ -106,3 +106,4 @@ export declare function emitStepActions(emitFn: HarnessEmitFn, state: HarnessEmi
106
106
  * will throw on the JSON-object invariant.
107
107
  */
108
108
  export declare function isInvalidToolCall(toolCall: TypedToolCall<ToolSet>): boolean;
109
+ export {};
@@ -50,14 +50,10 @@ export function buildStepHooks(input) {
50
50
  }
51
51
  return stepResult;
52
52
  };
53
- // -------------------------------------------------------------------------
54
- // onStepFinish
55
- // -------------------------------------------------------------------------
56
- const onStepFinish = async (step) => {
57
- resolveStep(step);
58
- };
59
53
  return {
60
- onStepFinish,
54
+ onStepFinish: async (step) => {
55
+ resolveStep(step);
56
+ },
61
57
  prepareStep,
62
58
  stepResult,
63
59
  };
@@ -812,7 +812,6 @@ async function maybeCompact(input) {
812
812
  modelId: formatLanguageModelGatewayId(compaction.model),
813
813
  sequence: emissionState.sequence,
814
814
  sessionId: session.sessionId,
815
- thresholdPercent: 0,
816
815
  turnId: emissionState.turnId,
817
816
  usageInputTokens: getInputTokenCount(messages, session.compaction),
818
817
  }));
@@ -827,7 +826,6 @@ async function maybeCompact(input) {
827
826
  }
828
827
  if (emit) {
829
828
  await emit(createCompactionCompletedEvent({
830
- lastCompactionIndex: 0,
831
829
  modelId: formatLanguageModelGatewayId(compaction.model),
832
830
  sequence: emissionState.sequence,
833
831
  sessionId: session.sessionId,
@@ -1,7 +1,7 @@
1
1
  import type { LanguageModel, ModelMessage, UserContent } from "ai";
2
2
  import type { SessionCapabilities } from "#channel/types.js";
3
3
  import type { HandleMessageStreamEvent, RuntimeIdentity } from "#protocol/message.js";
4
- import type { RunMode } from "#run-mode.js";
4
+ import type { RunMode } from "#shared/run-mode.js";
5
5
  import type { RuntimeActionResult } from "#runtime/actions/types.js";
6
6
  import type { RuntimeModelReference } from "#runtime/agent/bootstrap.js";
7
7
  import type { InputResponse } from "#runtime/input/types.js";
@@ -2,11 +2,11 @@ import { existsSync, readFileSync, realpathSync } from "node:fs";
2
2
  import { createRequire } from "node:module";
3
3
  import { basename, dirname, join } from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
- import { ASH_PACKAGE_NAME } from "#package-name.js";
5
+ import { ASH_PACKAGE_NAME } from "#internal/package-name.js";
6
6
  let cachedPackageInfo;
7
7
  // The package build stamps the published version into `dist` so bundled
8
8
  // deployments can still report package metadata without resolving package.json.
9
- const BUNDLED_FALLBACK_PACKAGE_VERSION = "0.24.2";
9
+ const BUNDLED_FALLBACK_PACKAGE_VERSION = "0.25.0";
10
10
  const BUNDLED_FALLBACK_PACKAGE_VERSION_PLACEHOLDER = "__ASH_PACKAGE_VERSION_PLACEHOLDER__";
11
11
  const WORKFLOW_MODULE_ALIASES = {
12
12
  "workflow/api": "src/compiled/@workflow/core/runtime.js",
@@ -7,6 +7,5 @@ import { resolvePackageSourceFilePath } from "#internal/application/package.js";
7
7
  export function createAuthoredSourceRuntimeCompiledArtifactsSource(appRoot) {
8
8
  return createDiskRuntimeCompiledArtifactsSource(appRoot, {
9
9
  moduleMapLoaderPath: resolvePackageSourceFilePath("src/internal/authored-module-map-loader.ts"),
10
- moduleMapLoadMode: "authored-source",
11
10
  });
12
11
  }
@@ -1,14 +1,19 @@
1
1
  /**
2
2
  * Discriminator for {@link AshAttachmentError}.
3
+ *
4
+ * Today the only literal ever produced in the codebase is
5
+ * `"resolver-threw"`. The union remains a discriminated type so future
6
+ * producers can broaden it intentionally rather than as an accident of
7
+ * a string parameter that drifted.
3
8
  */
4
- export type AshAttachmentErrorKind = "missing-adapter" | "resolver-missing" | "missing-param" | "fetch-failed" | "resolver-threw";
9
+ type AshAttachmentErrorKind = "resolver-threw";
5
10
  /**
6
11
  * Input shape for {@link AshAttachmentError}. Separated from the class
7
12
  * constructor so callers can build the options object inline and TS
8
13
  * can check the `kind` / `message` pair without a positional
9
14
  * constructor signature.
10
15
  */
11
- export interface AshAttachmentErrorInput {
16
+ interface AshAttachmentErrorInput {
12
17
  readonly kind: AshAttachmentErrorKind;
13
18
  readonly message: string;
14
19
  readonly adapterKind?: string;
@@ -30,3 +35,4 @@ export declare class AshAttachmentError extends Error {
30
35
  readonly cause?: unknown;
31
36
  constructor(input: AshAttachmentErrorInput);
32
37
  }
38
+ export {};
@@ -8,7 +8,6 @@
8
8
  * reconstitutes them back to `URL` objects so `instanceof URL` checks
9
9
  * work reliably.
10
10
  */
11
- export declare const ASH_URL_SCHEME = "ash-url:";
12
11
  export declare function serializeUrlFilePart(url: URL): string;
13
12
  export declare function isSerializedUrlFilePart(data: unknown): data is string;
14
13
  export declare function deserializeUrlFilePart(data: string): URL;
@@ -8,7 +8,7 @@
8
8
  * reconstitutes them back to `URL` objects so `instanceof URL` checks
9
9
  * work reliably.
10
10
  */
11
- export const ASH_URL_SCHEME = "ash-url:";
11
+ const ASH_URL_SCHEME = "ash-url:";
12
12
  export function serializeUrlFilePart(url) {
13
13
  return `${ASH_URL_SCHEME}${url.href}`;
14
14
  }
@@ -1,9 +1,4 @@
1
1
  import { type CompiledChannel } from "#channel/compiled-channel.js";
2
- /**
3
- * Type guard: returns whether `value` is a {@link CompiledChannel} produced
4
- * by {@link defineChannel}.
5
- */
6
- export declare function isCompiledChannel(value: unknown): value is CompiledChannel;
7
2
  /**
8
3
  * Normalizes one authored channel definition into the canonical internal
9
4
  * shape consumed by the compiler.
@@ -1,13 +1,4 @@
1
- import { CHANNEL_SENTINEL } from "#channel/compiled-channel.js";
2
- /**
3
- * Type guard: returns whether `value` is a {@link CompiledChannel} produced
4
- * by {@link defineChannel}.
5
- */
6
- export function isCompiledChannel(value) {
7
- return (typeof value === "object" &&
8
- value !== null &&
9
- value.__kind === CHANNEL_SENTINEL);
10
- }
1
+ import { isCompiledChannel } from "#channel/compiled-channel.js";
11
2
  /**
12
3
  * Normalizes one authored channel definition into the canonical internal
13
4
  * shape consumed by the compiler.
@@ -1,6 +1,6 @@
1
1
  import type { SandboxBackend } from "#public/definitions/sandbox-backend.js";
2
2
  import type { SandboxDefinition } from "#public/definitions/sandbox.js";
3
- export type NormalizedSandboxDefinition = Readonly<Omit<SandboxDefinition, "backend">> & {
3
+ type NormalizedSandboxDefinition = Readonly<Omit<SandboxDefinition, "backend">> & {
4
4
  readonly backend?: SandboxBackend;
5
5
  readonly description?: string;
6
6
  };
@@ -13,3 +13,4 @@ export type NormalizedSandboxDefinition = Readonly<Omit<SandboxDefinition, "back
13
13
  * access and the resulting backend is memoized.
14
14
  */
15
15
  export declare function normalizeSandboxDefinition(value: unknown, message: string): NormalizedSandboxDefinition;
16
+ export {};
@@ -5,14 +5,14 @@ import type { InternalToolDefinitionWithExecuteFn } from "#shared/tool-definitio
5
5
  * Identity is path-derived — the compiler stamps the filename slug onto
6
6
  * the compiled entry. This shape never carries an authored `name`.
7
7
  */
8
- export type NormalizedAuthoredTool = Readonly<Omit<InternalToolDefinitionWithExecuteFn, "name">>;
8
+ type NormalizedAuthoredTool = Readonly<Omit<InternalToolDefinitionWithExecuteFn, "name">>;
9
9
  /**
10
10
  * Result of normalizing one authored tool default export. Either a real tool
11
11
  * definition or a sentinel that disables a framework default. In both cases
12
12
  * the disable target / runtime name is the authored file's slug, supplied by
13
13
  * the compiler — this layer never sees a name.
14
14
  */
15
- export type NormalizedToolEntry = {
15
+ type NormalizedToolEntry = {
16
16
  readonly kind: "tool";
17
17
  readonly definition: NormalizedAuthoredTool;
18
18
  } | {
@@ -25,3 +25,4 @@ export type NormalizedToolEntry = {
25
25
  * Authored `name` fields are rejected — tool identity is path-derived.
26
26
  */
27
27
  export declare function normalizeToolDefinition(value: unknown, message: string): NormalizedToolEntry;
28
+ export {};
@@ -1,9 +1,3 @@
1
- /**
2
- * Registers a loaded channel module in the global cache so Rolldown-
3
- * bundled schedule modules that import the same channel get the exact
4
- * same route object instance.
5
- */
6
- export declare function registerChannelModuleInCache(absolutePath: string, moduleDefault: unknown): void;
7
1
  /**
8
2
  * Loads one authored module namespace from disk during compile-time
9
3
  * discovery. Concurrent loads of the same `modulePath` share a single
@@ -22,15 +22,6 @@ const RESOLVE_EXTENSIONS = [
22
22
  ];
23
23
  const CHANNEL_MODULE_CACHE_KEY = "__ashChannelModuleCache__";
24
24
  const CACHED_CHANNEL_PREFIX = "ash-cached-channel:";
25
- /**
26
- * Registers a loaded channel module in the global cache so Rolldown-
27
- * bundled schedule modules that import the same channel get the exact
28
- * same route object instance.
29
- */
30
- export function registerChannelModuleInCache(absolutePath, moduleDefault) {
31
- const cache = (globalThis[CHANNEL_MODULE_CACHE_KEY] ??= new Map());
32
- cache.set(resolve(absolutePath), moduleDefault);
33
- }
34
25
  function getChannelModuleCache() {
35
26
  return globalThis[CHANNEL_MODULE_CACHE_KEY];
36
27
  }
@@ -32,10 +32,6 @@ export declare function expectProviderOptions(value: unknown, message: string):
32
32
  * Rejects unexpected keys on one plain object.
33
33
  */
34
34
  export declare function expectOnlyKnownKeys(record: Record<string, unknown>, knownKeys: readonly string[], message: string): void;
35
- /**
36
- * Returns one optional string property when present.
37
- */
38
- export declare function getOptionalStringProperty(record: Record<string, unknown>, key: string, message: string): string | undefined;
39
35
  /**
40
36
  * Returns one optional string-record property when present.
41
37
  */
@@ -64,16 +64,6 @@ export function expectOnlyKnownKeys(record, knownKeys, message) {
64
64
  }
65
65
  }
66
66
  }
67
- /**
68
- * Returns one optional string property when present.
69
- */
70
- export function getOptionalStringProperty(record, key, message) {
71
- const value = record[key];
72
- if (value === undefined) {
73
- return undefined;
74
- }
75
- return expectString(value, message);
76
- }
77
67
  /**
78
68
  * Returns one optional string-record property when present.
79
69
  */
@@ -8,22 +8,14 @@ type RolldownOutputAsset = {
8
8
  readonly fileName: string;
9
9
  readonly source: string | Uint8Array;
10
10
  };
11
- export type RolldownOutput = {
11
+ type RolldownOutput = {
12
12
  readonly output: readonly [RolldownOutputChunk, ...(RolldownOutputChunk | RolldownOutputAsset)[]];
13
13
  };
14
14
  export type RolldownBuild = (options: Record<string, unknown>) => Promise<RolldownOutput>;
15
- export type RolldownParseAst = (sourceText: string, options?: Record<string, unknown> | null, filename?: string) => unknown;
16
- type RolldownModule = {
17
- readonly build: RolldownBuild;
18
- };
15
+ type RolldownParseAst = (sourceText: string, options?: Record<string, unknown> | null, filename?: string) => unknown;
19
16
  type RolldownParseAstModule = {
20
17
  readonly parseAst: RolldownParseAst;
21
18
  };
22
- /**
23
- * Loads Rolldown from Nitro's dependency tree so Ash does not carry a second
24
- * native bundler package in its own install footprint.
25
- */
26
- export declare function loadNitroRolldown(): Promise<RolldownModule>;
27
19
  /**
28
20
  * Loads Rolldown's parser from Nitro's dependency tree so workflow directive
29
21
  * transforms can use the same bundler dependency without exposing it publicly.
@@ -6,7 +6,7 @@ let rolldownParseAstPromise;
6
6
  * Loads Rolldown from Nitro's dependency tree so Ash does not carry a second
7
7
  * native bundler package in its own install footprint.
8
8
  */
9
- export function loadNitroRolldown() {
9
+ function loadNitroRolldown() {
10
10
  rolldownPromise ??= (async () => {
11
11
  const require = createRequire(import.meta.url);
12
12
  const nitroRequire = createRequire(require.resolve("nitro/package.json"));
@@ -1,28 +1,6 @@
1
1
  import { type ScheduleDefinition } from "#public/definitions/schedule.js";
2
2
  import { type SkillDefinition } from "#public/definitions/skill.js";
3
3
  import { type InstructionsDefinition } from "#public/definitions/instructions.js";
4
- /**
5
- * Parsed markdown document with optional YAML frontmatter.
6
- */
7
- export interface ParsedMarkdownDocument {
8
- /**
9
- * Whether the source started with a parsed frontmatter block.
10
- */
11
- hasFrontmatter: boolean;
12
- /**
13
- * Parsed frontmatter object. Empty when the source does not include a
14
- * frontmatter block.
15
- */
16
- frontmatter: Record<string, unknown>;
17
- /**
18
- * Markdown body content after stripping the frontmatter delimiters.
19
- */
20
- markdown: string;
21
- }
22
- /**
23
- * Parses markdown with optional YAML frontmatter.
24
- */
25
- export declare function parseMarkdownDocument(source: string): ParsedMarkdownDocument;
26
4
  /**
27
5
  * Lowers authored instructions prompt markdown into the shared public
28
6
  * definition shape. Instructions identity is path-derived, so the lowered
@@ -38,7 +16,7 @@ export declare function lowerInstructionsMarkdown(markdown: string): Instruction
38
16
  * Skill identity itself comes from the file path — the lowered definition
39
17
  * never carries a `name`.
40
18
  */
41
- export interface LowerSkillMarkdownInput {
19
+ interface LowerSkillMarkdownInput {
42
20
  readonly description?: string;
43
21
  readonly slug?: string;
44
22
  }
@@ -64,3 +42,4 @@ export interface LowerSkillMarkdownInput {
64
42
  */
65
43
  export declare function lowerScheduleMarkdown(source: string): ScheduleDefinition;
66
44
  export declare function lowerSkillMarkdown(source: string, input?: LowerSkillMarkdownInput): SkillDefinition;
45
+ export {};
@@ -8,7 +8,7 @@ const CLOSED_FRONTMATTER_PATTERN = /^---\r?\n[\s\S]*?\r?\n---(?:\r?\n|$)/;
8
8
  /**
9
9
  * Parses markdown with optional YAML frontmatter.
10
10
  */
11
- export function parseMarkdownDocument(source) {
11
+ function parseMarkdownDocument(source) {
12
12
  if (!grayMatter.test(source)) {
13
13
  return {
14
14
  hasFrontmatter: false,
@@ -6,13 +6,6 @@
6
6
  */
7
7
  import { type Span } from "#compiled/@opentelemetry/api/index.js";
8
8
  import type { JsonObject } from "#shared/json.js";
9
- /**
10
- * Severity level for a single log record.
11
- *
12
- * Exposed so the logger API is composable with future sinks that want
13
- * to filter or route by severity.
14
- */
15
- export type LogLevel = "debug" | "info" | "warn" | "error";
16
9
  /**
17
10
  * Extra structured context attached to a log record.
18
11
  *
@@ -20,7 +13,7 @@ export type LogLevel = "debug" | "info" | "warn" | "error";
20
13
  * before rendering, so a caller can pass `{ error }` and the full
21
14
  * cause chain will flow through to the sink.
22
15
  */
23
- export type LogFields = Readonly<Record<string, unknown>>;
16
+ type LogFields = Readonly<Record<string, unknown>>;
24
17
  /**
25
18
  * One namespaced logger handle. Returned by {@link createLogger}.
26
19
  *
@@ -94,3 +87,4 @@ export declare function formatErrorHint(event: {
94
87
  * non-active span should be annotated.
95
88
  */
96
89
  export declare function recordErrorOnSpan(span: Span, error: unknown): void;
90
+ export {};
@@ -1,5 +1,5 @@
1
1
  import type { CompiledAgentManifest } from "#compiler/manifest.js";
2
- import { type VercelAshAgentSummary } from "#protocol/vercel-agent-summary.js";
2
+ import { type VercelAshAgentSummary } from "#internal/vercel-agent-summary.js";
3
3
  /**
4
4
  * Builds the public {@link VercelAshAgentSummary} from a compiled agent
5
5
  * manifest. The result is the stable contract Vercel ingests from the
@@ -1,7 +1,7 @@
1
1
  import { mkdir, writeFile } from "node:fs/promises";
2
2
  import { dirname, join } from "node:path";
3
3
  import { resolveInstalledPackageInfo } from "#internal/application/package.js";
4
- import { VERCEL_ASH_AGENT_SUMMARY_KIND, VERCEL_ASH_AGENT_SUMMARY_OUTPUT_PATH, VERCEL_ASH_AGENT_SUMMARY_VERSION, normalizeChannelKindForDisplay, } from "#protocol/vercel-agent-summary.js";
4
+ import { VERCEL_ASH_AGENT_SUMMARY_KIND, VERCEL_ASH_AGENT_SUMMARY_OUTPUT_PATH, VERCEL_ASH_AGENT_SUMMARY_VERSION, normalizeChannelKindForDisplay, } from "#internal/vercel-agent-summary.js";
5
5
  /**
6
6
  * Builds the public {@link VercelAshAgentSummary} from a compiled agent
7
7
  * manifest. The result is the stable contract Vercel ingests from the
@@ -2,7 +2,7 @@ import { readFile } from "node:fs/promises";
2
2
  import { dirname, isAbsolute, join, relative, resolve } from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import { createNitro } from "nitro/builder";
5
- import { ASH_PACKAGE_NAME } from "#package-name.js";
5
+ import { ASH_PACKAGE_NAME } from "#internal/package-name.js";
6
6
  import { resolvePackageSourceDirectoryPath, resolvePackageSourceFilePath, resolveWorkflowModulePath, } from "#internal/application/package.js";
7
7
  import { prepareAshVersionedCacheDirectory, writeAshVersionedCacheMetadata, } from "#internal/application/cache-metadata.js";
8
8
  import { resolveNitroBuildDirectory } from "#internal/application/paths.js";
@@ -12,7 +12,7 @@ import { computeChannelRouteRegistrations, syncChannelVirtualHandlers, } from "#
12
12
  import { prepareApplicationHost } from "#internal/nitro/host/prepare-application-host.js";
13
13
  import { prewarmAppSandboxes } from "#execution/sandbox/prewarm.js";
14
14
  import { syncScheduleTaskHandlers } from "#internal/nitro/host/schedule-task-routes.js";
15
- import { getDevelopmentEnvironmentFilePaths, reloadDevelopmentEnvironmentFiles, } from "#cli/dev/environment.js";
15
+ import { getDevelopmentEnvironmentFilePaths, loadDevelopmentEnvironmentFiles, } from "#cli/dev/environment.js";
16
16
  const DEBOUNCE_MS = 120;
17
17
  const WATCHED_LOCKFILE_NAMES = [
18
18
  "pnpm-lock.yaml",
@@ -76,7 +76,7 @@ export async function startAuthoredSourceWatcher(input) {
76
76
  console.log(`[ash:dev] change detected (${eventSummary} event${eventSummary === 1 ? "" : "s"}), rebuilding authored artifacts...`);
77
77
  try {
78
78
  if (hasEnvironmentChange) {
79
- reloadDevelopmentEnvironmentFiles(previousHost.appRoot);
79
+ loadDevelopmentEnvironmentFiles(previousHost.appRoot);
80
80
  }
81
81
  const nextHost = await prepareApplicationHost(previousHost.appRoot);
82
82
  await prewarmAppSandboxes({
@@ -1,4 +1,4 @@
1
- import { createCrossChannelReceiveFn } from "#channel/cross-channel-receive.js";
1
+ import { createCrossChannelReceiveFn, toCrossChannelTargets, } from "#channel/cross-channel-receive.js";
2
2
  import { createSendFn } from "#channel/send.js";
3
3
  import { createGetSessionFn } from "#channel/session.js";
4
4
  import { resolveNitroChannelRuntimeBundle } from "#internal/nitro/routes/runtime-stack.js";
@@ -41,7 +41,7 @@ export async function dispatchChannelRequest(event, routeKey, config) {
41
41
  const adapter = matchedChannel.adapter ?? { kind: "channel" };
42
42
  const send = createSendFn(bundle.runtime, adapter, matchedChannel.name);
43
43
  const getSession = createGetSessionFn(bundle.runtime);
44
- const receive = createCrossChannelReceiveFn(bundle.runtime, bundle.channels);
44
+ const receive = createCrossChannelReceiveFn(bundle.runtime, toCrossChannelTargets(bundle.channels));
45
45
  const args = {
46
46
  send,
47
47
  getSession,
@@ -12,7 +12,6 @@ export function resolveNitroCompiledArtifactsSource(config) {
12
12
  }
13
13
  return createDiskRuntimeCompiledArtifactsSource(appRoot, {
14
14
  moduleMapLoaderPath: config.moduleMapLoaderPath,
15
- moduleMapLoadMode: "authored-source",
16
15
  });
17
16
  }
18
17
  if (readBundledCompiledArtifacts() !== null) {
@@ -8,7 +8,7 @@
8
8
  * time. The banner builder omits any line whose binding the chunk already
9
9
  * provides.
10
10
  */
11
- export interface NodeEsmCompatBannerOptions {
11
+ interface NodeEsmCompatBannerOptions {
12
12
  /** Whether to expose a CommonJS `require` shim alongside the path globals. */
13
13
  readonly includeRequire?: boolean;
14
14
  }
@@ -29,7 +29,7 @@ export declare class RuntimeRegistryError extends Error {
29
29
  /**
30
30
  * Options accepted by {@link RuntimeRegistry.register}.
31
31
  */
32
- export interface RuntimeRegistryRegisterOptions {
32
+ interface RuntimeRegistryRegisterOptions {
33
33
  /** Source location attached to the error if registration fails. */
34
34
  readonly location?: RuntimeRegistryEntryLocation;
35
35
  /** Override the default "duplicate name" error message. */
@@ -74,3 +74,4 @@ export declare class RuntimeRegistry<TEntry> {
74
74
  */
75
75
  set(name: string, entry: TEntry): void;
76
76
  }
77
+ export {};
@@ -129,7 +129,7 @@ export interface VercelAshConnectionEntry {
129
129
  }
130
130
  export interface VercelAshChannelEntry {
131
131
  readonly name: string;
132
- readonly method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
132
+ readonly method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
133
133
  readonly urlPath: string;
134
134
  readonly type: VercelAshChannelType;
135
135
  /**
@@ -6,7 +6,6 @@ import type { JsonObject } from "#shared/json.js";
6
6
  export declare const ASH_SESSION_ID_HEADER = "x-ash-session-id";
7
7
  export declare const ASH_STREAM_FORMAT_HEADER = "x-ash-stream-format";
8
8
  export declare const ASH_STREAM_VERSION_HEADER = "x-ash-stream-version";
9
- export declare const ASH_WORKFLOW_ID_HEADER = "x-ash-workflow-id";
10
9
  export declare const ASH_MESSAGE_STREAM_CONTENT_TYPE = "application/x-ndjson; charset=utf-8";
11
10
  export declare const ASH_MESSAGE_STREAM_FORMAT = "ndjson";
12
11
  export declare const ASH_MESSAGE_STREAM_VERSION = "14";
@@ -96,18 +95,6 @@ export type HandleMessageRequestBody = {
96
95
  readonly message: string | UserContent;
97
96
  readonly clientContext?: string | readonly string[] | JsonObject;
98
97
  };
99
- /**
100
- * JSON response returned when the message route accepts a start or resume
101
- * request.
102
- */
103
- export type HandleMessageResponseBody = {
104
- readonly continuationToken: string;
105
- readonly ok: true;
106
- } | {
107
- readonly continuationToken: string;
108
- readonly ok: true;
109
- readonly sessionId: string;
110
- };
111
98
  /**
112
99
  * Stream event emitted when the durable message workflow session starts.
113
100
  */
@@ -365,7 +352,6 @@ export interface CompactionRequestedStreamEvent {
365
352
  modelId: string;
366
353
  sequence: number;
367
354
  sessionId: string;
368
- thresholdPercent: number;
369
355
  turnId: string;
370
356
  usageInputTokens: number | null;
371
357
  };
@@ -377,7 +363,6 @@ export interface CompactionRequestedStreamEvent {
377
363
  */
378
364
  export interface CompactionCompletedStreamEvent {
379
365
  data: {
380
- lastCompactionIndex: number;
381
366
  modelId: string;
382
367
  sequence: number;
383
368
  sessionId: string;
@@ -484,10 +469,6 @@ export type HandleMessageStreamEvent = (CompactionCompletedStreamEvent | Compact
484
469
  export type TimedHandleMessageStreamEvent = HandleMessageStreamEvent & {
485
470
  readonly meta: HandleMessageStreamEventMeta;
486
471
  };
487
- /**
488
- * Returns the stable stream route path for one message workflow session.
489
- */
490
- export declare function createMessageSessionStreamPath(sessionId: string): string;
491
472
  /**
492
473
  * Returns true when the current stream has reached a turn boundary or terminal
493
474
  * session outcome.
@@ -589,15 +570,6 @@ export declare function createActionResultEvent(input: {
589
570
  readonly stepIndex: number;
590
571
  readonly turnId: string;
591
572
  }): ActionResultStreamEvent;
592
- /**
593
- * Creates the `subagent.event` envelope wrapping one child event for the
594
- * parent's stream.
595
- */
596
- export declare function createSubagentChildEventEvent(input: {
597
- readonly callId: string;
598
- readonly event: HandleMessageStreamEvent;
599
- readonly subagentName: string;
600
- }): SubagentChildEventStreamEvent;
601
573
  /**
602
574
  * Creates the `subagent.called` event for one started child workflow session.
603
575
  */
@@ -708,7 +680,6 @@ export declare function createCompactionRequestedEvent(input: {
708
680
  readonly modelId: string;
709
681
  readonly sequence: number;
710
682
  readonly sessionId: string;
711
- readonly thresholdPercent: number;
712
683
  readonly turnId: string;
713
684
  readonly usageInputTokens: number | undefined;
714
685
  }): CompactionRequestedStreamEvent;
@@ -716,7 +687,6 @@ export declare function createCompactionRequestedEvent(input: {
716
687
  * Creates the `compaction.completed` event for one appended checkpoint.
717
688
  */
718
689
  export declare function createCompactionCompletedEvent(input: {
719
- readonly lastCompactionIndex: number;
720
690
  readonly modelId: string;
721
691
  readonly sequence: number;
722
692
  readonly sessionId: string;
@@ -753,7 +723,3 @@ export declare function timestampHandleMessageStreamEvent(event: HandleMessageSt
753
723
  * Encodes one message stream event as newline-delimited JSON.
754
724
  */
755
725
  export declare function encodeMessageStreamEvent(event: TimedHandleMessageStreamEvent): Uint8Array;
756
- /**
757
- * Encodes one stream event as newline-delimited JSON.
758
- */
759
- export declare function encodeAnyStreamEvent(event: unknown): Uint8Array;