@astrale-os/adapter-cloudflare 0.5.0-beta.2 → 0.5.0-beta.21

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.
Files changed (120) hide show
  1. package/README.md +11 -0
  2. package/dist/adapter.d.ts +17 -0
  3. package/dist/adapter.js +140 -0
  4. package/dist/build/artifact.d.ts +8 -0
  5. package/dist/build/artifact.js +179 -0
  6. package/dist/build/closure.d.ts +2 -0
  7. package/dist/build/closure.js +22 -0
  8. package/dist/build/codegen/execution.d.ts +13 -0
  9. package/dist/build/codegen/execution.js +44 -0
  10. package/dist/build/codegen/gateway.d.ts +1 -0
  11. package/dist/build/codegen/gateway.js +7 -0
  12. package/dist/build/codegen/merge.d.ts +0 -1
  13. package/dist/build/codegen/merge.js +0 -1
  14. package/dist/build/codegen/wrangler.d.ts +10 -1
  15. package/dist/build/codegen/wrangler.js +22 -16
  16. package/dist/build/configuration.d.ts +9 -0
  17. package/dist/build/configuration.js +40 -0
  18. package/dist/build/frontend-v1.d.ts +16 -0
  19. package/dist/build/frontend-v1.js +133 -0
  20. package/dist/build/index.d.ts +8 -16
  21. package/dist/build/index.js +8 -16
  22. package/dist/build/metafile.d.ts +5 -0
  23. package/dist/build/metafile.js +14 -0
  24. package/dist/build/parse-output.d.ts +0 -1
  25. package/dist/build/parse-output.js +0 -1
  26. package/dist/build/qualification.d.ts +5 -0
  27. package/dist/build/qualification.js +7 -0
  28. package/dist/build/roots.d.ts +2 -0
  29. package/dist/build/roots.js +34 -0
  30. package/dist/build/wrangler-cli.d.ts +53 -34
  31. package/dist/build/wrangler-cli.js +284 -111
  32. package/dist/cloudflare.d.ts +1 -34
  33. package/dist/cloudflare.js +1 -205
  34. package/dist/deploy/deploy.d.ts +17 -0
  35. package/dist/deploy/deploy.js +207 -0
  36. package/dist/deploy/index.d.ts +1 -0
  37. package/dist/deploy/index.js +1 -0
  38. package/dist/identity/binding.d.ts +2 -0
  39. package/dist/identity/binding.js +2 -0
  40. package/dist/identity/material.d.ts +7 -0
  41. package/dist/identity/material.js +42 -0
  42. package/dist/identity/secret.d.ts +3 -0
  43. package/dist/identity/secret.js +7 -0
  44. package/dist/identity/source.d.ts +26 -0
  45. package/dist/identity/source.js +98 -0
  46. package/dist/index.d.ts +3 -4
  47. package/dist/index.js +3 -4
  48. package/dist/params.d.ts +18 -5
  49. package/dist/params.js +0 -1
  50. package/dist/release/index.d.ts +2 -0
  51. package/dist/release/index.js +2 -0
  52. package/dist/release/namespace.d.ts +2 -0
  53. package/dist/release/namespace.js +6 -0
  54. package/dist/release/target.d.ts +2 -0
  55. package/dist/release/target.js +9 -0
  56. package/dist/worker/entry.d.ts +34 -0
  57. package/dist/worker/entry.js +157 -0
  58. package/dist/worker/fetch.d.ts +11 -0
  59. package/dist/worker/fetch.js +31 -0
  60. package/dist/worker/gateway.d.ts +15 -0
  61. package/dist/worker/gateway.js +26 -0
  62. package/dist/worker/identity.d.ts +7 -0
  63. package/dist/worker/identity.js +23 -0
  64. package/dist/worker/index.d.ts +3 -48
  65. package/dist/worker/index.js +3 -186
  66. package/package.json +21 -18
  67. package/template/astrale.config.ts +19 -11
  68. package/dist/build/codegen/identity.d.ts +0 -10
  69. package/dist/build/codegen/identity.d.ts.map +0 -1
  70. package/dist/build/codegen/identity.js +0 -32
  71. package/dist/build/codegen/identity.js.map +0 -1
  72. package/dist/build/codegen/merge.d.ts.map +0 -1
  73. package/dist/build/codegen/merge.js.map +0 -1
  74. package/dist/build/codegen/worker.d.ts +0 -12
  75. package/dist/build/codegen/worker.d.ts.map +0 -1
  76. package/dist/build/codegen/worker.js +0 -40
  77. package/dist/build/codegen/worker.js.map +0 -1
  78. package/dist/build/codegen/wrangler.d.ts.map +0 -1
  79. package/dist/build/codegen/wrangler.js.map +0 -1
  80. package/dist/build/frontend.d.ts +0 -26
  81. package/dist/build/frontend.d.ts.map +0 -1
  82. package/dist/build/frontend.js +0 -263
  83. package/dist/build/frontend.js.map +0 -1
  84. package/dist/build/index.d.ts.map +0 -1
  85. package/dist/build/index.js.map +0 -1
  86. package/dist/build/parse-output.d.ts.map +0 -1
  87. package/dist/build/parse-output.js.map +0 -1
  88. package/dist/build/prepare.d.ts +0 -18
  89. package/dist/build/prepare.d.ts.map +0 -1
  90. package/dist/build/prepare.js +0 -117
  91. package/dist/build/prepare.js.map +0 -1
  92. package/dist/build/worker.d.ts +0 -15
  93. package/dist/build/worker.d.ts.map +0 -1
  94. package/dist/build/worker.js +0 -21
  95. package/dist/build/worker.js.map +0 -1
  96. package/dist/build/wrangler-cli.d.ts.map +0 -1
  97. package/dist/build/wrangler-cli.js.map +0 -1
  98. package/dist/cloudflare.d.ts.map +0 -1
  99. package/dist/cloudflare.js.map +0 -1
  100. package/dist/index.d.ts.map +0 -1
  101. package/dist/index.js.map +0 -1
  102. package/dist/params.d.ts.map +0 -1
  103. package/dist/params.js.map +0 -1
  104. package/dist/worker/index.d.ts.map +0 -1
  105. package/dist/worker/index.js.map +0 -1
  106. package/src/build/codegen/identity.ts +0 -40
  107. package/src/build/codegen/merge.ts +0 -92
  108. package/src/build/codegen/worker.ts +0 -53
  109. package/src/build/codegen/wrangler.ts +0 -127
  110. package/src/build/frontend.ts +0 -324
  111. package/src/build/index.ts +0 -29
  112. package/src/build/parse-output.ts +0 -60
  113. package/src/build/prepare.ts +0 -161
  114. package/src/build/worker.ts +0 -37
  115. package/src/build/wrangler-cli.ts +0 -362
  116. package/src/cloudflare.ts +0 -251
  117. package/src/index.ts +0 -21
  118. package/src/params.ts +0 -92
  119. package/src/worker/index.ts +0 -276
  120. package/src/worker/tsconfig.json +0 -10
