devflare 0.0.0 → 1.0.0-next.0

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 (198) hide show
  1. package/README.md +737 -1
  2. package/bin/devflare.js +14 -0
  3. package/dist/account-rvrj687w.js +397 -0
  4. package/dist/ai-dx4fr9jh.js +107 -0
  5. package/dist/bridge/client.d.ts +82 -0
  6. package/dist/bridge/client.d.ts.map +1 -0
  7. package/dist/bridge/index.d.ts +7 -0
  8. package/dist/bridge/index.d.ts.map +1 -0
  9. package/dist/bridge/miniflare.d.ts +70 -0
  10. package/dist/bridge/miniflare.d.ts.map +1 -0
  11. package/dist/bridge/protocol.d.ts +146 -0
  12. package/dist/bridge/protocol.d.ts.map +1 -0
  13. package/dist/bridge/proxy.d.ts +49 -0
  14. package/dist/bridge/proxy.d.ts.map +1 -0
  15. package/dist/bridge/serialization.d.ts +83 -0
  16. package/dist/bridge/serialization.d.ts.map +1 -0
  17. package/dist/bridge/server.d.ts +8 -0
  18. package/dist/bridge/server.d.ts.map +1 -0
  19. package/dist/browser-shim/binding-worker.d.ts +7 -0
  20. package/dist/browser-shim/binding-worker.d.ts.map +1 -0
  21. package/dist/browser-shim/handler.d.ts +21 -0
  22. package/dist/browser-shim/handler.d.ts.map +1 -0
  23. package/dist/browser-shim/index.d.ts +3 -0
  24. package/dist/browser-shim/index.d.ts.map +1 -0
  25. package/dist/browser-shim/server.d.ts +25 -0
  26. package/dist/browser-shim/server.d.ts.map +1 -0
  27. package/dist/browser-shim/worker.d.ts +14 -0
  28. package/dist/browser-shim/worker.d.ts.map +1 -0
  29. package/dist/build-mnf6v8gd.js +53 -0
  30. package/dist/bundler/do-bundler.d.ts +42 -0
  31. package/dist/bundler/do-bundler.d.ts.map +1 -0
  32. package/dist/bundler/index.d.ts +2 -0
  33. package/dist/bundler/index.d.ts.map +1 -0
  34. package/dist/cli/bin.d.ts +3 -0
  35. package/dist/cli/bin.d.ts.map +1 -0
  36. package/dist/cli/colors.d.ts +11 -0
  37. package/dist/cli/colors.d.ts.map +1 -0
  38. package/dist/cli/commands/account.d.ts +4 -0
  39. package/dist/cli/commands/account.d.ts.map +1 -0
  40. package/dist/cli/commands/ai.d.ts +3 -0
  41. package/dist/cli/commands/ai.d.ts.map +1 -0
  42. package/dist/cli/commands/build.d.ts +4 -0
  43. package/dist/cli/commands/build.d.ts.map +1 -0
  44. package/dist/cli/commands/deploy.d.ts +4 -0
  45. package/dist/cli/commands/deploy.d.ts.map +1 -0
  46. package/dist/cli/commands/dev.d.ts +4 -0
  47. package/dist/cli/commands/dev.d.ts.map +1 -0
  48. package/dist/cli/commands/doctor.d.ts +4 -0
  49. package/dist/cli/commands/doctor.d.ts.map +1 -0
  50. package/dist/cli/commands/init.d.ts +4 -0
  51. package/dist/cli/commands/init.d.ts.map +1 -0
  52. package/dist/cli/commands/remote.d.ts +4 -0
  53. package/dist/cli/commands/remote.d.ts.map +1 -0
  54. package/dist/cli/commands/types.d.ts +4 -0
  55. package/dist/cli/commands/types.d.ts.map +1 -0
  56. package/dist/cli/dependencies.d.ts +90 -0
  57. package/dist/cli/dependencies.d.ts.map +1 -0
  58. package/dist/cli/index.d.ts +23 -0
  59. package/dist/cli/index.d.ts.map +1 -0
  60. package/dist/cli/wrangler-auth.d.ts +36 -0
  61. package/dist/cli/wrangler-auth.d.ts.map +1 -0
  62. package/dist/cloudflare/account.d.ts +65 -0
  63. package/dist/cloudflare/account.d.ts.map +1 -0
  64. package/dist/cloudflare/api.d.ts +51 -0
  65. package/dist/cloudflare/api.d.ts.map +1 -0
  66. package/dist/cloudflare/auth.d.ts +35 -0
  67. package/dist/cloudflare/auth.d.ts.map +1 -0
  68. package/dist/cloudflare/index.d.ts +107 -0
  69. package/dist/cloudflare/index.d.ts.map +1 -0
  70. package/dist/cloudflare/index.js +13 -0
  71. package/dist/cloudflare/preferences.d.ts +46 -0
  72. package/dist/cloudflare/preferences.d.ts.map +1 -0
  73. package/dist/cloudflare/pricing.d.ts +15 -0
  74. package/dist/cloudflare/pricing.d.ts.map +1 -0
  75. package/dist/cloudflare/remote-config.d.ts +37 -0
  76. package/dist/cloudflare/remote-config.d.ts.map +1 -0
  77. package/dist/cloudflare/types.d.ts +161 -0
  78. package/dist/cloudflare/types.d.ts.map +1 -0
  79. package/dist/cloudflare/usage.d.ts +77 -0
  80. package/dist/cloudflare/usage.d.ts.map +1 -0
  81. package/dist/config/compiler.d.ts +146 -0
  82. package/dist/config/compiler.d.ts.map +1 -0
  83. package/dist/config/define.d.ts +44 -0
  84. package/dist/config/define.d.ts.map +1 -0
  85. package/dist/config/index.d.ts +6 -0
  86. package/dist/config/index.d.ts.map +1 -0
  87. package/dist/config/loader.d.ts +52 -0
  88. package/dist/config/loader.d.ts.map +1 -0
  89. package/dist/config/ref.d.ts +160 -0
  90. package/dist/config/ref.d.ts.map +1 -0
  91. package/dist/config/schema.d.ts +3318 -0
  92. package/dist/config/schema.d.ts.map +1 -0
  93. package/dist/decorators/durable-object.d.ts +59 -0
  94. package/dist/decorators/durable-object.d.ts.map +1 -0
  95. package/dist/decorators/index.d.ts +3 -0
  96. package/dist/decorators/index.d.ts.map +1 -0
  97. package/dist/decorators/index.js +9 -0
  98. package/dist/deploy-nhceck39.js +70 -0
  99. package/dist/dev-qnxet3j9.js +2096 -0
  100. package/dist/dev-server/index.d.ts +2 -0
  101. package/dist/dev-server/index.d.ts.map +1 -0
  102. package/dist/dev-server/server.d.ts +30 -0
  103. package/dist/dev-server/server.d.ts.map +1 -0
  104. package/dist/doctor-e8fy6fj5.js +186 -0
  105. package/dist/durable-object-t4kbb0yt.js +13 -0
  106. package/dist/env.d.ts +48 -0
  107. package/dist/env.d.ts.map +1 -0
  108. package/dist/index-07q6yxyc.js +168 -0
  109. package/dist/index-1xpj0m4r.js +57 -0
  110. package/dist/index-37x76zdn.js +4 -0
  111. package/dist/index-3t6rypgc.js +13 -0
  112. package/dist/index-67qcae0f.js +183 -0
  113. package/dist/index-a855bdsx.js +18 -0
  114. package/dist/index-d8bdkx2h.js +109 -0
  115. package/dist/index-ep3445yc.js +2225 -0
  116. package/dist/index-gz1gndna.js +307 -0
  117. package/dist/index-hcex3rgh.js +266 -0
  118. package/dist/index-m2q41jwa.js +462 -0
  119. package/dist/index-n7rs26ft.js +77 -0
  120. package/dist/index-pf5s73n9.js +1413 -0
  121. package/dist/index-rbht7m9r.js +36 -0
  122. package/dist/index-tfyxa77h.js +850 -0
  123. package/dist/index-tk6ej9dj.js +94 -0
  124. package/dist/index-z14anrqp.js +226 -0
  125. package/dist/index.d.ts +13 -0
  126. package/dist/index.d.ts.map +1 -0
  127. package/dist/index.js +298 -0
  128. package/dist/init-f9mgmew3.js +186 -0
  129. package/dist/remote-q59qk463.js +97 -0
  130. package/dist/runtime/context.d.ts +46 -0
  131. package/dist/runtime/context.d.ts.map +1 -0
  132. package/dist/runtime/exports.d.ts +118 -0
  133. package/dist/runtime/exports.d.ts.map +1 -0
  134. package/dist/runtime/index.d.ts +4 -0
  135. package/dist/runtime/index.d.ts.map +1 -0
  136. package/dist/runtime/index.js +111 -0
  137. package/dist/runtime/middleware.d.ts +82 -0
  138. package/dist/runtime/middleware.d.ts.map +1 -0
  139. package/dist/runtime/validation.d.ts +37 -0
  140. package/dist/runtime/validation.d.ts.map +1 -0
  141. package/dist/sveltekit/index.d.ts +2 -0
  142. package/dist/sveltekit/index.d.ts.map +1 -0
  143. package/dist/sveltekit/index.js +182 -0
  144. package/dist/sveltekit/platform.d.ts +141 -0
  145. package/dist/sveltekit/platform.d.ts.map +1 -0
  146. package/dist/test/bridge-context.d.ts +73 -0
  147. package/dist/test/bridge-context.d.ts.map +1 -0
  148. package/dist/test/cf.d.ts +130 -0
  149. package/dist/test/cf.d.ts.map +1 -0
  150. package/dist/test/email.d.ts +75 -0
  151. package/dist/test/email.d.ts.map +1 -0
  152. package/dist/test/index.d.ts +22 -0
  153. package/dist/test/index.d.ts.map +1 -0
  154. package/dist/test/index.js +71 -0
  155. package/dist/test/multi-worker-context.d.ts +114 -0
  156. package/dist/test/multi-worker-context.d.ts.map +1 -0
  157. package/dist/test/queue.d.ts +74 -0
  158. package/dist/test/queue.d.ts.map +1 -0
  159. package/dist/test/remote-ai.d.ts +6 -0
  160. package/dist/test/remote-ai.d.ts.map +1 -0
  161. package/dist/test/remote-vectorize.d.ts +6 -0
  162. package/dist/test/remote-vectorize.d.ts.map +1 -0
  163. package/dist/test/resolve-service-bindings.d.ts +68 -0
  164. package/dist/test/resolve-service-bindings.d.ts.map +1 -0
  165. package/dist/test/scheduled.d.ts +58 -0
  166. package/dist/test/scheduled.d.ts.map +1 -0
  167. package/dist/test/should-skip.d.ts +50 -0
  168. package/dist/test/should-skip.d.ts.map +1 -0
  169. package/dist/test/simple-context.d.ts +43 -0
  170. package/dist/test/simple-context.d.ts.map +1 -0
  171. package/dist/test/tail.d.ts +86 -0
  172. package/dist/test/tail.d.ts.map +1 -0
  173. package/dist/test/utilities.d.ts +99 -0
  174. package/dist/test/utilities.d.ts.map +1 -0
  175. package/dist/test/worker.d.ts +76 -0
  176. package/dist/test/worker.d.ts.map +1 -0
  177. package/dist/transform/durable-object.d.ts +46 -0
  178. package/dist/transform/durable-object.d.ts.map +1 -0
  179. package/dist/transform/index.d.ts +3 -0
  180. package/dist/transform/index.d.ts.map +1 -0
  181. package/dist/transform/worker-entrypoint.d.ts +66 -0
  182. package/dist/transform/worker-entrypoint.d.ts.map +1 -0
  183. package/dist/types-5nyrz1sz.js +454 -0
  184. package/dist/utils/entrypoint-discovery.d.ts +29 -0
  185. package/dist/utils/entrypoint-discovery.d.ts.map +1 -0
  186. package/dist/utils/glob.d.ts +33 -0
  187. package/dist/utils/glob.d.ts.map +1 -0
  188. package/dist/utils/resolve-package.d.ts +10 -0
  189. package/dist/utils/resolve-package.d.ts.map +1 -0
  190. package/dist/vite/index.d.ts +3 -0
  191. package/dist/vite/index.d.ts.map +1 -0
  192. package/dist/vite/index.js +339 -0
  193. package/dist/vite/plugin.d.ts +138 -0
  194. package/dist/vite/plugin.d.ts.map +1 -0
  195. package/dist/worker-entrypoint-m9th0rg0.js +13 -0
  196. package/dist/workerName.d.ts +17 -0
  197. package/dist/workerName.d.ts.map +1 -0
  198. package/package.json +111 -1
