@intentius/chant-lexicon-fly 0.16.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/README.md +91 -0
- package/dist/codegen/docs-cli.d.ts +3 -0
- package/dist/codegen/docs-cli.d.ts.map +1 -0
- package/dist/codegen/docs.d.ts +27 -0
- package/dist/codegen/docs.d.ts.map +1 -0
- package/dist/codegen/generate-cli.d.ts +6 -0
- package/dist/codegen/generate-cli.d.ts.map +1 -0
- package/dist/codegen/generate-lexicon.d.ts +18 -0
- package/dist/codegen/generate-lexicon.d.ts.map +1 -0
- package/dist/codegen/generate-typescript.d.ts +11 -0
- package/dist/codegen/generate-typescript.d.ts.map +1 -0
- package/dist/codegen/generate.d.ts +15 -0
- package/dist/codegen/generate.d.ts.map +1 -0
- package/dist/codegen/naming.d.ts +14 -0
- package/dist/codegen/naming.d.ts.map +1 -0
- package/dist/codegen/package.d.ts +17 -0
- package/dist/codegen/package.d.ts.map +1 -0
- package/dist/composites/fly-deploy.d.ts +110 -0
- package/dist/composites/fly-deploy.d.ts.map +1 -0
- package/dist/describe-resources.d.ts +74 -0
- package/dist/describe-resources.d.ts.map +1 -0
- package/dist/detect.d.ts +22 -0
- package/dist/detect.d.ts.map +1 -0
- package/dist/export-resources.d.ts +25 -0
- package/dist/export-resources.d.ts.map +1 -0
- package/dist/generated/index.d.ts +42 -0
- package/dist/generated/index.d.ts.map +1 -0
- package/dist/generated/runtime.d.ts +5 -0
- package/dist/generated/runtime.d.ts.map +1 -0
- package/dist/import/generator.d.ts +21 -0
- package/dist/import/generator.d.ts.map +1 -0
- package/dist/import/live-export.d.ts +42 -0
- package/dist/import/live-export.d.ts.map +1 -0
- package/dist/import/parser.d.ts +40 -0
- package/dist/import/parser.d.ts.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/integrity.json +9 -0
- package/dist/lint/post-synth/fly-helpers.d.ts +15 -0
- package/dist/lint/post-synth/fly-helpers.d.ts.map +1 -0
- package/dist/lint/post-synth/fly010-machine-requires-image.d.ts +10 -0
- package/dist/lint/post-synth/fly010-machine-requires-image.d.ts.map +1 -0
- package/dist/lint/post-synth/fly011-mount-references-declared-volume.d.ts +12 -0
- package/dist/lint/post-synth/fly011-mount-references-declared-volume.d.ts.map +1 -0
- package/dist/lint/post-synth/index.d.ts +3 -0
- package/dist/lint/post-synth/index.d.ts.map +1 -0
- package/dist/lint/rules/guest-sizing.d.ts +9 -0
- package/dist/lint/rules/guest-sizing.d.ts.map +1 -0
- package/dist/lint/rules/index.d.ts +7 -0
- package/dist/lint/rules/index.d.ts.map +1 -0
- package/dist/lint/rules/no-secret-literals.d.ts +13 -0
- package/dist/lint/rules/no-secret-literals.d.ts.map +1 -0
- package/dist/lint/rules/valid-region.d.ts +9 -0
- package/dist/lint/rules/valid-region.d.ts.map +1 -0
- package/dist/lsp/completions.d.ts +9 -0
- package/dist/lsp/completions.d.ts.map +1 -0
- package/dist/lsp/hover.d.ts +9 -0
- package/dist/lsp/hover.d.ts.map +1 -0
- package/dist/manifest.json +4 -0
- package/dist/meta.json +285 -0
- package/dist/op/activities/flaps.d.ts +29 -0
- package/dist/op/activities/flaps.d.ts.map +1 -0
- package/dist/op/activities/fly-apply.d.ts +382 -0
- package/dist/op/activities/fly-apply.d.ts.map +1 -0
- package/dist/op/activities/index.d.ts +12 -0
- package/dist/op/activities/index.d.ts.map +1 -0
- package/dist/ownership.d.ts +27 -0
- package/dist/ownership.d.ts.map +1 -0
- package/dist/package-cli.d.ts +3 -0
- package/dist/package-cli.d.ts.map +1 -0
- package/dist/plugin.d.ts +8 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/pseudo.d.ts +23 -0
- package/dist/pseudo.d.ts.map +1 -0
- package/dist/serializer.d.ts +36 -0
- package/dist/serializer.d.ts.map +1 -0
- package/dist/spec/fetch.d.ts +12 -0
- package/dist/spec/fetch.d.ts.map +1 -0
- package/dist/spec/parse.d.ts +58 -0
- package/dist/spec/parse.d.ts.map +1 -0
- package/dist/types/index.d.ts +590 -0
- package/dist/validate-cli.d.ts +3 -0
- package/dist/validate-cli.d.ts.map +1 -0
- package/dist/validate.d.ts +15 -0
- package/dist/validate.d.ts.map +1 -0
- package/package.json +76 -0
- package/src/codegen/docs-cli.ts +7 -0
- package/src/codegen/docs.ts +208 -0
- package/src/codegen/generate-cli.ts +36 -0
- package/src/codegen/generate-lexicon.ts +52 -0
- package/src/codegen/generate-typescript.ts +69 -0
- package/src/codegen/generate.ts +106 -0
- package/src/codegen/naming.ts +45 -0
- package/src/codegen/package.ts +25 -0
- package/src/composites/fly-deploy.ts +169 -0
- package/src/describe-resources.test.ts +188 -0
- package/src/describe-resources.ts +0 -0
- package/src/detect.ts +64 -0
- package/src/export-resources.ts +123 -0
- package/src/generated/.gitkeep +0 -0
- package/src/generated/index.d.ts +590 -0
- package/src/generated/index.ts +47 -0
- package/src/generated/lexicon-fly.json +285 -0
- package/src/generated/runtime.ts +4 -0
- package/src/import/generator.test.ts +123 -0
- package/src/import/generator.ts +242 -0
- package/src/import/live-export.test.ts +150 -0
- package/src/import/live-export.ts +107 -0
- package/src/import/parser.test.ts +132 -0
- package/src/import/parser.ts +185 -0
- package/src/import/roundtrip.test.ts +77 -0
- package/src/index.ts +23 -0
- package/src/lint/post-synth/fly-helpers.ts +25 -0
- package/src/lint/post-synth/fly010-machine-requires-image.test.ts +59 -0
- package/src/lint/post-synth/fly010-machine-requires-image.ts +39 -0
- package/src/lint/post-synth/fly011-mount-references-declared-volume.test.ts +92 -0
- package/src/lint/post-synth/fly011-mount-references-declared-volume.ts +61 -0
- package/src/lint/post-synth/index.ts +9 -0
- package/src/lint/rules/guest-sizing.ts +100 -0
- package/src/lint/rules/index.ts +15 -0
- package/src/lint/rules/no-secret-literals.ts +67 -0
- package/src/lint/rules/rules.test.ts +127 -0
- package/src/lint/rules/valid-region.ts +58 -0
- package/src/lsp/completions.test.ts +10 -0
- package/src/lsp/completions.ts +14 -0
- package/src/lsp/hover.test.ts +10 -0
- package/src/lsp/hover.ts +14 -0
- package/src/op/activities/describe-resources.integration.test.ts +105 -0
- package/src/op/activities/flaps.test.ts +29 -0
- package/src/op/activities/flaps.ts +44 -0
- package/src/op/activities/fly-apply.integration.test.ts +245 -0
- package/src/op/activities/fly-apply.test.ts +513 -0
- package/src/op/activities/fly-apply.ts +1014 -0
- package/src/op/activities/index.ts +48 -0
- package/src/ownership.ts +32 -0
- package/src/package-cli.ts +24 -0
- package/src/plugin.test.ts +17 -0
- package/src/plugin.ts +285 -0
- package/src/pseudo.test.ts +32 -0
- package/src/pseudo.ts +29 -0
- package/src/serializer.test.ts +232 -0
- package/src/serializer.ts +293 -0
- package/src/skills/chant-fly-ops.md +55 -0
- package/src/skills/chant-fly-patterns.md +71 -0
- package/src/skills/chant-fly.md +123 -0
- package/src/spec/fetch.ts +34 -0
- package/src/spec/parse.ts +323 -0
- package/src/validate-cli.ts +5 -0
- package/src/validate.ts +28 -0
package/README.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# @intentius/chant-lexicon-fly
|
|
2
|
+
|
|
3
|
+
The Fly.io lexicon for [chant](https://intentius.io/chant/). Declare Fly apps, machines, volumes, IPs, certificates, and secrets as typed TypeScript and apply them straight to the Fly Machines API.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install --save-dev @intentius/chant @intentius/chant-lexicon-fly
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Test it without a Fly account
|
|
10
|
+
|
|
11
|
+
Fly's Machines API is emulated by [mudflaps](https://github.com/intentius/mudflaps), a stateful Fly Machines API emulator. The entire apply-and-deploy loop runs against a local mudflaps container in CI, with no Fly account and no bill. The same code then deploys to a real org by changing one endpoint, so the loop you test offline is the loop you ship.
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
cd examples/local-fly
|
|
15
|
+
chant run fly # boots mudflaps, applies an App + Machine, waits for started, tears down
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## What it does
|
|
19
|
+
|
|
20
|
+
chant is a type system for operations: you describe infrastructure as typed TypeScript, and each lexicon turns those declarations into real provider API calls. This one covers Fly.
|
|
21
|
+
|
|
22
|
+
The resource types (`App`, `Machine`, `Volume`, `IPAddress`, `Certificate`, `Secret`) are generated from Fly's own Machines API OpenAPI spec, so they track the real API and give you full editor autocomplete. A build step lints them, and `flyApply` reconciles them against a Fly org over the Machines API (flaps) directly.
|
|
23
|
+
|
|
24
|
+
It fits two kinds of user: teams running on Fly who want their infrastructure as typed, reviewed, reconciled code rather than imperative CLI calls, and platform engineers who already manage AWS, GCP, or Kubernetes through chant and want Fly in the same model.
|
|
25
|
+
|
|
26
|
+
## Author infrastructure as typed code
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
import { App, Machine, MachineConfig, MachineGuest } from "@intentius/chant-lexicon-fly";
|
|
30
|
+
|
|
31
|
+
export const app = new App({ name: "my-app" });
|
|
32
|
+
|
|
33
|
+
export const web = new Machine({
|
|
34
|
+
region: "iad",
|
|
35
|
+
config: new MachineConfig({
|
|
36
|
+
image: "flyio/hellofly:latest",
|
|
37
|
+
guest: new MachineGuest({ cpu_kind: "shared", cpus: 1, memory_mb: 256 }),
|
|
38
|
+
}),
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
`MachineConfig` is typed all the way down through guest, services, mounts, and checks, because the whole graph is generated from the Machines API spec.
|
|
43
|
+
|
|
44
|
+
## Apply without a state file
|
|
45
|
+
|
|
46
|
+
`flyApply` speaks the Machines API directly. There is no `flyctl` shell-out and no state file to store, lock, or keep in sync. It reconciles what you declared against what is actually running:
|
|
47
|
+
|
|
48
|
+
- Creates and updates machines, then waits each one to `started` over the Machines API `/wait` endpoint.
|
|
49
|
+
- Prunes only what chant owns. Every machine chant creates carries a `managed-by: chant` marker, and a machine without it is never modified or deleted, so the applier is safe to point at an app that also holds resources you manage elsewhere.
|
|
50
|
+
- Speaks the Machines API lease protocol: acquire a lease, send the nonce on each mutation, re-acquire and retry if the lease is lost, so concurrent operators stay out of each other's way.
|
|
51
|
+
|
|
52
|
+
The endpoint is a single switch. Set `FLY_FLAPS_BASE_URL` (or pass an `endpoint`) to choose between a real Fly org and a local emulator with no code change.
|
|
53
|
+
|
|
54
|
+
## Catch mistakes at build time
|
|
55
|
+
|
|
56
|
+
Lint rules run during `chant build`, before anything reaches the API:
|
|
57
|
+
|
|
58
|
+
- `region` must be a real Fly region.
|
|
59
|
+
- Guest sizing (`cpu_kind` / `cpus` / `memory_mb`) must be a valid combination.
|
|
60
|
+
- Every machine mount must reference a `Volume` declared in the stack, checked across files.
|
|
61
|
+
- Secret values may not be written inline; they belong in a `Secret` or a reference.
|
|
62
|
+
|
|
63
|
+
## The deploy Op
|
|
64
|
+
|
|
65
|
+
The lexicon ships a deploy Op that runs the phases boot, build, apply, verify, and teardown, and a runnable [`examples/local-fly`](../../examples/local-fly) starter. As shown above, `chant run fly` boots mudflaps, builds the plan, applies the App and Machine, waits for the machine to reach `started`, and tears the emulator down. Drop the local endpoint and set `FLY_API_TOKEN`, and the same Op deploys to a real Fly org.
|
|
66
|
+
|
|
67
|
+
## Compared to a Terraform provider for Fly
|
|
68
|
+
|
|
69
|
+
| | Terraform for Fly | This lexicon |
|
|
70
|
+
| ------------ | ---------------------------------------- | ------------------------------------------------------- |
|
|
71
|
+
| **State** | A `.tfstate` to store, lock, and back up | None; reconciles from live state + the ownership marker |
|
|
72
|
+
| **Language** | HCL | TypeScript, types generated from the Machines API spec |
|
|
73
|
+
| **Testing** | Against a real Fly org | Offline against the mudflaps emulator, in CI |
|
|
74
|
+
|
|
75
|
+
The same code applies to a local emulator and to a real Fly org; the only difference is the endpoint.
|
|
76
|
+
|
|
77
|
+
## Agent skill
|
|
78
|
+
|
|
79
|
+
The agent-facing entry point is the `chant-fly` skill: a short operational playbook that walks an agent through authoring an `App` and `Machine`, linting with `chant build`, and reconciling over the Machines API with `flyApply`, including the `FLY_FLAPS_BASE_URL` switch between mudflaps and a real org. It ships with two companions, `chant-fly-patterns` (volumes, IPs, certificates, apply-only secrets, and the ownership model) and `chant-fly-ops` (waiting, leases, prune, and teardown). The skill sources live in [`src/skills/`](src/skills/).
|
|
80
|
+
|
|
81
|
+
## Related packages
|
|
82
|
+
|
|
83
|
+
| Package | Role |
|
|
84
|
+
| ------------------------------------------------------------------------------------------ | ------------------------------------- |
|
|
85
|
+
| [@intentius/chant](https://www.npmjs.com/package/@intentius/chant) | Core type system, CLI, build pipeline |
|
|
86
|
+
| [@intentius/chant-lexicon-aws](https://www.npmjs.com/package/@intentius/chant-lexicon-aws) | AWS CloudFormation lexicon |
|
|
87
|
+
| [@intentius/chant-lexicon-gcp](https://www.npmjs.com/package/@intentius/chant-lexicon-gcp) | GCP Deployment Manager lexicon |
|
|
88
|
+
|
|
89
|
+
## License
|
|
90
|
+
|
|
91
|
+
See the main project LICENSE file.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs-cli.d.ts","sourceRoot":"","sources":["../../src/codegen/docs-cli.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* fly (Machines API / "flaps") documentation generator.
|
|
3
|
+
*
|
|
4
|
+
* Calls the core docsPipeline with fly-specific config: service grouping and
|
|
5
|
+
* overview content. Produces a standalone Starlight docs site at
|
|
6
|
+
* lexicons/fly/docs/, like the aws and gcp lexicons.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Group a fly resource type into a service bucket for the reference sidebar.
|
|
10
|
+
* fly type names are `Fly::Machines::<Kind>`, so the middle segment is always
|
|
11
|
+
* "Machines"; grouping by the leaf kind gives a more useful split (Apps,
|
|
12
|
+
* Machines, Storage, Networking, Secrets).
|
|
13
|
+
*/
|
|
14
|
+
export declare function serviceFromType(resourceType: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* The reference doc URL for a fly resource type. The Machines API (flaps) is
|
|
17
|
+
* documented at docs.machines.dev, tagged by resource; resources flaps does not
|
|
18
|
+
* own (public IPs, certificates) link to the matching fly.io docs page.
|
|
19
|
+
*/
|
|
20
|
+
export declare function resourceTypeUrl(resourceType: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Generate documentation for the fly Machines lexicon.
|
|
23
|
+
*/
|
|
24
|
+
export declare function generateDocs(options?: {
|
|
25
|
+
verbose?: boolean;
|
|
26
|
+
}): Promise<void>;
|
|
27
|
+
//# sourceMappingURL=docs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/codegen/docs.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAsBH;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAiB5D;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAkB5D;AAsED;;GAEG;AACH,wBAAsB,YAAY,CAAC,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA0DjF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-cli.d.ts","sourceRoot":"","sources":["../../src/codegen/generate-cli.ts"],"names":[],"mappings":";AACA;;GAEG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lexicon JSON generator — produces lexicon-fly.json with metadata for the
|
|
3
|
+
* fly resource and property types.
|
|
4
|
+
*/
|
|
5
|
+
import type { PropertyConstraints } from "@intentius/chant/codegen/json-schema";
|
|
6
|
+
import type { FlyParseResult } from "../spec/parse.js";
|
|
7
|
+
import type { NamingStrategy } from "./naming.js";
|
|
8
|
+
export interface FlyLexiconEntry {
|
|
9
|
+
resourceType: string;
|
|
10
|
+
kind: "resource" | "property";
|
|
11
|
+
lexicon: "fly";
|
|
12
|
+
constraints?: Record<string, PropertyConstraints>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Generate the lexicon-fly.json content.
|
|
16
|
+
*/
|
|
17
|
+
export declare function generateLexiconJSON(results: FlyParseResult[], naming: NamingStrategy): string;
|
|
18
|
+
//# sourceMappingURL=generate-lexicon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-lexicon.d.ts","sourceRoot":"","sources":["../../src/codegen/generate-lexicon.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG/C,MAAM,WAAW,eAAe;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,UAAU,GAAG,UAAU,CAAC;IAC9B,OAAO,EAAE,KAAK,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;CACnD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,cAAc,EAAE,EAAE,MAAM,EAAE,cAAc,GAAG,MAAM,CA8B7F"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript declaration file generator — produces index.d.ts with the fly
|
|
3
|
+
* resource classes (App, Machine, Volume) and their property-type classes.
|
|
4
|
+
*/
|
|
5
|
+
import type { FlyParseResult } from "../spec/parse.js";
|
|
6
|
+
import type { NamingStrategy } from "./naming.js";
|
|
7
|
+
/**
|
|
8
|
+
* Generate the complete .d.ts file content.
|
|
9
|
+
*/
|
|
10
|
+
export declare function generateTypeScriptDeclarations(results: FlyParseResult[], naming: NamingStrategy): string;
|
|
11
|
+
//# sourceMappingURL=generate-typescript.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-typescript.d.ts","sourceRoot":"","sources":["../../src/codegen/generate-typescript.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAe/C;;GAEG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,cAAc,EAAE,EAAE,MAAM,EAAE,cAAc,GAAG,MAAM,CA4CxG"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fly generation pipeline — uses core generatePipeline with fly-specific
|
|
3
|
+
* fetch, parse, naming, and generation callbacks.
|
|
4
|
+
*/
|
|
5
|
+
import { type GenerateOptions, type GenerateResult } from "@intentius/chant/codegen/generate";
|
|
6
|
+
export type { GenerateResult };
|
|
7
|
+
/**
|
|
8
|
+
* Run the full fly generation pipeline.
|
|
9
|
+
*/
|
|
10
|
+
export declare function generate(opts?: GenerateOptions): Promise<GenerateResult>;
|
|
11
|
+
/**
|
|
12
|
+
* Write generated artifacts to disk.
|
|
13
|
+
*/
|
|
14
|
+
export declare function writeGeneratedFiles(result: GenerateResult, baseDir: string): void;
|
|
15
|
+
//# sourceMappingURL=generate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/codegen/generate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,cAAc,EAEpB,MAAM,mCAAmC,CAAC;AAY3C,YAAY,EAAE,cAAc,EAAE,CAAC;AAE/B;;GAEG;AACH,wBAAsB,QAAQ,CAAC,IAAI,GAAE,eAAoB,GAAG,OAAO,CAAC,cAAc,CAAC,CAoClF;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAUjF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fly naming strategy — maps Fly::Machines::{Kind} type names to
|
|
3
|
+
* user-friendly TypeScript class names.
|
|
4
|
+
*/
|
|
5
|
+
import { NamingStrategy as CoreNamingStrategy } from "@intentius/chant/codegen/naming";
|
|
6
|
+
import { type FlyParseResult } from "../spec/parse.js";
|
|
7
|
+
export { propertyTypeName, extractDefName } from "@intentius/chant/codegen/naming";
|
|
8
|
+
/**
|
|
9
|
+
* Fly-specific naming strategy. Extends the core strategy with the fly config.
|
|
10
|
+
*/
|
|
11
|
+
export declare class NamingStrategy extends CoreNamingStrategy {
|
|
12
|
+
constructor(results: FlyParseResult[]);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=naming.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"naming.d.ts","sourceRoot":"","sources":["../../src/codegen/naming.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,cAAc,IAAI,kBAAkB,EAGrC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAgC,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAElF,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAqBnF;;GAEG;AACH,qBAAa,cAAe,SAAQ,kBAAkB;gBACxC,OAAO,EAAE,cAAc,EAAE;CAOtC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Package the fly lexicon for distribution.
|
|
3
|
+
*/
|
|
4
|
+
export declare function packageLexicon(options?: {
|
|
5
|
+
verbose?: boolean;
|
|
6
|
+
force?: boolean;
|
|
7
|
+
}): Promise<{
|
|
8
|
+
spec: import("packages/core/src").BundleSpec;
|
|
9
|
+
stats: {
|
|
10
|
+
resources: number;
|
|
11
|
+
properties: number;
|
|
12
|
+
enums: number;
|
|
13
|
+
ruleCount: number;
|
|
14
|
+
skillCount: number;
|
|
15
|
+
};
|
|
16
|
+
}>;
|
|
17
|
+
//# sourceMappingURL=package.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.d.ts","sourceRoot":"","sources":["../../src/codegen/package.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,wBAAsB,cAAc,CAAC,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE;;;;;;;;;GAepF"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* fly deploy Op (#744) — the integration proof: `boot → build → flyApply → wait
|
|
3
|
+
* → teardown` on the local executor. The peer of the aws/gcp deploy Ops in
|
|
4
|
+
* `examples/local-cloud-trio`, for a single cloud.
|
|
5
|
+
*
|
|
6
|
+
* The phases compose modeled activities, no raw shell:
|
|
7
|
+
* Emulator boot mudflaps (the Fly Machines API fake) via `flapsUp`
|
|
8
|
+
* Build run the project's `build:fly` npm script → the serialized plan
|
|
9
|
+
* Apply `flyApply` the plan straight to flaps (creates App + Machine and
|
|
10
|
+
* waits each machine to `started` via `/wait`)
|
|
11
|
+
* Verify GET the app's machines and assert one reached `started`
|
|
12
|
+
* Teardown stop and remove the mudflaps container via `flapsDown`
|
|
13
|
+
*
|
|
14
|
+
* The activity steps are the generic `activity(fn, args)` builder tagged with
|
|
15
|
+
* the exported activity function names the fly lexicon contributes
|
|
16
|
+
* (`flapsUp`/`flapsDown`/`flyApply` from `src/op/activities`). The core activity
|
|
17
|
+
* registry resolves them by name when a project lists the `fly` lexicon, so
|
|
18
|
+
* these typed builders give `gcpApply()`-style DX without a core change.
|
|
19
|
+
*
|
|
20
|
+
* D3 (local vs real Fly): the Apply step's flaps endpoint defaults to local
|
|
21
|
+
* mudflaps (`http://localhost:4280`). Pass `endpoint: null` to drop the override
|
|
22
|
+
* and let `flyApply` fall through to `FLY_FLAPS_BASE_URL` / real Fly (with a
|
|
23
|
+
* `FLY_API_TOKEN`).
|
|
24
|
+
*/
|
|
25
|
+
import type { OpResource } from "@intentius/chant/op";
|
|
26
|
+
import type { ActivityStep } from "@intentius/chant/op";
|
|
27
|
+
/** The local mudflaps endpoint the deploy Op targets by default. */
|
|
28
|
+
export declare const LOCAL_FLAPS_ENDPOINT = "http://localhost:4280";
|
|
29
|
+
/** Options accepted by the mudflaps lifecycle step builders. */
|
|
30
|
+
export interface FlapsStepOpts {
|
|
31
|
+
/** Container name. Default: `chant-mudflaps`. */
|
|
32
|
+
name?: string;
|
|
33
|
+
/** Host port mapped to the emulator's `:4280`. Default: `4280`. */
|
|
34
|
+
port?: number;
|
|
35
|
+
/** Image. Default: `ghcr.io/intentius/mudflaps:0.3.0`. */
|
|
36
|
+
image?: string;
|
|
37
|
+
/** Readiness timeout in ms. */
|
|
38
|
+
timeoutMs?: number;
|
|
39
|
+
/** Health poll interval in ms. */
|
|
40
|
+
intervalMs?: number;
|
|
41
|
+
/** Activity profile override. */
|
|
42
|
+
profile?: ActivityStep["profile"];
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Boot a local mudflaps (Fly Machines API emulator) in Docker and point the
|
|
46
|
+
* apply step at it — the typed twin of `flociGcpUp` for flaps. Resolves to the
|
|
47
|
+
* `flapsUp` activity (#740). Defaults to the `longInfra` profile (the image may
|
|
48
|
+
* pull); override via `opts.profile`.
|
|
49
|
+
*/
|
|
50
|
+
export declare const flapsUp: (opts?: FlapsStepOpts) => ActivityStep;
|
|
51
|
+
/** Stop and remove the local mudflaps container. Resolves to the `flapsDown` activity. Defaults to the `fastIdempotent` profile (override via `opts.profile`). */
|
|
52
|
+
export declare const flapsDown: (opts?: FlapsStepOpts) => ActivityStep;
|
|
53
|
+
/** Options for the flaps apply step (mirror `FlyApplyArgs`, minus `planPath`). */
|
|
54
|
+
export interface FlyApplyStepOpts {
|
|
55
|
+
/** flaps endpoint override (D3). Default: `FLY_FLAPS_BASE_URL` env, else real Fly. */
|
|
56
|
+
endpoint?: string;
|
|
57
|
+
/** Bearer token for real Fly. Default: `FLY_API_TOKEN`. mudflaps ignores it. */
|
|
58
|
+
token?: string;
|
|
59
|
+
/** Prune declared-then-removed resources (D2). Destructive — off by default. */
|
|
60
|
+
prune?: boolean;
|
|
61
|
+
/** Wait-loop tuning (mainly for tests). */
|
|
62
|
+
wait?: Record<string, unknown>;
|
|
63
|
+
/** Activity profile override. */
|
|
64
|
+
profile?: ActivityStep["profile"];
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Apply the serialized flaps plan straight to the Machines API — the typed twin
|
|
68
|
+
* of `gcpApply` for fly. Resolves to the `flyApply` activity (#739): create
|
|
69
|
+
* App + Machine, wait each machine to `started`, prune owned-only when asked.
|
|
70
|
+
* Defaults to the `longInfra` profile (override via `opts.profile`).
|
|
71
|
+
*/
|
|
72
|
+
export declare const flyApplyStep: (planPath: string, opts?: FlyApplyStepOpts) => ActivityStep;
|
|
73
|
+
/** Options for {@link flyDeploy}. */
|
|
74
|
+
export interface FlyDeployOpts {
|
|
75
|
+
/** Op name (the `chant run <name>` target). Default: `fly`. */
|
|
76
|
+
name?: string;
|
|
77
|
+
/** Op overview line. */
|
|
78
|
+
overview?: string;
|
|
79
|
+
/** Temporal task queue (unused by the local executor). Default: `local-fly`. */
|
|
80
|
+
taskQueue?: string;
|
|
81
|
+
/** Directory the `build:fly` script and plan path are relative to. Default: `.`. */
|
|
82
|
+
path?: string;
|
|
83
|
+
/** npm build script to run. Default: `build:fly`. */
|
|
84
|
+
buildScript?: string;
|
|
85
|
+
/** Path to the serialized flaps plan the build writes. Default: `dist/fly.json`. */
|
|
86
|
+
planPath?: string;
|
|
87
|
+
/**
|
|
88
|
+
* flaps endpoint the apply + verify steps target (D3). Defaults to local
|
|
89
|
+
* mudflaps ({@link LOCAL_FLAPS_ENDPOINT}). Pass `null` to drop the override so
|
|
90
|
+
* `flyApply` targets real Fly via `FLY_FLAPS_BASE_URL` / a `FLY_API_TOKEN`.
|
|
91
|
+
*/
|
|
92
|
+
endpoint?: string | null;
|
|
93
|
+
/**
|
|
94
|
+
* App name for the Verify step. When set (with a local `endpoint`), the Op GETs
|
|
95
|
+
* the app's machines and asserts one reached `started`. Omitted → no Verify
|
|
96
|
+
* step (the Apply step still waits each machine to `started`).
|
|
97
|
+
*/
|
|
98
|
+
app?: string;
|
|
99
|
+
/** Prune declared-then-removed resources on apply (D2). Off by default. */
|
|
100
|
+
prune?: boolean;
|
|
101
|
+
/** Wait-loop tuning passed through to `flyApply` (mainly for tests). */
|
|
102
|
+
wait?: Record<string, unknown>;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Build a fly deploy Op: boot mudflaps, build the plan, apply App + Machine,
|
|
106
|
+
* verify the machine reached `started`, tear the emulator down. See the module
|
|
107
|
+
* docstring for the phase layout and the D3 endpoint story.
|
|
108
|
+
*/
|
|
109
|
+
export declare function flyDeploy(opts?: FlyDeployOpts): InstanceType<typeof OpResource>;
|
|
110
|
+
//# sourceMappingURL=fly-deploy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fly-deploy.d.ts","sourceRoot":"","sources":["../../src/composites/fly-deploy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,oEAAoE;AACpE,eAAO,MAAM,oBAAoB,0BAA0B,CAAC;AAE5D,gEAAgE;AAChE,MAAM,WAAW,aAAa;IAC5B,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iCAAiC;IACjC,OAAO,CAAC,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;CACnC;AAED;;;;;GAKG;AACH,eAAO,MAAM,OAAO,GAAI,OAAO,aAAa,KAAG,YAG9C,CAAC;AAEF,kKAAkK;AAClK,eAAO,MAAM,SAAS,GAAI,OAAO,aAAa,KAAG,YAGhD,CAAC;AAEF,kFAAkF;AAClF,MAAM,WAAW,gBAAgB;IAC/B,sFAAsF;IACtF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gFAAgF;IAChF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gFAAgF;IAChF,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2CAA2C;IAC3C,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,iCAAiC;IACjC,OAAO,CAAC,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;CACnC;AAED;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAI,UAAU,MAAM,EAAE,OAAO,gBAAgB,KAAG,YAGxE,CAAC;AAEF,qCAAqC;AACrC,MAAM,WAAW,aAAa;IAC5B,+DAA+D;IAC/D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wBAAwB;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gFAAgF;IAChF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oFAAoF;IACpF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oFAAoF;IACpF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,2EAA2E;IAC3E,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,wEAAwE;IACxE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,GAAE,aAAkB,GAAG,YAAY,CAAC,OAAO,UAAU,CAAC,CAyCnF"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live introspection of Fly (flaps) resources — the read-back seam for chant's
|
|
3
|
+
* plan/drift machinery (#767).
|
|
4
|
+
*
|
|
5
|
+
* The write path (flyApply, #739/#741) already GETs live state to decide
|
|
6
|
+
* create/update/noop and to prune owned orphans. This surfaces that same read
|
|
7
|
+
* side through the standard `describeResources` seam so core's change set
|
|
8
|
+
* (packages/core/src/lifecycle/change-set.ts) and `chant lifecycle plan` can see
|
|
9
|
+
* live Fly state and classify create/update/delete/adopt/noop.
|
|
10
|
+
*
|
|
11
|
+
* Peer of gcp/aws describe-resources: list what is live, key it by chant entity
|
|
12
|
+
* name, attach an ownership verdict. Two-tier ownership, matching the applier
|
|
13
|
+
* (#743):
|
|
14
|
+
*
|
|
15
|
+
* - Machines carry the primary marker (`managed-by: chant`,
|
|
16
|
+
* FLY_METADATA_OWNERSHIP_KEYS), so their verdict is per-resource: `owned`
|
|
17
|
+
* when `isChantOwned(config.metadata)`, else `foreign`.
|
|
18
|
+
* - Volumes, IPs, and certificates carry no marker channel, so their boundary
|
|
19
|
+
* is the app (#741/#743): everything under a chant-managed app (one carrying
|
|
20
|
+
* the marker via its machines) is `owned`. When the `owned` filter asks for
|
|
21
|
+
* those types, this logs that ownership is inferred at the app boundary
|
|
22
|
+
* rather than silently returning everything, per the seam contract.
|
|
23
|
+
*
|
|
24
|
+
* Endpoint + auth reuse the applier verbatim (resolveEndpoint /
|
|
25
|
+
* FLY_FLAPS_BASE_URL / FLY_API_TOKEN), so plan reads the same mudflaps or
|
|
26
|
+
* real-Fly target flyApply writes. Secrets are apply-only (D7): flaps returns
|
|
27
|
+
* only a digest, so they never enter a diff and are excluded here.
|
|
28
|
+
*/
|
|
29
|
+
import type { ResourceMetadata } from "@intentius/chant/lexicon";
|
|
30
|
+
import { type ChangeSet } from "@intentius/chant/lifecycle/change-set";
|
|
31
|
+
import { type FlyHttp } from "./op/activities/fly-apply.js";
|
|
32
|
+
export interface DescribeResourcesOptions {
|
|
33
|
+
environment: string;
|
|
34
|
+
buildOutput: string;
|
|
35
|
+
entityNames: string[];
|
|
36
|
+
entities: Map<string, {
|
|
37
|
+
entityType: string;
|
|
38
|
+
props: Record<string, unknown>;
|
|
39
|
+
}>;
|
|
40
|
+
/** Restrict to chant-owned resources (#119). */
|
|
41
|
+
owned?: boolean;
|
|
42
|
+
/** flaps endpoint override (tests). Defaults to resolveEndpoint() → FLY_FLAPS_BASE_URL. */
|
|
43
|
+
endpoint?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* List live Fly resources over flaps and return them keyed by chant entity name,
|
|
47
|
+
* each tagged with an ownership verdict the core change set reads to decide
|
|
48
|
+
* whether an orphan is a delete (owned) or an adopt candidate (foreign). Reused
|
|
49
|
+
* by `flyPlugin.describeResources`.
|
|
50
|
+
*
|
|
51
|
+
* `http` is injectable for tests; the default reuses the applier's fetch client
|
|
52
|
+
* (bearer token from FLY_API_TOKEN).
|
|
53
|
+
*/
|
|
54
|
+
export declare function describeResources(options: DescribeResourcesOptions, http?: FlyHttp, signal?: AbortSignal): Promise<Record<string, ResourceMetadata>>;
|
|
55
|
+
/**
|
|
56
|
+
* Read-only plan (#767 §4): a `flyApply` dry-run. Reads live state via
|
|
57
|
+
* {@link describeResources}, promotes it to core's typed change set, then
|
|
58
|
+
* refines each declared+live machine's update/noop verdict with the applier's
|
|
59
|
+
* own `configEqual`, so the plan matches exactly what a subsequent `flyApply`
|
|
60
|
+
* would do — never mutating. `renderChangeSet` gives the human view.
|
|
61
|
+
*
|
|
62
|
+
* The core change set already computes create/delete/adopt/noop from
|
|
63
|
+
* declared-vs-live + ownership; the `configEqual` refinement adds the
|
|
64
|
+
* declared-vs-live *config* comparison for machines (core's own update signal is
|
|
65
|
+
* snapshot-relative, which a stateless dry-run has no snapshot for).
|
|
66
|
+
*/
|
|
67
|
+
export declare function flyPlan(options: DescribeResourcesOptions & {
|
|
68
|
+
/** Previous snapshot resources, when reconciling drift since a snapshot. */
|
|
69
|
+
observedThen?: Record<string, ResourceMetadata>;
|
|
70
|
+
}, http?: FlyHttp, signal?: AbortSignal): Promise<{
|
|
71
|
+
changeSet: ChangeSet;
|
|
72
|
+
rendered: string;
|
|
73
|
+
}>;
|
|
74
|
+
//# sourceMappingURL=describe-resources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"describe-resources.d.ts","sourceRoot":"","sources":["../src/describe-resources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAGL,KAAK,SAAS,EACf,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAqBL,KAAK,OAAO,EAIb,MAAM,2BAA2B,CAAC;AAcnC,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC,CAAC;IAC9E,gDAAgD;IAChD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2FAA2F;IAC3F,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAeD;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,wBAAwB,EACjC,IAAI,GAAE,OAA0B,EAChC,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,CA0M3C;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,OAAO,CAC3B,OAAO,EAAE,wBAAwB,GAAG;IAClC,4EAA4E;IAC5E,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;CACjD,EACD,IAAI,GAAE,OAA0B,EAChC,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC;IAAE,SAAS,EAAE,SAAS,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CA8BrD"}
|
package/dist/detect.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Template detection for the fly lexicon.
|
|
3
|
+
*
|
|
4
|
+
* `chant import` parses a template file as JSON and asks each installed lexicon
|
|
5
|
+
* whether it recognizes the shape. fly's importable source is flaps JSON — the
|
|
6
|
+
* Machines API surface the #738 serializer emits and the applier POSTs. Three
|
|
7
|
+
* shapes are recognized:
|
|
8
|
+
*
|
|
9
|
+
* 1. The serializer plan: an object keyed by entity name whose values are
|
|
10
|
+
* `{ endpoint, method, body }` flaps requests (what #738 produces).
|
|
11
|
+
* 2. A machine, a machines listing, or an app-with-machines bundle: what
|
|
12
|
+
* `GET /v1/apps/{app}/machines` returns, or a single machine create body.
|
|
13
|
+
* 3. An app: a create body (`{ app_name }`) or the `GET /v1/apps/{app}` shape.
|
|
14
|
+
*/
|
|
15
|
+
/** The serializer's whole output: entity name → flaps request. */
|
|
16
|
+
export declare function isSerializerPlan(v: unknown): boolean;
|
|
17
|
+
/** A live or create-body machine: carries a `config` object, or the id+state+region GET shape. */
|
|
18
|
+
export declare function isMachineObject(v: unknown): boolean;
|
|
19
|
+
/** An app: a create body (`app_name`) or the `GET /v1/apps/{app}` shape (`name` + machine_count/organization/status). */
|
|
20
|
+
export declare function isAppObject(v: unknown): boolean;
|
|
21
|
+
export declare function detectTemplate(data: unknown): boolean;
|
|
22
|
+
//# sourceMappingURL=detect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../src/detect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAYH,kEAAkE;AAClE,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAIpD;AAED,kGAAkG;AAClG,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAInD;AAED,yHAAyH;AACzH,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAO/C;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAcrD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live export for the fly lexicon — implements `LexiconPlugin.exportResources()`
|
|
3
|
+
* so `chant import --from <fly-env>` regenerates existing Fly apps and machines
|
|
4
|
+
* as chant TypeScript.
|
|
5
|
+
*
|
|
6
|
+
* Reads live flaps state and hands it to the pure `./import/live-export`
|
|
7
|
+
* helpers, which strip server-written fields to the authored shape and map it to
|
|
8
|
+
* import IR via `FlyParser`. Endpoint + auth reuse the applier verbatim
|
|
9
|
+
* (`resolveEndpoint` / `defaultFlyHttp` → FLY_FLAPS_BASE_URL / FLY_API_TOKEN),
|
|
10
|
+
* and the machine listing reuses the applier's `listMachines`, so export reads
|
|
11
|
+
* the same target `flyApply` writes and `describeResources` observes.
|
|
12
|
+
*
|
|
13
|
+
* Which apps are exported: an app named by the selector, else `FLY_APP_NAME`,
|
|
14
|
+
* else every app in the org (`GET /v1/apps?org_slug=<FLY_ORG>`). All flaps I/O
|
|
15
|
+
* lives here; cleaning and IR-building are pure in `./import/live-export`.
|
|
16
|
+
*/
|
|
17
|
+
import type { ExportedTemplate, ResourceSelector } from "@intentius/chant/lexicon";
|
|
18
|
+
import { type FlyHttp } from "./op/activities/fly-apply.js";
|
|
19
|
+
export declare function exportResources(options: {
|
|
20
|
+
environment: string;
|
|
21
|
+
selector?: ResourceSelector;
|
|
22
|
+
owned?: boolean;
|
|
23
|
+
verbatim?: boolean;
|
|
24
|
+
}, http?: FlyHttp, signal?: AbortSignal): Promise<ExportedTemplate>;
|
|
25
|
+
//# sourceMappingURL=export-resources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export-resources.d.ts","sourceRoot":"","sources":["../src/export-resources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACnF,OAAO,EAIL,KAAK,OAAO,EAEb,MAAM,2BAA2B,CAAC;AA8CnC,wBAAsB,eAAe,CACnC,OAAO,EAAE;IACP,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,EACD,IAAI,GAAE,OAA0B,EAChC,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,gBAAgB,CAAC,CA2C3B"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare const App: new (props: Record<string, unknown>, attributes?: Record<string, unknown>) => import("packages/core/src").Declarable & Record<string, string>;
|
|
2
|
+
export declare const Certificate: new (props: Record<string, unknown>, attributes?: Record<string, unknown>) => import("packages/core/src").Declarable & Record<string, string>;
|
|
3
|
+
export declare const IPAddress: new (props: Record<string, unknown>, attributes?: Record<string, unknown>) => import("packages/core/src").Declarable & Record<string, string>;
|
|
4
|
+
export declare const Machine: new (props: Record<string, unknown>, attributes?: Record<string, unknown>) => import("packages/core/src").Declarable & Record<string, string>;
|
|
5
|
+
export declare const Secret: new (props: Record<string, unknown>, attributes?: Record<string, unknown>) => import("packages/core/src").Declarable & Record<string, string>;
|
|
6
|
+
export declare const Volume: new (props: Record<string, unknown>, attributes?: Record<string, unknown>) => import("packages/core/src").Declarable & Record<string, string>;
|
|
7
|
+
export declare const ContainerConfig: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
8
|
+
export declare const ContainerDependency: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
9
|
+
export declare const ContainerHealthcheck: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
10
|
+
export declare const DNSConfig: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
11
|
+
export declare const DnsForwardRule: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
12
|
+
export declare const DnsOption: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
13
|
+
export declare const EnvFrom: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
14
|
+
export declare const ExecHealthcheck: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
15
|
+
export declare const File: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
16
|
+
export declare const HTTPHealthcheck: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
17
|
+
export declare const HTTPOptions: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
18
|
+
export declare const HTTPResponseOptions: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
19
|
+
export declare const MachineCacheDrive: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
20
|
+
export declare const MachineCheck: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
21
|
+
export declare const MachineConfig: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
22
|
+
export declare const MachineGuest: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
23
|
+
export declare const MachineHTTPHeader: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
24
|
+
export declare const MachineInit: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
25
|
+
export declare const MachineMetrics: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
26
|
+
export declare const MachineMount: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
27
|
+
export declare const MachinePort: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
28
|
+
export declare const MachineProcess: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
29
|
+
export declare const MachineRestart: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
30
|
+
export declare const MachineRootfs: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
31
|
+
export declare const MachineSecret: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
32
|
+
export declare const MachineService: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
33
|
+
export declare const MachineServiceCheck: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
34
|
+
export declare const MachineServiceConcurrency: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
35
|
+
export declare const MachineSpot: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
36
|
+
export declare const ProxyProtoOptions: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
37
|
+
export declare const ReplayCache: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
38
|
+
export declare const Static: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
39
|
+
export declare const StopConfig: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
40
|
+
export declare const TCPHealthcheck: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
41
|
+
export declare const TLSOptions: new (props: Record<string, unknown>) => Record<string, unknown>;
|
|
42
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/generated/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,GAAG,+IAAqN,CAAC;AACtO,eAAO,MAAM,WAAW,+IAAqV,CAAC;AAC9W,eAAO,MAAM,SAAS,+IAA6G,CAAC;AACpI,eAAO,MAAM,OAAO,+IAA+V,CAAC;AACpX,eAAO,MAAM,MAAM,+IAAwI,CAAC;AAC5J,eAAO,MAAM,MAAM,+IAAgZ,CAAC;AAEpa,eAAO,MAAM,eAAe,iEAA0D,CAAC;AACvF,eAAO,MAAM,mBAAmB,iEAA8D,CAAC;AAC/F,eAAO,MAAM,oBAAoB,iEAA+D,CAAC;AACjG,eAAO,MAAM,SAAS,iEAAoD,CAAC;AAC3E,eAAO,MAAM,cAAc,iEAAyD,CAAC;AACrF,eAAO,MAAM,SAAS,iEAAoD,CAAC;AAC3E,eAAO,MAAM,OAAO,iEAAkD,CAAC;AACvE,eAAO,MAAM,eAAe,iEAA0D,CAAC;AACvF,eAAO,MAAM,IAAI,iEAA+C,CAAC;AACjE,eAAO,MAAM,eAAe,iEAA0D,CAAC;AACvF,eAAO,MAAM,WAAW,iEAAsD,CAAC;AAC/E,eAAO,MAAM,mBAAmB,iEAA8D,CAAC;AAC/F,eAAO,MAAM,iBAAiB,iEAA4D,CAAC;AAC3F,eAAO,MAAM,YAAY,iEAAuD,CAAC;AACjF,eAAO,MAAM,aAAa,iEAAwD,CAAC;AACnF,eAAO,MAAM,YAAY,iEAAuD,CAAC;AACjF,eAAO,MAAM,iBAAiB,iEAA4D,CAAC;AAC3F,eAAO,MAAM,WAAW,iEAAsD,CAAC;AAC/E,eAAO,MAAM,cAAc,iEAAyD,CAAC;AACrF,eAAO,MAAM,YAAY,iEAAuD,CAAC;AACjF,eAAO,MAAM,WAAW,iEAAsD,CAAC;AAC/E,eAAO,MAAM,cAAc,iEAAyD,CAAC;AACrF,eAAO,MAAM,cAAc,iEAAyD,CAAC;AACrF,eAAO,MAAM,aAAa,iEAAwD,CAAC;AACnF,eAAO,MAAM,aAAa,iEAAwD,CAAC;AACnF,eAAO,MAAM,cAAc,iEAAyD,CAAC;AACrF,eAAO,MAAM,mBAAmB,iEAA8D,CAAC;AAC/F,eAAO,MAAM,yBAAyB,iEAAoE,CAAC;AAC3G,eAAO,MAAM,WAAW,iEAAsD,CAAC;AAC/E,eAAO,MAAM,iBAAiB,iEAA4D,CAAC;AAC3F,eAAO,MAAM,WAAW,iEAAsD,CAAC;AAC/E,eAAO,MAAM,MAAM,iEAAiD,CAAC;AACrE,eAAO,MAAM,UAAU,iEAAqD,CAAC;AAC7E,eAAO,MAAM,cAAc,iEAAyD,CAAC;AACrF,eAAO,MAAM,UAAU,iEAAqD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/generated/runtime.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* flaps TypeScript generator.
|
|
3
|
+
*
|
|
4
|
+
* Converts import IR from {@link FlyParser} into typed chant TypeScript:
|
|
5
|
+
* `import { App, Machine, ... } from "@intentius/chant-lexicon-fly";` followed by
|
|
6
|
+
* `export const <var> = new <Class>({ ... });`.
|
|
7
|
+
*
|
|
8
|
+
* fly's nested config types (`MachineConfig`, `MachineGuest`, `MachineService`,
|
|
9
|
+
* ...) are property declarables — classes with an empty instance shape — so a
|
|
10
|
+
* bare object literal would trip TypeScript's excess-property check against the
|
|
11
|
+
* declared parameter type. Wherever a field's declared type is one of those
|
|
12
|
+
* classes, the value is wrapped in `new <Class>({ ... })` (recursively), which is
|
|
13
|
+
* the same authoring surface `chant init` scaffolds and the serializer walks back
|
|
14
|
+
* to the identical flaps body.
|
|
15
|
+
*/
|
|
16
|
+
import type { TypeScriptGenerator, GeneratedFile } from "@intentius/chant/import/generator";
|
|
17
|
+
import type { TemplateIR } from "@intentius/chant/import/parser";
|
|
18
|
+
export declare class FlyGenerator implements TypeScriptGenerator {
|
|
19
|
+
generate(ir: TemplateIR): GeneratedFile[];
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../src/import/generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAC5F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAuFjE,qBAAa,YAAa,YAAW,mBAAmB;IACtD,QAAQ,CAAC,EAAE,EAAE,UAAU,GAAG,aAAa,EAAE;CAyB1C"}
|