@every-app/sdk 0.2.0 → 0.3.0-rc.1

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 (113) hide show
  1. package/README.md +608 -2
  2. package/dist/cloudflare/index.d.ts +22 -0
  3. package/dist/cloudflare/index.d.ts.map +1 -0
  4. package/dist/cloudflare/index.js +21 -0
  5. package/dist/cloudflare/sentinel.d.ts +69 -0
  6. package/dist/cloudflare/sentinel.d.ts.map +1 -0
  7. package/dist/cloudflare/sentinel.js +50 -0
  8. package/dist/cloudflare/worker.d.ts +511 -0
  9. package/dist/cloudflare/worker.d.ts.map +1 -0
  10. package/dist/cloudflare/worker.js +738 -0
  11. package/dist/dev/index.d.ts +8 -0
  12. package/dist/dev/index.d.ts.map +1 -0
  13. package/dist/dev/index.js +7 -0
  14. package/dist/dev/keypair.d.ts +24 -0
  15. package/dist/dev/keypair.d.ts.map +1 -0
  16. package/dist/dev/keypair.js +60 -0
  17. package/dist/internal/aiProviders.d.ts +67 -0
  18. package/dist/internal/aiProviders.d.ts.map +1 -0
  19. package/dist/internal/aiProviders.js +220 -0
  20. package/dist/internal/appSettings.d.ts +237 -0
  21. package/dist/internal/appSettings.d.ts.map +1 -0
  22. package/dist/internal/appSettings.js +374 -0
  23. package/dist/internal/capabilities.d.ts +1344 -0
  24. package/dist/internal/capabilities.d.ts.map +1 -0
  25. package/dist/internal/capabilities.js +1521 -0
  26. package/dist/internal/devProviders.d.ts +49 -0
  27. package/dist/internal/devProviders.d.ts.map +1 -0
  28. package/dist/internal/devProviders.js +62 -0
  29. package/dist/internal/email.d.ts +280 -0
  30. package/dist/internal/email.d.ts.map +1 -0
  31. package/dist/internal/email.js +613 -0
  32. package/dist/internal/events.d.ts +182 -0
  33. package/dist/internal/events.d.ts.map +1 -0
  34. package/dist/internal/events.js +324 -0
  35. package/dist/internal/gatewaySettings.d.ts +82 -0
  36. package/dist/internal/gatewaySettings.d.ts.map +1 -0
  37. package/dist/internal/gatewaySettings.js +209 -0
  38. package/dist/internal/identity.d.ts +18 -3
  39. package/dist/internal/identity.d.ts.map +1 -1
  40. package/dist/internal/identity.js +53 -14
  41. package/dist/internal/index.d.ts +17 -1
  42. package/dist/internal/index.d.ts.map +1 -1
  43. package/dist/internal/index.js +17 -1
  44. package/dist/internal/members.d.ts +35 -0
  45. package/dist/internal/members.d.ts.map +1 -0
  46. package/dist/internal/members.js +7 -0
  47. package/dist/internal/oauthClient.d.ts +63 -0
  48. package/dist/internal/oauthClient.d.ts.map +1 -0
  49. package/dist/internal/oauthClient.js +194 -0
  50. package/dist/internal/oauthScopes.d.ts +117 -0
  51. package/dist/internal/oauthScopes.d.ts.map +1 -0
  52. package/dist/internal/oauthScopes.js +416 -0
  53. package/dist/internal/organizationName.d.ts +18 -0
  54. package/dist/internal/organizationName.d.ts.map +1 -0
  55. package/dist/internal/organizationName.js +24 -0
  56. package/dist/internal/protocol.d.ts +86 -2
  57. package/dist/internal/protocol.d.ts.map +1 -1
  58. package/dist/internal/protocol.js +112 -1
  59. package/dist/internal/providerApps.d.ts +75 -0
  60. package/dist/internal/providerApps.d.ts.map +1 -0
  61. package/dist/internal/providerApps.js +59 -0
  62. package/dist/internal/providerRegistry.d.ts +147 -0
  63. package/dist/internal/providerRegistry.d.ts.map +1 -0
  64. package/dist/internal/providerRegistry.js +262 -0
  65. package/dist/internal/providerSpec.d.ts +55 -0
  66. package/dist/internal/providerSpec.d.ts.map +1 -0
  67. package/dist/internal/providerSpec.js +746 -0
  68. package/dist/internal/remoteMcp.d.ts +188 -0
  69. package/dist/internal/remoteMcp.d.ts.map +1 -0
  70. package/dist/internal/remoteMcp.js +543 -0
  71. package/dist/internal/tools.d.ts +115 -0
  72. package/dist/internal/tools.d.ts.map +1 -0
  73. package/dist/internal/tools.js +80 -0
  74. package/dist/server/attribution.d.ts +39 -0
  75. package/dist/server/attribution.d.ts.map +1 -0
  76. package/dist/server/attribution.js +67 -0
  77. package/dist/server/authorizeUrl.d.ts +43 -0
  78. package/dist/server/authorizeUrl.d.ts.map +1 -0
  79. package/dist/server/authorizeUrl.js +110 -0
  80. package/dist/server/emit.d.ts +63 -0
  81. package/dist/server/emit.d.ts.map +1 -0
  82. package/dist/server/emit.js +101 -0
  83. package/dist/server/everyApp.d.ts +38 -12
  84. package/dist/server/everyApp.d.ts.map +1 -1
  85. package/dist/server/everyApp.js +92 -28
  86. package/dist/server/gatewayFetch.d.ts +24 -8
  87. package/dist/server/gatewayFetch.d.ts.map +1 -1
  88. package/dist/server/gatewayFetch.js +81 -36
  89. package/dist/server/index.d.ts +10 -1
  90. package/dist/server/index.d.ts.map +1 -1
  91. package/dist/server/index.js +8 -1
  92. package/dist/server/integrationFetch.d.ts +131 -0
  93. package/dist/server/integrationFetch.d.ts.map +1 -0
  94. package/dist/server/integrationFetch.js +526 -0
  95. package/dist/server/listMembers.d.ts +32 -0
  96. package/dist/server/listMembers.d.ts.map +1 -0
  97. package/dist/server/listMembers.js +74 -0
  98. package/dist/server/nodeServer.d.ts +48 -0
  99. package/dist/server/nodeServer.d.ts.map +1 -0
  100. package/dist/server/nodeServer.js +45 -0
  101. package/dist/server/sendEmail.d.ts +39 -0
  102. package/dist/server/sendEmail.d.ts.map +1 -0
  103. package/dist/server/sendEmail.js +114 -0
  104. package/dist/server/tools.d.ts +184 -0
  105. package/dist/server/tools.d.ts.map +1 -0
  106. package/dist/server/tools.js +347 -0
  107. package/dist/server/toolsEndpoint.d.ts +32 -0
  108. package/dist/server/toolsEndpoint.d.ts.map +1 -0
  109. package/dist/server/toolsEndpoint.js +231 -0
  110. package/package.json +30 -17
  111. package/dist/server/mcp.d.ts +0 -66
  112. package/dist/server/mcp.d.ts.map +0 -1
  113. package/dist/server/mcp.js +0 -147
