@framers/agentos-ext-cloud-flyio 0.1.2 → 0.1.3
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/README.md +108 -0
- package/manifest.json +1 -1
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Fly.io cloud
|
|
2
|
+
|
|
3
|
+
This pack gives agents tools to deploy Docker images, list apps and machines, scale machines, and create persistent volumes on Fly.io. It uses the Machines REST API and Fly.io GraphQL API with bearer-token authentication.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @framers/agentos-ext-cloud-flyio
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Peer dependency: `@framers/agentos` with range `>=0.10.40`.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { AgentOS } from '@framers/agentos';
|
|
17
|
+
|
|
18
|
+
const agentos = await AgentOS.create({
|
|
19
|
+
extensionManifest: {
|
|
20
|
+
packs: [
|
|
21
|
+
{
|
|
22
|
+
package: '@framers/agentos-ext-cloud-flyio',
|
|
23
|
+
options: {
|
|
24
|
+
token: process.env.FLY_API_TOKEN,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Configuration
|
|
33
|
+
|
|
34
|
+
| Option | Secret id | Environment variable | Required | Default |
|
|
35
|
+
| --- | --- | --- | --- | --- |
|
|
36
|
+
| `token` | `fly.token` | `FLY_API_TOKEN` | Yes | Empty string |
|
|
37
|
+
| `secrets` | | | No | `context.secrets`, then `{}` |
|
|
38
|
+
|
|
39
|
+
Explicit options take precedence over secrets, then environment variables. `options.secrets` takes precedence over `context.secrets`.
|
|
40
|
+
|
|
41
|
+
## Tools
|
|
42
|
+
|
|
43
|
+
| Tool | What it does |
|
|
44
|
+
| --- | --- |
|
|
45
|
+
| `flyDeployApp` | Deploys a Docker image by creating a machine and creates the app if needed. |
|
|
46
|
+
| `flyListApps` | Lists apps or retrieves a named app, with optional machine details. |
|
|
47
|
+
| `flyScaleApp` | Creates, destroys, or resizes machines to reach a desired scale. |
|
|
48
|
+
| `flyCreateVolume` | Creates a persistent volume with encryption enabled by default. |
|
|
49
|
+
|
|
50
|
+
### `flyDeployApp`
|
|
51
|
+
|
|
52
|
+
| Parameter | Type | Required | Description |
|
|
53
|
+
| --- | --- | --- | --- |
|
|
54
|
+
| `appName` | string | Yes | Fly app name. |
|
|
55
|
+
| `image` | string | Yes | Docker image to deploy. |
|
|
56
|
+
| `region` | string | No | Fly region code, described as defaulting to closest. |
|
|
57
|
+
| `cpus` | number | No | CPUs, default 1. |
|
|
58
|
+
| `cpuKind` | string: `shared`, `performance` | No | CPU type, default `shared`. |
|
|
59
|
+
| `memoryMb` | number | No | Memory in MB, default 256. |
|
|
60
|
+
| `env` | object | No | Environment variables as key-value pairs. |
|
|
61
|
+
| `internalPort` | number | No | Internal app port, default 8080. |
|
|
62
|
+
| `autoDestroy` | boolean | No | Destroy the machine when it exits, default `false`. |
|
|
63
|
+
| `createApp` | boolean | No | Create the app if it does not exist, default `true`. |
|
|
64
|
+
| `org` | string | No | Fly organization slug, default `personal`. |
|
|
65
|
+
|
|
66
|
+
### `flyListApps`
|
|
67
|
+
|
|
68
|
+
| Parameter | Type | Required | Description |
|
|
69
|
+
| --- | --- | --- | --- |
|
|
70
|
+
| `appName` | string | No | Filter to a named app; omitting it lists apps. |
|
|
71
|
+
| `includeMachines` | boolean | No | Include machine details for each app, default `true`. |
|
|
72
|
+
|
|
73
|
+
### `flyScaleApp`
|
|
74
|
+
|
|
75
|
+
| Parameter | Type | Required | Description |
|
|
76
|
+
| --- | --- | --- | --- |
|
|
77
|
+
| `appName` | string | Yes | App name to scale. |
|
|
78
|
+
| `count` | number | Yes | Desired machines, with zero described as stopping all. |
|
|
79
|
+
| `cpus` | number | No | CPUs per new or resized machine. |
|
|
80
|
+
| `cpuKind` | string: `shared`, `performance` | No | CPU type for new or resized machines. |
|
|
81
|
+
| `memoryMb` | number | No | Memory in MB per new or resized machine. |
|
|
82
|
+
| `region` | string | No | Region for new machines. |
|
|
83
|
+
|
|
84
|
+
### `flyCreateVolume`
|
|
85
|
+
|
|
86
|
+
| Parameter | Type | Required | Description |
|
|
87
|
+
| --- | --- | --- | --- |
|
|
88
|
+
| `appName` | string | Yes | App in which to create the volume. |
|
|
89
|
+
| `name` | string | Yes | Volume name used in mount configuration. |
|
|
90
|
+
| `region` | string | Yes | Volume region, which must match the machine region. |
|
|
91
|
+
| `sizeGb` | number | Yes | Volume size in GB, described minimum 1. |
|
|
92
|
+
| `encrypted` | boolean | No | Encrypt the volume, default `true`. |
|
|
93
|
+
|
|
94
|
+
## Notes
|
|
95
|
+
|
|
96
|
+
Activation fails when the token is missing and validates supplied tokens through a GraphQL `currentUser` query. A response without a user ID fails activation.
|
|
97
|
+
|
|
98
|
+
Deployment creates remote apps and machines from an existing Docker image. It exposes HTTP and HTTPS, enables automatic start and stop, and redirects HTTP to HTTPS. An omitted `region` is left out of the request. With `createApp` set to `false`, a failed app lookup returns an error.
|
|
99
|
+
|
|
100
|
+
Scaling down stops and destroys excess machines, including all machines when `count` is zero. Scaling up clones the first existing machine's configuration; without an existing machine, it sends an empty image. Resizing sends a guest configuration update. The tool does not validate `count` as a nonnegative integer.
|
|
101
|
+
|
|
102
|
+
Volume creation provisions remote storage without attaching it to a machine. The described minimum size is not enforced locally.
|
|
103
|
+
|
|
104
|
+
When listing apps without `appName`, a machine lookup failure becomes an empty machine list for that app. A machine lookup failure for a named app returns an error.
|
|
105
|
+
|
|
106
|
+
## License
|
|
107
|
+
|
|
108
|
+
Apache-2.0
|
package/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://agentos.sh/schemas/extension-manifest-v1.json",
|
|
3
3
|
"id": "com.framers.cloud.flyio",
|
|
4
4
|
"name": "Fly.io Cloud Deployment",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.3",
|
|
6
6
|
"description": "Deploy and manage applications on Fly.io using the Machines API. Create apps, launch machines with custom configs, scale instances by count and size, and provision persistent volumes for stateful workloads.",
|
|
7
7
|
"author": {
|
|
8
8
|
"name": "Frame.dev",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@framers/agentos-ext-cloud-flyio",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Fly.io cloud deployment extension — deploy apps, manage machines, scale instances, and create persistent volumes via the Fly Machines API.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"rimraf": "^5.0.7",
|
|
54
54
|
"typescript": "^5.4.5",
|
|
55
55
|
"vitest": "^3.2.7",
|
|
56
|
-
"@framers/agentos": "^0.13.
|
|
56
|
+
"@framers/agentos": "^0.13.47"
|
|
57
57
|
},
|
|
58
58
|
"homepage": "https://github.com/framerslab/agentos-extensions/tree/master/registry/curated/cloud/flyio#readme",
|
|
59
59
|
"bugs": {
|