@jive-sh/workflow-platform 0.5.1 → 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 +50 -5
- package/dist/dashboard/queue-table.js +10 -2
- package/dist/dashboard/queue-table.js.map +1 -1
- package/dist/dashboard/spending-words.js +32 -0
- package/dist/dashboard/spending-words.js.map +1 -0
- package/dist/index.js +13 -4
- package/dist/index.js.map +1 -1
- package/dist/pick-wakes.js +1 -0
- package/dist/pick-wakes.js.map +1 -1
- package/dist/project.js +0 -4
- package/dist/project.js.map +1 -1
- package/dist/queue-counts.js +7 -1
- package/dist/queue-counts.js.map +1 -1
- package/dist/spending-limit.js +87 -0
- package/dist/spending-limit.js.map +1 -0
- package/dist/steps.js +150 -17
- package/dist/steps.js.map +1 -1
- package/dist/storage/budgets.js +27 -2
- package/dist/storage/budgets.js.map +1 -1
- package/dist/storage/sqlite-store.js +14 -3
- package/dist/storage/sqlite-store.js.map +1 -1
- package/dist/storage/task-store.js +10 -1
- package/dist/storage/task-store.js.map +1 -1
- package/dist/tasks.js +35 -5
- package/dist/tasks.js.map +1 -1
- package/dist/views/format.js +2 -0
- package/dist/views/format.js.map +1 -1
- package/dist/views/runs-now.js +30 -2
- package/dist/views/runs-now.js.map +1 -1
- package/dist/views/workflows-view.js +9 -2
- package/dist/views/workflows-view.js.map +1 -1
- package/package.json +1 -1
- package/src/dashboard/dashboard.css +5 -0
- package/src/dashboard/queue-bar.tsx +5 -5
- package/src/dashboard/queue-table.ts +17 -3
- package/src/dashboard/spending-limit-control.tsx +50 -0
- package/src/dashboard/spending-words.ts +50 -0
- package/src/dashboard/workflow-dag.tsx +1 -1
- package/src/dashboard/workflow-drilldown.tsx +5 -5
- package/src/dashboard/workflows-dashboard.tsx +28 -3
- package/src/index.ts +13 -4
- package/src/pick-wakes.ts +3 -0
- package/src/project.ts +35 -0
- package/src/queue-counts.ts +8 -1
- package/src/spending-limit.ts +155 -0
- package/src/steps.ts +180 -30
- package/src/storage/budgets.ts +34 -2
- package/src/storage/sqlite-store.ts +15 -4
- package/src/storage/step-records.ts +2 -0
- package/src/storage/task-store.ts +17 -1
- package/src/tasks.ts +43 -5
- package/src/views/format.ts +3 -0
- package/src/views/runs-now.ts +21 -3
- package/src/views/workflows-view.ts +27 -4
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
import { stepKindOf, stepUsesAnAgent } from '../steps';
|
|
15
15
|
import { pipelinePlaces, workflowFlows } from './workflow-flows';
|
|
16
16
|
import { Effect } from 'effect';
|
|
17
|
+
import { QUEUED_NEEDING_AN_AGENT } from '../queue-counts';
|
|
17
18
|
import { TASK_STATUSES } from '../tasks';
|
|
18
19
|
import { stepFunnel } from './step-funnel';
|
|
19
20
|
import { workflowGraphs } from './step-graph';
|
|
@@ -122,6 +123,8 @@ export const historyByStatus = (recorded) => {
|
|
|
122
123
|
});
|
|
123
124
|
return out;
|
|
124
125
|
};
|
|
126
|
+
/** Each queue's newest count of queued tasks marked as needing an agent, from the recorded counts (oldest first). Pure. */
|
|
127
|
+
export const queuedNeedingAnAgentNow = (recorded) => new Map(recorded.filter((row) => row.bucket === QUEUED_NEEDING_AN_AGENT).map((row) => [row.workflow, row.tasks]));
|
|
125
128
|
/** Each queue's newest count from its history by status (`historyByStatus`), a status never counted at 0. Pure. */
|
|
126
129
|
export const queuesNow = (history) => {
|
|
127
130
|
const queues = new Map();
|
|
@@ -143,8 +146,10 @@ export const buildWorkflowsView = (input) => Effect.gen(function* () {
|
|
|
143
146
|
// Until the project declares its top workflow, its steps are every workflow no other workflow uses as a step.
|
|
144
147
|
const usedAsAStep = new Set(input.declared.flatMap((d) => d.steps().flatMap((s) => (s.workflow === undefined ? [] : [s.workflow]))));
|
|
145
148
|
const phases = [...input.phases, ...[...new Set(input.declared.map((d) => d.phase))].filter((p) => !input.phases.includes(p))];
|
|
146
|
-
const
|
|
149
|
+
const recordedCounts = yield* input.taskStore.queueCountsSince(input.now - QUEUE_HISTORY_DAYS * 86_400);
|
|
150
|
+
const queueHistory = historyByStatus(recordedCounts);
|
|
147
151
|
const queues = queuesNow(queueHistory);
|
|
152
|
+
const needingAnAgent = queuedNeedingAnAgentNow(recordedCounts);
|
|
148
153
|
// The map is of the top workflow's steps: a workflow used as a step of another is drawn inside that one, not here.
|
|
149
154
|
const onTheMap = input.declared.filter((d) => !usedAsAStep.has(d.name));
|
|
150
155
|
const flows = workflowFlows({ declared: onTheMap, returned: yield* input.taskStore.returnedBetween(), waits: yield* input.taskStore.listedWaits() });
|
|
@@ -157,6 +162,7 @@ export const buildWorkflowsView = (input) => Effect.gen(function* () {
|
|
|
157
162
|
limits: usedAsAStep.has(d.name) ? null : input.limitsOf(d.name),
|
|
158
163
|
place: places.get(d.name),
|
|
159
164
|
queue: d.item === null ? null : queues.get(d.name) ?? noTasks(),
|
|
165
|
+
queuedNeedingAnAgent: d.item === null || !d.steps().some(stepUsesAnAgent) ? null : needingAnAgent.get(d.name) ?? 0,
|
|
160
166
|
startsOn: usedAsAStep.has(d.name) ? { kind: 'a step', of: input.declared.filter((p) => p.steps().some((s) => s.workflow === d.name)).map((p) => p.name) }
|
|
161
167
|
: d.pending !== undefined || d.items !== undefined ? { kind: 'queue' } : d.inputs !== undefined ? { kind: 'inputs', says: d.inputs.says } : { kind: 'timer or request' },
|
|
162
168
|
});
|
|
@@ -170,6 +176,7 @@ export const buildWorkflowsView = (input) => Effect.gen(function* () {
|
|
|
170
176
|
groups: phases.map((phase) => ({ phase, workflows: input.declared.filter((d) => d.phase === phase).map(workflowView) })).filter((g) => g.workflows.length > 0),
|
|
171
177
|
queueHistory,
|
|
172
178
|
flows,
|
|
179
|
+
spending: input.spending,
|
|
173
180
|
};
|
|
174
181
|
});
|
|
175
182
|
/**
|
|
@@ -210,7 +217,7 @@ export const buildWorkflowFigures = (input) => Effect.gen(function* () {
|
|
|
210
217
|
graph: workflowGraphs({ declared: [d], taken: moves.edges, lasts: moves.lasts, going })[0],
|
|
211
218
|
funnel,
|
|
212
219
|
runCosts: runCostsOf(runCosts),
|
|
213
|
-
|
|
220
|
+
...(yield* input.reasons),
|
|
214
221
|
yields: {
|
|
215
222
|
now: yieldOf({ runs: funnel.runs, finished: finished(finishedNow), tokens: costNow.inputTokens + costNow.outputTokens, compiles: costNow.compiles }),
|
|
216
223
|
before: yieldOf({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflows-view.js","sourceRoot":"","sources":["../../../../src/views/workflows-view.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,UAAU,EAAE,eAAe,EAAgG,MAAM,UAAU,CAAC;AACrJ,OAAO,EAAE,cAAc,EAAE,aAAa,EAAyC,MAAM,kBAAkB,CAAC;AAMxG,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,OAAO,EAAE,aAAa,EAAuC,MAAM,UAAU,CAAC;AAE9E,OAAO,EAAE,UAAU,EAAmB,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAsB,MAAM,cAAc,CAAC;AAalE,iDAAiD;AACjD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AA6DpC,MAAM,QAAQ,GAAG,CAAC,EAAyB,EAAU,EAAE;IACrD,MAAM,MAAM,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7C,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC1C,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,CAAE,GAAG,MAAM,CAAC,GAAG,CAAE,CAAC,GAAG,CAAC,CAAC;AACx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AAK,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAE;QAC3F,MAAM;QACN,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC;QAC9B,GAAG,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC;QACzB,MAAM,EAAE;YACN,GAAG,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,YAAY,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC;YACpJ,MAAM,EAAE,OAAO,CAAC;gBACd,IAAI,EAAE,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,CAAC,YAAY,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC;gBACjF,MAAM,EAAE,QAAQ,CAAC,WAAW,GAAG,QAAQ,CAAC,YAAY,GAAG,CAAC,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ;aACpJ,CAAC;SACH;KACF,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jive-sh/workflow-platform",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Durable workflows on effect/workflow: steps, step records, task queues, waiting picks, budgets, the trigger that keeps runs going, and a dashboard of them.",
|
|
@@ -103,6 +103,11 @@ a.wp-drill-name { text-decoration: underline; padding: 4px 0; }
|
|
|
103
103
|
.wp-machine .wp-limit button, .wp-stop { min-width: 30px; min-height: 30px; font-size: 14px; touch-action: manipulation; }
|
|
104
104
|
.wp-stop { background: none; color: var(--wp-fg); border: 1px solid var(--wp-node-line); border-radius: 4px; padding: 2px 10px; cursor: pointer; font: inherit; }
|
|
105
105
|
|
|
106
|
+
/* The spending limit: its setting with its buttons, then its verdict, a stale reading and the steps waiting, each a line of words. */
|
|
107
|
+
.wp-spending { margin: 8px 0; font-size: 12.5px; }
|
|
108
|
+
.wp-spending .wp-limit button { min-width: 30px; min-height: 30px; font-size: 14px; touch-action: manipulation; }
|
|
109
|
+
.wp-spending .wp-line { margin: 4px 0; }
|
|
110
|
+
|
|
106
111
|
/* The agents' account: a row a limit, its figure in words and a bar that only repeats it, the pace line a mark on the bar. */
|
|
107
112
|
.wp-usage { margin: 10px 0 14px; }
|
|
108
113
|
.wp-usage-limit { margin: 6px 0; font-size: 12px; }
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
* rule, the total. The bar's segments differ in lightness, and every count is also in words.
|
|
6
6
|
*/
|
|
7
7
|
import type { WorkflowView } from '../views/workflows-view';
|
|
8
|
-
import { queueSum } from './queue-table';
|
|
8
|
+
import { addendLabel, queueSum } from './queue-table';
|
|
9
9
|
|
|
10
|
-
export function QueueBar({ queue }: { readonly queue: NonNullable<WorkflowView['queue']
|
|
11
|
-
const sum = queueSum(queue);
|
|
10
|
+
export function QueueBar({ queue, queuedNeedingAnAgent }: { readonly queue: NonNullable<WorkflowView['queue']>; readonly queuedNeedingAnAgent: WorkflowView['queuedNeedingAnAgent'] }) {
|
|
11
|
+
const sum = queueSum(queue, queuedNeedingAnAgent);
|
|
12
12
|
const segments = [
|
|
13
13
|
{ n: queue.done, cls: 'wp-seg-done' },
|
|
14
14
|
{ n: queue['in progress'], cls: 'wp-seg-running' },
|
|
@@ -17,7 +17,7 @@ export function QueueBar({ queue }: { readonly queue: NonNullable<WorkflowView['
|
|
|
17
17
|
];
|
|
18
18
|
return (
|
|
19
19
|
<div className="wp-queue">
|
|
20
|
-
<div className="wp-bar" role="img" aria-label={sum.addends.map((a) => `${a.text} ${a
|
|
20
|
+
<div className="wp-bar" role="img" aria-label={sum.addends.map((a) => `${a.text} ${addendLabel(a)}`).join(', ')}>
|
|
21
21
|
{segments.map((s) => (s.n === 0 ? null : <span key={s.cls} className={s.cls} style={{ width: `${(100 * s.n) / Math.max(1, sum.total)}%` }} />))}
|
|
22
22
|
</div>
|
|
23
23
|
<table className="wp-sum">
|
|
@@ -26,7 +26,7 @@ export function QueueBar({ queue }: { readonly queue: NonNullable<WorkflowView['
|
|
|
26
26
|
<tr key={a.category}>
|
|
27
27
|
<td className="wp-sum-plus">{i === sum.addends.length - 1 ? '+' : ''}</td>
|
|
28
28
|
<td className="wp-sum-n">{a.text}</td>
|
|
29
|
-
<td className="wp-sum-label">{a
|
|
29
|
+
<td className="wp-sum-label">{addendLabel(a)}</td>
|
|
30
30
|
</tr>
|
|
31
31
|
))}
|
|
32
32
|
</tbody>
|
|
@@ -6,9 +6,13 @@
|
|
|
6
6
|
* The total is the addends added up here, never a count read apart from them, so the two cannot disagree. The categories
|
|
7
7
|
* and their order are the queue's own keys: the view gives every queue all of the platform's categories, in its order
|
|
8
8
|
* (`views/workflows-view.ts` `queuesNow`). Pure, with no React and no JSX, so a test reads it without a page.
|
|
9
|
+
*
|
|
10
|
+
* THE QUEUED ROW SAYS HOW MANY OF ITS TASKS NEED AN AGENT, in parentheses: "804 queued (12 need agent)". Alex,
|
|
11
|
+
* 2026-11-20: "there can be in parens the number in the queue marked for needing an agent". Like every figure of the
|
|
12
|
+
* table it is shown at 0 too, for a workflow with an agent step; one with none can mark no task, and shows none.
|
|
9
13
|
*/
|
|
10
14
|
export interface QueueSum {
|
|
11
|
-
readonly addends: ReadonlyArray<{ readonly category: string; readonly tasks: number; readonly text: string }>;
|
|
15
|
+
readonly addends: ReadonlyArray<{ readonly category: string; readonly tasks: number; readonly text: string; readonly note: string | null }>;
|
|
12
16
|
readonly total: number;
|
|
13
17
|
readonly totalText: string;
|
|
14
18
|
}
|
|
@@ -16,8 +20,18 @@ export interface QueueSum {
|
|
|
16
20
|
/** A count as the table writes it: thousands separated, as every figure on the page is. */
|
|
17
21
|
const written = (tasks: number): string => tasks.toLocaleString('en-US');
|
|
18
22
|
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
/** "12 need agent", "1 needs agent": Alex, 2026-11-20: "(12 need agent) is fine. no 'an'". */
|
|
24
|
+
const needWords = (tasks: number): string => `${written(tasks)} ${tasks === 1 ? 'needs' : 'need'} agent`;
|
|
25
|
+
|
|
26
|
+
/** `queuedNeedingAnAgent`: how many queued tasks are marked as needing an agent; none where none can be (`WorkflowView`). */
|
|
27
|
+
export const queueSum = (queue: Readonly<Record<string, number>>, queuedNeedingAnAgent: number | null = null): QueueSum => {
|
|
28
|
+
const addends = Object.entries(queue).map(([category, tasks]) => ({
|
|
29
|
+
category, tasks, text: written(tasks),
|
|
30
|
+
note: category === 'queued' && queuedNeedingAnAgent !== null ? needWords(queuedNeedingAnAgent) : null,
|
|
31
|
+
}));
|
|
21
32
|
const total = addends.reduce((sum, a) => sum + a.tasks, 0);
|
|
22
33
|
return { addends, total, totalText: written(total) };
|
|
23
34
|
};
|
|
35
|
+
|
|
36
|
+
/** An addend's label as the table and its one-line form write it: "queued (12 need agent)". */
|
|
37
|
+
export const addendLabel = (a: QueueSum['addends'][number]): string => (a.note === null ? a.category : `${a.category} (${a.note})`);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* THE SPENDING LIMIT ON THE PAGE (`spending-limit.ts`): what it is set to with − and +, the week's reading against it, whether
|
|
5
|
+
* it holds every agent step, whether the reading is stale, and which agent steps wait on it, each in words
|
|
6
|
+
* (`spending-words.ts`). A click shows at once, as asked, until the page's next reading says the same; a failed one says why.
|
|
7
|
+
*/
|
|
8
|
+
import { useEffect, useState } from 'react';
|
|
9
|
+
import type { SpendingLimitState } from '../spending-limit';
|
|
10
|
+
import { heldStepsWords, spendingSettingWords, spendingStaleWords, spendingVerdictWords, type HeldStep } from './spending-words';
|
|
11
|
+
|
|
12
|
+
export interface SpendingLimitControlProps {
|
|
13
|
+
readonly spending: SpendingLimitState;
|
|
14
|
+
readonly held: ReadonlyArray<HeldStep>;
|
|
15
|
+
readonly now: number;
|
|
16
|
+
/** Stores a new limit, a whole percent from 0 to 100; with none the limit shows without buttons. */
|
|
17
|
+
readonly setSpendingLimit?: (weekPercent: number) => Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const WHY = 'While the newest good reading of the week is at or past this percent, every agent step of every workflow waits before its agent call. A failed or late reading never lifts it.';
|
|
21
|
+
|
|
22
|
+
export function SpendingLimitControl({ spending, held, now, setSpendingLimit }: SpendingLimitControlProps) {
|
|
23
|
+
const [asked, setAsked] = useState<number | null>(null);
|
|
24
|
+
const [failed, setFailed] = useState<string | null>(null);
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (asked !== null && asked === spending.limitPercent && spending.setAt !== null) setAsked(null);
|
|
27
|
+
}, [asked, spending.limitPercent, spending.setAt]);
|
|
28
|
+
const shown = asked === null ? spending.limitPercent : asked;
|
|
29
|
+
const set = (to: number) => {
|
|
30
|
+
if (setSpendingLimit === undefined) return;
|
|
31
|
+
setAsked(to);
|
|
32
|
+
setFailed(null);
|
|
33
|
+
setSpendingLimit(to).catch((e: unknown) => { setAsked(null); setFailed(e instanceof Error ? e.message : String(e)); });
|
|
34
|
+
};
|
|
35
|
+
const stale = spendingStaleWords(spending, now);
|
|
36
|
+
const waiting = heldStepsWords(spending, held);
|
|
37
|
+
return (
|
|
38
|
+
<div className="wp-spending">
|
|
39
|
+
<span className="wp-limit" title={WHY}>
|
|
40
|
+
{setSpendingLimit === undefined ? null : <button type="button" aria-label="Lower the spending limit" disabled={shown <= 0} onClick={() => set(shown - 1)}>−</button>}
|
|
41
|
+
<span>{spendingSettingWords({ limitPercent: shown, setAt: asked === null ? spending.setAt : now })}</span>
|
|
42
|
+
{setSpendingLimit === undefined ? null : <button type="button" aria-label="Raise the spending limit" disabled={shown >= 100} onClick={() => set(shown + 1)}>+</button>}
|
|
43
|
+
{failed === null ? null : <span className="wp-bad">not saved: {failed}</span>}
|
|
44
|
+
</span>
|
|
45
|
+
<p className={spending.holds ? 'wp-line wp-bad' : 'wp-line'}>{spendingVerdictWords(spending, now)}</p>
|
|
46
|
+
{stale === null ? null : <p className="wp-line wp-bad">{stale}</p>}
|
|
47
|
+
{waiting === null ? null : <p className={held.length > 0 ? 'wp-line wp-bad' : 'wp-line wp-mut'}>{waiting}</p>}
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THE SPENDING LIMIT IN WORDS (`spending-limit.ts`): what it is set to, the week's reading against it, whether it holds, and
|
|
3
|
+
* which agent steps wait on it. Each state is said in words, first in its line; a colour on the page only repeats it. Pure,
|
|
4
|
+
* with no React and no JSX, so a test reads it without a page.
|
|
5
|
+
*/
|
|
6
|
+
import type { SpendingLimitState } from '../spending-limit';
|
|
7
|
+
import type { PhaseRunsNow } from '../views/runs-now';
|
|
8
|
+
import { percentCut, whenAgo } from '../views/format';
|
|
9
|
+
|
|
10
|
+
/** One agent step the limit holds runs at, and how many. */
|
|
11
|
+
export interface HeldStep {
|
|
12
|
+
readonly workflow: string;
|
|
13
|
+
readonly step: string;
|
|
14
|
+
readonly runs: number;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** Every agent step the limit holds a run at now, from where runs are now. */
|
|
18
|
+
export const heldSteps = (runsNow: ReadonlyArray<PhaseRunsNow>): ReadonlyArray<HeldStep> =>
|
|
19
|
+
runsNow.flatMap((p) => p.workflows.flatMap((w) => w.steps.filter((s) => s.heldBySpendingLimit > 0).map((s) => ({ workflow: w.workflow, step: s.step, runs: s.heldBySpendingLimit }))));
|
|
20
|
+
|
|
21
|
+
/** What the limit is set to: "agents stop at 95% of the week (the default)". */
|
|
22
|
+
export const spendingSettingWords = (s: Pick<SpendingLimitState, 'limitPercent' | 'setAt'>): string =>
|
|
23
|
+
`Spending limit: agents stop at ${s.limitPercent}% of the week${s.setAt === null ? ' (the default)' : ''}`;
|
|
24
|
+
|
|
25
|
+
/** The week's reading against the limit, and whether it holds every agent step. */
|
|
26
|
+
export const spendingVerdictWords = (s: SpendingLimitState, now: number): string => {
|
|
27
|
+
if (s.reading === null) {
|
|
28
|
+
return s.failedSince === null
|
|
29
|
+
? "Holds nothing: there is no reading of the week's use yet."
|
|
30
|
+
: `Holds nothing: there is no good reading of the week's use yet; the newest read failed at ${whenAgo(s.failedSince.at, now)}: ${s.failedSince.error}`;
|
|
31
|
+
}
|
|
32
|
+
const reading = `the week's use is ${percentCut(s.reading.usedPercent)}, read ${whenAgo(s.reading.readAt, now)}`;
|
|
33
|
+
return s.holds
|
|
34
|
+
? `Holding every agent step: ${reading}, at or past the limit. Each waits before its agent call until a reading is below ${s.limitPercent}%.`
|
|
35
|
+
: `Holds nothing: ${reading}, below the limit.`;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/** Why the reading is stale and what the limit does meanwhile; none while it is current. */
|
|
39
|
+
export const spendingStaleWords = (s: SpendingLimitState, now: number): string | null => {
|
|
40
|
+
if (!s.stale) return null;
|
|
41
|
+
return s.failedSince === null
|
|
42
|
+
? "The reading is stale: none came since. The limit keeps that reading's verdict until a new one."
|
|
43
|
+
: `The reading is stale: the newest read failed at ${whenAgo(s.failedSince.at, now)} (${s.failedSince.error}). The limit keeps the last good reading's verdict until a read succeeds.`;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/** Which agent steps wait on it; none to say while it holds nothing and nothing waits. */
|
|
47
|
+
export const heldStepsWords = (s: Pick<SpendingLimitState, 'holds'>, held: ReadonlyArray<HeldStep>): string | null => {
|
|
48
|
+
if (held.length === 0) return s.holds ? 'No agent step has reached it yet.' : null;
|
|
49
|
+
return `Waiting on it: ${held.map((h) => `${h.workflow}, step ${h.step} (${h.runs} run${h.runs === 1 ? '' : 's'})`).join('; ')}.`;
|
|
50
|
+
};
|
|
@@ -96,7 +96,7 @@ function Node({ w, nodeStatus, href, style }: { readonly w: WorkflowView; readon
|
|
|
96
96
|
return (
|
|
97
97
|
<div data-workflow={w.name} className="wp-node" style={style}>
|
|
98
98
|
<a className="wp-node-name" href={href} title={`Open ${w.name}: ${w.description}`}>{w.name} ›</a>
|
|
99
|
-
{w.queue === null ? null : <QueueBar queue={w.queue} />}
|
|
99
|
+
{w.queue === null ? null : <QueueBar queue={w.queue} queuedNeedingAnAgent={w.queuedNeedingAnAgent} />}
|
|
100
100
|
<div className="wp-node-status">{nodeStatus(w)}</div>
|
|
101
101
|
</div>
|
|
102
102
|
);
|
|
@@ -8,7 +8,7 @@ import { Fragment, type ReactNode } from 'react';
|
|
|
8
8
|
import type { StepRunsNow, WorkflowRunsNow } from '../views/runs-now';
|
|
9
9
|
import type { StepSummary, WorkflowView } from '../views/workflows-view';
|
|
10
10
|
import { kindWords, type Crumb } from './drilldown';
|
|
11
|
-
import { queueSum } from './queue-table';
|
|
11
|
+
import { addendLabel, queueSum } from './queue-table';
|
|
12
12
|
|
|
13
13
|
/** The path opened, top first: every part but the last a link to its level, the last the page's title; `after` follows it. */
|
|
14
14
|
export function Breadcrumb({ crumbs, hrefOf, after }: { readonly crumbs: ReadonlyArray<Crumb>; readonly hrefOf: (path: ReadonlyArray<string>) => string; readonly after?: ReactNode }) {
|
|
@@ -26,9 +26,9 @@ export function Breadcrumb({ crumbs, hrefOf, after }: { readonly crumbs: Readonl
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
/** A sub-workflow's tasks on one line, as an addition: every category, then their total. */
|
|
29
|
-
const tasksLine = (queue: NonNullable<WorkflowView['queue']
|
|
30
|
-
const sum = queueSum(queue);
|
|
31
|
-
return `${sum.addends.map((a) => `${a.text} ${a
|
|
29
|
+
const tasksLine = (queue: NonNullable<WorkflowView['queue']>, queuedNeedingAnAgent: WorkflowView['queuedNeedingAnAgent']): string => {
|
|
30
|
+
const sum = queueSum(queue, queuedNeedingAnAgent);
|
|
31
|
+
return `${sum.addends.map((a) => `${a.text} ${addendLabel(a)}`).join(' + ')} = ${sum.totalText}`;
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
/** A sub-workflow's runs now against its run limit, in words. */
|
|
@@ -77,7 +77,7 @@ export function StepList({ steps, path, hrefOf, workflowOf, runsOf, runs, groupO
|
|
|
77
77
|
<span className="wp-kind">{kindWords(s)}</span>
|
|
78
78
|
</div>
|
|
79
79
|
<div className="wp-drill-what wp-mut">{s.description}</div>
|
|
80
|
-
{sub === undefined || sub.queue === null ? null : <div className="wp-drill-figures">{tasksLine(sub.queue)}</div>}
|
|
80
|
+
{sub === undefined || sub.queue === null ? null : <div className="wp-drill-figures">{tasksLine(sub.queue, sub.queuedNeedingAnAgent)}</div>}
|
|
81
81
|
{sub === undefined ? null : <div className="wp-drill-figures wp-mut">{runsLine(sub, runsOf(sub.name))}</div>}
|
|
82
82
|
{inStep === null ? null : <div className="wp-drill-figures">{inStep}</div>}
|
|
83
83
|
</li>
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* an addition (queued + in progress + blocked + done), its runs and limits, its tasks over time, its own steps with their
|
|
7
7
|
* kinds, and, read from its own records while it is open, why its blocked tasks are blocked, what its steps cost, its step
|
|
8
8
|
* graph and where its runs stopped. At the top it also shows what the project gives of its machine and its agents'
|
|
9
|
-
* account: the CPU limit, the stop of everything, and usage. It reads the platform's two readings
|
|
9
|
+
* account: the CPU limit, the stop of everything, and usage; and on every level the spending limit (`spending-limit-control.tsx`). It reads the platform's two readings
|
|
10
10
|
* (`views/workflows-view.ts`) and runs now (`views/runs-now.ts`). Uses React, which the host page brings.
|
|
11
11
|
*/
|
|
12
12
|
import { Fragment, useEffect, useState, type ReactNode } from 'react';
|
|
@@ -24,6 +24,8 @@ import { WorkflowDag } from './workflow-dag';
|
|
|
24
24
|
import { AgentUsageLine } from './agent-usage-line';
|
|
25
25
|
import type { AgentUsage } from './agent-usage';
|
|
26
26
|
import { MachineControls } from './machine-controls';
|
|
27
|
+
import { SpendingLimitControl } from './spending-limit-control';
|
|
28
|
+
import { heldSteps } from './spending-words';
|
|
27
29
|
|
|
28
30
|
/** What the page is given at each poll, all of it read at the request: every workflow, and where runs are now. */
|
|
29
31
|
export interface WorkflowsPageData {
|
|
@@ -79,6 +81,8 @@ export interface WorkflowsDashboardProps {
|
|
|
79
81
|
/** Stops everything the project runs, and resumes it; with neither, no button shows. */
|
|
80
82
|
readonly stopEverything?: () => Promise<void>;
|
|
81
83
|
readonly resume?: () => Promise<void>;
|
|
84
|
+
/** Stores a new spending limit, a whole percent of the week; with none the limit shows without buttons (`spending-limit-control.tsx`). */
|
|
85
|
+
readonly setSpendingLimit?: (weekPercent: number) => Promise<void>;
|
|
82
86
|
/**
|
|
83
87
|
* THE DRILL-DOWN (`drilldown.ts`): the sub-workflow steps opened below the top workflow, top first, and each level's
|
|
84
88
|
* address, which the host page routes back here as `path`.
|
|
@@ -279,6 +283,12 @@ function WorkflowStatus({ workflow, runs, limits, setLimit }: { readonly workflo
|
|
|
279
283
|
);
|
|
280
284
|
}
|
|
281
285
|
|
|
286
|
+
/** What its Pick does with its tasks marked as needing an agent, in words. */
|
|
287
|
+
const needingAnAgentLine = (passedOverBecause: string | null): string =>
|
|
288
|
+
passedOverBecause === null
|
|
289
|
+
? 'Each ended a run at an agent step when no agent could be had. An agent can be had now, so its Pick takes them in their queue\'s order again.'
|
|
290
|
+
: `Each ended a run at an agent step when no agent could be had. Its Pick passes over them now, because ${passedOverBecause}, and takes them in their queue's order once an agent can be had.`;
|
|
291
|
+
|
|
282
292
|
/** How often an open workflow's figures are read again. */
|
|
283
293
|
const FIGURES_EVERY_MS = 15_000;
|
|
284
294
|
|
|
@@ -305,6 +315,17 @@ function WorkflowDetail({ workflow, runs, now, figuresUrl, hrefOfWorkflow }: { r
|
|
|
305
315
|
</table>
|
|
306
316
|
</>
|
|
307
317
|
)}
|
|
318
|
+
{figures.needingAnAgent.reasons.length === 0 ? null : (
|
|
319
|
+
<>
|
|
320
|
+
<h4 className="wp-h4">Queued, needing an agent</h4>
|
|
321
|
+
<p className={figures.needingAnAgent.passedOverBecause === null ? 'wp-line' : 'wp-line wp-bad'}>{needingAnAgentLine(figures.needingAnAgent.passedOverBecause)}</p>
|
|
322
|
+
<table className="wp-reasons">
|
|
323
|
+
<tbody>
|
|
324
|
+
{figures.needingAnAgent.reasons.map((b) => <tr key={b.why}><td className="wp-r">{b.tasks.toLocaleString("en-US")}</td><td>{b.why}</td></tr>)}
|
|
325
|
+
</tbody>
|
|
326
|
+
</table>
|
|
327
|
+
</>
|
|
328
|
+
)}
|
|
308
329
|
{workflow.item === null ? null : <p className="wp-line">{yieldLine(figures, workflow.finishedWord)}</p>}
|
|
309
330
|
<p className="wp-line">{runCostLine(figures)}</p>
|
|
310
331
|
<StepsTable workflow={figures} usesAgents={workflow.usesAgents} runs={runs} now={now} />
|
|
@@ -341,7 +362,7 @@ function DrillLevelView({ data, path, hrefOf, now, figuresUrl, sourceHref, phase
|
|
|
341
362
|
{level.notFound === null ? null : <p className="wp-line wp-bad">{level.name} has no sub-workflow step named {level.notFound}.</p>}
|
|
342
363
|
<p className="wp-line">{level.description}</p>
|
|
343
364
|
{w === null ? null : <p className="wp-line wp-mut">{startsLine(w)}</p>}
|
|
344
|
-
{w === null || w.queue === null ? null : <QueueBar queue={w.queue} />}
|
|
365
|
+
{w === null || w.queue === null ? null : <QueueBar queue={w.queue} queuedNeedingAnAgent={w.queuedNeedingAnAgent} />}
|
|
345
366
|
{w === null ? null : <div className="wp-node-status wp-drill-status"><WorkflowStatus workflow={w} runs={runs} limits={w.limits} setLimit={setLimit} /></div>}
|
|
346
367
|
{/* Its tasks over time: at the top a row for each step that has tasks; below it, the workflow opened and each such step of its own. */}
|
|
347
368
|
<QueueChart view={data.view} level={path.join("/")} rowWord={w === null ? "step" : "workflow"}
|
|
@@ -364,7 +385,7 @@ function DrillLevelView({ data, path, hrefOf, now, figuresUrl, sourceHref, phase
|
|
|
364
385
|
);
|
|
365
386
|
}
|
|
366
387
|
|
|
367
|
-
export function WorkflowsDashboard({ data, error, figuresUrl, sourceHref, header, phaseLabel, setLimit, setCpuLimit, stopEverything, resume, path, hrefOf }: WorkflowsDashboardProps) {
|
|
388
|
+
export function WorkflowsDashboard({ data, error, figuresUrl, sourceHref, header, phaseLabel, setLimit, setCpuLimit, stopEverything, resume, setSpendingLimit, path, hrefOf }: WorkflowsDashboardProps) {
|
|
368
389
|
const now = Date.now() / 1000;
|
|
369
390
|
const atTheTop = path.length === 0;
|
|
370
391
|
return (
|
|
@@ -374,6 +395,10 @@ export function WorkflowsDashboard({ data, error, figuresUrl, sourceHref, header
|
|
|
374
395
|
{error !== null ? `The workflows could not be read: ${error}` : data === null ? 'Reading the workflows…' : `Read from the records ${whenAgo(data.view.at, now)}.`}
|
|
375
396
|
</p>
|
|
376
397
|
{data === null ? null : <p className={data.cpu.use !== null && data.cpu.use.cores > data.cpu.limit ? 'wp-line wp-bad' : 'wp-line'}>{cpuLine(data.cpu, now)}</p>}
|
|
398
|
+
{/* The spending limit holds agent steps at every level, so every level says where it stands. */}
|
|
399
|
+
{data === null || data.view.spending === null ? null : (
|
|
400
|
+
<SpendingLimitControl spending={data.view.spending} held={heldSteps(data.runsNow)} now={now} {...(setSpendingLimit === undefined ? {} : { setSpendingLimit })} />
|
|
401
|
+
)}
|
|
377
402
|
{/* Nothing a level decides is drawn before the first read: a server draws one page for every level's address. */}
|
|
378
403
|
{data === null || !atTheTop ? null : (
|
|
379
404
|
<>
|
package/src/index.ts
CHANGED
|
@@ -14,9 +14,10 @@ import { makePickWakes } from './pick-wakes';
|
|
|
14
14
|
import { makeStepFiles } from './step-files';
|
|
15
15
|
import { makeStepUsage } from './step-usage';
|
|
16
16
|
import { keptRunningByItsBudget, makeSteps, runLimitOf } from './steps';
|
|
17
|
-
import { blockedReasons, makeTasks } from './tasks';
|
|
17
|
+
import { blockedReasons, makeTasks, needsAgentReasons } from './tasks';
|
|
18
18
|
import { buildWorkflowFigures, buildWorkflowsView, type WorkflowFigures, type WorkflowsView, type WorkflowView } from './views/workflows-view';
|
|
19
19
|
import { makeQueueCounts } from './queue-counts';
|
|
20
|
+
import { makeSpendingLimit } from './spending-limit';
|
|
20
21
|
import { sqliteBudgets, type LimitStore } from './storage/budgets';
|
|
21
22
|
import { sqliteEngineRecords, type EngineRecords } from './storage/engine-records';
|
|
22
23
|
import { sqliteStore } from './storage/sqlite-store';
|
|
@@ -30,6 +31,7 @@ export * from './budget-states';
|
|
|
30
31
|
export * from './keep-running';
|
|
31
32
|
export * from './pick-wakes';
|
|
32
33
|
export * from './queue-counts';
|
|
34
|
+
export * from './spending-limit';
|
|
33
35
|
export * from './step-files';
|
|
34
36
|
export * from './step-meter';
|
|
35
37
|
export * from './steps';
|
|
@@ -100,10 +102,12 @@ export const createWorkflowPlatform = <Phase extends string, R>(input: {
|
|
|
100
102
|
const stepFiles = makeStepFiles({ tree: project.tree, runLightNow: project.runLightNow });
|
|
101
103
|
const stepUsage = makeStepUsage({ variable: project.stepRecordVariable, addStepCompile: (record) => { Effect.runFork(Effect.catchTag(storage.stepRecords.addStepCompile(record), 'StorageError', (e) => Effect.logError(`[step-runs] a compile of step record ${record}: ${e.reason}`))); } });
|
|
102
104
|
const tasks = makeTasks({ store: storage.tasks, engine: storage.engine, stepRecords: storage.stepRecords, wakes, texts: project.texts });
|
|
105
|
+
const spending = makeSpendingLimit({ store: storage.budgets, usage: project.weekUsage === undefined ? null : project.weekUsage, wakes });
|
|
103
106
|
const steps = makeSteps<Phase, R>({
|
|
104
107
|
sourceRoot: project.sourceRoot, stepRecords: storage.stepRecords, engine: storage.engine, tasks, wakes, budgets: storage.budgets, stepFiles,
|
|
105
108
|
CurrentStepUsage: stepUsage.CurrentStepUsage, isTransientFailure: project.isTransientFailure, thisProcess: project.processes.thisProcess, inputs: storage.inputs,
|
|
106
109
|
queueChanged: (workflow) => queueCounts.changed(workflow),
|
|
110
|
+
spendingHoldsAgents: spending.holdsAgents,
|
|
107
111
|
});
|
|
108
112
|
const queueCounts = makeQueueCounts({
|
|
109
113
|
store: storage.tasks, tasks, wakes,
|
|
@@ -141,7 +145,7 @@ export const createWorkflowPlatform = <Phase extends string, R>(input: {
|
|
|
141
145
|
*/
|
|
142
146
|
const view = (r: { readonly now: number; readonly phases: ReadonlyArray<string>; readonly top: { readonly name: string; readonly description: string } }): Effect.Effect<WorkflowsView, StorageError> => Effect.gen(function* () {
|
|
143
147
|
const limits = yield* limitsNow();
|
|
144
|
-
return yield* buildWorkflowsView({ declared: steps.declaredWorkflows(), phases: r.phases, top: r.top, now: r.now, taskStore: storage.tasks, locate, limitsOf: (name) => limits[name] ?? null });
|
|
148
|
+
return yield* buildWorkflowsView({ declared: steps.declaredWorkflows(), phases: r.phases, top: r.top, now: r.now, taskStore: storage.tasks, locate, limitsOf: (name) => limits[name] ?? null, spending: yield* spending.state(r.now) });
|
|
145
149
|
});
|
|
146
150
|
|
|
147
151
|
/** One workflow's figures over the `hours` before `now`, read from its own records (`buildWorkflowFigures`); none for one not declared. */
|
|
@@ -149,10 +153,15 @@ export const createWorkflowPlatform = <Phase extends string, R>(input: {
|
|
|
149
153
|
const declaration = steps.declaredWorkflows().find((d) => d.name === r.workflow);
|
|
150
154
|
return declaration === undefined ? Effect.succeed(null) : buildWorkflowFigures({
|
|
151
155
|
declaration, now: r.now, hours: r.hours, records: storage.stepRecords, engine: storage.engine, locate,
|
|
152
|
-
|
|
156
|
+
reasons: declaration.item === null
|
|
157
|
+
? Effect.succeed({ blocked: [], needingAnAgent: { reasons: [], passedOverBecause: null } })
|
|
158
|
+
: Effect.map(Effect.all({ summaries: tasks.taskSummaries({ workflow: r.workflow }), unavailable: steps.agentsUnavailable(r.workflow) }), ({ summaries, unavailable }) => ({
|
|
159
|
+
blocked: blockedReasons(summaries),
|
|
160
|
+
needingAnAgent: { reasons: needsAgentReasons(summaries), passedOverBecause: unavailable },
|
|
161
|
+
})),
|
|
153
162
|
});
|
|
154
163
|
};
|
|
155
|
-
return { project, storage, wakes, stepFiles, stepUsage, tasks, steps, view, figures, limitsNow, queueCounts };
|
|
164
|
+
return { project, storage, wakes, stepFiles, stepUsage, tasks, steps, view, figures, limitsNow, queueCounts, spending };
|
|
156
165
|
};
|
|
157
166
|
|
|
158
167
|
export type WorkflowPlatform<Phase extends string, R> = ReturnType<typeof createWorkflowPlatform<Phase, R>>;
|
package/src/pick-wakes.ts
CHANGED
|
@@ -67,6 +67,8 @@ export interface PickWakes {
|
|
|
67
67
|
* waiting it held its process's handover open for the engine's full limit, 10 minutes (2026-11-11).
|
|
68
68
|
*/
|
|
69
69
|
readonly releaseWaiting: () => void;
|
|
70
|
+
/** Whether this process is handing its runs to another (`releaseWaiting` was called): what a step that waits on work elsewhere asks. */
|
|
71
|
+
readonly handingOver: () => boolean;
|
|
70
72
|
}
|
|
71
73
|
|
|
72
74
|
const SUMMARY_MS = 60_000;
|
|
@@ -147,6 +149,7 @@ export const makePickWakes = (): PickWakes => {
|
|
|
147
149
|
relay = send;
|
|
148
150
|
},
|
|
149
151
|
wake: wakeHere,
|
|
152
|
+
handingOver: () => released,
|
|
150
153
|
releaseWaiting: () => {
|
|
151
154
|
released = true;
|
|
152
155
|
for (const waiter of [...waiters]) waiter.release();
|
package/src/project.ts
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
* WHAT A PROJECT TELLS THE PLATFORM ABOUT ITSELF: the facts no generic code can know. Everything else (how a step is
|
|
3
3
|
* measured, how a task is queued, when a waiting Pick wakes) is the platform's.
|
|
4
4
|
*/
|
|
5
|
+
import type { Effect } from 'effect';
|
|
6
|
+
import type { StorageError } from './storage/storage-error';
|
|
5
7
|
|
|
6
8
|
/** A process, by its pid and the second it started (as `ps` reports it), so a reused pid is never taken for it. */
|
|
7
9
|
export interface ProcessIdentity {
|
|
@@ -58,6 +60,34 @@ export interface CpuLimit {
|
|
|
58
60
|
readonly newestUse: () => { readonly at: number; readonly cores: number; readonly held: number; readonly waiting: number } | null;
|
|
59
61
|
}
|
|
60
62
|
|
|
63
|
+
/** One good reading of the week the project's agents spend from, as its account reports it. */
|
|
64
|
+
export interface WeekUsageReading {
|
|
65
|
+
/** How much of the week is used, in percent. */
|
|
66
|
+
readonly usedPercent: number;
|
|
67
|
+
/** When it was read, unix seconds. */
|
|
68
|
+
readonly readAt: number;
|
|
69
|
+
/** When the week starts again, unix seconds; none where the account does not say. */
|
|
70
|
+
readonly resetsAt: number | null;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** What the project knows of its week now: its newest good reading, and a read that failed after it. */
|
|
74
|
+
export interface WeekUsageNow {
|
|
75
|
+
/** The newest reading that succeeded, however old; none before the first. */
|
|
76
|
+
readonly good: WeekUsageReading | null;
|
|
77
|
+
/** The newest read, where it failed after that one: when, and why in words. */
|
|
78
|
+
readonly failedSince: { readonly at: number; readonly error: string } | null;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* THE WEEK THE PROJECT'S AGENTS SPEND FROM, as the project reads it: the one figure the spending limit judges
|
|
83
|
+
* (`spending-limit.ts`). The project reads it however it reads its account; the platform never asks the account itself.
|
|
84
|
+
*/
|
|
85
|
+
export interface WeekUsage {
|
|
86
|
+
readonly now: () => Effect.Effect<WeekUsageNow, StorageError>;
|
|
87
|
+
/** How old a good reading may be before a page calls it stale: the project's time between readings, and its margin. */
|
|
88
|
+
readonly staleAfterSeconds: number;
|
|
89
|
+
}
|
|
90
|
+
|
|
61
91
|
export interface WorkflowProject {
|
|
62
92
|
/** The folder a workflow's or step's source link is relative to. */
|
|
63
93
|
readonly sourceRoot: string;
|
|
@@ -77,4 +107,9 @@ export interface WorkflowProject {
|
|
|
77
107
|
/** A failure that says nothing about the work and is waited out: a step retries on it (a locked database). */
|
|
78
108
|
readonly isTransientFailure: (failure: unknown) => boolean;
|
|
79
109
|
readonly cpu: CpuLimit;
|
|
110
|
+
/**
|
|
111
|
+
* The week its agents spend from, where it reads one: the spending limit holds its agent steps by it
|
|
112
|
+
* (`spending-limit.ts`). A project that gives none has no spending limit.
|
|
113
|
+
*/
|
|
114
|
+
readonly weekUsage?: WeekUsage;
|
|
80
115
|
}
|
package/src/queue-counts.ts
CHANGED
|
@@ -18,6 +18,12 @@ import { statusCounts, type Tasks } from './tasks';
|
|
|
18
18
|
/** How long after a queue's first change it is counted: every change in that time is in the one count. */
|
|
19
19
|
export const COUNT_AFTER_MS = 5_000;
|
|
20
20
|
|
|
21
|
+
/**
|
|
22
|
+
* The count recorded beside the four statuses: how many queued tasks are marked as needing an agent (`tasks.ts`
|
|
23
|
+
* `TaskSummary.needsAgent`). Part of `queued`, never an addend of its own: a page shows it beside that row.
|
|
24
|
+
*/
|
|
25
|
+
export const QUEUED_NEEDING_AN_AGENT = 'queued, needing an agent';
|
|
26
|
+
|
|
21
27
|
export const makeQueueCounts = (deps: {
|
|
22
28
|
readonly store: Pick<TaskStore, 'recordQueueCounts'>;
|
|
23
29
|
readonly tasks: Pick<Tasks, 'taskSummaries'>;
|
|
@@ -29,7 +35,8 @@ export const makeQueueCounts = (deps: {
|
|
|
29
35
|
}) => {
|
|
30
36
|
/** Counts one workflow's queue now and records it. */
|
|
31
37
|
const count = (workflow: string): Effect.Effect<void, StorageError> => Effect.gen(function* () {
|
|
32
|
-
const
|
|
38
|
+
const summaries = yield* deps.tasks.taskSummaries({ workflow });
|
|
39
|
+
const counts = { ...statusCounts(summaries), [QUEUED_NEEDING_AN_AGENT]: summaries.filter((t) => t.status === 'queued' && t.needsAgent !== null).length };
|
|
33
40
|
yield* deps.store.recordQueueCounts({ at: Date.now() / 1000, counts: Object.entries(counts).map(([bucket, tasks]) => ({ workflow, bucket, tasks })) });
|
|
34
41
|
});
|
|
35
42
|
|