@@ -0,0 +1,69 @@
1
+ /**
2
+ * What a production build of an Every App app is made of in place of the
3
+ * install's own values. The build is tenant-neutral: whoever builds an
4
+ * app gets the same Build Output, with these placeholders wherever an
5
+ * install's Worker name, organization, gateway, identity key or resource
6
+ * ids belong. The installer rewrites them (`everyapp deploy` for an own
7
+ * Gateway, the hosted gateway's deployer for a hosted one) and refuses an
8
+ * output in which any survives.
9
+ *
10
+ * A leaf module with no imports, so the gateway Worker can read the same
11
+ * values (`@every-app/sdk/cloudflare/sentinel`) without loading the
12
+ * Node-only Worker builder.
13
+ */
14
+ export declare const BUILD_SENTINEL: Readonly<{
15
+ workerName: "every-hosted--sentinel";
16
+ organizationId: "everyapp-hosted-deploy-sentinel";
17
+ /** The gateway's URL, and so the identity issuer. */
18
+ gatewayUrl: "https://every-hosted--sentinel.invalid";
19
+ publicKey: "-----BEGIN PUBLIC KEY-----\nEVERYAPPHOSTEDDEPLOYSENTINEL\n-----END PUBLIC KEY-----\n";
20
+ }>;
21
+ /**
22
+ * A manifest binding's placeholder: a D1 database's name and id, an R2
23
+ * bucket's name, a KV namespace's or Hyperdrive config's id. The installer
24
+ * rewrites each by its binding name; the value only has to be recognizable.
25
+ */
26
+ export declare function resourceSentinel(binding: string): string;
27
+ /** The fields of the manifest a build's placeholders are made for. */
28
+ interface SentinelManifest {
29
+ resources?: {
30
+ d1?: readonly string[];
31
+ kv?: readonly string[];
32
+ r2?: readonly string[];
33
+ hyperdrive?: readonly {
34
+ readonly name: string;
35
+ }[];
36
+ };
37
+ }
38
+ /** Everything install-specific a Worker is built from, by binding. */
39
+ export interface EveryAppDeployTarget {
40
+ /** The Worker name the gateway registry assigned to this app. */
41
+ workerName: string;
42
+ /** The organization that owns the app; scopes the AppGateway binding. */
43
+ organizationId: string;
44
+ /** The gateway's URL, which is also the identity tokens' issuer. */
45
+ gatewayUrl: string;
46
+ /** SPKI PEM public keys (current + next) that verify identity tokens. */
47
+ identityPublicKeys: string[];
48
+ /** Provisioned resources keyed by manifest binding name. */
49
+ resources: {
50
+ d1?: Record<string, {
51
+ name: string;
52
+ id: string;
53
+ }>;
54
+ kv?: Record<string, {
55
+ id: string;
56
+ }>;
57
+ hyperdrive?: Record<string, {
58
+ id: string;
59
+ }>;
60
+ /** R2 buckets by binding, under the names the registry assigned. */
61
+ r2?: Record<string, {
62
+ name: string;
63
+ }>;
64
+ };
65
+ }
66
+ /** The target every production build is made for: placeholders throughout. */
67
+ export declare function sentinelDeployTarget(manifest: SentinelManifest): EveryAppDeployTarget;
68
+ export {};
69
+ //# sourceMappingURL=sentinel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentinel.d.ts","sourceRoot":"","sources":["../../src/cloudflare/sentinel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,eAAO,MAAM,cAAc;;;IAKzB,qDAAqD;;;EAIrD,CAAC;AAEH;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAExD;AAED,sEAAsE;AACtE,UAAU,gBAAgB;IACxB,SAAS,CAAC,EAAE;QACV,EAAE,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;QACvB,EAAE,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;QACvB,EAAE,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;QACvB,UAAU,CAAC,EAAE,SAAS;YAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;KACnD,CAAC;CACH;AAED,sEAAsE;AACtE,MAAM,WAAW,oBAAoB;IACnC,iEAAiE;IACjE,UAAU,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,cAAc,EAAE,MAAM,CAAC;IACvB,oEAAoE;IACpE,UAAU,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,4DAA4D;IAC5D,SAAS,EAAE;QACT,EAAE,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,EAAE,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QAClD,EAAE,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QACpC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QAC5C,oEAAoE;QACpE,EAAE,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KACvC,CAAC;CACH;AAED,8EAA8E;AAC9E,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,gBAAgB,GACzB,oBAAoB,CA2BtB"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * What a production build of an Every App app is made of in place of the
3
+ * install's own values. The build is tenant-neutral: whoever builds an
4
+ * app gets the same Build Output, with these placeholders wherever an
5
+ * install's Worker name, organization, gateway, identity key or resource
6
+ * ids belong. The installer rewrites them (`everyapp deploy` for an own
7
+ * Gateway, the hosted gateway's deployer for a hosted one) and refuses an
8
+ * output in which any survives.
9
+ *
10
+ * A leaf module with no imports, so the gateway Worker can read the same
11
+ * values (`@every-app/sdk/cloudflare/sentinel`) without loading the
12
+ * Node-only Worker builder.
13
+ */
14
+ export const BUILD_SENTINEL = Object.freeze({
15
+ // Holds the resource separator, so no registry Worker is ever named so
16
+ // and a string rewrite of it can't hit anything else.
17
+ workerName: "every-hosted--sentinel",
18
+ organizationId: "everyapp-hosted-deploy-sentinel",
19
+ /** The gateway's URL, and so the identity issuer. */
20
+ gatewayUrl: "https://every-hosted--sentinel.invalid",
21
+ publicKey: "-----BEGIN PUBLIC KEY-----\nEVERYAPPHOSTEDDEPLOYSENTINEL\n-----END PUBLIC KEY-----\n",
22
+ });
23
+ /**
24
+ * A manifest binding's placeholder: a D1 database's name and id, an R2
25
+ * bucket's name, a KV namespace's or Hyperdrive config's id. The installer
26
+ * rewrites each by its binding name; the value only has to be recognizable.
27
+ */
28
+ export function resourceSentinel(binding) {
29
+ return `${BUILD_SENTINEL.workerName}--${binding}`;
30
+ }
31
+ /** The target every production build is made for: placeholders throughout. */
32
+ export function sentinelDeployTarget(manifest) {
33
+ const byBinding = (bindings, value) => Object.fromEntries((bindings ?? []).map((binding) => [
34
+ binding,
35
+ value(resourceSentinel(binding)),
36
+ ]));
37
+ const { resources } = manifest;
38
+ return {
39
+ workerName: BUILD_SENTINEL.workerName,
40
+ organizationId: BUILD_SENTINEL.organizationId,
41
+ gatewayUrl: BUILD_SENTINEL.gatewayUrl,
42
+ identityPublicKeys: [BUILD_SENTINEL.publicKey],
43
+ resources: {
44
+ d1: byBinding(resources?.d1, (id) => ({ name: id, id })),
45
+ kv: byBinding(resources?.kv, (id) => ({ id })),
46
+ hyperdrive: byBinding(resources?.hyperdrive?.map((config) => config.name), (id) => ({ id })),
47
+ r2: byBinding(resources?.r2, (name) => ({ name })),
48
+ },
49
+ };
50
+ }
@@ -0,0 +1,511 @@
1
+ /** A Durable Object or Workflow class, and the helper Worker defining it. */
2
+ interface ClassResource {
3
+ readonly name: string;
4
+ readonly className: string;
5
+ /** A helper Worker (`workers`) that defines the class; the app's own when unset. */
6
+ readonly worker?: string;
7
+ }
8
+ /** A Hyperdrive config, and the helper Worker that alone binds it. */
9
+ interface HyperdriveResource {
10
+ readonly name: string;
11
+ /** A helper Worker (`workers`) that alone binds it; every Worker when unset. */
12
+ readonly worker?: string;
13
+ /** Whether Hyperdrive caches its reads (the deploy's concern; "off" by default). */
14
+ readonly caching?: "off" | "default";
15
+ }
16
+ /** Cloudflare's limits for one of the app's Workers. */
17
+ interface WorkerLimits {
18
+ readonly cpuMs?: number;
19
+ }
20
+ /** The fields of `everyapp.config.ts` the Worker definition is built from. */
21
+ export interface EveryAppWorkerManifest {
22
+ id: string;
23
+ compatibilityDate?: string;
24
+ resources?: {
25
+ d1?: readonly string[];
26
+ kv?: readonly string[];
27
+ /**
28
+ * R2 buckets every one of the app's Workers binds: `R2` named after the
29
+ * app's Worker, any other binding `<app worker>--<binding>`.
30
+ */
31
+ r2?: readonly string[];
32
+ durableObjects?: readonly ClassResource[];
33
+ workflows?: readonly ClassResource[];
34
+ /** Hyperdrive configs, named `<app worker>--<binding>` by the deploy. */
35
+ hyperdrive?: readonly HyperdriveResource[];
36
+ };
37
+ /**
38
+ * Helper Workers deployed beside the app's Worker as
39
+ * `<app worker>--<name>`, built with {@link everyAppAuxiliaryWorker}.
40
+ * `binding` names the app Worker's service binding to one.
41
+ */
42
+ workers?: readonly {
43
+ readonly name: string;
44
+ readonly binding?: string;
45
+ readonly limits?: WorkerLimits;
46
+ }[];
47
+ /**
48
+ * The database the app's code talks to, which its Workers read as
49
+ * DATABASE_PROVIDER; deployed Workers run near `region`.
50
+ */
51
+ database?: {
52
+ readonly provider: "d1" | "postgres";
53
+ readonly region?: string;
54
+ };
55
+ /** Cloudflare's limits for the app's own Worker. */
56
+ limits?: WorkerLimits;
57
+ /**
58
+ * AI providers the app calls through the gateway (`createGatewayFetch()`):
59
+ * each by id, or as `{ id, optional, anyOf, why, docs }` (the manifest's
60
+ * settings model, `@every-app/sdk/internal` appSettings).
61
+ */
62
+ providers?: ReadonlyArray<string | {
63
+ readonly id: string;
64
+ }>;
65
+ /** Capabilities the app calls through the gateway (`integrationFetch()`). */
66
+ capabilities?: {
67
+ readonly [id: string]: unknown;
68
+ };
69
+ /**
70
+ * The app's own secrets, e.g. an API key it calls out with. A deployed
71
+ * Worker gets them from `everyapp secret set <NAME>`, and later deploys
72
+ * keep them, so production builds don't declare them. In development each
73
+ * one that is set locally is declared, read as the Vite plugin reads
74
+ * secrets (`.dev.vars[.<mode>]` alone when present, otherwise the `.env`
75
+ * files and the environment), so the plugin passes it through. Type them
76
+ * as optional in `src/env.d.ts`.
77
+ *
78
+ * The keys of `providers` and `capabilities` need no listing: there's no
79
+ * gateway in development, so each one set locally under the gateway
80
+ * secret's name (OPENAI_API_KEY, DATAFORSEO_API_KEY, …) is declared for
81
+ * the SDK's direct fallback.
82
+ *
83
+ * Each by name, or as `{ name, optional, anyOf, why, docs }`: whether the
84
+ * app opens without it, and why it is needed.
85
+ */
86
+ secrets?: ReadonlyArray<string | {
87
+ readonly name: string;
88
+ }>;
89
+ }
90
+ /** The context cf passes to a `defineConfig((ctx) => …)` factory. */
91
+ export interface EveryAppConfigContext {
92
+ mode: string | undefined;
93
+ isPreview?: boolean;
94
+ }
95
+ export interface EveryAppWorkerOptions<TManifest extends EveryAppWorkerManifest, TEntrypoint> {
96
+ /** The default export of `everyapp.config.ts`, declared `as const`. */
97
+ manifest: TManifest;
98
+ /** The Worker entry, usually a `cf-worker` namespace import of `src/entry.worker.ts`. */
99
+ entrypoint: TEntrypoint;
100
+ ctx: EveryAppConfigContext;
101
+ /** App root holding `.dev.vars` and `.env` files. Defaults to the working directory. */
102
+ root?: string;
103
+ /**
104
+ * Cron schedules (UTC) that run the Worker's `scheduled` handler, e.g.
105
+ * `"0 6 * * *"` (daily at 06:00). Deploys keep them; an app can't declare
106
+ * routes.
107
+ */
108
+ crons?: readonly string[];
109
+ /**
110
+ * Compatibility flags beyond `nodejs_compat`, which every Every App Worker
111
+ * has, e.g. `["global_fetch_strictly_public"]` so the Worker's `fetch()`
112
+ * reaches only the public internet. Appended to `nodejs_compat`, without
113
+ * duplicates. The compatibility date is the manifest's.
114
+ */
115
+ compatibilityFlags?: readonly string[];
116
+ }
117
+ export interface TextBinding {
118
+ type: "text";
119
+ value: string;
120
+ }
121
+ export interface SecretBinding {
122
+ type: "secret";
123
+ }
124
+ export interface D1Binding {
125
+ type: "d1";
126
+ name: string;
127
+ id?: string;
128
+ }
129
+ export interface KvBinding {
130
+ type: "kv";
131
+ id?: string;
132
+ }
133
+ export interface R2Binding {
134
+ type: "r2";
135
+ name: string;
136
+ }
137
+ export interface HyperdriveBinding {
138
+ type: "hyperdrive";
139
+ id: string;
140
+ dev?: {
141
+ connectionString?: string;
142
+ };
143
+ }
144
+ /**
145
+ * The app's own Worker, as the bindings of the Durable Objects it defines
146
+ * name it when its entrypoint is a `cf-worker` module import. cf reads each
147
+ * class from that module, so the `Env` it generates types the namespace
148
+ * with it (`DurableObjectNamespace<UserSyncDO>`) and RPC calls on a stub
149
+ * type-check, and it resolves the reference to the Worker's name.
150
+ */
151
+ export interface EveryAppWorkerReference<TEntrypoint extends object> {
152
+ name: string;
153
+ compatibilityDate: string;
154
+ entrypoint: TEntrypoint;
155
+ }
156
+ /**
157
+ * A Durable Object binding. `worker` names the Worker defining the class:
158
+ * the app's own Worker by its definition (see
159
+ * {@link EveryAppWorkerReference}), or a Worker by name, which cf types as
160
+ * an untyped `DurableObjectNamespace`.
161
+ */
162
+ export interface DurableObjectBinding<TWorker extends string | EveryAppWorkerReference<object> = string, TClassName extends string = string> {
163
+ type: "durable-object";
164
+ worker: TWorker;
165
+ exportName: TClassName;
166
+ }
167
+ export interface WorkflowBinding {
168
+ type: "workflow";
169
+ name: string;
170
+ worker: string;
171
+ exportName: string;
172
+ }
173
+ export interface GatewayBinding {
174
+ type: "worker";
175
+ worker: string;
176
+ exportName: string;
177
+ props: Record<string, string>;
178
+ }
179
+ /** The app's service binding to one of its helper Workers. */
180
+ export interface ServiceBinding {
181
+ type: "worker";
182
+ worker: string;
183
+ }
184
+ export interface VersionMetadataBinding {
185
+ type: "version-metadata";
186
+ }
187
+ export type EveryAppBinding = TextBinding | SecretBinding | D1Binding | KvBinding | R2Binding | HyperdriveBinding | DurableObjectBinding<string | EveryAppWorkerReference<object>> | WorkflowBinding | GatewayBinding | ServiceBinding | VersionMetadataBinding;
188
+ export interface DurableObjectExport {
189
+ type: "durable-object";
190
+ storage: "sqlite";
191
+ }
192
+ export interface WorkflowExport {
193
+ type: "workflow";
194
+ name: string;
195
+ }
196
+ type D1Names<M> = M extends {
197
+ resources: {
198
+ d1: readonly (infer B)[];
199
+ };
200
+ } ? B & string : never;
201
+ type KvNames<M> = M extends {
202
+ resources: {
203
+ kv: readonly (infer B)[];
204
+ };
205
+ } ? B & string : never;
206
+ type R2Names<M> = M extends {
207
+ resources: {
208
+ r2: readonly (infer B)[];
209
+ };
210
+ } ? B & string : never;
211
+ type DurableObjects<M> = M extends {
212
+ resources: {
213
+ durableObjects: readonly (infer D)[];
214
+ };
215
+ } ? D : never;
216
+ type Workflows<M> = M extends {
217
+ resources: {
218
+ workflows: readonly (infer W)[];
219
+ };
220
+ } ? W : never;
221
+ type HelperWorkers<M> = M extends {
222
+ workers: readonly (infer H)[];
223
+ } ? H : never;
224
+ /** The Hyperdrive bindings the app's own Worker has: those no helper alone takes. */
225
+ type AppHyperdriveNames<M> = M extends {
226
+ resources: {
227
+ hyperdrive: readonly (infer H)[];
228
+ };
229
+ } ? H extends {
230
+ worker: string;
231
+ } ? never : H extends {
232
+ name: infer N extends string;
233
+ } ? N : never : never;
234
+ type DatabaseEnv<M> = M extends {
235
+ database: object;
236
+ } ? {
237
+ DATABASE_PROVIDER: TextBinding;
238
+ } : unknown;
239
+ /**
240
+ * The gateway secrets holding the keys of the AI providers and capabilities
241
+ * an app may ask for, with the settings a provider needs besides its key
242
+ * (Workers AI's account). With no gateway in development, the SDK reaches
243
+ * them with the developer's own values under the same names. A copy of the
244
+ * tables in ../internal, which the Worker loads: the Vite plugin hides
245
+ * whatever cloudflare.config.ts imports from the Worker. A test keeps them
246
+ * in step.
247
+ */
248
+ declare const DEV_GATEWAY_KEYS: {
249
+ readonly providers: {
250
+ readonly openai: readonly ["OPENAI_API_KEY"];
251
+ readonly openrouter: readonly ["OPENROUTER_API_KEY"];
252
+ readonly "workers-ai": readonly ["WORKERS_AI_API_TOKEN", "CLOUDFLARE_ACCOUNT_ID"];
253
+ };
254
+ readonly capabilities: {
255
+ readonly dataforseo: readonly ["DATAFORSEO_API_KEY"];
256
+ readonly context: readonly ["CONTEXT_API_KEY"];
257
+ readonly email: readonly ["EMAIL_FROM", "EMAIL_FROM_NAME", "EMAIL_REST_API_TOKEN", "CLOUDFLARE_ACCOUNT_ID", "RESEND_API_KEY", "EMAIL_PROVIDER"];
258
+ readonly members: readonly [];
259
+ readonly linkedin: readonly ["LINKEDIN_CLIENT_ID", "LINKEDIN_CLIENT_SECRET"];
260
+ readonly facebook: readonly ["FACEBOOK_APP_ID", "FACEBOOK_APP_SECRET"];
261
+ readonly instagram: readonly ["INSTAGRAM_APP_ID", "INSTAGRAM_APP_SECRET"];
262
+ readonly threads: readonly ["THREADS_APP_ID", "THREADS_APP_SECRET"];
263
+ readonly youtube: readonly ["YOUTUBE_CLIENT_ID", "YOUTUBE_CLIENT_SECRET"];
264
+ readonly tiktok: readonly ["TIKTOK_CLIENT_ID", "TIKTOK_CLIENT_SECRET"];
265
+ readonly "tiktok-business": readonly ["TIKTOK_BUSINESS_CLIENT_ID", "TIKTOK_BUSINESS_CLIENT_SECRET"];
266
+ readonly reddit: readonly ["REDDIT_CLIENT_ID", "REDDIT_CLIENT_SECRET"];
267
+ readonly pinterest: readonly ["PINTEREST_CLIENT_ID", "PINTEREST_CLIENT_SECRET"];
268
+ readonly discord: readonly ["DISCORD_CLIENT_ID", "DISCORD_CLIENT_SECRET"];
269
+ readonly slack: readonly ["SLACK_CLIENT_ID", "SLACK_CLIENT_SECRET"];
270
+ readonly mastodon: readonly ["MASTODON_CLIENT_ID", "MASTODON_CLIENT_SECRET", "MASTODON_URL"];
271
+ readonly kick: readonly ["KICK_CLIENT_ID", "KICK_CLIENT_SECRET"];
272
+ readonly twitch: readonly ["TWITCH_CLIENT_ID", "TWITCH_CLIENT_SECRET"];
273
+ readonly tumblr: readonly ["TUMBLR_CLIENT_ID", "TUMBLR_CLIENT_SECRET"];
274
+ readonly dribbble: readonly ["DRIBBBLE_CLIENT_ID", "DRIBBBLE_CLIENT_SECRET"];
275
+ readonly "google-workspace": readonly ["GOOGLE_WORKSPACE_CLIENT_ID", "GOOGLE_WORKSPACE_CLIENT_SECRET"];
276
+ readonly "microsoft-365": readonly ["MICROSOFT_365_CLIENT_ID", "MICROSOFT_365_CLIENT_SECRET"];
277
+ };
278
+ };
279
+ type DevProviderKeys = typeof DEV_GATEWAY_KEYS.providers;
280
+ type DevCapabilityKeys = typeof DEV_GATEWAY_KEYS.capabilities;
281
+ /** The gateway keys a developer may set locally for the manifest's providers and capabilities. */
282
+ type DevGatewayKeys<M> = (M extends {
283
+ providers: readonly (infer P)[];
284
+ } ? P extends keyof DevProviderKeys ? DevProviderKeys[P][number] : never : never) | (M extends {
285
+ capabilities: infer C;
286
+ } ? keyof C extends infer K ? K extends keyof DevCapabilityKeys ? DevCapabilityKeys[K][number] : never : never : never);
287
+ /**
288
+ * A manifest Durable Object's binding: named after the app's own Worker by
289
+ * its definition when that Worker defines the class and its entrypoint is a
290
+ * module import, so cf types the namespace with the class; a helper
291
+ * Worker's class, or any class behind a path entrypoint, by name.
292
+ */
293
+ type DurableObjectBindingFor<D, TEntrypoint> = D extends {
294
+ worker: string;
295
+ } ? DurableObjectBinding : TEntrypoint extends object ? D extends {
296
+ className: infer C extends string;
297
+ } ? DurableObjectBinding<EveryAppWorkerReference<TEntrypoint>, C> : DurableObjectBinding : DurableObjectBinding;
298
+ type ResourceEnv<M, TEntrypoint> = {
299
+ [B in D1Names<M>]: D1Binding;
300
+ } & {
301
+ [B in KvNames<M>]: KvBinding;
302
+ } & {
303
+ [B in R2Names<M>]: R2Binding;
304
+ } & {
305
+ [D in DurableObjects<M> as D extends {
306
+ name: infer N extends string;
307
+ } ? N : never]: DurableObjectBindingFor<D, TEntrypoint>;
308
+ } & {
309
+ [W in Workflows<M> as W extends {
310
+ name: infer N extends string;
311
+ } ? N : never]: WorkflowBinding;
312
+ } & {
313
+ [H in HelperWorkers<M> as H extends {
314
+ binding: infer B extends string;
315
+ } ? B : never]: ServiceBinding;
316
+ };
317
+ type SharedEnv = {
318
+ EVERYAPP_APP_ID: TextBinding;
319
+ CF_VERSION_METADATA: VersionMetadataBinding;
320
+ };
321
+ /**
322
+ * Hyperdrive in production; in development only where a local connection
323
+ * string is set, so `Env` marks each optional.
324
+ */
325
+ type HyperdriveEnv<M> = {
326
+ [B in AppHyperdriveNames<M>]: HyperdriveBinding;
327
+ };
328
+ /** In dev, an app that lists `email` may get the installation's stand-in senders from .dev.vars. */
329
+ type DevEmailEnv<M> = M extends {
330
+ capabilities: {
331
+ email: unknown;
332
+ };
333
+ } ? {
334
+ EVERYAPP_EMAIL_SENDERS?: SecretBinding;
335
+ } : unknown;
336
+ /**
337
+ * Bindings in development: the well-known dev identity, as plain text, and
338
+ * the developer's own gateway keys (when set).
339
+ */
340
+ export type EveryAppDevEnv<M, TEntrypoint = string> = ResourceEnv<M, TEntrypoint> & SharedEnv & DatabaseEnv<M> & DevEmailEnv<M> & {
341
+ EVERYAPP_DEV: TextBinding;
342
+ EVERYAPP_DEV_CAPABILITIES: TextBinding;
343
+ /** The specs in `.everyapp/providers/*.json`, when the app has any: providers registered on a gateway, for integrationFetch()'s dev fallback. */
344
+ EVERYAPP_DEV_PROVIDERS?: TextBinding;
345
+ EVERYAPP_IDENTITY_PUBLIC_KEYS: TextBinding;
346
+ EVERYAPP_IDENTITY_ISSUER: TextBinding;
347
+ } & {
348
+ [K in DevGatewayKeys<M>]: SecretBinding;
349
+ };
350
+ /** Bindings in production: the deployed identity and the gateway binding. */
351
+ export type EveryAppDeployEnv<M, TEntrypoint = string> = ResourceEnv<M, TEntrypoint> & SharedEnv & DatabaseEnv<M> & HyperdriveEnv<M> & {
352
+ EVERYAPP_AUDIENCE: TextBinding;
353
+ EVERYAPP_IDENTITY_PUBLIC_KEYS: TextBinding;
354
+ EVERYAPP_IDENTITY_ISSUER: TextBinding;
355
+ EVERY_APP_GATEWAY: GatewayBinding;
356
+ GATEWAY_URL: SecretBinding;
357
+ /**
358
+ * The owning organization. The build always declares it; installing a
359
+ * shared app, which serves every organization, drops it.
360
+ */
361
+ EVERY_APP_ORG_ID?: SecretBinding;
362
+ /**
363
+ * `1` on a shared app's Workers, added when it is installed: gateway
364
+ * calls say whom they are for.
365
+ */
366
+ EVERYAPP_SHARED?: TextBinding;
367
+ };
368
+ /** The classes the app's own Worker defines: none a helper Worker does. */
369
+ export type EveryAppExports<M> = {
370
+ [E in DurableObjects<M> | Workflows<M> as E extends {
371
+ worker: string;
372
+ } ? never : E extends {
373
+ className: infer C extends string;
374
+ } ? C : never]: E extends Workflows<M> ? WorkflowExport : DurableObjectExport;
375
+ };
376
+ export interface EveryAppObservability {
377
+ enabled: boolean;
378
+ headSamplingRate: number;
379
+ redactQueryString: boolean;
380
+ logs: {
381
+ enabled: boolean;
382
+ invocationLogs: boolean;
383
+ persist: boolean;
384
+ headSamplingRate: number;
385
+ };
386
+ traces: {
387
+ enabled: boolean;
388
+ persist: boolean;
389
+ headSamplingRate: number;
390
+ };
391
+ issues: {
392
+ enabled: boolean;
393
+ };
394
+ }
395
+ /** Structural copy of cf's targeted placement: run near a cloud region. */
396
+ export interface EveryAppPlacement {
397
+ region: string;
398
+ }
399
+ /** Structural copy of cf's scheduled (cron) trigger. */
400
+ export interface ScheduledTrigger {
401
+ type: "scheduled";
402
+ schedule: string;
403
+ }
404
+ export interface EveryAppWorkerConfig<M, TEntrypoint> {
405
+ name: string;
406
+ entrypoint: TEntrypoint;
407
+ compatibilityDate: string;
408
+ compatibilityFlags: string[];
409
+ workersDev: false;
410
+ previewUrls: false;
411
+ /** The `crons` option's schedules; absent without any. */
412
+ triggers?: ScheduledTrigger[];
413
+ /** Near the manifest's `database.region`, once deployed. */
414
+ placement?: EveryAppPlacement;
415
+ /** The manifest's `limits`. */
416
+ limits?: {
417
+ cpuMs?: number;
418
+ };
419
+ observability: EveryAppObservability;
420
+ /** Either branch, so `Env` marks dev-only and deploy-only bindings optional. */
421
+ env: EveryAppDevEnv<M, TEntrypoint> | EveryAppDeployEnv<M, TEntrypoint>;
422
+ exports: EveryAppExports<M>;
423
+ }
424
+ /**
425
+ * Observability every Every App Worker ships with: logs (with invocation
426
+ * logs), sampled traces and Workers Issues, with query strings redacted so
427
+ * tokens and invitation ids in URLs stay out of logs.
428
+ */
429
+ export declare const EVERYAPP_OBSERVABILITY: Readonly<EveryAppObservability>;
430
+ /**
431
+ * Build the Worker definition for an Every App app from its manifest.
432
+ *
433
+ * - `development` (cf dev) and no mode (cf API commands, `cf workers types`):
434
+ * EVERYAPP_DEV is on, the identity keys and issuer are the well-known dev
435
+ * ones (`@every-app/sdk/dev`) as plain text, so nothing needs writing to
436
+ * `.dev.vars`, and each D1 database gets a fixed local id (see
437
+ * {@link localD1Id}) that `cf d1 … --local` can address.
438
+ * - `production`: tenant-neutral. Everything install-specific (the Worker
439
+ * name, organization, gateway URL, identity keys, resource names and ids)
440
+ * is a placeholder from {@link sentinelDeployTarget}, which the installer
441
+ * rewrites (`everyapp deploy`, or a hosted gateway's deployer), so every
442
+ * build of an app is the same. Only with EVERYAPP_BUILD=1, which
443
+ * `everyapp deploy` sets: a bare `cf deploy` would upload the
444
+ * placeholders.
445
+ */
446
+ export declare function everyAppWorker<const M extends EveryAppWorkerManifest, TEntrypoint extends string | object>(options: EveryAppWorkerOptions<M, TEntrypoint>): EveryAppWorkerConfig<M, TEntrypoint>;
447
+ export interface EveryAppAuxiliaryWorkerOptions<TManifest extends EveryAppWorkerManifest, TEntrypoint> extends EveryAppWorkerOptions<TManifest, TEntrypoint> {
448
+ /** The helper Worker's name in the manifest's `workers`. */
449
+ worker: string;
450
+ }
451
+ /** A helper Worker's definition, for the Vite plugin's `auxiliaryWorkers`. */
452
+ export interface EveryAppAuxiliaryWorkerConfig<TEntrypoint> {
453
+ name: string;
454
+ entrypoint: TEntrypoint;
455
+ compatibilityDate: string;
456
+ compatibilityFlags: string[];
457
+ workersDev: false;
458
+ previewUrls: false;
459
+ triggers?: ScheduledTrigger[];
460
+ placement?: EveryAppPlacement;
461
+ limits?: {
462
+ cpuMs?: number;
463
+ };
464
+ observability: EveryAppObservability;
465
+ env: Record<string, EveryAppBinding>;
466
+ exports: Record<string, DurableObjectExport | WorkflowExport>;
467
+ }
468
+ /**
469
+ * Build the definition of one of the app's helper Workers (the manifest's
470
+ * `workers`), e.g. one that runs a memory-hungry job away from the app's
471
+ * Worker. It is named `<app worker>--<worker>`, is private like the app, and
472
+ * binds the app's D1 databases, KV namespaces and R2 buckets, the classes it defines, and
473
+ * the gateway (with the app's identity, for capabilities). Only the app's
474
+ * Worker reaches it. Pass it to the Vite plugin:
475
+ *
476
+ * cloudflare({
477
+ * auxiliaryWorkers: [
478
+ * { config: everyAppAuxiliaryWorker({ manifest, worker: "audit", entrypoint: "./src/audit.ts", ctx: { mode } }) },
479
+ * ],
480
+ * })
481
+ */
482
+ export declare function everyAppAuxiliaryWorker<const M extends EveryAppWorkerManifest, TEntrypoint extends string | object>(options: EveryAppAuxiliaryWorkerOptions<M, TEntrypoint>): EveryAppAuxiliaryWorkerConfig<TEntrypoint>;
483
+ /**
484
+ * A helper Worker's name: `<app worker>--<name>`, within Cloudflare's
485
+ * limit. New app ids can't contain `--`, so it is never another app's
486
+ * Worker name.
487
+ */
488
+ export declare function helperWorkerName(appWorker: string, helper: string): string;
489
+ /**
490
+ * The Workflow a binding defines, named after the app's Worker:
491
+ * `every-acme-seo` and `RANK_CHECK` → `every-acme-seo--rank-check`.
492
+ * Workflow names are unique in the account, and new app ids can't contain
493
+ * `--`, so one app's Workflow is never named like another app's.
494
+ */
495
+ export declare function workflowNameFor(workerName: string, binding: string): string;
496
+ /**
497
+ * The local D1 database id for a binding: a 32-hex string, because
498
+ * `cf d1 … --local` rejects names. The everyapp CLI computes the same id to
499
+ * apply local migrations to the database `cf dev` serves.
500
+ */
501
+ export declare function localD1Id(workerName: string, binding: string): string;
502
+ /**
503
+ * The sqlite file `cf dev` (and `cf d1 … --local`) keeps the local D1
504
+ * database `databaseId` in, under the app at `root`, for tools such as
505
+ * drizzle-kit studio: `.cloudflare/state/v3/d1/miniflare-D1DatabaseObject/
506
+ * <hash>.sqlite`. The database is a Durable Object named after its id, and
507
+ * the file after that object's id. `databaseId` is the {@link localD1Id}.
508
+ */
509
+ export declare function localD1Path(root: string, databaseId: string): string;
510
+ export {};
511
+ //# sourceMappingURL=worker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../src/cloudflare/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