@@ -0,0 +1,133 @@
1
+ import { frontend as frontendBuild } from '@astrale-os/sdk/deployment/build';
2
+ import { spawn } from 'node:child_process';
3
+ import { existsSync } from 'node:fs';
4
+ import { readFile, readdir, rm } from 'node:fs/promises';
5
+ import { createServer } from 'node:net';
6
+ import { join } from 'node:path';
7
+ export async function frontendFiles(input) {
8
+ const frontend = input.frontend;
9
+ if (frontend === undefined)
10
+ return [];
11
+ if (frontend.source.kind === 'external')
12
+ return frontendBuild.files(frontend, []);
13
+ const output = join(input.projectDir, '.astrale', 'frontend-build');
14
+ await rm(output, { recursive: true, force: true });
15
+ await run(viteCommand(input.projectDir), [
16
+ 'build',
17
+ '--outDir',
18
+ output,
19
+ '--emptyOutDir',
20
+ ...(frontend.source.config === undefined ? [] : ['--config', frontend.source.config]),
21
+ ], input.projectDir, input.onLog);
22
+ return frontendBuild.files(frontend, await readFiles(output));
23
+ }
24
+ export async function startFrontend(input) {
25
+ const frontend = input.frontend;
26
+ if (frontend === undefined || frontend.source.kind !== 'vite')
27
+ return undefined;
28
+ const port = await ephemeralPort();
29
+ const child = spawn(viteCommand(input.projectDir), [
30
+ '--host',
31
+ '127.0.0.1',
32
+ '--port',
33
+ String(port),
34
+ '--strictPort',
35
+ ...(frontend.source.config === undefined ? [] : ['--config', frontend.source.config]),
36
+ ], { cwd: input.projectDir, stdio: ['ignore', 'pipe', 'pipe'] });
37
+ const output = [];
38
+ const collect = (buffer) => {
39
+ for (const line of buffer.toString().split('\n')) {
40
+ if (line.trim() === '')
41
+ continue;
42
+ output.push(line);
43
+ if (output.length > 40)
44
+ output.shift();
45
+ input.onLog?.(line);
46
+ }
47
+ };
48
+ child.stdout?.on('data', collect);
49
+ child.stderr?.on('data', collect);
50
+ const url = `http://127.0.0.1:${port}`;
51
+ try {
52
+ await ready(url, child, output);
53
+ }
54
+ catch (cause) {
55
+ await stop(child);
56
+ throw cause;
57
+ }
58
+ return Object.freeze({ url, stop: () => stop(child) });
59
+ }
60
+ async function readFiles(root, current = '') {
61
+ const entries = await readdir(join(root, current), { withFileTypes: true });
62
+ const files = [];
63
+ for (const entry of entries.sort((left, right) => left.name.localeCompare(right.name))) {
64
+ const path = current === '' ? entry.name : `${current}/${entry.name}`;
65
+ if (entry.isDirectory())
66
+ files.push(...(await readFiles(root, path)));
67
+ else if (entry.isFile()) {
68
+ files.push({ path, content: new Uint8Array(await readFile(join(root, path))) });
69
+ }
70
+ }
71
+ return files;
72
+ }
73
+ function viteCommand(projectDir) {
74
+ const command = join(projectDir, 'node_modules', '.bin', 'vite');
75
+ if (!existsSync(command))
76
+ throw new TypeError('Vite frontend requires a project-local vite binary.');
77
+ return command;
78
+ }
79
+ function run(command, args, cwd, onLog) {
80
+ return new Promise((resolve, reject) => {
81
+ const child = spawn(command, args, { cwd, stdio: ['ignore', 'pipe', 'pipe'] });
82
+ let output = '';
83
+ const collect = (buffer) => {
84
+ const value = buffer.toString();
85
+ output += value;
86
+ for (const line of value.split('\n'))
87
+ if (line.trim() !== '')
88
+ onLog?.(line);
89
+ };
90
+ child.stdout?.on('data', collect);
91
+ child.stderr?.on('data', collect);
92
+ child.on('error', reject);
93
+ child.on('exit', (code) => code === 0
94
+ ? resolve()
95
+ : reject(new Error(`Vite failed (code ${code ?? 1}):\n${output.slice(-1500)}`)));
96
+ });
97
+ }
98
+ function ephemeralPort() {
99
+ return new Promise((resolve, reject) => {
100
+ const server = createServer();
101
+ server.once('error', reject);
102
+ server.listen(0, '127.0.0.1', () => {
103
+ const address = server.address();
104
+ const port = typeof address === 'object' && address !== null ? address.port : 0;
105
+ server.close((cause) => (cause === undefined ? resolve(port) : reject(cause)));
106
+ });
107
+ });
108
+ }
109
+ async function ready(url, child, output) {
110
+ const deadline = Date.now() + 15_000;
111
+ while (Date.now() < deadline) {
112
+ if (child.exitCode !== null) {
113
+ throw new Error(`Vite exited before readiness (code ${child.exitCode}).\n${output.join('\n')}`);
114
+ }
115
+ try {
116
+ const response = await fetch(url, { signal: AbortSignal.timeout(500) });
117
+ await response.body?.cancel();
118
+ return;
119
+ }
120
+ catch {
121
+ await new Promise((resolve) => setTimeout(resolve, 50));
122
+ }
123
+ }
124
+ throw new Error(`Vite did not become ready at ${url}.`);
125
+ }
126
+ function stop(child) {
127
+ if (child.exitCode !== null || child.killed)
128
+ return Promise.resolve();
129
+ return new Promise((resolve) => {
130
+ child.once('exit', () => resolve());
131
+ child.kill('SIGTERM');
132
+ });
133
+ }
@@ -1,16 +1,8 @@
1
- /**
2
- * `@astrale-os/adapter-cloudflare/build` the shared Cloudflare-Workers build
3
- * toolkit, exposed for sibling deploy adapters (e.g.
4
- * `@astrale-os/adapter-astrale`).
5
- *
6
- * This is the "compile a `defineDomain` into a Cloudflare Workers bundle + run
7
- * local dev" surface that every Cloudflare-Workers deploy strategy shares,
8
- * regardless of WHERE the bundle ultimately ships. It is NOT part of the public
9
- * adapter API (`@astrale-os/adapter-cloudflare`) — it's the seam two adapters
10
- * build on so the codegen/bundling/dev logic lives in exactly one place.
11
- */
12
- export { buildFrontend, FRONTEND_STAGE_DIR, watchFrontend, type FrontendWatchHandle, type FrontendWatchSubscribe, type FrontendWatchSubscription, } from './frontend.js';
13
- export { logTo, prepare } from './prepare.js';
14
- export { buildCloudflareWorker, type CloudflareWorkerBuild } from './worker.js';
15
- export { bulkPutSecrets, runWranglerBundle, runWranglerDeploy, runWranglerDev, runWranglerTypes, } from './wrangler-cli.js';
16
- //# sourceMappingURL=index.d.ts.map
1
+ export { artifact, materialize } from './artifact.js';
2
+ export { resolveRouter, workerName } from './configuration.js';
3
+ export { frontendFiles, startFrontend, type FrontendDevHandle } from './frontend-v1.js';
4
+ export { qualifyWorkerBundle } from './qualification.js';
5
+ export { assertSingletonRuntimeRoots } from './roots.js';
6
+ export { signingIdentity } from '../identity/source.js';
7
+ export { signingIdentitySecrets } from '../identity/secret.js';
8
+ export { runWranglerBundle, runWranglerDeploy, runWranglerDeploymentStatus, runWranglerDev, runWranglerTypes, } from './wrangler-cli.js';
@@ -1,16 +1,8 @@
1
- /**
2
- * `@astrale-os/adapter-cloudflare/build` the shared Cloudflare-Workers build
3
- * toolkit, exposed for sibling deploy adapters (e.g.
4
- * `@astrale-os/adapter-astrale`).
5
- *
6
- * This is the "compile a `defineDomain` into a Cloudflare Workers bundle + run
7
- * local dev" surface that every Cloudflare-Workers deploy strategy shares,
8
- * regardless of WHERE the bundle ultimately ships. It is NOT part of the public
9
- * adapter API (`@astrale-os/adapter-cloudflare`) — it's the seam two adapters
10
- * build on so the codegen/bundling/dev logic lives in exactly one place.
11
- */
12
- export { buildFrontend, FRONTEND_STAGE_DIR, watchFrontend, } from './frontend.js';
13
- export { logTo, prepare } from './prepare.js';
14
- export { buildCloudflareWorker } from './worker.js';
15
- export { bulkPutSecrets, runWranglerBundle, runWranglerDeploy, runWranglerDev, runWranglerTypes, } from './wrangler-cli.js';
16
- //# sourceMappingURL=index.js.map
1
+ export { artifact, materialize } from './artifact.js';
2
+ export { resolveRouter, workerName } from './configuration.js';
3
+ export { frontendFiles, startFrontend } from './frontend-v1.js';
4
+ export { qualifyWorkerBundle } from './qualification.js';
5
+ export { assertSingletonRuntimeRoots } from './roots.js';
6
+ export { signingIdentity } from '../identity/source.js';
7
+ export { signingIdentitySecrets } from '../identity/secret.js';
8
+ export { runWranglerBundle, runWranglerDeploy, runWranglerDeploymentStatus, runWranglerDev, runWranglerTypes, } from './wrangler-cli.js';
@@ -0,0 +1,5 @@
1
+ export interface WranglerMetafile {
2
+ readonly inputs: Readonly<Record<string, unknown>>;
3
+ }
4
+ /** Decode Wrangler's emitted esbuild graph at the provider-tooling boundary. */
5
+ export declare function readWranglerMetafile(path: string): Promise<WranglerMetafile>;
@@ -0,0 +1,14 @@
1
+ import { readFile } from 'node:fs/promises';
2
+ /** Decode Wrangler's emitted esbuild graph at the provider-tooling boundary. */
3
+ export async function readWranglerMetafile(path) {
4
+ const source = await readFile(path, 'utf8');
5
+ const value = JSON.parse(source);
6
+ if (value === null || typeof value !== 'object' || Array.isArray(value)) {
7
+ throw new TypeError('Wrangler metafile is not an object.');
8
+ }
9
+ const inputs = Reflect.get(value, 'inputs');
10
+ if (inputs === null || typeof inputs !== 'object' || Array.isArray(inputs)) {
11
+ throw new TypeError('Wrangler metafile has no input graph.');
12
+ }
13
+ return Object.freeze({ inputs: inputs });
14
+ }
@@ -24,4 +24,3 @@ export declare function parseDeployUrl(text: string, route?: string): string | u
24
24
  export declare function parseDeployVersionId(text: string): string | undefined;
