veryfront 0.1.1026 → 0.1.1027
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 +1 -1
- package/esm/src/platform/cloud/resolver.d.ts +1 -0
- package/esm/src/platform/cloud/resolver.d.ts.map +1 -1
- package/esm/src/platform/cloud/resolver.js +10 -4
- package/esm/src/server/handlers/request/agent-stream.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/agent-stream.handler.js +23 -8
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +4 -4
package/esm/deno.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare function resolveVeryfrontApiBaseUrlFromHostEnv(): string;
|
|
1
2
|
export declare const DEFAULT_VERYFRONT_CLOUD_MODEL = "veryfront-cloud/openai/gpt-5.4-nano";
|
|
2
3
|
export declare const DEFAULT_VERYFRONT_CLOUD_EMBEDDING_MODEL = "veryfront-cloud/openai/text-embedding-3-small";
|
|
3
4
|
export interface VeryfrontCloudBootstrap {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../../../src/src/platform/cloud/resolver.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../../../src/src/platform/cloud/resolver.ts"],"names":[],"mappings":"AAwCA,wBAAgB,qCAAqC,IAAI,MAAM,CAG9D;AAED,eAAO,MAAM,6BAA6B,wCAAwC,CAAC;AACnF,eAAO,MAAM,uCAAuC,kDACH,CAAC;AAElD,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,eAAe,EAAE,OAAO,CAAC;CAC1B;AAyDD,wBAAgB,0BAA0B,IAAI,MAAM,GAAG,SAAS,CAE/D;AAED,wBAAgB,4BAA4B,IAAI,MAAM,GAAG,SAAS,CAEjE;AAED,wBAAgB,0BAA0B,IAAI,uBAAuB,CAOpE;AAED,wBAAgB,uBAAuB,IAAI,OAAO,CAgBjD;AAED,wBAAgB,6BAA6B,IAAI,MAAM,CAKtD;AAED,wBAAgB,sCAAsC,IAAI,MAAM,CAK/D"}
|
|
@@ -11,9 +11,15 @@ function isRuntimeConfigInitialized() {
|
|
|
11
11
|
return checker?.() ?? false;
|
|
12
12
|
}
|
|
13
13
|
const DEFAULT_API_BASE_URL = "https://api.veryfront.com";
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
function normalizeApiBaseUrl(value) {
|
|
15
|
+
const trimmed = value?.trim();
|
|
16
|
+
if (!trimmed)
|
|
17
|
+
return undefined;
|
|
18
|
+
return trimmed.replace(/\/graphql\/?$/, "/api").replace(/\/+$/, "");
|
|
19
|
+
}
|
|
20
|
+
export function resolveVeryfrontApiBaseUrlFromHostEnv() {
|
|
21
|
+
return normalizeApiBaseUrl(getHostEnv("VERYFRONT_API_BASE_URL")) ??
|
|
22
|
+
normalizeApiBaseUrl(getHostEnv("VERYFRONT_API_URL")) ?? DEFAULT_API_BASE_URL;
|
|
17
23
|
}
|
|
18
24
|
export const DEFAULT_VERYFRONT_CLOUD_MODEL = "veryfront-cloud/openai/gpt-5.4-nano";
|
|
19
25
|
export const DEFAULT_VERYFRONT_CLOUD_EMBEDDING_MODEL = "veryfront-cloud/openai/text-embedding-3-small";
|
|
@@ -67,7 +73,7 @@ export function getVeryfrontCloudProjectSlug() {
|
|
|
67
73
|
export function getVeryfrontCloudBootstrap() {
|
|
68
74
|
const scopedContext = getCurrentVeryfrontCloudContext();
|
|
69
75
|
return {
|
|
70
|
-
apiBaseUrl: scopedContext?.apiBaseUrl?.trim() ||
|
|
76
|
+
apiBaseUrl: scopedContext?.apiBaseUrl?.trim() || resolveVeryfrontApiBaseUrlFromHostEnv(),
|
|
71
77
|
...getResolvedVeryfrontCloudContext(),
|
|
72
78
|
};
|
|
73
79
|
}
|
|
@@ -1 +1 @@
|
|
|
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;AAEpF,OAAO,EAEL,KAAK,+BAA+B,EACrC,MAAM,wCAAwC,CAAC;AAQhD,OAAO,EACL,4BAA4B,EAE7B,MAAM,2CAA2C,CAAC;AAyBnD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAmB,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
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;AAEpF,OAAO,EAEL,KAAK,+BAA+B,EACrC,MAAM,wCAAwC,CAAC;AAQhD,OAAO,EACL,4BAA4B,EAE7B,MAAM,2CAA2C,CAAC;AAyBnD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAmB,aAAa,EAAE,MAAM,aAAa,CAAC;AAcnG,MAAM,WAAW,sBACf,SAAQ,yBAAyB,EAAE,+BAA+B;IAClE,4BAA4B,CAAC,EAAE,OAAO,4BAA4B,CAAC;IACnE,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,+BAA+B,CAAC,YAAY,CAAC,CAAC;CACpF;AAwgBD,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;CA4LxE"}
|
|
@@ -16,6 +16,7 @@ import { PRIORITY_MEDIUM_API } from "../../../utils/constants/index.js";
|
|
|
16
16
|
import { buildRuntimeShuttingDownResponse } from "./runtime-shutdown-response.js";
|
|
17
17
|
import { isServerShuttingDown } from "../../shutdown-state.js";
|
|
18
18
|
import { getHostEnv } from "../../../platform/compat/process.js";
|
|
19
|
+
import { resolveVeryfrontApiBaseUrlFromHostEnv } from "../../../platform/cloud/resolver.js";
|
|
19
20
|
import { serverLogger } from "../../../utils/index.js";
|
|
20
21
|
import { EnvironmentVariableCache, fetchProjectEnvVars, filterSharedRuntimeProjectEnv, runWithProjectEnv, } from "../../project-env/index.js";
|
|
21
22
|
const defaultDeps = {
|
|
@@ -39,8 +40,7 @@ const STUDIO_RUNTIME_REMOTE_TOOL_NAMES = new Set([
|
|
|
39
40
|
const LOCAL_RUNTIME_BOOLEAN_TOOL_NAMES = new Set(["bash"]);
|
|
40
41
|
// Per-environment env var cache shared across all agent stream requests (60s TTL)
|
|
41
42
|
const _agentEnvVarCache = new EnvironmentVariableCache((environmentId, token, projectSlug) => {
|
|
42
|
-
|
|
43
|
-
return fetchProjectEnvVars(apiBaseUrl, projectSlug, environmentId, token);
|
|
43
|
+
return fetchProjectEnvVars(resolveVeryfrontApiBaseUrlFromHostEnv(), projectSlug, environmentId, token);
|
|
44
44
|
});
|
|
45
45
|
// Cache: projectSlug → production environmentId (stable across restarts)
|
|
46
46
|
const _productionEnvIdCache = new Map();
|
|
@@ -48,21 +48,36 @@ async function _resolveProductionEnvironmentId(projectSlug, token) {
|
|
|
48
48
|
const cached = _productionEnvIdCache.get(projectSlug);
|
|
49
49
|
if (cached)
|
|
50
50
|
return cached;
|
|
51
|
-
const apiBaseUrl =
|
|
51
|
+
const apiBaseUrl = resolveVeryfrontApiBaseUrlFromHostEnv();
|
|
52
52
|
try {
|
|
53
53
|
const res = await fetch(`${apiBaseUrl}/projects/${encodeURIComponent(projectSlug)}/environments`, { headers: { Authorization: `Bearer ${token}`, Accept: "application/json" } });
|
|
54
54
|
if (!res.ok) {
|
|
55
55
|
await res.body?.cancel();
|
|
56
|
+
logger.warn("Unable to resolve production environment for agent stream", {
|
|
57
|
+
projectSlug,
|
|
58
|
+
apiBaseUrl,
|
|
59
|
+
status: res.status,
|
|
60
|
+
});
|
|
56
61
|
return null;
|
|
57
62
|
}
|
|
58
63
|
const body = await res.json();
|
|
59
64
|
const env = body.data?.find((e) => e.name === "production") ?? body.data?.[0];
|
|
60
|
-
if (!env?.id)
|
|
65
|
+
if (!env?.id) {
|
|
66
|
+
logger.warn("Production environment missing for agent stream", {
|
|
67
|
+
projectSlug,
|
|
68
|
+
apiBaseUrl,
|
|
69
|
+
});
|
|
61
70
|
return null;
|
|
71
|
+
}
|
|
62
72
|
_productionEnvIdCache.set(projectSlug, env.id);
|
|
63
73
|
return env.id;
|
|
64
74
|
}
|
|
65
|
-
catch {
|
|
75
|
+
catch (error) {
|
|
76
|
+
logger.warn("Unable to resolve production environment for agent stream", {
|
|
77
|
+
projectSlug,
|
|
78
|
+
apiBaseUrl,
|
|
79
|
+
error: error instanceof Error ? error.message : String(error),
|
|
80
|
+
});
|
|
66
81
|
return null;
|
|
67
82
|
}
|
|
68
83
|
}
|
|
@@ -231,7 +246,7 @@ async function withVeryfrontPlatformRemoteTools(input) {
|
|
|
231
246
|
if ((!veryfrontApiMcpPolicy.allowAll && requestedToolNames.length === 0) || !input.token) {
|
|
232
247
|
return input.agent;
|
|
233
248
|
}
|
|
234
|
-
const apiUrl =
|
|
249
|
+
const apiUrl = resolveVeryfrontApiBaseUrlFromHostEnv();
|
|
235
250
|
const platformRemoteToolSource = createRemoteMCPToolSource({
|
|
236
251
|
id: VERYFRONT_PLATFORM_REMOTE_TOOL_SOURCE_ID,
|
|
237
252
|
endpoint: `${apiUrl}/mcp`,
|
|
@@ -308,7 +323,7 @@ function withVeryfrontStudioRemoteTools(input) {
|
|
|
308
323
|
};
|
|
309
324
|
}
|
|
310
325
|
function buildAgentStreamEnv(input) {
|
|
311
|
-
const apiUrl =
|
|
326
|
+
const apiUrl = resolveVeryfrontApiBaseUrlFromHostEnv();
|
|
312
327
|
return {
|
|
313
328
|
...filterSharedRuntimeProjectEnv(input.envVars),
|
|
314
329
|
// Framework-owned values must override project env to keep request-scoped
|
|
@@ -491,7 +506,7 @@ export class AgentStreamHandler extends BaseHandler {
|
|
|
491
506
|
...this.deps,
|
|
492
507
|
localTools,
|
|
493
508
|
projectAgentSandbox: {
|
|
494
|
-
apiUrl:
|
|
509
|
+
apiUrl: resolveVeryfrontApiBaseUrlFromHostEnv(),
|
|
495
510
|
authToken: apiAuthToken || undefined,
|
|
496
511
|
projectId: ctx.projectId ?? null,
|
|
497
512
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "veryfront",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1027",
|
|
4
4
|
"description": "The simplest way to build AI-powered apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -326,9 +326,9 @@
|
|
|
326
326
|
"@types/react": "19.2.14",
|
|
327
327
|
"@types/react-dom": "19.2.3",
|
|
328
328
|
"ws": "8.21.0",
|
|
329
|
-
"@veryfront/ext-bundler-esbuild": "0.1.
|
|
330
|
-
"@veryfront/ext-content-mdx": "0.1.
|
|
331
|
-
"@veryfront/ext-css-tailwind": "0.1.
|
|
329
|
+
"@veryfront/ext-bundler-esbuild": "0.1.1027",
|
|
330
|
+
"@veryfront/ext-content-mdx": "0.1.1027",
|
|
331
|
+
"@veryfront/ext-css-tailwind": "0.1.1027"
|
|
332
332
|
},
|
|
333
333
|
"devDependencies": {
|
|
334
334
|
"@types/node": "20.9.0"
|