@framers/agentos-ext-cloud-cloudflare-pages 0.1.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.
- package/LICENSE +98 -0
- package/dist/CloudflareService.d.ts +191 -0
- package/dist/CloudflareService.d.ts.map +1 -0
- package/dist/CloudflareService.js +383 -0
- package/dist/CloudflareService.js.map +1 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +72 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/configureDns.d.ts +83 -0
- package/dist/tools/configureDns.d.ts.map +1 -0
- package/dist/tools/configureDns.js +108 -0
- package/dist/tools/configureDns.js.map +1 -0
- package/dist/tools/createWorker.d.ts +57 -0
- package/dist/tools/createWorker.d.ts.map +1 -0
- package/dist/tools/createWorker.js +48 -0
- package/dist/tools/createWorker.js.map +1 -0
- package/dist/tools/deploy.d.ts +59 -0
- package/dist/tools/deploy.d.ts.map +1 -0
- package/dist/tools/deploy.js +45 -0
- package/dist/tools/deploy.js.map +1 -0
- package/dist/tools/listProjects.d.ts +33 -0
- package/dist/tools/listProjects.d.ts.map +1 -0
- package/dist/tools/listProjects.js +34 -0
- package/dist/tools/listProjects.js.map +1 -0
- package/manifest.json +31 -0
- package/package.json +67 -0
- package/src/CloudflareService.ts +606 -0
- package/src/index.ts +129 -0
- package/src/tools/configureDns.ts +130 -0
- package/src/tools/createWorker.ts +58 -0
- package/src/tools/deploy.ts +56 -0
- package/src/tools/listProjects.ts +35 -0
- package/test/CloudflareService.test.ts +409 -0
- package/test/index.test.ts +56 -0
- package/test/tools.test.ts +336 -0
- package/tsconfig.json +22 -0
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Cloudflare REST API service layer.
|
|
4
|
+
*
|
|
5
|
+
* Wraps the Cloudflare API v4 for Pages project deployment, DNS record
|
|
6
|
+
* management, and Worker script deployment.
|
|
7
|
+
*/
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
// Service
|
|
10
|
+
// ---------------------------------------------------------------------------
|
|
11
|
+
export class CloudflareService {
|
|
12
|
+
config;
|
|
13
|
+
running = false;
|
|
14
|
+
constructor(config) {
|
|
15
|
+
this.config = {
|
|
16
|
+
...config,
|
|
17
|
+
baseUrl: config.baseUrl ?? 'https://api.cloudflare.com/client/v4',
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
async initialize() {
|
|
21
|
+
// Validate token by verifying the token
|
|
22
|
+
const res = await this.fetch('/user/tokens/verify');
|
|
23
|
+
if (!res.ok) {
|
|
24
|
+
const body = await res.text();
|
|
25
|
+
throw new Error(`Cloudflare auth failed: ${res.status} ${body}`);
|
|
26
|
+
}
|
|
27
|
+
this.running = true;
|
|
28
|
+
}
|
|
29
|
+
async shutdown() {
|
|
30
|
+
this.running = false;
|
|
31
|
+
}
|
|
32
|
+
get isRunning() {
|
|
33
|
+
return this.running;
|
|
34
|
+
}
|
|
35
|
+
// ── Pages Projects ──────────────────────────────────────────────────────
|
|
36
|
+
/** List all Pages projects. */
|
|
37
|
+
async listProjects(limit = 25) {
|
|
38
|
+
const res = await this.fetch(`/accounts/${this.config.accountId}/pages/projects?per_page=${limit}`);
|
|
39
|
+
const data = await this.json(res);
|
|
40
|
+
return (data.result ?? []).map((p) => this.mapProject(p));
|
|
41
|
+
}
|
|
42
|
+
/** Get a Pages project by name. */
|
|
43
|
+
async getProject(projectName) {
|
|
44
|
+
const res = await this.fetch(`/accounts/${this.config.accountId}/pages/projects/${encodeURIComponent(projectName)}`);
|
|
45
|
+
const data = await this.json(res);
|
|
46
|
+
return this.mapProject(data.result);
|
|
47
|
+
}
|
|
48
|
+
/** Create a new Pages project. */
|
|
49
|
+
async createProject(name, opts) {
|
|
50
|
+
const body = {
|
|
51
|
+
name,
|
|
52
|
+
production_branch: opts?.productionBranch ?? 'main',
|
|
53
|
+
};
|
|
54
|
+
if (opts?.buildCommand || opts?.buildOutputDirectory) {
|
|
55
|
+
body.build_config = {
|
|
56
|
+
...(opts?.buildCommand ? { build_command: opts.buildCommand } : {}),
|
|
57
|
+
...(opts?.buildOutputDirectory ? { destination_dir: opts.buildOutputDirectory } : {}),
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
if (opts?.gitUrl) {
|
|
61
|
+
const { owner, repo } = this.parseGitUrl(opts.gitUrl);
|
|
62
|
+
body.source = {
|
|
63
|
+
type: 'github',
|
|
64
|
+
config: {
|
|
65
|
+
owner,
|
|
66
|
+
repo_name: repo,
|
|
67
|
+
production_branch: opts?.productionBranch ?? 'main',
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
const res = await this.fetch(`/accounts/${this.config.accountId}/pages/projects`, { method: 'POST', body: JSON.stringify(body) });
|
|
72
|
+
const data = await this.json(res);
|
|
73
|
+
return this.mapProject(data.result);
|
|
74
|
+
}
|
|
75
|
+
// ── Deployments ─────────────────────────────────────────────────────────
|
|
76
|
+
/** Create a deployment for a Pages project (triggers build from latest commit). */
|
|
77
|
+
async createDeployment(projectName, opts) {
|
|
78
|
+
const formData = new FormData();
|
|
79
|
+
if (opts?.branch) {
|
|
80
|
+
formData.append('branch', opts.branch);
|
|
81
|
+
}
|
|
82
|
+
const res = await this.fetch(`/accounts/${this.config.accountId}/pages/projects/${encodeURIComponent(projectName)}/deployments`, {
|
|
83
|
+
method: 'POST',
|
|
84
|
+
body: formData,
|
|
85
|
+
headers: {}, // Let fetch set content-type for FormData
|
|
86
|
+
});
|
|
87
|
+
const data = await this.json(res);
|
|
88
|
+
const d = data.result;
|
|
89
|
+
return {
|
|
90
|
+
id: d.id,
|
|
91
|
+
url: d.url ? (d.url.startsWith('http') ? d.url : `https://${d.url}`) : '',
|
|
92
|
+
environment: d.environment ?? 'production',
|
|
93
|
+
projectName: d.project_name ?? projectName,
|
|
94
|
+
latestStage: d.latest_stage ?? { name: 'queued', status: 'idle' },
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
/** Deploy from a Git URL — creates project if needed, then triggers deployment. */
|
|
98
|
+
async deployFromGit(opts) {
|
|
99
|
+
const projectName = this.inferProjectName(opts.gitUrl);
|
|
100
|
+
// Try to get existing project
|
|
101
|
+
let _project = null;
|
|
102
|
+
try {
|
|
103
|
+
_project = await this.getProject(projectName);
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
// Project doesn't exist — create it
|
|
107
|
+
_project = await this.createProject(projectName, {
|
|
108
|
+
gitUrl: opts.gitUrl,
|
|
109
|
+
productionBranch: opts.productionBranch,
|
|
110
|
+
buildCommand: opts.buildCommand,
|
|
111
|
+
buildOutputDirectory: opts.buildOutputDirectory,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
// Set env vars if provided
|
|
115
|
+
if (opts.envVars && Object.keys(opts.envVars).length > 0) {
|
|
116
|
+
await this.setProjectEnvVars(projectName, opts.envVars);
|
|
117
|
+
}
|
|
118
|
+
// Trigger deployment
|
|
119
|
+
return this.createDeployment(projectName, { branch: opts.productionBranch });
|
|
120
|
+
}
|
|
121
|
+
/** Get deployment status. */
|
|
122
|
+
async getDeployment(projectName, deploymentId) {
|
|
123
|
+
const res = await this.fetch(`/accounts/${this.config.accountId}/pages/projects/${encodeURIComponent(projectName)}/deployments/${deploymentId}`);
|
|
124
|
+
const data = await this.json(res);
|
|
125
|
+
return this.mapDeployment(data.result);
|
|
126
|
+
}
|
|
127
|
+
/** List recent deployments for a project. */
|
|
128
|
+
async listDeployments(projectName, limit = 10) {
|
|
129
|
+
const res = await this.fetch(`/accounts/${this.config.accountId}/pages/projects/${encodeURIComponent(projectName)}/deployments?per_page=${limit}`);
|
|
130
|
+
const data = await this.json(res);
|
|
131
|
+
return (data.result ?? []).map((d) => this.mapDeployment(d));
|
|
132
|
+
}
|
|
133
|
+
/** Set environment variables on a Pages project. */
|
|
134
|
+
async setProjectEnvVars(projectName, vars, environment = 'production') {
|
|
135
|
+
const envVarMap = {};
|
|
136
|
+
for (const [key, value] of Object.entries(vars)) {
|
|
137
|
+
envVarMap[key] = { value, type: 'plain_text' };
|
|
138
|
+
}
|
|
139
|
+
const body = {
|
|
140
|
+
deployment_configs: {
|
|
141
|
+
[environment]: {
|
|
142
|
+
env_vars: envVarMap,
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
await this.fetch(`/accounts/${this.config.accountId}/pages/projects/${encodeURIComponent(projectName)}`, { method: 'PATCH', body: JSON.stringify(body) });
|
|
147
|
+
}
|
|
148
|
+
// ── DNS ─────────────────────────────────────────────────────────────────
|
|
149
|
+
/** Look up a zone by domain name. */
|
|
150
|
+
async getZoneByDomain(domain) {
|
|
151
|
+
const res = await this.fetch(`/zones?name=${encodeURIComponent(domain)}`);
|
|
152
|
+
const data = await this.json(res);
|
|
153
|
+
const zones = data.result ?? [];
|
|
154
|
+
if (zones.length === 0) {
|
|
155
|
+
throw new Error(`No Cloudflare zone found for domain: ${domain}`);
|
|
156
|
+
}
|
|
157
|
+
return this.mapZone(zones[0]);
|
|
158
|
+
}
|
|
159
|
+
/** List DNS records for a zone. */
|
|
160
|
+
async listDnsRecords(zoneId, opts) {
|
|
161
|
+
let path = `/zones/${zoneId}/dns_records?per_page=100`;
|
|
162
|
+
if (opts?.type)
|
|
163
|
+
path += `&type=${opts.type}`;
|
|
164
|
+
if (opts?.name)
|
|
165
|
+
path += `&name=${encodeURIComponent(opts.name)}`;
|
|
166
|
+
const res = await this.fetch(path);
|
|
167
|
+
const data = await this.json(res);
|
|
168
|
+
return (data.result ?? []).map((r) => this.mapDnsRecord(r));
|
|
169
|
+
}
|
|
170
|
+
/** Create a DNS record. */
|
|
171
|
+
async createDnsRecord(zoneId, record) {
|
|
172
|
+
const body = {
|
|
173
|
+
type: record.type,
|
|
174
|
+
name: record.name,
|
|
175
|
+
content: record.content,
|
|
176
|
+
ttl: record.ttl ?? 1, // 1 = auto
|
|
177
|
+
proxied: record.proxied ?? false,
|
|
178
|
+
};
|
|
179
|
+
if (record.priority !== undefined)
|
|
180
|
+
body.priority = record.priority;
|
|
181
|
+
if (record.comment)
|
|
182
|
+
body.comment = record.comment;
|
|
183
|
+
const res = await this.fetch(`/zones/${zoneId}/dns_records`, {
|
|
184
|
+
method: 'POST',
|
|
185
|
+
body: JSON.stringify(body),
|
|
186
|
+
});
|
|
187
|
+
const data = await this.json(res);
|
|
188
|
+
return this.mapDnsRecord(data.result);
|
|
189
|
+
}
|
|
190
|
+
/** Update a DNS record. */
|
|
191
|
+
async updateDnsRecord(zoneId, recordId, record) {
|
|
192
|
+
const res = await this.fetch(`/zones/${zoneId}/dns_records/${recordId}`, {
|
|
193
|
+
method: 'PUT',
|
|
194
|
+
body: JSON.stringify(record),
|
|
195
|
+
});
|
|
196
|
+
const data = await this.json(res);
|
|
197
|
+
return this.mapDnsRecord(data.result);
|
|
198
|
+
}
|
|
199
|
+
/** Delete a DNS record. */
|
|
200
|
+
async deleteDnsRecord(zoneId, recordId) {
|
|
201
|
+
await this.fetch(`/zones/${zoneId}/dns_records/${recordId}`, {
|
|
202
|
+
method: 'DELETE',
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
// ── Workers ─────────────────────────────────────────────────────────────
|
|
206
|
+
/** Deploy a Worker script. */
|
|
207
|
+
async deployWorker(opts) {
|
|
208
|
+
// Upload the script
|
|
209
|
+
const formData = new FormData();
|
|
210
|
+
const metadata = {
|
|
211
|
+
main_module: 'worker.js',
|
|
212
|
+
compatibility_date: opts.compatibilityDate ?? '2024-01-01',
|
|
213
|
+
};
|
|
214
|
+
// Add bindings for env vars / secrets
|
|
215
|
+
if (opts.bindings && Object.keys(opts.bindings).length > 0) {
|
|
216
|
+
metadata.bindings = Object.entries(opts.bindings).map(([name, text]) => ({
|
|
217
|
+
type: 'plain_text',
|
|
218
|
+
name,
|
|
219
|
+
text,
|
|
220
|
+
}));
|
|
221
|
+
}
|
|
222
|
+
formData.append('metadata', new Blob([JSON.stringify(metadata)], { type: 'application/json' }));
|
|
223
|
+
formData.append('worker.js', new Blob([opts.script], { type: 'application/javascript+module' }), 'worker.js');
|
|
224
|
+
const res = await this.fetch(`/accounts/${this.config.accountId}/workers/scripts/${encodeURIComponent(opts.name)}`, {
|
|
225
|
+
method: 'PUT',
|
|
226
|
+
body: formData,
|
|
227
|
+
headers: {}, // Let fetch set content-type for FormData
|
|
228
|
+
});
|
|
229
|
+
const data = await this.json(res);
|
|
230
|
+
const result = data.result;
|
|
231
|
+
// Set up routes if provided
|
|
232
|
+
if (opts.routes && opts.routes.length > 0) {
|
|
233
|
+
for (const pattern of opts.routes) {
|
|
234
|
+
try {
|
|
235
|
+
// Determine zone from route pattern
|
|
236
|
+
const routeDomain = pattern.replace(/\/\*$/, '').replace(/^\*\./, '');
|
|
237
|
+
const zone = await this.getZoneByDomain(routeDomain);
|
|
238
|
+
await this.fetch(`/zones/${zone.id}/workers/routes`, {
|
|
239
|
+
method: 'POST',
|
|
240
|
+
body: JSON.stringify({ pattern, script: opts.name }),
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
catch {
|
|
244
|
+
// Route setup is best-effort — zone may not be managed
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
return {
|
|
249
|
+
id: result?.id ?? opts.name,
|
|
250
|
+
tag: result?.tag ?? '',
|
|
251
|
+
etag: result?.etag ?? '',
|
|
252
|
+
size: result?.size ?? 0,
|
|
253
|
+
createdOn: result?.created_on ?? new Date().toISOString(),
|
|
254
|
+
modifiedOn: result?.modified_on ?? new Date().toISOString(),
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
/** List Worker scripts. */
|
|
258
|
+
async listWorkers() {
|
|
259
|
+
const res = await this.fetch(`/accounts/${this.config.accountId}/workers/scripts`);
|
|
260
|
+
const data = await this.json(res);
|
|
261
|
+
return (data.result ?? []).map((w) => ({
|
|
262
|
+
id: w.id,
|
|
263
|
+
tag: w.tag ?? '',
|
|
264
|
+
etag: w.etag ?? '',
|
|
265
|
+
size: w.size ?? 0,
|
|
266
|
+
createdOn: w.created_on ?? '',
|
|
267
|
+
modifiedOn: w.modified_on ?? '',
|
|
268
|
+
}));
|
|
269
|
+
}
|
|
270
|
+
/** Delete a Worker script. */
|
|
271
|
+
async deleteWorker(name) {
|
|
272
|
+
await this.fetch(`/accounts/${this.config.accountId}/workers/scripts/${encodeURIComponent(name)}`, { method: 'DELETE' });
|
|
273
|
+
}
|
|
274
|
+
// ── Helpers ─────────────────────────────────────────────────────────────
|
|
275
|
+
async fetch(path, init) {
|
|
276
|
+
const url = `${this.config.baseUrl}${path}`;
|
|
277
|
+
const headers = {
|
|
278
|
+
'Authorization': `Bearer ${this.config.apiToken}`,
|
|
279
|
+
...(init?.headers ?? {}),
|
|
280
|
+
};
|
|
281
|
+
// Only set Content-Type for non-FormData requests
|
|
282
|
+
if (!(init?.body instanceof FormData) && !headers['Content-Type']) {
|
|
283
|
+
headers['Content-Type'] = 'application/json';
|
|
284
|
+
}
|
|
285
|
+
return globalThis.fetch(url, {
|
|
286
|
+
...init,
|
|
287
|
+
headers,
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
async json(res) {
|
|
291
|
+
if (!res.ok) {
|
|
292
|
+
const text = await res.text();
|
|
293
|
+
throw new Error(`Cloudflare API ${res.status}: ${text.slice(0, 500)}`);
|
|
294
|
+
}
|
|
295
|
+
return res.json();
|
|
296
|
+
}
|
|
297
|
+
parseGitUrl(url) {
|
|
298
|
+
const match = url.match(/(?:github\.com|gitlab\.com|bitbucket\.org)[/:]([^/]+)\/([^/.]+)/);
|
|
299
|
+
if (!match)
|
|
300
|
+
throw new Error(`Cannot parse git URL: ${url}`);
|
|
301
|
+
return { owner: match[1], repo: match[2] };
|
|
302
|
+
}
|
|
303
|
+
inferProjectName(gitUrl) {
|
|
304
|
+
const { repo } = this.parseGitUrl(gitUrl);
|
|
305
|
+
return repo.toLowerCase().replace(/[^a-z0-9-]/g, '-');
|
|
306
|
+
}
|
|
307
|
+
mapProject(data) {
|
|
308
|
+
return {
|
|
309
|
+
id: data.id,
|
|
310
|
+
name: data.name,
|
|
311
|
+
subdomain: data.subdomain ?? `${data.name}.pages.dev`,
|
|
312
|
+
productionBranch: data.production_branch ?? 'main',
|
|
313
|
+
createdOn: data.created_on ?? '',
|
|
314
|
+
domains: data.domains ?? [],
|
|
315
|
+
source: data.source
|
|
316
|
+
? {
|
|
317
|
+
type: data.source.type,
|
|
318
|
+
config: data.source.config
|
|
319
|
+
? {
|
|
320
|
+
owner: data.source.config.owner,
|
|
321
|
+
repo_name: data.source.config.repo_name,
|
|
322
|
+
production_branch: data.source.config.production_branch,
|
|
323
|
+
}
|
|
324
|
+
: undefined,
|
|
325
|
+
}
|
|
326
|
+
: undefined,
|
|
327
|
+
latestDeployment: data.latest_deployment
|
|
328
|
+
? this.mapDeployment(data.latest_deployment)
|
|
329
|
+
: undefined,
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
mapDeployment(data) {
|
|
333
|
+
return {
|
|
334
|
+
id: data.id,
|
|
335
|
+
projectId: data.project_id ?? '',
|
|
336
|
+
projectName: data.project_name ?? '',
|
|
337
|
+
url: data.url ? (data.url.startsWith('http') ? data.url : `https://${data.url}`) : '',
|
|
338
|
+
environment: data.environment ?? 'production',
|
|
339
|
+
createdOn: data.created_on ?? '',
|
|
340
|
+
modifiedOn: data.modified_on ?? '',
|
|
341
|
+
latestStage: data.latest_stage ?? { name: 'queued', status: 'idle' },
|
|
342
|
+
deploymentTrigger: data.deployment_trigger
|
|
343
|
+
? {
|
|
344
|
+
type: data.deployment_trigger.type,
|
|
345
|
+
metadata: data.deployment_trigger.metadata
|
|
346
|
+
? {
|
|
347
|
+
branch: data.deployment_trigger.metadata.branch ?? '',
|
|
348
|
+
commitHash: data.deployment_trigger.metadata.commit_hash ?? '',
|
|
349
|
+
commitMessage: data.deployment_trigger.metadata.commit_message ?? '',
|
|
350
|
+
}
|
|
351
|
+
: undefined,
|
|
352
|
+
}
|
|
353
|
+
: undefined,
|
|
354
|
+
stages: (data.stages ?? []).map((s) => ({
|
|
355
|
+
name: s.name,
|
|
356
|
+
status: s.status,
|
|
357
|
+
startedOn: s.started_on,
|
|
358
|
+
endedOn: s.ended_on,
|
|
359
|
+
})),
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
mapDnsRecord(data) {
|
|
363
|
+
return {
|
|
364
|
+
id: data.id,
|
|
365
|
+
type: data.type,
|
|
366
|
+
name: data.name,
|
|
367
|
+
content: data.content,
|
|
368
|
+
ttl: data.ttl ?? 1,
|
|
369
|
+
proxied: data.proxied,
|
|
370
|
+
priority: data.priority,
|
|
371
|
+
comment: data.comment,
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
mapZone(data) {
|
|
375
|
+
return {
|
|
376
|
+
id: data.id,
|
|
377
|
+
name: data.name,
|
|
378
|
+
status: data.status,
|
|
379
|
+
nameServers: data.name_servers ?? [],
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
//# sourceMappingURL=CloudflareService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CloudflareService.js","sourceRoot":"","sources":["../src/CloudflareService.ts"],"names":[],"mappings":"AAAA,cAAc;AACd;;;;;GAKG;AAoGH,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E,MAAM,OAAO,iBAAiB;IACpB,MAAM,CAAmB;IACzB,OAAO,GAAG,KAAK,CAAC;IAExB,YAAY,MAAwB;QAClC,IAAI,CAAC,MAAM,GAAG;YACZ,GAAG,MAAM;YACT,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,sCAAsC;SAClE,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,UAAU;QACd,wCAAwC;QACxC,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACpD,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;YAC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CAAC,MAAM;YACnB,WAAW,EAAE,IAAI,CAAC,YAAY,IAAI,EAAE;SACrC,CAAC;IACJ,CAAC;CACF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Cloudflare Pages & Workers Extension for AgentOS.
|
|
3
|
+
*
|
|
4
|
+
* Provides 4 tools for deploying Pages projects, managing DNS records,
|
|
5
|
+
* and deploying Worker scripts via the Cloudflare API v4.
|
|
6
|
+
*
|
|
7
|
+
* @module @framers/agentos-ext-cloud-cloudflare-pages
|
|
8
|
+
*/
|
|
9
|
+
export interface CloudflarePagesOptions {
|
|
10
|
+
apiToken?: string;
|
|
11
|
+
accountId?: string;
|
|
12
|
+
secrets?: Record<string, string>;
|
|
13
|
+
}
|
|
14
|
+
export interface ExtensionContext {
|
|
15
|
+
options?: Record<string, unknown>;
|
|
16
|
+
secrets?: Record<string, string>;
|
|
17
|
+
getSecret?: (key: string) => string | undefined;
|
|
18
|
+
logger?: {
|
|
19
|
+
info: (msg: string) => void;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export interface ExtensionPack {
|
|
23
|
+
name: string;
|
|
24
|
+
version: string;
|
|
25
|
+
descriptors: Array<{
|
|
26
|
+
id: string;
|
|
27
|
+
kind: string;
|
|
28
|
+
priority?: number;
|
|
29
|
+
payload: unknown;
|
|
30
|
+
}>;
|
|
31
|
+
onActivate?: () => Promise<void>;
|
|
32
|
+
onDeactivate?: () => Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
export declare function createExtensionPack(context: ExtensionContext): ExtensionPack;
|
|
35
|
+
export { CloudflareService } from './CloudflareService.js';
|
|
36
|
+
export type { CloudflareConfig, CloudflarePagesProject, CloudflareDeployment, CloudflareDnsRecord, CloudflareZone, CloudflareWorker, DeployPagesResult, CreatePagesProjectOptions, DeployWorkerOptions, } from './CloudflareService.js';
|
|
37
|
+
export { CfDeployPagesTool } from './tools/deploy.js';
|
|
38
|
+
export { CfListProjectsTool } from './tools/listProjects.js';
|
|
39
|
+
export { CfConfigureDnsTool } from './tools/configureDns.js';
|
|
40
|
+
export { CfCreateWorkerTool } from './tools/createWorker.js';
|
|
41
|
+
export default createExtensionPack;
|
|
42
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAaH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAqBD,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAChD,MAAM,CAAC,EAAE;QAAE,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,CAAC;CAC1C;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IACtF,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,YAAY,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACpC;AAMD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,gBAAgB,GAAG,aAAa,CAwC5E;AAMD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,YAAY,EACV,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,eAAe,mBAAmB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Cloudflare Pages & Workers Extension for AgentOS.
|
|
4
|
+
*
|
|
5
|
+
* Provides 4 tools for deploying Pages projects, managing DNS records,
|
|
6
|
+
* and deploying Worker scripts via the Cloudflare API v4.
|
|
7
|
+
*
|
|
8
|
+
* @module @framers/agentos-ext-cloud-cloudflare-pages
|
|
9
|
+
*/
|
|
10
|
+
import { CloudflareService } from './CloudflareService.js';
|
|
11
|
+
import { CfDeployPagesTool } from './tools/deploy.js';
|
|
12
|
+
import { CfListProjectsTool } from './tools/listProjects.js';
|
|
13
|
+
import { CfConfigureDnsTool } from './tools/configureDns.js';
|
|
14
|
+
import { CfCreateWorkerTool } from './tools/createWorker.js';
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
// Secret Resolution
|
|
17
|
+
// ---------------------------------------------------------------------------
|
|
18
|
+
function resolveConfig(opts, secrets) {
|
|
19
|
+
return {
|
|
20
|
+
apiToken: opts.apiToken ?? secrets['cloudflare.apiToken']
|
|
21
|
+
?? process.env.CLOUDFLARE_API_TOKEN ?? '',
|
|
22
|
+
accountId: opts.accountId ?? secrets['cloudflare.accountId']
|
|
23
|
+
?? process.env.CLOUDFLARE_ACCOUNT_ID ?? '',
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
// ---------------------------------------------------------------------------
|
|
27
|
+
// Factory
|
|
28
|
+
// ---------------------------------------------------------------------------
|
|
29
|
+
export function createExtensionPack(context) {
|
|
30
|
+
const opts = (context.options ?? {});
|
|
31
|
+
const secrets = opts.secrets ?? context.secrets ?? {};
|
|
32
|
+
const config = resolveConfig(opts, secrets);
|
|
33
|
+
const service = new CloudflareService(config);
|
|
34
|
+
const deployTool = new CfDeployPagesTool(service);
|
|
35
|
+
const listProjectsTool = new CfListProjectsTool(service);
|
|
36
|
+
const configureDnsTool = new CfConfigureDnsTool(service);
|
|
37
|
+
const createWorkerTool = new CfCreateWorkerTool(service);
|
|
38
|
+
return {
|
|
39
|
+
name: '@framers/agentos-ext-cloud-cloudflare-pages',
|
|
40
|
+
version: '0.1.0',
|
|
41
|
+
descriptors: [
|
|
42
|
+
{ id: 'cfDeployPages', kind: 'tool', priority: 40, payload: deployTool },
|
|
43
|
+
{ id: 'cfListProjects', kind: 'tool', priority: 40, payload: listProjectsTool },
|
|
44
|
+
{ id: 'cfConfigureDns', kind: 'tool', priority: 40, payload: configureDnsTool },
|
|
45
|
+
{ id: 'cfCreateWorker', kind: 'tool', priority: 40, payload: createWorkerTool },
|
|
46
|
+
],
|
|
47
|
+
onActivate: async () => {
|
|
48
|
+
if (!config.apiToken) {
|
|
49
|
+
throw new Error('Cloudflare: no API token provided. Set CLOUDFLARE_API_TOKEN environment variable, '
|
|
50
|
+
+ 'or provide it via secrets["cloudflare.apiToken"].');
|
|
51
|
+
}
|
|
52
|
+
if (!config.accountId) {
|
|
53
|
+
throw new Error('Cloudflare: no Account ID provided. Set CLOUDFLARE_ACCOUNT_ID environment variable, '
|
|
54
|
+
+ 'or provide it via secrets["cloudflare.accountId"].');
|
|
55
|
+
}
|
|
56
|
+
await service.initialize();
|
|
57
|
+
},
|
|
58
|
+
onDeactivate: async () => {
|
|
59
|
+
await service.shutdown();
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
// ---------------------------------------------------------------------------
|
|
64
|
+
// Public exports
|
|
65
|
+
// ---------------------------------------------------------------------------
|
|
66
|
+
export { CloudflareService } from './CloudflareService.js';
|
|
67
|
+
export { CfDeployPagesTool } from './tools/deploy.js';
|
|
68
|
+
export { CfListProjectsTool } from './tools/listProjects.js';
|
|
69
|
+
export { CfConfigureDnsTool } from './tools/configureDns.js';
|
|
70
|
+
export { CfCreateWorkerTool } from './tools/createWorker.js';
|
|
71
|
+
export default createExtensionPack;
|
|
72
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc;AACd;;;;;;;GAOG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAY7D,8EAA8E;AAC9E,oBAAoB;AACpB,8EAA8E;AAE9E,SAAS,aAAa,CAAC,IAA4B,EAAE,OAA+B;IAClF,OAAO;QACL,QAAQ,EACN,IAAI,CAAC,QAAQ,IAAI,OAAO,CAAC,qBAAqB,CAAC;eAC5C,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,EAAE;QAC3C,SAAS,EACP,IAAI,CAAC,SAAS,IAAI,OAAO,CAAC,sBAAsB,CAAC;eAC9C,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,EAAE;KAC7C,CAAC;AACJ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MAAM,CAAC,QAAQ,EAAE,CAAC;gBACrB,MAAM,IAAI,KAAK,CACb,oFAAoF;sBAClF,mDAAmD,CACtD,CAAC;YACJ,CAAC;YACD,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;gBACtB,MAAM,IAAI,KAAK,CACb,sFAAsF;sBACpF,oDAAoD,CACvD,CAAC;YACJ,CAAC;YACD,MAAM,OAAO,CAAC,UAAU,EAAE,CAAC;QAC7B,CAAC;QACD,YAAY,EAAE,KAAK,IAAI,EAAE;YACvB,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAC;QAC3B,CAAC;KACF,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,iBAAiB;AACjB,8EAA8E;AAE9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAY3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview CfConfigureDnsTool — manage DNS records on a Cloudflare zone.
|
|
3
|
+
*/
|
|
4
|
+
import type { CloudflareService, CloudflareDnsRecord } from '../CloudflareService.js';
|
|
5
|
+
export interface ConfigureDnsInput {
|
|
6
|
+
domain: string;
|
|
7
|
+
action?: 'add' | 'remove' | 'list' | 'update';
|
|
8
|
+
recordType?: 'A' | 'AAAA' | 'CNAME' | 'TXT' | 'MX';
|
|
9
|
+
name?: string;
|
|
10
|
+
content?: string;
|
|
11
|
+
ttl?: number;
|
|
12
|
+
proxied?: boolean;
|
|
13
|
+
priority?: number;
|
|
14
|
+
comment?: string;
|
|
15
|
+
recordId?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare class CfConfigureDnsTool {
|
|
18
|
+
private service;
|
|
19
|
+
readonly id = "cfConfigureDns";
|
|
20
|
+
readonly name = "cfConfigureDns";
|
|
21
|
+
readonly displayName = "Configure DNS Records";
|
|
22
|
+
readonly description = "Manage DNS records (A, AAAA, CNAME, TXT, MX) on a Cloudflare zone. Supports adding, removing, listing, and updating records. Automatically looks up the zone ID from the domain name.";
|
|
23
|
+
readonly category = "cloud";
|
|
24
|
+
readonly version = "0.1.0";
|
|
25
|
+
readonly hasSideEffects = true;
|
|
26
|
+
readonly inputSchema: {
|
|
27
|
+
type: "object";
|
|
28
|
+
properties: {
|
|
29
|
+
domain: {
|
|
30
|
+
type: string;
|
|
31
|
+
description: string;
|
|
32
|
+
};
|
|
33
|
+
action: {
|
|
34
|
+
type: string;
|
|
35
|
+
enum: string[];
|
|
36
|
+
description: string;
|
|
37
|
+
};
|
|
38
|
+
recordType: {
|
|
39
|
+
type: string;
|
|
40
|
+
enum: string[];
|
|
41
|
+
description: string;
|
|
42
|
+
};
|
|
43
|
+
name: {
|
|
44
|
+
type: string;
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
content: {
|
|
48
|
+
type: string;
|
|
49
|
+
description: string;
|
|
50
|
+
};
|
|
51
|
+
ttl: {
|
|
52
|
+
type: string;
|
|
53
|
+
description: string;
|
|
54
|
+
};
|
|
55
|
+
proxied: {
|
|
56
|
+
type: string;
|
|
57
|
+
description: string;
|
|
58
|
+
};
|
|
59
|
+
priority: {
|
|
60
|
+
type: string;
|
|
61
|
+
description: string;
|
|
62
|
+
};
|
|
63
|
+
comment: {
|
|
64
|
+
type: string;
|
|
65
|
+
description: string;
|
|
66
|
+
};
|
|
67
|
+
recordId: {
|
|
68
|
+
type: string;
|
|
69
|
+
description: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
required: string[];
|
|
73
|
+
};
|
|
74
|
+
constructor(service: CloudflareService);
|
|
75
|
+
execute(args: ConfigureDnsInput): Promise<{
|
|
76
|
+
success: boolean;
|
|
77
|
+
data?: CloudflareDnsRecord | CloudflareDnsRecord[] | {
|
|
78
|
+
message: string;
|
|
79
|
+
};
|
|
80
|
+
error?: string;
|
|
81
|
+
}>;
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=configureDns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configureDns.d.ts","sourceRoot":"","sources":["../../src/tools/configureDns.ts"],"names":[],"mappings":"AACA;;GAEG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEtF,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAC;IAC9C,UAAU,CAAC,EAAE,GAAG,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,IAAI,CAAC;IACnD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,kBAAkB;IA0BjB,OAAO,CAAC,OAAO;IAzB3B,QAAQ,CAAC,EAAE,oBAAoB;IAC/B,QAAQ,CAAC,IAAI,oBAAoB;IACjC,QAAQ,CAAC,WAAW,2BAA2B;IAC/C,QAAQ,CAAC,WAAW,2LAA2L;IAC/M,QAAQ,CAAC,QAAQ,WAAW;IAC5B,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,cAAc,QAAQ;IAE/B,QAAQ,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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