MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / fetchAsset

Function fetchAsset

apps/cloud/executor.config.ts:90–100  ·  view source on GitHub ↗
(
  assets: { readonly fetch: (request: Request) => Promise<Response> },
  path: string,
)

Source from the content-addressed store, hash-verified

88const assetRequest = (path: string): Request => new Request(new URL(path, "https://assets.local"));
89
90const fetchAsset = async (
91 assets: { readonly fetch: (request: Request) => Promise<Response> },
92 path: string,
93): Promise<Response> => {
94 const response = await assets.fetch(assetRequest(path));
95 if (!response.ok) {
96 // oxlint-disable-next-line executor/no-try-catch-or-throw, executor/no-error-constructor -- boundary: worker artifact asset fetch must reject the dynamic bundler setup
97 throw new Error(`failed to fetch worker-bundler asset ${path}: ${response.status}`);
98 }
99 return response;
100};
101
102export default defineExecutorConfig({
103 plugins: ({

Callers 1

executor.config.tsFile · 0.85

Calls 2

assetRequestFunction · 0.85
fetchMethod · 0.65

Tested by

no test coverage detected