veryfront 0.1.105 → 0.1.106

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.
package/esm/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.1.105",
3
+ "version": "0.1.106",
4
4
  "license": "Apache-2.0",
5
5
  "nodeModulesDir": "auto",
6
6
  "exclude": [
@@ -58,6 +58,7 @@ export declare class AgentRunSessionManager {
58
58
  getRunStatus(runId: string): SessionStatus | null;
59
59
  reset(): void;
60
60
  }
61
+ export declare function _resetGlobalAgentRunSessionManagerForTesting(): void;
61
62
  export declare const agentRunSessionManager: AgentRunSessionManager;
62
63
  export {};
63
64
  //# sourceMappingURL=session-manager.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"session-manager.d.ts","sourceRoot":"","sources":["../../../src/src/internal-agents/session-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAyB/C,qBAAa,sBAAuB,SAAQ,KAAK;gBACnC,OAAO,SAAkB;CAItC;AAED,qBAAa,0BAA2B,SAAQ,KAAK;gBACvC,KAAK,EAAE,MAAM;CAI1B;AAED,qBAAa,iBAAkB,SAAQ,KAAK;gBAC9B,KAAK,EAAE,MAAM;CAI1B;AAED,qBAAa,yBAA0B,SAAQ,KAAK;gBACtC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;CAI9C;AAED,qBAAa,uBAAwB,SAAQ,KAAK;gBACpC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;CAI9C;AAMD,KAAK,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,WAAW,GAAG,QAAQ,CAAC;AA0BlF,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,IAAI,CAAC;IACf,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB;AAED,qBAAa,sBAAsB;IAI/B,OAAO,CAAC,Q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AY,GAEvB;IAED,OAAO,KAAK,cAAc,GAEzB;IAED,OAAO,CAAC,mBAAmB;IAS3B,OAAO,CAAC,mBAAmB;IAS3B,OAAO,CAAC,sBAAsB;IAW9B,OAAO,CAAC,sBAAsB;IAO9B,OAAO,CAAC,YAAY;IAQpB,OAAO,KAAK,qBAAqB,GAEhC;IAED,QAAQ,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,WAAW;IA4B3D,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;QAClE,MAAM,EAAE,OAAO,CAAC;QAChB,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;IAsDF,gBAAgB,CACd,KAAK,EAAE,MAAM,EACb,KAAK,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,GAChE,uBAAuB;IAuC1B,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAuBjC,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAUhC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAU5B,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI;IAIjD,KAAK,IAAI,IAAI;CAOd;AAoBD,wBAAgB,4CAA4C,IAAI,IAAI,CAGnE;AAED,eAAO,MAAM,sBAAsB,wBAAoC,CAAC"}
@@ -50,6 +50,7 @@ export class ToolResultConflictError extends Error {
50
50
  const DEFAULT_WAITING_FOR_TOOL_TTL_MS = 5 * 60 * 1000;
51
51
  const DEFAULT_SESSION_TTL_MS = 15 * 60 * 1000;
52
52
  const DEFAULT_MAX_CONCURRENT_SESSIONS = 100;
53
+ const AGENT_RUN_SESSION_MANAGER_GLOBAL_KEY = "__veryfrontAgentRunSessionManager";
53
54
  export class AgentRunSessionManager {
54
55
  options;
55
56
  sessions = new Map();
@@ -253,6 +254,20 @@ export class AgentRunSessionManager {
253
254
  this.sessions.clear();
254
255
  }
255
256
  }
256
- export const agentRunSessionManager = new AgentRunSessionManager({
257
- sessionTtlMs: DEFAULT_SESSION_TTL_MS,
258
- });
257
+ function getGlobalAgentRunSessionManager() {
258
+ const runtimeGlobal = dntShim.dntGlobalThis;
259
+ const existing = runtimeGlobal[AGENT_RUN_SESSION_MANAGER_GLOBAL_KEY];
260
+ if (existing) {
261
+ return existing;
262
+ }
263
+ const sessionManager = new AgentRunSessionManager({
264
+ sessionTtlMs: DEFAULT_SESSION_TTL_MS,
265
+ });
266
+ runtimeGlobal[AGENT_RUN_SESSION_MANAGER_GLOBAL_KEY] = sessionManager;
267
+ return sessionManager;
268
+ }
269
+ export function _resetGlobalAgentRunSessionManagerForTesting() {
270
+ const runtimeGlobal = dntShim.dntGlobalThis;
271
+ delete runtimeGlobal[AGENT_RUN_SESSION_MANAGER_GLOBAL_KEY];
272
+ }
273
+ export const agentRunSessionManager = getGlobalAgentRunSessionManager();
@@ -1 +1 @@
1
- {"version":3,"file":"environment-resolution.d.ts","sourceRoot":"","sources":["../../../../src/src/server/runtime-handler/environment-resolution.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAC;AAKlD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAM/D,UAAU,2BAA2B;IACnC,gDAAgD;IAChD,mBAAmB,EAAE,SAAS,GAAG,YAAY,GAAG,SAAS,CAAC;IAC1D,iEAAiE;IACjE,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,yCAAyC;IACzC,aAAa,EAAE,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC;CAC7C;AAED,UAAU,4BAA4B;IACpC,qCAAqC;IACrC,QAAQ,EAAE,gBAAgB,GAAG,SAAS,CAAC;IACvC,gCAAgC;IAChC,UAAU,EAAE,SAAS,GAAG,YAAY,GAAG,SAAS,CAAC;IACjD,8BAA8B;IAC9B,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,mBAAmB;IACnB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,iBAAiB;IACjB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,uBAAuB;IACvB,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,kBAAkB;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,cAAc,EAAE,OAAO,CAAC;IACxB,oCAAoC;IACpC,WAAW,EAAE,OAAO,CAAC;IACrB,iCAAiC;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,kBAAkB,EAAE,SAAS,GAAG,YAAY,GAAG,SAAS,CAAC;CAC1D;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,4BAA4B,GACjC,2BAA2B,CA0E7B"}
1
+ {"version":3,"file":"environment-resolution.d.ts","sourceRoot":"","sources":["../../../../src/src/server/runtime-handler/environment-resolution.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAC;AAKlD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAM/D,UAAU,2BAA2B;IACnC,gDAAgD;IAChD,mBAAmB,EAAE,SAAS,GAAG,YAAY,GAAG,SAAS,CAAC;IAC1D,iEAAiE;IACjE,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,yCAAyC;IACzC,aAAa,EAAE,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC;CAC7C;AAED,UAAU,4BAA4B;IACpC,qCAAqC;IACrC,QAAQ,EAAE,gBAAgB,GAAG,SAAS,CAAC;IACvC,gCAAgC;IAChC,UAAU,EAAE,SAAS,GAAG,YAAY,GAAG,SAAS,CAAC;IACjD,8BAA8B;IAC9B,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,mBAAmB;IACnB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,iBAAiB;IACjB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,uBAAuB;IACvB,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,kBAAkB;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,cAAc,EAAE,OAAO,CAAC;IACxB,oCAAoC;IACpC,WAAW,EAAE,OAAO,CAAC;IACrB,iCAAiC;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,kBAAkB,EAAE,SAAS,GAAG,YAAY,GAAG,SAAS,CAAC;CAC1D;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,4BAA4B,GACjC,2BAA2B,CAgF7B"}
@@ -19,16 +19,21 @@ const logger = baseLogger.component("environment-resolution");
19
19
  export function resolveEnvironment(opts) {
20
20
  let resolvedEnvironment = opts.proxyEnv === "preview" || opts.proxyEnv === "production" ? opts.proxyEnv : opts.reqCtxMode;
21
21
  let releaseId = opts.releaseId;
22
- // Skip releaseId validation for WebSocket/HMR endpoints - they're for development
23
- // features and shouldn't require release context
24
- const isWebSocketOrHMR = opts.pathname === "/_ws" || opts.pathname.startsWith("/_veryfront/");
22
+ // Some internal framework surfaces are routed directly to a runtime owner pod and
23
+ // rely on signed control-plane auth instead of a user-facing release address.
24
+ const isInternalAgentControlPlanePath = opts.pathname.startsWith("/internal/agents/");
25
+ // Skip releaseId validation for development assets and signed internal control-plane
26
+ // requests because they do not require a user-facing release context.
27
+ const canSkipReleaseIdValidation = opts.pathname === "/_ws" ||
28
+ opts.pathname.startsWith("/_veryfront/") ||
29
+ isInternalAgentControlPlanePath;
25
30
  // Validate releaseId in proxy mode production
26
31
  if (opts.isProxyMode &&
27
32
  resolvedEnvironment === "production" &&
28
33
  opts.projectSlug &&
29
34
  !releaseId &&
30
35
  !opts.isLocalProject &&
31
- !isWebSocketOrHMR) {
36
+ !canSkipReleaseIdValidation) {
32
37
  logger.warn("No active release found (proxy mode)", {
33
38
  projectSlug: opts.projectSlug,
34
39
  projectId: opts.projectId,
@@ -1,4 +1,4 @@
1
- export declare const VERSION = "0.1.105";
1
+ export declare const VERSION = "0.1.106";
2
2
  export declare function normalizeVeryfrontVersion(version: string | undefined): string | undefined;
3
3
  export declare function resolveRuntimeVersion(options?: {
4
4
  veryfrontVersion?: string;
@@ -2,7 +2,7 @@ import denoConfig from "../../deno.js";
2
2
  import { getEnv } from "../platform/compat/process.js";
3
3
  // Keep in sync with deno.json version.
4
4
  // scripts/release.ts updates this constant during releases.
5
- export const VERSION = "0.1.105";
5
+ export const VERSION = "0.1.106";
6
6
  export function normalizeVeryfrontVersion(version) {
7
7
  if (!version)
8
8
  return undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "veryfront",
3
- "version": "0.1.105",
3
+ "version": "0.1.106",
4
4
  "description": "The simplest way to build AI-powered apps",
5
5
  "keywords": [
6
6
  "react",
package/src/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.1.105",
3
+ "version": "0.1.106",
4
4
  "license": "Apache-2.0",
5
5
  "nodeModulesDir": "auto",
6
6
  "exclude": [
@@ -61,6 +61,7 @@ export class ToolResultConflictError extends Error {
61
61
  const DEFAULT_WAITING_FOR_TOOL_TTL_MS = 5 * 60 * 1000;
62
62
  const DEFAULT_SESSION_TTL_MS = 15 * 60 * 1000;
63
63
  const DEFAULT_MAX_CONCURRENT_SESSIONS = 100;
64
+ const AGENT_RUN_SESSION_MANAGER_GLOBAL_KEY = "__veryfrontAgentRunSessionManager" as const;
64
65
 
65
66
  type SessionStatus = "running" | "waiting" | "completed" | "cancelled" | "failed";
66
67
 
@@ -353,6 +354,27 @@ export class AgentRunSessionManager {
353
354
  }
354
355
  }
355
356
 
356
- export const agentRunSessionManager = new AgentRunSessionManager({
357
- sessionTtlMs: DEFAULT_SESSION_TTL_MS,
358
- });
357
+ type AgentRunSessionManagerGlobal = typeof dntShim.dntGlobalThis & {
358
+ [AGENT_RUN_SESSION_MANAGER_GLOBAL_KEY]?: AgentRunSessionManager;
359
+ };
360
+
361
+ function getGlobalAgentRunSessionManager(): AgentRunSessionManager {
362
+ const runtimeGlobal = dntShim.dntGlobalThis as AgentRunSessionManagerGlobal;
363
+ const existing = runtimeGlobal[AGENT_RUN_SESSION_MANAGER_GLOBAL_KEY];
364
+ if (existing) {
365
+ return existing;
366
+ }
367
+
368
+ const sessionManager = new AgentRunSessionManager({
369
+ sessionTtlMs: DEFAULT_SESSION_TTL_MS,
370
+ });
371
+ runtimeGlobal[AGENT_RUN_SESSION_MANAGER_GLOBAL_KEY] = sessionManager;
372
+ return sessionManager;
373
+ }
374
+
375
+ export function _resetGlobalAgentRunSessionManagerForTesting(): void {
376
+ const runtimeGlobal = dntShim.dntGlobalThis as AgentRunSessionManagerGlobal;
377
+ delete runtimeGlobal[AGENT_RUN_SESSION_MANAGER_GLOBAL_KEY];
378
+ }
379
+
380
+ export const agentRunSessionManager = getGlobalAgentRunSessionManager();
@@ -64,9 +64,15 @@ export function resolveEnvironment(
64
64
 
65
65
  let releaseId = opts.releaseId;
66
66
 
67
- // Skip releaseId validation for WebSocket/HMR endpoints - they're for development
68
- // features and shouldn't require release context
69
- const isWebSocketOrHMR = opts.pathname === "/_ws" || opts.pathname.startsWith("/_veryfront/");
67
+ // Some internal framework surfaces are routed directly to a runtime owner pod and
68
+ // rely on signed control-plane auth instead of a user-facing release address.
69
+ const isInternalAgentControlPlanePath = opts.pathname.startsWith("/internal/agents/");
70
+
71
+ // Skip releaseId validation for development assets and signed internal control-plane
72
+ // requests because they do not require a user-facing release context.
73
+ const canSkipReleaseIdValidation = opts.pathname === "/_ws" ||
74
+ opts.pathname.startsWith("/_veryfront/") ||
75
+ isInternalAgentControlPlanePath;
70
76
 
71
77
  // Validate releaseId in proxy mode production
72
78
  if (
@@ -75,7 +81,7 @@ export function resolveEnvironment(
75
81
  opts.projectSlug &&
76
82
  !releaseId &&
77
83
  !opts.isLocalProject &&
78
- !isWebSocketOrHMR
84
+ !canSkipReleaseIdValidation
79
85
  ) {
80
86
  logger.warn("No active release found (proxy mode)", {
81
87
  projectSlug: opts.projectSlug,
@@ -3,7 +3,7 @@ import { getEnv } from "../platform/compat/process.js";
3
3
 
4
4
  // Keep in sync with deno.json version.
5
5
  // scripts/release.ts updates this constant during releases.
6
- export const VERSION = "0.1.105";
6
+ export const VERSION = "0.1.106";
7
7
 
8
8
  export function normalizeVeryfrontVersion(version: string | undefined): string | undefined {
9
9
  if (!version) return undefined;