@elie-laloum/outpost 4.0.0 → 4.1.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 (56) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +3 -3
  3. package/dist/adapters/agents/codex-adapter.js +2 -0
  4. package/dist/adapters/agents/codex-adapter.js.map +1 -1
  5. package/dist/adapters/agents/codex-provider.d.ts +2 -0
  6. package/dist/adapters/agents/codex-provider.js +32 -0
  7. package/dist/adapters/agents/codex-provider.js.map +1 -0
  8. package/dist/adapters/agents/codex-request.js +2 -1
  9. package/dist/adapters/agents/codex-request.js.map +1 -1
  10. package/dist/adapters/agents/gemini-request.js +2 -0
  11. package/dist/adapters/agents/gemini-request.js.map +1 -1
  12. package/dist/adapters/agents/settings.types.d.ts +5 -0
  13. package/dist/adapters/agents/settings.types.js.map +1 -1
  14. package/dist/cli/commands.js +55 -18
  15. package/dist/cli/commands.js.map +1 -1
  16. package/dist/cli/init-authentication.constants.d.ts +13 -0
  17. package/dist/cli/init-authentication.constants.js +10 -0
  18. package/dist/cli/init-authentication.constants.js.map +1 -0
  19. package/dist/cli/init-authentication.d.ts +4 -0
  20. package/dist/cli/init-authentication.js +43 -0
  21. package/dist/cli/init-authentication.js.map +1 -0
  22. package/dist/cli/init-command.js +74 -15
  23. package/dist/cli/init-command.js.map +1 -1
  24. package/dist/cli/main.constants.d.ts +102 -2
  25. package/dist/cli/main.constants.js +148 -46
  26. package/dist/cli/main.constants.js.map +1 -1
  27. package/dist/cli/scaffold-files.js +4 -3
  28. package/dist/cli/scaffold-files.js.map +1 -1
  29. package/dist/cli/scaffold-validation.js +19 -0
  30. package/dist/cli/scaffold-validation.js.map +1 -1
  31. package/dist/cli/scaffold.constants.d.ts +0 -5
  32. package/dist/cli/scaffold.constants.js +0 -5
  33. package/dist/cli/scaffold.constants.js.map +1 -1
  34. package/dist/cli/scaffold.js +13 -0
  35. package/dist/cli/scaffold.js.map +1 -1
  36. package/dist/cli/scaffold.types.d.ts +3 -0
  37. package/dist/cli/scaffold.types.js.map +1 -1
  38. package/dist/cli/starters.js +9 -2
  39. package/dist/cli/starters.js.map +1 -1
  40. package/dist/index.d.ts +1 -1
  41. package/dist/index.js.map +1 -1
  42. package/dist/providers/agents.d.ts +1 -1
  43. package/dist/providers/agents.js.map +1 -1
  44. package/dist/providers/daytona-command.constants.d.ts +2 -0
  45. package/dist/providers/daytona-command.constants.js +13 -0
  46. package/dist/providers/daytona-command.constants.js.map +1 -0
  47. package/dist/providers/daytona-command.js +9 -3
  48. package/dist/providers/daytona-command.js.map +1 -1
  49. package/dist/providers/daytona-output.d.ts +4 -0
  50. package/dist/providers/daytona-output.js +37 -0
  51. package/dist/providers/daytona-output.js.map +1 -0
  52. package/dist/providers/daytona-terminal.js +3 -1
  53. package/dist/providers/daytona-terminal.js.map +1 -1
  54. package/dist/providers/vercel-command.js +2 -2
  55. package/dist/providers/vercel-command.js.map +1 -1
  56. package/package.json +6 -2
