fjall 0.89.5 → 0.94.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 (108) hide show
  1. package/LICENSE +50 -21
  2. package/bin/.bundled +3 -0
  3. package/bin/.metafile.json +39155 -0
  4. package/bin/assets/generators/account/files/infrastructure.ts +17 -0
  5. package/bin/assets/generators/account/generator.d.ts +8 -0
  6. package/bin/assets/generators/account/generator.js +2 -0
  7. package/bin/assets/generators/account/index.d.ts +1 -0
  8. package/bin/assets/generators/account/index.js +1 -0
  9. package/bin/assets/generators/application/generator.d.ts +4 -0
  10. package/bin/assets/generators/application/generator.js +28 -0
  11. package/bin/assets/generators/application/index.d.ts +1 -0
  12. package/bin/assets/generators/application/index.js +1 -0
  13. package/bin/assets/generators/cdn/generator.d.ts +4 -0
  14. package/bin/assets/generators/cdn/generator.js +4 -0
  15. package/bin/assets/generators/cdn/index.d.ts +1 -0
  16. package/bin/assets/generators/cdn/index.js +1 -0
  17. package/bin/assets/generators/compute/computeIntegrationHelpers.d.ts +134 -0
  18. package/bin/assets/generators/compute/computeIntegrationHelpers.js +1 -0
  19. package/bin/assets/generators/compute/generator.d.ts +4 -0
  20. package/bin/assets/generators/compute/generator.js +1 -0
  21. package/bin/assets/generators/compute/index.d.ts +1 -0
  22. package/bin/assets/generators/compute/index.js +1 -0
  23. package/bin/assets/generators/compute/service/generator.d.ts +4 -0
  24. package/bin/assets/generators/compute/service/generator.js +1 -0
  25. package/bin/assets/generators/compute/service/index.d.ts +1 -0
  26. package/bin/assets/generators/compute/service/index.js +1 -0
  27. package/bin/assets/generators/database/databaseIntegrationTestUtils.d.ts +134 -0
  28. package/bin/assets/generators/database/databaseIntegrationTestUtils.js +1 -0
  29. package/bin/assets/generators/database/generator.d.ts +4 -0
  30. package/bin/assets/generators/database/generator.js +1 -0
  31. package/bin/assets/generators/database/index.d.ts +1 -0
  32. package/bin/assets/generators/database/index.js +1 -0
  33. package/bin/assets/generators/database/proxy/generator.d.ts +4 -0
  34. package/bin/assets/generators/database/proxy/generator.js +1 -0
  35. package/bin/assets/generators/database/proxy/index.d.ts +1 -0
  36. package/bin/assets/generators/database/proxy/index.js +1 -0
  37. package/bin/assets/generators/domain/files/infrastructure.ts.ejs +22 -0
  38. package/bin/assets/generators/domain/files/zone.bind.ejs +14 -0
  39. package/bin/assets/generators/domain/generator.d.ts +10 -0
  40. package/bin/assets/generators/domain/generator.js +2 -0
  41. package/bin/assets/generators/domain/index.d.ts +1 -0
  42. package/bin/assets/generators/domain/index.js +1 -0
  43. package/bin/assets/generators/messaging/index.d.ts +1 -0
  44. package/bin/assets/generators/messaging/index.js +0 -0
  45. package/bin/assets/generators/network/generator.d.ts +4 -0
  46. package/bin/assets/generators/network/generator.js +1 -0
  47. package/bin/assets/generators/network/index.d.ts +1 -0
  48. package/bin/assets/generators/network/index.js +1 -0
  49. package/bin/assets/generators/organisation/files/account/infrastructure.ts +25 -0
  50. package/bin/assets/generators/organisation/files/organisation/infrastructure.ts +46 -0
  51. package/bin/assets/generators/organisation/files/platform/infrastructure.ts +16 -0
  52. package/bin/assets/generators/organisation/generator.d.ts +4 -0
  53. package/bin/assets/generators/organisation/generator.js +2 -0
  54. package/bin/assets/generators/organisation/index.d.ts +1 -0
  55. package/bin/assets/generators/organisation/index.js +1 -0
  56. package/bin/assets/generators/shared/files/cdk.context.json +3 -0
  57. package/bin/assets/generators/shared/files/cdk.json +55 -0
  58. package/bin/assets/generators/shared/files/package.json +15 -0
  59. package/bin/assets/generators/shared/files/tsconfig.json +23 -0
  60. package/bin/assets/generators/storage/index.d.ts +1 -0
  61. package/bin/assets/generators/storage/index.js +1 -0
  62. package/bin/assets/generators/storage/s3/generator.d.ts +4 -0
  63. package/bin/assets/generators/storage/s3/generator.js +1 -0
  64. package/bin/assets/generators/tunnel/generator.d.ts +4 -0
  65. package/bin/assets/generators/tunnel/generator.js +1 -0
  66. package/bin/assets/generators/tunnel/index.d.ts +1 -0
  67. package/bin/assets/generators/tunnel/index.js +1 -0
  68. package/bin/assets/generators/utils/ast/astCodeModification.d.ts +23 -0
  69. package/bin/assets/generators/utils/ast/astCodeModification.js +1 -0
  70. package/bin/assets/generators/utils/ast/astDomainRewriter.d.ts +65 -0
  71. package/bin/assets/generators/utils/ast/astDomainRewriter.js +1 -0
  72. package/bin/assets/generators/utils/ast/astSurgicalModification.d.ts +2 -0
  73. package/bin/assets/generators/utils/ast/astSurgicalModification.js +1 -0
  74. package/bin/assets/generators/utils/ast/index.d.ts +3 -0
  75. package/bin/assets/generators/utils/ast/index.js +1 -0
  76. package/bin/assets/generators/utils/copySharedFiles.d.ts +10 -0
  77. package/bin/assets/generators/utils/copySharedFiles.js +1 -0
  78. package/bin/assets/generators/utils/index.d.ts +8 -0
  79. package/bin/assets/generators/utils/index.js +1 -0
  80. package/bin/assets/generators/utils/integrationTestUtils.d.ts +129 -0
  81. package/bin/assets/generators/utils/integrationTestUtils.js +2 -0
  82. package/bin/assets/generators/utils/mockTree.d.ts +30 -0
  83. package/bin/assets/generators/utils/mockTree.js +1 -0
  84. package/bin/assets/generators/utils/planning/generatorHelpers.d.ts +35 -0
  85. package/bin/assets/generators/utils/planning/generatorHelpers.js +2 -0
  86. package/bin/assets/generators/utils/planning/index.d.ts +1 -0
  87. package/bin/assets/generators/utils/planning/index.js +1 -0
  88. package/bin/assets/generators/utils/prompts.d.ts +4 -0
  89. package/bin/assets/generators/utils/prompts.js +6 -0
  90. package/bin/assets/generators/utils/renderEjs.d.ts +24 -0
  91. package/bin/assets/generators/utils/renderEjs.js +1 -0
  92. package/bin/assets/generators/utils/resources/connectionHelpers.d.ts +19 -0
  93. package/bin/assets/generators/utils/resources/connectionHelpers.js +1 -0
  94. package/bin/assets/generators/utils/resources/index.d.ts +4 -0
  95. package/bin/assets/generators/utils/resources/index.js +1 -0
  96. package/bin/assets/generators/utils/resources/promptValidation.d.ts +42 -0
  97. package/bin/assets/generators/utils/resources/promptValidation.js +1 -0
  98. package/bin/assets/generators/utils/resources/resourceDetection.d.ts +12 -0
  99. package/bin/assets/generators/utils/resources/resourceDetection.js +1 -0
  100. package/bin/assets/generators/utils/resources/resourceNaming.d.ts +6 -0
  101. package/bin/assets/generators/utils/resources/resourceNaming.js +1 -0
  102. package/bin/assets/generators/utils/tree.d.ts +25 -0
  103. package/bin/assets/generators/utils/tree.js +1 -0
  104. package/bin/assets/proto/buildkit.proto +126 -0
  105. package/bin/assets/proto/proto/buildkit.proto +126 -0
  106. package/bin/fjall.bundle.js +1138 -0
  107. package/bin/fjall.js +5 -1
  108. package/package.json +43 -6
