@altf4llc/vorpal-sdk 0.1.0-alpha.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 (61) hide show
  1. package/dist/api/agent/agent.d.ts +68 -0
  2. package/dist/api/agent/agent.d.ts.map +1 -0
  3. package/dist/api/agent/agent.js +246 -0
  4. package/dist/api/agent/agent.js.map +1 -0
  5. package/dist/api/archive/archive.d.ts +98 -0
  6. package/dist/api/archive/archive.d.ts.map +1 -0
  7. package/dist/api/archive/archive.js +288 -0
  8. package/dist/api/archive/archive.js.map +1 -0
  9. package/dist/api/artifact/artifact.d.ts +169 -0
  10. package/dist/api/artifact/artifact.d.ts.map +1 -0
  11. package/dist/api/artifact/artifact.js +1041 -0
  12. package/dist/api/artifact/artifact.js.map +1 -0
  13. package/dist/api/context/context.d.ts +42 -0
  14. package/dist/api/context/context.d.ts.map +1 -0
  15. package/dist/api/context/context.js +31 -0
  16. package/dist/api/context/context.js.map +1 -0
  17. package/dist/api/worker/worker.d.ts +65 -0
  18. package/dist/api/worker/worker.d.ts.map +1 -0
  19. package/dist/api/worker/worker.js +185 -0
  20. package/dist/api/worker/worker.js.map +1 -0
  21. package/dist/artifact/language/go.d.ts +165 -0
  22. package/dist/artifact/language/go.d.ts.map +1 -0
  23. package/dist/artifact/language/go.js +361 -0
  24. package/dist/artifact/language/go.js.map +1 -0
  25. package/dist/artifact/language/rust.d.ts +136 -0
  26. package/dist/artifact/language/rust.d.ts.map +1 -0
  27. package/dist/artifact/language/rust.js +576 -0
  28. package/dist/artifact/language/rust.js.map +1 -0
  29. package/dist/artifact/language/typescript.d.ts +112 -0
  30. package/dist/artifact/language/typescript.d.ts.map +1 -0
  31. package/dist/artifact/language/typescript.js +232 -0
  32. package/dist/artifact/language/typescript.js.map +1 -0
  33. package/dist/artifact/step.d.ts +28 -0
  34. package/dist/artifact/step.d.ts.map +1 -0
  35. package/dist/artifact/step.js +214 -0
  36. package/dist/artifact/step.js.map +1 -0
  37. package/dist/artifact.d.ts +392 -0
  38. package/dist/artifact.d.ts.map +1 -0
  39. package/dist/artifact.js +938 -0
  40. package/dist/artifact.js.map +1 -0
  41. package/dist/cli.d.ts +42 -0
  42. package/dist/cli.d.ts.map +1 -0
  43. package/dist/cli.js +112 -0
  44. package/dist/cli.js.map +1 -0
  45. package/dist/context.d.ts +169 -0
  46. package/dist/context.d.ts.map +1 -0
  47. package/dist/context.js +779 -0
  48. package/dist/context.js.map +1 -0
  49. package/dist/index.d.ts +16 -0
  50. package/dist/index.d.ts.map +1 -0
  51. package/dist/index.js +22 -0
  52. package/dist/index.js.map +1 -0
  53. package/dist/system.d.ts +20 -0
  54. package/dist/system.d.ts.map +1 -0
  55. package/dist/system.js +76 -0
  56. package/dist/system.js.map +1 -0
  57. package/dist/vorpal.d.ts +2 -0
  58. package/dist/vorpal.d.ts.map +1 -0
  59. package/dist/vorpal.js +148 -0
  60. package/dist/vorpal.js.map +1 -0
  61. package/package.json +55 -0