@@ -1,87 +1,187 @@
1
- export declare const help = "Outpost \u2014 sandboxed coding agents and workflows\n\noutpost init [--yes] [--agent codex|claude|gemini] [--provider docker|podman|vercel|daytona|local]\n [--manager npm|pnpm|yarn|bun] [--model NAME] [--install] [--build] [--image NAME] [--directory PATH] [--repository PATH]\noutpost image build|remove [--engine docker|podman] [--file PATH] [--image NAME] [--uid ID] [--gid ID]\n\noutpost doctor [--provider docker|podman|local|vercel|daytona] [--agent codex|claude|gemini] [--image NAME] [--json]\n\noutpost recovery inspect [--repository PATH] [--max-entries NUMBER] [--git] [--locks] [--resources] [--json]\noutpost recovery verify --directory TRANSFER_PATH [--checksums] [--max-bytes NUMBER] [--restorability --repository PATH] [--json]\noutpost recovery restore --directory TRANSFER_PATH --repository PATH --destination NEW_PATH --side previous|incoming [--max-bytes NUMBER] [--apply] [--json]\noutpost recovery prune --policy FILE [--repository PATH] [--apply] [--json]\n\nNode.js 24+ and Git are required. Run generated scripts with Node.js.\nInitialization writes run.ts and project files directly into --directory (default: current directory).\n--repository selects the target Git repository; relative paths are resolved from the workflow directory.\n";
2
1
  export declare const cliOptions: {
2
+ readonly "base-url": {
3
+ readonly type: "string";
4
+ readonly description: "Custom Codex Responses API base URL (requires --model)";
5
+ };
6
+ readonly "api-key-env": {
7
+ readonly type: "string";
8
+ readonly description: "Custom provider API-key environment variable";
9
+ };
10
+ readonly authentication: {
11
+ readonly type: "string";
12
+ readonly description: "Authentication: api-key, oauth-token (Claude), login (Codex)";
13
+ };
3
14
  readonly help: {
4
15
  readonly type: "boolean";
5
16
  readonly short: "h";
17
+ readonly description: "Help";
6
18
  };
7
19
  readonly yes: {
8
20
  readonly type: "boolean";
9
21
  readonly short: "y";
22
+ readonly description: "Accept defaults without prompting";
10
23
  };
11
24
  readonly install: {
12
25
  readonly type: "boolean";
26
+ readonly description: "Install project dependencies";
13
27
  };
14
28
  readonly build: {
15
29
  readonly type: "boolean";
30
+ readonly description: "Build the container image";
16
31
  };
17
32
  readonly json: {
18
33
  readonly type: "boolean";
34
+ readonly description: "Write a machine-readable JSON report";
19
35
  };
20
36
  readonly git: {
21
37
  readonly type: "boolean";
38
+ readonly description: "Inspect workspace Git state";
22
39
  };
23
40
  readonly locks: {
24
41
  readonly type: "boolean";
42
+ readonly description: "Inspect local lock ownership";
25
43
  };
26
44
  readonly resources: {
27
45
  readonly type: "boolean";
46
+ readonly description: "Inspect recorded sandbox activity";
28
47
  };
29
48
  readonly restorability: {
30
49
  readonly type: "boolean";
50
+ readonly description: "Check whether the retained transfer can be restored";
31
51
  };
32
52
  readonly apply: {
33
53
  readonly type: "boolean";
54
+ readonly description: "Apply changes (default: preview)";
34
55
  };
35
56
  readonly policy: {
36
57
  readonly type: "string";
58
+ readonly description: "Retention policy file";
37
59
  };
38
60
  readonly checksums: {
39
61
  readonly type: "boolean";
62
+ readonly description: "Verify retained file checksums";
40
63
  };
41
64
  readonly "max-bytes": {
42
65
  readonly type: "string";
66
+ readonly description: "Maximum bytes to inspect";
43
67
  };
44
68
  readonly "max-entries": {
45
69
  readonly type: "string";
70
+ readonly description: "Maximum inventory entries";
46
71
  };
47
72
  readonly agent: {
48
73
  readonly type: "string";
74
+ readonly description: "Agent: codex, claude or gemini";
49
75
  };
50
76
  readonly provider: {
51
77
  readonly type: "string";
78
+ readonly description: "Provider: docker, podman, local, vercel or daytona";
52
79
  };
53
80
  readonly manager: {
54
81
  readonly type: "string";
82
+ readonly description: "Package manager: npm, pnpm, yarn or bun";
55
83
  };
56
84
  readonly model: {
57
85
  readonly type: "string";
86
+ readonly description: "Agent model name";
58
87
  };
59
88
  readonly directory: {
60
89
  readonly type: "string";
90
+ readonly description: "Workflow or retained transfer directory";
61
91
  };
62
92
  readonly repository: {
63
93
  readonly type: "string";
94
+ readonly description: "Target Git repository";
64
95
  };
65
96
  readonly destination: {
66
97
  readonly type: "string";
98
+ readonly description: "New restoration directory";
67
99
  };
68
100
  readonly side: {
69
101
  readonly type: "string";
102
+ readonly description: "Transfer side: previous or incoming";
70
103
  };
71
104
  readonly engine: {
72
105
  readonly type: "string";
106
+ readonly description: "Container engine: docker or podman";
73
107
  };
74
108
  readonly file: {
75
109
  readonly type: "string";
110
+ readonly description: "Container recipe path";
76
111
  };
77
112
  readonly image: {
78
113
  readonly type: "string";
114
+ readonly description: "Container image name";
79
115
  };
80
116
  readonly uid: {
81
117
  readonly type: "string";
118
+ readonly description: "Container user ID";
82
119
  };
83
120
  readonly gid: {
84
121
  readonly type: "string";
122
+ readonly description: "Container group ID";
123
+ };
124
+ };
125
+ export declare const commandOptions: {
126
+ readonly init: {
127
+ readonly description: "Create a standalone workflow project";
128
+ readonly options: readonly ["yes", "agent", "provider", "manager", "authentication", "model", "base-url", "api-key-env", "install", "build", "image", "directory", "repository"];
85
129
  };
130
+ readonly doctor: {
131
+ readonly description: "Diagnose host and sandbox prerequisites";
132
+ readonly options: readonly ["provider", "agent", "image", "json"];
133
+ };
134
+ readonly "image build": {
135
+ readonly description: "Build a container image";
136
+ readonly options: readonly ["directory", "engine", "file", "image", "uid", "gid"];
137
+ };
138
+ readonly "image remove": {
139
+ readonly description: "Remove a container image";
140
+ readonly options: readonly ["directory", "engine", "image"];
141
+ };
142
+ readonly "recovery inspect": {
143
+ readonly description: "Inspect recovery inventory";
144
+ readonly options: readonly ["repository", "max-entries", "git", "locks", "resources", "json"];
145
+ };
146
+ readonly "recovery verify": {
147
+ readonly description: "Verify a retained transfer";
148
+ readonly options: readonly ["directory", "checksums", "max-bytes", "restorability", "repository", "json"];
149
+ };
150
+ readonly "recovery restore": {
151
+ readonly description: "Restore a retained transfer";
152
+ readonly options: readonly ["directory", "repository", "destination", "side", "max-bytes", "apply", "json"];
153
+ };
154
+ readonly "recovery prune": {
155
+ readonly description: "Apply an explicit retention policy";
156
+ readonly options: readonly ["policy", "repository", "apply", "json"];
157
+ };
158
+ };
159
+ export declare const initializationQuestions: readonly [{
160
+ readonly key: "agent";
161
+ readonly message: "Coding agent";
162
+ readonly choices: readonly ["codex", "claude", "gemini"];
163
+ }, {
164
+ readonly key: "provider";
165
+ readonly message: "Sandbox provider";
166
+ readonly choices: readonly ["docker", "podman", "vercel", "daytona", "local"];
167
+ }];
168
+ export declare const authenticationChoices: {
169
+ readonly codex: readonly [{
170
+ readonly value: "api-key";
171
+ readonly label: "OpenAI API key (API billing)";
172
+ }, {
173
+ readonly value: "login";
174
+ readonly label: "Existing Codex account login";
175
+ }];
176
+ readonly claude: readonly [{
177
+ readonly value: "api-key";
178
+ readonly label: "Anthropic API key (API billing)";
179
+ }, {
180
+ readonly value: "oauth-token";
181
+ readonly label: "Claude subscription token (claude setup-token)";
182
+ }];
183
+ readonly gemini: readonly [{
184
+ readonly value: "api-key";
185
+ readonly label: "Gemini API key";
186
+ }];
86
187
  };
