@foldrun/core 2.4.0 → 2.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/dist/src/agent-activity.d.ts +5 -0
- package/dist/src/agent-activity.js +31 -0
- package/dist/src/agent-import.js +2 -2
- package/dist/src/agent-tools.js +2 -2
- package/dist/src/agents-md.d.ts +5 -1
- package/dist/src/agents-md.js +42 -18
- package/dist/src/alerts.d.ts +60 -0
- package/dist/src/alerts.js +161 -0
- package/dist/src/browser-pod.js +4 -0
- package/dist/src/capture.d.ts +23 -0
- package/dist/src/capture.js +80 -0
- package/dist/src/compare.d.ts +57 -0
- package/dist/src/compare.js +116 -0
- package/dist/src/completions.js +26 -3
- package/dist/src/deploy.d.ts +36 -1
- package/dist/src/deploy.js +237 -13
- package/dist/src/egress.d.ts +16 -1
- package/dist/src/evals.d.ts +27 -2
- package/dist/src/evals.js +62 -19
- package/dist/src/flow-lint.d.ts +14 -0
- package/dist/src/flow-lint.js +35 -0
- package/dist/src/flow-patterns.js +29 -14
- package/dist/src/frontmatter-fields.d.ts +27 -0
- package/dist/src/frontmatter-fields.js +60 -3
- package/dist/src/frontmatter-guard.d.ts +19 -0
- package/dist/src/frontmatter-guard.js +67 -0
- package/dist/src/frontmatter-schema.d.ts +2 -2
- package/dist/src/frontmatter-schema.js +33 -2
- package/dist/src/frontmatter-text.d.ts +31 -0
- package/dist/src/frontmatter-text.js +102 -0
- package/dist/src/history.d.ts +4 -0
- package/dist/src/history.js +15 -0
- package/dist/src/hooks.js +1 -1
- package/dist/src/insights.d.ts +30 -0
- package/dist/src/insights.js +152 -0
- package/dist/src/issues.d.ts +140 -0
- package/dist/src/issues.js +302 -0
- package/dist/src/judge-verdict.d.ts +19 -0
- package/dist/src/judge-verdict.js +54 -0
- package/dist/src/library.js +1 -1
- package/dist/src/limits.d.ts +8 -0
- package/dist/src/limits.js +36 -5
- package/dist/src/linkable.js +1 -1
- package/dist/src/matter.d.ts +42 -0
- package/dist/src/matter.js +132 -0
- package/dist/src/model-credential.d.ts +14 -0
- package/dist/src/model-credential.js +40 -0
- package/dist/src/network.d.ts +12 -1
- package/dist/src/network.js +35 -8
- package/dist/src/notify.d.ts +16 -0
- package/dist/src/notify.js +17 -7
- package/dist/src/okf.js +1 -1
- package/dist/src/online-checks.d.ts +76 -0
- package/dist/src/online-checks.js +432 -0
- package/dist/src/operator.d.ts +277 -0
- package/dist/src/operator.js +176 -2
- package/dist/src/otel-config.d.ts +18 -0
- package/dist/src/otel-config.js +69 -0
- package/dist/src/otel.d.ts +38 -0
- package/dist/src/otel.js +85 -0
- package/dist/src/outcome.d.ts +40 -0
- package/dist/src/outcome.js +77 -0
- package/dist/src/package.js +9 -2
- package/dist/src/platform.d.ts +1 -1
- package/dist/src/prompt-layers.d.ts +30 -0
- package/dist/src/prompt-layers.js +77 -0
- package/dist/src/provider-health.js +2 -2
- package/dist/src/providers.d.ts +5 -0
- package/dist/src/providers.js +2 -2
- package/dist/src/run-container.d.ts +25 -2
- package/dist/src/run-container.js +61 -6
- package/dist/src/runner.d.ts +53 -2
- package/dist/src/runner.js +471 -102
- package/dist/src/runs-filter.d.ts +48 -0
- package/dist/src/runs-filter.js +73 -0
- package/dist/src/scan.d.ts +30 -1
- package/dist/src/scan.js +145 -14
- package/dist/src/starter.js +27 -2
- package/dist/src/step-exec.d.ts +39 -3
- package/dist/src/step-exec.js +118 -15
- package/dist/src/store.d.ts +144 -3
- package/dist/src/store.js +150 -7
- package/dist/src/tokens.d.ts +38 -0
- package/dist/src/tokens.js +57 -0
- package/dist/src/tool-names.js +1 -1
- package/dist/src/tool-programs.js +1 -1
- package/dist/src/trace-tree.d.ts +40 -0
- package/dist/src/trace-tree.js +156 -0
- package/dist/src/translator.d.ts +8 -0
- package/dist/src/translator.js +7 -2
- package/dist/src/trigger-log.d.ts +1 -1
- package/dist/src/workspace-check.d.ts +18 -0
- package/dist/src/workspace-check.js +34 -0
- package/package.json +2 -2
- package/src/agent-activity.ts +32 -0
- package/src/agent-import.ts +2 -2
- package/src/agent-tools.ts +2 -2
- package/src/agents-md.ts +39 -14
- package/src/alerts.ts +190 -0
- package/src/browser-pod.ts +3 -0
- package/src/capture.ts +88 -0
- package/src/compare.ts +146 -0
- package/src/completions.ts +27 -3
- package/src/deploy.ts +238 -12
- package/src/egress.ts +12 -2
- package/src/evals.ts +64 -19
- package/src/flow-lint.ts +36 -0
- package/src/flow-patterns.ts +26 -13
- package/src/frontmatter-fields.ts +83 -3
- package/src/frontmatter-guard.ts +70 -0
- package/src/frontmatter-schema.ts +33 -4
- package/src/frontmatter-text.ts +109 -0
- package/src/history.ts +13 -0
- package/src/hooks.ts +1 -1
- package/src/insights.ts +174 -0
- package/src/issues.ts +396 -0
- package/src/judge-verdict.ts +52 -0
- package/src/library.ts +1 -1
- package/src/limits.ts +38 -5
- package/src/linkable.ts +1 -1
- package/src/matter.ts +145 -0
- package/src/model-credential.ts +45 -0
- package/src/network.ts +35 -7
- package/src/notify.ts +22 -7
- package/src/okf.ts +1 -1
- package/src/online-checks.ts +450 -0
- package/src/operator.ts +213 -3
- package/src/otel-config.ts +67 -0
- package/src/otel.ts +100 -0
- package/src/outcome.ts +90 -0
- package/src/package.ts +8 -2
- package/src/platform.ts +1 -1
- package/src/prompt-layers.ts +90 -0
- package/src/provider-health.ts +2 -2
- package/src/providers.ts +7 -2
- package/src/run-container.ts +77 -8
- package/src/runner.ts +477 -79
- package/src/runs-filter.ts +88 -0
- package/src/scan.ts +153 -14
- package/src/starter.ts +27 -2
- package/src/step-exec.ts +168 -17
- package/src/store.ts +268 -9
- package/src/tokens.ts +68 -0
- package/src/tool-names.ts +1 -1
- package/src/tool-programs.ts +1 -1
- package/src/trace-tree.ts +187 -0
- package/src/translator.ts +13 -2
- package/src/trigger-log.ts +1 -0
- package/src/workspace-check.ts +41 -0
package/dist/src/runner.d.ts
CHANGED
|
@@ -33,6 +33,46 @@ export declare function slotPool(size: number): {
|
|
|
33
33
|
acquire: () => Promise<void>;
|
|
34
34
|
release: () => void;
|
|
35
35
|
};
|
|
36
|
+
export declare function markResponding(step: StepRecord): void;
|
|
37
|
+
/**
|
|
38
|
+
* Is this step's prompt in the cache yet? An entry is readable from the
|
|
39
|
+
* moment the response to the request that wrote it begins streaming
|
|
40
|
+
* (Anthropic's prompt-caching docs), which is what `responding` marks.
|
|
41
|
+
* The first text, tool call or recorded model call says the same a little
|
|
42
|
+
* later, for an executor that cannot see the stream (the stub, an older
|
|
43
|
+
* driver). Resolves on the first of those, or when the step is over
|
|
44
|
+
* without one (a refusal before the first turn, a failed start).
|
|
45
|
+
*/
|
|
46
|
+
export declare function untilFirstReply(step: StepRecord, done: Promise<unknown>, pollMs?: number): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Steps of one agent launched together share a prompt prefix — tools and
|
|
49
|
+
* system prompt — and that is what the model's cache keeps. The cache is
|
|
50
|
+
* written by the first request that carries a prefix and readable only
|
|
51
|
+
* once that response has begun, so N copies started at once all write it
|
|
52
|
+
* and none reads: a fan-out of twenty paid twenty cold prefixes. The gate
|
|
53
|
+
* lets the first instance of each agent go alone and holds its siblings
|
|
54
|
+
* until its first response has begun (or it ended); then they all start
|
|
55
|
+
* and read what it wrote — Claude Code holds a workflow's fan-out the same
|
|
56
|
+
* way. Not a fixed delay: a sandbox takes seconds to start before its
|
|
57
|
+
* first model call, so a timer from launch would release the siblings
|
|
58
|
+
* before there was anything to read. Keyed by agent and model, since a
|
|
59
|
+
* cache is per model.
|
|
60
|
+
*/
|
|
61
|
+
export declare function warmGate(launching: StepRecord[], pollMs?: number): {
|
|
62
|
+
/** Claim the step's place — synchronously, before anything awaits, or
|
|
63
|
+
* the copies that reach their first await together would all find no
|
|
64
|
+
* lead and all go (a `parallel:` pool's acquire was exactly that).
|
|
65
|
+
* The first of its agent leads and gets null; a later one gets the
|
|
66
|
+
* lead's gate to await before it starts; a lone step gets null too. */
|
|
67
|
+
claim(step: StepRecord): Promise<void> | null;
|
|
68
|
+
/** A lead that will not run after all (the run was stopped while it
|
|
69
|
+
* waited for a pool slot) still opens its gate — or its siblings,
|
|
70
|
+
* which also wake to the stop, would wait on it forever. */
|
|
71
|
+
release(step: StepRecord): void;
|
|
72
|
+
/** Run the step; a lead opens its agent's gate on its first reply (or
|
|
73
|
+
* its end), whatever else happens to it. */
|
|
74
|
+
run(step: StepRecord, launch: () => Promise<void>): Promise<void>;
|
|
75
|
+
};
|
|
36
76
|
export interface DiscoveredSkill {
|
|
37
77
|
name: string;
|
|
38
78
|
description: string;
|
|
@@ -258,6 +298,8 @@ grantsOnly?: boolean): {
|
|
|
258
298
|
* reported by the step, not here, so it lands in the run's trace. */
|
|
259
299
|
clock: ClockChoice;
|
|
260
300
|
systemPrompt: string;
|
|
301
|
+
/** What the record keeps of each layer of that prompt. */
|
|
302
|
+
promptLayers: import("./tokens.ts").PromptLayerRecord[];
|
|
261
303
|
allowed: string[];
|
|
262
304
|
disabled: string[];
|
|
263
305
|
unknownTools: string[];
|
|
@@ -280,6 +322,7 @@ grantsOnly?: boolean): {
|
|
|
280
322
|
ask: {
|
|
281
323
|
timeoutSec: number;
|
|
282
324
|
} | null;
|
|
325
|
+
peers: boolean;
|
|
283
326
|
runtime: {
|
|
284
327
|
log: string[];
|
|
285
328
|
error: string | null;
|
|
@@ -328,6 +371,7 @@ grantsOnly?: boolean): {
|
|
|
328
371
|
maxTokensParam?: "max_tokens" | "max_completion_tokens";
|
|
329
372
|
reasoningEffort?: boolean;
|
|
330
373
|
params?: Record<string, unknown>;
|
|
374
|
+
cacheKey?: string;
|
|
331
375
|
label?: string;
|
|
332
376
|
egress?: string;
|
|
333
377
|
timezone: string;
|
|
@@ -340,6 +384,7 @@ grantsOnly?: boolean): {
|
|
|
340
384
|
maxTokensParam?: "max_tokens" | "max_completion_tokens";
|
|
341
385
|
reasoningEffort?: boolean;
|
|
342
386
|
params?: Record<string, unknown>;
|
|
387
|
+
cacheKey?: string;
|
|
343
388
|
label?: string;
|
|
344
389
|
egress?: string;
|
|
345
390
|
timezone: string;
|
|
@@ -583,7 +628,13 @@ export interface Reconciliation {
|
|
|
583
628
|
* outlives any process. A run whose person already answered is not waiting,
|
|
584
629
|
* and is picked back up — see below.
|
|
585
630
|
*/
|
|
586
|
-
|
|
631
|
+
/** Told when a run reconcile closed, or resumed and saw to its end — so the
|
|
632
|
+
* platform settles, notifies and chains it as it would a run its worker
|
|
633
|
+
* drove (a run closed here had spent tokens, and nobody was charged or
|
|
634
|
+
* told). Not told when a resumed run parks again: whatever resumes it next
|
|
635
|
+
* goes through the worker. */
|
|
636
|
+
export type ReconcileEnd = (tenant: string, workspace: string, runId: string) => void | Promise<void>;
|
|
637
|
+
export declare function reconcileRuns(tenant: string, now?: number, live?: ReadonlySet<string>, onEnd?: ReconcileEnd): Reconciliation[];
|
|
587
638
|
/**
|
|
588
639
|
* The same, for every account this installation holds.
|
|
589
640
|
*
|
|
@@ -591,7 +642,7 @@ export declare function reconcileRuns(tenant: string, now?: number, live?: Reado
|
|
|
591
642
|
* one hard-coded account left every other account's interrupted runs marked
|
|
592
643
|
* `running` forever, with no process left to finish them.
|
|
593
644
|
*/
|
|
594
|
-
export declare function reconcileAllRuns(now?: number, live?: ReadonlySet<string
|
|
645
|
+
export declare function reconcileAllRuns(now?: number, live?: ReadonlySet<string>, onEnd?: ReconcileEnd): Reconciliation[];
|
|
595
646
|
/**
|
|
596
647
|
* Wait for a run to stop being in progress.
|
|
597
648
|
*
|