veryfront 0.1.1100 → 0.1.1102

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 (64) hide show
  1. package/esm/deno.js +1 -1
  2. package/esm/src/agent/factory.d.ts.map +1 -1
  3. package/esm/src/agent/factory.js +2 -0
  4. package/esm/src/agent/hosted/cloud-runtime-system-messages.d.ts +5 -0
  5. package/esm/src/agent/hosted/cloud-runtime-system-messages.d.ts.map +1 -1
  6. package/esm/src/agent/hosted/cloud-runtime-system-messages.js +3 -2
  7. package/esm/src/agent/runtime/agent-invocation-contract.d.ts +1 -0
  8. package/esm/src/agent/runtime/agent-invocation-contract.d.ts.map +1 -1
  9. package/esm/src/agent/runtime/agent-invocation-contract.js +1 -0
  10. package/esm/src/agent/runtime/effective-agent-system.d.ts +8 -0
  11. package/esm/src/agent/runtime/effective-agent-system.d.ts.map +1 -0
  12. package/esm/src/agent/runtime/effective-agent-system.js +9 -0
  13. package/esm/src/internal-agents/run-stream.d.ts +1 -0
  14. package/esm/src/internal-agents/run-stream.d.ts.map +1 -1
  15. package/esm/src/internal-agents/run-stream.js +53 -0
  16. package/esm/src/internal-agents/run-system-prompt.d.ts +42 -0
  17. package/esm/src/internal-agents/run-system-prompt.d.ts.map +1 -0
  18. package/esm/src/internal-agents/run-system-prompt.js +109 -0
  19. package/esm/src/internal-agents/schema.d.ts +2 -0
  20. package/esm/src/internal-agents/schema.d.ts.map +1 -1
  21. package/esm/src/internal-agents/schema.js +1 -0
  22. package/esm/src/routing/api/context-builder.d.ts +23 -1
  23. package/esm/src/routing/api/context-builder.d.ts.map +1 -1
  24. package/esm/src/routing/api/context-builder.js +22 -1
  25. package/esm/src/routing/api/handler.d.ts +11 -1
  26. package/esm/src/routing/api/handler.d.ts.map +1 -1
  27. package/esm/src/routing/api/handler.js +46 -12
  28. package/esm/src/routing/api/module-loader/loader.d.ts +5 -0
  29. package/esm/src/routing/api/module-loader/loader.d.ts.map +1 -1
  30. package/esm/src/routing/api/module-loader/loader.js +37 -2
  31. package/esm/src/server/dev-server/middleware.d.ts.map +1 -1
  32. package/esm/src/server/dev-server/middleware.js +35 -7
  33. package/esm/src/server/handlers/request/agent-stream.handler.d.ts.map +1 -1
  34. package/esm/src/server/handlers/request/agent-stream.handler.js +1 -0
  35. package/esm/src/server/handlers/request/ssr/error-page-fallback.js +20 -3
  36. package/esm/src/server/handlers/request/ssr/ssr.handler.d.ts +0 -11
  37. package/esm/src/server/handlers/request/ssr/ssr.handler.d.ts.map +1 -1
  38. package/esm/src/server/handlers/request/ssr/ssr.handler.js +23 -1
  39. package/esm/src/transforms/esm/degraded-artifact.d.ts +15 -0
  40. package/esm/src/transforms/esm/degraded-artifact.d.ts.map +1 -0
  41. package/esm/src/transforms/esm/degraded-artifact.js +22 -0
  42. package/esm/src/transforms/esm/http-cache.d.ts.map +1 -1
  43. package/esm/src/transforms/esm/http-cache.js +47 -17
  44. package/esm/src/transforms/esm/import-parser.d.ts.map +1 -1
  45. package/esm/src/transforms/esm/import-parser.js +47 -1
  46. package/esm/src/transforms/esm/specifier-resolver.d.ts +21 -4
  47. package/esm/src/transforms/esm/specifier-resolver.d.ts.map +1 -1
  48. package/esm/src/transforms/esm/specifier-resolver.js +43 -23
  49. package/esm/src/transforms/import-rewriter/strategies/asset-strategy.d.ts +23 -0
  50. package/esm/src/transforms/import-rewriter/strategies/asset-strategy.d.ts.map +1 -0
  51. package/esm/src/transforms/import-rewriter/strategies/asset-strategy.js +49 -0
  52. package/esm/src/transforms/import-rewriter/strategies/index.d.ts +1 -0
  53. package/esm/src/transforms/import-rewriter/strategies/index.d.ts.map +1 -1
  54. package/esm/src/transforms/import-rewriter/strategies/index.js +1 -0
  55. package/esm/src/transforms/import-rewriter/unified-rewriter.d.ts.map +1 -1
  56. package/esm/src/transforms/import-rewriter/unified-rewriter.js +2 -0
  57. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/index.d.ts.map +1 -1
  58. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/index.js +2 -1
  59. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/nested-imports.d.ts +19 -0
  60. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/nested-imports.d.ts.map +1 -1
  61. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/nested-imports.js +23 -1
  62. package/esm/src/utils/version-constant.d.ts +1 -1
  63. package/esm/src/utils/version-constant.js +1 -1
  64. package/package.json +5 -5