@@ -0,0 +1,4 @@
1
+ import { type ConsolaInstance } from 'consola';
2
+ import type { ParsedArgs, CliOptions, CliResult } from '../index';
3
+ export declare function runDeployCommand(parsed: ParsedArgs, logger: ConsolaInstance, options: CliOptions): Promise<CliResult>;
4
+ //# sourceMappingURL=deploy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/deploy.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAKjE,wBAAsB,gBAAgB,CACrC,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,UAAU,GACjB,OAAO,CAAC,SAAS,CAAC,CAsEpB"}
@@ -0,0 +1,4 @@
1
+ import { type ConsolaInstance } from 'consola';
2
+ import type { ParsedArgs, CliOptions, CliResult } from '../index';
3
+ export declare function runDevCommand(parsed: ParsedArgs, logger: ConsolaInstance, options: CliOptions): Promise<CliResult>;
4
+ //# sourceMappingURL=dev.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/dev.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAiB,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAE7D,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AA+DjE,wBAAsB,aAAa,CAClC,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,UAAU,GACjB,OAAO,CAAC,SAAS,CAAC,CAgGpB"}
@@ -0,0 +1,4 @@
1
+ import { type ConsolaInstance } from 'consola';
2
+ import type { ParsedArgs, CliOptions, CliResult } from '../index';
3
+ export declare function runDoctorCommand(parsed: ParsedArgs, logger: ConsolaInstance, options: CliOptions): Promise<CliResult>;
4
+ //# sourceMappingURL=doctor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/doctor.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAUjE,wBAAsB,gBAAgB,CACrC,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,UAAU,GACjB,OAAO,CAAC,SAAS,CAAC,CAqMpB"}
@@ -0,0 +1,4 @@
1
+ import { type ConsolaInstance } from 'consola';
2
+ import type { ParsedArgs, CliOptions, CliResult } from '../index';
3
+ export declare function runInitCommand(parsed: ParsedArgs, logger: ConsolaInstance, options: CliOptions): Promise<CliResult>;
4
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAmKjE,wBAAsB,cAAc,CACnC,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,UAAU,GACjB,OAAO,CAAC,SAAS,CAAC,CAqDpB"}
@@ -0,0 +1,4 @@
1
+ import type { ConsolaInstance } from 'consola';
2
+ import type { ParsedArgs, CliOptions, CliResult } from '../index';
3
+ export declare function runRemoteCommand(parsed: ParsedArgs, _logger: ConsolaInstance, _options: CliOptions): CliResult;
4
+ //# sourceMappingURL=remote.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/remote.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAwFjE,wBAAgB,gBAAgB,CAC/B,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,UAAU,GAClB,SAAS,CAyBX"}
@@ -0,0 +1,4 @@
1
+ import { type ConsolaInstance } from 'consola';
2
+ import type { ParsedArgs, CliOptions, CliResult } from '../index';
3
+ export declare function runTypesCommand(parsed: ParsedArgs, logger: ConsolaInstance, options: CliOptions): Promise<CliResult>;
4
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AA0oBjE,wBAAsB,eAAe,CACpC,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,UAAU,GACjB,OAAO,CAAC,SAAS,CAAC,CAwHpB"}
@@ -0,0 +1,90 @@
1
+ import type { PathLike, MakeDirectoryOptions, Stats } from 'node:fs';
2
+ import type { Options as ExecaOptions } from 'execa';
3
+ /**
4
+ * Filesystem abstraction for CLI commands
5
+ */
6
+ export interface FileSystem {
7
+ readFile(path: PathLike, encoding: BufferEncoding): Promise<string>;
8
+ readFile(path: PathLike, options?: {
9
+ encoding?: BufferEncoding;
10
+ }): Promise<string | Buffer>;
11
+ writeFile(path: PathLike, data: string | Buffer, encoding?: BufferEncoding): Promise<void>;
12
+ mkdir(path: PathLike, options?: MakeDirectoryOptions): Promise<string | undefined>;
13
+ access(path: PathLike, mode?: number): Promise<void>;
14
+ stat(path: PathLike): Promise<Stats>;
15
+ readdir(path: PathLike, options?: {
16
+ withFileTypes?: boolean;
17
+ }): Promise<string[] | Array<{
18
+ name: string;
19
+ isDirectory(): boolean;
20
+ isFile(): boolean;
21
+ }>>;
22
+ rm(path: PathLike, options?: {
23
+ recursive?: boolean;
24
+ force?: boolean;
25
+ }): Promise<void>;
26
+ unlink(path: PathLike): Promise<void>;
27
+ }
28
+ /**
29
+ * Exec result type (compatible with execa Result)
30
+ */
31
+ export interface ExecResult {
32
+ exitCode: number;
33
+ stdout: string;
34
+ stderr: string;
35
+ failed: boolean;
36
+ killed: boolean;
37
+ signal?: string;
38
+ }
39
+ /**
40
+ * Spawned process handle
41
+ */
42
+ export interface SpawnedProcess {
43
+ pid?: number;
44
+ stdout: NodeJS.ReadableStream | null;
45
+ stderr: NodeJS.ReadableStream | null;
46
+ /** Whether the process has been killed */
47
+ readonly killed: boolean;
48
+ kill(signal?: NodeJS.Signals): boolean;
49
+ on(event: 'exit', handler: (code: number | null) => void): SpawnedProcess;
50
+ on(event: 'error', handler: (err: Error) => void): SpawnedProcess;
51
+ }
52
+ /**
53
+ * Process execution abstraction for CLI commands
54
+ */
55
+ export interface ProcessRunner {
56
+ exec(command: string, args?: string[], options?: ExecaOptions): Promise<ExecResult>;
57
+ spawn(command: string, args?: string[], options?: {
58
+ cwd?: string;
59
+ stdio?: any;
60
+ env?: NodeJS.ProcessEnv;
61
+ }): SpawnedProcess;
62
+ }
63
+ /**
64
+ * CLI dependencies container
65
+ */
66
+ export interface CliDependencies {
67
+ fs: FileSystem;
68
+ exec: ProcessRunner;
69
+ }
70
+ /**
71
+ * Create real dependencies using actual fs and execa
72
+ */
73
+ export declare function createRealDependencies(): Promise<CliDependencies>;
74
+ /**
75
+ * Get CLI dependencies (lazy initialization)
76
+ */
77
+ export declare function getDependencies(): Promise<CliDependencies>;
78
+ /**
79
+ * Set CLI dependencies (for testing)
80
+ */
81
+ export declare function setDependencies(deps: CliDependencies): void;
82
+ /**
83
+ * Reset CLI dependencies to real implementations
84
+ */
85
+ export declare function resetDependencies(): Promise<void>;
86
+ /**
87
+ * Clear dependencies (force re-initialization)
88
+ */
89
+ export declare function clearDependencies(): void;
90
+ //# sourceMappingURL=dependencies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dependencies.d.ts","sourceRoot":"","sources":["../../src/cli/dependencies.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AACpE,OAAO,KAAK,EAAU,OAAO,IAAI,YAAY,EAAE,MAAM,OAAO,CAAA;AAE5D;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IACnE,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,cAAc,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,CAAA;IAC3F,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,QAAQ,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC1F,KAAK,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAClF,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACpD,IAAI,CAAC,IAAI,EAAE,QAAQ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C,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,GAAG,cAAc,CAAA;CACjE;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,IAAI,CACH,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,MAAM,EAAE,EACf,OAAO,CAAC,EAAE,YAAY,GACpB,OAAO,CAAC,UAAU,CAAC,CAAA;IACtB,KAAK,CACJ,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,MAAM,EAAE,EACf,OAAO,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAA;KAAE,GAC9D,cAAc,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B,EAAE,EAAE,UAAU,CAAA;IACd,IAAI,EAAE,aAAa,CAAA;CACnB;AAED;;GAEG;AACH,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,eAAe,CAAC,CA4CvE;AAKD;;GAEG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,eAAe,CAAC,CAKhE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI,CAE3D;AAED;;GAEG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAEvD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAExC"}
@@ -0,0 +1,23 @@
1
+ export interface ParsedArgs {
2
+ command: string;
3
+ args: string[];
4
+ options: Record<string, string | boolean>;
5
+ unknownCommand?: string;
6
+ }
7
+ export interface CliOptions {
8
+ silent?: boolean;
9
+ cwd?: string;
10
+ }
11
+ export interface CliResult {
12
+ exitCode: number;
13
+ output?: string;
14
+ }
15
+ /**
16
+ * Parses CLI arguments into structured format
17
+ */
18
+ export declare function parseArgs(argv: string[]): ParsedArgs;
19
+ /**
20
+ * Main CLI entry point
21
+ */
22
+ export declare function runCli(argv: string[], options?: CliOptions): Promise<CliResult>;
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,UAAU;IAC1B,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAAA;IACzC,cAAc,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,UAAU;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,GAAG,CAAC,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,SAAS;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;CACf;AAeD;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CAmDpD;AA2DD;;GAEG;AACH,wBAAsB,MAAM,CAC3B,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,GAAE,UAAe,GACtB,OAAO,CAAC,SAAS,CAAC,CA0DpB"}
@@ -0,0 +1,36 @@
1
+ import type { DevflareConfig } from '../config/schema';
2
+ export interface WranglerAuthStatus {
3
+ loggedIn: boolean;
4
+ accountId?: string;
5
+ email?: string;
6
+ error?: string;
7
+ }
8
+ export interface RemoteBindingCheck {
9
+ hasRemoteBindings: boolean;
10
+ remoteBindings: string[];
11
+ missingAccountId: boolean;
12
+ notLoggedIn: boolean;
13
+ }
14
+ /**
15
+ * Check if the config contains any bindings that require remote access
16
+ */
17
+ export declare function detectRemoteBindings(config: DevflareConfig): string[];
18
+ /**
19
+ * Check if wrangler is logged in by running `wrangler whoami`
20
+ *
21
+ * Returns:
22
+ * - loggedIn: true if user is authenticated
23
+ * - accountId: the account ID if available
24
+ * - email: the email if available
25
+ * - error: error message if check failed
26
+ */
27
+ export declare function checkWranglerAuth(): Promise<WranglerAuthStatus>;
28
+ /**
29
+ * Check if remote bindings are properly configured
30
+ *
31
+ * Returns warnings if:
32
+ * - Config has remote-only bindings but no accountId
33
+ * - Config has remote-only bindings but user is not logged in to wrangler
34
+ */
35
+ export declare function checkRemoteBindingRequirements(config: DevflareConfig): Promise<RemoteBindingCheck>;
36
+ //# sourceMappingURL=wrangler-auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wrangler-auth.d.ts","sourceRoot":"","sources":["../../src/cli/wrangler-auth.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAQtD,MAAM,WAAW,kBAAkB;IAClC,QAAQ,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,kBAAkB;IAClC,iBAAiB,EAAE,OAAO,CAAA;IAC1B,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,gBAAgB,EAAE,OAAO,CAAA;IACzB,WAAW,EAAE,OAAO,CAAA;CACpB;AAMD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,EAAE,CAmBrE;AAMD;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,kBAAkB,CAAC,CA+CrE;AAMD;;;;;;GAMG;AACH,wBAAsB,8BAA8B,CACnD,MAAM,EAAE,cAAc,GACpB,OAAO,CAAC,kBAAkB,CAAC,CAyB7B"}
@@ -0,0 +1,65 @@
1
+ import { type APIClientOptions } from './api';
2
+ import type { AccountInfo, CloudflareService, ServiceStatus, WorkerInfo, KVNamespaceInfo, D1DatabaseInfo, R2BucketInfo, VectorizeIndexInfo, AIModelInfo } from './types';
3
+ /**
4
+ * Get list of accounts the user has access to
5
+ */
6
+ export declare function getAccounts(): Promise<AccountInfo[]>;
7
+ /**
8
+ * Get the primary account (first account in the list)
9
+ * Most users have a single account, so this is usually sufficient
10
+ */
11
+ export declare function getPrimaryAccount(): Promise<AccountInfo | null>;
12
+ /**
13
+ * Get account by ID
14
+ */
15
+ export declare function getAccountById(accountId: string): Promise<AccountInfo | null>;
16
+ /**
17
+ * List all Workers scripts in an account
18
+ */
19
+ export declare function listWorkers(accountId: string, options?: APIClientOptions): Promise<WorkerInfo[]>;
20
+ /**
21
+ * List all KV namespaces in an account
22
+ */
23
+ export declare function listKVNamespaces(accountId: string, options?: APIClientOptions): Promise<KVNamespaceInfo[]>;
24
+ /**
25
+ * List all D1 databases in an account
26
+ */
27
+ export declare function listD1Databases(accountId: string, options?: APIClientOptions): Promise<D1DatabaseInfo[]>;
28
+ /**
29
+ * List all R2 buckets in an account
30
+ */
31
+ export declare function listR2Buckets(accountId: string, options?: APIClientOptions): Promise<R2BucketInfo[]>;
32
+ /**
33
+ * List all Vectorize indexes in an account
34
+ */
35
+ export declare function listVectorizeIndexes(accountId: string, options?: APIClientOptions): Promise<VectorizeIndexInfo[]>;
36
+ /**
37
+ * List available AI models
38
+ */
39
+ export declare function listAIModels(accountId: string, options?: APIClientOptions): Promise<AIModelInfo[]>;
40
+ /**
41
+ * Check the status of a specific service
42
+ * Uses a short timeout to avoid hanging
43
+ */
44
+ export declare function getServiceStatus(accountId: string, service: CloudflareService): Promise<ServiceStatus>;
45
+ /**
46
+ * Get status of all services
47
+ */
48
+ export declare function getAllServiceStatus(accountId: string): Promise<ServiceStatus[]>;
49
+ /**
50
+ * Check if the user is authenticated with Cloudflare
51
+ */
52
+ export declare function checkAuth(): Promise<boolean>;
53
+ /**
54
+ * Quick check if a service is available for an account
55
+ */
56
+ export declare function hasService(accountId: string, service: CloudflareService): Promise<boolean>;
57
+ /**
58
+ * Get a summary of the account
59
+ */
60
+ export interface AccountSummary {
61
+ account: AccountInfo;
62
+ services: ServiceStatus[];
63
+ }
64
+ export declare function getAccountSummary(accountId: string): Promise<AccountSummary | null>;
65
+ //# sourceMappingURL=account.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/cloudflare/account.ts"],"names":[],"mappings":"AAMA,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,OAAO,CAAA;AAEhE,OAAO,KAAK,EACX,WAAW,EAEX,iBAAiB,EACjB,aAAa,EAEb,UAAU,EAEV,eAAe,EAEf,cAAc,EAEd,YAAY,EAEZ,kBAAkB,EAElB,WAAW,EACX,MAAM,SAAS,CAAA;AAMhB;;GAEG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,CAS1D;AAED;;;GAGG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAGrE;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAYnF;AAMD;;GAEG;AACH,wBAAsB,WAAW,CAChC,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,gBAAgB,GACxB,OAAO,CAAC,UAAU,EAAE,CAAC,CAWvB;AAMD;;GAEG;AACH,wBAAsB,gBAAgB,CACrC,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,gBAAgB,GACxB,OAAO,CAAC,eAAe,EAAE,CAAC,CAU5B;AAMD;;GAEG;AACH,wBAAsB,eAAe,CACpC,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,gBAAgB,GACxB,OAAO,CAAC,cAAc,EAAE,CAAC,CAa3B;AAMD;;GAEG;AACH,wBAAsB,aAAa,CAClC,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,gBAAgB,GACxB,OAAO,CAAC,YAAY,EAAE,CAAC,CAWzB;AAMD;;GAEG;AACH,wBAAsB,oBAAoB,CACzC,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,gBAAgB,GACxB,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAiB/B;AAMD;;GAEG;AACH,wBAAsB,YAAY,CACjC,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,gBAAgB,GACxB,OAAO,CAAC,WAAW,EAAE,CAAC,CAiBxB;AAMD;;;GAGG;AACH,wBAAsB,gBAAgB,CACrC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,iBAAiB,GACxB,OAAO,CAAC,aAAa,CAAC,CAuGxB;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAerF;AAMD;;GAEG;AACH,wBAAsB,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC,CAElD;AAED;;GAEG;AACH,wBAAsB,UAAU,CAC/B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,iBAAiB,GACxB,OAAO,CAAC,OAAO,CAAC,CAGlB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,OAAO,EAAE,WAAW,CAAA;IACpB,QAAQ,EAAE,aAAa,EAAE,CAAA;CACzB;AAED,wBAAsB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAUzF"}
@@ -0,0 +1,51 @@
1
+ export declare class CloudflareAPIError extends Error {
2
+ code: number;
3
+ errors: Array<{
4
+ code: number;
5
+ message: string;
6
+ }>;
7
+ constructor(message: string, code: number, errors: Array<{
8
+ code: number;
9
+ message: string;
10
+ }>);
11
+ }
12
+ export declare class AuthenticationError extends Error {
13
+ constructor(message?: string);
14
+ }
15
+ export interface APIClientOptions {
16
+ /** Override the API token (instead of auto-detecting) */
17
+ token?: string;
18
+ /** Request timeout in ms (default: 30000) */
19
+ timeout?: number;
20
+ }
21
+ /**
22
+ * Make a GET request to the Cloudflare API
23
+ * Automatically retries with a fresh token on auth failure
24
+ */
25
+ export declare function apiGet<T>(path: string, options?: APIClientOptions): Promise<T>;
26
+ /**
27
+ * Make a POST request to the Cloudflare API
28
+ */
29
+ export declare function apiPost<T>(path: string, body: unknown, options?: APIClientOptions): Promise<T>;
30
+ /**
31
+ * Make a PUT request to the Cloudflare API
32
+ */
33
+ export declare function apiPut<T>(path: string, body: unknown, options?: APIClientOptions): Promise<T>;
34
+ /**
35
+ * Make a DELETE request to the Cloudflare API
36
+ */
37
+ export declare function apiDelete<T>(path: string, options?: APIClientOptions): Promise<T>;
38
+ /**
39
+ * Make a paginated GET request, fetching all pages
40
+ */
41
+ export declare function apiGetAll<T>(path: string, options?: APIClientOptions): Promise<T[]>;
42
+ /**
43
+ * Read a KV value (raw text response, not JSON envelope)
44
+ * Returns null if key doesn't exist (404)
45
+ */
46
+ export declare function kvGet(accountId: string, namespaceId: string, key: string, options?: APIClientOptions): Promise<string | null>;
47
+ /**
48
+ * Write a KV value (raw text body, not JSON)
49
+ */
50
+ export declare function kvPut(accountId: string, namespaceId: string, key: string, value: string, options?: APIClientOptions): Promise<void>;
51
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/cloudflare/api.ts"],"names":[],"mappings":"AAoDA,qBAAa,kBAAmB,SAAQ,KAAK;IAGpC,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAHxD,YACC,OAAO,EAAE,MAAM,EACR,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,EAIvD;CACD;AAED,qBAAa,mBAAoB,SAAQ,KAAK;IAC7C,YAAY,OAAO,SAAgD,EA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,gBAAgB,GACxB,OAAO,CAAC,IAAI,CAAC,CA8Bf"}
@@ -0,0 +1,35 @@
1
+ import type { WranglerAuth } from './types';
2
+ /**
3
+ * Invalidate the cached token (call when API returns auth error)
4
+ * This forces the next getApiToken() call to refresh via wrangler
5
+ */
6
+ export declare function invalidateToken(): void;
7
+ /**
8
+ * Get the path to wrangler's config file (first existing path)
9
+ */
10
+ export declare function getWranglerConfigPath(): string | null;
11
+ /**
12
+ * Check if wrangler config file exists
13
+ */
14
+ export declare function hasWranglerConfig(): boolean;
15
+ /**
16
+ * Extract OAuth token info from wrangler's stored configuration
17
+ */
18
+ export declare function getWranglerAuth(): Promise<WranglerAuth | null>;
19
+ /**
20
+ * Get the API token to use for Cloudflare API requests
21
+ *
22
+ * Strategy (fast path first):
23
+ * 1. Check in-memory cache (unless forceRefresh)
24
+ * 2. Check CLOUDFLARE_API_TOKEN env var
25
+ * 3. Read token from wrangler config (if not expired)
26
+ * 4. Call `wrangler auth token` to refresh (slow, only when needed)
27
+ *
28
+ * @param forceRefresh - Skip cache and force a refresh via wrangler
29
+ */
30
+ export declare function getApiToken(forceRefresh?: boolean): Promise<string | null>;
31
+ /**
32
+ * Check if we have valid authentication
33
+ */
34
+ export declare function isAuthenticated(): Promise<boolean>;
35
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/cloudflare/auth.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAe3C;;;GAGG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAGtC;AA6BD;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,GAAG,IAAI,CAUrD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C;AA2DD;;GAEG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAmBpE;AA6BD;;;;;;;;;;GAUG;AACH,wBAAsB,WAAW,CAAC,YAAY,UAAQ,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAsC9E;AAED;;GAEG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC,CAGxD"}
@@ -0,0 +1,107 @@
1
+ import { getAccounts, getPrimaryAccount, getAccountById, getAccountSummary, listWorkers, listKVNamespaces, listD1Databases, listR2Buckets, listVectorizeIndexes, listAIModels, getServiceStatus, getAllServiceStatus, hasService } from './account';
2
+ import { getUsage, recordUsage, resetUsage, getLimits, setLimits, setLimitsEnabled, isWithinLimits, getUsageSummary, getAllUsageSummaries, canProceedWithTest, recordTestUsage, shouldSkip } from './usage';
3
+ import { getGlobalDefaultAccountId, setGlobalDefaultAccountId, getWorkspaceAccountId, setWorkspaceAccountId, getEffectiveAccountId, clearGlobalDefaultAccountId } from './preferences';
4
+ import { getApiToken, isAuthenticated, getWranglerAuth, hasWranglerConfig } from './auth';
5
+ import { CloudflareAPIError, AuthenticationError, type APIClientOptions } from './api';
6
+ /**
7
+ * Main account API object
8
+ *
9
+ * Usage:
10
+ * ```ts
11
+ * import { account } from 'devflare/cloudflare'
12
+ *
13
+ * // Check authentication
14
+ * const isLoggedIn = await account.isAuthenticated()
15
+ *
16
+ * // Get primary account
17
+ * const primary = await account.getPrimaryAccount()
18
+ *
19
+ * // List resources (requires accountId)
20
+ * const workers = await account.workers(accountId)
21
+ *
22
+ * // Check usage limits before testing
23
+ * const { allowed } = await account.canProceedWithTest(accountId, 'ai')
24
+ * ```
25
+ */
26
+ export declare const account: {
27
+ /** Check if user is authenticated with Cloudflare */
28
+ readonly isAuthenticated: typeof isAuthenticated;
29
+ /** Check if wrangler config file exists */
30
+ readonly hasWranglerConfig: typeof hasWranglerConfig;
31
+ /** Get the API token (from env or wrangler config) */
32
+ readonly getApiToken: typeof getApiToken;
33
+ /** Get full wrangler auth info */
34
+ readonly getWranglerAuth: typeof getWranglerAuth;
35
+ /** Get all accounts the user has access to */
36
+ readonly getAccounts: typeof getAccounts;
37
+ /** Get the primary (first) account */
38
+ readonly getPrimaryAccount: typeof getPrimaryAccount;
39
+ /** Get account by ID */
40
+ readonly getAccountById: typeof getAccountById;
41
+ /** Get comprehensive account summary with all services */
42
+ readonly getAccountSummary: typeof getAccountSummary;
43
+ /** List all Workers scripts */
44
+ readonly workers: typeof listWorkers;
45
+ /** List all KV namespaces */
46
+ readonly kv: typeof listKVNamespaces;
47
+ /** List all D1 databases */
48
+ readonly d1: typeof listD1Databases;
49
+ /** List all R2 buckets */
50
+ readonly r2: typeof listR2Buckets;
51
+ /** List all Vectorize indexes */
52
+ readonly vectorize: typeof listVectorizeIndexes;
53
+ /** List available AI models */
54
+ readonly ai: typeof listAIModels;
55
+ /** Get status of a specific service */
56
+ readonly getServiceStatus: typeof getServiceStatus;
57
+ /** Get status of all services */
58
+ readonly getAllServiceStatus: typeof getAllServiceStatus;
59
+ /** Check if a service is available */
60
+ readonly hasService: typeof hasService;
61
+ /** Get usage for a service on a date */
62
+ readonly getUsage: typeof getUsage;
63
+ /** Record usage for a service */
64
+ readonly recordUsage: typeof recordUsage;
65
+ /** Reset usage counter for a service */
66
+ readonly resetUsage: typeof resetUsage;
67
+ /** Get all usage summaries */
68
+ readonly getAllUsageSummaries: typeof getAllUsageSummaries;
69
+ /** Get usage summary for a service */
70
+ readonly getUsageSummary: typeof getUsageSummary;
71
+ /** Get current usage limits */
72
+ readonly getLimits: typeof getLimits;
73
+ /** Update usage limits */
74
+ readonly setLimits: typeof setLimits;
75
+ /** Enable or disable limit enforcement */
76
+ readonly setLimitsEnabled: typeof setLimitsEnabled;
77
+ /** Check if within limits for a service */
78
+ readonly isWithinLimits: typeof isWithinLimits;
79
+ /** Check if a test can proceed (within limits) */
80
+ readonly canProceedWithTest: typeof canProceedWithTest;
81
+ /** Record test usage after successful test */
82
+ readonly recordTestUsage: typeof recordTestUsage;
83
+ /**
84
+ * Check if tests for a service should be skipped
85
+ * Returns true if tests should be SKIPPED (not authenticated, no account, or limits exceeded)
86
+ * Automatically logs the skip reason to console.
87
+ *
88
+ * Usage: `const skipAI = await account.shouldSkip('ai')`
89
+ */
90
+ readonly shouldSkip: typeof shouldSkip;
91
+ /** Get the global default account ID */
92
+ readonly getGlobalDefaultAccountId: typeof getGlobalDefaultAccountId;
93
+ /** Set the global default account ID */
94
+ readonly setGlobalDefaultAccountId: typeof setGlobalDefaultAccountId;
95
+ /** Get the workspace account ID from package.json */
96
+ readonly getWorkspaceAccountId: typeof getWorkspaceAccountId;
97
+ /** Set the workspace account ID in package.json */
98
+ readonly setWorkspaceAccountId: typeof setWorkspaceAccountId;
99
+ /** Get the effective account ID (workspace > global > primary) */
100
+ readonly getEffectiveAccountId: typeof getEffectiveAccountId;
101
+ /** Clear the global default account ID */
102
+ readonly clearGlobalDefaultAccountId: typeof clearGlobalDefaultAccountId;
103
+ };
104
+ export type { AccountInfo, CloudflareAccount, CloudflareService, ServiceStatus, WorkerInfo, KVNamespaceInfo, D1DatabaseInfo, R2BucketInfo, VectorizeIndexInfo, AIModelInfo, UsageRecord, UsageLimits, UsageSummary, WranglerAuth } from './types';
105
+ export { CloudflareAPIError, AuthenticationError };
106
+ export type { APIClientOptions };
107
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cloudflare/index.ts"],"names":[],"mappings":"AAOA,OAAO,EACN,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,UAAU,EAEV,MAAM,WAAW,CAAA;AAElB,OAAO,EACN,QAAQ,EACR,WAAW,EACX,UAAU,EACV,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,UAAU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EAAE,CAAA;AAClD,YAAY,EAAE,gBAAgB,EAAE,CAAA"}
@@ -0,0 +1,13 @@
1
+ import {
2
+ account
3
+ } from "../index-n7rs26ft.js";
4
+ import {
5
+ AuthenticationError,
6
+ CloudflareAPIError
7
+ } from "../index-tfyxa77h.js";
8
+ import"../index-37x76zdn.js";
9
+ export {
10
+ account,
11
+ CloudflareAPIError,
12
+ AuthenticationError
13
+ };
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Get workspace account ID from nearest package.json
3
+ */
4
+ export declare function getWorkspaceAccountId(): string | null;
5
+ /**
6
+ * Set workspace account ID in nearest package.json
7
+ * Creates package.json if it doesn't exist
8
+ */
9
+ export declare function setWorkspaceAccountId(accountId: string): string;
10
+ /**
11
+ * Get the global default account ID
12
+ *
13
+ * Priority:
14
+ * 1. Local cache (fast, no network)
15
+ * 2. Cloud KV (if local cache is missing)
16
+ *
17
+ * Returns null if no default is set
18
+ */
19
+ export declare function getGlobalDefaultAccountId(fallbackAccountId: string): Promise<string | null>;
20
+ /**
21
+ * Set the global default account ID
22
+ * Saves to both local cache and cloud KV
23
+ *
24
+ * @param accountId - The account ID to set as default
25
+ * @param anyAccountId - Any account ID to use for accessing KV (can be the same)
26
+ */
27
+ export declare function setGlobalDefaultAccountId(accountId: string, anyAccountId?: string): Promise<void>;
28
+ /**
29
+ * Get the effective account ID to use
30
+ *
31
+ * Priority:
32
+ * 1. Workspace (package.json) - highest priority
33
+ * 2. Global default (local cache + cloud KV)
34
+ * 3. Primary account (first account in list)
35
+ *
36
+ * @param primaryAccountId - The primary account ID to use as fallback
37
+ */
38
+ export declare function getEffectiveAccountId(primaryAccountId: string): Promise<{
39
+ accountId: string;
40
+ source: 'workspace' | 'global' | 'primary';
41
+ }>;
42
+ /**
43
+ * Clear the global default account ID (both local and cloud)
44
+ */
45
+ export declare function clearGlobalDefaultAccountId(anyAccountId: string): Promise<void>;
46
+ //# sourceMappingURL=preferences.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preferences.d.ts","sourceRoot":"","sources":["../../src/cloudflare/preferences.ts"],"names":[],"mappings":"AA0HA;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,GAAG,IAAI,CAMrD;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAyB/D;AAkCD;;;;;;;;GAQG;AACH,wBAAsB,yBAAyB,CAC9C,iBAAiB,EAAE,MAAM,GACvB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA0BxB;AAED;;;;;;GAMG;AACH,wBAAsB,yBAAyB,CAC9C,SAAS,EAAE,MAAM,EACjB,YAAY,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC,CAmBf;AAED;;;;;;;;;GASG;AACH,wBAAsB,qBAAqB,CAC1C,gBAAgB,EAAE,MAAM,GACtB,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAA;CAAE,CAAC,CAe5E;AAED;;GAEG;AACH,wBAAsB,2BAA2B,CAChD,YAAY,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAef"}
@@ -0,0 +1,15 @@
1
+ /** Cloudflare Workers AI pricing documentation URL */
2
+ export declare const PRICING_DOCS_URL = "https://developers.cloudflare.com/workers-ai/platform/pricing/";
3
+ /** Price per 1,000 neurons in USD (as of Jan 2026) */
4
+ export declare const PRICE_PER_1000_NEURONS_USD = 0.011;
5
+ /** Free tier neurons per day */
6
+ export declare const FREE_TIER_NEURONS_PER_DAY = 10000;
7
+ /**
8
+ * Convert neurons to approximate USD cost
9
+ */
10
+ export declare function neuronsToUSD(neurons: number): number;
11
+ /**
12
+ * Format a message about pricing with docs link
13
+ */
14
+ export declare function getPricingInfo(): string;
15
+ //# sourceMappingURL=pricing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pricing.d.ts","sourceRoot":"","sources":["../../src/cloudflare/pricing.ts"],"names":[],"mappings":"AAYA,sDAAsD;AACtD,eAAO,MAAM,gBAAgB,mEAAmE,CAAA;AAEhG,sDAAsD;AACtD,eAAO,MAAM,0BAA0B,QAAQ,CAAA;AAE/C,gCAAgC;AAChC,eAAO,MAAM,yBAAyB,QAAS,CAAA;AAE/C;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Enable remote mode for a given duration.
3
+ * @param minutes Duration in minutes (default: 30, clamped to 1-1440)
4
+ * @returns The validated minutes value actually used
5
+ */
6
+ export declare function enableRemoteMode(minutes?: number): number;
7
+ /**
8
+ * Disable remote mode immediately.
9
+ */
10
+ export declare function disableRemoteMode(): void;
11
+ /**
12
+ * Get the current remote mode status from stored config.
13
+ * Note: Use getEffectiveRemoteModeStatus() to also include env var override.
14
+ * @returns Status object with isEnabled, remainingMinutes, and expiresAt
15
+ */
16
+ export declare function getRemoteModeStatus(): {
17
+ isEnabled: boolean;
18
+ remainingMinutes: number;
19
+ expiresAt: Date | null;
20
+ };
21
+ /**
22
+ * Get the effective remote mode status including env var override.
23
+ * @returns Status object with isActive, source, and config details
24
+ */
25
+ export declare function getEffectiveRemoteModeStatus(): {
26
+ isActive: boolean;
27
+ source: 'env' | 'config' | 'none';
28
+ remainingMinutes: number;
29
+ expiresAt: Date | null;
30
+ envVarSet: boolean;
31
+ };
32
+ /**
33
+ * Check if remote mode is currently enabled.
34
+ * Checks both env var (DEVFLARE_REMOTE=1) and stored config.
35
+ */
36
+ export declare function isRemoteModeActive(): boolean;
37
+ //# sourceMappingURL=remote-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-config.d.ts","sourceRoot":"","sources":["../../src/cloudflare/remote-config.ts"],"names":[],"mappings":"AA+EA;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,MAAW,GAAG,MAAM,CAY7D;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAExC;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI;IACtC,SAAS,EAAE,OAAO,CAAA;IAClB,gBAAgB,EAAE,MAAM,CAAA;IACxB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAA;CACtB,CAqBA;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,IAAI;IAC/C,QAAQ,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAA;IACjC,gBAAgB,EAAE,MAAM,CAAA;IACxB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAA;IACtB,SAAS,EAAE,OAAO,CAAA;CAClB,CAkCA;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAU5C"}