@foldrun/core 0.4.0 → 0.6.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 +7 -4
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/src/account.d.ts +45 -0
- package/dist/src/account.js +130 -0
- package/dist/src/api-tools.d.ts +8 -0
- package/dist/src/api-tools.js +22 -4
- package/dist/src/browser-pod.d.ts +148 -0
- package/dist/src/browser-pod.js +333 -0
- package/dist/src/catalog.js +2 -1
- package/dist/src/clock.d.ts +49 -0
- package/dist/src/clock.js +121 -0
- package/dist/src/completions.js +17 -8
- package/dist/src/confine.d.ts +22 -0
- package/dist/src/confine.js +218 -3
- package/dist/src/container.d.ts +9 -0
- package/dist/src/container.js +115 -5
- package/dist/src/context-tools.d.ts +1 -1
- package/dist/src/deploy.d.ts +33 -0
- package/dist/src/deploy.js +145 -6
- package/dist/src/egress.d.ts +7 -0
- package/dist/src/egress.js +6 -0
- package/dist/src/eol.d.ts +2 -0
- package/dist/src/eol.js +7 -0
- package/dist/src/evals.d.ts +5 -0
- package/dist/src/evals.js +9 -2
- package/dist/src/flow-lint.d.ts +8 -0
- package/dist/src/flow-lint.js +223 -1
- package/dist/src/flow-patterns.d.ts +141 -0
- package/dist/src/flow-patterns.js +568 -0
- package/dist/src/gitrepo.d.ts +18 -0
- package/dist/src/gitrepo.js +49 -0
- package/dist/src/host-env.js +5 -0
- package/dist/src/kinds.js +1 -1
- package/dist/src/language.d.ts +17 -0
- package/dist/src/language.js +55 -0
- package/dist/src/layout.d.ts +69 -0
- package/dist/src/layout.js +200 -0
- package/dist/src/library.d.ts +9 -0
- package/dist/src/library.js +30 -3
- package/dist/src/limits.d.ts +84 -0
- package/dist/src/limits.js +287 -0
- package/dist/src/locale.d.ts +47 -0
- package/dist/src/locale.js +177 -0
- package/dist/src/mail.d.ts +88 -0
- package/dist/src/mail.js +247 -0
- package/dist/src/model-credential.d.ts +14 -0
- package/dist/src/model-credential.js +58 -0
- package/dist/src/model-probe.d.ts +3 -0
- package/dist/src/model-probe.js +1 -0
- package/dist/src/notify.d.ts +53 -7
- package/dist/src/notify.js +194 -126
- package/dist/src/openapi.js +5 -3
- package/dist/src/operator.d.ts +201 -0
- package/dist/src/operator.js +251 -0
- package/dist/src/paths.d.ts +28 -0
- package/dist/src/paths.js +55 -0
- package/dist/src/platform.d.ts +43 -3
- package/dist/src/platform.js +9 -1
- package/dist/src/provider-health.js +3 -2
- package/dist/src/providers.d.ts +481 -0
- package/dist/src/providers.js +1105 -6
- package/dist/src/refusal.d.ts +83 -0
- package/dist/src/refusal.js +281 -0
- package/dist/src/run-container.d.ts +149 -13
- package/dist/src/run-container.js +424 -43
- package/dist/src/runner.d.ts +177 -9
- package/dist/src/runner.js +1146 -154
- package/dist/src/runtime.d.ts +52 -0
- package/dist/src/runtime.js +493 -58
- package/dist/src/script-tools.d.ts +17 -2
- package/dist/src/script-tools.js +82 -10
- package/dist/src/secret-files.d.ts +6 -5
- package/dist/src/secret-files.js +24 -11
- package/dist/src/secret-health.d.ts +30 -6
- package/dist/src/secret-health.js +42 -20
- package/dist/src/secrets.d.ts +19 -0
- package/dist/src/secrets.js +155 -86
- package/dist/src/starter.d.ts +9 -0
- package/dist/src/starter.js +92 -11
- package/dist/src/step-exec.d.ts +72 -2
- package/dist/src/step-exec.js +431 -37
- package/dist/src/step-removal.d.ts +15 -0
- package/dist/src/step-removal.js +49 -0
- package/dist/src/storage.d.ts +23 -4
- package/dist/src/storage.js +125 -23
- package/dist/src/store.d.ts +222 -37
- package/dist/src/store.js +349 -62
- package/dist/src/subagents.d.ts +75 -0
- package/dist/src/subagents.js +149 -0
- package/dist/src/test-mode.d.ts +17 -2
- package/dist/src/test-mode.js +53 -13
- package/dist/src/tool-names.d.ts +13 -1
- package/dist/src/tool-names.js +38 -11
- package/dist/src/tool-programs.d.ts +26 -0
- package/dist/src/tool-programs.js +172 -0
- package/dist/src/tool-test.js +104 -12
- package/dist/src/translator.d.ts +8 -2
- package/dist/src/translator.js +69 -23
- package/dist/src/trigger-log.d.ts +1 -1
- package/dist/src/triggers.d.ts +3 -0
- package/dist/src/triggers.js +10 -2
- package/dist/src/untrusted-fetch.d.ts +11 -0
- package/dist/src/untrusted-fetch.js +77 -0
- package/dist/src/web-actions.d.ts +91 -0
- package/dist/src/web-actions.js +199 -0
- package/dist/src/webhook.d.ts +4 -0
- package/dist/src/webhook.js +39 -0
- package/index.ts +4 -0
- package/package.json +3 -3
- package/src/account.ts +149 -0
- package/src/api-tools.ts +32 -4
- package/src/browser-pod.ts +350 -0
- package/src/catalog.ts +2 -1
- package/src/clock.ts +149 -0
- package/src/completions.ts +17 -8
- package/src/confine.ts +218 -3
- package/src/container.ts +112 -5
- package/src/context-tools.ts +1 -1
- package/src/deploy.ts +137 -6
- package/src/egress.ts +13 -1
- package/src/eol.ts +7 -0
- package/src/evals.ts +14 -2
- package/src/flow-lint.ts +253 -1
- package/src/flow-patterns.ts +597 -0
- package/src/gitrepo.ts +48 -0
- package/src/host-env.ts +5 -0
- package/src/kinds.ts +1 -1
- package/src/language.ts +62 -0
- package/src/layout.ts +228 -0
- package/src/library.ts +37 -3
- package/src/limits.ts +290 -0
- package/src/locale.ts +217 -0
- package/src/mail.ts +318 -0
- package/src/model-credential.ts +71 -0
- package/src/model-probe.ts +4 -0
- package/src/notify.ts +189 -103
- package/src/openapi.ts +5 -3
- package/src/operator.ts +300 -0
- package/src/paths.ts +54 -0
- package/src/platform.ts +52 -3
- package/src/provider-health.ts +3 -2
- package/src/providers.ts +1368 -6
- package/src/refusal.ts +320 -0
- package/src/run-container.ts +460 -44
- package/src/runner.ts +1168 -155
- package/src/runtime.ts +487 -55
- package/src/script-tools.ts +81 -10
- package/src/secret-files.ts +22 -10
- package/src/secret-health.ts +64 -19
- package/src/secrets.ts +149 -87
- package/src/starter.ts +93 -11
- package/src/step-exec.ts +447 -38
- package/src/step-removal.ts +59 -0
- package/src/storage.ts +141 -22
- package/src/store.ts +506 -70
- package/src/subagents.ts +189 -0
- package/src/test-mode.ts +51 -11
- package/src/tool-names.ts +40 -11
- package/src/tool-programs.ts +179 -0
- package/src/tool-test.ts +110 -12
- package/src/translator.ts +72 -22
- package/src/trigger-log.ts +1 -0
- package/src/triggers.ts +10 -2
- package/src/untrusted-fetch.ts +88 -0
- package/src/web-actions.ts +237 -0
- package/src/webhook.ts +41 -0
- package/templates/blog-desk/agents/writer/agent.md +1 -1
- package/templates/hello/agents/curator/agent.md +4 -4
- package/templates/hello/agents/notetaker/agent.md +3 -3
package/dist/src/runtime.d.ts
CHANGED
|
@@ -8,6 +8,10 @@ export interface RuntimeSpec {
|
|
|
8
8
|
* the script with "no module named pandas" is the least debuggable outcome
|
|
9
9
|
* available. Never part of the fingerprint — it names nothing installed. */
|
|
10
10
|
rejected?: string[];
|
|
11
|
+
/** Installer options a requirements.txt carried (`--hash`, `-r`,
|
|
12
|
+
* `--index-url`), by name only. Not applied — the installer takes options
|
|
13
|
+
* from the same argv as its packages — and said so in the build log. */
|
|
14
|
+
ignored?: string[];
|
|
11
15
|
}
|
|
12
16
|
export declare function parseRuntime(raw: unknown): RuntimeSpec | null;
|
|
13
17
|
/**
|
|
@@ -37,5 +41,53 @@ export interface PreparedRuntime {
|
|
|
37
41
|
/** Human-readable lines describing what was built, for the run log. */
|
|
38
42
|
log: string[];
|
|
39
43
|
error: string | null;
|
|
44
|
+
/** Removes what only this step may use — the private build a wedged or
|
|
45
|
+
* failed shared build left it with. Absent when there is nothing to
|
|
46
|
+
* remove; call it when the step is done with the environment. */
|
|
47
|
+
dispose?: () => void;
|
|
40
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Claim the right to build `root`, or discover someone else holds it.
|
|
51
|
+
*
|
|
52
|
+
* The cache became shared the moment it started surviving the container, and
|
|
53
|
+
* two steps of the same account with the same dependencies now start at the
|
|
54
|
+
* same instant routinely — the platform runs four at a time. Both would run
|
|
55
|
+
* `python -m venv` into one directory and pip into it concurrently, and the
|
|
56
|
+
* loser's half-written venv is not a slow run, it is a corrupt cache that
|
|
57
|
+
* every later step inherits. `mkdir` is the lock because it is atomic on
|
|
58
|
+
* every filesystem this runs on; O_EXCL on a file would do as well.
|
|
59
|
+
*/
|
|
60
|
+
export declare function claimBuild(root: string,
|
|
61
|
+
/** Test seam: runs once the claim is judged abandoned, before the
|
|
62
|
+
* takeover — where a second claimer used to slip in. */
|
|
63
|
+
seam?: {
|
|
64
|
+
beforeTakeover?: () => void;
|
|
65
|
+
}): string | null;
|
|
66
|
+
/** Release the claim — only if it is still ours. */
|
|
67
|
+
export declare function releaseBuild(root: string, token: string): void;
|
|
68
|
+
/** A requirement's distribution name: `requests[socks]>=2` → `requests`. */
|
|
69
|
+
export declare function distName(req: string): string;
|
|
70
|
+
/** An npm requirement's package name: `@scope/pkg@^1` → `@scope/pkg`. */
|
|
71
|
+
export declare function npmName(req: string): string;
|
|
72
|
+
/**
|
|
73
|
+
* Does a `.ready` entry still hold what the declaration asks for? Null when it
|
|
74
|
+
* does, else why not.
|
|
75
|
+
*
|
|
76
|
+
* `.ready` is written once and trusted for ever, and that trust was misplaced
|
|
77
|
+
* more than once: a build interrupted between install and marker, a cache
|
|
78
|
+
* volume restored without its contents, and — the quiet one — an image whose
|
|
79
|
+
* python moved (bookworm's 3.11 to trixie's 3.13), which leaves every venv
|
|
80
|
+
* with a valid-looking bin/python pointing at an interpreter that is gone.
|
|
81
|
+
* Each reported "cached" and failed later inside somebody's tool. One spawn
|
|
82
|
+
* of the venv's python per step is the price of never doing that again.
|
|
83
|
+
*/
|
|
84
|
+
export declare function checkEntry(root: string, spec: RuntimeSpec): string | null;
|
|
85
|
+
/**
|
|
86
|
+
* Remove entries nobody has used for maxAgeDays. `.ready`'s mtime is the
|
|
87
|
+
* last-used clock (every hit touches it); an entry with no `.ready` is a
|
|
88
|
+
* failed build and ages from its directory's own mtime. Never an entry that
|
|
89
|
+
* is being built, and never `keep`. Runs after a successful build — the only
|
|
90
|
+
* moment a cache grows — so it costs nothing on the hot path.
|
|
91
|
+
*/
|
|
92
|
+
export declare function pruneRuntimes(cacheRoot: string, keep: string): string[];
|
|
41
93
|
export declare function prepareRuntime(tenant: string, spec: RuntimeSpec | null): PreparedRuntime;
|