package/esm/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.1.1100",
3
+ "version": "0.1.1102",
4
4
  "license": "Apache-2.0",
5
5
  "nodeModulesDir": "auto",
6
6
  "minimumDependencyAge": {
@@ -1 +1 @@
1
- {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/src/agent/factory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,KAAK,EACL,WAAW,EACX,eAAe,EAKhB,MAAM,YAAY,CAAC;AAqFpB,oBAAoB;AACpB,wBAAgB,KAAK,CAAC,MAAM,EAAE,WAAW,GAAG,KAAK,CAwNhD;AAcD;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,YAAY,CAAC,GACnD,eAAe,EAAE,CAanB"}
1
+ {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/src/agent/factory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,KAAK,EACL,WAAW,EACX,eAAe,EAKhB,MAAM,YAAY,CAAC;AAsFpB,oBAAoB;AACpB,wBAAgB,KAAK,CAAC,MAAM,EAAE,WAAW,GAAG,KAAK,CAyNhD;AAcD;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,YAAY,CAAC,GACnD,eAAe,EAAE,CAanB"}
@@ -13,6 +13,7 @@ import { createError, toError } from "../errors/index.js";
13
13
  import { COMMON_BLOCKED_PATTERNS, securityMiddleware } from "./middleware/security/validator.js";
14
14
  import { withSpan } from "../observability/tracing/otlp-setup.js";
15
15
  import { resolveConfiguredAgentModel } from "./runtime/model-resolution.js";
16
+ import { setEffectiveAgentSystem } from "./runtime/effective-agent-system.js";
16
17
  import { defineSchema } from "../schemas/index.js";
17
18
  import { getMessageSchema } from "./schemas/agent.schema.js";
18
19
  import { isRequestBodyTooLargeError, readBodyWithLimit, } from "../security/input-validation/limits.js";
@@ -204,6 +205,7 @@ export function agent(config) {
204
205
  return runtime.clearMemory();
205
206
  },
206
207
  };
208
+ setEffectiveAgentSystem(agentInstance, augmentedSystem);
207
209
  agentRegistry.register(id, agentInstance);
208
210
  return agentInstance;
209
211
  }
@@ -11,6 +11,11 @@ export type CreateVeryfrontCloudRuntimeSystemMessagesInput = {
11
11
  branchId?: string | null;
12
12
  environmentContext?: string;
13
13
  };
14
+ /** Builds the shared project-context prompt block (project reference + branch). */
15
+ export declare function buildProjectContextPromptBlock(input: {
16
+ projectId: string;
17
+ branchId?: string | null;
18
+ }): string;
14
19
  /** Create Veryfront Cloud runtime system messages. */
15
20
  export declare function createVeryfrontCloudRuntimeSystemMessages(input: CreateVeryfrontCloudRuntimeSystemMessagesInput): ChatSystemMessage[];
16
21
  /** Builds Veryfront Cloud runtime instructions. */
@@ -1 +1 @@
1
- {"version":3,"file":"cloud-runtime-system-messages.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/hosted/cloud-runtime-system-messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAEL,KAAK,8BAA8B,EACpC,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,uBAAuB,CAAC;AAEhF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAE3E,wEAAwE;AACxE,MAAM,MAAM,8CAA8C,GAAG;IAC3D,KAAK,EAAE,8BAA8B,CAAC;IACtC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,SAAS,sBAAsB,EAAE,CAAC;IAC3C,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAyBF,sDAAsD;AACtD,wBAAgB,yCAAyC,CACvD,KAAK,EAAE,8CAA8C,GACpD,iBAAiB,EAAE,CAsBrB;AAED,mDAAmD;AACnD,wBAAgB,sCAAsC,CACpD,KAAK,EAAE,kCAAkC,CAAC,8BAA8B,CAAC,GACxE,iBAAiB,EAAE,CASrB"}
1
+ {"version":3,"file":"cloud-runtime-system-messages.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/hosted/cloud-runtime-system-messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAEL,KAAK,8BAA8B,EACpC,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,uBAAuB,CAAC;AAEhF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAE3E,wEAAwE;AACxE,MAAM,MAAM,8CAA8C,GAAG;IAC3D,KAAK,EAAE,8BAA8B,CAAC;IACtC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,SAAS,sBAAsB,EAAE,CAAC;IAC3C,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AASF,mFAAmF;AACnF,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GACrD,MAAM,CAcR;AAED,sDAAsD;AACtD,wBAAgB,yCAAyC,CACvD,KAAK,EAAE,8CAA8C,GACpD,iBAAiB,EAAE,CAsBrB;AAED,mDAAmD;AACnD,wBAAgB,sCAAsC,CACpD,KAAK,EAAE,kCAAkC,CAAC,8BAA8B,CAAC,GACxE,iBAAiB,EAAE,CASrB"}
@@ -6,7 +6,8 @@ function createProjectInstructionsBlock(instructions) {
6
6
  content: `CRITICAL: You MUST follow these project-specific guidelines:\n\n${instructions}`,
7
7
  });
