veryfront 0.1.635 → 0.1.637

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 (88) hide show
  1. package/esm/cli/commands/serve/command.d.ts.map +1 -1
  2. package/esm/cli/commands/serve/command.js +2 -1
  3. package/esm/deno.js +1 -1
  4. package/esm/src/cache/distributed-cache-init.d.ts +11 -2
  5. package/esm/src/cache/distributed-cache-init.d.ts.map +1 -1
  6. package/esm/src/cache/distributed-cache-init.js +2 -14
  7. package/esm/src/channels/control-plane.d.ts +5 -5
  8. package/esm/src/embedding/chunk.js +4 -2
  9. package/esm/src/errors/error-registry/agent.d.ts +16 -0
  10. package/esm/src/errors/error-registry/agent.d.ts.map +1 -0
  11. package/esm/src/errors/error-registry/agent.js +52 -0
  12. package/esm/src/errors/error-registry/boundary.d.ts +16 -0
  13. package/esm/src/errors/error-registry/boundary.d.ts.map +1 -0
  14. package/esm/src/errors/error-registry/boundary.js +52 -0
  15. package/esm/src/errors/error-registry/build.d.ts +20 -0
  16. package/esm/src/errors/error-registry/build.d.ts.map +1 -0
  17. package/esm/src/errors/error-registry/build.js +68 -0
  18. package/esm/src/errors/error-registry/config.d.ts +22 -0
  19. package/esm/src/errors/error-registry/config.d.ts.map +1 -0
  20. package/esm/src/errors/error-registry/config.js +70 -0
  21. package/esm/src/errors/error-registry/deploy.d.ts +12 -0
  22. package/esm/src/errors/error-registry/deploy.d.ts.map +1 -0
  23. package/esm/src/errors/error-registry/deploy.js +36 -0
  24. package/esm/src/errors/error-registry/dev.d.ts +14 -0
  25. package/esm/src/errors/error-registry/dev.d.ts.map +1 -0
  26. package/esm/src/errors/error-registry/dev.js +44 -0
  27. package/esm/src/errors/error-registry/general.d.ts +29 -0
  28. package/esm/src/errors/error-registry/general.d.ts.map +1 -0
  29. package/esm/src/errors/error-registry/general.js +92 -0
  30. package/esm/src/errors/error-registry/module.d.ts +16 -0
  31. package/esm/src/errors/error-registry/module.d.ts.map +1 -0
  32. package/esm/src/errors/error-registry/module.js +52 -0
  33. package/esm/src/errors/error-registry/route.d.ts +16 -0
  34. package/esm/src/errors/error-registry/route.d.ts.map +1 -0
  35. package/esm/src/errors/error-registry/route.js +52 -0
  36. package/esm/src/errors/error-registry/runtime.d.ts +18 -0
  37. package/esm/src/errors/error-registry/runtime.d.ts.map +1 -0
  38. package/esm/src/errors/error-registry/runtime.js +60 -0
  39. package/esm/src/errors/error-registry/server.d.ts +39 -0
  40. package/esm/src/errors/error-registry/server.d.ts.map +1 -0
  41. package/esm/src/errors/error-registry/server.js +129 -0
  42. package/esm/src/errors/error-registry.d.ts +79 -157
  43. package/esm/src/errors/error-registry.d.ts.map +1 -1
  44. package/esm/src/errors/error-registry.js +37 -706
  45. package/esm/src/errors/logging.d.ts.map +1 -1
  46. package/esm/src/errors/logging.js +7 -3
  47. package/esm/src/integrations/schema.d.ts +4 -4
  48. package/esm/src/internal-agents/control-plane-auth.d.ts +1 -1
  49. package/esm/src/internal-agents/run-stream.d.ts.map +1 -1
  50. package/esm/src/internal-agents/run-stream.js +15 -1
  51. package/esm/src/oauth/index.d.ts +1 -0
  52. package/esm/src/oauth/index.d.ts.map +1 -1
  53. package/esm/src/oauth/token-store/index.d.ts +1 -0
  54. package/esm/src/oauth/token-store/index.d.ts.map +1 -1
  55. package/esm/src/oauth/token-store/memory.d.ts +26 -4
  56. package/esm/src/oauth/token-store/memory.d.ts.map +1 -1
  57. package/esm/src/oauth/token-store/memory.js +42 -5
  58. package/esm/src/observability/log-buffer.d.ts.map +1 -1
  59. package/esm/src/observability/log-buffer.js +7 -1
  60. package/esm/src/platform/adapters/redis/modules.d.ts.map +1 -1
  61. package/esm/src/platform/adapters/redis/modules.js +3 -10
  62. package/esm/src/security/sandbox/project-worker.d.ts.map +1 -1
  63. package/esm/src/security/sandbox/project-worker.js +0 -1
  64. package/esm/src/server/dev-server/server.d.ts.map +1 -1
  65. package/esm/src/server/dev-server/server.js +2 -1
  66. package/esm/src/server/distributed-cache-initializers.d.ts +13 -0
  67. package/esm/src/server/distributed-cache-initializers.d.ts.map +1 -0
  68. package/esm/src/server/distributed-cache-initializers.js +22 -0
  69. package/esm/src/server/handlers/request/agent-stream.handler.d.ts.map +1 -1
  70. package/esm/src/server/handlers/request/agent-stream.handler.js +56 -16
  71. package/esm/src/server/index.d.ts +1 -0
  72. package/esm/src/server/index.d.ts.map +1 -1
  73. package/esm/src/server/index.js +1 -0
  74. package/esm/src/server/production-server.d.ts.map +1 -1
  75. package/esm/src/server/production-server.js +2 -1
  76. package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.d.ts.map +1 -1
  77. package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.js +2 -2
  78. package/esm/src/utils/logger/logger.d.ts.map +1 -1
  79. package/esm/src/utils/logger/logger.js +15 -5
  80. package/esm/src/utils/logger/redact.d.ts +64 -0
  81. package/esm/src/utils/logger/redact.d.ts.map +1 -0
  82. package/esm/src/utils/logger/redact.js +235 -0
  83. package/esm/src/utils/redis-client.d.ts.map +1 -1
  84. package/esm/src/utils/redis-client.js +0 -3
  85. package/esm/src/utils/version-constant.d.ts +1 -1
  86. package/esm/src/utils/version-constant.js +1 -1
  87. package/esm/src/workflow/schemas/workflow.schema.d.ts +4 -4
  88. package/package.json +2 -1