25
25
  /** Normalize a local dev URL to an origin: `0.0.0.0` → `localhost`, fill the port. */
26
26
  export declare function normalizeLocal(url: string, port: number): string;
27
- //# sourceMappingURL=parse-output.d.ts.map
@@ -55,4 +55,3 @@ export function normalizeLocal(url, port) {
55
55
  return `http://localhost:${port}`;
56
56
  }
57
57
  }
58
- //# sourceMappingURL=parse-output.js.map
@@ -0,0 +1,5 @@
1
+ /** Qualify Wrangler's emitted module, not generated source or an inferred graph. */
2
+ export declare function qualifyWorkerBundle(evidence: {
3
+ readonly metafilePath: string;
4
+ readonly inputRoot: string;
5
+ }): Promise<void>;
@@ -0,0 +1,7 @@
1
+ import { assertRuntimeClosure } from './closure.js';
2
+ import { assertSingletonRuntimeRoots } from './roots.js';
3
+ /** Qualify Wrangler's emitted module, not generated source or an inferred graph. */
4
+ export async function qualifyWorkerBundle(evidence) {
5
+ await assertRuntimeClosure(evidence.metafilePath);
6
+ await assertSingletonRuntimeRoots(evidence.metafilePath, evidence.inputRoot);
7
+ }
@@ -0,0 +1,2 @@
1
+ /** Prove that Wrangler emitted at most one physical root per runtime package. */
2
+ export declare function assertSingletonRuntimeRoots(metafilePath: string, inputRoot: string): Promise<void>;
@@ -0,0 +1,34 @@
1
+ import { realpath } from 'node:fs/promises';
2
+ import { resolve } from 'node:path';
3
+ import { readWranglerMetafile } from './metafile.js';
4
+ const RUNTIME_PACKAGES = [
5
+ '@astrale-os/adapter-cloudflare',
6
+ '@astrale-os/sdk',
7
+ '@astrale-os/kernel-core',
8
+ '@astrale-os/kernel-dsl',
9
+ '@astrale-os/kernel-ports',
10
+ '@astrale-os/kernel-protocol',
11
+ '@astrale-os/kernel-server',
12
+ '@astrale-os/kernel-client',
13
+ ];
14
+ /** Prove that Wrangler emitted at most one physical root per runtime package. */
15
+ export async function assertSingletonRuntimeRoots(metafilePath, inputRoot) {
16
+ const metafile = await readWranglerMetafile(metafilePath);
17
+ for (const name of RUNTIME_PACKAGES) {
18
+ const roots = new Set();
19
+ for (const input of Object.keys(metafile.inputs)) {
20
+ const root = packageRoot(input, name);
21
+ if (root !== undefined)
22
+ roots.add(await realpath(resolve(inputRoot, root)));
23
+ }
24
+ if (roots.size > 1) {
25
+ throw new Error(`Cloudflare Worker contains duplicate physical ${name} roots: ${[...roots].join(', ')}.`);
26
+ }
27
+ }
28
+ }
29
+ function packageRoot(input, name) {
30
+ const normalized = input.replaceAll('\\', '/');
31
+ const marker = `node_modules/${name}/`;
32
+ const index = normalized.lastIndexOf(marker);
33
+ return index < 0 ? undefined : normalized.slice(0, index + marker.length - 1);
34
+ }
@@ -6,6 +6,8 @@
6
6
  * bulk`. The wrangler binary is resolved from the project's `node_modules/.bin`,
7
7
  * falling back to `npx wrangler`.
8
8
  */
9
+ /** Keep Wrangler CLI diagnostic logs inside the generated project state. */
10
+ export declare function wranglerProcessEnv(projectDir: string): NodeJS.ProcessEnv;
9
11
  export interface DevHandle {
10
12
  url: string;
11
13
  stop(): Promise<void>;
@@ -19,53 +21,68 @@ export declare function runWranglerDev(args: {
19
21
  ip?: string;
20
22
  /** When the port was NOT explicitly chosen, dodge a taken one automatically. */
21
23
  autoPickPort?: boolean;
24
+ /** Secret bindings loaded through Wrangler's dotenv boundary, never config vars. */
25
+ secrets: Readonly<Record<string, string>>;
22
26
  onReload: () => void;
23
27
  onLog?: (line: string) => void;
24
28
  }): Promise<DevHandle>;
25
29
  export interface DeployArgs {
26
30
  configPath: string;
27
- /** SELF-less config for the first-deploy two-pass (see `deployWithSelfFallback`). */
28
- fallbackConfigPath?: string;
29
- /** The worker's own name, to scope the self-binding-missing detection. */
30
- workerName?: string;
31
31
  route?: string;
32
32
  onLog?: (line: string) => void;
33
33
  }
34
+ export declare class WranglerDeployError extends Error {
35
+ readonly applied?: {
36
+ readonly url?: string;
37
+ readonly deploymentVersion?: string;
38
+ };
39
+ constructor(message: string, applied?: {
40
+ readonly url?: string;
41
+ readonly deploymentVersion?: string;
42
+ });
43
+ }
34
44
  export declare function runWranglerDeploy(args: DeployArgs & {
35
45
  projectDir: string;
36
46
  }): Promise<{
37
- url: string;
47
+ url?: string;
38
48
  raw: string;
39
- deploymentVersion?: string;
49
+ deploymentVersion: string;
40
50
  }>;
41
- /**
42
- * Deploy with a one-time SELF-binding first-deploy recovery. A fresh worker that
43
- * declares a `services: SELF` binding can't deploy (its own script doesn't exist
44
- * yet); on THAT specific failure we deploy the SELF-less fallback to create the
45
- * script, then redeploy WITH SELF so autobinding works. Steady state (every
46
- * deploy after the first) is a single pass. The `deploy` runner is injected so
47
- * the orchestration is unit-testable without shelling out.
48
- */
49
- export declare function deployWithSelfFallback(deploy: (configPath: string) => Promise<{
50
- code: number;
51
- out: string;
52
- }>, args: DeployArgs): Promise<{
53
- url: string;
54
- raw: string;
55
- deploymentVersion?: string;
51
+ /** Upload one Schema-revision Worker without assigning it a public route. */
52
+ export declare function runWranglerReleaseDeploy(args: {
53
+ readonly projectDir: string;
54
+ readonly configPath: string;
55
+ readonly namespace: string;
56
+ readonly secrets: Readonly<Record<string, string>>;
57
+ readonly onLog?: (line: string) => void;
58
+ }): Promise<{
59
+ readonly raw: string;
60
+ readonly deploymentVersion: string;
56
61
  }>;
57
- /**
58
- * True when wrangler failed specifically because the worker's OWN `SELF` service
59
- * binding can't resolve yet (first deploy of a fresh script). Requires the
60
- * worker name so an unrelated missing-service error doesn't trigger the two-pass.
61
- */
62
- export declare function isSelfBindingMissing(out: string, workerName?: string): boolean;
63
- export declare function bulkPutSecrets(args: {
64
- projectDir: string;
65
- configPath: string;
66
- secrets: Record<string, string>;
67
- onLog?: (line: string) => void;
62
+ export declare class WranglerDispatchNamespaceError extends Error {
63
+ readonly effect: 'none' | 'unknown';
64
+ constructor(message: string, effect: 'none' | 'unknown');
65
+ }
66
+ /** Establish the private dispatch namespace without advancing the public gateway. */
67
+ export declare function ensureWranglerDispatchNamespace(args: {
68
+ readonly projectDir: string;
69
+ readonly namespace: string;
70
+ readonly onLog?: (line: string) => void;
68
71
  }): Promise<void>;
72
+ export declare function runWranglerDeploymentStatus(args: {
73
+ readonly projectDir: string;
74
+ readonly configPath: string;
75
+ readonly workerName: string;
76
+ }): Promise<WranglerDeploymentStatus>;
77
+ export interface WranglerDeploymentStatus {
78
+ readonly deployment: string;
79
+ readonly versions: readonly {
80
+ readonly version: string;
81
+ readonly percentage: number;
82
+ }[];
83
+ }
84
+ /** Admit Wrangler's current-deployment JSON before it becomes provider evidence. */
85
+ export declare function admitWranglerDeploymentStatus(output: string): WranglerDeploymentStatus;
69
86
  /**
70
87
  * Build the single-module worker bundle WITHOUT deploying — `wrangler deploy
71
88
  * --dry-run --outdir` (no Cloudflare auth required). Returns the path of the
@@ -76,11 +93,13 @@ export declare function runWranglerBundle(args: {
76
93
  configPath: string;
77
94
  outDir: string;
78
95
  onLog?: (line: string) => void;
79
- }): Promise<string>;
96
+ }): Promise<{
97
+ readonly bundlePath: string;
98
+ readonly metafilePath: string;
99
+ }>;
80
100
  /** Generate the exact binding and runtime types selected by the generated config. */
81
101
  export declare function runWranglerTypes(args: {
82
102
  readonly projectDir: string;
83
103
  readonly configPath: string;
84
104
  readonly onLog?: (line: string) => void;
85
105
  }): Promise<string>;
86
- //# sourceMappingURL=wrangler-cli.d.ts.map