@@ -0,0 +1,112 @@
1
+ import type { ArtifactSystem } from "../../api/artifact/artifact.js";
2
+ import type { ConfigContext } from "../../context.js";
3
+ export declare class TypeScript {
4
+ private _aliases;
5
+ private _artifacts;
6
+ private _entrypoint;
7
+ private _environments;
8
+ private _includes;
9
+ private _name;
10
+ private _secrets;
11
+ private _sourceScripts;
12
+ private _systems;
13
+ private _workingDir;
14
+ constructor(name: string, systems: ArtifactSystem[]);
15
+ withAliases(aliases: string[]): this;
16
+ /**
17
+ * Adds artifact dependencies that will be available during the build step.
18
+ */
19
+ withArtifacts(artifacts: string[]): this;
20
+ /**
21
+ * Sets the entrypoint TypeScript file for the project.
22
+ * When set, the builder produces a compiled binary (binary mode).
23
+ * When not set (default), the builder produces a library package (library mode).
24
+ */
25
+ withEntrypoint(entrypoint: string): this;
26
+ /**
27
+ * Sets environment variables for the build step.
28
+ * Format: "KEY=VALUE"
29
+ */
30
+ withEnvironments(environments: string[]): this;
31
+ /**
32
+ * Sets file patterns to include in the source.
33
+ */
34
+ withIncludes(includes: string[]): this;
35
+ /**
36
+ * Adds secrets available during the build step.
37
+ *
38
+ * @param secrets - Map of secret name to value
39
+ */
40
+ withSecrets(secrets: Map<string, string>): this;
41
+ /**
42
+ * Adds scripts to run inside the source directory before the build.
43
+ * Multiple scripts are joined with newlines and run in order.
44
+ * Duplicates are ignored.
45
+ */
46
+ withSourceScripts(scripts: string[]): this;
47
+ /**
48
+ * Sets the working directory within the source. When set, the build
49
+ * runs inside `./source/{name}/{workingDir}` instead of `./source/{name}`.
50
+ */
51
+ withWorkingDir(dir: string): this;
52
+ /**
53
+ * Builds the TypeScript project artifact.
54
+ *
55
+ * When entrypoint is set (binary mode):
56
+ * - Compiles to standalone binary via `bun build --compile`
57
+ * - Output at `$VORPAL_OUTPUT/bin/{name}`
58
+ *
59
+ * When entrypoint is undefined (library mode):
60
+ * - Builds via `bun x tsc --project tsconfig.json --outDir dist`
61
+ * - Copies `package.json`, `dist/`, `node_modules/` to `$VORPAL_OUTPUT/`
62
+ *
63
+ * @returns The artifact digest string
64
+ */
65
+ build(context: ConfigContext): Promise<string>;
66
+ }
67
+ /**
68
+ * Builder for TypeScript development environment artifacts.
69
+ *
70
+ * Wraps {@link DevelopmentEnvironment} to provide a TypeScript-specific
71
+ * development environment with Bun pre-configured. This is the simplest
72
+ * of the language-specific development environment builders -- it includes
73
+ * only the Bun runtime as a default tool and requires no special
74
+ * environment variables.
75
+ *
76
+ * Usage:
77
+ * ```typescript
78
+ * const digest = await new TypeScriptDevelopmentEnvironment("example-shell", SYSTEMS)
79
+ * .build(context);
80
+ * ```
81
+ */
82
+ export declare class TypeScriptDevelopmentEnvironment {
83
+ private _artifacts;
84
+ private _environments;
85
+ private _name;
86
+ private _secrets;
87
+ private _systems;
88
+ constructor(name: string, systems: ArtifactSystem[]);
89
+ /**
90
+ * Adds extra artifact dependencies beyond the default Bun tooling.
91
+ * These are appended to the default artifacts, not replacing them.
92
+ */
93
+ withArtifacts(artifacts: string[]): this;
94
+ /**
95
+ * Adds extra environment variables beyond what DevelopmentEnvironment provides.
96
+ * Format: "KEY=VALUE".
97
+ */
98
+ withEnvironments(environments: string[]): this;
99
+ /** Adds secrets available during the environment build step. */
100
+ withSecrets(secrets: Map<string, string>): this;
101
+ /**
102
+ * Builds the TypeScript development environment artifact.
103
+ *
104
+ * Default artifacts fetched:
105
+ * - bun (Bun runtime)
106
+ *
107
+ * No default environment variables beyond what DevelopmentEnvironment provides.
108
+ * Bun does not require special env vars like Go or Rust do.
109
+ */
110
+ build(context: ConfigContext): Promise<string>;
111
+ }
112
+ //# sourceMappingURL=typescript.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../../src/artifact/language/typescript.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACf,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAYtD,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAgB;IAChC,OAAO,CAAC,UAAU,CAAgB;IAClC,OAAO,CAAC,WAAW,CAAiC;IACpD,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,SAAS,CAAgB;IACjC,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,QAAQ,CAAkC;IAClD,OAAO,CAAC,cAAc,CAAgB;IACtC,OAAO,CAAC,QAAQ,CAAmB;IACnC,OAAO,CAAC,WAAW,CAAiC;gBAExC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE;IAKnD,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;IAKpC;;OAEG;IACH,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI;IAKxC;;;;OAIG;IACH,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAKxC;;;OAGG;IACH,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,IAAI;IAK9C;;OAEG;IACH,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI;IAKtC;;;;OAIG;IACH,WAAW,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;IAS/C;;;;OAIG;IACH,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;IAS1C;;;OAGG;IACH,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAKjC;;;;;;;;;;;;OAYG;IACG,KAAK,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;CAyErD;AAMD;;;;;;;;;;;;;;GAcG;AACH,qBAAa,gCAAgC;IAC3C,OAAO,CAAC,UAAU,CAAgB;IAClC,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,QAAQ,CAAkC;IAClD,OAAO,CAAC,QAAQ,CAAmB;gBAEvB,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE;IAKnD;;;OAGG;IACH,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI;IAKxC;;;OAGG;IACH,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,IAAI;IAK9C,gEAAgE;IAChE,WAAW,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;IAS/C;;;;;;;;OAQG;IACG,KAAK,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;CAerD"}
@@ -0,0 +1,232 @@
1
+ import { Artifact, ArtifactSource, DevelopmentEnvironment, getEnvKey, secretsToProto, } from "../../artifact.js";
2
+ import { shell } from "../step.js";
3
+ const DEFAULT_BUN_ALIAS = "bun:1.3.10";
4
+ export class TypeScript {
5
+ _aliases = [];
6
+ _artifacts = [];
7
+ _entrypoint = undefined;
8
+ _environments = [];
9
+ _includes = [];
10
+ _name;
11
+ _secrets = new Map();
12
+ _sourceScripts = [];
13
+ _systems;
14
+ _workingDir = undefined;
15
+ constructor(name, systems) {
16
+ this._name = name;
17
+ this._systems = systems;
18
+ }
19
+ withAliases(aliases) {
20
+ this._aliases = aliases;
21
+ return this;
22
+ }
23
+ /**
24
+ * Adds artifact dependencies that will be available during the build step.
25
+ */
26
+ withArtifacts(artifacts) {
27
+ this._artifacts = artifacts;
28
+ return this;
29
+ }
30
+ /**
31
+ * Sets the entrypoint TypeScript file for the project.
32
+ * When set, the builder produces a compiled binary (binary mode).
33
+ * When not set (default), the builder produces a library package (library mode).
34
+ */
35
+ withEntrypoint(entrypoint) {
36
+ this._entrypoint = entrypoint;
37
+ return this;
38
+ }
39
+ /**
40
+ * Sets environment variables for the build step.
41
+ * Format: "KEY=VALUE"
42
+ */
43
+ withEnvironments(environments) {
44
+ this._environments = environments;
45
+ return this;
46
+ }
47
+ /**
48
+ * Sets file patterns to include in the source.
49
+ */
50
+ withIncludes(includes) {
51
+ this._includes = includes;
52
+ return this;
53
+ }
54
+ /**
55
+ * Adds secrets available during the build step.
56
+ *
57
+ * @param secrets - Map of secret name to value
58
+ */
59
+ withSecrets(secrets) {
60
+ for (const [k, v] of secrets) {
61
+ if (!this._secrets.has(k)) {
62
+ this._secrets.set(k, v);
63
+ }
64
+ }
65
+ return this;
66
+ }
67
+ /**
68
+ * Adds scripts to run inside the source directory before the build.
69
+ * Multiple scripts are joined with newlines and run in order.
70
+ * Duplicates are ignored.
71
+ */
72
+ withSourceScripts(scripts) {
73
+ for (const script of scripts) {
74
+ if (!this._sourceScripts.includes(script)) {
75
+ this._sourceScripts.push(script);
76
+ }
77
+ }
78
+ return this;
79
+ }
80
+ /**
81
+ * Sets the working directory within the source. When set, the build
82
+ * runs inside `./source/{name}/{workingDir}` instead of `./source/{name}`.
83
+ */
84
+ withWorkingDir(dir) {
85
+ this._workingDir = dir;
86
+ return this;
87
+ }
88
+ /**
89
+ * Builds the TypeScript project artifact.
90
+ *
91
+ * When entrypoint is set (binary mode):
92
+ * - Compiles to standalone binary via `bun build --compile`
93
+ * - Output at `$VORPAL_OUTPUT/bin/{name}`
94
+ *
95
+ * When entrypoint is undefined (library mode):
96
+ * - Builds via `bun x tsc --project tsconfig.json --outDir dist`
97
+ * - Copies `package.json`, `dist/`, `node_modules/` to `$VORPAL_OUTPUT/`
98
+ *
99
+ * @returns The artifact digest string
100
+ */
101
+ async build(context) {
102
+ // Setup artifacts -- resolve Bun
103
+ const bunDigest = await context.fetchArtifactAlias(DEFAULT_BUN_ALIAS);
104
+ const bunBin = `${getEnvKey(bunDigest)}/bin`;
105
+ // Setup source
106
+ const sourcePath = ".";
107
+ const sourceBuilder = new ArtifactSource(this._name, sourcePath);
108
+ if (this._includes.length > 0) {
109
+ sourceBuilder.withIncludes(this._includes);
110
+ }
111
+ const source = sourceBuilder.build();
112
+ // Setup step source directory
113
+ let stepSourceDir = `${sourcePath}/source/${source.name}`;
114
+ if (this._workingDir !== undefined) {
115
+ stepSourceDir = `${stepSourceDir}/${this._workingDir}`;
116
+ }
117
+ // Setup build command -- dual mode based on entrypoint
118
+ let stepBuildCommand;
119
+ if (this._entrypoint !== undefined) {
120
+ // Binary mode
121
+ stepBuildCommand = `mkdir -p $VORPAL_OUTPUT/bin
122
+
123
+ ${bunBin}/bun build --compile ${this._entrypoint} --outfile ${this._name}
124
+
125
+ cp ${this._name} $VORPAL_OUTPUT/bin/${this._name}`;
126
+ }
127
+ else {
128
+ // Library mode
129
+ stepBuildCommand = `mkdir -p $VORPAL_OUTPUT
130
+
131
+ ${bunBin}/bun x tsc --project tsconfig.json --outDir dist
132
+
133
+ cp package.json $VORPAL_OUTPUT/
134
+ cp -r dist $VORPAL_OUTPUT/
135
+ cp -r node_modules $VORPAL_OUTPUT/`;
136
+ }
137
+ // Build step script -- matches Rust formatdoc! output
138
+ const stepScript = `pushd ${stepSourceDir}
139
+
140
+ ${this._sourceScripts.join("\n")}
141
+
142
+ ${bunBin}/bun install --frozen-lockfile
143
+
144
+ ${stepBuildCommand}`;
145
+ // Build environment variables
146
+ const stepEnvironments = [`PATH=${bunBin}`, ...this._environments];
147
+ // Build artifact dependencies
148
+ const stepArtifacts = [bunDigest, ...this._artifacts];
149
+ // Create step
150
+ const step = await shell(context, stepArtifacts, stepEnvironments, stepScript, secretsToProto(this._secrets));
151
+ // Create and return artifact
152
+ return new Artifact(this._name, [step], this._systems)
153
+ .withAliases(this._aliases)
154
+ .withSources([source])
155
+ .build(context);
156
+ }
157
+ }
158
+ // ---------------------------------------------------------------------------
159
+ // TypeScript Development Environment
160
+ // ---------------------------------------------------------------------------
161
+ /**
162
+ * Builder for TypeScript development environment artifacts.
163
+ *
164
+ * Wraps {@link DevelopmentEnvironment} to provide a TypeScript-specific
165
+ * development environment with Bun pre-configured. This is the simplest
166
+ * of the language-specific development environment builders -- it includes
167
+ * only the Bun runtime as a default tool and requires no special
168
+ * environment variables.
169
+ *
170
+ * Usage:
171
+ * ```typescript
172
+ * const digest = await new TypeScriptDevelopmentEnvironment("example-shell", SYSTEMS)
173
+ * .build(context);
174
+ * ```
175
+ */
176
+ export class TypeScriptDevelopmentEnvironment {
177
+ _artifacts = [];
178
+ _environments = [];
179
+ _name;
180
+ _secrets = new Map();
181
+ _systems;
182
+ constructor(name, systems) {
183
+ this._name = name;
184
+ this._systems = systems;
185
+ }
186
+ /**
187
+ * Adds extra artifact dependencies beyond the default Bun tooling.
188
+ * These are appended to the default artifacts, not replacing them.
189
+ */
190
+ withArtifacts(artifacts) {
191
+ this._artifacts.push(...artifacts);
192
+ return this;
193
+ }
194
+ /**
195
+ * Adds extra environment variables beyond what DevelopmentEnvironment provides.
196
+ * Format: "KEY=VALUE".
197
+ */
198
+ withEnvironments(environments) {
199
+ this._environments.push(...environments);
200
+ return this;
201
+ }
202
+ /** Adds secrets available during the environment build step. */
203
+ withSecrets(secrets) {
204
+ for (const [k, v] of secrets) {
205
+ if (!this._secrets.has(k)) {
206
+ this._secrets.set(k, v);
207
+ }
208
+ }
209
+ return this;
210
+ }
211
+ /**
212
+ * Builds the TypeScript development environment artifact.
213
+ *
214
+ * Default artifacts fetched:
215
+ * - bun (Bun runtime)
216
+ *
217
+ * No default environment variables beyond what DevelopmentEnvironment provides.
218
+ * Bun does not require special env vars like Go or Rust do.
219
+ */
220
+ async build(context) {
221
+ const bun = await context.fetchArtifactAlias(DEFAULT_BUN_ALIAS);
222
+ const artifacts = [bun, ...this._artifacts];
223
+ let devenv = new DevelopmentEnvironment(this._name, this._systems)
224
+ .withArtifacts(artifacts)
225
+ .withEnvironments(this._environments);
226
+ if (this._secrets.size > 0) {
227
+ devenv = devenv.withSecrets(this._secrets);
228
+ }
229
+ return devenv.build(context);
230
+ }
231
+ }
232
+ //# sourceMappingURL=typescript.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typescript.js","sourceRoot":"","sources":["../../../src/artifact/language/typescript.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,QAAQ,EACR,cAAc,EACd,sBAAsB,EACtB,SAAS,EACT,cAAc,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,MAAM,iBAAiB,GAAG,YAAY,CAAC;AAEvC,MAAM,OAAO,UAAU;IACb,QAAQ,GAAa,EAAE,CAAC;IACxB,UAAU,GAAa,EAAE,CAAC;IAC1B,WAAW,GAAuB,SAAS,CAAC;IAC5C,aAAa,GAAa,EAAE,CAAC;IAC7B,SAAS,GAAa,EAAE,CAAC;IACzB,KAAK,CAAS;IACd,QAAQ,GAAwB,IAAI,GAAG,EAAE,CAAC;IAC1C,cAAc,GAAa,EAAE,CAAC;IAC9B,QAAQ,CAAmB;IAC3B,WAAW,GAAuB,SAAS,CAAC;IAEpD,YAAY,IAAY,EAAE,OAAyB;QACjD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC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AC;IAED;;;OAGG;IACH,gBAAgB,CAAC,YAAsB;QACrC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,CAAC;QACzC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,gEAAgE;IAChE,WAAW,CAAC,OAA4B;QACtC,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,OAAO,EAAE,CAAC;YAC7B,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC1B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAC1B,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,KAAK,CAAC,OAAsB;QAChC,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,CAAC;QAEhE,MAAM,SAAS,GAAa,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC;QAEtD,IAAI,MAAM,GAAG,IAAI,sBAAsB,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC;aAC/D,aAAa,CAAC,SAAS,CAAC;aACxB,gBAAgB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAExC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;YAC3B,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC7C,CAAC;QAED,OAAO,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;CACF"}
@@ -0,0 +1,28 @@
1
+ import type { ArtifactStep as ArtifactStepMsg, ArtifactStepSecret } from "../api/artifact/artifact.js";
2
+ import type { ConfigContext } from "../context.js";
3
+ /**
4
+ * Creates a bash step. Matches Rust sdk/rust/src/artifact/step.rs bash().
5
+ *
6
+ * - Filters PATH from environments
7
+ * - Builds PATH from artifact bins + default system paths
8
+ * - Prepends bash shebang and set -euo pipefail to script
9
+ * - Uses "bash" as entrypoint
10
+ */
11
+ export declare function bash(artifacts: string[], environments: string[], secrets: ArtifactStepSecret[], script: string): ArtifactStepMsg;
12
+ /**
13
+ * Creates a bwrap step. Matches Rust sdk/rust/src/artifact/step.rs bwrap().
14
+ *
15
+ * CRITICAL: Argument list ordering must be identical to Rust/Go.
16
+ */
17
+ export declare function bwrap(arguments_: string[], artifacts: string[], environments: string[], rootfs: string | null, secrets: ArtifactStepSecret[], script: string): ArtifactStepMsg;
18
+ /**
19
+ * Creates a shell step. Matches Rust sdk/rust/src/artifact/step.rs shell().
20
+ *
21
+ * Dispatches to bash() on Darwin, bwrap() on Linux with linux-vorpal rootfs.
22
+ */
23
+ export declare function shell(context: ConfigContext, artifacts: string[], environments: string[], script: string, secrets: ArtifactStepSecret[]): Promise<ArtifactStepMsg>;
24
+ /**
25
+ * Creates a docker step. Matches Rust sdk/rust/src/artifact/step.rs docker().
26
+ */
27
+ export declare function docker(arguments_: string[], artifacts: string[]): ArtifactStepMsg;
28
+ //# sourceMappingURL=step.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../src/artifact/step.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,IAAI,eAAe,EAC/B,kBAAkB,EACnB,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGnD;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAClB,SAAS,EAAE,MAAM,EAAE,EACnB,YAAY,EAAE,MAAM,EAAE,EACtB,OAAO,EAAE,kBAAkB,EAAE,EAC7B,MAAM,EAAE,MAAM,GACb,eAAe,CA+CjB;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CACnB,UAAU,EAAE,MAAM,EAAE,EACpB,SAAS,EAAE,MAAM,EAAE,EACnB,YAAY,EAAE,MAAM,EAAE,EACtB,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,OAAO,EAAE,kBAAkB,EAAE,EAC7B,MAAM,EAAE,MAAM,GACb,eAAe,CAgJjB;AAED;;;;GAIG;AACH,wBAAsB,KAAK,CACzB,OAAO,EAAE,aAAa,EACtB,SAAS,EAAE,MAAM,EAAE,EACnB,YAAY,EAAE,MAAM,EAAE,EACtB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,kBAAkB,EAAE,GAC5B,OAAO,CAAC,eAAe,CAAC,CAsB1B;AAED;;GAEG;AACH,wBAAgB,MAAM,CACpB,UAAU,EAAE,MAAM,EAAE,EACpB,SAAS,EAAE,MAAM,EAAE,GAClB,eAAe,CASjB"}
@@ -0,0 +1,214 @@
1
+ import { ArtifactSystem } from "../api/artifact/artifact.js";
2
+ import { getEnvKey } from "../artifact.js";
3
+ /**
4
+ * Creates a bash step. Matches Rust sdk/rust/src/artifact/step.rs bash().
5
+ *
6
+ * - Filters PATH from environments
7
+ * - Builds PATH from artifact bins + default system paths
8
+ * - Prepends bash shebang and set -euo pipefail to script
9
+ * - Uses "bash" as entrypoint
10
+ */
11
+ export function bash(artifacts, environments, secrets, script) {
12
+ const stepEnvironments = [];
13
+ for (const environment of environments) {
14
+ if (environment.startsWith("PATH=")) {
15
+ continue;
16
+ }
17
+ stepEnvironments.push(environment);
18
+ }
19
+ const stepPathBins = artifacts
20
+ .map((a) => `${getEnvKey(a)}/bin`)
21
+ .join(":");
22
+ const stepPathDefault = "/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin";
23
+ let stepPath = `${stepPathBins}:${stepPathDefault}`;
24
+ const pathEnv = environments.find((x) => x.startsWith("PATH="));
25
+ if (pathEnv) {
26
+ const pathValue = pathEnv.split("=").slice(1).join("=");
27
+ if (pathValue) {
28
+ stepPath = `${pathValue}:${stepPath}`;
29
+ }
30
+ }
31
+ stepEnvironments.push("HOME=$VORPAL_WORKSPACE");
32
+ stepEnvironments.push(`PATH=${stepPath}`);
33
+ const stepScript = `#!/bin/bash\nset -euo pipefail\n\n${script}\n`;
34
+ // Deduplicate secrets by name
35
+ const uniqueSecrets = [];
36
+ for (const secret of secrets) {
37
+ if (!uniqueSecrets.some((s) => s.name === secret.name)) {
38
+ uniqueSecrets.push(secret);
39
+ }
40
+ }
41
+ return {
42
+ entrypoint: "bash",
43
+ script: stepScript,
44
+ secrets: uniqueSecrets,
45
+ arguments: [],
46
+ artifacts: artifacts,
47
+ environments: stepEnvironments,
48
+ };
49
+ }
50
+ /**
51
+ * Creates a bwrap step. Matches Rust sdk/rust/src/artifact/step.rs bwrap().
52
+ *
53
+ * CRITICAL: Argument list ordering must be identical to Rust/Go.
54
+ */
55
+ export function bwrap(arguments_, artifacts, environments, rootfs, secrets, script) {
56
+ // Setup arguments
57
+ const stepArguments = [
58
+ "--unshare-all",
59
+ "--share-net",
60
+ "--clearenv",
61
+ "--chdir",
62
+ "$VORPAL_WORKSPACE",
63
+ "--gid",
64
+ "1000",
65
+ "--uid",
66
+ "1000",
67
+ "--dev",
68
+ "/dev",
69
+ "--proc",
70
+ "/proc",
71
+ "--tmpfs",
72
+ "/tmp",
73
+ "--bind",
74
+ "$VORPAL_OUTPUT",
75
+ "$VORPAL_OUTPUT",
76
+ "--bind",
77
+ "$VORPAL_WORKSPACE",
78
+ "$VORPAL_WORKSPACE",
79
+ "--setenv",
80
+ "VORPAL_OUTPUT",
81
+ "$VORPAL_OUTPUT",
82
+ "--setenv",
83
+ "VORPAL_WORKSPACE",
84
+ "$VORPAL_WORKSPACE",
85
+ "--setenv",
86
+ "HOME",
87
+ "$VORPAL_WORKSPACE",
88
+ ];
89
+ // Setup artifacts
90
+ const stepArtifacts = [];
91
+ if (rootfs !== null) {
92
+ const rootfsEnv = getEnvKey(rootfs);
93
+ const rootfsBin = `${rootfsEnv}/bin`;
94
+ const rootfsEtc = `${rootfsEnv}/etc`;
95
+ const rootfsLib = `${rootfsEnv}/lib`;
96
+ const rootfsLib64 = `${rootfsEnv}/lib64`;
97
+ const rootfsSbin = `${rootfsEnv}/sbin`;
98
+ const rootfsUsr = `${rootfsEnv}/usr`;
99
+ const rootfsArgs = [
100
+ "--ro-bind",
101
+ rootfsBin,
102
+ "/bin",
103
+ "--ro-bind",
104
+ rootfsEtc,
105
+ "/etc",
106
+ "--ro-bind",
107
+ rootfsLib,
108
+ "/lib",
109
+ "--ro-bind-try",
110
+ rootfsLib64,
111
+ "/lib64",
112
+ "--ro-bind",
113
+ rootfsSbin,
114
+ "/sbin",
115
+ "--ro-bind",
116
+ rootfsUsr,
117
+ "/usr",
118
+ ];
119
+ stepArguments.push(...rootfsArgs);
120
+ stepArtifacts.push(rootfs);
121
+ }
122
+ // Setup artifact arguments
123
+ for (const artifact of artifacts) {
124
+ stepArtifacts.push(artifact);
125
+ }
126
+ for (const artifact of stepArtifacts) {
127
+ stepArguments.push("--ro-bind");
128
+ stepArguments.push(getEnvKey(artifact));
129
+ stepArguments.push(getEnvKey(artifact));
130
+ stepArguments.push("--setenv");
131
+ stepArguments.push(getEnvKey(artifact).replace("$", ""));
132
+ stepArguments.push(getEnvKey(artifact));
133
+ }
134
+ // Setup environment arguments
135
+ const stepPathBins = stepArtifacts
136
+ .map((a) => `${getEnvKey(a)}/bin`)
137
+ .join(":");
138
+ let stepPath = `${stepPathBins}:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin`;
139
+ const pathEnv = environments.find((x) => x.startsWith("PATH="));
140
+ if (pathEnv) {
141
+ const pathValue = pathEnv.split("=").slice(1).join("=");
142
+ if (pathValue) {
143
+ stepPath = `${pathValue}:${stepPath}`;
144
+ }
145
+ }
146
+ stepArguments.push("--setenv");
147
+ stepArguments.push("PATH");
148
+ stepArguments.push(stepPath);
149
+ for (const env of environments) {
150
+ const eqIdx = env.indexOf("=");
151
+ const key = eqIdx !== -1 ? env.substring(0, eqIdx) : env;
152
+ const value = eqIdx !== -1 ? env.substring(eqIdx + 1) : "";
153
+ if (key.startsWith("PATH")) {
154
+ continue;
155
+ }
156
+ stepArguments.push("--setenv");
157
+ stepArguments.push(key);
158
+ stepArguments.push(value);
159
+ }
160
+ // Setup arguments
161
+ for (const argument of arguments_) {
162
+ stepArguments.push(argument);
163
+ }
164
+ // Setup script
165
+ const stepScript = `#!/bin/bash\nset -euo pipefail\n\n${script}\n`;
166
+ // Deduplicate secrets by name
167
+ const uniqueSecrets = [];
168
+ for (const secret of secrets) {
169
+ if (!uniqueSecrets.some((s) => s.name === secret.name)) {
170
+ uniqueSecrets.push(secret);
171
+ }
172
+ }
173
+ // Setup step
174
+ return {
175
+ entrypoint: "bwrap",
176
+ script: stepScript,
177
+ secrets: uniqueSecrets,
178
+ arguments: stepArguments,
179
+ artifacts: stepArtifacts,
180
+ environments: ["PATH=/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin"],
181
+ };
182
+ }
183
+ /**
184
+ * Creates a shell step. Matches Rust sdk/rust/src/artifact/step.rs shell().
185
+ *
186
+ * Dispatches to bash() on Darwin, bwrap() on Linux with linux-vorpal rootfs.
187
+ */
188
+ export async function shell(context, artifacts, environments, script, secrets) {
189
+ const stepSystem = context.getSystem();
190
+ if (stepSystem === ArtifactSystem.AARCH64_DARWIN ||
191
+ stepSystem === ArtifactSystem.X8664_DARWIN) {
192
+ return bash(artifacts, environments, secrets, script);
193
+ }
194
+ if (stepSystem === ArtifactSystem.AARCH64_LINUX ||
195
+ stepSystem === ArtifactSystem.X8664_LINUX) {
196
+ const linuxVorpal = await context.fetchArtifactAlias("library/linux-vorpal:latest");
197
+ return bwrap([], artifacts, environments, linuxVorpal, secrets, script);
198
+ }
199
+ throw new Error(`unsupported system: ${stepSystem}`);
200
+ }
201
+ /**
202
+ * Creates a docker step. Matches Rust sdk/rust/src/artifact/step.rs docker().
203
+ */
204
+ export function docker(arguments_, artifacts) {
205
+ return {
206
+ entrypoint: "docker",
207
+ script: undefined,
208
+ secrets: [],
209
+ arguments: arguments_,
210
+ artifacts: artifacts,
211
+ environments: ["PATH=/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin"],
212
+ };
213
+ }
214
+ //# sourceMappingURL=step.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step.js","sourceRoot":"","sources":["../../src/artifact/step.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C;;;;;;;GAOG;AACH,MAAM,UAAU,IAAI,CAClB,SAAmB,EACnB,YAAsB,EACtB,OAA6B,EAC7B,MAAc;IAEd,MAAM,gBAAgB,GAAa,EAAE,CAAC;IAEtC,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE,CAAC;QACvC,IAAI,WAAW,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;YACpC,SAAS;QACX,CAAC;QACD,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACrC,CAAC;IAED,MAAM,YAAY,GAAG,SAAS;SAC3B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;SACjC,IAAI,CAAC,GAAG,CAAC,CAAC;IAEb,MAAM,eAAe,GAAG,8CAA8C,CAAC;IAEvE,IAAI,QAAQ,GAAG,GAAG,YAAY,IAAI,eAAe,EAAE,CAAC;IAEpD,MAAM,OAAO,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;IAChE,IAAI,OAAO,EAAE,CAAC;QACZ,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxD,IAAI,SAAS,EAAE,CAAC;YACd,QAAQ,GAAG,GAAG,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