spell-runtime 1.0.0 → 1.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.
- package/README.md +100 -7
- package/README.txt +84 -7
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.js +70 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/server.d.ts +19 -0
- package/dist/api/server.js +868 -0
- package/dist/api/server.js.map +1 -0
- package/dist/api/ui.d.ts +2 -0
- package/dist/api/ui.js +474 -0
- package/dist/api/ui.js.map +1 -0
- package/dist/bundle/install.js +9 -0
- package/dist/bundle/install.js.map +1 -1
- package/dist/cli/index.js +53 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/contract/buttonRegistry.d.ts +21 -0
- package/dist/contract/buttonRegistry.js +103 -0
- package/dist/contract/buttonRegistry.js.map +1 -0
- package/dist/logging/executionLog.js +3 -1
- package/dist/logging/executionLog.js.map +1 -1
- package/dist/runner/cast.js +43 -3
- package/dist/runner/cast.js.map +1 -1
- package/dist/runner/dockerRunner.d.ts +9 -0
- package/dist/runner/dockerRunner.js +121 -0
- package/dist/runner/dockerRunner.js.map +1 -0
- package/dist/runner/spell-runner.d.ts +11 -0
- package/dist/runner/spell-runner.js +144 -0
- package/dist/runner/spell-runner.js.map +1 -0
- package/dist/signature/bundleDigest.d.ts +6 -0
- package/dist/signature/bundleDigest.js +89 -0
- package/dist/signature/bundleDigest.js.map +1 -0
- package/dist/signature/signatureFile.d.ts +12 -0
- package/dist/signature/signatureFile.js +79 -0
- package/dist/signature/signatureFile.js.map +1 -0
- package/dist/signature/trustStore.d.ts +20 -0
- package/dist/signature/trustStore.js +173 -0
- package/dist/signature/trustStore.js.map +1 -0
- package/dist/signature/verify.d.ts +12 -0
- package/dist/signature/verify.js +119 -0
- package/dist/signature/verify.js.map +1 -0
- package/dist/types.d.ts +8 -0
- package/dist/util/paths.d.ts +2 -0
- package/dist/util/paths.js +9 -0
- package/dist/util/paths.js.map +1 -1
- package/dist/util/platform.d.ts +2 -0
- package/dist/util/platform.js +38 -0
- package/dist/util/platform.js.map +1 -1
- package/dist/util/redact.d.ts +2 -0
- package/dist/util/redact.js +66 -0
- package/dist/util/redact.js.map +1 -0
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -46,7 +46,10 @@ npm run smoke:npx
|
|
|
46
46
|
- `spell install <local-path>`
|
|
47
47
|
- `spell list`
|
|
48
48
|
- `spell inspect <id> [--version x.y.z]`
|
|
49
|
-
- `spell cast <id> [--version x.y.z] [-p key=value ...] [--input input.json] [--dry-run] [--yes] [--allow-billing] [--verbose] [--profile <name>]`
|
|
49
|
+
- `spell cast <id> [--version x.y.z] [-p key=value ...] [--input input.json] [--dry-run] [--yes] [--allow-billing] [--require-signature] [--verbose] [--profile <name>]`
|
|
50
|
+
- `spell trust add <publisher> <public-key> [--key-id default]`
|
|
51
|
+
- `spell trust list`
|
|
52
|
+
- `spell trust remove <publisher>`
|
|
50
53
|
- `spell log <execution-id>`
|
|
51
54
|
|
|
52
55
|
## Storage Layout
|
|
@@ -72,6 +75,7 @@ Consistency rule:
|
|
|
72
75
|
- bundle resolution by id (and optional version)
|
|
73
76
|
- input assembly (`--input` + `-p` overrides)
|
|
74
77
|
- JSON Schema validation by Ajv
|
|
78
|
+
- optional signature verification (`--require-signature`)
|
|
75
79
|
- platform guard
|
|
76
80
|
- risk guard (`high`/`critical` requires `--yes`)
|
|
77
81
|
- billing guard (`billing.enabled` requires `--allow-billing`)
|
|
@@ -82,14 +86,17 @@ If `--dry-run` is set, command exits after summary and validation.
|
|
|
82
86
|
|
|
83
87
|
## Runtime Model
|
|
84
88
|
|
|
85
|
-
v1 supports
|
|
89
|
+
v1 supports:
|
|
86
90
|
|
|
87
91
|
- host: steps run in order, shell/http supported.
|
|
88
|
-
- docker:
|
|
92
|
+
- docker: steps run in a linux container via "runner-in-image".
|
|
89
93
|
|
|
90
|
-
|
|
94
|
+
Docker mode (v1) details:
|
|
91
95
|
|
|
92
|
-
- docker
|
|
96
|
+
- `runtime.execution=docker` requires `runtime.docker_image`.
|
|
97
|
+
- the image must provide `spell-runner` on `PATH` (this repo publishes it as a second npm bin).
|
|
98
|
+
- the bundle is mounted read-only at `/spell`; the runner copies it into a writable temp workdir before executing steps.
|
|
99
|
+
- environment variables passed from host -> container are restricted to connector tokens only (`CONNECTOR_<NAME>_TOKEN`). If your spell needs `{{ENV.*}}` for other values, provide them inside the image (or extend the runtime later).
|
|
93
100
|
|
|
94
101
|
## Windows Policy
|
|
95
102
|
|
|
@@ -111,11 +118,31 @@ Use these `effect.type` words where possible:
|
|
|
111
118
|
## v1 Limitations (Intentionally Not Implemented)
|
|
112
119
|
|
|
113
120
|
- name search or ambiguous resolution (id only)
|
|
114
|
-
- registry/marketplace/
|
|
121
|
+
- registry/marketplace/license verification
|
|
122
|
+
- signature signing UX (keygen/sign commands)
|
|
115
123
|
- real billing execution (Stripe)
|
|
116
124
|
- DAG/parallel/rollback/self-healing
|
|
117
125
|
- advanced templating language (only `{{INPUT.*}}` and `{{ENV.*}}`)
|
|
118
|
-
- docker
|
|
126
|
+
- docker env passthrough beyond connector tokens
|
|
127
|
+
|
|
128
|
+
## Signature (Verify-Only)
|
|
129
|
+
|
|
130
|
+
If a bundle contains `spell.sig.json`, you can require signature verification at execution time:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
spell cast <id> --require-signature ...
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Trust store:
|
|
137
|
+
|
|
138
|
+
- `spell trust add <publisher> <public-key>`
|
|
139
|
+
- `spell trust list`
|
|
140
|
+
- `spell trust remove <publisher>`
|
|
141
|
+
|
|
142
|
+
Notes:
|
|
143
|
+
|
|
144
|
+
- publisher is derived from the spell id prefix before the first `/` (example: `samples/call-webhook` -> `samples`).
|
|
145
|
+
- public key format is ed25519 `spki` DER encoded as base64url.
|
|
119
146
|
|
|
120
147
|
## Example Flow
|
|
121
148
|
|
|
@@ -128,9 +155,75 @@ spell cast fixtures/hello-host -p name=world
|
|
|
128
155
|
spell log <execution-id>
|
|
129
156
|
```
|
|
130
157
|
|
|
158
|
+
## Real-Use Sample Spells
|
|
159
|
+
|
|
160
|
+
These are product-facing examples (separate from test fixtures):
|
|
161
|
+
|
|
162
|
+
- `/Users/koichinishizuka/spell-runtime/examples/spells/call-webhook`
|
|
163
|
+
- `/Users/koichinishizuka/spell-runtime/examples/spells/repo-ops`
|
|
164
|
+
- `/Users/koichinishizuka/spell-runtime/examples/spells/publish-site`
|
|
165
|
+
|
|
166
|
+
Quick try:
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
spell install ./examples/spells/call-webhook
|
|
170
|
+
spell inspect samples/call-webhook
|
|
171
|
+
spell cast samples/call-webhook --dry-run -p event=deploy -p source=manual -p payload='{"service":"web"}'
|
|
172
|
+
```
|
|
173
|
+
|
|
131
174
|
## UI Connection Spec
|
|
132
175
|
|
|
133
176
|
- Decision-complete button integration spec:
|
|
134
177
|
- `/Users/koichinishizuka/spell-runtime/docs/ui-connection-spec-v1.md`
|
|
135
178
|
- Sample button registry:
|
|
136
179
|
- `/Users/koichinishizuka/spell-runtime/examples/button-registry.v1.json`
|
|
180
|
+
- Button registry schema:
|
|
181
|
+
- `/Users/koichinishizuka/spell-runtime/examples/button-registry.v1.schema.json`
|
|
182
|
+
- Registry optional policy:
|
|
183
|
+
- `require_signature` (when true, Execution API adds `--require-signature`)
|
|
184
|
+
|
|
185
|
+
## Runtime Decision Log
|
|
186
|
+
|
|
187
|
+
- `/Users/koichinishizuka/spell-runtime/docs/runtime-decisions-v1.md`
|
|
188
|
+
|
|
189
|
+
## Execution API (Async)
|
|
190
|
+
|
|
191
|
+
Start API server:
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
npm run api:dev
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
By default it listens on `:8787` and reads:
|
|
198
|
+
- button registry: `./examples/button-registry.v1.json`
|
|
199
|
+
- limits:
|
|
200
|
+
- request body: `64KB`
|
|
201
|
+
- execution timeout: `60s`
|
|
202
|
+
- in-flight executions: `4`
|
|
203
|
+
- execution index persistence: `~/.spell/logs/index.json`
|
|
204
|
+
- routes:
|
|
205
|
+
- `GET /` (minimal Receipts UI)
|
|
206
|
+
- `GET /ui/app.js` (UI client script)
|
|
207
|
+
- `GET /api/buttons`
|
|
208
|
+
- `GET /api/spell-executions` (`status`, `button_id`, `limit` query supported)
|
|
209
|
+
- `POST /api/spell-executions`
|
|
210
|
+
- `GET /api/spell-executions/:execution_id`
|
|
211
|
+
|
|
212
|
+
Optional environment variables:
|
|
213
|
+
- `SPELL_API_PORT`
|
|
214
|
+
- `SPELL_BUTTON_REGISTRY_PATH`
|
|
215
|
+
- `SPELL_API_AUTH_KEYS` (comma-separated `role=token` entries; when set, `/api/*` requires auth and derives `actor_role` from token)
|
|
216
|
+
- `SPELL_API_AUTH_TOKENS` (legacy: comma-separated tokens; when set, `/api/*` requires auth but does not bind role)
|
|
217
|
+
- `SPELL_API_BODY_LIMIT_BYTES`
|
|
218
|
+
- `SPELL_API_EXECUTION_TIMEOUT_MS`
|
|
219
|
+
- `SPELL_API_RATE_LIMIT_WINDOW_MS`
|
|
220
|
+
- `SPELL_API_RATE_LIMIT_MAX_REQUESTS`
|
|
221
|
+
- `SPELL_API_MAX_CONCURRENT_EXECUTIONS`
|
|
222
|
+
- `SPELL_API_LOG_RETENTION_DAYS` (default `14`, `0` disables age-based pruning)
|
|
223
|
+
- `SPELL_API_LOG_MAX_FILES` (default `500`, `0` disables count-based pruning)
|
|
224
|
+
|
|
225
|
+
Security note:
|
|
226
|
+
- execution logs redact secret-like keys (`token`, `authorization`, `apiKey`, etc.)
|
|
227
|
+
- environment-derived secret values are masked in persisted logs
|
|
228
|
+
- when auth is enabled, pass `Authorization: Bearer <token>` (or `x-api-key`) for `/api` routes
|
|
229
|
+
- do not set both `SPELL_API_AUTH_KEYS` and `SPELL_API_AUTH_TOKENS` at the same time
|
package/README.txt
CHANGED
|
@@ -33,7 +33,10 @@ Manual npx (local package):
|
|
|
33
33
|
- spell install <local-path>
|
|
34
34
|
- spell list
|
|
35
35
|
- spell inspect <id> [--version x.y.z]
|
|
36
|
-
- spell cast <id> [--version x.y.z] [-p key=value ...] [--input input.json] [--dry-run] [--yes] [--allow-billing] [--verbose] [--profile <name>]
|
|
36
|
+
- spell cast <id> [--version x.y.z] [-p key=value ...] [--input input.json] [--dry-run] [--yes] [--allow-billing] [--require-signature] [--verbose] [--profile <name>]
|
|
37
|
+
- spell trust add <publisher> <public-key> [--key-id default]
|
|
38
|
+
- spell trust list
|
|
39
|
+
- spell trust remove <publisher>
|
|
37
40
|
- spell log <execution-id>
|
|
38
41
|
|
|
39
42
|
3. Storage layout
|
|
@@ -54,6 +57,7 @@ Cast performs these checks before execution:
|
|
|
54
57
|
- Bundle resolution by id (and optional version)
|
|
55
58
|
- Input assembly (--input + -p overrides)
|
|
56
59
|
- JSON Schema validation by Ajv
|
|
60
|
+
- Optional signature verification (--require-signature)
|
|
57
61
|
- Platform guard
|
|
58
62
|
- Risk guard (high/critical requires --yes)
|
|
59
63
|
- Billing guard (billing.enabled requires --allow-billing)
|
|
@@ -63,12 +67,15 @@ Cast performs these checks before execution:
|
|
|
63
67
|
If --dry-run is set, command exits after summary and validation.
|
|
64
68
|
|
|
65
69
|
5. Runtime model
|
|
66
|
-
v1 supports
|
|
70
|
+
v1 supports:
|
|
67
71
|
- host: steps run in order, shell/http supported.
|
|
68
|
-
- docker:
|
|
72
|
+
- docker: steps run in a linux container via "runner-in-image".
|
|
69
73
|
|
|
70
|
-
|
|
71
|
-
- docker
|
|
74
|
+
Docker mode (v1) details:
|
|
75
|
+
- runtime.execution=docker requires runtime.docker_image.
|
|
76
|
+
- the image must provide spell-runner on PATH (this repo publishes it as a second npm bin).
|
|
77
|
+
- the bundle is mounted read-only at /spell; the runner copies it into a writable temp workdir before executing steps.
|
|
78
|
+
- env vars passed from host -> container are restricted to connector tokens only (CONNECTOR_<NAME>_TOKEN). If your spell needs {{ENV.*}} for other values, provide them inside the image (or extend the runtime later).
|
|
72
79
|
|
|
73
80
|
6. Windows policy
|
|
74
81
|
- host mode does not assume bash/sh.
|
|
@@ -86,11 +93,25 @@ Use these effect.type words where possible:
|
|
|
86
93
|
|
|
87
94
|
8. v1 limitations (intentionally not implemented)
|
|
88
95
|
- name search or ambiguous resolution (id only)
|
|
89
|
-
- registry/marketplace/
|
|
96
|
+
- registry/marketplace/license verification
|
|
97
|
+
- signature signing UX (keygen/sign commands)
|
|
90
98
|
- real billing execution (Stripe)
|
|
91
99
|
- DAG/parallel/rollback/self-healing
|
|
92
100
|
- advanced templating language (only {{INPUT.*}} and {{ENV.*}})
|
|
93
|
-
- docker
|
|
101
|
+
- docker env passthrough beyond connector tokens
|
|
102
|
+
|
|
103
|
+
8.1 Signature (verify-only)
|
|
104
|
+
If a bundle contains spell.sig.json, you can require signature verification at execution time:
|
|
105
|
+
spell cast <id> --require-signature ...
|
|
106
|
+
|
|
107
|
+
Trust store:
|
|
108
|
+
- spell trust add <publisher> <public-key>
|
|
109
|
+
- spell trust list
|
|
110
|
+
- spell trust remove <publisher>
|
|
111
|
+
|
|
112
|
+
Notes:
|
|
113
|
+
- publisher is derived from the spell id prefix before the first / (example: samples/call-webhook -> samples).
|
|
114
|
+
- public key format is ed25519 spki DER encoded as base64url.
|
|
94
115
|
|
|
95
116
|
9. Example flow
|
|
96
117
|
1) Install a local fixture
|
|
@@ -116,6 +137,10 @@ Use these effect.type words where possible:
|
|
|
116
137
|
/Users/koichinishizuka/spell-runtime/docs/ui-connection-spec-v1.md
|
|
117
138
|
- Sample button registry:
|
|
118
139
|
/Users/koichinishizuka/spell-runtime/examples/button-registry.v1.json
|
|
140
|
+
- Button registry schema:
|
|
141
|
+
/Users/koichinishizuka/spell-runtime/examples/button-registry.v1.schema.json
|
|
142
|
+
- Registry optional policy:
|
|
143
|
+
require_signature (when true, Execution API adds --require-signature)
|
|
119
144
|
|
|
120
145
|
11. Install from npm
|
|
121
146
|
Global install:
|
|
@@ -124,3 +149,55 @@ Global install:
|
|
|
124
149
|
|
|
125
150
|
Run with npx:
|
|
126
151
|
npx --yes --package spell-runtime spell --help
|
|
152
|
+
|
|
153
|
+
12. Real-use sample spells
|
|
154
|
+
- /Users/koichinishizuka/spell-runtime/examples/spells/call-webhook
|
|
155
|
+
- /Users/koichinishizuka/spell-runtime/examples/spells/repo-ops
|
|
156
|
+
- /Users/koichinishizuka/spell-runtime/examples/spells/publish-site
|
|
157
|
+
|
|
158
|
+
Quick try:
|
|
159
|
+
spell install ./examples/spells/call-webhook
|
|
160
|
+
spell inspect samples/call-webhook
|
|
161
|
+
spell cast samples/call-webhook --dry-run -p event=deploy -p source=manual -p payload='{"service":"web"}'
|
|
162
|
+
|
|
163
|
+
13. Runtime decision log
|
|
164
|
+
- /Users/koichinishizuka/spell-runtime/docs/runtime-decisions-v1.md
|
|
165
|
+
|
|
166
|
+
14. Execution API (async)
|
|
167
|
+
Start:
|
|
168
|
+
npm run api:dev
|
|
169
|
+
|
|
170
|
+
Defaults:
|
|
171
|
+
- listens on :8787
|
|
172
|
+
- reads registry: ./examples/button-registry.v1.json
|
|
173
|
+
- limits:
|
|
174
|
+
- request body: 64KB
|
|
175
|
+
- execution timeout: 60s
|
|
176
|
+
- in-flight executions: 4
|
|
177
|
+
- execution index persistence: ~/.spell/logs/index.json
|
|
178
|
+
- routes:
|
|
179
|
+
GET /
|
|
180
|
+
GET /ui/app.js
|
|
181
|
+
GET /api/buttons
|
|
182
|
+
GET /api/spell-executions (status/button_id/limit query supported)
|
|
183
|
+
POST /api/spell-executions
|
|
184
|
+
GET /api/spell-executions/:execution_id
|
|
185
|
+
|
|
186
|
+
Optional environment variables:
|
|
187
|
+
- SPELL_API_PORT
|
|
188
|
+
- SPELL_BUTTON_REGISTRY_PATH
|
|
189
|
+
- SPELL_API_AUTH_KEYS (comma-separated role=token entries; when set, /api/* requires auth and derives actor_role from token)
|
|
190
|
+
- SPELL_API_AUTH_TOKENS (legacy: comma-separated tokens; when set, /api/* requires auth but does not bind role)
|
|
191
|
+
- SPELL_API_BODY_LIMIT_BYTES
|
|
192
|
+
- SPELL_API_EXECUTION_TIMEOUT_MS
|
|
193
|
+
- SPELL_API_RATE_LIMIT_WINDOW_MS
|
|
194
|
+
- SPELL_API_RATE_LIMIT_MAX_REQUESTS
|
|
195
|
+
- SPELL_API_MAX_CONCURRENT_EXECUTIONS
|
|
196
|
+
- SPELL_API_LOG_RETENTION_DAYS (default 14, 0 disables age-based pruning)
|
|
197
|
+
- SPELL_API_LOG_MAX_FILES (default 500, 0 disables count-based pruning)
|
|
198
|
+
|
|
199
|
+
Security note:
|
|
200
|
+
- execution logs redact secret-like keys (token, authorization, apiKey, etc.)
|
|
201
|
+
- environment-derived secret values are masked in persisted logs
|
|
202
|
+
- when auth is enabled, pass Authorization: Bearer <token> (or x-api-key) for /api routes
|
|
203
|
+
- do not set both SPELL_API_AUTH_KEYS and SPELL_API_AUTH_TOKENS at the same time
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const server_1 = require("./server");
|
|
4
|
+
async function main() {
|
|
5
|
+
const port = readIntegerEnv("SPELL_API_PORT", 1, 8787);
|
|
6
|
+
const registryPath = process.env.SPELL_BUTTON_REGISTRY_PATH;
|
|
7
|
+
const requestBodyLimitBytes = readOptionalIntegerEnv("SPELL_API_BODY_LIMIT_BYTES", 1);
|
|
8
|
+
const executionTimeoutMs = readOptionalIntegerEnv("SPELL_API_EXECUTION_TIMEOUT_MS", 1);
|
|
9
|
+
const rateLimitWindowMs = readOptionalIntegerEnv("SPELL_API_RATE_LIMIT_WINDOW_MS", 1);
|
|
10
|
+
const rateLimitMaxRequests = readOptionalIntegerEnv("SPELL_API_RATE_LIMIT_MAX_REQUESTS", 1);
|
|
11
|
+
const maxConcurrentExecutions = readOptionalIntegerEnv("SPELL_API_MAX_CONCURRENT_EXECUTIONS", 0);
|
|
12
|
+
const authTokens = readOptionalCsvEnv("SPELL_API_AUTH_TOKENS");
|
|
13
|
+
const authKeys = readOptionalCsvEnv("SPELL_API_AUTH_KEYS");
|
|
14
|
+
const logRetentionDays = readOptionalIntegerEnv("SPELL_API_LOG_RETENTION_DAYS", 0);
|
|
15
|
+
const logMaxFiles = readOptionalIntegerEnv("SPELL_API_LOG_MAX_FILES", 0);
|
|
16
|
+
const started = await (0, server_1.startExecutionApiServer)({
|
|
17
|
+
port,
|
|
18
|
+
registryPath,
|
|
19
|
+
requestBodyLimitBytes,
|
|
20
|
+
executionTimeoutMs,
|
|
21
|
+
rateLimitWindowMs,
|
|
22
|
+
rateLimitMaxRequests,
|
|
23
|
+
maxConcurrentExecutions,
|
|
24
|
+
authTokens,
|
|
25
|
+
authKeys,
|
|
26
|
+
logRetentionDays,
|
|
27
|
+
logMaxFiles
|
|
28
|
+
});
|
|
29
|
+
process.stdout.write(`spell execution api listening on :${started.port}\n`);
|
|
30
|
+
}
|
|
31
|
+
main().catch((error) => {
|
|
32
|
+
process.stderr.write(`${error.message}\n`);
|
|
33
|
+
process.exitCode = 1;
|
|
34
|
+
});
|
|
35
|
+
function readOptionalIntegerEnv(name, min) {
|
|
36
|
+
const raw = process.env[name];
|
|
37
|
+
if (raw === undefined || raw.trim() === "") {
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
return readInteger(name, raw, min);
|
|
41
|
+
}
|
|
42
|
+
function readIntegerEnv(name, min, fallback) {
|
|
43
|
+
const raw = process.env[name];
|
|
44
|
+
if (raw === undefined || raw.trim() === "") {
|
|
45
|
+
return fallback;
|
|
46
|
+
}
|
|
47
|
+
return readInteger(name, raw, min);
|
|
48
|
+
}
|
|
49
|
+
function readInteger(name, raw, min) {
|
|
50
|
+
const num = Number(raw);
|
|
51
|
+
if (!Number.isInteger(num) || num < min) {
|
|
52
|
+
throw new Error(`${name} must be an integer >= ${min}`);
|
|
53
|
+
}
|
|
54
|
+
return num;
|
|
55
|
+
}
|
|
56
|
+
function readOptionalCsvEnv(name) {
|
|
57
|
+
const raw = process.env[name];
|
|
58
|
+
if (raw === undefined || raw.trim() === "") {
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
const values = raw
|
|
62
|
+
.split(",")
|
|
63
|
+
.map((entry) => entry.trim())
|
|
64
|
+
.filter((entry) => entry.length > 0);
|
|
65
|
+
if (values.length === 0) {
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
return values;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface ExecutionApiServerOptions {
|
|
2
|
+
port?: number;
|
|
3
|
+
registryPath?: string;
|
|
4
|
+
requestBodyLimitBytes?: number;
|
|
5
|
+
executionTimeoutMs?: number;
|
|
6
|
+
rateLimitWindowMs?: number;
|
|
7
|
+
rateLimitMaxRequests?: number;
|
|
8
|
+
maxConcurrentExecutions?: number;
|
|
9
|
+
authTokens?: string[];
|
|
10
|
+
authKeys?: string[];
|
|
11
|
+
logRetentionDays?: number;
|
|
12
|
+
logMaxFiles?: number;
|
|
13
|
+
}
|
|
14
|
+
interface StartExecutionApiServerResult {
|
|
15
|
+
port: number;
|
|
16
|
+
close: () => Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
export declare function startExecutionApiServer(options?: ExecutionApiServerOptions): Promise<StartExecutionApiServerResult>;
|
|
19
|
+
export {};
|