veryfront 0.1.793 → 0.1.795
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/README.md +38 -87
- package/esm/deno.js +1 -1
- package/esm/src/agent/hosted/chat-runtime-agent-adapter.d.ts +1 -0
- package/esm/src/agent/hosted/chat-runtime-agent-adapter.d.ts.map +1 -1
- package/esm/src/agent/hosted/chat-runtime-agent-adapter.js +1 -0
- package/esm/src/agent/hosted/default-chat-runtime.d.ts.map +1 -1
- package/esm/src/agent/hosted/default-chat-runtime.js +1 -0
- package/esm/src/agent/service/mcp-server-config.d.ts.map +1 -1
- package/esm/src/agent/service/mcp-server-config.js +5 -2
- package/esm/src/release-assets/build-executor.d.ts +23 -0
- package/esm/src/release-assets/build-executor.d.ts.map +1 -1
- package/esm/src/release-assets/build-executor.js +262 -8
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,6 +14,44 @@ It gives you agents, tools, workflows, and a complete React rendering stack in a
|
|
|
14
14
|
<img src="./assets/banner.svg" alt="Veryfront" width="100%">
|
|
15
15
|
</p>
|
|
16
16
|
|
|
17
|
+
## Get started
|
|
18
|
+
|
|
19
|
+
Create a new Veryfront Code app:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm create veryfront
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
<details>
|
|
26
|
+
<summary>Use another package manager</summary>
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pnpm create veryfront
|
|
30
|
+
yarn create veryfront
|
|
31
|
+
bun create veryfront
|
|
32
|
+
deno init --npm veryfront
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
</details>
|
|
36
|
+
|
|
37
|
+
Start from a template directly:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npx veryfront init <PROJECT_NAME> --template <TEMPLATE>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Available starters: `ai-agent`, `minimal`, `agentic-workflow`.
|
|
44
|
+
|
|
45
|
+
Install the `veryfront` binary for local development commands and the TUI:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
curl -fsSL https://veryfront.com/install.sh | sh
|
|
49
|
+
# or
|
|
50
|
+
brew install veryfront/tap/veryfront
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Follow the [Quickstart guide](https://veryfront.com/docs/code/getting-started/quickstart) to build your first app. For project setup options and template details, see [Create a project](https://veryfront.com/docs/code/getting-started/create-a-project). For the full documentation, visit [veryfront.com/docs/code](https://veryfront.com/docs/code).
|
|
54
|
+
|
|
17
55
|
## Why Veryfront Code?
|
|
18
56
|
|
|
19
57
|
Purpose-built for TypeScript and React, Veryfront Code gives you everything you need to build agentic full-stack applications out-of-the-box.
|
|
@@ -50,99 +88,12 @@ Purpose-built for TypeScript and React, Veryfront Code gives you everything you
|
|
|
50
88
|
|
|
51
89
|
- [**Extensions**](https://veryfront.com/docs/code/guides/extensions) - Extend Veryfront Code with contract-based packages for LLM providers, bundling, CSS, tracing, caching, and more.
|
|
52
90
|
|
|
53
|
-
## Get Started
|
|
54
|
-
|
|
55
|
-
Use the interactive project wizard when you want to compare templates:
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
npm create veryfront
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
Choose a starting point directly with `npx` when you already know what you want
|
|
62
|
-
to build:
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
# Agent app with a chat UI, tool, and AG-UI route
|
|
66
|
-
npx veryfront init support-agent --template ai-agent
|
|
67
|
-
|
|
68
|
-
# Blank full-stack app with pages and routing
|
|
69
|
-
npx veryfront init my-app --template minimal
|
|
70
|
-
|
|
71
|
-
# Durable multi-step AI pipeline
|
|
72
|
-
npx veryfront init my-workflow --template agentic-workflow
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
<details>
|
|
76
|
-
<summary>pnpm, yarn, bun, deno</summary>
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
pnpm create veryfront
|
|
80
|
-
yarn create veryfront
|
|
81
|
-
bun create veryfront
|
|
82
|
-
deno init --npm veryfront
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
Binary install (recommended for the CLI/TUI):
|
|
86
|
-
|
|
87
|
-
```bash
|
|
88
|
-
curl -fsSL https://veryfront.com/install.sh | sh
|
|
89
|
-
# or
|
|
90
|
-
brew install veryfront/tap/veryfront
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
</details>
|
|
94
|
-
|
|
95
|
-
Follow the [Quickstart guide](https://veryfront.com/docs/code/getting-started/quickstart) to build the agent app end-to-end, or use [Create a project](https://veryfront.com/docs/code/getting-started/create-a-project) to compare templates before you scaffold. For the full documentation, visit [veryfront.com/docs/code](https://veryfront.com/docs/code).
|
|
96
|
-
|
|
97
|
-
## Project Structure
|
|
98
|
-
|
|
99
|
-
```
|
|
100
|
-
veryfront/
|
|
101
|
-
├── src/ # Framework core modules
|
|
102
|
-
│ ├── agent/ # Agent runtime, AG-UI, hosted execution
|
|
103
|
-
│ ├── tool/ # Tool definitions and registry
|
|
104
|
-
│ ├── workflow/ # Durable DAG workflows with crash recovery
|
|
105
|
-
│ ├── mcp/ # Model Context Protocol server
|
|
106
|
-
│ ├── skill/ # Agent skills system (SKILL.md)
|
|
107
|
-
│ ├── chat/ # Chat UI components and streaming
|
|
108
|
-
│ ├── discovery/ # Auto-discovery of tools, agents, workflows
|
|
109
|
-
│ ├── sandbox/ # Ephemeral compute environments
|
|
110
|
-
│ ├── runs/ # Durable runs client
|
|
111
|
-
│ ├── task/ # Task definitions and runner
|
|
112
|
-
│ ├── channels/ # Control-plane agent routing
|
|
113
|
-
│ ├── integrations/ # Third-party connector metadata
|
|
114
|
-
│ ├── provider/ # AI model provider adapters
|
|
115
|
-
│ ├── rendering/ # SSR/RSC engine
|
|
116
|
-
│ ├── server/ # HTTP servers (dev + production)
|
|
117
|
-
│ ├── routing/ # File-based routing
|
|
118
|
-
│ ├── security/ # Rate limiting, CORS, CSP, validation
|
|
119
|
-
│ └── ... # See src/README.md for full list
|
|
120
|
-
├── cli/ # CLI and TUI dashboard
|
|
121
|
-
├── extensions/ # First-party extension packages
|
|
122
|
-
├── docs/ # Architecture diagrams and guides
|
|
123
|
-
├── tests/ # Integration and E2E tests
|
|
124
|
-
└── scripts/ # Development and build scripts
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
## Examples
|
|
128
|
-
|
|
129
|
-
You can find standalone, runnable examples in the [veryfront-examples](https://github.com/veryfront/veryfront-examples) repo.
|
|
130
|
-
|
|
131
91
|
## Contributing
|
|
132
92
|
|
|
133
93
|
Looking to contribute? All types of help are appreciated, from coding to testing and feature specification. Read [CONTRIBUTING.md](./CONTRIBUTING.md) for more details on how to get involved.
|
|
134
94
|
|
|
135
95
|
If you are a developer and would like to contribute with code, please open an issue to discuss before opening a Pull Request.
|
|
136
96
|
|
|
137
|
-
## Supply-Chain Hardening
|
|
138
|
-
|
|
139
|
-
Veryfront Code treats dependency changes as reviewed code changes.
|
|
140
|
-
|
|
141
|
-
- Workspace Deno dependencies use exact versions and are resolved through the checked-in `deno.lock`.
|
|
142
|
-
- `deno.json` sets `minimumDependencyAge` to delay freshly published dependency versions during Deno resolution.
|
|
143
|
-
- `.npmrc` sets `save-exact=true` so npm-compatible tooling records exact versions.
|
|
144
|
-
- The npm package generator pins automatic `dependencies`, `optionalDependencies`, and `devDependencies`; peer ranges remain available only for opt-in compatibility constraints.
|
|
145
|
-
|
|
146
97
|
## Support
|
|
147
98
|
|
|
148
99
|
We have an [open community Discord](https://discord.gg/xWuRjafrtV). Come say hello and let us know if you have any questions or need help getting things running.
|
package/esm/deno.js
CHANGED
|
@@ -12,6 +12,7 @@ export type HostedChatRuntimeAgentAdapterInput = {
|
|
|
12
12
|
runtimeAgent: Pick<Agent, "stream">;
|
|
13
13
|
runId?: string;
|
|
14
14
|
agentId?: string;
|
|
15
|
+
authToken?: string;
|
|
15
16
|
runStream?: HostedChatRuntimeAgentAdapterRunner;
|
|
16
17
|
warnOrphanedToolInput?: (message: string, metadata: HostedChatRuntimeAgentAdapterWarning) => void;
|
|
17
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-runtime-agent-adapter.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/hosted/chat-runtime-agent-adapter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,sBAAsB,EAEvB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,wEAAwE;AACxE,MAAM,MAAM,mCAAmC,GAAG,CAAC,OAAO,EACxD,SAAS,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,KAC9B,OAAO,CAAC,OAAO,CAAC,CAAC;AAEtB,yEAAyE;AACzE,MAAM,MAAM,oCAAoC,GAAG;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,2DAA2D;AAC3D,MAAM,MAAM,kCAAkC,GAAG;IAC/C,YAAY,EAAE,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,mCAAmC,CAAC;IAChD,qBAAqB,CAAC,EAAE,CACtB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,oCAAoC,KAC3C,IAAI,CAAC;CACX,CAAC;AAMF,gDAAgD;AAChD,wBAAgB,mCAAmC,CACjD,KAAK,EAAE,kCAAkC,GACxC,sBAAsB,
|
|
1
|
+
{"version":3,"file":"chat-runtime-agent-adapter.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/hosted/chat-runtime-agent-adapter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,sBAAsB,EAEvB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,wEAAwE;AACxE,MAAM,MAAM,mCAAmC,GAAG,CAAC,OAAO,EACxD,SAAS,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,KAC9B,OAAO,CAAC,OAAO,CAAC,CAAC;AAEtB,yEAAyE;AACzE,MAAM,MAAM,oCAAoC,GAAG;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,2DAA2D;AAC3D,MAAM,MAAM,kCAAkC,GAAG;IAC/C,YAAY,EAAE,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,mCAAmC,CAAC;IAChD,qBAAqB,CAAC,EAAE,CACtB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,oCAAoC,KAC3C,IAAI,CAAC;CACX,CAAC;AAMF,gDAAgD;AAChD,wBAAgB,mCAAmC,CACjD,KAAK,EAAE,kCAAkC,GACxC,sBAAsB,CAyDxB"}
|
|
@@ -14,6 +14,7 @@ export function createHostedChatRuntimeAgentAdapter(input) {
|
|
|
14
14
|
context: {
|
|
15
15
|
...(input.runId ? { runId: input.runId } : {}),
|
|
16
16
|
...(input.agentId ? { agentId: input.agentId } : {}),
|
|
17
|
+
...(input.authToken ? { authToken: input.authToken } : {}),
|
|
17
18
|
abortSignal: streamInput.abortSignal,
|
|
18
19
|
publishDataEvent: (event) => publishDataEvent(event),
|
|
19
20
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-chat-runtime.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/hosted/default-chat-runtime.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,W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uCAAuC,CAAC;IACjD,MAAM,EAAE,8BAA8B,CAAC;IACvC,eAAe,EAAE,CAAC,WAAW,EAAE,mCAAmC,KAAK,WAAW,CAAC;IACnF,iBAAiB,CAAC,EAAE,CAClB,KAAK,EAAE,0CAA0C,KAC9C,mCAAmC,CAAC;IACzC,aAAa,CAAC,EAAE,CACd,KAAK,EAAE,0CAA0C,KAC9C,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;IAC9B,kBAAkB,CAAC,EAAE,CACnB,KAAK,EAAE,6CAA6C,KACjD,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC1B,qBAAqB,CAAC,EAAE,CACtB,KAAK,EAAE,0CAA0C,KAC9C,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IAChC,8BAA8B,CAAC,EAC7B,yCAAyC,CAAC,gCAAgC,CAAC,CAAC;IAC9E,sBAAsB,CAAC,EAAE,CAAC,MAAM,EAAE,yBAAyB,KAAK,gBAAgB,CAAC;IACjF,eAAe,CAAC,EAAE,yCAAyC,CAAC,iBAAiB,CAAC,CAAC;IAC/E,iCAAiC,CAAC,EAAE,OAAO,CAAC;IAC5C,MAAM,CAAC,EAAE,8BAA8B,CAAC;CACzC,CAAC;AA8JF,0CAA0C;AAC1C,wBAAsB,8BAA8B,CAClD,KAAK,EAAE,qCAAqC,GAC3C,OAAO,CAAC,+BAA+B,CAAC,
|
|
1
|
+
{"version":3,"file":"default-chat-runtime.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/hosted/default-chat-runtime.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACtB,MAAM,qBAAqB,CAAC;AAkB7B,OAAO,KAAK,EACV,gCAAgC,EAChC,+BAA+B,EAChC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,KAAK,mCAAmC,EAExC,KAAK,yCAAyC,EAC/C,MAAM,iCAAiC,CAAC;A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A0C,KAC9C,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;IAC9B,kBAAkB,CAAC,EAAE,CACnB,KAAK,EAAE,6CAA6C,KACjD,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC1B,qBAAqB,CAAC,EAAE,CACtB,KAAK,EAAE,0CAA0C,KAC9C,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IAChC,8BAA8B,CAAC,EAC7B,yCAAyC,CAAC,gCAAgC,CAAC,CAAC;IAC9E,sBAAsB,CAAC,EAAE,CAAC,MAAM,EAAE,yBAAyB,KAAK,gBAAgB,CAAC;IACjF,eAAe,CAAC,EAAE,yCAAyC,CAAC,iBAAiB,CAAC,CAAC;IAC/E,iCAAiC,CAAC,EAAE,OAAO,CAAC;IAC5C,MAAM,CAAC,EAAE,8BAA8B,CAAC;CACzC,CAAC;AA8JF,0CAA0C;AAC1C,wBAAsB,8BAA8B,CAClD,KAAK,EAAE,qCAAqC,GAC3C,OAAO,CAAC,+BAA+B,CAAC,CAyD1C"}
|
|
@@ -157,6 +157,7 @@ export async function createDefaultHostedChatRuntime(input) {
|
|
|
157
157
|
runtimeAgent,
|
|
158
158
|
runId: taskContext.runId,
|
|
159
159
|
agentId: taskContext.agentId,
|
|
160
|
+
authToken: taskContext.authToken,
|
|
160
161
|
runStream: (operation) => runWithDefaultHostedRequestContext({
|
|
161
162
|
taskContext,
|
|
162
163
|
cloudContext,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-server-config.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/service/mcp-server-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD,OAAO,EAAyB,KAAK,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEhG,MAAM,MAAM,uCAAuC,GAAG;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AG,IAAI,CAAC;IAC7B,aAAa,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC5C,YAAY,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC/C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,wBAAgB,6BAA6B,IAAI,2BAA2B,EAAE,CAE7E;AA4DD,wBAAgB,iCAAiC,CAC/C,KAAK,EAAE,sCAAsC,GAC5C,yBAAyB,GAAG,IAAI,CAUlC"}
|
|
@@ -23,8 +23,11 @@ function createVeryfrontApiRemoteMcpConfig(input, server) {
|
|
|
23
23
|
return {
|
|
24
24
|
id: server.id ?? input.defaultSourceId ?? "veryfront-mcp",
|
|
25
25
|
endpoint: input.apiMcpUrl,
|
|
26
|
-
headers: {
|
|
27
|
-
|
|
26
|
+
headers: (context) => {
|
|
27
|
+
const authToken = typeof context?.authToken === "string" && context.authToken.length > 0
|
|
28
|
+
? context.authToken
|
|
29
|
+
: input.authToken;
|
|
30
|
+
return { Authorization: `Bearer ${authToken}` };
|
|
28
31
|
},
|
|
29
32
|
};
|
|
30
33
|
}
|
|
@@ -44,6 +44,11 @@ export interface ReleaseAssetBuildInput {
|
|
|
44
44
|
* Injectable for tests.
|
|
45
45
|
*/
|
|
46
46
|
transform?: ReleaseAssetTransform;
|
|
47
|
+
/**
|
|
48
|
+
* Optional HTTP dependency vendor. Defaults to the existing HTTP module cache
|
|
49
|
+
* and is injectable so tests do not depend on live package CDN behavior.
|
|
50
|
+
*/
|
|
51
|
+
vendorHttpImports?: ReleaseAssetHttpDependencyVendor;
|
|
47
52
|
}
|
|
48
53
|
export type ReleaseAssetTransform = (source: string, sourceFile: string, projectDir: string, adapter: any, options: {
|
|
49
54
|
projectId: string;
|
|
@@ -51,6 +56,24 @@ export type ReleaseAssetTransform = (source: string, sourceFile: string, project
|
|
|
51
56
|
ssr: boolean;
|
|
52
57
|
reactVersion?: string;
|
|
53
58
|
}) => Promise<string>;
|
|
59
|
+
export interface ReleaseAssetVendorDependency {
|
|
60
|
+
/** Specifier currently used by transformed code after vendoring. */
|
|
61
|
+
specifier: string;
|
|
62
|
+
/** Stable manifest key, normally the original HTTP source URL. */
|
|
63
|
+
manifestKey: string;
|
|
64
|
+
/** Absolute local cache path when the dependency came from disk. */
|
|
65
|
+
sourcePath?: string;
|
|
66
|
+
/** Browser ESM source for this dependency. */
|
|
67
|
+
code: string;
|
|
68
|
+
}
|
|
69
|
+
export interface ReleaseAssetVendorResult {
|
|
70
|
+
code: string;
|
|
71
|
+
dependencies: ReleaseAssetVendorDependency[];
|
|
72
|
+
}
|
|
73
|
+
export type ReleaseAssetHttpDependencyVendor = (code: string, options: {
|
|
74
|
+
tempDir: string;
|
|
75
|
+
reactVersion?: string;
|
|
76
|
+
}) => Promise<ReleaseAssetVendorResult>;
|
|
54
77
|
/** Subset of the API client used by the builder (eases testing). */
|
|
55
78
|
export interface ReleaseAssetBuildClient {
|
|
56
79
|
beginReleaseAssetManifestBuild(version: string): Promise<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-executor.d.ts","sourceRoot":"","sources":["../../../src/src/release-assets/build-executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;
|
|
1
|
+
{"version":3,"file":"build-executor.d.ts","sourceRoot":"","sources":["../../../src/src/release-assets/build-executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAuBH,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAe/C,MAAM,WAAW,sBAAsB;IACrC,yDAAyD;IACzD,gBAAgB,EAAE,MAAM,CAAC;IACzB,oBAAoB;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,yDAAyD;IACzD,iBAAiB,EAAE,MAAM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E,MAAM,EAAE,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAwsBD;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,sBAAsB,EAC7B,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,uBAAuB,CAAC,CA2ClC"}
|
|
@@ -17,9 +17,11 @@
|
|
|
17
17
|
import { serverLogger } from "../utils/index.js";
|
|
18
18
|
import { VERSION } from "../utils/version.js";
|
|
19
19
|
import { createFileSystem } from "../platform/compat/fs.js";
|
|
20
|
-
import { dirname, join } from "../platform/compat/path/index.js";
|
|
20
|
+
import { dirname, join, normalize } from "../platform/compat/path/index.js";
|
|
21
21
|
import { resolveFrameworkSourcePath } from "../platform/compat/framework-source-resolver.js";
|
|
22
22
|
import { transformToESM } from "../transforms/esm-transform.js";
|
|
23
|
+
import { cacheHttpImportsToLocal } from "../transforms/esm/http-cache.js";
|
|
24
|
+
import { extractSourceUrl } from "../transforms/esm/source-url-embed.js";
|
|
23
25
|
import { parseImports, replaceSpecifiers } from "../transforms/esm/lexer.js";
|
|
24
26
|
import { PLATFORM_UTILITIES } from "../html/utils.js";
|
|
25
27
|
import { extractCandidatesFromFiles } from "../html/styles-builder/candidate-extractor.js";
|
|
@@ -191,6 +193,9 @@ async function collectProjectModuleImports(code, logicalPath, knownPaths) {
|
|
|
191
193
|
}
|
|
192
194
|
async function rewriteProjectModuleImports(code, logicalPath, moduleAssets, knownPaths, dependencyUrls) {
|
|
193
195
|
function rewriteSpecifier(specifier) {
|
|
196
|
+
const dependencyUrl = dependencyUrls.get(specifier.replace(/[?#].*$/, ""));
|
|
197
|
+
if (dependencyUrl)
|
|
198
|
+
return dependencyUrl;
|
|
194
199
|
if (specifier.startsWith("/_vf_modules/")) {
|
|
195
200
|
const dependencyUrl = dependencyUrls.get(specifier.replace(/[?#].*$/, ""));
|
|
196
201
|
if (dependencyUrl)
|
|
@@ -202,11 +207,210 @@ async function rewriteProjectModuleImports(code, logicalPath, moduleAssets, know
|
|
|
202
207
|
}
|
|
203
208
|
return await replaceSpecifiers(code, (specifier) => rewriteSpecifier(specifier));
|
|
204
209
|
}
|
|
205
|
-
function buildDependencyUrlMap(
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
+
function buildDependencyUrlMap(dependencies, dependencyModules) {
|
|
211
|
+
const urls = new Map();
|
|
212
|
+
for (const [manifestKey, entry] of Object.entries(dependencies)) {
|
|
213
|
+
const dependency = dependencyModules?.get(manifestKey);
|
|
214
|
+
if (!dependency)
|
|
215
|
+
continue;
|
|
216
|
+
const url = releaseAssetUrl(entry.contentHash, "js");
|
|
217
|
+
urls.set(manifestKey, url);
|
|
218
|
+
urls.set(entry.logicalPath, url);
|
|
219
|
+
for (const specifier of dependency.specifiers) {
|
|
220
|
+
urls.set(normalizeDependencySpecifier(specifier), url);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
return urls;
|
|
224
|
+
}
|
|
225
|
+
function addDependencyModule(dependencies, dependency) {
|
|
226
|
+
const sourcePath = dependency.sourcePath ?? resolveLocalDependencyPath(dependency.specifier) ??
|
|
227
|
+
undefined;
|
|
228
|
+
const existing = dependencies.get(dependency.manifestKey);
|
|
229
|
+
if (existing) {
|
|
230
|
+
existing.specifiers.add(dependency.specifier);
|
|
231
|
+
existing.sourcePath ??= sourcePath;
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
dependencies.set(dependency.manifestKey, {
|
|
235
|
+
manifestKey: dependency.manifestKey,
|
|
236
|
+
specifiers: new Set([dependency.specifier]),
|
|
237
|
+
sourcePath,
|
|
238
|
+
code: dependency.code,
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
function normalizeDependencySpecifier(specifier) {
|
|
242
|
+
return specifier.replace(/[?#].*$/, "");
|
|
243
|
+
}
|
|
244
|
+
function resolveLocalDependencyPath(specifier, parentFilePath) {
|
|
245
|
+
const normalized = normalizeDependencySpecifier(specifier);
|
|
246
|
+
if (normalized.startsWith("file://")) {
|
|
247
|
+
try {
|
|
248
|
+
return normalize(decodeURIComponent(new URL(normalized).pathname));
|
|
249
|
+
}
|
|
250
|
+
catch (_) {
|
|
251
|
+
return null;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
if (!parentFilePath || (!normalized.startsWith("./") && !normalized.startsWith("../"))) {
|
|
255
|
+
return null;
|
|
256
|
+
}
|
|
257
|
+
return normalize(join(dirname(parentFilePath), normalized));
|
|
258
|
+
}
|
|
259
|
+
function isPathInsideRoot(filePath, rootPath) {
|
|
260
|
+
const file = normalize(filePath);
|
|
261
|
+
const root = normalize(rootPath);
|
|
262
|
+
return file === root || file.startsWith(`${root}/`) || file.startsWith(`${root}\\`);
|
|
263
|
+
}
|
|
264
|
+
async function collectLocalHttpDependencyModules(code, dependencies, cacheDir) {
|
|
265
|
+
const fs = createFileSystem();
|
|
266
|
+
const cacheRoot = normalize(cacheDir);
|
|
267
|
+
const seen = new Set();
|
|
268
|
+
const queue = [];
|
|
269
|
+
for (const imp of await parseImports(code)) {
|
|
270
|
+
if (imp.n)
|
|
271
|
+
queue.push({ specifier: imp.n });
|
|
272
|
+
}
|
|
273
|
+
while (queue.length > 0) {
|
|
274
|
+
const { specifier, parentFilePath } = queue.shift();
|
|
275
|
+
const filePath = resolveLocalDependencyPath(specifier, parentFilePath);
|
|
276
|
+
if (!filePath || seen.has(filePath))
|
|
277
|
+
continue;
|
|
278
|
+
if (!isPathInsideRoot(filePath, cacheRoot)) {
|
|
279
|
+
throw new Error(`Vendored HTTP dependency resolved outside cache root: ${specifier}`);
|
|
280
|
+
}
|
|
281
|
+
seen.add(filePath);
|
|
282
|
+
const depCode = await fs.readTextFile(filePath);
|
|
283
|
+
const manifestKey = extractSourceUrl(depCode) ?? `file://${filePath}`;
|
|
284
|
+
const depSpecifiers = new Set([
|
|
285
|
+
normalizeDependencySpecifier(specifier),
|
|
286
|
+
`file://${filePath}`,
|
|
287
|
+
]);
|
|
288
|
+
const existing = dependencies.get(manifestKey);
|
|
289
|
+
if (existing) {
|
|
290
|
+
for (const depSpecifier of depSpecifiers)
|
|
291
|
+
existing.specifiers.add(depSpecifier);
|
|
292
|
+
existing.sourcePath ??= filePath;
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
dependencies.set(manifestKey, {
|
|
296
|
+
manifestKey,
|
|
297
|
+
specifiers: depSpecifiers,
|
|
298
|
+
sourcePath: filePath,
|
|
299
|
+
code: depCode,
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
for (const imp of await parseImports(depCode)) {
|
|
303
|
+
if (imp.n)
|
|
304
|
+
queue.push({ specifier: imp.n, parentFilePath: filePath });
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
async function vendorHttpImportsWithCache(code, options) {
|
|
309
|
+
const imports = await parseImports(code);
|
|
310
|
+
if (!imports.some((imp) => imp.n &&
|
|
311
|
+
(imp.n.startsWith("http://") || imp.n.startsWith("https://") || imp.n.startsWith("npm:")))) {
|
|
312
|
+
return { code, dependencies: [] };
|
|
313
|
+
}
|
|
314
|
+
const cacheDir = join(options.tempDir, ".veryfront-http-bundle");
|
|
315
|
+
const result = await cacheHttpImportsToLocal(code, {
|
|
316
|
+
cacheDir,
|
|
317
|
+
importMap: { imports: {}, scopes: {} },
|
|
318
|
+
reactVersion: options.reactVersion,
|
|
319
|
+
});
|
|
320
|
+
const dependencies = new Map();
|
|
321
|
+
await collectLocalHttpDependencyModules(result.code, dependencies, cacheDir);
|
|
322
|
+
return {
|
|
323
|
+
code: result.code,
|
|
324
|
+
dependencies: [...dependencies.values()].flatMap((dependency) => [...dependency.specifiers].map((specifier) => ({
|
|
325
|
+
specifier,
|
|
326
|
+
manifestKey: dependency.manifestKey,
|
|
327
|
+
sourcePath: dependency.sourcePath,
|
|
328
|
+
code: dependency.code,
|
|
329
|
+
}))),
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
async function finalizeDependencyModules(dependencyModules, uploadQueue, pendingBytes) {
|
|
333
|
+
const bySpecifier = new Map();
|
|
334
|
+
const byFilePath = new Map();
|
|
335
|
+
for (const dependency of dependencyModules.values()) {
|
|
336
|
+
for (const specifier of dependency.specifiers) {
|
|
337
|
+
bySpecifier.set(normalizeDependencySpecifier(specifier), dependency);
|
|
338
|
+
const filePath = resolveLocalDependencyPath(specifier);
|
|
339
|
+
if (filePath)
|
|
340
|
+
byFilePath.set(filePath, dependency);
|
|
341
|
+
}
|
|
342
|
+
if (dependency.sourcePath)
|
|
343
|
+
byFilePath.set(dependency.sourcePath, dependency);
|
|
344
|
+
}
|
|
345
|
+
const finalized = new Map();
|
|
346
|
+
const visiting = [];
|
|
347
|
+
function resolveDependencyImport(specifier, parent) {
|
|
348
|
+
const filePath = resolveLocalDependencyPath(specifier, parent.sourcePath);
|
|
349
|
+
if (filePath) {
|
|
350
|
+
const localDependency = byFilePath.get(filePath);
|
|
351
|
+
if (localDependency)
|
|
352
|
+
return localDependency;
|
|
353
|
+
}
|
|
354
|
+
return bySpecifier.get(normalizeDependencySpecifier(specifier)) ?? null;
|
|
355
|
+
}
|
|
356
|
+
async function finalize(manifestKey) {
|
|
357
|
+
const existing = finalized.get(manifestKey);
|
|
358
|
+
if (existing)
|
|
359
|
+
return existing;
|
|
360
|
+
if (visiting.includes(manifestKey)) {
|
|
361
|
+
const cycle = [...visiting.slice(visiting.indexOf(manifestKey)), manifestKey].join(" -> ");
|
|
362
|
+
throw new Error(`Circular release asset dependency graph: ${cycle}`);
|
|
363
|
+
}
|
|
364
|
+
const dependency = dependencyModules.get(manifestKey);
|
|
365
|
+
if (!dependency)
|
|
366
|
+
return null;
|
|
367
|
+
visiting.push(manifestKey);
|
|
368
|
+
try {
|
|
369
|
+
const imports = await parseImports(dependency.code);
|
|
370
|
+
for (const imp of imports) {
|
|
371
|
+
if (!imp.n)
|
|
372
|
+
continue;
|
|
373
|
+
const filePath = resolveLocalDependencyPath(imp.n, dependency.sourcePath);
|
|
374
|
+
if (filePath && !byFilePath.has(filePath)) {
|
|
375
|
+
throw new Error(`Unresolved vendored file dependency: ${imp.n}`);
|
|
376
|
+
}
|
|
377
|
+
const child = resolveDependencyImport(imp.n, dependency);
|
|
378
|
+
if (!child)
|
|
379
|
+
continue;
|
|
380
|
+
if (child.manifestKey === manifestKey) {
|
|
381
|
+
throw new Error(`Circular release asset dependency graph: ${manifestKey} -> ${manifestKey}`);
|
|
382
|
+
}
|
|
383
|
+
await finalize(child.manifestKey);
|
|
384
|
+
}
|
|
385
|
+
const rewritten = await replaceSpecifiers(dependency.code, (specifier) => {
|
|
386
|
+
const child = resolveDependencyImport(specifier, dependency);
|
|
387
|
+
if (!child)
|
|
388
|
+
return null;
|
|
389
|
+
const asset = finalized.get(child.manifestKey);
|
|
390
|
+
return asset ? releaseAssetUrl(asset.contentHash, "js") : null;
|
|
391
|
+
});
|
|
392
|
+
const entry = await addPreparedJavaScriptAsset(`__dependencies__/${manifestKey}`, rewritten, uploadQueue, pendingBytes);
|
|
393
|
+
if (!entry) {
|
|
394
|
+
throw new Error(`Vendored dependency exceeds release asset size limit: ${manifestKey}`);
|
|
395
|
+
}
|
|
396
|
+
for (const specifier of dependency.specifiers) {
|
|
397
|
+
bySpecifier.set(normalizeDependencySpecifier(specifier), dependency);
|
|
398
|
+
}
|
|
399
|
+
finalized.set(manifestKey, entry);
|
|
400
|
+
return entry;
|
|
401
|
+
}
|
|
402
|
+
finally {
|
|
403
|
+
visiting.pop();
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
try {
|
|
407
|
+
for (const manifestKey of dependencyModules.keys())
|
|
408
|
+
await finalize(manifestKey);
|
|
409
|
+
}
|
|
410
|
+
finally {
|
|
411
|
+
visiting.length = 0;
|
|
412
|
+
}
|
|
413
|
+
return Object.fromEntries(finalized);
|
|
210
414
|
}
|
|
211
415
|
async function finalizeProjectModules(transformedModules, knownPaths, dependencyUrls, uploadQueue, pendingBytes, gaps) {
|
|
212
416
|
const finalized = new Map();
|
|
@@ -446,11 +650,13 @@ async function runBuildInner(input, tempDir, client, transform) {
|
|
|
446
650
|
// 3 + 4. Collect the browser module closure and transform each module
|
|
447
651
|
// through the SAME pipeline serveModule uses (browser, non-SSR).
|
|
448
652
|
const transformedModules = new Map();
|
|
653
|
+
const dependencyModules = new Map();
|
|
449
654
|
const gaps = [];
|
|
450
655
|
const uploadQueue = [];
|
|
451
656
|
// Bytes are held per-hash only until uploaded, then dropped (M3).
|
|
452
657
|
const pendingBytes = new Map();
|
|
453
658
|
const knownPaths = new Set(sourceByPath.keys());
|
|
659
|
+
const vendorHttpImports = input.vendorHttpImports ?? vendorHttpImportsWithCache;
|
|
454
660
|
for (const [logicalPath, source] of sourceByPath) {
|
|
455
661
|
if (!isBrowserModule(logicalPath))
|
|
456
662
|
continue;
|
|
@@ -484,10 +690,58 @@ async function runBuildInner(input, tempDir, client, transform) {
|
|
|
484
690
|
error: sanitized,
|
|
485
691
|
};
|
|
486
692
|
}
|
|
693
|
+
try {
|
|
694
|
+
const vendored = await vendorHttpImports(code, {
|
|
695
|
+
tempDir,
|
|
696
|
+
reactVersion: input.reactVersion,
|
|
697
|
+
});
|
|
698
|
+
code = vendored.code;
|
|
699
|
+
for (const dependency of vendored.dependencies) {
|
|
700
|
+
addDependencyModule(dependencyModules, dependency);
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
catch (error) {
|
|
704
|
+
const sanitized = sanitizeError(error);
|
|
705
|
+
logger.warn("HTTP dependency vendoring failed during release asset build", {
|
|
706
|
+
path: logicalPath,
|
|
707
|
+
error: sanitized,
|
|
708
|
+
});
|
|
709
|
+
await client.reportReleaseAssetManifestState(input.releaseVersionRef, "failed", sanitized);
|
|
710
|
+
return {
|
|
711
|
+
success: false,
|
|
712
|
+
state: "failed",
|
|
713
|
+
moduleCount: 0,
|
|
714
|
+
cssCount: 0,
|
|
715
|
+
routeCount: 0,
|
|
716
|
+
gaps,
|
|
717
|
+
error: sanitized,
|
|
718
|
+
};
|
|
719
|
+
}
|
|
487
720
|
transformedModules.set(logicalPath, { logicalPath, code });
|
|
488
721
|
}
|
|
489
|
-
const
|
|
490
|
-
|
|
722
|
+
const frameworkDependencies = await buildFrameworkDependencies(input, tempDir, transform, uploadQueue, pendingBytes, gaps);
|
|
723
|
+
let httpDependencies;
|
|
724
|
+
try {
|
|
725
|
+
httpDependencies = await finalizeDependencyModules(dependencyModules, uploadQueue, pendingBytes);
|
|
726
|
+
}
|
|
727
|
+
catch (error) {
|
|
728
|
+
const sanitized = sanitizeError(error);
|
|
729
|
+
logger.warn("HTTP dependency finalization failed during release asset build", {
|
|
730
|
+
error: sanitized,
|
|
731
|
+
});
|
|
732
|
+
await client.reportReleaseAssetManifestState(input.releaseVersionRef, "failed", sanitized);
|
|
733
|
+
return {
|
|
734
|
+
success: false,
|
|
735
|
+
state: "failed",
|
|
736
|
+
moduleCount: 0,
|
|
737
|
+
cssCount: 0,
|
|
738
|
+
routeCount: 0,
|
|
739
|
+
gaps,
|
|
740
|
+
error: sanitized,
|
|
741
|
+
};
|
|
742
|
+
}
|
|
743
|
+
const dependencies = { ...frameworkDependencies, ...httpDependencies };
|
|
744
|
+
const dependencyUrls = buildDependencyUrlMap(dependencies, dependencyModules);
|
|
491
745
|
const { modules, skippedModules } = await finalizeProjectModules(transformedModules, knownPaths, dependencyUrls, uploadQueue, pendingBytes, gaps);
|
|
492
746
|
for (const logicalPath of transformedModules.keys()) {
|
|
493
747
|
if (modules[logicalPath])
|