veryfront 0.1.793 → 0.1.796
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 +324 -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;AA+wBD;;;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,266 @@ 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 dependencyFallbackUrl(dependency) {
|
|
226
|
+
if (dependency.manifestKey.startsWith("http://") ||
|
|
227
|
+
dependency.manifestKey.startsWith("https://")) {
|
|
228
|
+
return dependency.manifestKey;
|
|
229
|
+
}
|
|
230
|
+
for (const specifier of dependency.specifiers) {
|
|
231
|
+
if (specifier.startsWith("http://") || specifier.startsWith("https://")) {
|
|
232
|
+
return specifier;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
return null;
|
|
236
|
+
}
|
|
237
|
+
function addDependencyUrlAliases(urls, dependency, url) {
|
|
238
|
+
urls.set(dependency.manifestKey, url);
|
|
239
|
+
if (dependency.sourcePath)
|
|
240
|
+
urls.set(`file://${dependency.sourcePath}`, url);
|
|
241
|
+
for (const specifier of dependency.specifiers) {
|
|
242
|
+
urls.set(normalizeDependencySpecifier(specifier), url);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
function addDependencyModule(dependencies, dependency) {
|
|
246
|
+
const sourcePath = dependency.sourcePath ?? resolveLocalDependencyPath(dependency.specifier) ??
|
|
247
|
+
undefined;
|
|
248
|
+
const existing = dependencies.get(dependency.manifestKey);
|
|
249
|
+
if (existing) {
|
|
250
|
+
existing.specifiers.add(dependency.specifier);
|
|
251
|
+
existing.sourcePath ??= sourcePath;
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
dependencies.set(dependency.manifestKey, {
|
|
255
|
+
manifestKey: dependency.manifestKey,
|
|
256
|
+
specifiers: new Set([dependency.specifier]),
|
|
257
|
+
sourcePath,
|
|
258
|
+
code: dependency.code,
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
function normalizeDependencySpecifier(specifier) {
|
|
262
|
+
return specifier.replace(/[?#].*$/, "");
|
|
263
|
+
}
|
|
264
|
+
function resolveLocalDependencyPath(specifier, parentFilePath) {
|
|
265
|
+
const normalized = normalizeDependencySpecifier(specifier);
|
|
266
|
+
if (normalized.startsWith("file://")) {
|
|
267
|
+
try {
|
|
268
|
+
return normalize(decodeURIComponent(new URL(normalized).pathname));
|
|
269
|
+
}
|
|
270
|
+
catch (_) {
|
|
271
|
+
return null;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
if (!parentFilePath || (!normalized.startsWith("./") && !normalized.startsWith("../"))) {
|
|
275
|
+
return null;
|
|
276
|
+
}
|
|
277
|
+
return normalize(join(dirname(parentFilePath), normalized));
|
|
278
|
+
}
|
|
279
|
+
function isPathInsideRoot(filePath, rootPath) {
|
|
280
|
+
const file = normalize(filePath);
|
|
281
|
+
const root = normalize(rootPath);
|
|
282
|
+
return file === root || file.startsWith(`${root}/`) || file.startsWith(`${root}\\`);
|
|
283
|
+
}
|
|
284
|
+
async function collectLocalHttpDependencyModules(code, dependencies, cacheDir) {
|
|
285
|
+
const fs = createFileSystem();
|
|
286
|
+
const cacheRoot = normalize(cacheDir);
|
|
287
|
+
const seen = new Set();
|
|
288
|
+
const queue = [];
|
|
289
|
+
for (const imp of await parseImports(code)) {
|
|
290
|
+
if (imp.n)
|
|
291
|
+
queue.push({ specifier: imp.n });
|
|
292
|
+
}
|
|
293
|
+
while (queue.length > 0) {
|
|
294
|
+
const { specifier, parentFilePath } = queue.shift();
|
|
295
|
+
const filePath = resolveLocalDependencyPath(specifier, parentFilePath);
|
|
296
|
+
if (!filePath || seen.has(filePath))
|
|
297
|
+
continue;
|
|
298
|
+
if (!isPathInsideRoot(filePath, cacheRoot)) {
|
|
299
|
+
throw new Error(`Vendored HTTP dependency resolved outside cache root: ${specifier}`);
|
|
300
|
+
}
|
|
301
|
+
seen.add(filePath);
|
|
302
|
+
const depCode = await fs.readTextFile(filePath);
|
|
303
|
+
const manifestKey = extractSourceUrl(depCode) ?? `file://${filePath}`;
|
|
304
|
+
const depSpecifiers = new Set([
|
|
305
|
+
normalizeDependencySpecifier(specifier),
|
|
306
|
+
`file://${filePath}`,
|
|
307
|
+
]);
|
|
308
|
+
const existing = dependencies.get(manifestKey);
|
|
309
|
+
if (existing) {
|
|
310
|
+
for (const depSpecifier of depSpecifiers)
|
|
311
|
+
existing.specifiers.add(depSpecifier);
|
|
312
|
+
existing.sourcePath ??= filePath;
|
|
313
|
+
}
|
|
314
|
+
else {
|
|
315
|
+
dependencies.set(manifestKey, {
|
|
316
|
+
manifestKey,
|
|
317
|
+
specifiers: depSpecifiers,
|
|
318
|
+
sourcePath: filePath,
|
|
319
|
+
code: depCode,
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
for (const imp of await parseImports(depCode)) {
|
|
323
|
+
if (imp.n)
|
|
324
|
+
queue.push({ specifier: imp.n, parentFilePath: filePath });
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
async function vendorHttpImportsWithCache(code, options) {
|
|
329
|
+
const imports = await parseImports(code);
|
|
330
|
+
if (!imports.some((imp) => imp.n &&
|
|
331
|
+
(imp.n.startsWith("http://") || imp.n.startsWith("https://") || imp.n.startsWith("npm:")))) {
|
|
332
|
+
return { code, dependencies: [] };
|
|
333
|
+
}
|
|
334
|
+
const cacheDir = join(options.tempDir, ".veryfront-http-bundle");
|
|
335
|
+
const result = await cacheHttpImportsToLocal(code, {
|
|
336
|
+
cacheDir,
|
|
337
|
+
importMap: { imports: {}, scopes: {} },
|
|
338
|
+
reactVersion: options.reactVersion,
|
|
339
|
+
});
|
|
340
|
+
const dependencies = new Map();
|
|
341
|
+
await collectLocalHttpDependencyModules(result.code, dependencies, cacheDir);
|
|
342
|
+
return {
|
|
343
|
+
code: result.code,
|
|
344
|
+
dependencies: [...dependencies.values()].flatMap((dependency) => [...dependency.specifiers].map((specifier) => ({
|
|
345
|
+
specifier,
|
|
346
|
+
manifestKey: dependency.manifestKey,
|
|
347
|
+
sourcePath: dependency.sourcePath,
|
|
348
|
+
code: dependency.code,
|
|
349
|
+
}))),
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
async function finalizeDependencyModules(dependencyModules, uploadQueue, pendingBytes, gaps) {
|
|
353
|
+
const bySpecifier = new Map();
|
|
354
|
+
const byFilePath = new Map();
|
|
355
|
+
for (const dependency of dependencyModules.values()) {
|
|
356
|
+
for (const specifier of dependency.specifiers) {
|
|
357
|
+
bySpecifier.set(normalizeDependencySpecifier(specifier), dependency);
|
|
358
|
+
const filePath = resolveLocalDependencyPath(specifier);
|
|
359
|
+
if (filePath)
|
|
360
|
+
byFilePath.set(filePath, dependency);
|
|
361
|
+
}
|
|
362
|
+
if (dependency.sourcePath)
|
|
363
|
+
byFilePath.set(dependency.sourcePath, dependency);
|
|
364
|
+
}
|
|
365
|
+
const finalized = new Map();
|
|
366
|
+
const fallbackUrls = new Map();
|
|
367
|
+
const skippedCycles = new Set();
|
|
368
|
+
const recordedCycleGaps = new Set();
|
|
369
|
+
const visiting = [];
|
|
370
|
+
function resolveDependencyImport(specifier, parent) {
|
|
371
|
+
const filePath = resolveLocalDependencyPath(specifier, parent.sourcePath);
|
|
372
|
+
if (filePath) {
|
|
373
|
+
const localDependency = byFilePath.get(filePath);
|
|
374
|
+
if (localDependency)
|
|
375
|
+
return localDependency;
|
|
376
|
+
}
|
|
377
|
+
return bySpecifier.get(normalizeDependencySpecifier(specifier)) ?? null;
|
|
378
|
+
}
|
|
379
|
+
function recordDependencyCycle(cycleKeys) {
|
|
380
|
+
// Separate content-hashed ESM files cannot represent cyclic imports without
|
|
381
|
+
// release-scoped aliases or bundling, so keep only that component on source URL fallback.
|
|
382
|
+
for (const key of cycleKeys)
|
|
383
|
+
skippedCycles.add(key);
|
|
384
|
+
const gap = `dependency-cycle:${cycleKeys.join("->")}`;
|
|
385
|
+
if (!recordedCycleGaps.has(gap)) {
|
|
386
|
+
recordedCycleGaps.add(gap);
|
|
387
|
+
gaps.push(gap);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
function cycleFallbackFor(dependency) {
|
|
391
|
+
if (!skippedCycles.has(dependency.manifestKey))
|
|
392
|
+
return null;
|
|
393
|
+
return dependencyFallbackUrl(dependency);
|
|
394
|
+
}
|
|
395
|
+
async function finalize(manifestKey) {
|
|
396
|
+
const existing = finalized.get(manifestKey);
|
|
397
|
+
if (existing)
|
|
398
|
+
return existing;
|
|
399
|
+
if (visiting.includes(manifestKey)) {
|
|
400
|
+
recordDependencyCycle([...visiting.slice(visiting.indexOf(manifestKey)), manifestKey]);
|
|
401
|
+
return null;
|
|
402
|
+
}
|
|
403
|
+
if (skippedCycles.has(manifestKey))
|
|
404
|
+
return null;
|
|
405
|
+
const dependency = dependencyModules.get(manifestKey);
|
|
406
|
+
if (!dependency)
|
|
407
|
+
return null;
|
|
408
|
+
visiting.push(manifestKey);
|
|
409
|
+
try {
|
|
410
|
+
const imports = await parseImports(dependency.code);
|
|
411
|
+
for (const imp of imports) {
|
|
412
|
+
if (!imp.n)
|
|
413
|
+
continue;
|
|
414
|
+
const filePath = resolveLocalDependencyPath(imp.n, dependency.sourcePath);
|
|
415
|
+
if (filePath && !byFilePath.has(filePath)) {
|
|
416
|
+
throw new Error(`Unresolved vendored file dependency: ${imp.n}`);
|
|
417
|
+
}
|
|
418
|
+
const child = resolveDependencyImport(imp.n, dependency);
|
|
419
|
+
if (!child)
|
|
420
|
+
continue;
|
|
421
|
+
if (child.manifestKey === manifestKey) {
|
|
422
|
+
recordDependencyCycle([manifestKey, manifestKey]);
|
|
423
|
+
continue;
|
|
424
|
+
}
|
|
425
|
+
await finalize(child.manifestKey);
|
|
426
|
+
}
|
|
427
|
+
if (skippedCycles.has(manifestKey))
|
|
428
|
+
return null;
|
|
429
|
+
const rewritten = await replaceSpecifiers(dependency.code, (specifier) => {
|
|
430
|
+
const child = resolveDependencyImport(specifier, dependency);
|
|
431
|
+
if (!child)
|
|
432
|
+
return null;
|
|
433
|
+
const asset = finalized.get(child.manifestKey);
|
|
434
|
+
if (asset)
|
|
435
|
+
return releaseAssetUrl(asset.contentHash, "js");
|
|
436
|
+
return cycleFallbackFor(child);
|
|
437
|
+
});
|
|
438
|
+
const entry = await addPreparedJavaScriptAsset(`__dependencies__/${manifestKey}`, rewritten, uploadQueue, pendingBytes);
|
|
439
|
+
if (!entry) {
|
|
440
|
+
throw new Error(`Vendored dependency exceeds release asset size limit: ${manifestKey}`);
|
|
441
|
+
}
|
|
442
|
+
for (const specifier of dependency.specifiers) {
|
|
443
|
+
bySpecifier.set(normalizeDependencySpecifier(specifier), dependency);
|
|
444
|
+
}
|
|
445
|
+
finalized.set(manifestKey, entry);
|
|
446
|
+
return entry;
|
|
447
|
+
}
|
|
448
|
+
finally {
|
|
449
|
+
visiting.pop();
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
try {
|
|
453
|
+
for (const manifestKey of dependencyModules.keys())
|
|
454
|
+
await finalize(manifestKey);
|
|
455
|
+
}
|
|
456
|
+
finally {
|
|
457
|
+
visiting.length = 0;
|
|
458
|
+
}
|
|
459
|
+
for (const manifestKey of skippedCycles) {
|
|
460
|
+
const dependency = dependencyModules.get(manifestKey);
|
|
461
|
+
if (!dependency)
|
|
462
|
+
continue;
|
|
463
|
+
const fallbackUrl = dependencyFallbackUrl(dependency);
|
|
464
|
+
if (!fallbackUrl) {
|
|
465
|
+
throw new Error(`Unrepresentable vendored dependency cycle: ${manifestKey}`);
|
|
466
|
+
}
|
|
467
|
+
addDependencyUrlAliases(fallbackUrls, dependency, fallbackUrl);
|
|
468
|
+
}
|
|
469
|
+
return { assets: Object.fromEntries(finalized), fallbackUrls };
|
|
210
470
|
}
|
|
211
471
|
async function finalizeProjectModules(transformedModules, knownPaths, dependencyUrls, uploadQueue, pendingBytes, gaps) {
|
|
212
472
|
const finalized = new Map();
|
|
@@ -446,11 +706,13 @@ async function runBuildInner(input, tempDir, client, transform) {
|
|
|
446
706
|
// 3 + 4. Collect the browser module closure and transform each module
|
|
447
707
|
// through the SAME pipeline serveModule uses (browser, non-SSR).
|
|
448
708
|
const transformedModules = new Map();
|
|
709
|
+
const dependencyModules = new Map();
|
|
449
710
|
const gaps = [];
|
|
450
711
|
const uploadQueue = [];
|
|
451
712
|
// Bytes are held per-hash only until uploaded, then dropped (M3).
|
|
452
713
|
const pendingBytes = new Map();
|
|
453
714
|
const knownPaths = new Set(sourceByPath.keys());
|
|
715
|
+
const vendorHttpImports = input.vendorHttpImports ?? vendorHttpImportsWithCache;
|
|
454
716
|
for (const [logicalPath, source] of sourceByPath) {
|
|
455
717
|
if (!isBrowserModule(logicalPath))
|
|
456
718
|
continue;
|
|
@@ -484,10 +746,64 @@ async function runBuildInner(input, tempDir, client, transform) {
|
|
|
484
746
|
error: sanitized,
|
|
485
747
|
};
|
|
486
748
|
}
|
|
749
|
+
try {
|
|
750
|
+
const vendored = await vendorHttpImports(code, {
|
|
751
|
+
tempDir,
|
|
752
|
+
reactVersion: input.reactVersion,
|
|
753
|
+
});
|
|
754
|
+
code = vendored.code;
|
|
755
|
+
for (const dependency of vendored.dependencies) {
|
|
756
|
+
addDependencyModule(dependencyModules, dependency);
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
catch (error) {
|
|
760
|
+
const sanitized = sanitizeError(error);
|
|
761
|
+
logger.warn("HTTP dependency vendoring failed during release asset build", {
|
|
762
|
+
path: logicalPath,
|
|
763
|
+
error: sanitized,
|
|
764
|
+
});
|
|
765
|
+
await client.reportReleaseAssetManifestState(input.releaseVersionRef, "failed", sanitized);
|
|
766
|
+
return {
|
|
767
|
+
success: false,
|
|
768
|
+
state: "failed",
|
|
769
|
+
moduleCount: 0,
|
|
770
|
+
cssCount: 0,
|
|
771
|
+
routeCount: 0,
|
|
772
|
+
gaps,
|
|
773
|
+
error: sanitized,
|
|
774
|
+
};
|
|
775
|
+
}
|
|
487
776
|
transformedModules.set(logicalPath, { logicalPath, code });
|
|
488
777
|
}
|
|
489
|
-
const
|
|
490
|
-
|
|
778
|
+
const frameworkDependencies = await buildFrameworkDependencies(input, tempDir, transform, uploadQueue, pendingBytes, gaps);
|
|
779
|
+
let httpDependencies;
|
|
780
|
+
let httpDependencyFallbackUrls = new Map();
|
|
781
|
+
try {
|
|
782
|
+
const finalizedHttpDependencies = await finalizeDependencyModules(dependencyModules, uploadQueue, pendingBytes, gaps);
|
|
783
|
+
httpDependencies = finalizedHttpDependencies.assets;
|
|
784
|
+
httpDependencyFallbackUrls = finalizedHttpDependencies.fallbackUrls;
|
|
785
|
+
}
|
|
786
|
+
catch (error) {
|
|
787
|
+
const sanitized = sanitizeError(error);
|
|
788
|
+
logger.warn("HTTP dependency finalization failed during release asset build", {
|
|
789
|
+
error: sanitized,
|
|
790
|
+
});
|
|
791
|
+
await client.reportReleaseAssetManifestState(input.releaseVersionRef, "failed", sanitized);
|
|
792
|
+
return {
|
|
793
|
+
success: false,
|
|
794
|
+
state: "failed",
|
|
795
|
+
moduleCount: 0,
|
|
796
|
+
cssCount: 0,
|
|
797
|
+
routeCount: 0,
|
|
798
|
+
gaps,
|
|
799
|
+
error: sanitized,
|
|
800
|
+
};
|
|
801
|
+
}
|
|
802
|
+
const dependencies = { ...frameworkDependencies, ...httpDependencies };
|
|
803
|
+
const dependencyUrls = buildDependencyUrlMap(dependencies, dependencyModules);
|
|
804
|
+
for (const [specifier, url] of httpDependencyFallbackUrls) {
|
|
805
|
+
dependencyUrls.set(specifier, url);
|
|
806
|
+
}
|
|
491
807
|
const { modules, skippedModules } = await finalizeProjectModules(transformedModules, knownPaths, dependencyUrls, uploadQueue, pendingBytes, gaps);
|
|
492
808
|
for (const logicalPath of transformedModules.keys()) {
|
|
493
809
|
if (modules[logicalPath])
|