87
- export declare const initializationQuestions: readonly [readonly ["agent", "Agent (codex/claude/gemini)", "codex"], readonly ["provider", "Sandbox (docker/podman/vercel/daytona/local)", "docker"]];
@@ -1,51 +1,153 @@
1
- export const help = `Outpost — sandboxed coding agents and workflows
2
-
3
- outpost init [--yes] [--agent codex|claude|gemini] [--provider docker|podman|vercel|daytona|local]
4
- [--manager npm|pnpm|yarn|bun] [--model NAME] [--install] [--build] [--image NAME] [--directory PATH] [--repository PATH]
5
- outpost image build|remove [--engine docker|podman] [--file PATH] [--image NAME] [--uid ID] [--gid ID]
6
-
7
- outpost doctor [--provider docker|podman|local|vercel|daytona] [--agent codex|claude|gemini] [--image NAME] [--json]
8
-
9
- outpost recovery inspect [--repository PATH] [--max-entries NUMBER] [--git] [--locks] [--resources] [--json]
10
- outpost recovery verify --directory TRANSFER_PATH [--checksums] [--max-bytes NUMBER] [--restorability --repository PATH] [--json]
11
- outpost recovery restore --directory TRANSFER_PATH --repository PATH --destination NEW_PATH --side previous|incoming [--max-bytes NUMBER] [--apply] [--json]
12
- outpost recovery prune --policy FILE [--repository PATH] [--apply] [--json]
13
-
14
- Node.js 24+ and Git are required. Run generated scripts with Node.js.
15
- Initialization writes run.ts and project files directly into --directory (default: current directory).
16
- --repository selects the target Git repository; relative paths are resolved from the workflow directory.
17
- `;
18
1
  export const cliOptions = {
19
- help: { type: "boolean", short: "h" },
20
- yes: { type: "boolean", short: "y" },
21
- install: { type: "boolean" },
22
- build: { type: "boolean" },
23
- json: { type: "boolean" },
24
- git: { type: "boolean" },
25
- locks: { type: "boolean" },
26
- resources: { type: "boolean" },
27
- restorability: { type: "boolean" },
28
- apply: { type: "boolean" },
29
- policy: { type: "string" },
30
- checksums: { type: "boolean" },
31
- "max-bytes": { type: "string" },
32
- "max-entries": { type: "string" },
33
- agent: { type: "string" },
34
- provider: { type: "string" },
35
- manager: { type: "string" },
36
- model: { type: "string" },
37
- directory: { type: "string" },
38
- repository: { type: "string" },
39
- destination: { type: "string" },
40
- side: { type: "string" },
41
- engine: { type: "string" },
42
- file: { type: "string" },
43
- image: { type: "string" },
44
- uid: { type: "string" },
45
- gid: { type: "string" },
2
+ "base-url": {
3
+ type: "string",
4
+ description: "Custom Codex Responses API base URL (requires --model)",
5
+ },
6
+ "api-key-env": {
7
+ type: "string",
8
+ description: "Custom provider API-key environment variable",
9
+ },
10
+ authentication: {
11
+ type: "string",
12
+ description: "Authentication: api-key, oauth-token (Claude), login (Codex)",
13
+ },
14
+ help: { type: "boolean", short: "h", description: "Help" },
15
+ yes: {
16
+ type: "boolean",
17
+ short: "y",
18
+ description: "Accept defaults without prompting",
19
+ },
20
+ install: { type: "boolean", description: "Install project dependencies" },
21
+ build: { type: "boolean", description: "Build the container image" },
22
+ json: {
23
+ type: "boolean",
24
+ description: "Write a machine-readable JSON report",
25
+ },
26
+ git: { type: "boolean", description: "Inspect workspace Git state" },
27
+ locks: { type: "boolean", description: "Inspect local lock ownership" },
28
+ resources: {
29
+ type: "boolean",
30
+ description: "Inspect recorded sandbox activity",
31
+ },
32
+ restorability: {
33
+ type: "boolean",
34
+ description: "Check whether the retained transfer can be restored",
35
+ },
36
+ apply: { type: "boolean", description: "Apply changes (default: preview)" },
37
+ policy: { type: "string", description: "Retention policy file" },
38
+ checksums: { type: "boolean", description: "Verify retained file checksums" },
39
+ "max-bytes": { type: "string", description: "Maximum bytes to inspect" },
40
+ "max-entries": { type: "string", description: "Maximum inventory entries" },
41
+ agent: { type: "string", description: "Agent: codex, claude or gemini" },
42
+ provider: {
43
+ type: "string",
44
+ description: "Provider: docker, podman, local, vercel or daytona",
45
+ },
46
+ manager: {
47
+ type: "string",
48
+ description: "Package manager: npm, pnpm, yarn or bun",
49
+ },
50
+ model: { type: "string", description: "Agent model name" },
51
+ directory: {
52
+ type: "string",
53
+ description: "Workflow or retained transfer directory",
54
+ },
55
+ repository: { type: "string", description: "Target Git repository" },
56
+ destination: { type: "string", description: "New restoration directory" },
57
+ side: { type: "string", description: "Transfer side: previous or incoming" },
58
+ engine: { type: "string", description: "Container engine: docker or podman" },
59
+ file: { type: "string", description: "Container recipe path" },
60
+ image: { type: "string", description: "Container image name" },
61
+ uid: { type: "string", description: "Container user ID" },
62
+ gid: { type: "string", description: "Container group ID" },
63
+ };
64
+ export const commandOptions = {
65
+ init: {
66
+ description: "Create a standalone workflow project",
67
+ options: [
68
+ "yes",
69
+ "agent",
70
+ "provider",
71
+ "manager",
72
+ "authentication",
73
+ "model",
74
+ "base-url",
75
+ "api-key-env",
76
+ "install",
77
+ "build",
78
+ "image",
79
+ "directory",
80
+ "repository",
81
+ ],
82
+ },
83
+ doctor: {
84
+ description: "Diagnose host and sandbox prerequisites",
85
+ options: ["provider", "agent", "image", "json"],
86
+ },
87
+ "image build": {
88
+ description: "Build a container image",
89
+ options: ["directory", "engine", "file", "image", "uid", "gid"],
90
+ },
91
+ "image remove": {
92
+ description: "Remove a container image",
93
+ options: ["directory", "engine", "image"],
94
+ },
95
+ "recovery inspect": {
96
+ description: "Inspect recovery inventory",
97
+ options: ["repository", "max-entries", "git", "locks", "resources", "json"],
98
+ },
99
+ "recovery verify": {
100
+ description: "Verify a retained transfer",
101
+ options: [
102
+ "directory",
103
+ "checksums",
104
+ "max-bytes",
105
+ "restorability",
106
+ "repository",
107
+ "json",
108
+ ],
109
+ },
110
+ "recovery restore": {
111
+ description: "Restore a retained transfer",
112
+ options: [
113
+ "directory",
114
+ "repository",
115
+ "destination",
116
+ "side",
117
+ "max-bytes",
118
+ "apply",
119
+ "json",
120
+ ],
121
+ },
122
+ "recovery prune": {
123
+ description: "Apply an explicit retention policy",
124
+ options: ["policy", "repository", "apply", "json"],
125
+ },
46
126
  };
47
127
  export const initializationQuestions = [
48
- ["agent", "Agent (codex/claude/gemini)", "codex"],
49
- ["provider", "Sandbox (docker/podman/vercel/daytona/local)", "docker"],
128
+ {
129
+ key: "agent",
130
+ message: "Coding agent",
131
+ choices: ["codex", "claude", "gemini"],
132
+ },
133
+ {
134
+ key: "provider",
135
+ message: "Sandbox provider",
136
+ choices: ["docker", "podman", "vercel", "daytona", "local"],
137
+ },
50
138
  ];
139
+ export const authenticationChoices = {
140
+ codex: [
141
+ { value: "api-key", label: "OpenAI API key (API billing)" },
142
+ { value: "login", label: "Existing Codex account login" },
143
+ ],
144
+ claude: [
145
+ { value: "api-key", label: "Anthropic API key (API billing)" },
146
+ {
147
+ value: "oauth-token",
148
+ label: "Claude subscription token (claude setup-token)",
149
+ },
150
+ ],
151
+ gemini: [{ value: "api-key", label: "Gemini API key" }],
152
+ };
51
153
  //# sourceMappingURL=main.constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"main.constants.js","sourceRoot":"","sources":["../../src/cli/main.constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,IAAI,GAAG;;;;;;;;;;;;;;;;CAgBnB,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE;IACrC,GAAG,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE;IACpC,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;IAC5B,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;IAC1B,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;IACzB,GAAG,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;IACxB,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;IAC1B,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;IAC9B,aAAa,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;IAClC,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;IAC1B,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC1B,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;IAC9B,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC/B,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IACjC,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IACzB,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC5B,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC3B,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IACzB,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC7B,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC9B,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC/B,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IACxB,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC1B,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IACxB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IACzB,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IACvB,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;CACf,CAAC;AAEX,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,CAAC,OAAO,EAAE,6BAA6B,EAAE,OAAO,CAAC;IACjD,CAAC,UAAU,EAAE,8CAA8C,EAAE,QAAQ,CAAC;CAC9D,CAAC","sourcesContent":["export const help = `Outpost — sandboxed coding agents and workflows\n\noutpost init [--yes] [--agent codex|claude|gemini] [--provider docker|podman|vercel|daytona|local]\n [--manager npm|pnpm|yarn|bun] [--model NAME] [--install] [--build] [--image NAME] [--directory PATH] [--repository PATH]\noutpost image build|remove [--engine docker|podman] [--file PATH] [--image NAME] [--uid ID] [--gid ID]\n\noutpost doctor [--provider docker|podman|local|vercel|daytona] [--agent codex|claude|gemini] [--image NAME] [--json]\n\noutpost recovery inspect [--repository PATH] [--max-entries NUMBER] [--git] [--locks] [--resources] [--json]\noutpost recovery verify --directory TRANSFER_PATH [--checksums] [--max-bytes NUMBER] [--restorability --repository PATH] [--json]\noutpost recovery restore --directory TRANSFER_PATH --repository PATH --destination NEW_PATH --side previous|incoming [--max-bytes NUMBER] [--apply] [--json]\noutpost recovery prune --policy FILE [--repository PATH] [--apply] [--json]\n\nNode.js 24+ and Git are required. Run generated scripts with Node.js.\nInitialization writes run.ts and project files directly into --directory (default: current directory).\n--repository selects the target Git repository; relative paths are resolved from the workflow directory.\n`;\n\nexport const cliOptions = {\n help: { type: \"boolean\", short: \"h\" },\n yes: { type: \"boolean\", short: \"y\" },\n install: { type: \"boolean\" },\n build: { type: \"boolean\" },\n json: { type: \"boolean\" },\n git: { type: \"boolean\" },\n locks: { type: \"boolean\" },\n resources: { type: \"boolean\" },\n restorability: { type: \"boolean\" },\n apply: { type: \"boolean\" },\n policy: { type: \"string\" },\n checksums: { type: \"boolean\" },\n \"max-bytes\": { type: \"string\" },\n \"max-entries\": { type: \"string\" },\n agent: { type: \"string\" },\n provider: { type: \"string\" },\n manager: { type: \"string\" },\n model: { type: \"string\" },\n directory: { type: \"string\" },\n repository: { type: \"string\" },\n destination: { type: \"string\" },\n side: { type: \"string\" },\n engine: { type: \"string\" },\n file: { type: \"string\" },\n image: { type: \"string\" },\n uid: { type: \"string\" },\n gid: { type: \"string\" },\n} as const;\n\nexport const initializationQuestions = [\n [\"agent\", \"Agent (codex/claude/gemini)\", \"codex\"],\n [\"provider\", \"Sandbox (docker/podman/vercel/daytona/local)\", \"docker\"],\n] as const;\n"]}