@@ -0,0 +1 @@
1
+ import{applyServiceConnections as u,applyComputeConnections as s}from"@fjall/generator";import{promptForConnection as m,selectResources as f}from"../prompts.js";async function h(o,n,t,c,i){if(o.compute.length===0)return;if(n.connectionConfig){const{connectToCompute:e=[],connectToServices:r=[]}=n.connectionConfig;r.length>0&&u(o,r,t,c),e.length>0&&s(o,e,t,c);return}if(n.nameProvidedByFlag||!await m(o.compute.length,"compute resource",i.singularPrompt,i.pluralPrompt))return;const p=await f(o.compute,"Select compute resources to connect:",e=>e.type.toUpperCase());p.length>0&&s(o,p,t,c)}export{h as handleResourceConnections};
@@ -0,0 +1,4 @@
1
+ export { generateUniqueResourceName, getDefaultResourceName, getUniqueDefaultResourceName, ensureUniqueResourceName } from "./resourceNaming.js";
2
+ export { type ComputeResource, resourceExists, assertResourceNameUnique, countResourcesOfType, detectComputeResources, databaseExists } from "./resourceDetection.js";
3
+ export { validateOrganisationName, validatePort, validateResourceName, validateAppName, validateInstanceType, validateLambdaMemory, validateLambdaTimeout, validateCapacity, validateDatabaseName, validateMinMaxCapacity } from "./promptValidation.js";
4
+ export { handleResourceConnections } from "./connectionHelpers.js";
@@ -0,0 +1 @@
1
+ import{generateUniqueResourceName as t,getDefaultResourceName as o,getUniqueDefaultResourceName as r,ensureUniqueResourceName as s}from"./resourceNaming.js";import{resourceExists as u,assertResourceNameUnique as m,countResourcesOfType as c,detectComputeResources as n,databaseExists as d}from"./resourceDetection.js";import{validateOrganisationName as p,validatePort as v,validateResourceName as N,validateAppName as R,validateInstanceType as f,validateLambdaMemory as x,validateLambdaTimeout as y,validateCapacity as b,validateDatabaseName as g,validateMinMaxCapacity as q}from"./promptValidation.js";import{handleResourceConnections as U}from"./connectionHelpers.js";export{m as assertResourceNameUnique,c as countResourcesOfType,d as databaseExists,n as detectComputeResources,s as ensureUniqueResourceName,t as generateUniqueResourceName,o as getDefaultResourceName,r as getUniqueDefaultResourceName,U as handleResourceConnections,u as resourceExists,R as validateAppName,b as validateCapacity,g as validateDatabaseName,f as validateInstanceType,x as validateLambdaMemory,y as validateLambdaTimeout,q as validateMinMaxCapacity,p as validateOrganisationName,v as validatePort,N as validateResourceName};
@@ -0,0 +1,42 @@
1
+ import { type Tree } from "@nx/devkit";
2
+ /**
3
+ * Validation function for organisation names
4
+ */
5
+ export declare const validateOrganisationName: (value: string) => true | string;
6
+ /**
7
+ * Validation function for port numbers in prompts
8
+ */
9
+ export declare const validatePort: (value: string | number) => true | string;
10
+ /**
11
+ * Validation function for resource names in prompts
12
+ * Checks both format and uniqueness
13
+ */
14
+ export declare const validateResourceName: (value: string, tree: Tree, appName: string) => true | string;
15
+ /**
16
+ * Validation function for application names in prompts
17
+ */
18
+ export declare const validateAppName: (value: string) => true | string;
19
+ /**
20
+ * Validation function for EC2 instance types in prompts
21
+ */
22
+ export declare const validateInstanceType: (value: string) => true | string;
23
+ /**
24
+ * Validation function for Lambda memory in prompts
25
+ */
26
+ export declare const validateLambdaMemory: (value: string | number) => true | string;
27
+ /**
28
+ * Validation function for Lambda timeout in prompts
29
+ */
30
+ export declare const validateLambdaTimeout: (value: string | number) => true | string;
31
+ /**
32
+ * Validation function for ECS capacity settings
33
+ */
34
+ export declare const validateCapacity: (value: string | number, min?: number, max?: number) => true | string;
35
+ /**
36
+ * Validation function for database names
37
+ */
38
+ export declare const validateDatabaseName: (value: string) => true | string;
39
+ /**
40
+ * Validation function for ensuring min capacity is less than max capacity
41
+ */
42
+ export declare const validateMinMaxCapacity: (minCapacity: number, maxCapacity: number) => true | string;
@@ -0,0 +1 @@
1
+ import{PortSchema as u,ResourceNameSchema as m,InstanceTypeSchema as p,AppNameSchema as f,OrganisationNameSchema as M,DatabaseNameSchema as d,getZodErrorMessage as a,MIN_LAMBDA_MEMORY as n,MAX_LAMBDA_MEMORY as o,MIN_LAMBDA_TIMEOUT as c,MAX_LAMBDA_TIMEOUT as i}from"@fjall/generator";import{resourceExists as y}from"./resourceDetection.js";const x=t=>{const e=M.safeParse(t);return e.success?!0:a(e.error)},l=t=>{const e=typeof t=="string"?parseInt(t,10):t,r=u.safeParse(e);return r.success?!0:a(r.error)},A=(t,e,r)=>{const s=m.safeParse(t);return s.success?y(e,r,t)?`Resource "${t}" already exists in this application`:!0:a(s.error)},T=t=>{const e=f.safeParse(t);return e.success?!0:a(e.error)},$=t=>{const e=p.safeParse(t);return e.success?!0:a(e.error)},h=t=>{const e=typeof t=="string"?parseInt(t,10):t;if(isNaN(e))return"Memory must be a number";if(e<n)return`Memory must be at least ${n} MB`;if(e>o)return`Memory cannot exceed ${o} MB`;if(e>128&&e%64!==0){const r=Math.floor(e/64)*64,s=Math.ceil(e/64)*64;return`Memory must be in 64 MB increments. Try ${r} or ${s}`}return!0},I=t=>{const e=typeof t=="string"?parseInt(t,10):t;return isNaN(e)?"Timeout must be a number":e<c?`Timeout must be at least ${c} seconds`:e>i?`Timeout cannot exceed ${i} seconds (15 minutes)`:!0},g=(t,e=1,r=1e3)=>{const s=typeof t=="string"?parseInt(t,10):t;return isNaN(s)?"Capacity must be a number":s<e?`Capacity must be at least ${e}`:s>r?`Capacity cannot exceed ${r}`:!0},P=t=>{const e=t?.trim()??"",r=d.safeParse(e);return r.success?!0:a(r.error)},_=(t,e)=>t>e?`Minimum capacity (${t}) cannot be greater than maximum capacity (${e})`:!0;export{T as validateAppName,g as validateCapacity,P as validateDatabaseName,$ as validateInstanceType,h as validateLambdaMemory,I as validateLambdaTimeout,_ as validateMinMaxCapacity,x as validateOrganisationName,l as validatePort,A as validateResourceName};
@@ -0,0 +1,12 @@
1
+ import { type Tree } from "@nx/devkit";
2
+ export interface ComputeResource {
3
+ name: string;
4
+ type: "ecs" | "lambda" | "ec2";
5
+ hasConnections: boolean;
6
+ connectedResources: string[];
7
+ }
8
+ export declare function resourceExists(tree: Tree, appName: string, resourceName: string): boolean;
9
+ export declare function assertResourceNameUnique(tree: Tree, appName: string, resourceName: string): void;
10
+ export declare function countResourcesOfType(tree: Tree, appName: string, resourceType: "database" | "compute" | "lambda" | "ecs" | "ec2"): number;
11
+ export declare function detectComputeResources(tree: Tree, appName: string): ComputeResource[];
12
+ export declare function databaseExists(tree: Tree, appName: string, databaseName: string): boolean;
@@ -0,0 +1 @@
1
+ import{getInfrastructurePath as o}from"../../../src/util/pathHelpers.js";function l(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function m(t,e,r){const s=o(e),n=t.read(s)?.toString();return n?new RegExp(`["']${l(r)}["']`).test(n):!1}function y(t,e,r){const s=o(e);if(!t.read(s)?.toString())throw new Error(`Infrastructure file not found for ${e}`);if(m(t,e,r))throw new Error(`Resource name '${r}' already exists in ${e}. Please choose a different name or remove the existing resource first.`)}function P(t,e,r){const s=o(e),n=t.read(s)?.toString();if(!n)return 0;const c={database:/DatabaseFactory\.build\(/g,compute:/ComputeFactory\.build\(/g,lambda:/type:\s*["']lambda["']/g,ecs:/type:\s*["']ecs["']/g,ec2:/type:\s*["']ec2["']/g}[r];if(!c)return 0;const u=n.match(c);return u?u.length:0}function R(t,e){const r=o(e),s=t.read(r)?.toString();if(!s)return[];const n=[],a=s.matchAll(/ComputeFactory\.build\(["']([^"']+)["'],\s*\{([^}]*?)\}/gs);for(const c of a){const u=c[1],i=c[2];let f="ecs";i.includes('type: "lambda"')?f="lambda":i.includes('type: "ec2"')&&(f="ec2");const d=i.includes("connections:"),h=[];if(d){const p=i.match(/connections:\s*\[([^\]]+)\]/);if(p){const g=p[1].match(/\w+/g)??[];h.push(...g)}}n.push({name:u,type:f,hasConnections:d,connectedResources:h})}return n}function w(t,e,r){const s=o(e),n=t.read(s)?.toString();return n?new RegExp(`databaseName:\\s*["']${l(r)}["']`).test(n):!1}export{y as assertResourceNameUnique,P as countResourcesOfType,w as databaseExists,R as detectComputeResources,m as resourceExists};
@@ -0,0 +1,6 @@
1
+ import { type Tree } from "@nx/devkit";
2
+ import { DEFAULTS } from "@fjall/generator";
3
+ export declare function generateUniqueResourceName(tree: Tree, appName: string, baseResourceName: string, resourceType: "database" | "compute" | "lambda" | "ecs" | "ec2"): string;
4
+ export declare function getDefaultResourceName(appName: string, resourceType: keyof typeof DEFAULTS.RESOURCE_SUFFIXES): string;
5
+ export declare function getUniqueDefaultResourceName(tree: Tree, appName: string, resourceType: keyof typeof DEFAULTS.RESOURCE_SUFFIXES): string;
6
+ export declare function ensureUniqueResourceName(tree: Tree, appName: string, proposedName: string): string;
@@ -0,0 +1 @@
1
+ import{assertResourceNameUnique as $,countResourcesOfType as a,resourceExists as s}from"./resourceDetection.js";import{DEFAULTS as E}from"@fjall/generator";const i=1e3;function x(r,n,t,e){if(a(r,n,e)===0)return t;for(let u=2;u<=i;u++){const o=`${t}${u}`;try{return $(r,n,o),o}catch{}}return`${t}${i}`}function m(r,n){const t=E.RESOURCE_SUFFIXES[n];return`${r}${t}`}function T(r,n,t){const e=m(n,t);if(!s(r,n,e))return e;for(let c=2;c<=i;c++){const u=`${e}${c}`;if(!s(r,n,u))return u}return`${e}${i}`}function l(r,n,t){if(!s(r,n,t))return t;const e=t.match(/^(.+?)(\d*)$/);if(!e)return t;const c=e[1],u=e[2]?parseInt(e[2],10)+1:2;for(let o=u;o<=u+i;o++){const f=`${c}${o}`;if(!s(r,n,f))return f}return`${c}${u+i}`}export{l as ensureUniqueResourceName,x as generateUniqueResourceName,m as getDefaultResourceName,T as getUniqueDefaultResourceName};
@@ -0,0 +1,25 @@
1
+ import { type Tree, type FileChange } from "@nx/devkit";
2
+ import type { Mode } from "fs";
3
+ /**
4
+ * File system tree implementation that implements the full Nx Tree interface
5
+ *
6
+ * Provides direct filesystem operations for use in integration tests and deploy tests.
7
+ * Supports optional path rewriting for test isolation (e.g., redirecting fjall/ to fjall-deploy-tests/).
8
+ */
9
+ export declare class FileSystemTree implements Tree {
10
+ readonly root: string;
11
+ private pathRewriter?;
12
+ private changes;
13
+ constructor(rootPath: string, pathRewriter?: (filePath: string) => string);
14
+ private resolvePath;
15
+ read(filePath: string): Buffer | null;
16
+ read(filePath: string, encoding: BufferEncoding): string | null;
17
+ write(filePath: string, content: string | Buffer): void;
18
+ exists(filePath: string): boolean;
19
+ delete(filePath: string): void;
20
+ rename(from: string, to: string): void;
21
+ isFile(filePath: string): boolean;
22
+ children(dirPath: string): string[];
23
+ listChanges(): FileChange[];
24
+ changePermissions(filePath: string, mode: Mode): void;
25
+ }
@@ -0,0 +1 @@
1
+ import{existsSync as s,readFileSync as h,writeFileSync as c,mkdirSync as o,rmSync as l,renameSync as u,statSync as f,readdirSync as m,chmodSync as P}from"fs";import{join as v,dirname as a}from"path";class S{root;pathRewriter;changes=new Map;constructor(t,e){this.root=t,this.pathRewriter=e}resolvePath(t){const e=this.pathRewriter?this.pathRewriter(t):t;return v(this.root,e)}read(t,e){const r=this.resolvePath(t);return s(r)?e?h(r,e):h(r):null}write(t,e){const r=this.resolvePath(t),i=a(r);s(i)||o(i,{recursive:!0});const n=s(r);c(r,e),this.changes.set(t,{path:t,type:n?"UPDATE":"CREATE",content:Buffer.isBuffer(e)?e:Buffer.from(e)})}exists(t){return s(this.resolvePath(t))}delete(t){const e=this.resolvePath(t);s(e)&&(l(e,{recursive:!0,force:!0}),this.changes.set(t,{path:t,type:"DELETE",content:null}))}rename(t,e){const r=this.resolvePath(t),i=this.resolvePath(e);if(!s(r))return;const n=a(i);s(n)||o(n,{recursive:!0}),u(r,i)}isFile(t){const e=this.resolvePath(t);return s(e)?f(e).isFile():!1}children(t){const e=this.resolvePath(t);if(!s(e))return[];try{return m(e)}catch{return[]}}listChanges(){return Array.from(this.changes.values())}changePermissions(t,e){const r=this.resolvePath(t);s(r)&&P(r,e)}}export{S as FileSystemTree};
@@ -0,0 +1,126 @@
1
+ // Simplified BuildKit StatusResponse schema
2
+ // Source: https://github.com/moby/buildkit/blob/master/api/services/control/control.proto
3
+ // Only includes types needed for decoding build progress
4
+
5
+ syntax = "proto3";
6
+
7
+ package moby.buildkit.v1;
8
+
9
+ import "google/protobuf/timestamp.proto";
10
+
11
+ // StatusResponse is the response from the Status RPC
12
+ // This is what Docker sends in the aux field of build events
13
+ message StatusResponse {
14
+ repeated Vertex vertexes = 1;
15
+ repeated VertexStatus statuses = 2;
16
+ repeated VertexLog logs = 3;
17
+ repeated VertexWarning warnings = 4;
18
+ }
19
+
20
+ // Vertex represents a node in the build graph
21
+ message Vertex {
22
+ string digest = 1;
23
+ repeated string inputs = 2;
24
+ string name = 3;
25
+ bool cached = 4;
26
+ google.protobuf.Timestamp started = 5;
27
+ google.protobuf.Timestamp completed = 6;
28
+ string error = 7;
29
+ ProgressGroup progressGroup = 8;
30
+ }
31
+
32
+ // VertexStatus represents progress of a vertex
33
+ message VertexStatus {
34
+ string ID = 1;
35
+ string vertex = 2;
36
+ string name = 3;
37
+ int64 current = 4;
38
+ int64 total = 5;
39
+ google.protobuf.Timestamp timestamp = 6;
40
+ google.protobuf.Timestamp started = 7;
41
+ google.protobuf.Timestamp completed = 8;
42
+ }
43
+
44
+ // VertexLog is a log message from a vertex
45
+ message VertexLog {
46
+ string vertex = 1;
47
+ google.protobuf.Timestamp timestamp = 2;
48
+ int64 stream = 3; // 1 = stdout, 2 = stderr
49
+ bytes msg = 4;
50
+ }
51
+
52
+ // VertexWarning is a warning from a vertex
53
+ message VertexWarning {
54
+ string vertex = 1;
55
+ int64 level = 2;
56
+ bytes short = 3;
57
+ repeated bytes detail = 4;
58
+ string url = 5;
59
+ SourceInfo info = 6;
60
+ repeated Range ranges = 7;
61
+ }
62
+
63
+ // ProgressGroup for grouping related vertices
64
+ message ProgressGroup {
65
+ string id = 1;
66
+ string name = 2;
67
+ bool weak = 3;
68
+ }
69
+
70
+ // SourceInfo provides source location for warnings
71
+ message SourceInfo {
72
+ string filename = 1;
73
+ bytes data = 2;
74
+ Definition definition = 3;
75
+ string language = 4;
76
+ }
77
+
78
+ // Range specifies a range in source
79
+ message Range {
80
+ Position start = 1;
81
+ Position end = 2;
82
+ }
83
+
84
+ // Position in source
85
+ message Position {
86
+ int32 line = 1;
87
+ int32 character = 2;
88
+ }
89
+
90
+ // Definition for source info
91
+ message Definition {
92
+ repeated bytes def = 1;
93
+ map<string, OpMetadata> metadata = 2;
94
+ Source Source = 3;
95
+ }
96
+
97
+ // OpMetadata for operation metadata
98
+ message OpMetadata {
99
+ bool ignore_cache = 1;
100
+ map<string, string> description = 2;
101
+ WorkerConstraint export_cache = 4;
102
+ map<string, bytes> caps = 5;
103
+ ProgressGroup progress_group = 6;
104
+ }
105
+
106
+ // WorkerConstraint for cache export
107
+ message WorkerConstraint {
108
+ repeated string filter = 1;
109
+ }
110
+
111
+ // Source information
112
+ message Source {
113
+ map<string, Locations> locations = 1;
114
+ repeated SourceInfo infos = 2;
115
+ }
116
+
117
+ // Locations in source
118
+ message Locations {
119
+ repeated Location locations = 1;
120
+ }
121
+
122
+ // Location in source
123
+ message Location {
124
+ int32 sourceIndex = 1;
125
+ repeated Range ranges = 2;
126
+ }
@@ -0,0 +1,126 @@
1
+ // Simplified BuildKit StatusResponse schema
2
+ // Source: https://github.com/moby/buildkit/blob/master/api/services/control/control.proto
3
+ // Only includes types needed for decoding build progress
4
+
5
+ syntax = "proto3";
6
+
7
+ package moby.buildkit.v1;
8
+
9
+ import "google/protobuf/timestamp.proto";
10
+
11
+ // StatusResponse is the response from the Status RPC
12
+ // This is what Docker sends in the aux field of build events
13
+ message StatusResponse {
14
+ repeated Vertex vertexes = 1;
15
+ repeated VertexStatus statuses = 2;
16
+ repeated VertexLog logs = 3;
17
+ repeated VertexWarning warnings = 4;
18
+ }
19
+
20
+ // Vertex represents a node in the build graph
21
+ message Vertex {
22
+ string digest = 1;
23
+ repeated string inputs = 2;
24
+ string name = 3;
25
+ bool cached = 4;
26
+ google.protobuf.Timestamp started = 5;
27
+ google.protobuf.Timestamp completed = 6;
28
+ string error = 7;
29
+ ProgressGroup progressGroup = 8;
30
+ }
31
+
32
+ // VertexStatus represents progress of a vertex
33
+ message VertexStatus {
34
+ string ID = 1;
35
+ string vertex = 2;
36
+ string name = 3;
37
+ int64 current = 4;
38
+ int64 total = 5;
39
+ google.protobuf.Timestamp timestamp = 6;
40
+ google.protobuf.Timestamp started = 7;
41
+ google.protobuf.Timestamp completed = 8;
42
+ }
43
+
44
+ // VertexLog is a log message from a vertex
45
+ message VertexLog {
46
+ string vertex = 1;
47
+ google.protobuf.Timestamp timestamp = 2;
48
+ int64 stream = 3; // 1 = stdout, 2 = stderr
49
+ bytes msg = 4;
50
+ }
51
+
52
+ // VertexWarning is a warning from a vertex
53
+ message VertexWarning {
54
+ string vertex = 1;
55
+ int64 level = 2;
56
+ bytes short = 3;
57
+ repeated bytes detail = 4;
58
+ string url = 5;
59
+ SourceInfo info = 6;
60
+ repeated Range ranges = 7;
61
+ }
62
+
63
+ // ProgressGroup for grouping related vertices
64
+ message ProgressGroup {
65
+ string id = 1;
66
+ string name = 2;
67
+ bool weak = 3;
68
+ }
69
+
70
+ // SourceInfo provides source location for warnings
71
+ message SourceInfo {
72
+ string filename = 1;
73
+ bytes data = 2;
74
+ Definition definition = 3;
75
+ string language = 4;
76
+ }
77
+
78
+ // Range specifies a range in source
79
+ message Range {
80
+ Position start = 1;
81
+ Position end = 2;
82
+ }
83
+
84
+ // Position in source
85
+ message Position {
86
+ int32 line = 1;
87
+ int32 character = 2;
88
+ }
89
+
90
+ // Definition for source info
91
+ message Definition {
92
+ repeated bytes def = 1;
93
+ map<string, OpMetadata> metadata = 2;
94
+ Source Source = 3;
95
+ }
96
+
97
+ // OpMetadata for operation metadata
98
+ message OpMetadata {
99
+ bool ignore_cache = 1;
100
+ map<string, string> description = 2;
101
+ WorkerConstraint export_cache = 4;
102
+ map<string, bytes> caps = 5;
103
+ ProgressGroup progress_group = 6;
104
+ }
105
+
106
+ // WorkerConstraint for cache export
107
+ message WorkerConstraint {
108
+ repeated string filter = 1;
109
+ }
110
+
111
+ // Source information
112
+ message Source {
113
+ map<string, Locations> locations = 1;
114
+ repeated SourceInfo infos = 2;
115
+ }
116
+
117
+ // Locations in source
118
+ message Locations {
119
+ repeated Location locations = 1;
120
+ }
121
+
122
+ // Location in source
123
+ message Location {
124
+ int32 sourceIndex = 1;
125
+ repeated Range ranges = 2;
126
+ }