8
8
  }
9
- function createProjectContextBlock(input) {
9
+ /** Builds the shared project-context prompt block (project reference + branch). */
10
+ export function buildProjectContextPromptBlock(input) {
10
11
  const branchLine = input.branchId
11
12
  ? `branch_id: "${input.branchId}"`
12
13
  : "branch_id: main (no branch_id needed for file operations)";
@@ -27,7 +28,7 @@ export function createVeryfrontCloudRuntimeSystemMessages(input) {
27
28
  runtimeBlocks.push(createProjectInstructionsBlock(input.instructions));
28
29
  }
29
30
  if (input.projectId) {
30
- runtimeBlocks.push(createProjectContextBlock({
31
+ runtimeBlocks.push(buildProjectContextPromptBlock({
31
32
  projectId: input.projectId,
32
33
  branchId: input.branchId,
33
34
  }));
@@ -397,6 +397,7 @@ export type RuntimeAgentControlPlaneStreamRequest = {
397
397
  messages: RuntimeAgentRunInvocation["messages"];
398
398
  tools: RuntimeAgentRunInvocation["tools"];
399
399
  context: RuntimeAgentRunInvocation["context"];
400
+ runtimeTargetBranchId?: RuntimeAgentProjectContext["runtimeTargetBranchId"];
400
401
  credentials?: RuntimeAgentRunInvocation["credentials"];
401
402
  agentSource: RuntimeAgentRunInvocation["agentSource"];
402
403
  agentConfig?: RuntimeAgentRunInvocation["agentConfig"];
@@ -1 +1 @@
1
- {"version":3,"file":"agent-invocation-contract.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/agent-invocation-contract.ts"],"names":[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AAC,yBAAyB,CAAC,CAEpC;AAED,6DAA6D;AAC7D,wBAAsB,qCAAqC,CACzD,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,yBAAyB,GAAG,QAAQ,CAAC,CAK/C"}
1
+ {"version":3,"file":"agent-invocation-contract.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/agent-invocation-contract.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAuBnF,eAAO,MAAM,0BAA0B,gEAEtC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,0DAAyC,CAAC;AAE9E,eAAO,MAAM,+BAA+B,gEAAkD,CAAC;AAE/F;;GAEG;AACH,eAAO,MAAM,4BAA4B,0DAA8C,CAAC;AAExF,eAAO,MAAM,8BAA8B,gEAK1C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,2BAA2B,0DAA6C,CAAC;AAEtF,eAAO,MAAM,uBAAuB,gEAAkD,CAAC;AAEvF;;GAEG;AACH,eAAO,MAAM,oBAAoB,0DAAsC,CAAC;AAExE,eAAO,MAAM,6BAA6B,gEAKzC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,0DAA4C,CAAC;AASpF,eAAO,MAAM,yBAAyB;;;;;;GAWrC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;GAAwC,CAAC;AAE5E,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;GAuB5C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;GAA+C,CAAC;AAE1F,eAAO,MAAM,kCAAkC;;;;;;;;;;GAgB9C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;;GAAiD,CAAC;AAE9F,eAAO,MAAM,+BAA+B,gEAE3C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,4BAA4B,0DAA8C,CAAC;AAExF,KA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CAAC;IACtD,WAAW,CAAC,EAAE,yBAAyB,CAAC,aAAa,CAAC,CAAC;IACvD,cAAc,CAAC,EAAE,yBAAyB,CAAC,gBAAgB,CAAC,CAAC;CAC9D,CAAC;AAEF,yEAAyE;AACzE,wBAAgB,wDAAwD,CACtE,KAAK,EAAE,yBAAyB,GAC/B,qCAAqC,CAevC;AAED,2CAA2C;AAC3C,wBAAsB,8BAA8B,CAClD,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,yBAAyB,CAAC,CAEpC;AAED,6DAA6D;AAC7D,wBAAsB,qCAAqC,CACzD,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,yBAAyB,GAAG,QAAQ,CAAC,CAK/C"}
@@ -246,6 +246,7 @@ export function buildRuntimeAgentControlPlaneStreamRequestFromInvocation(input)
246
246
  messages: input.messages,
247
247
  tools: input.tools,
248
248
  context: input.context,
249
+ runtimeTargetBranchId: input.run.project.runtimeTargetBranchId ?? null,
249
250
  ...(input.credentials ? { credentials: input.credentials } : {}),
250
251
  agentSource: input.agentSource,
251
252
  ...(input.agentConfig ? { agentConfig: input.agentConfig } : {}),
@@ -0,0 +1,8 @@
1
+ import type { Agent } from "../types.js";
2
+ type AgentSystem = Agent["config"]["system"];
3
+ /** Records the system resolver used by an agent's private runtime. */
4
+ export declare function setEffectiveAgentSystem(agent: Agent, system: AgentSystem): void;
5
+ /** Returns the effective runtime system resolver, including through config-preserving wrappers. */
6
+ export declare function getEffectiveAgentSystem(agent: Agent): AgentSystem;
7
+ export {};
8
+ //# sourceMappingURL=effective-agent-system.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"effective-agent-system.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/effective-agent-system.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,KAAK,WAAW,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC;AAU7C,sEAAsE;AACtE,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI,CAE/E;AAED,mGAAmG;AACnG,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,KAAK,GAAG,WAAW,CAEjE"}
@@ -0,0 +1,9 @@
1
+ const EFFECTIVE_AGENT_SYSTEM = Symbol("veryfront.effectiveAgentSystem");
2
+ /** Records the system resolver used by an agent's private runtime. */
3
+ export function setEffectiveAgentSystem(agent, system) {
4
+ agent.config[EFFECTIVE_AGENT_SYSTEM] = system;
5
+ }
6
+ /** Returns the effective runtime system resolver, including through config-preserving wrappers. */
7
+ export function getEffectiveAgentSystem(agent) {
8
+ return agent.config[EFFECTIVE_AGENT_SYSTEM] ?? agent.config.system;
9
+ }
@@ -9,6 +9,7 @@ export interface RuntimeAgentStreamExecutionDeps {
9
9
  projectAgentSandbox?: {
10
10
  apiUrl?: string;
11
11
  authToken?: string;
12
+ branchId?: string | null;
12
13
  projectId?: string | null;
13
14
  sandboxEndpoint?: string;
14
15
  };
@@ -1 +1 @@
1
- {"version":3,"file":"run-stream.d.ts","sourceRoot":"","sources":["../../../src/src/internal-agents/run-stream.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,KAAK,EACV,KAAK,YAAY,IAAI,OAAO,EAC5B,KAAK,aAAa,EAEnB,MAAM,mBAAmB,CAAC;AAY3B,OAAO,KAAK,EACV,+BAA+B,EAC/B,8BAA8B,EAC/B,MAAM,qBAAqB,CAAC;AAU7B,OAAO,EAGL,KAAK,IAAI,EAGV,MAAM,kBAAkB,CAAC;AAe1B,OAAO,EAA0B,KAAK,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC3F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAsCxD,MAAM,WAAW,+BAA+B;IAC9C,cAAc,EAAE,sBAAsB,CAAC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,GAAG,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C,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;SAC9C,EACD,aAAa,CAAC,EAAE,MAAM,EACtB,uBAAuB,CAAC,EAAE,MAAM,EAChC,WAAW,CAAC,EAAE,WAAW,KACtB,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;KAC1C,CAAC;CACH;AAoCD,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,oBAAoB,EAC3B,cAAc,EAAE,sBAAsB,EACtC,2BAA2B,CAAC,EAAE,MAAM,EAAE,EACtC,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,GAAG,OAAO,CAAC;;cAsFrD;AAoXD,wBAAsB,gCAAgC,CACpD,KAAK,EAAE,oBAAoB,EAC3B,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,+BAA+B,GACpC,OAAO,CAAC,QAAQ,CAAC,CAqdnB"}
@@ -3,6 +3,8 @@ import { normalizeAgUiRuntimeMessages } from "../agent/ag-ui/runtime-support.js"
3
3
  import { compactForStep, estimateOverhead } from "../chat/message-prep.js";
4
4
  import { getRuntimeRemoteToolSources, } from "../agent/runtime/mcp-server-tool-sources.js";
5
5
  import { buildRuntimeUsageTraceAttributes } from "../agent/runtime/trace-usage.js";
6
+ import { getProviderNativeToolNames } from "../agent/runtime/provider-native-tool-inventory.js";
7
+ import { selectProviderCompatibleToolNames } from "../agent/runtime/provider-tool-compat.js";
6
8
  import { convertAgentRuntimeMessagesToProviderMessages, convertProviderMessagesToAgentRuntimeMessages, } from "../agent/runtime/message-adapter.js";
7
9
  import { createAgentServiceSandboxTools } from "../sandbox/index.js";
8
10
  import { tryResolve } from "../extensions/contracts.js";
@@ -15,6 +17,7 @@ import { addSpanEvent, setSpanAttributes, withSpan, } from "../observability/tra
15
17
  import { defineSchema, lazySchema } from "../schemas/index.js";
16
18
  import { createStreamTransformState, finalizeRunEvents, formatAgUiEvent, mapRuntimeEventToAgUi, parseSseJsonEvents, } from "./ag-ui-sse.js";
17
19
  import { AgentRunCancelledError } from "./session-manager.js";
20
+ import { createInternalAgentRunSystemPromptResolver } from "./run-system-prompt.js";
18
21
  import { serverLogger } from "../utils/index.js";
19
22
  const getAnyObjectSchema = defineSchema((v) => v.record(v.string(), v.unknown()));
20
23
  const anyObjectSchema = lazySchema(getAnyObjectSchema);
@@ -303,6 +306,23 @@ function applyRuntimeToolAllowlist(mergedTools, toolAllowlist, agent) {
303
306
  }
304
307
  return Object.fromEntries(Object.entries(mergedTools).filter(([toolName]) => allowedToolNames.has(toolName)));
305
308
  }
309
+ function getRequiredLocalToolNames(input) {
310
+ if (!input.mergedTools || input.mergedTools === true) {
311
+ return [];
312
+ }
313
+ return Object.entries(input.mergedTools)
314
+ .filter(([toolName, entry]) => {
315
+ if (entry && typeof entry === "object") {
316
+ return true;
317
+ }
318
+ if (Object.hasOwn(input.availableLocalTools, toolName)) {
319
+ return true;
320
+ }
321
+ const registryTool = toolRegistry.get(toolName);
322
+ return Boolean(registryTool && isToolVisibleTo(registryTool, { agentId: input.agent.id }));
323
+ })
324
+ .map(([toolName]) => toolName);
325
+ }
306
326
  function getServerResolvedProjectToolNames(forwardedProps) {
307
327
  const runtimeOverrides = isRecord(forwardedProps?.runtimeOverrides)
308
328
  ? forwardedProps.runtimeOverrides
@@ -430,10 +450,43 @@ export async function createRuntimeAgentStreamResponse(input, agent, deps) {
430
450
  const cappedProviderTools = runtimeToolAllowlist !== null && Array.isArray(agent.config.providerTools)
431
451
  ? agent.config.providerTools.filter((toolName) => typeof toolName === "string" && runtimeToolAllowlist.has(toolName))
432
452
  : undefined;
453
+ const effectiveProviderToolNames = cappedProviderTools ??
454
+ (Array.isArray(agent.config.providerTools)
455
+ ? agent.config.providerTools.filter((toolName) => typeof toolName === "string")
456
+ : []);
457
+ const modelSupportedProviderToolNames = new Set(getProviderNativeToolNames({ model: agent.config.model }));
458
+ const providerToolNames = effectiveProviderToolNames.filter((toolName) => modelSupportedProviderToolNames.has(toolName));
459
+ const mergedToolNames = mergedTools && mergedTools !== true ? Object.keys(mergedTools) : [];
460
+ const allowedRemoteToolNameSet = new Set(allowedRemoteToolNames ?? []);
461
+ const forwardedToolNames = (forwardedIntegrationToolDefs?.map((def) => def.name) ?? [])
462
+ .filter((toolName) => allowedRemoteToolNameSet.has(toolName));
463
+ const localToolNames = getRequiredLocalToolNames({
464
+ mergedTools,
465
+ availableLocalTools,
466
+ agent,
467
+ });
468
+ const runtimeToolNames = selectProviderCompatibleToolNames([
469
+ ...new Set([
470
+ ...mergedToolNames,
471
+ ...providerToolNames,
472
+ ...(allowedRemoteToolNames ?? []),
473
+ ...forwardedToolNames,
474
+ ]),
475
+ ].sort(), {
476
+ model: agent.config.model,
477
+ requiredToolNames: localToolNames,
478
+ });
433
479
  const runtimeAgent = {
434
480
  ...agent,
435
481
  config: {
436
482
  ...agent.config,
483
+ system: createInternalAgentRunSystemPromptResolver({
484
+ agent,
485
+ runInput: input,
486
+ projectId: deps.projectAgentSandbox?.projectId ?? null,
487
+ branchId: deps.projectAgentSandbox?.branchId,
488
+ toolNames: runtimeToolNames,
489
+ }),
437
490
  tools: mergedTools,
438
491
  ...(cappedProviderTools !== undefined ? { providerTools: cappedProviderTools } : {}),
439
492
  ...(allowedRemoteToolNames !== undefined
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Internal Agent Run System Prompt
3
+ *
4
+ * Composes the system prompt for project-runtime agent runs, mirroring the
5
+ * hosted chat runtime's instruction assembly. Before this, internal runs used
6
+ * the agent's authored instructions verbatim, so request-scoped agents (e.g.
7
+ * Studio-created project agents) never learned the project reference, branch,
8
+ * Studio environment context, or effective tool surface of the run they were
9
+ * executing in and asked users for values the harness already knew.
10
+ *
11
+ * The composed prompt extends the agent's resolved base instructions (which
12
+ * already include the factory's skill manifest for skill-enabled agents) with:
13
+ * - the shared project-context block (project reference + branch)
14
+ * - the requested model
15
+ * - the caller-supplied environment context (`studio_context` context item)
16
+ * - the effective run tool inventory
17
+ *
18
+ * @module
19
+ */
20
+ import type { Agent } from "../agent/index.js";
21
+ import type { RuntimeRunAgentInput } from "./schema.js";
22
+ /** Caller-supplied run context extracted from the `studio_context` item. */
23
+ export type InternalAgentStudioRunContext = {
24
+ environmentContext?: string;
25
+ projectId?: string;
26
+ branchId?: string | null;
27
+ };
28
+ /** Extracts the Studio-supplied run context from run context items. */
29
+ export declare function getInternalAgentStudioRunContext(context: RuntimeRunAgentInput["context"]): InternalAgentStudioRunContext;
30
+ /** Input payload for compose internal agent run system prompt. */
31
+ export type ComposeInternalAgentRunSystemPromptInput = {
32
+ agent: Agent;
33
+ runInput: RuntimeRunAgentInput;
34
+ projectId?: string | null;
35
+ branchId?: string | null;
36
+ toolNames: readonly string[];
37
+ };
38
+ /** Composes the internal agent run system prompt. */
39
+ export declare function composeInternalAgentRunSystemPrompt(input: ComposeInternalAgentRunSystemPromptInput): Promise<string>;
40
+ /** Creates a lazy system prompt resolver for an internal agent run. */
41
+ export declare function createInternalAgentRunSystemPromptResolver(input: ComposeInternalAgentRunSystemPromptInput): () => Promise<string>;
42
+ //# sourceMappingURL=run-system-prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-system-prompt.d.ts","sourceRoot":"","sources":["../../../src/src/internal-agents/run-system-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAU/C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAKxD,4EAA4E;AAC5E,MAAM,MAAM,6BAA6B,GAAG;IAC1C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CAAC;AAqBF,uEAAuE;AACvE,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,oBAAoB,CAAC,SAAS,CAAC,GACvC,6BAA6B,CAmB/B;AAYD,kEAAkE;AAClE,MAAM,MAAM,wCAAwC,GAAG;IACrD,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9B,CAAC;AAEF,qDAAqD;AACrD,wBAAsB,mCAAmC,CACvD,KAAK,EAAE,wCAAwC,GAC9C,OAAO,CAAC,MAAM,CAAC,CAwCjB;AAED,uEAAuE;AACvE,wBAAgB,0CAA0C,CACxD,KAAK,EAAE,wCAAwC,GAC9C,MAAM,OAAO,CAAC,MAAM,CAAC,CAEvB"}
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Internal Agent Run System Prompt
3
+ *
4
+ * Composes the system prompt for project-runtime agent runs, mirroring the
5
+ * hosted chat runtime's instruction assembly. Before this, internal runs used
6
+ * the agent's authored instructions verbatim, so request-scoped agents (e.g.
7
+ * Studio-created project agents) never learned the project reference, branch,
8
+ * Studio environment context, or effective tool surface of the run they were
9
+ * executing in and asked users for values the harness already knew.
10
+ *
11
+ * The composed prompt extends the agent's resolved base instructions (which
12
+ * already include the factory's skill manifest for skill-enabled agents) with:
13
+ * - the shared project-context block (project reference + branch)
14
+ * - the requested model
15
+ * - the caller-supplied environment context (`studio_context` context item)
16
+ * - the effective run tool inventory
17
+ *
18
+ * @module
19
+ */
20
+ import { buildProjectContextPromptBlock } from "../agent/hosted/cloud-runtime-system-messages.js";
21
+ import { createRuntimeAgentSystemMessages } from "../agent/runtime/agent-definition.js";
22
+ import { getEffectiveAgentSystem } from "../agent/runtime/effective-agent-system.js";
23
+ import { getRuntimeAgentMarkdownDefinition } from "../agent/runtime/agent-markdown-adapter.js";
24
+ import { createRuntimePromptBlock } from "../agent/runtime/prompt-block.js";
25
+ import { flattenSystemInstructions, withRuntimeToolInventory, } from "../agent/runtime/tool-inventory.js";
26
+ const STUDIO_CONTEXT_ITEM_TITLE = "studio_context";
27
+ const DEFAULT_SYSTEM_PROMPT = "You are a helpful assistant.";
28
+ function isRecord(value) {
29
+ return value !== null && typeof value === "object" && !Array.isArray(value);
30
+ }
31
+ function getNonEmptyString(value) {
32
+ if (typeof value !== "string") {
33
+ return undefined;
34
+ }
35
+ const trimmed = value.trim();
36
+ return trimmed.length > 0 ? trimmed : undefined;
37
+ }
38
+ function getStudioContextData(item) {
39
+ if (!isRecord(item) || item.type !== "json" || item.title !== STUDIO_CONTEXT_ITEM_TITLE) {
40
+ return undefined;
41
+ }
42
+ return isRecord(item.data) ? item.data : undefined;
43
+ }
44
+ /** Extracts the Studio-supplied run context from run context items. */
45
+ export function getInternalAgentStudioRunContext(context) {
46
+ for (const item of context) {
47
+ const data = getStudioContextData(item);
48
+ if (!data) {
49
+ continue;
50
+ }
51
+ const environmentContext = getNonEmptyString(data.environmentContext);
52
+ const projectId = getNonEmptyString(data.projectId);
53
+ const branchId = data.branchId === null ? null : getNonEmptyString(data.branchId);
54
+ return {
55
+ ...(environmentContext ? { environmentContext } : {}),
56
+ ...(projectId ? { projectId } : {}),
57
+ ...(branchId !== undefined ? { branchId } : {}),
58
+ };
59
+ }
60
+ return {};
61
+ }
62
+ async function resolveBaseSystemPrompt(system) {
63
+ if (typeof system === "string") {
64
+ return system;
65
+ }
66
+ if (typeof system === "function") {
67
+ return await system();
68
+ }
69
+ return DEFAULT_SYSTEM_PROMPT;
70
+ }
71
+ /** Composes the internal agent run system prompt. */
72
+ export async function composeInternalAgentRunSystemPrompt(input) {
73
+ const baseInstructions = await resolveBaseSystemPrompt(getEffectiveAgentSystem(input.agent));
74
+ const studioContext = getInternalAgentStudioRunContext(input.runInput.context);
75
+ const projectId = input.projectId ?? studioContext.projectId;
76
+ const runtimeBlocks = [];
77
+ if (projectId) {
78
+ runtimeBlocks.push(buildProjectContextPromptBlock({
79
+ projectId,
80
+ branchId: input.branchId !== undefined ? input.branchId : studioContext.branchId ?? null,
81
+ }));
82
+ }
83
+ if (input.agent.config.model) {
84
+ runtimeBlocks.push(createRuntimePromptBlock({
85
+ name: "runtime_info",
86
+ content: `model: "${input.agent.config.model}"`,
87
+ }));
88
+ }
89
+ const definition = getRuntimeAgentMarkdownDefinition(input.agent);
90
+ const messages = createRuntimeAgentSystemMessages({
91
+ agent: {
92
+ ...(definition ?? {
93
+ id: input.agent.id,
94
+ name: input.agent.config.name ?? input.agent.id,
95
+ description: input.agent.config.description ?? "",
96
+ }),
97
+ instructions: baseInstructions,
98
+ },
99
+ runtimeBlocks,
100
+ ...(studioContext.environmentContext
101
+ ? { environmentContext: studioContext.environmentContext }
102
+ : {}),
103
+ });
104
+ return flattenSystemInstructions(withRuntimeToolInventory(messages, input.toolNames));
105
+ }
106
+ /** Creates a lazy system prompt resolver for an internal agent run. */
107
+ export function createInternalAgentRunSystemPromptResolver(input) {
108
+ return () => composeInternalAgentRunSystemPrompt(input);
109
+ }
@@ -240,6 +240,7 @@ export declare const getInternalAgentControlPlaneStreamRequestSchema: () => Sche
240
240
  description: Schema<string>;
241
241
  value: Schema<string>;
242
242
  }>)[]>;
243
+ runtimeTargetBranchId: Schema<string | null | undefined>;
243
244
  agentSource: Schema<import("../extensions/schema/schema-validator.js").InferShape<{
244
245
  type: Schema<"branch">;
245
246
  branch: Schema<string>;
@@ -352,6 +353,7 @@ export declare const getInternalAgentStreamRequestSchema: () => Schema<import(".
352
353
  description: Schema<string>;
353
354
  value: Schema<string>;
354
355
  }>)[]>;
356
+ runtimeTargetBranchId: Schema<string | null | undefined>;
355
357
  agentSource: Schema<import("../extensions/schema/schema-validator.js").InferShape<{
356
358
  type: Schema<"branch">;
357
359
  branch: Schema<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/src/internal-agents/schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,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QtD,CAAC;AAEF,eAAO,MAAM,+CAA+C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmC3D,CAAC;AAEF,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAkD,CAAC;AAqNnG,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,WAAW,CAAC,UAAU,CAAC,OAAO,mCAAmC,CAAC,CAAC,GACzE,kBAAkB,CAWpB;AAED,eAAO,MAAM,qBAAqB;;;;;GAYjC,CAAC;AAEF,OAAO,EAAE,kCAAkC,EAAE,CAAC;AAC9C,YAAY,EAAE,yBAAyB,EAAE,CAAC;AAC1C,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,4BAA4B,CAAC,CAAC,CAAC;AAC/F,MAAM,MAAM,kBAAkB,GAAG,sBAAsB,CAAC;AACxD,MAAM,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AACtD,MAAM,MAAM,0BAA0B,GAAG,WAAW,CAClD,UAAU,CAAC,OAAO,mCAAmC,CAAC,CACvD,CAAC;AACF,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC,CAAC;AAGjF,YAAY,EAAE,MAAM,EAAE,CAAC"}
@@ -40,6 +40,7 @@ export const getInternalAgentControlPlaneStreamRequestSchema = defineSchema((v)
40
40
  messages: v.array(v.union([getRuntimeMessageSchema(), getInternalAgentCompatibilityMessageSchema()])).max(MAX_RUNTIME_MESSAGES),
41
41
  tools: v.array(getRuntimeInjectedToolSchema()).max(50).default([]),
42
42
  context: v.array(getRuntimeContextSchema()).max(10).default([]).refine((value) => isWithinJsonSizeLimit(value, 65_536), { message: "context must be less than 64 KB total" }),
43
+ runtimeTargetBranchId: v.string().uuid().nullable().optional(),
43
44
  agentSource: getRuntimeAgentSourceContextSchema(),
44
45
  agentConfig: getRuntimeAgentMarkdownDefinitionSchema().optional().refine((value) => value === undefined || isWithinJsonSizeLimit(value, MAX_AGENT_CONFIG_BYTES), { message: "agentConfig must be less than 64 KB" }),
45
46
  credentials: getRuntimeAgentCredentialsSchema().optional(),
@@ -11,10 +11,32 @@ export interface APIContext {
11
11
  cookies: Record<string, string>;
12
12
  headers: Headers;
13
13
  url: URL;
14
- json: (data: unknown, init?: ResponseInit) => Response;
14
+ /**
15
+ * Read the request body as JSON, or build a JSON response.
16
+ *
17
+ * `ctx.json()` with no arguments parses and returns the request body.
18
+ * `ctx.json(data, init?)` returns a JSON `Response`.
19
+ */
20
+ json: {
21
+ (): Promise<unknown>;
22
+ (data: unknown, init?: ResponseInit): Response;
23
+ };
15
24
  text: (data: string, init?: ResponseInit) => Response;
16
25
  fs: FileSystemAdapter;
17
26
  }
27
+ /**
28
+ * Build the `ctx.json` helper for a request.
29
+ *
30
+ * Overloaded on arity. `ctx.json(data)` builds a response; `ctx.json()` reads
31
+ * the request body, which is what handlers reach for, and what the zero-arg
32
+ * form was previously misread as. It used to stringify `undefined` into a
33
+ * Response, so `await ctx.json()` yielded a Response object that serialised
34
+ * back out as `{}` and silently dropped every posted payload.
35
+ *
36
+ * Exported because the isolation Worker builds its own context and has to
37
+ * behave identically. Handlers must not care which one ran them.
38
+ */
39
+ export declare function createJsonHelper(request: Request): APIContext["json"];
18
40
  export declare function createContext(request: Request, match: RouteMatch, fs: FileSystemAdapter): APIContext;
19
41
  /**
20
42
  * @deprecated Use {@link flattenRouteParams} directly. Kept as a thin alias so
@@ -1 +1 @@
1
- {"version":3,"file":"context-builder.d.ts","sourceRoot":"","sources":["../../../../src/src/routing/api/context-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EA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A6B,CAAC;AAG3D,OAAO,EAAE,YAAY,EAAE,CAAC;AAExB,mDAAmD;AACnD,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,OAAO,CAAC;IACb,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IAC1C,KAAK,EAAE,eAAe,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,GAAG,CAAC;IACT;;;;;OAKG;IACH,IAAI,EAAE;QACJ,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;QACrB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,YAAY,GAAG,QAAQ,CAAC;KAChD,CAAC;IACF,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,YAAY,KAAK,QAAQ,CAAC;IACtD,EAAE,EAAE,iBAAiB,CAAC;CACvB;AAgBD;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,CAUrE;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,UAAU,EACjB,EAAE,EAAE,iBAAiB,GACpB,UAAU,CAmBZ;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,GACxC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAExB"}
@@ -10,9 +10,30 @@ function createResponse(body, contentType, init) {
10
10
  },
11
11
  });
12
12
  }
13
+ /**
14
+ * Build the `ctx.json` helper for a request.
15
+ *
16
+ * Overloaded on arity. `ctx.json(data)` builds a response; `ctx.json()` reads
17
+ * the request body, which is what handlers reach for, and what the zero-arg
18
+ * form was previously misread as. It used to stringify `undefined` into a
19
+ * Response, so `await ctx.json()` yielded a Response object that serialised
20
+ * back out as `{}` and silently dropped every posted payload.
21
+ *
22
+ * Exported because the isolation Worker builds its own context and has to
23
+ * behave identically. Handlers must not care which one ran them.
24
+ */
25
+ export function createJsonHelper(request) {
26
+ function json(...args) {
27
+ if (args.length === 0)
28
+ return request.json();
29
+ const [data, init] = args;
30
+ return createResponse(JSON.stringify(data), "application/json", init);
31
+ }
32
+ return json;
33
+ }
13
34
  export function createContext(request, match, fs) {
14
35
  const url = new URL(request.url);
15
- const json = (data, init) => createResponse(JSON.stringify(data), "application/json", init);
36
+ const json = createJsonHelper(request);
16
37
  const text = (data, init) => createResponse(data, "text/plain", init);
17
38
  return {
18
39
  request,
@@ -6,6 +6,17 @@ import { loadHandlerModule } from "./module-loader/loader.js";
6
6
  import { discoverAppRoutes, discoverPagesRoutes } from "./route-discovery.js";
7
7
  import type { HandlerContext } from "../../types/index.js";
8
8
  export type { APIContext, APIRoute };
9
+ /**
10
+ * Reduce a module load error to something safe to put in a response body.
11
+ *
12
+ * The message is worth returning, since it usually names a syntax or import
13
+ * error the developer can act on. The rest of it is not: a raw load error
14
+ * carries the temp directory the bundle was written to, absolute paths into the
15
+ * framework install, and a full stack trace. A path inside the project survives
16
+ * as a project-relative one, because that is the part that identifies the file
17
+ * to fix.
18
+ */
19
+ export declare function sanitizeLoadErrorForResponse(message: string, projectDir?: string): string;
9
20
  /**
10
21
  * Injection interface for testing APIRouteHandler dependencies
11
22
  */
@@ -31,7 +42,6 @@ export declare class APIRouteHandler {
31
42
  private projectDir;
32
43
  private router;
33
44
  private routeCache;
34
- private lastErrorMessage;
35
45
  private activeRequests;
36
46
  private destroyRequested;
37
47
  private destroyed;
@@ -1 +1 @@
1
- {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/src/routing/api/handler.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCA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