@@ -1 +1 @@
1
- {"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../../src/src/errors/logging.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,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,CAMN"}
@@ -6,6 +6,7 @@
6
6
  */
7
7
  import { isProduction } from "../platform/environment.js";
8
8
  import { serverLogger } from "../utils/logger/logger.js";
9
+ import { redactSensitive } from "../utils/logger/redact.js";
9
10
  function toContextRecord(value) {
10
11
  return value && typeof value === "object" && !Array.isArray(value)
11
12
  ? value
@@ -30,6 +31,9 @@ function mergeContext(errorContext, extraContext) {
30
31
  */
31
32
  export function logError(error, context) {
32
33
  const mergedContext = mergeContext(error.context, context);
34
+ // Redact once and reuse for both the production JSON entry and the dev-mode
35
+ // human-readable dump, so neither path can emit unredacted credentials.
36
+ const safeContext = redactSensitive(mergedContext);
33
37
  const entry = {
34
38
  level: "error",
35
39
  slug: error.slug,
@@ -40,7 +44,7 @@ export function logError(error, context) {
40
44
  status: error.status,
41
45
  docs: error.getDocsUrl(),
42
46
  timestamp: new Date().toISOString(),
43
- context: mergedContext,
47
+ context: safeContext,
44
48
  };
45
49
  if (isProduction()) {
46
50
  // Direct JSON output — this module owns its own structured format
@@ -57,8 +61,8 @@ export function logError(error, context) {
57
61
  serverLogger.error(` 💡 Suggestion: ${error.suggestion}`);
58
62
  }
59
63
  serverLogger.error(` 📚 Docs: ${entry.docs}`);
60
- if (mergedContext) {
61
- serverLogger.error(` Context: ${JSON.stringify(mergedContext, null, 2)}`);
64
+ if (safeContext) {
65
+ serverLogger.error(` Context: ${JSON.stringify(safeContext, null, 2)}`);
62
66
  }
63
67
  }
64
68
  }
@@ -1,7 +1,7 @@
1
1
  import type { InferSchema } from "../extensions/schema/index.js";
2
- export declare const getIntegrationNameSchema: () => import("../internal-agents/schema.js").Schema<"github" | "twitter" | "anthropic" | "gmail" | "slack" | "calendar" | "jira" | "notion" | "servicenow" | "confluence" | "linear" | "gitlab" | "outlook" | "teams" | "figma" | "sheets" | "airtable" | "supabase" | "neon" | "sharepoint" | "stripe" | "salesforce" | "onedrive" | "bitbucket" | "sentry" | "posthog" | "zendesk" | "asana" | "harvest" | "monday" | "zoom" | "trello" | "box" | "shopify" | "clickup" | "intercom" | "pipedrive" | "mailchimp" | "webex" | "freshdesk" | "quickbooks" | "xero" | "drive" | "docs-google" | "snowflake" | "mixpanel" | "twilio" | "aws">;
2
+ export declare const getIntegrationNameSchema: () => import("../internal-agents/schema.js").Schema<"github" | "anthropic" | "gmail" | "slack" | "calendar" | "jira" | "notion" | "servicenow" | "confluence" | "linear" | "gitlab" | "outlook" | "teams" | "figma" | "sheets" | "airtable" | "supabase" | "neon" | "sharepoint" | "stripe" | "salesforce" | "twitter" | "onedrive" | "bitbucket" | "sentry" | "posthog" | "zendesk" | "asana" | "harvest" | "monday" | "zoom" | "trello" | "box" | "shopify" | "clickup" | "intercom" | "pipedrive" | "mailchimp" | "webex" | "freshdesk" | "quickbooks" | "xero" | "drive" | "docs-google" | "snowflake" | "mixpanel" | "twilio" | "aws">;
3
3
  /** Zod schema for integration name. */
4
- export declare const IntegrationNameSchema: import("../internal-agents/schema.js").Schema<"github" | "twitter" | "anthropic" | "gmail" | "slack" | "calendar" | "jira" | "notion" | "servicenow" | "confluence" | "linear" | "gitlab" | "outlook" | "teams" | "figma" | "sheets" | "airtable" | "supabase" | "neon" | "sharepoint" | "stripe" | "salesforce" | "onedrive" | "bitbucket" | "sentry" | "posthog" | "zendesk" | "asana" | "harvest" | "monday" | "zoom" | "trello" | "box" | "shopify" | "clickup" | "intercom" | "pipedrive" | "mailchimp" | "webex" | "freshdesk" | "quickbooks" | "xero" | "drive" | "docs-google" | "snowflake" | "mixpanel" | "twilio" | "aws">;
4
+ export declare const IntegrationNameSchema: import("../internal-agents/schema.js").Schema<"github" | "anthropic" | "gmail" | "slack" | "calendar" | "jira" | "notion" | "servicenow" | "confluence" | "linear" | "gitlab" | "outlook" | "teams" | "figma" | "sheets" | "airtable" | "supabase" | "neon" | "sharepoint" | "stripe" | "salesforce" | "twitter" | "onedrive" | "bitbucket" | "sentry" | "posthog" | "zendesk" | "asana" | "harvest" | "monday" | "zoom" | "trello" | "box" | "shopify" | "clickup" | "intercom" | "pipedrive" | "mailchimp" | "webex" | "freshdesk" | "quickbooks" | "xero" | "drive" | "docs-google" | "snowflake" | "mixpanel" | "twilio" | "aws">;
5
5
  export declare const getEnvVarSchema: () => import("../internal-agents/schema.js").Schema<import("../extensions/schema/schema-validator.js").InferShape<{
6
6
  name: import("../internal-agents/schema.js").Schema<string>;
7
7
  description: import("../internal-agents/schema.js").Schema<string>;
@@ -412,7 +412,7 @@ export declare const IntegrationPromptSchema: import("../internal-agents/schema.
412
412
  icon: import("../internal-agents/schema.js").Schema<string | undefined>;
413
413
  }>>;
414
414
  export declare const getIntegrationConfigSchema: () => import("../internal-agents/schema.js").Schema<import("../extensions/schema/schema-validator.js").InferShape<{
415
- name: import("../internal-agents/schema.js").Schema<"github" | "twitter" | "anthropic" | "gmail" | "slack" | "calendar" | "jira" | "notion" | "servicenow" | "confluence" | "linear" | "gitlab" | "outlook" | "teams" | "figma" | "sheets" | "airtable" | "supabase" | "neon" | "sharepoint" | "stripe" | "salesforce" | "onedrive" | "bitbucket" | "sentry" | "posthog" | "zendesk" | "asana" | "harvest" | "monday" | "zoom" | "trello" | "box" | "shopify" | "clickup" | "intercom" | "pipedrive" | "mailchimp" | "webex" | "freshdesk" | "quickbooks" | "xero" | "drive" | "docs-google" | "snowflake" | "mixpanel" | "twilio" | "aws">;
415
+ name: import("../internal-agents/schema.js").Schema<"github" | "anthropic" | "gmail" | "slack" | "calendar" | "jira" | "notion" | "servicenow" | "confluence" | "linear" | "gitlab" | "outlook" | "teams" | "figma" | "sheets" | "airtable" | "supabase" | "neon" | "sharepoint" | "stripe" | "salesforce" | "twitter" | "onedrive" | "bitbucket" | "sentry" | "posthog" | "zendesk" | "asana" | "harvest" | "monday" | "zoom" | "trello" | "box" | "shopify" | "clickup" | "intercom" | "pipedrive" | "mailchimp" | "webex" | "freshdesk" | "quickbooks" | "xero" | "drive" | "docs-google" | "snowflake" | "mixpanel" | "twilio" | "aws">;
416
416
  displayName: import("../internal-agents/schema.js").Schema<string>;
417
417
  icon: import("../internal-agents/schema.js").Schema<string | undefined>;
418
418
  description: import("../internal-agents/schema.js").Schema<string>;
@@ -535,7 +535,7 @@ export declare const getIntegrationConfigSchema: () => import("../internal-agent
535
535
  }>>;
536
536
  /** Zod schema for integration config. */
537
537
  export declare const IntegrationConfigSchema: import("../internal-agents/schema.js").Schema<import("../extensions/schema/schema-validator.js").InferShape<{
538
- name: import("../internal-agents/schema.js").Schema<"github" | "twitter" | "anthropic" | "gmail" | "slack" | "calendar" | "jira" | "notion" | "servicenow" | "confluence" | "linear" | "gitlab" | "outlook" | "teams" | "figma" | "sheets" | "airtable" | "supabase" | "neon" | "sharepoint" | "stripe" | "salesforce" | "onedrive" | "bitbucket" | "sentry" | "posthog" | "zendesk" | "asana" | "harvest" | "monday" | "zoom" | "trello" | "box" | "shopify" | "clickup" | "intercom" | "pipedrive" | "mailchimp" | "webex" | "freshdesk" | "quickbooks" | "xero" | "drive" | "docs-google" | "snowflake" | "mixpanel" | "twilio" | "aws">;
538
+ name: import("../internal-agents/schema.js").Schema<"github" | "anthropic" | "gmail" | "slack" | "calendar" | "jira" | "notion" | "servicenow" | "confluence" | "linear" | "gitlab" | "outlook" | "teams" | "figma" | "sheets" | "airtable" | "supabase" | "neon" | "sharepoint" | "stripe" | "salesforce" | "twitter" | "onedrive" | "bitbucket" | "sentry" | "posthog" | "zendesk" | "asana" | "harvest" | "monday" | "zoom" | "trello" | "box" | "shopify" | "clickup" | "intercom" | "pipedrive" | "mailchimp" | "webex" | "freshdesk" | "quickbooks" | "xero" | "drive" | "docs-google" | "snowflake" | "mixpanel" | "twilio" | "aws">;
539
539
  displayName: import("../internal-agents/schema.js").Schema<string>;
540
540
  icon: import("../internal-agents/schema.js").Schema<string | undefined>;
541
541
  description: import("../internal-agents/schema.js").Schema<string>;
@@ -12,7 +12,7 @@ export declare function verifyControlPlaneRequest(req: Request, ctx: HandlerCont
12
12
  iss: import("./schema.js").Schema<string>;
13
13
  aud: import("./schema.js").Schema<string>;
14
14
  sub: import("./schema.js").Schema<string>;
15
- surface: import("./schema.js").Schema<"mcp" | "studio" | "channels" | "a2a">;
15
+ surface: import("./schema.js").Schema<"mcp" | "channels" | "studio" | "a2a">;
16
16
  project_id: import("./schema.js").Schema<string>;
17
17
  request_hash: import("./schema.js").Schema<string>;
18
18
  iat: import("./schema.js").Schema<number>;
@@ -1 +1 @@
1
- {"version":3,"file":"run-stream.d.ts","sourceRoot":"","sources":["../../../src/src/internal-agents/run-stream.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,KAAK,EACV,KAAK,YAAY,IAAI,OAAO,EAC5B,KAAK,aAAa,EAEnB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EACV,+BAA+B,EAC/B,8BAA8B,EAC/B,MAAM,qBAAqB,CAAC;AAkB7B,OAAO,EAA0B,KAAK,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC3F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAuBxD,MAAM,WAAW,+BAA+B;IAC9C,cAAc,EAAE,sBAAsB,CAAC;IACvC,mBAAmB,CAAC,EAAE;QACpB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC;IACF,cAAc,CAAC,EAAE,+BAA+B,CAAC,gBAAgB,CAAC,CAAC;IACnE,8BAA8B,CAAC,EAAE,CAC/B,KAAK,EAAE,+BAA+B,KACnC,OAAO,CAAC,8BAA8B,CAAC,CAAC;IAC7C,aAAa,CAAC,EAAE,CACd,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,KAClC;QACH,MAAM,EAAE,CACN,QAAQ,EAAE,OAAO,EAAE,EACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MA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Aa,CAAC,EAAE,CACd,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,KAClC;QACH,MAAM,EAAE,CACN,QAAQ,EAAE,OAAO,EAAE,EACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,SAAS,CAAC,EAAE;YACV,QAAQ,CAAC,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;AA6QD,wBAAsB,gCAAgC,CACpD,KAAK,EAAE,oBAAoB,EAC3B,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,+BAA+B,GACpC,OAAO,CAAC,QAAQ,CAAC,CA0SnB"}
@@ -20,6 +20,16 @@ function getAgentAllowedRemoteToolNames(agent) {
20
20
  const raw = agent.config.allowedRemoteTools;
21
21
  return Array.isArray(raw) && raw.every((toolName) => typeof toolName === "string") ? raw : [];
22
22
  }
23
+ function mergeRemoteToolNames(source, forwarded) {
24
+ const merged = new Set();
25
+ for (const toolName of source) {
26
+ merged.add(toolName);
27
+ }
28
+ for (const toolName of forwarded) {
29
+ merged.add(toolName);
30
+ }
31
+ return [...merged];
32
+ }
23
33
  function createInjectedStudioTool(runId, toolName, description, parameters, sessionManager) {
24
34
  return {
25
35
  id: toolName,
@@ -225,7 +235,11 @@ export async function createRuntimeAgentStreamResponse(input, agent, deps) {
225
235
  runId: input.runId,
226
236
  threadId: input.threadId,
227
237
  });
228
- const allowedRemoteToolNames = getAllowedRemoteToolNames(input.forwardedProps);
238
+ const forwardedAllowedRemoteToolNames = getAllowedRemoteToolNames(input.forwardedProps);
239
+ const sourceAllowedRemoteToolNames = getAgentAllowedRemoteToolNames(agent);
240
+ const allowedRemoteToolNames = forwardedAllowedRemoteToolNames === undefined
241
+ ? undefined
242
+ : mergeRemoteToolNames(sourceAllowedRemoteToolNames, forwardedAllowedRemoteToolNames);
229
243
  const forwardedIntegrationToolDefs = getForwardedIntegrationToolDefinitions(input.forwardedProps);
230
244
  const availableForwardedToolNames = forwardedIntegrationToolDefs?.map((tool) => tool.name);
231
245
  const sandboxTools = await buildProjectAgentSandboxTools({ agent, deps });
@@ -24,5 +24,6 @@ export type { AuthorizationUrlOptions, OAuthProviderConfig, OAuthServiceConfig,
24
24
  export { OAuthProvider, OAuthService } from "./providers/base.js";
25
25
  export { airtableConfig, asanaConfig, bitbucketConfig, boxConfig, calendarConfig, clickupConfig, confluenceConfig, driveConfig, figmaConfig, freshdeskConfig, githubConfig, gitlabConfig, gmailConfig, hubspotConfig, intercomConfig, jiraConfig, linearConfig, mailchimpConfig, mondayConfig, notionConfig, oneDriveConfig, outlookConfig, pipedriveConfig, quickbooksConfig, salesforceConfig, sharePointConfig, sheetsConfig, shopifyConfig, slackConfig, teamsConfig, trelloConfig, twitterConfig, webexConfig, xeroConfig, zoomConfig, } from "./providers/index.js";
26
26
  export { MemoryTokenStore } from "./token-store/index.js";
27
+ export type { MemoryTokenStoreOptions } from "./token-store/index.js";
27
28
  export { createOAuthCallbackHandler, createOAuthDisconnectHandler, createOAuthInitHandler, createOAuthStatusHandler, type OAuthCallbackHandlerOptions, type OAuthInitHandlerOptions, } from "./handlers/index.js";
28
29
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/oauth/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,yBAAyB,CAAC;AAGjC,YAAY,EACV,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,UAAU,EACV,WAAW,EACX,oBAAoB,EACpB,mBAAmB,EACnB,UAAU,GACX,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,EACL,cAAc,EACd,WAAW,EACX,eAAe,EACf,SAAS,EACT,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,aAAa,EACb,cAAc,EACd,UAAU,EACV,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,WAAW,EACX,WAAW,EACX,YAAY,EACZ,aAAa,EACb,WAAW,EACX,UAAU,EACV,UAAU,GACX,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,EAC5B,sBAAsB,EACtB,wBAAwB,EACxB,KAAK,2BAA2B,EAChC,KAAK,uBAAuB,GAC7B,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/oauth/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,yBAAyB,CAAC;AAGjC,YAAY,EACV,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,UAAU,EACV,WAAW,EACX,oBAAoB,EACpB,mBAAmB,EACnB,UAAU,GACX,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,EACL,cAAc,EACd,WAAW,EACX,eAAe,EACf,SAAS,EACT,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,aAAa,EACb,cAAc,EACd,UAAU,EACV,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,WAAW,EACX,WAAW,EACX,YAAY,EACZ,aAAa,EACb,WAAW,EACX,UAAU,EACV,UAAU,GACX,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,YAAY,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEtE,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,EAC5B,sBAAsB,EACtB,wBAAwB,EACxB,KAAK,2BAA2B,EAChC,KAAK,uBAAuB,GAC7B,MAAM,qBAAqB,CAAC"}
@@ -4,5 +4,6 @@
4
4
  * @module oauth/token-store
5
5
  */
6
6
  export { MemoryTokenStore, memoryTokenStore } from "./memory.js";
7
+ export type { MemoryTokenStoreOptions } from "./memory.js";
7
8
  export type { OAuthState, OAuthTokens, StoredOAuthState, TokenStore } from "../types.js";
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/oauth/token-store/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACjE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/oauth/token-store/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACjE,YAAY,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAC3D,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC"}
@@ -1,17 +1,39 @@
1
1
  import type { OAuthTokens, StoredOAuthState, TokenStore } from "../types.js";
2
+ /** Options for {@link MemoryTokenStore}. */
3
+ export interface MemoryTokenStoreOptions {
4
+ /**
5
+ * Maximum number of `(serviceId, userId)` token slots to retain before
6
+ * least-recently-used eviction kicks in. Defaults to
7
+ * {@link DEFAULT_MAX_TOKEN_ENTRIES}.
8
+ */
9
+ maxEntries?: number;
10
+ }
2
11
  /**
3
12
  * In-memory TokenStore keyed by `(serviceId, userId)`.
4
13
  *
5
- * Suitable for development and tests. For production use a persistent store
6
- * (Redis, Postgres, ...) keyed the same way. Never share a single slot per
7
- * service across users see VULN-AUTH-2.
14
+ * Suitable for development and tests ONLY. It is process-local and not
15
+ * durable: tokens are lost on restart and not shared across instances or
16
+ * workers, and the exported {@link memoryTokenStore} singleton shares one
17
+ * keyspace process-wide. For production inject a persistent, scoped store
18
+ * (Redis, Postgres, ...) keyed the same way.
19
+ *
20
+ * The token map is bounded (see {@link MemoryTokenStoreOptions.maxEntries}) so
21
+ * it cannot grow without limit. Never share a single slot per service across
22
+ * users — see VULN-AUTH-2.
8
23
  */
9
24
  export declare class MemoryTokenStore implements TokenStore {
10
25
  private tokens;
11
26
  private states;
12
27
  private projectId;
13
- constructor(projectId?: string);
28
+ private warnedProductionUse;
29
+ constructor(projectId?: string, options?: MemoryTokenStoreOptions);
14
30
  private scopedKey;
31
+ /**
32
+ * Warn once if this non-durable store is used to persist tokens in
33
+ * production — almost always a misconfiguration (a persistent TokenStore
34
+ * should have been injected).
35
+ */
36
+ private warnIfProductionUse;
15
37
  getTokens(serviceId: string, userId: string): Promise<OAuthTokens | null>;
16
38
  setTokens(serviceId: string, userId: string, tokens: OAuthTokens): Promise<void>;
17
39
  clearTokens(serviceId: string, userId: string): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../../../src/src/oauth/token-store/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AAW,uBAAuB;IACtC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,gBAAiB,YAAW,UAAU;IACjD,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,MAAM,CAAuC;IACrD,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,mBAAmB,CAAS;gBAExB,SAAS,SAAY,EAAE,OAAO,GAAE,uBAA4B;IAOxE,OAAO,CAAC,SAAS;IAIjB;;;;OAIG;IACH,OAAO,CAAC,mBAAmB;IAW3B,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;IAMzE,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAMhF,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAK7D,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAM9D;;;OAGG;IACH,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAU7D,OAAO,CAAC,oBAAoB;IAS5B,iFAAiF;IACjF,oBAAoB,IAAI,MAAM,EAAE;IAOhC,4DAA4D;IAC5D,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO;IAQvD,QAAQ,IAAI,IAAI;CAIjB;AAED,eAAO,MAAM,gBAAgB,EAAE,UAAmC,CAAC"}
@@ -1,26 +1,63 @@
1
+ import { logger as baseLogger } from "../../utils/index.js";
2
+ import { isProduction } from "../../platform/environment.js";
3
+ import { LRUCacheAdapter } from "../../utils/cache/stores/memory/lru-cache-adapter.js";
4
+ const logger = baseLogger.component("o-auth");
1
5
  /** State expiry window: reject any state older than this (10 minutes). */
2
6
  const STATE_EXPIRY_MS = 10 * 60 * 1_000;
7
+ /**
8
+ * Default cap on stored token slots. Bounds memory in long-lived processes;
9
+ * past this, the least-recently-used `(serviceId, userId)` slot is evicted
10
+ * (the affected user simply re-authenticates). Tokens are NOT given a TTL —
11
+ * an expired access token may still be refreshable via its refresh token, so
12
+ * eviction is by capacity/recency only.
13
+ */
14
+ const DEFAULT_MAX_TOKEN_ENTRIES = 10_000;
3
15
  /**
4
16
  * In-memory TokenStore keyed by `(serviceId, userId)`.
5
17
  *
6
- * Suitable for development and tests. For production use a persistent store
7
- * (Redis, Postgres, ...) keyed the same way. Never share a single slot per
8
- * service across users see VULN-AUTH-2.
18
+ * Suitable for development and tests ONLY. It is process-local and not
19
+ * durable: tokens are lost on restart and not shared across instances or
20
+ * workers, and the exported {@link memoryTokenStore} singleton shares one
21
+ * keyspace process-wide. For production inject a persistent, scoped store
22
+ * (Redis, Postgres, ...) keyed the same way.
23
+ *
24
+ * The token map is bounded (see {@link MemoryTokenStoreOptions.maxEntries}) so
25
+ * it cannot grow without limit. Never share a single slot per service across
26
+ * users — see VULN-AUTH-2.
9
27
  */
10
28
  export class MemoryTokenStore {
11
- tokens = new Map();
29
+ tokens;
12
30
  states = new Map();
13
31
  projectId;
14
- constructor(projectId = "default") {
32
+ warnedProductionUse = false;
33
+ constructor(projectId = "default", options = {}) {
15
34
  this.projectId = projectId;
35
+ this.tokens = new LRUCacheAdapter({
36
+ maxEntries: options.maxEntries ?? DEFAULT_MAX_TOKEN_ENTRIES,
37
+ });
16
38
  }
17
39
  scopedKey(serviceId, userId) {
18
40
  return `${this.projectId}:${serviceId}:${userId}`;
19
41
  }
42
+ /**
43
+ * Warn once if this non-durable store is used to persist tokens in
44
+ * production — almost always a misconfiguration (a persistent TokenStore
45
+ * should have been injected).
46
+ */
47
+ warnIfProductionUse() {
48
+ if (this.warnedProductionUse || !isProduction())
49
+ return;
50
+ this.warnedProductionUse = true;
51
+ logger.warn("MemoryTokenStore is persisting OAuth tokens in production. It is " +
52
+ "process-local and not durable (tokens are lost on restart and not " +
53
+ "shared across instances). Inject a persistent, scoped TokenStore " +
54
+ "(Redis/Postgres/...) instead.");
55
+ }
20
56
  getTokens(serviceId, userId) {
21
57
  return Promise.resolve(this.tokens.get(this.scopedKey(serviceId, userId)) ?? null);
22
58
  }
23
59
  setTokens(serviceId, userId, tokens) {
60
+ this.warnIfProductionUse();
24
61
  this.tokens.set(this.scopedKey(serviceId, userId), tokens);
25
62
  return Promise.resolve();
26
63
  }
@@ -1 +1 @@
1
- {"version":3,"file":"log-buffer.d.ts","sourceRoot":"","sources":["../../../src/src/observability/log-buffer.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3D,2BAA2B;AAC3B,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,QAAQ,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB;AACD,uDAAuD;AACvD,MAAM,WAAW,SAAS;IACxB,KAAK,CAAC,EAAE,QAAQ,GAAG,QAAQ,EAAE,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,8CAA8C;AAC9C,MAAM,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;AAEtD,4BAA4B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AgB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,SAAY,GAAG,MAAM,IAAI,CA6ClF"}
@@ -1,3 +1,4 @@
1
+ import { redactSensitive } from "../utils/logger/redact.js";
1
2
  /** Implement log buffer. */
2
3
  export class LogBuffer {
3
4
  entries = [];
@@ -13,6 +14,9 @@ export class LogBuffer {
13
14
  append(entry) {
14
15
  const fullEntry = {
15
16
  ...entry,
17
+ // Redact credential-like keys before the entry is buffered, surfaced to
18
+ // subscribers, or written to disk by the file subscriber (#1989).
19
+ data: entry.data ? redactSensitive(entry.data) : entry.data,
16
20
  id: this.generateId(),
17
21
  timestamp: Date.now(),
18
22
  };
@@ -136,7 +140,9 @@ export function interceptConsole(buffer, source = "console") {
136
140
  if (typeof a === "string")
137
141
  return a;
138
142
  try {
139
- return JSON.stringify(a);
143
+ // Redact object args before they are folded into the message string,
144
+ // where the per-entry data redaction can no longer reach them (#1989).
145
+ return JSON.stringify(redactSensitive(a));
140
146
  }
141
147
  catch (_) {
142
148
  /* expected: circular references or non-serializable values */
@@ -1 +1 @@
1
- {"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/adapters/redis/modules.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAKnE,wBAAgB,cAAc,IAAI,OAAO,CAAC;IACxC,SAAS,EAAE,eAAe,GAAG,IAAI,CAAC;IAClC,SAAS,EAAE,eAAe,GAAG,IAAI,CAAC;CACnC,CAAC,CAqCD;AAED,wBAAgB,gBAAgB,IAAI,IAAI,CAGvC"}
1
+ {"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/adapters/redis/modules.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAKnE,wBAAgB,cAAc,IAAI,OAAO,CAAC;IACxC,SAAS,EAAE,eAAe,GAAG,IAAI,CAAC;IAClC,SAAS,EAAE,eAAe,GAAG,IAAI,CAAC;CACnC,CAAC,CA6BD;AAED,wBAAgB,gBAAgB,IAAI,IAAI,CAGvC"}
@@ -10,9 +10,7 @@ export function getRedisModule() {
10
10
  return withSpan("platform.redis.getModule", async () => {
11
11
  try {
12
12
  if (isDeno) {
13
- const denoRedisUrl = "https://deno.land/x/redis@v0.32.1/mod.ts";
14
- // @ts-ignore - Deno global
15
- DenoRedis = await import(denoRedisUrl);
13
+ NodeRedis = (await import("redis"));
16
14
  }
17
15
  else {
18
16
  NodeRedis = (await import("redis"));
@@ -20,14 +18,9 @@ export function getRedisModule() {
20
18
  }
21
19
  catch (error) {
22
20
  const message = error instanceof Error ? error.message : String(error);
23
- if (isDeno) {
24
- throw INITIALIZATION_ERROR.create({
25
- detail: `Failed to load Deno Redis module. Error: ${message}`,
26
- cause: error instanceof Error ? error : undefined,
27
- });
28
- }
21
+ const packageName = isDeno ? "npm:redis@5.11.0" : "redis";
29
22
  throw INITIALIZATION_ERROR.create({
30
- detail: `Failed to load 'redis' package. Please install it with: npm install redis\nError: ${message}`,
23
+ detail: `Failed to load '${packageName}' package. Please install it with: npm install redis\nError: ${message}`,
31
24
  cause: error instanceof Error ? error : undefined,
32
25
  });
33
26
  }
@@ -1 +1 @@
1
- {"version":3,"file":"project-worker.d.ts","sourceRoot":"","sources":["../../../../src/src/security/sandbox/project-worker.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EAGf,MAAM,mBAAmB,CAAC;AAW3B,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,iBAAiB,CAAC;IAC/B,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAcD;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM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,CAAC,gBAAgB;IAMxB,OAAO,CAAC,gBAAgB;CAazB"}
@@ -55,7 +55,6 @@ export class ProjectWorker {
55
55
  name: `project-worker-${this.projectId}`,
56
56
  deno: { permissions: this.permissions },
57
57
  };
58
- // @ts-ignore - Deno Worker accepts extended options
59
58
  this.worker = new Worker(workerUrl, workerOptions);
60
59
  this._status = "idle";
61
60
  this.worker.onmessage = (event) => {
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../src/src/server/dev-server/server.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAInD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAkCvD,4BAA4B;AAC5B,qBAAa,SAAS;IAiBR,OAAO,CAAC,OAAO;IAhB3B,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,iBAAiB,CAAqB;IAC9C,OAAO,CAAC,cAAc,CAAC,CAAiB;IACxC,OAAO,CAAC,QAAQ,CAAqB;IACrC,OAAO,CAAC,OAAO,CAAkB;IACjC,OAAO,CAAC,MAAM,CAAC,CAAS;IACxB,OAAO,CAAC,SAAS,CAA8B;IAC/C,OAAO,CAAC,cAAc,CAAC,CAAiB;IACxC,OAAO,CAAC,QAAQ,CAAC,CAAsC;IACvD,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,OAAO,CAAC,aAAa,CAAc;IACnC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,iBAAiB,CAAC,CAAa;IACvC,OAAO,CAAC,qBAAqB,CAAC,CAAa;IAC3C,OAAO,CAAC,8BAA8B,CAAC,CAAa;gBAEhC,OAAO,EAAE,gBAAgB;IAQ7C,OAAO,CAAC,OAAO;YAID,YAAY;IAWpB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IA8K5B,qEAAqE;IACrE,IAAI,OAAO,IAAI,CAAC,GAAG,EA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IAWpB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAgL5B,qEAAqE;IACrE,IAAI,OAAO,IAAI,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAKjD;IAED,OAAO,CAAC,oBAAoB;YAkBd,qBAAqB;YAkBrB,yBAAyB;YAoBzB,uBAAuB;YA4BvB,wBAAwB;IAmBtC,OAAO,CAAC,kBAAkB;IAuBpB,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;YAe7B,iBAAiB;IAsC/B,qBAAqB,IAAI,UAAU,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,GAAG,IAAI;IAIlE,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CA6B5B"}
@@ -17,6 +17,7 @@ import { FileWatchSetup } from "./file-watch-setup.js";
17
17
  import { enableSSRClientOnlyFetching, enableSSRFetchInterception, setSSRServerPort, } from "../../rendering/ssr-globals.js";
18
18
  import { setEnv } from "../../platform/compat/process.js";
19
19
  import { initializeDistributedCaches } from "../../cache/distributed-cache-init.js";
20
+ import { defaultDistributedCacheInitializers } from "../distributed-cache-initializers.js";
20
21
  import { isDiskCacheConfigured } from "../../cache/backend.js";
21
22
  import { clearTranspileCache, discoverAll } from "../../discovery/index.js";
22
23
  const rscLog = logger.component("rsc");
@@ -117,7 +118,7 @@ export class DevServer {
117
118
  await this.logRSCStatus();
118
119
  // Initialize disk cache in dev mode when explicitly configured
119
120
  if (isDiskCacheConfigured()) {
120
- void initializeDistributedCaches().catch((error) => {
121
+ void initializeDistributedCaches(defaultDistributedCacheInitializers).catch((error) => {
121
122
  logger.debug("[DevServer] Cache initialization failed, using memory fallback", { error });
122
123
  });
123
124
  }
@@ -0,0 +1,13 @@
1
+ import type { DistributedCacheInitializers } from "../cache/distributed-cache-init.js";
2
+ /**
3
+ * Default wiring of distributed-cache initializers, assembled at the server
4
+ * composition root.
5
+ *
6
+ * The concrete initializers live in the `transforms`, `modules`, `html`, and
7
+ * `platform` layers. Keeping this wiring in `src/server` (which is free to
8
+ * depend on every layer) lets `src/cache/distributed-cache-init.ts` remain a
9
+ * low-level orchestrator that takes its initializers as an injected dependency
10
+ * instead of reaching up into those layers itself.
11
+ */
12
+ export declare const defaultDistributedCacheInitializers: DistributedCacheInitializers;
13
+ //# sourceMappingURL=distributed-cache-initializers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"distributed-cache-initializers.d.ts","sourceRoot":"","sources":["../../../src/src/server/distributed-cache-initializers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAOvF;;;;;;;;;GASG;AACH,eAAO,MAAM,mCAAmC,EAAE,4BAMjD,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { initializeFileCacheBackend } from "../platform/adapters/fs/cache/file-cache.js";
2
+ import { initializeSSRDistributedCache } from "../modules/react-loader/ssr-module-loader/index.js";
3
+ import { initializeTransformCache } from "../transforms/esm/transform-cache.js";
4
+ import { initializeHttpModuleDistributedCache } from "../transforms/esm/http-cache-wrapper.js";
5
+ import { initializeProjectCSSCache } from "../html/styles-builder/tailwind-compiler.js";
6
+ /**
7
+ * Default wiring of distributed-cache initializers, assembled at the server
8
+ * composition root.
9
+ *
10
+ * The concrete initializers live in the `transforms`, `modules`, `html`, and
11
+ * `platform` layers. Keeping this wiring in `src/server` (which is free to
12
+ * depend on every layer) lets `src/cache/distributed-cache-init.ts` remain a
13
+ * low-level orchestrator that takes its initializers as an injected dependency
14
+ * instead of reaching up into those layers itself.
15
+ */
16
+ export const defaultDistributedCacheInitializers = {
17
+ transformCache: initializeTransformCache,
18
+ ssrModuleCache: initializeSSRDistributedCache,
19
+ fileCache: initializeFileCacheBackend,
20
+ projectCSSCache: initializeProjectCSSCache,
21
+ httpModuleCache: initializeHttpModuleDistributedCache,
22
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"agent-stream.handler.d.ts","sourceRoot":"","sources":["../../../../../src/src/server/handlers/request/agent-stream.handler.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AACpF,OAAO,EAEL,KAAK,+BAA+B,EACrC,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,4BAA4B,EAE7B,MAAM,2CAA2C,CAAC;AAwBnD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAmB,aAAa,EAAE,MAAM,aAAa,CAAC;AAUnG,MAAM,WAAW,sBACf,SAAQ,yBAAyB,EAAE,+BAA+B;IAClE,4BAA4B,CAAC,EAAE,OAAO,4BAA4B,CAAC;CACpE;AAyND,qBAAa,kBAAmB,SAAQ,WAAW;IASrC,OAAO,CAAC,QAAQ,CAAC,IAAI;IARjC,QAAQ,EAAE,eAAe,CAMvB;gBAE2B,IAAI,GAAE,sBAAoC;IAIvE,OAAO,CAAC,sBAAsB;IAwBxB,MAAM,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;CA+JxE"}
1
+ {"version":3,"file":"agent-stream.handler.d.ts","sourceRoot":"","sources":["../../../../../src/src/server/handlers/request/agent-stream.handler.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AACpF,OAAO,EAEL,KAAK,+BAA+B,EACrC,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,4BAA4B,EAE7B,MAAM,2CAA2C,CAAC;AAwBnD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAmB,aAAa,EAAE,MAAM,aAAa,CAAC;AAUnG,MAAM,WAAW,sBACf,SAAQ,yBAAyB,EAAE,+BAA+B;IAClE,4BAA4B,CAAC,EAAE,OAAO,4BAA4B,CAAC;CACpE;AAyQD,qBAAa,kBAAmB,SAAQ,WAAW;IASrC,OAAO,CAAC,QAAQ,CAAC,IAAI;IARjC,QAAQ,EAAE,eAAe,CAMvB;gBAE2B,IAAI,GAAE,sBAAoC;IAIvE,OAAO,CAAC,sBAAsB;IAwBxB,MAAM,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;CAiKxE"}
@@ -1,4 +1,4 @@
1
- import { createRemoteMCPToolSource } from "../../../tool/index.js";
1
+ import { createRemoteMCPToolSource, toolRegistry, } from "../../../tool/index.js";
2
2
  import { defaultChannelInvokeDeps } from "../../../channels/invoke.js";
3
3
  import { createRuntimeAgentStreamResponse, } from "../../../internal-agents/run-stream.js";
4
4
  import { resolveRuntimeOwnerInvokeUrl, RUNTIME_OWNER_INVOKE_URL_HEADER, } from "../../../internal-agents/runtime-owner.js";
@@ -20,7 +20,7 @@ const defaultDeps = {
20
20
  const logger = serverLogger.component("agent-stream-handler");
21
21
  const RUN_STREAM_PATH_REGEX = /^\/api\/control-plane\/runs\/([^/]+)\/stream$/;
22
22
  const VERYFRONT_PLATFORM_REMOTE_TOOL_SOURCE_ID = "veryfront-platform-mcp";
23
- const VERYFRONT_PLATFORM_REMOTE_TOOL_NAMES = new Set(["search_knowledge", "get_file"]);
23
+ const LOCAL_RUNTIME_BOOLEAN_TOOL_NAMES = new Set(["bash"]);
24
24
  // Per-environment env var cache shared across all agent stream requests (60s TTL)
25
25
  const _agentEnvVarCache = new EnvironmentVariableCache((environmentId, token, projectSlug) => {
26
26
  const apiBaseUrl = getHostEnv("VERYFRONT_API_URL") ?? "https://api.veryfront.com";
@@ -50,13 +50,17 @@ async function _resolveProductionEnvironmentId(projectSlug, token) {
50
50
  return null;
51
51
  }
52
52
  }
53
- function getRequestedVeryfrontPlatformToolNames(agent) {
54
- const tools = agent.config.tools;
53
+ function getRequestedUnresolvedBooleanToolNames(input) {
54
+ const availableToolNames = new Set(input.availableToolNames ?? []);
55
+ const tools = input.agent.config.tools;
55
56
  if (!tools || tools === true) {
56
57
  return [];
57
58
  }
58
59
  return Object.entries(tools)
59
- .filter(([toolName, entry]) => entry === true && VERYFRONT_PLATFORM_REMOTE_TOOL_NAMES.has(toolName))
60
+ .filter(([toolName, entry]) => entry === true &&
61
+ !toolRegistry.get(toolName) &&
62
+ !availableToolNames.has(toolName) &&
63
+ !LOCAL_RUNTIME_BOOLEAN_TOOL_NAMES.has(toolName))
60
64
  .map(([toolName]) => toolName)
61
65
  .sort();
62
66
  }
@@ -73,26 +77,60 @@ function hasVeryfrontPlatformRemoteToolSource(remoteTools) {
73
77
  return remoteTools?.some((source) => source.id === VERYFRONT_PLATFORM_REMOTE_TOOL_SOURCE_ID) ??
74
78
  false;
75
79
  }
76
- function withVeryfrontPlatformRemoteTools(input) {
77
- const requestedToolNames = getRequestedVeryfrontPlatformToolNames(input.agent);
80
+ function createStaticRemoteToolSource(source, toolDefinitions) {
81
+ return {
82
+ id: source.id,
83
+ listTools: async () => toolDefinitions,
84
+ executeTool: (toolName, args, context) => source.executeTool(toolName, args, context),
85
+ };
86
+ }
87
+ async function withVeryfrontPlatformRemoteTools(input) {
88
+ const requestedToolNames = getRequestedUnresolvedBooleanToolNames({
89
+ agent: input.agent,
90
+ availableToolNames: input.availableToolNames,
91
+ });
78
92
  if (requestedToolNames.length === 0 || !input.token) {
79
93
  return input.agent;
80
94
  }
81
95
  const apiUrl = getHostEnv("VERYFRONT_API_URL") ?? "https://api.veryfront.com";
96
+ const platformRemoteToolSource = createRemoteMCPToolSource({
97
+ id: VERYFRONT_PLATFORM_REMOTE_TOOL_SOURCE_ID,
98
+ endpoint: `${apiUrl}/mcp`,
99
+ headers: { Authorization: `Bearer ${input.token}` },
100
+ });
101
+ let platformToolDefinitions = null;
102
+ try {
103
+ platformToolDefinitions = await platformRemoteToolSource.listTools({
104
+ ...(input.projectId ? { projectId: input.projectId } : {}),
105
+ });
106
+ }
107
+ catch (error) {
108
+ logger.warn("Unable to discover Veryfront platform MCP tools", {
109
+ projectId: input.projectId ?? undefined,
110
+ error: error instanceof Error ? error.message : String(error),
111
+ });
112
+ }
113
+ const platformToolNames = platformToolDefinitions
114
+ ? new Set(platformToolDefinitions.map((tool) => tool.name))
115
+ : null;
116
+ const requestedPlatformToolNames = platformToolNames
117
+ ? requestedToolNames.filter((toolName) => platformToolNames.has(toolName))
118
+ : requestedToolNames;
119
+ if (requestedPlatformToolNames.length === 0) {
120
+ return input.agent;
121
+ }
82
122
  const remoteTools = input.agent.config.remoteTools ?? [];
83
- const platformRemoteToolSource = hasVeryfrontPlatformRemoteToolSource(remoteTools) ? [] : [
84
- createRemoteMCPToolSource({
85
- id: VERYFRONT_PLATFORM_REMOTE_TOOL_SOURCE_ID,
86
- endpoint: `${apiUrl}/mcp`,
87
- headers: { Authorization: `Bearer ${input.token}` },
88
- }),
123
+ const platformRemoteToolSources = hasVeryfrontPlatformRemoteToolSource(remoteTools) ? [] : [
124
+ platformToolDefinitions
125
+ ? createStaticRemoteToolSource(platformRemoteToolSource, platformToolDefinitions)
126
+ : platformRemoteToolSource,
89
127
  ];
90
128
  return {
91
129
  ...input.agent,
92
130
  config: {
93
131
  ...input.agent.config,
94
- allowedRemoteTools: mergeAllowedRemoteTools(input.agent.config.allowedRemoteTools, requestedToolNames),
95
- remoteTools: [...remoteTools, ...platformRemoteToolSource],
132
+ allowedRemoteTools: mergeAllowedRemoteTools(input.agent.config.allowedRemoteTools, requestedPlatformToolNames),
133
+ remoteTools: [...remoteTools, ...platformRemoteToolSources],
96
134
  },
97
135
  };
98
136
  }
@@ -227,9 +265,11 @@ export class AgentStreamHandler extends BaseHandler {
227
265
  return this.respond(builder.json({ error: "Agent not found" }, 404));
228
266
  }
229
267
  const runtimeInput = toRuntimeRunAgentInput(payload);
230
- const runtimeAgent = withVeryfrontPlatformRemoteTools({
268
+ const runtimeAgent = await withVeryfrontPlatformRemoteTools({
231
269
  agent: agent,
232
270
  token: ctx.proxyToken || getHostEnv("VERYFRONT_API_TOKEN") || null,
271
+ projectId: ctx.projectId ?? null,
272
+ availableToolNames: runtimeInput.tools.map((tool) => tool.name),
233
273
  });
234
274
  // Load project env vars so source-defined MCP tool headers resolve
235
275
  // via _getProjectEnv(). Control-plane requests don't go through the proxy and
@@ -29,6 +29,7 @@ export type { DevServerOptions, DiscoveryOptions, FileWatcherMetrics, RouteDirec
29
29
  import { ReloadNotifier } from "./reload-notifier.js";
30
30
  export { ReloadNotifier };
31
31
  export type { BuildOptions, BuildStats } from "./build-types.js";
32
+ export { defaultDistributedCacheInitializers } from "./distributed-cache-initializers.js";
32
33
  /** Shared options for both development and production server modes. */
33
34
  interface BaseServerOptions {
34
35
  /** Project root directory. Defaults to process.cwd(). */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/server/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,yBAAyB,CAAC;AAKjC,OAAO,EACL,SAAS,EACT,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,cAAc,EACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,qBAAqB,EACrB,KAAK,4BAA4B,EAClC,MAAM,wBAAwB,CAAC;AAahC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,qBAAqB,EAAE,CAAC;AAC5D,OAAO,EACL,qBAAqB,EACrB,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAC/B,wBAAwB,EACxB,KAAK,+BAA+B,EACpC,oBAAoB,EACpB,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,EAC3B,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EACjC,KAAK,4BAA4B,EACjC,KAAK,oCAAoC,EACzC,KAAK,6BAA6B,EAClC,KAAK,iCAAiC,GACvC,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,gBAAgB,EAChB,gBAA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