1
+ {"version":3,"file":"main.constants.js","sourceRoot":"","sources":["../../src/cli/main.constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,wDAAwD;KACtE;IACD,aAAa,EAAE;QACb,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,8CAA8C;KAC5D;IACD,cAAc,EAAE;QACd,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,8DAA8D;KAC5E;IACD,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE;IAC1D,GA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M,EAAE;QACN,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,iCAAiC,EAAE;QAC9D;YACE,KAAK,EAAE,aAAa;YACpB,KAAK,EAAE,gDAAgD;SACxD;KACF;IACD,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,gBAAgB,EAAE,CAAC;CAC/C,CAAC","sourcesContent":["export const cliOptions = {\n \"base-url\": {\n type: \"string\",\n description: \"Custom Codex Responses API base URL (requires --model)\",\n },\n \"api-key-env\": {\n type: \"string\",\n description: \"Custom provider API-key environment variable\",\n },\n authentication: {\n type: \"string\",\n description: \"Authentication: api-key, oauth-token (Claude), login (Codex)\",\n },\n help: { type: \"boolean\", short: \"h\", description: \"Help\" },\n yes: {\n type: \"boolean\",\n short: \"y\",\n description: \"Accept defaults without prompting\",\n },\n install: { type: \"boolean\", description: \"Install project dependencies\" },\n build: { type: \"boolean\", description: \"Build the container image\" },\n json: {\n type: \"boolean\",\n description: \"Write a machine-readable JSON report\",\n },\n git: { type: \"boolean\", description: \"Inspect workspace Git state\" },\n locks: { type: \"boolean\", description: \"Inspect local lock ownership\" },\n resources: {\n type: \"boolean\",\n description: \"Inspect recorded sandbox activity\",\n },\n restorability: {\n type: \"boolean\",\n description: \"Check whether the retained transfer can be restored\",\n },\n apply: { type: \"boolean\", description: \"Apply changes (default: preview)\" },\n policy: { type: \"string\", description: \"Retention policy file\" },\n checksums: { type: \"boolean\", description: \"Verify retained file checksums\" },\n \"max-bytes\": { type: \"string\", description: \"Maximum bytes to inspect\" },\n \"max-entries\": { type: \"string\", description: \"Maximum inventory entries\" },\n agent: { type: \"string\", description: \"Agent: codex, claude or gemini\" },\n provider: {\n type: \"string\",\n description: \"Provider: docker, podman, local, vercel or daytona\",\n },\n manager: {\n type: \"string\",\n description: \"Package manager: npm, pnpm, yarn or bun\",\n },\n model: { type: \"string\", description: \"Agent model name\" },\n directory: {\n type: \"string\",\n description: \"Workflow or retained transfer directory\",\n },\n repository: { type: \"string\", description: \"Target Git repository\" },\n destination: { type: \"string\", description: \"New restoration directory\" },\n side: { type: \"string\", description: \"Transfer side: previous or incoming\" },\n engine: { type: \"string\", description: \"Container engine: docker or podman\" },\n file: { type: \"string\", description: \"Container recipe path\" },\n image: { type: \"string\", description: \"Container image name\" },\n uid: { type: \"string\", description: \"Container user ID\" },\n gid: { type: \"string\", description: \"Container group ID\" },\n} as const;\n\nexport const commandOptions = {\n init: {\n description: \"Create a standalone workflow project\",\n options: [\n \"yes\",\n \"agent\",\n \"provider\",\n \"manager\",\n \"authentication\",\n \"model\",\n \"base-url\",\n \"api-key-env\",\n \"install\",\n \"build\",\n \"image\",\n \"directory\",\n \"repository\",\n ],\n },\n doctor: {\n description: \"Diagnose host and sandbox prerequisites\",\n options: [\"provider\", \"agent\", \"image\", \"json\"],\n },\n \"image build\": {\n description: \"Build a container image\",\n options: [\"directory\", \"engine\", \"file\", \"image\", \"uid\", \"gid\"],\n },\n \"image remove\": {\n description: \"Remove a container image\",\n options: [\"directory\", \"engine\", \"image\"],\n },\n \"recovery inspect\": {\n description: \"Inspect recovery inventory\",\n options: [\"repository\", \"max-entries\", \"git\", \"locks\", \"resources\", \"json\"],\n },\n \"recovery verify\": {\n description: \"Verify a retained transfer\",\n options: [\n \"directory\",\n \"checksums\",\n \"max-bytes\",\n \"restorability\",\n \"repository\",\n \"json\",\n ],\n },\n \"recovery restore\": {\n description: \"Restore a retained transfer\",\n options: [\n \"directory\",\n \"repository\",\n \"destination\",\n \"side\",\n \"max-bytes\",\n \"apply\",\n \"json\",\n ],\n },\n \"recovery prune\": {\n description: \"Apply an explicit retention policy\",\n options: [\"policy\", \"repository\", \"apply\", \"json\"],\n },\n} as const;\n\nexport const initializationQuestions = [\n {\n key: \"agent\",\n message: \"Coding agent\",\n choices: [\"codex\", \"claude\", \"gemini\"],\n },\n {\n key: \"provider\",\n message: \"Sandbox provider\",\n choices: [\"docker\", \"podman\", \"vercel\", \"daytona\", \"local\"],\n },\n] as const;\n\nexport const authenticationChoices = {\n codex: [\n { value: \"api-key\", label: \"OpenAI API key (API billing)\" },\n { value: \"login\", label: \"Existing Codex account login\" },\n ],\n claude: [\n { value: \"api-key\", label: \"Anthropic API key (API billing)\" },\n {\n value: \"oauth-token\",\n label: \"Claude subscription token (claude setup-token)\",\n },\n ],\n gemini: [{ value: \"api-key\", label: \"Gemini API key\" }],\n} as const;\n"]}
@@ -1,12 +1,13 @@
1
1
  import { readFile } from "node:fs/promises";
2
- import { agentEnvironment, imageRecipe, providerPackages, } from "./scaffold.constants.js";
2
+ import { imageRecipe, providerPackages } from "./scaffold.constants.js";
3
+ import { authenticationEnvironment } from "./init-authentication.js";
3
4
  import { starter } from "./starters.js";
4
5
  export async function scaffoldFiles(options, hasPackage, extension) {
5
- const agent = options.agent ?? "codex", provider = options.provider ?? "docker";
6
+ const provider = options.provider ?? "docker";
6
7
  const files = {
7
8
  [`run.${extension}`]: starter(options),
8
9
  "brief.md": "Objective: {{OBJECTIVE}}\n\nWork on {{WORK_BRANCH}} from {{BASE_BRANCH}}. Inspect the repository, implement the objective, run relevant tests and commit your changes. When finished, write <outpost>done</outpost>.\n",
9
- ".env.example": agentEnvironment[agent],
10
+ ".env.example": authenticationEnvironment(options),
10
11
  ".gitignore": "node_modules/\n.env\n.outpost/workspaces/\n.outpost/locks/\n.outpost/recovery/\n.outpost/logs/\n",
11
12
  };
12
13
  if (provider === "docker" || provider === "podman")
@@ -1 +1 @@
1
- {"version":3,"file":"scaffold-files.js","sourceRoot":"","sources":["../../src/cli/scaffold-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,OAAoB,EACpB,UAAmB,EACnB,S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IACb,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport {\n agentEnvironment,\n imageRecipe,\n providerPackages,\n} from \"./scaffold.constants.ts\";\nimport type { InitOptions } from \"./scaffold.types.ts\";\nimport { starter } from \"./starters.ts\";\n\nexport async function scaffoldFiles(\n options: InitOptions,\n hasPackage: boolean,\n extension: \"ts\" | \"mts\",\n): Promise<Record<string, string>> {\n const agent = options.agent ?? \"codex\",\n provider = options.provider ?? \"docker\";\n const files: Record<string, string> = {\n [`run.${extension}`]: starter(options),\n \"brief.md\":\n \"Objective: {{OBJECTIVE}}\\n\\nWork on {{WORK_BRANCH}} from {{BASE_BRANCH}}. Inspect the repository, implement the objective, run relevant tests and commit your changes. When finished, write <outpost>done</outpost>.\\n\",\n \".env.example\": agentEnvironment[agent],\n \".gitignore\":\n \"node_modules/\\n.env\\n.outpost/workspaces/\\n.outpost/locks/\\n.outpost/recovery/\\n.outpost/logs/\\n\",\n };\n if (provider === \"docker\" || provider === \"podman\")\n files[provider === \"docker\" ? \"Dockerfile\" : \"Containerfile\"] = imageRecipe;\n\n if (!hasPackage) {\n const manifest = JSON.parse(\n await readFile(new URL(\"../../package.json\", import.meta.url), \"utf8\"),\n );\n files[\"package.json\"] =\n JSON.stringify(\n {\n private: true,\n type: \"module\",\n scripts: { start: `node run.${extension}` },\n engines: { node: \">=24\" },\n devDependencies: {\n \"@elie-laloum/outpost\": `^${manifest.version}`,\n ...Object.fromEntries(\n providerPackages[provider].map((name) => [\n name,\n manifest.peerDependencies[name],\n ]),\n ),\n },\n },\n null,\n 2,\n ) + \"\\n\";\n }\n return files;\n}\n"]}
1
+ {"version":3,"file":"scaffold-files.js","sourceRoot":"","sources":["../../src/cli/scaffold-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CA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AAI;wBACJ,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC;qBAChC,CAAC,CACH;iBACF;aACF,EACD,IAAI,EACJ,CAAC,CACF,GAAG,IAAI,CAAC;IACb,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport { imageRecipe, providerPackages } from \"./scaffold.constants.ts\";\nimport type { InitOptions } from \"./scaffold.types.ts\";\nimport { authenticationEnvironment } from \"./init-authentication.ts\";\nimport { starter } from \"./starters.ts\";\n\nexport async function scaffoldFiles(\n options: InitOptions,\n hasPackage: boolean,\n extension: \"ts\" | \"mts\",\n): Promise<Record<string, string>> {\n const provider = options.provider ?? \"docker\";\n const files: Record<string, string> = {\n [`run.${extension}`]: starter(options),\n \"brief.md\":\n \"Objective: {{OBJECTIVE}}\\n\\nWork on {{WORK_BRANCH}} from {{BASE_BRANCH}}. Inspect the repository, implement the objective, run relevant tests and commit your changes. When finished, write <outpost>done</outpost>.\\n\",\n \".env.example\": authenticationEnvironment(options),\n \".gitignore\":\n \"node_modules/\\n.env\\n.outpost/workspaces/\\n.outpost/locks/\\n.outpost/recovery/\\n.outpost/logs/\\n\",\n };\n if (provider === \"docker\" || provider === \"podman\")\n files[provider === \"docker\" ? \"Dockerfile\" : \"Containerfile\"] = imageRecipe;\n\n if (!hasPackage) {\n const manifest = JSON.parse(\n await readFile(new URL(\"../../package.json\", import.meta.url), \"utf8\"),\n );\n files[\"package.json\"] =\n JSON.stringify(\n {\n private: true,\n type: \"module\",\n scripts: { start: `node run.${extension}` },\n engines: { node: \">=24\" },\n devDependencies: {\n \"@elie-laloum/outpost\": `^${manifest.version}`,\n ...Object.fromEntries(\n providerPackages[provider].map((name) => [\n name,\n manifest.peerDependencies[name],\n ]),\n ),\n },\n },\n null,\n 2,\n ) + \"\\n\";\n }\n return files;\n}\n"]}
@@ -1,8 +1,27 @@
1
+ import { codex } from "../adapters/agents/codex-adapter.js";
1
2
  import { invariant } from "../domain/errors.js";
2
3
  import { supportedAgents, supportedProviders } from "./scaffold.constants.js";
3
4
  export function validateInitialization(options) {
4
5
  const agent = options.agent ?? "codex", provider = options.provider ?? "docker";
5
6
  invariant(supportedAgents.includes(agent), "Choose codex, claude or gemini");
6
7
  invariant(supportedProviders.includes(provider), "Unknown sandbox provider");
8
+ invariant(!options.apiKeyEnvironment || options.baseUrl, "--api-key-env requires --base-url");
9
+ if (options.baseUrl) {
10
+ invariant(agent === "codex" &&
11
+ (!options.authentication || options.authentication === "api-key"), "Custom Responses providers require Codex and api-key authentication");
12
+ codex({
13
+ ...(options.model ? { model: options.model } : {}),
14
+ modelProvider: {
15
+ baseUrl: options.baseUrl,
16
+ ...(options.apiKeyEnvironment
17
+ ? { apiKeyEnvironment: options.apiKeyEnvironment }
18
+ : {}),
19
+ },
20
+ });
21
+ }
22
+ const authentication = options.authentication ?? "api-key";
23
+ invariant(authentication === "api-key" ||
24
+ (authentication === "oauth-token" && agent === "claude") ||
25
+ (authentication === "login" && agent === "codex"), "Authentication must be api-key, oauth-token for Claude, or login for Codex");
7
26
  }
8
27
  //# sourceMappingURL=scaffold-validation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"scaffold-validation.js","sourceRoot":"","sources":["../../src/cli/scaffold-validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAG9E,MAAM,UAAU,sBAAsB,CAAC,OAAoB;IACzD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,EACpC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAAC;IAC1C,SAAS,CAAC,eAAe,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,gCAAgC,CAAC,CAAC;IAC7E,SAAS,CAAC,kBAAkB,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,0BAA0B,CAAC,CAAC;AAC/E,CAAC","sourcesContent":["import { invariant } from \"../domain/errors.ts\";\nimport { supportedAgents, supportedProviders } from \"./scaffold.constants.ts\";\nimport type { InitOptions } from \"./scaffold.types.ts\";\n\nexport function validateInitialization(options: InitOptions): void {\n const agent = options.agent ?? \"codex\",\n provider = options.provider ?? \"docker\";\n invariant(supportedAgents.includes(agent), \"Choose codex, claude or gemini\");\n invariant(supportedProviders.includes(provider), \"Unknown sandbox provider\");\n}\n"]}
1
+ {"version":3,"file":"scaffold-validation.js","sourceRoot":"","sources":["../../src/cli/scaffold-validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAG9E,MAAM,UAAU,sBAAsB,CAAC,OAAoB;IACzD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,EACpC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAAC;IAC1C,SAAS,CAAC,eAAe,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,gCAAgC,CAAC,CAAC;IAC7E,SAAS,CAAC,kBAAkB,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,0BAA0B,CAAC,CAAC;IAC7E,SAAS,CACP,CAAC,OAAO,CAAC,iBAAiB,IAAI,OAAO,CAAC,OAAO,EAC7C,mCAAmC,CACpC,CAAC;IACF,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;QACpB,SAAS,CACP,KAAK,KAAK,OAAO;YACf,CAAC,CAAC,OAAO,CAAC,cAAc,IAAI,OAAO,CAAC,cAAc,KAAK,SAAS,CAAC,EACnE,qEAAqE,CACtE,CAAC;QACF,KAAK,CAAC;YACJ,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAClD,aAAa,EAAE;gBACb,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,GAAG,CAAC,OAAO,CAAC,iBAAiB;oBAC3B,CAAC,CAAC,EAAE,iBAAiB,EAAE,OAAO,CAAC,iBAAiB,EAAE;oBAClD,CAAC,CAAC,EAAE,CAAC;aACR;SACF,CAAC,CAAC;IACL,CAAC;IACD,MAAM,cAAc,GAAG,OAAO,CAAC,cAAc,IAAI,SAAS,CAAC;IAC3D,SAAS,CACP,cAAc,KAAK,SAAS;QAC1B,CAAC,cAAc,KAAK,aAAa,IAAI,KAAK,KAAK,QAAQ,CAAC;QACxD,CAAC,cAAc,KAAK,OAAO,IAAI,KAAK,KAAK,OAAO,CAAC,EACnD,4EAA4E,CAC7E,CAAC;AACJ,CAAC","sourcesContent":["import { codex } from \"../adapters/agents/codex-adapter.ts\";\nimport { invariant } from \"../domain/errors.ts\";\nimport { supportedAgents, supportedProviders } from \"./scaffold.constants.ts\";\nimport type { InitOptions } from \"./scaffold.types.ts\";\n\nexport function validateInitialization(options: InitOptions): void {\n const agent = options.agent ?? \"codex\",\n provider = options.provider ?? \"docker\";\n invariant(supportedAgents.includes(agent), \"Choose codex, claude or gemini\");\n invariant(supportedProviders.includes(provider), \"Unknown sandbox provider\");\n invariant(\n !options.apiKeyEnvironment || options.baseUrl,\n \"--api-key-env requires --base-url\",\n );\n if (options.baseUrl) {\n invariant(\n agent === \"codex\" &&\n (!options.authentication || options.authentication === \"api-key\"),\n \"Custom Responses providers require Codex and api-key authentication\",\n );\n codex({\n ...(options.model ? { model: options.model } : {}),\n modelProvider: {\n baseUrl: options.baseUrl,\n ...(options.apiKeyEnvironment\n ? { apiKeyEnvironment: options.apiKeyEnvironment }\n : {}),\n },\n });\n }\n const authentication = options.authentication ?? \"api-key\";\n invariant(\n authentication === \"api-key\" ||\n (authentication === \"oauth-token\" && agent === \"claude\") ||\n (authentication === \"login\" && agent === \"codex\"),\n \"Authentication must be api-key, oauth-token for Claude, or login for Codex\",\n );\n}\n"]}
@@ -1,9 +1,4 @@
1
1
  export declare const imageRecipe: string;
2
- export declare const agentEnvironment: {
3
- readonly codex: "OPENAI_API_KEY=\n";
4
- readonly claude: "ANTHROPIC_API_KEY=\n";
5
- readonly gemini: "GEMINI_API_KEY=\n";
6
- };
7
2
  export declare const supportedAgents: readonly string[];
8
3
  export declare const supportedProviders: readonly string[];
9
4
  export declare const supportedManagers: readonly string[];
@@ -10,11 +10,6 @@ ENV HOME=/home/agent
10
10
  USER $AGENT_UID:$AGENT_GID
11
11
  WORKDIR /workspace
12
12
  `;
13
- export const agentEnvironment = {
14
- codex: "OPENAI_API_KEY=\n",
15
- claude: "ANTHROPIC_API_KEY=\n",
16
- gemini: "GEMINI_API_KEY=\n",
17
- };
18
13
  export const supportedAgents = ["codex", "claude", "gemini"];
19
14
  export const supportedProviders = [
20
15
  "docker",
@@ -1 +1 @@
1
- {"version":3,"file":"scaffold.constants.js","sourceRoot":"","sources":["../../src/cli/scaffold.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,MAAM,CAAC,MAAM,WAAW,GAAG;;;;6EAIkD,aAAa,CAAC,KAAK,8BAA8B,aAAa,CAAC,MAAM,uBAAuB,aAAa,CAAC,MAAM;;;;;;CAM5L,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,KAAK,EAAE,mBAAmB;IAC1B,MAAM,EAAE,sBAAsB;IAC9B,MAAM,EAAE,mBAAmB;CACnB,CAAC;AAEX,MAAM,CAAC,MAAM,eAAe,GAAsB,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAChF,MAAM,CAAC,MAAM,kBAAkB,GAAsB;IACnD,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,OAAO;CACR,CAAC;AACF,MAAM,CAAC,MAAM,iBAAiB,GAAsB;IAClD,KAAK;IACL,MAAM;IACN,MAAM;IACN,KAAK;CACN,CAAC;AACF,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAC1B,CAAC,WAAW,EAAE,MAAM,CAAC;IACrB,CAAC,UAAU,EAAE,KAAK,CAAC;IACnB,CAAC,WAAW,EAAE,KAAK,CAAC;CACZ,CAAC;AACX,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,MAAM,EAAE,EAAE;IACV,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,EAAE;IACT,MAAM,EAAE,CAAC,iBAAiB,CAAC;IAC3B,OAAO,EAAE,CAAC,cAAc,CAAC;CACjB,CAAC","sourcesContent":["import { agentVersions } from \"../providers/versions.ts\";\n\nexport const imageRecipe = `FROM node:24-bookworm-slim\nARG AGENT_UID=1000\nARG AGENT_GID=1000\nRUN apt-get update && apt-get install -y --no-install-recommends git openssh-client ca-certificates curl procps util-linux python3 && rm -rf /var/lib/apt/lists/*\nRUN npm install -g --allow-scripts=@anthropic-ai/claude-code @openai/codex@${agentVersions.codex} @anthropic-ai/claude-code@${agentVersions.claude} @google/gemini-cli@${agentVersions.gemini}\nRUN groupmod -o -g \"$AGENT_GID\" node && usermod -o -u \"$AGENT_UID\" -g \"$AGENT_GID\" node\nRUN mkdir -p /home/agent && chown \"$AGENT_UID:$AGENT_GID\" /home/agent && chmod 700 /home/agent\nENV HOME=/home/agent\nUSER $AGENT_UID:$AGENT_GID\nWORKDIR /workspace\n`;\n\nexport const agentEnvironment = {\n codex: \"OPENAI_API_KEY=\\n\",\n claude: \"ANTHROPIC_API_KEY=\\n\",\n gemini: \"GEMINI_API_KEY=\\n\",\n} as const;\n\nexport const supportedAgents: readonly string[] = [\"codex\", \"claude\", \"gemini\"];\nexport const supportedProviders: readonly string[] = [\n \"docker\",\n \"podman\",\n \"vercel\",\n \"daytona\",\n \"local\",\n];\nexport const supportedManagers: readonly string[] = [\n \"npm\",\n \"pnpm\",\n \"yarn\",\n \"bun\",\n];\nexport const managerLocks = [\n [\"pnpm-lock.yaml\", \"pnpm\"],\n [\"yarn.lock\", \"yarn\"],\n [\"bun.lock\", \"bun\"],\n [\"bun.lockb\", \"bun\"],\n] as const;\nexport const providerPackages = {\n docker: [],\n podman: [],\n local: [],\n vercel: [\"@vercel/sandbox\"],\n daytona: [\"@daytona/sdk\"],\n} as const;\n"]}
1
+ {"version":3,"file":"scaffold.constants.js","sourceRoot":"","sources":["../../src/cli/scaffold.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,MAAM,CAAC,MAAM,WAAW,GAAG;;;;6EAIkD,aAAa,CAAC,KAAK,8BAA8B,aAAa,CAAC,MAAM,uBAAuB,aAAa,CAAC,MAAM;;;;;;CAM5L,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAsB,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAChF,MAAM,CAAC,MAAM,kBAAkB,GAAsB;IACnD,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,OAAO;CACR,CAAC;AACF,MAAM,CAAC,MAAM,iBAAiB,GAAsB;IAClD,KAAK;IACL,MAAM;IACN,MAAM;IACN,KAAK;CACN,CAAC;AACF,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAC1B,CAAC,WAAW,EAAE,MAAM,CAAC;IACrB,CAAC,UAAU,EAAE,KAAK,CAAC;IACnB,CAAC,WAAW,EAAE,KAAK,CAAC;CACZ,CAAC;AACX,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,MAAM,EAAE,EAAE;IACV,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,EAAE;IACT,MAAM,EAAE,CAAC,iBAAiB,CAAC;IAC3B,OAAO,EAAE,CAAC,cAAc,CAAC;CACjB,CAAC","sourcesContent":["import { agentVersions } from \"../providers/versions.ts\";\n\nexport const imageRecipe = `FROM node:24-bookworm-slim\nARG AGENT_UID=1000\nARG AGENT_GID=1000\nRUN apt-get update && apt-get install -y --no-install-recommends git openssh-client ca-certificates curl procps util-linux python3 && rm -rf /var/lib/apt/lists/*\nRUN npm install -g --allow-scripts=@anthropic-ai/claude-code @openai/codex@${agentVersions.codex} @anthropic-ai/claude-code@${agentVersions.claude} @google/gemini-cli@${agentVersions.gemini}\nRUN groupmod -o -g \"$AGENT_GID\" node && usermod -o -u \"$AGENT_UID\" -g \"$AGENT_GID\" node\nRUN mkdir -p /home/agent && chown \"$AGENT_UID:$AGENT_GID\" /home/agent && chmod 700 /home/agent\nENV HOME=/home/agent\nUSER $AGENT_UID:$AGENT_GID\nWORKDIR /workspace\n`;\n\nexport const supportedAgents: readonly string[] = [\"codex\", \"claude\", \"gemini\"];\nexport const supportedProviders: readonly string[] = [\n \"docker\",\n \"podman\",\n \"vercel\",\n \"daytona\",\n \"local\",\n];\nexport const supportedManagers: readonly string[] = [\n \"npm\",\n \"pnpm\",\n \"yarn\",\n \"bun\",\n];\nexport const managerLocks = [\n [\"pnpm-lock.yaml\", \"pnpm\"],\n [\"yarn.lock\", \"yarn\"],\n [\"bun.lock\", \"bun\"],\n [\"bun.lockb\", \"bun\"],\n] as const;\nexport const providerPackages = {\n docker: [],\n podman: [],\n local: [],\n vercel: [\"@vercel/sandbox\"],\n daytona: [\"@daytona/sdk\"],\n} as const;\n"]}
@@ -15,6 +15,19 @@ export async function initialize(options = {}, executor) {
15
15
  const provider = options.provider ?? "docker";
16
16
  validateInitialization(options);
17
17
  const { hasPackage, manager, extension } = await projectSettings(root, options);
18
+ if (options.install) {
19
+ try {
20
+ await requireSuccess(process.platform === "win32"
21
+ ? {
22
+ executable: "cmd.exe",
23
+ arguments: ["/d", "/c", `${manager} --version`],
24
+ }
25
+ : { executable: manager, arguments: ["--version"] }, executor);
26
+ }
27
+ catch {
28
+ throw new OutpostError("configuration", `Package manager ${manager} is unavailable. Install it or select an installed manager with --manager before using --install.`);
29
+ }
30
+ }
18
31
  const files = await scaffoldFiles({ ...options, image: options.image ?? imageName(root) }, hasPackage, extension);
19
32
  const existingIgnore = await readFile(join(root, ".gitignore"), "utf8").catch((error) => {
20
33
  if (error.code === "ENOENT")
@@ -1 +1 @@
1
- {"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../../src/cli/scaffold.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,KAAK,EACL,KAAK,EACL,QAAQ,EACR,SAAS,GACV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3D,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,UAAuB,EAAE,EACzB,QAAmB;IAEnB,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IACzD,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAAC;IAC9C,sBAAsB,CAAC,OAAO,CAAC,CAAC;IAChC,MAAM,EAAE,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SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACrD,SAAS,EAAE,IAAI;aAChB;YACH,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,EAC7D,QAAQ,CACT,CAAC;IACJ,CAAC;IACD,IAAI,OAAO,CAAC,KAAK,IAAI,CAAC,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,QAAQ,CAAC;QACnE,MAAM,WAAW,CACf,OAAO,EACP;YACE,SAAS,EAAE,IAAI;YACf,MAAM,EAAE,QAAQ;YAChB,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACnD,EACD,QAAQ,CACT,CAAC;IACJ,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACzD,GAAG,EAAE,YAAY,SAAS,EAAE;KAC7B,CAAC;AACJ,CAAC","sourcesContent":["import {\n appendFile,\n lstat,\n mkdir,\n readFile,\n writeFile,\n} from \"node:fs/promises\";\nimport { join, resolve } from \"node:path\";\nimport { OutpostError } from \"../domain/errors.ts\";\nimport { requireSuccess } from \"../infrastructure/process.ts\";\nimport type { Executor } from \"../infrastructure/process.types.ts\";\nimport { imageName } from \"../providers/container.ts\";\nimport { manageImage } from \"./image.ts\";\nimport { projectSettings } from \"./project-settings.ts\";\nimport { scaffoldFiles } from \"./scaffold-files.ts\";\nimport { validateInitialization } from \"./scaffold-validation.ts\";\nimport { providerPackages } from \"./scaffold.constants.ts\";\nimport type { InitOptions, ScaffoldResult } from \"./scaffold.types.ts\";\n\nexport { manageImage } from \"./image.ts\";\nexport { imageRecipe } from \"./scaffold.constants.ts\";\nexport type { InitOptions } from \"./scaffold.types.ts\";\n\nexport async function initialize(\n options: InitOptions = {},\n executor?: Executor,\n): Promise<ScaffoldResult> {\n const root = resolve(options.directory ?? process.cwd());\n const provider = options.provider ?? \"docker\";\n validateInitialization(options);\n const { hasPackage, manager, extension } = await projectSettings(\n root,\n options,\n );\n const files = await scaffoldFiles(\n { ...options, image: options.image ?? imageName(root) },\n hasPackage,\n extension,\n );\n const existingIgnore = await readFile(join(root, \".gitignore\"), \"utf8\").catch(\n (error) => {\n if (error.code === \"ENOENT\") return undefined;\n throw error;\n },\n );\n const ignore = files[\".gitignore\"]!;\n if (existingIgnore !== undefined) delete files[\".gitignore\"];\n for (const name of Object.keys(files))\n if (\n await lstat(join(root, name))\n .then(() => true)\n .catch((error) => {\n if (error.code === \"ENOENT\") return false;\n throw error;\n })\n )\n throw new OutpostError(\n \"configuration\",\n `Initialization would overwrite ${name}`,\n );\n await mkdir(root, { recursive: true });\n for (const [name, content] of Object.entries(files))\n await writeFile(join(root, name), content, { flag: \"wx\" });\n if (existingIgnore !== undefined) {\n const rules = new Set(existingIgnore.split(/\\r?\\n/));\n const additions = ignore\n .trimEnd()\n .split(\"\\n\")\n .filter((rule) => !rules.has(rule));\n if (additions.length) {\n const suffix = `${existingIgnore && !existingIgnore.endsWith(\"\\n\") ? \"\\n\" : \"\"}${additions.join(\"\\n\")}\\n`;\n await appendFile(join(root, \".gitignore\"), suffix);\n files[\".gitignore\"] = existingIgnore + suffix;\n }\n }\n if (options.install) {\n const packages = [\"@elie-laloum/outpost\", ...providerPackages[provider]];\n const args =\n manager === \"npm\"\n ? [\"install\", \"--save-dev\", ...packages]\n : [\"add\", \"--dev\", ...packages];\n await requireSuccess(\n process.platform === \"win32\"\n ? {\n executable: \"cmd.exe\",\n arguments: [\"/d\", \"/c\", [manager, ...args].join(\" \")],\n directory: root,\n }\n : { executable: manager, arguments: args, directory: root },\n executor,\n );\n }\n if (options.build && (provider === \"docker\" || provider === \"podman\"))\n await manageImage(\n \"build\",\n {\n directory: root,\n engine: provider,\n ...(options.image ? { image: options.image } : {}),\n },\n executor,\n );\n return {\n files: Object.keys(files).map((name) => join(root, name)),\n run: `node run.${extension}`,\n };\n}\n"]}
1
+ {"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../../src/cli/scaffold.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,KAAK,EACL,KAAK,EACL,QAAQ,EACR,SAAS,GACV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3D,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,UAAuB,EAAE,EACzB,QAAmB;IAEnB,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IACzD,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAAC;IAC9C,sBAAsB,CAAC,OAAO,CAAC,CAAC;IAChC,MAAM,EAAE,UAAU,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QACzD,GAAG,EAAE,YAAY,SAAS,EAAE;KAC7B,CAAC;AACJ,CAAC","sourcesContent":["import {\n appendFile,\n lstat,\n mkdir,\n readFile,\n writeFile,\n} from \"node:fs/promises\";\nimport { join, resolve } from \"node:path\";\nimport { OutpostError } from \"../domain/errors.ts\";\nimport { requireSuccess } from \"../infrastructure/process.ts\";\nimport type { Executor } from \"../infrastructure/process.types.ts\";\nimport { imageName } from \"../providers/container.ts\";\nimport { manageImage } from \"./image.ts\";\nimport { projectSettings } from \"./project-settings.ts\";\nimport { scaffoldFiles } from \"./scaffold-files.ts\";\nimport { validateInitialization } from \"./scaffold-validation.ts\";\nimport { providerPackages } from \"./scaffold.constants.ts\";\nimport type { InitOptions, ScaffoldResult } from \"./scaffold.types.ts\";\n\nexport { manageImage } from \"./image.ts\";\nexport { imageRecipe } from \"./scaffold.constants.ts\";\nexport type { InitOptions } from \"./scaffold.types.ts\";\n\nexport async function initialize(\n options: InitOptions = {},\n executor?: Executor,\n): Promise<ScaffoldResult> {\n const root = resolve(options.directory ?? process.cwd());\n const provider = options.provider ?? \"docker\";\n validateInitialization(options);\n const { hasPackage, manager, extension } = await projectSettings(\n root,\n options,\n );\n if (options.install) {\n try {\n await requireSuccess(\n process.platform === \"win32\"\n ? {\n executable: \"cmd.exe\",\n arguments: [\"/d\", \"/c\", `${manager} --version`],\n }\n : { executable: manager, arguments: [\"--version\"] },\n executor,\n );\n } catch {\n throw new OutpostError(\n \"configuration\",\n `Package manager ${manager} is unavailable. Install it or select an installed manager with --manager before using --install.`,\n );\n }\n }\n const files = await scaffoldFiles(\n { ...options, image: options.image ?? imageName(root) },\n hasPackage,\n extension,\n );\n const existingIgnore = await readFile(join(root, \".gitignore\"), \"utf8\").catch(\n (error) => {\n if (error.code === \"ENOENT\") return undefined;\n throw error;\n },\n );\n const ignore = files[\".gitignore\"]!;\n if (existingIgnore !== undefined) delete files[\".gitignore\"];\n for (const name of Object.keys(files))\n if (\n await lstat(join(root, name))\n .then(() => true)\n .catch((error) => {\n if (error.code === \"ENOENT\") return false;\n throw error;\n })\n )\n throw new OutpostError(\n \"configuration\",\n `Initialization would overwrite ${name}`,\n );\n await mkdir(root, { recursive: true });\n for (const [name, content] of Object.entries(files))\n await writeFile(join(root, name), content, { flag: \"wx\" });\n if (existingIgnore !== undefined) {\n const rules = new Set(existingIgnore.split(/\\r?\\n/));\n const additions = ignore\n .trimEnd()\n .split(\"\\n\")\n .filter((rule) => !rules.has(rule));\n if (additions.length) {\n const suffix = `${existingIgnore && !existingIgnore.endsWith(\"\\n\") ? \"\\n\" : \"\"}${additions.join(\"\\n\")}\\n`;\n await appendFile(join(root, \".gitignore\"), suffix);\n files[\".gitignore\"] = existingIgnore + suffix;\n }\n }\n if (options.install) {\n const packages = [\"@elie-laloum/outpost\", ...providerPackages[provider]];\n const args =\n manager === \"npm\"\n ? [\"install\", \"--save-dev\", ...packages]\n : [\"add\", \"--dev\", ...packages];\n await requireSuccess(\n process.platform === \"win32\"\n ? {\n executable: \"cmd.exe\",\n arguments: [\"/d\", \"/c\", [manager, ...args].join(\" \")],\n directory: root,\n }\n : { executable: manager, arguments: args, directory: root },\n executor,\n );\n }\n if (options.build && (provider === \"docker\" || provider === \"podman\"))\n await manageImage(\n \"build\",\n {\n directory: root,\n engine: provider,\n ...(options.image ? { image: options.image } : {}),\n },\n executor,\n );\n return {\n files: Object.keys(files).map((name) => join(root, name)),\n run: `node run.${extension}`,\n };\n}\n"]}
@@ -5,6 +5,9 @@ export interface InitOptions {
5
5
  readonly provider?: "docker" | "podman" | "vercel" | "daytona" | "local";
6
6
  readonly manager?: "npm" | "pnpm" | "yarn" | "bun";
7
7
  readonly model?: string;
8
+ readonly baseUrl?: string;
9
+ readonly apiKeyEnvironment?: string;
10
+ readonly authentication?: "api-key" | "oauth-token" | "login";
8
11
  readonly install?: boolean;
9
12
  readonly build?: boolean;
10
13
  readonly image?: string;