@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.
Files changed (149) hide show
  1. package/README.md +91 -0
  2. package/dist/codegen/docs-cli.d.ts +3 -0
  3. package/dist/codegen/docs-cli.d.ts.map +1 -0
  4. package/dist/codegen/docs.d.ts +27 -0
  5. package/dist/codegen/docs.d.ts.map +1 -0
  6. package/dist/codegen/generate-cli.d.ts +6 -0
  7. package/dist/codegen/generate-cli.d.ts.map +1 -0
  8. package/dist/codegen/generate-lexicon.d.ts +18 -0
  9. package/dist/codegen/generate-lexicon.d.ts.map +1 -0
  10. package/dist/codegen/generate-typescript.d.ts +11 -0
  11. package/dist/codegen/generate-typescript.d.ts.map +1 -0
  12. package/dist/codegen/generate.d.ts +15 -0
  13. package/dist/codegen/generate.d.ts.map +1 -0
  14. package/dist/codegen/naming.d.ts +14 -0
  15. package/dist/codegen/naming.d.ts.map +1 -0
  16. package/dist/codegen/package.d.ts +17 -0
  17. package/dist/codegen/package.d.ts.map +1 -0
  18. package/dist/composites/fly-deploy.d.ts +110 -0
  19. package/dist/composites/fly-deploy.d.ts.map +1 -0
  20. package/dist/describe-resources.d.ts +74 -0
  21. package/dist/describe-resources.d.ts.map +1 -0
  22. package/dist/detect.d.ts +22 -0
  23. package/dist/detect.d.ts.map +1 -0
  24. package/dist/export-resources.d.ts +25 -0
  25. package/dist/export-resources.d.ts.map +1 -0
  26. package/dist/generated/index.d.ts +42 -0
  27. package/dist/generated/index.d.ts.map +1 -0
  28. package/dist/generated/runtime.d.ts +5 -0
  29. package/dist/generated/runtime.d.ts.map +1 -0
  30. package/dist/import/generator.d.ts +21 -0
  31. package/dist/import/generator.d.ts.map +1 -0
  32. package/dist/import/live-export.d.ts +42 -0
  33. package/dist/import/live-export.d.ts.map +1 -0
  34. package/dist/import/parser.d.ts +40 -0
  35. package/dist/import/parser.d.ts.map +1 -0
  36. package/dist/index.d.ts +8 -0
  37. package/dist/index.d.ts.map +1 -0
  38. package/dist/integrity.json +9 -0
  39. package/dist/lint/post-synth/fly-helpers.d.ts +15 -0
  40. package/dist/lint/post-synth/fly-helpers.d.ts.map +1 -0
  41. package/dist/lint/post-synth/fly010-machine-requires-image.d.ts +10 -0
  42. package/dist/lint/post-synth/fly010-machine-requires-image.d.ts.map +1 -0
  43. package/dist/lint/post-synth/fly011-mount-references-declared-volume.d.ts +12 -0
  44. package/dist/lint/post-synth/fly011-mount-references-declared-volume.d.ts.map +1 -0
  45. package/dist/lint/post-synth/index.d.ts +3 -0
  46. package/dist/lint/post-synth/index.d.ts.map +1 -0
  47. package/dist/lint/rules/guest-sizing.d.ts +9 -0
  48. package/dist/lint/rules/guest-sizing.d.ts.map +1 -0
  49. package/dist/lint/rules/index.d.ts +7 -0
  50. package/dist/lint/rules/index.d.ts.map +1 -0
  51. package/dist/lint/rules/no-secret-literals.d.ts +13 -0
  52. package/dist/lint/rules/no-secret-literals.d.ts.map +1 -0
  53. package/dist/lint/rules/valid-region.d.ts +9 -0
  54. package/dist/lint/rules/valid-region.d.ts.map +1 -0
  55. package/dist/lsp/completions.d.ts +9 -0
  56. package/dist/lsp/completions.d.ts.map +1 -0
  57. package/dist/lsp/hover.d.ts +9 -0
  58. package/dist/lsp/hover.d.ts.map +1 -0
  59. package/dist/manifest.json +4 -0
  60. package/dist/meta.json +285 -0
  61. package/dist/op/activities/flaps.d.ts +29 -0
  62. package/dist/op/activities/flaps.d.ts.map +1 -0
  63. package/dist/op/activities/fly-apply.d.ts +382 -0
  64. package/dist/op/activities/fly-apply.d.ts.map +1 -0
  65. package/dist/op/activities/index.d.ts +12 -0
  66. package/dist/op/activities/index.d.ts.map +1 -0
  67. package/dist/ownership.d.ts +27 -0
  68. package/dist/ownership.d.ts.map +1 -0
  69. package/dist/package-cli.d.ts +3 -0
  70. package/dist/package-cli.d.ts.map +1 -0
  71. package/dist/plugin.d.ts +8 -0
  72. package/dist/plugin.d.ts.map +1 -0
  73. package/dist/pseudo.d.ts +23 -0
  74. package/dist/pseudo.d.ts.map +1 -0
  75. package/dist/serializer.d.ts +36 -0
  76. package/dist/serializer.d.ts.map +1 -0
  77. package/dist/spec/fetch.d.ts +12 -0
  78. package/dist/spec/fetch.d.ts.map +1 -0
  79. package/dist/spec/parse.d.ts +58 -0
  80. package/dist/spec/parse.d.ts.map +1 -0
  81. package/dist/types/index.d.ts +590 -0
  82. package/dist/validate-cli.d.ts +3 -0
  83. package/dist/validate-cli.d.ts.map +1 -0
  84. package/dist/validate.d.ts +15 -0
  85. package/dist/validate.d.ts.map +1 -0
  86. package/package.json +76 -0
  87. package/src/codegen/docs-cli.ts +7 -0
  88. package/src/codegen/docs.ts +208 -0
  89. package/src/codegen/generate-cli.ts +36 -0
  90. package/src/codegen/generate-lexicon.ts +52 -0
  91. package/src/codegen/generate-typescript.ts +69 -0
  92. package/src/codegen/generate.ts +106 -0
  93. package/src/codegen/naming.ts +45 -0
  94. package/src/codegen/package.ts +25 -0
  95. package/src/composites/fly-deploy.ts +169 -0
  96. package/src/describe-resources.test.ts +188 -0
  97. package/src/describe-resources.ts +0 -0
  98. package/src/detect.ts +64 -0
  99. package/src/export-resources.ts +123 -0
  100. package/src/generated/.gitkeep +0 -0
  101. package/src/generated/index.d.ts +590 -0
  102. package/src/generated/index.ts +47 -0
  103. package/src/generated/lexicon-fly.json +285 -0
  104. package/src/generated/runtime.ts +4 -0
  105. package/src/import/generator.test.ts +123 -0
  106. package/src/import/generator.ts +242 -0
  107. package/src/import/live-export.test.ts +150 -0
  108. package/src/import/live-export.ts +107 -0
  109. package/src/import/parser.test.ts +132 -0
  110. package/src/import/parser.ts +185 -0
  111. package/src/import/roundtrip.test.ts +77 -0
  112. package/src/index.ts +23 -0
  113. package/src/lint/post-synth/fly-helpers.ts +25 -0
  114. package/src/lint/post-synth/fly010-machine-requires-image.test.ts +59 -0
  115. package/src/lint/post-synth/fly010-machine-requires-image.ts +39 -0
  116. package/src/lint/post-synth/fly011-mount-references-declared-volume.test.ts +92 -0
  117. package/src/lint/post-synth/fly011-mount-references-declared-volume.ts +61 -0
  118. package/src/lint/post-synth/index.ts +9 -0
  119. package/src/lint/rules/guest-sizing.ts +100 -0
  120. package/src/lint/rules/index.ts +15 -0
  121. package/src/lint/rules/no-secret-literals.ts +67 -0
  122. package/src/lint/rules/rules.test.ts +127 -0
  123. package/src/lint/rules/valid-region.ts +58 -0
  124. package/src/lsp/completions.test.ts +10 -0
  125. package/src/lsp/completions.ts +14 -0
  126. package/src/lsp/hover.test.ts +10 -0
  127. package/src/lsp/hover.ts +14 -0
  128. package/src/op/activities/describe-resources.integration.test.ts +105 -0
  129. package/src/op/activities/flaps.test.ts +29 -0
  130. package/src/op/activities/flaps.ts +44 -0
  131. package/src/op/activities/fly-apply.integration.test.ts +245 -0
  132. package/src/op/activities/fly-apply.test.ts +513 -0
  133. package/src/op/activities/fly-apply.ts +1014 -0
  134. package/src/op/activities/index.ts +48 -0
  135. package/src/ownership.ts +32 -0
  136. package/src/package-cli.ts +24 -0
  137. package/src/plugin.test.ts +17 -0
  138. package/src/plugin.ts +285 -0
  139. package/src/pseudo.test.ts +32 -0
  140. package/src/pseudo.ts +29 -0
  141. package/src/serializer.test.ts +232 -0
  142. package/src/serializer.ts +293 -0
  143. package/src/skills/chant-fly-ops.md +55 -0
  144. package/src/skills/chant-fly-patterns.md +71 -0
  145. package/src/skills/chant-fly.md +123 -0
  146. package/src/spec/fetch.ts +34 -0
  147. package/src/spec/parse.ts +323 -0
  148. package/src/validate-cli.ts +5 -0
  149. package/src/validate.ts +28 -0
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Pure export helpers for the fly lexicon — strip live flaps state to the
3
+ * authored shape and build import IR from it. All flaps I/O stays in the caller
4
+ * (`../export-resources`); this module is deterministic and unit-testable.
5
+ *
6
+ * The strip mirrors the read-only field lists the parser drops, so a live
7
+ * machine/app reaches the same declared shape a user would have written. Machine
8
+ * ownership is a per-resource marker (`managed-by: chant` in `config.metadata`,
9
+ * read via `isChantOwned`); the app carries no marker, so under the `owned`
10
+ * filter its ownership is inferred at the app boundary (an app is chant-managed
11
+ * when one of its machines is), and the limitation is logged rather than
12
+ * silently returning everything — the seam contract, matching gcp/aws.
13
+ *
14
+ * `verbatim` is inert for fly (the core contract permits this for targets whose
15
+ * importable surface is already the declared shape): the App/Machine
16
+ * constructors accept only the writable surface, so server-written fields are
17
+ * not constructor parameters and cannot round-trip into the generated code. The
18
+ * option is accepted for signature parity.
19
+ */
20
+ import type { ExportedTemplate, ResourceSelector } from "@intentius/chant/lexicon";
21
+ import { type FlapsMachine } from "../op/activities/fly-apply.js";
22
+ /** Drop server-written read-only machine fields to reach the authored shape. Returns a new object. */
23
+ export declare function stripMachineServerFields(machine: Record<string, unknown>): Record<string, unknown>;
24
+ /** Drop server-written read-only app fields, keeping `name`/`org_slug`. Returns a new object. */
25
+ export declare function stripAppServerFields(app: Record<string, unknown>): Record<string, unknown>;
26
+ /**
27
+ * Build export IR from one app's live flaps state. Reuses {@link FlyParser} as
28
+ * the single wire→authoring mapping authority by feeding it a cleaned
29
+ * app-with-machines bundle.
30
+ *
31
+ * `opts.owned` keeps only machines carrying the chant marker, and includes the
32
+ * app only when it is chant-managed (a machine is). `opts.verbatim` keeps server
33
+ * fields. Pure: logging is delegated to `opts.onBoundaryInference`, which the
34
+ * I/O caller wires to a single warn.
35
+ */
36
+ export declare function buildExportFromApp(app: Record<string, unknown> | undefined, machines: FlapsMachine[], opts?: {
37
+ verbatim?: boolean;
38
+ selector?: ResourceSelector;
39
+ owned?: boolean;
40
+ onBoundaryInference?: () => void;
41
+ }): ExportedTemplate;
42
+ //# sourceMappingURL=live-export.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"live-export.d.ts","sourceRoot":"","sources":["../../src/import/live-export.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACnF,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAW7E,sGAAsG;AACtG,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAIlG;AAED,iGAAiG;AACjG,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAQ1F;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EACxC,QAAQ,EAAE,YAAY,EAAE,EACxB,IAAI,GAAE;IACJ,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;CAC7B,GACL,gBAAgB,CAqClB"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * flaps JSON template parser.
3
+ *
4
+ * Turns Fly Machines API ("flaps") JSON into the import IR for conversion to
5
+ * chant TypeScript. Three input shapes are accepted, all mapped to the authoring
6
+ * surface (the writable fields a user would have declared):
7
+ *
8
+ * 1. The #738 serializer plan — `{ <entity>: { endpoint, method, body } }`.
9
+ * `/v1/apps` bodies become `App`s; `.../machines` bodies become `Machine`s.
10
+ * 2. A machines listing (an array) or an app-with-machines bundle
11
+ * (`{ ...appFields, machines: [...] }`) — an `App` plus its `Machine`s.
12
+ * 3. A single machine (`{ name, region, config }`) or a single app
13
+ * (`{ app_name }` / the `GET /v1/apps/{app}` shape).
14
+ *
15
+ * flaps wire field names are mapped back to the authoring surface: an app's
16
+ * `app_name` becomes the `App`'s `name`, and server-written read-only machine
17
+ * fields (id, state, instance_id, ...) are dropped so the IR is the declared
18
+ * shape. `logicalId` is the app/machine name (the generator camelCases it into a
19
+ * variable).
20
+ */
21
+ import type { TemplateParser, TemplateIR } from "@intentius/chant/import/parser";
22
+ import { BaseValueParser } from "@intentius/chant/import/base-parser";
23
+ export declare const APP_TYPE = "Fly::Machines::App";
24
+ export declare const MACHINE_TYPE = "Fly::Machines::Machine";
25
+ /** Server-written read-only machine fields — never part of the authored shape. */
26
+ export declare const MACHINE_SERVER_FIELDS: string[];
27
+ /** Server-written read-only app fields — never part of the authored shape. */
28
+ export declare const APP_SERVER_FIELDS: string[];
29
+ export declare class FlyParser extends BaseValueParser implements TemplateParser {
30
+ protected dispatchIntrinsic(_key: string, _value: unknown, _obj: Record<string, unknown>): unknown | null;
31
+ parse(input: string): TemplateIR;
32
+ /** Map one serializer-plan request to a resource by its endpoint. */
33
+ private resourceFromRequest;
34
+ private looksLikeApp;
35
+ /** An `App` resource. flaps `app_name` (create body) or `name` (GET) → `name`. */
36
+ private appResource;
37
+ /** A `Machine` resource, stripped of server-written read-only fields. */
38
+ private machineResource;
39
+ }
40
+ //# sourceMappingURL=parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/import/parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EAEX,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAGtE,eAAO,MAAM,QAAQ,uBAAuB,CAAC;AAC7C,eAAO,MAAM,YAAY,2BAA2B,CAAC;AAErD,kFAAkF;AAClF,eAAO,MAAM,qBAAqB,UAajC,CAAC;AAEF,8EAA8E;AAC9E,eAAO,MAAM,iBAAiB,UAO7B,CAAC;AAMF,qBAAa,SAAU,SAAQ,eAAgB,YAAW,cAAc;IACtE,SAAS,CAAC,iBAAiB,CACzB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,GAAG,IAAI;IAKjB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU;IAiDhC,qEAAqE;IACrE,OAAO,CAAC,mBAAmB;IAkB3B,OAAO,CAAC,YAAY;IAIpB,kFAAkF;IAClF,OAAO,CAAC,WAAW;IAuBnB,yEAAyE;IACzE,OAAO,CAAC,eAAe;CAexB"}
@@ -0,0 +1,8 @@
1
+ export { flyPlugin } from "./plugin.js";
2
+ export { flySerializer } from "./serializer.js";
3
+ export { Fly, Region, OrgSlug, AppName, PseudoParameter } from "./pseudo.js";
4
+ export { FLY_METADATA_OWNERSHIP_KEYS } from "./ownership.js";
5
+ export { flyDeploy, flapsUp, flapsDown, flyApplyStep, LOCAL_FLAPS_ENDPOINT } from "./composites/fly-deploy.js";
6
+ export type { FlyDeployOpts, FlyApplyStepOpts, FlapsStepOpts } from "./composites/fly-deploy.js";
7
+ export * from "./generated/index.js";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAGrC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAI7C,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAG1E,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAK1D,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC5G,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAK9F,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,9 @@
1
+ {
2
+ "algorithm": "sha256",
3
+ "artifacts": {
4
+ "manifest.json": "fcc2496380c816d45afe24ae51a64d54a856820179f16f7f61d4ff21e566738e",
5
+ "meta.json": "e46e65ba7544fafc6dbb3fd48b841904b5ae6f7cb4d517a940ed68b01626c097",
6
+ "types/index.d.ts": "ec573230bc00413137871d6f1470e027083231dfd188b69b2517b20c3317a6b6"
7
+ },
8
+ "composite": "5a1f375f50953512d171047c55a13bcaa03f7ce8fc10a79bc17d5806f5ee5436"
9
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Shared helpers for the fly post-synth checks. Not a check itself, so the
3
+ * generated barrel skips it (the scanner only picks up exported PostSynthChecks).
4
+ */
5
+ /**
6
+ * Read an entity or property's constructor props. Nested Declarables
7
+ * (MachineConfig, MachineMount, Volume) stash their args under a non-enumerable
8
+ * `props`; a plain inline object carries them directly. Handle both so a check
9
+ * behaves the same whether the user authored `config: { image }` or
10
+ * `config: new MachineConfig({ image })`.
11
+ */
12
+ export declare function readProps(value: unknown): Record<string, unknown>;
13
+ /** The entityType of a declarable, or undefined. */
14
+ export declare function entityTypeOf(value: unknown): string | undefined;
15
+ //# sourceMappingURL=fly-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fly-helpers.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/fly-helpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAOjE;AAED,oDAAoD;AACpD,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAE/D"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * FLY010: Machine config must specify an image.
3
+ *
4
+ * A Machine cannot boot without a container image. The Machines API rejects a
5
+ * create request whose config omits `image`, so catch it at synth time with a
6
+ * clearer message.
7
+ */
8
+ import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
9
+ export declare const fly010: PostSynthCheck;
10
+ //# sourceMappingURL=fly010-machine-requires-image.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fly010-machine-requires-image.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/fly010-machine-requires-image.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAG9G,eAAO,MAAM,MAAM,EAAE,cA2BpB,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * FLY011: A machine mount must reference a declared volume.
3
+ *
4
+ * Every machine `config.mounts[].volume` must resolve to a `Volume` declared in
5
+ * the stack. A mount pointing at a volume that does not exist is rejected at
6
+ * apply time, so catch it at synth. This is a whole-stack check: it reads all
7
+ * entities in the build (`ctx.entities`), so the mount and the Volume can be
8
+ * declared in different files.
9
+ */
10
+ import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
11
+ export declare const fly011: PostSynthCheck;
12
+ //# sourceMappingURL=fly011-mount-references-declared-volume.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fly011-mount-references-declared-volume.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/fly011-mount-references-declared-volume.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAM9G,eAAO,MAAM,MAAM,EAAE,cA4CpB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
2
+ export declare const postSynthChecks: PostSynthCheck[];
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAIvE,eAAO,MAAM,eAAe,EAAE,cAAc,EAG3C,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { LintRule } from "@intentius/chant/lint/rule";
2
+ /**
3
+ * FLY002: Sane guest sizing
4
+ *
5
+ * A guest's `cpu_kind`, `cpus`, and `memory_mb` must be a valid combination per
6
+ * Fly's guest presets. An invalid combination is rejected at apply time.
7
+ */
8
+ export declare const guestSizingRule: LintRule;
9
+ //# sourceMappingURL=guest-sizing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guest-sizing.d.ts","sourceRoot":"","sources":["../../../src/lint/rules/guest-sizing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAA+B,MAAM,4BAA4B,CAAC;AAyCxF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,QAoD7B,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { LintRule } from "@intentius/chant/lint/rule";
2
+ export { validRegionRule } from "./valid-region.js";
3
+ export { guestSizingRule } from "./guest-sizing.js";
4
+ export { noSecretLiteralsRule } from "./no-secret-literals.js";
5
+ /** All lint rules provided by the fly lexicon. */
6
+ export declare const rules: LintRule[];
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lint/rules/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAK3D,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D,kDAAkD;AAClD,eAAO,MAAM,KAAK,EAAE,QAAQ,EAI3B,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { LintRule } from "@intentius/chant/lint/rule";
2
+ /**
3
+ * FLY004: No secret literals in machine config
4
+ *
5
+ * Flags secret values written inline in config (e.g. an env value under a
6
+ * credential-looking key). Secrets belong in `secrets` (apply-only) or a
7
+ * reference. The heuristic is conservative: it fires only when the property
8
+ * name looks like a credential AND the value is a plain string literal that is
9
+ * not a reference/placeholder, so a `secrets` reference (an identifier or
10
+ * `$FOO` placeholder) is not flagged.
11
+ */
12
+ export declare const noSecretLiteralsRule: LintRule;
13
+ //# sourceMappingURL=no-secret-literals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-secret-literals.d.ts","sourceRoot":"","sources":["../../../src/lint/rules/no-secret-literals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAA+B,MAAM,4BAA4B,CAAC;AAgBxF;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,EAAE,QAwClC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { LintRule } from "@intentius/chant/lint/rule";
2
+ /**
3
+ * FLY001: Valid Fly region
4
+ *
5
+ * A machine (or volume/IP) `region` must be a known Fly region code. An unknown
6
+ * region is rejected at apply time; catch it at build with a clearer message.
7
+ */
8
+ export declare const validRegionRule: LintRule;
9
+ //# sourceMappingURL=valid-region.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"valid-region.d.ts","sourceRoot":"","sources":["../../../src/lint/rules/valid-region.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAA+B,MAAM,4BAA4B,CAAC;AAoBxF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,QA+B7B,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { CompletionContext, CompletionItem } from "@intentius/chant/lsp/types";
2
+ /**
3
+ * Provide LSP completions for fly resources.
4
+ *
5
+ * TODO: Build a LexiconIndex from your generated lexicon data
6
+ * and delegate to lexiconCompletions().
7
+ */
8
+ export declare function completions(ctx: CompletionContext): CompletionItem[];
9
+ //# sourceMappingURL=completions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"completions.d.ts","sourceRoot":"","sources":["../../src/lsp/completions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAGpF;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,iBAAiB,GAAG,cAAc,EAAE,CAIpE"}
@@ -0,0 +1,9 @@
1
+ import type { HoverContext, HoverInfo } from "@intentius/chant/lsp/types";
2
+ /**
3
+ * Provide LSP hover information for fly resources.
4
+ *
5
+ * TODO: Build a LexiconIndex from your generated lexicon data
6
+ * and delegate to lexiconHover().
7
+ */
8
+ export declare function hover(ctx: HoverContext): HoverInfo | undefined;
9
+ //# sourceMappingURL=hover.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hover.d.ts","sourceRoot":"","sources":["../../src/lsp/hover.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAG1E;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,YAAY,GAAG,SAAS,GAAG,SAAS,CAI9D"}
@@ -0,0 +1,4 @@
1
+ {
2
+ "name": "fly",
3
+ "version": "0.0.1"
4
+ }
package/dist/meta.json ADDED
@@ -0,0 +1,285 @@
1
+ {
2
+ "App": {
3
+ "resourceType": "Fly::Machines::App",
4
+ "kind": "resource",
5
+ "lexicon": "fly"
6
+ },
7
+ "Certificate": {
8
+ "resourceType": "Fly::Machines::Certificate",
9
+ "kind": "resource",
10
+ "lexicon": "fly"
11
+ },
12
+ "ContainerConfig": {
13
+ "resourceType": "Fly::Machines::ContainerConfig",
14
+ "kind": "property",
15
+ "lexicon": "fly"
16
+ },
17
+ "ContainerDependency": {
18
+ "resourceType": "Fly::Machines::ContainerDependency",
19
+ "kind": "property",
20
+ "lexicon": "fly"
21
+ },
22
+ "ContainerHealthcheck": {
23
+ "resourceType": "Fly::Machines::ContainerHealthcheck",
24
+ "kind": "property",
25
+ "lexicon": "fly"
26
+ },
27
+ "DNSConfig": {
28
+ "resourceType": "Fly::Machines::DNSConfig",
29
+ "kind": "property",
30
+ "lexicon": "fly"
31
+ },
32
+ "DnsForwardRule": {
33
+ "resourceType": "Fly::Machines::DnsForwardRule",
34
+ "kind": "property",
35
+ "lexicon": "fly"
36
+ },
37
+ "DnsOption": {
38
+ "resourceType": "Fly::Machines::DnsOption",
39
+ "kind": "property",
40
+ "lexicon": "fly"
41
+ },
42
+ "EnvFrom": {
43
+ "resourceType": "Fly::Machines::EnvFrom",
44
+ "kind": "property",
45
+ "lexicon": "fly",
46
+ "constraints": {
47
+ "field_ref": {
48
+ "enum": [
49
+ "id",
50
+ "version",
51
+ "app_name",
52
+ "private_ip",
53
+ "region",
54
+ "image"
55
+ ]
56
+ }
57
+ }
58
+ },
59
+ "ExecHealthcheck": {
60
+ "resourceType": "Fly::Machines::ExecHealthcheck",
61
+ "kind": "property",
62
+ "lexicon": "fly"
63
+ },
64
+ "File": {
65
+ "resourceType": "Fly::Machines::File",
66
+ "kind": "property",
67
+ "lexicon": "fly"
68
+ },
69
+ "HTTPHealthcheck": {
70
+ "resourceType": "Fly::Machines::HTTPHealthcheck",
71
+ "kind": "property",
72
+ "lexicon": "fly"
73
+ },
74
+ "HTTPOptions": {
75
+ "resourceType": "Fly::Machines::HTTPOptions",
76
+ "kind": "property",
77
+ "lexicon": "fly"
78
+ },
79
+ "HTTPResponseOptions": {
80
+ "resourceType": "Fly::Machines::HTTPResponseOptions",
81
+ "kind": "property",
82
+ "lexicon": "fly"
83
+ },
84
+ "IPAddress": {
85
+ "resourceType": "Fly::Machines::IPAddress",
86
+ "kind": "resource",
87
+ "lexicon": "fly"
88
+ },
89
+ "Machine": {
90
+ "resourceType": "Fly::Machines::Machine",
91
+ "kind": "resource",
92
+ "lexicon": "fly"
93
+ },
94
+ "MachineCacheDrive": {
95
+ "resourceType": "Fly::Machines::MachineCacheDrive",
96
+ "kind": "property",
97
+ "lexicon": "fly"
98
+ },
99
+ "MachineCheck": {
100
+ "resourceType": "Fly::Machines::MachineCheck",
101
+ "kind": "property",
102
+ "lexicon": "fly",
103
+ "constraints": {
104
+ "kind": {
105
+ "enum": [
106
+ "informational",
107
+ "readiness"
108
+ ]
109
+ }
110
+ }
111
+ },
112
+ "MachineConfig": {
113
+ "resourceType": "Fly::Machines::MachineConfig",
114
+ "kind": "property",
115
+ "lexicon": "fly"
116
+ },
117
+ "MachineGuest": {
118
+ "resourceType": "Fly::Machines::MachineGuest",
119
+ "kind": "property",
120
+ "lexicon": "fly",
121
+ "constraints": {
122
+ "persist_rootfs": {
123
+ "enum": [
124
+ "never",
125
+ "always",
126
+ "restart"
127
+ ]
128
+ }
129
+ }
130
+ },
131
+ "MachineHTTPHeader": {
132
+ "resourceType": "Fly::Machines::MachineHTTPHeader",
133
+ "kind": "property",
134
+ "lexicon": "fly"
135
+ },
136
+ "MachineInit": {
137
+ "resourceType": "Fly::Machines::MachineInit",
138
+ "kind": "property",
139
+ "lexicon": "fly"
140
+ },
141
+ "MachineMetrics": {
142
+ "resourceType": "Fly::Machines::MachineMetrics",
143
+ "kind": "property",
144
+ "lexicon": "fly"
145
+ },
146
+ "MachineMount": {
147
+ "resourceType": "Fly::Machines::MachineMount",
148
+ "kind": "property",
149
+ "lexicon": "fly"
150
+ },
151
+ "MachinePort": {
152
+ "resourceType": "Fly::Machines::MachinePort",
153
+ "kind": "property",
154
+ "lexicon": "fly"
155
+ },
156
+ "MachineProcess": {
157
+ "resourceType": "Fly::Machines::MachineProcess",
158
+ "kind": "property",
159
+ "lexicon": "fly"
160
+ },
161
+ "MachineRestart": {
162
+ "resourceType": "Fly::Machines::MachineRestart",
163
+ "kind": "property",
164
+ "lexicon": "fly",
165
+ "constraints": {
166
+ "policy": {
167
+ "enum": [
168
+ "no",
169
+ "always",
170
+ "on-failure",
171
+ "spot-price"
172
+ ]
173
+ }
174
+ }
175
+ },
176
+ "MachineRootfs": {
177
+ "resourceType": "Fly::Machines::MachineRootfs",
178
+ "kind": "property",
179
+ "lexicon": "fly",
180
+ "constraints": {
181
+ "persist": {
182
+ "enum": [
183
+ "never",
184
+ "always",
185
+ "restart"
186
+ ]
187
+ }
188
+ }
189
+ },
190
+ "MachineSecret": {
191
+ "resourceType": "Fly::Machines::MachineSecret",
192
+ "kind": "property",
193
+ "lexicon": "fly"
194
+ },
195
+ "MachineService": {
196
+ "resourceType": "Fly::Machines::MachineService",
197
+ "kind": "property",
198
+ "lexicon": "fly",
199
+ "constraints": {
200
+ "autostop": {
201
+ "enum": [
202
+ "off",
203
+ "stop",
204
+ "suspend"
205
+ ]
206
+ }
207
+ }
208
+ },
209
+ "MachineServiceCheck": {
210
+ "resourceType": "Fly::Machines::MachineServiceCheck",
211
+ "kind": "property",
212
+ "lexicon": "fly"
213
+ },
214
+ "MachineServiceConcurrency": {
215
+ "resourceType": "Fly::Machines::MachineServiceConcurrency",
216
+ "kind": "property",
217
+ "lexicon": "fly"
218
+ },
219
+ "MachineSpot": {
220
+ "resourceType": "Fly::Machines::MachineSpot",
221
+ "kind": "property",
222
+ "lexicon": "fly"
223
+ },
224
+ "ProxyProtoOptions": {
225
+ "resourceType": "Fly::Machines::ProxyProtoOptions",
226
+ "kind": "property",
227
+ "lexicon": "fly"
228
+ },
229
+ "ReplayCache": {
230
+ "resourceType": "Fly::Machines::ReplayCache",
231
+ "kind": "property",
232
+ "lexicon": "fly",
233
+ "constraints": {
234
+ "type": {
235
+ "enum": [
236
+ "cookie",
237
+ "header"
238
+ ]
239
+ }
240
+ }
241
+ },
242
+ "Secret": {
243
+ "resourceType": "Fly::Machines::Secret",
244
+ "kind": "resource",
245
+ "lexicon": "fly"
246
+ },
247
+ "Static": {
248
+ "resourceType": "Fly::Machines::Static",
249
+ "kind": "property",
250
+ "lexicon": "fly"
251
+ },
252
+ "StopConfig": {
253
+ "resourceType": "Fly::Machines::StopConfig",
254
+ "kind": "property",
255
+ "lexicon": "fly",
256
+ "constraints": {
257
+ "signal": {
258
+ "enum": [
259
+ "SIGHUP",
260
+ "SIGINT",
261
+ "SIGQUIT",
262
+ "SIGKILL",
263
+ "SIGUSR1",
264
+ "SIGUSR2",
265
+ "SIGTERM"
266
+ ]
267
+ }
268
+ }
269
+ },
270
+ "TCPHealthcheck": {
271
+ "resourceType": "Fly::Machines::TCPHealthcheck",
272
+ "kind": "property",
273
+ "lexicon": "fly"
274
+ },
275
+ "TLSOptions": {
276
+ "resourceType": "Fly::Machines::TLSOptions",
277
+ "kind": "property",
278
+ "lexicon": "fly"
279
+ },
280
+ "Volume": {
281
+ "resourceType": "Fly::Machines::Volume",
282
+ "kind": "resource",
283
+ "lexicon": "fly"
284
+ }
285
+ }
@@ -0,0 +1,29 @@
1
+ export interface FlapsUpArgs {
2
+ /** Container name. Default: `chant-mudflaps`. */
3
+ name?: string;
4
+ /** Host port mapped to the emulator's `:4280`. Default: `4280`. */
5
+ port?: number;
6
+ /** Image. Default: `ghcr.io/intentius/mudflaps:0.3.0`. */
7
+ image?: string;
8
+ /** Readiness timeout in ms. Default: `60000`. */
9
+ timeoutMs?: number;
10
+ /** Health poll interval in ms. Default: `2000`. */
11
+ intervalMs?: number;
12
+ }
13
+ export interface FlapsDownArgs {
14
+ /** Container name to remove. Default: `chant-mudflaps`. */
15
+ name?: string;
16
+ }
17
+ export declare const flapsExistsCommand: (name: string) => string;
18
+ export declare const flapsRmCommand: (name: string) => string;
19
+ export declare const flapsHealthUrl: (port: number) => string;
20
+ /** The flaps endpoint URL (what `flyApply`'s `FLY_FLAPS_BASE_URL`/`endpoint` points at). */
21
+ export declare const flapsEndpoint: (port: number) => string;
22
+ export declare const flapsRunCommand: (args?: FlapsUpArgs) => string;
23
+ /** Boot a local mudflaps (Fly Machines API emulator) in Docker and return its endpoint. */
24
+ export declare const flapsUp: (args?: FlapsUpArgs, signal?: AbortSignal) => Promise<{
25
+ endpoint: string;
26
+ }>;
27
+ /** Stop and remove the local mudflaps container (no-op if already gone). */
28
+ export declare const flapsDown: (args?: FlapsDownArgs, signal?: AbortSignal) => Promise<void>;
29
+ //# sourceMappingURL=flaps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flaps.d.ts","sourceRoot":"","sources":["../../../src/op/activities/flaps.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,WAAW;IAC1B,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mDAAmD;IACnD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B,2DAA2D;IAC3D,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAYD,eAAO,MAAM,kBAAkB,0BAAsB,CAAC;AACtD,eAAO,MAAM,cAAc,0BAAkB,CAAC;AAC9C,eAAO,MAAM,cAAc,0BAAkB,CAAC;AAC9C,4FAA4F;AAC5F,eAAO,MAAM,aAAa,0BAAiB,CAAC;AAC5C,eAAO,MAAM,eAAe,GAAI,OAAM,WAAgB,KAAG,MAAgC,CAAC;AAE1F,2FAA2F;AAC3F,eAAO,MAAM,OAAO,GAAI,OAAM,WAAgB,EAAE,SAAS,WAAW,KAAG,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAC3E,CAAC;AAEzB,4EAA4E;AAC5E,eAAO,MAAM,SAAS,GAAI,OAAM,aAAkB,EAAE,SAAS,WAAW,KAAG,OAAO,CAAC,IAAI,CAC7D,CAAC"}