@jive-sh/workflow-platform 0.6.3 → 1.0.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 +66 -295
- package/component/_generated/api.ts +72 -0
- package/component/_generated/component.ts +621 -0
- package/component/_generated/dataModel.ts +60 -0
- package/component/_generated/server.ts +169 -0
- package/component/convex.config.ts +3 -0
- package/component/engine.ts +755 -0
- package/component/errors.ts +66 -0
- package/component/events.ts +17 -0
- package/component/notes.ts +13 -0
- package/component/places.ts +136 -0
- package/component/retention.ts +205 -0
- package/component/runEngine.ts +25 -0
- package/component/schema.ts +132 -0
- package/component/steps.ts +188 -0
- package/component/store.ts +512 -0
- package/component/tasks.ts +289 -0
- package/component/worker.ts +109 -0
- package/component/workflows.ts +83 -0
- package/dist/definition/agent-runner.js +9 -0
- package/dist/definition/agent-runner.js.map +1 -0
- package/dist/definition/file-store.js +9 -0
- package/dist/definition/file-store.js.map +1 -0
- package/dist/definition/program-build.js +10 -0
- package/dist/definition/program-build.js.map +1 -0
- package/dist/definition/step.js +1 -0
- package/dist/definition/step.js.map +1 -0
- package/dist/definition/task-schema.js +5 -0
- package/dist/definition/task-schema.js.map +1 -0
- package/dist/definition/tasks.js +9 -0
- package/dist/definition/tasks.js.map +1 -0
- package/dist/definition/workflow.js +111 -0
- package/dist/definition/workflow.js.map +1 -0
- package/dist/graph.js +301 -9
- package/dist/graph.js.map +1 -1
- package/dist/index.js +7 -133
- package/dist/index.js.map +1 -1
- package/package.json +9 -4
- package/src/definition/agent-runner.ts +59 -0
- package/src/definition/file-store.ts +20 -0
- package/src/definition/program-build.ts +30 -0
- package/src/definition/step.ts +106 -0
- package/src/definition/task-schema.ts +15 -0
- package/src/definition/tasks.ts +43 -0
- package/src/definition/workflow.ts +255 -0
- package/src/graph.ts +341 -19
- package/src/index.ts +8 -168
- package/worker/directory-file-store.ts +42 -0
- package/worker/index.ts +12 -0
- package/worker/platform-client.ts +138 -0
- package/worker/step-meter.ts +80 -0
- package/worker/worker-tasks.ts +27 -0
- package/worker/worker.test.ts +200 -0
- package/worker/worker.ts +240 -0
- package/dist/budget-states.js +0 -30
- package/dist/budget-states.js.map +0 -1
- package/dist/cpu-limit/limiter.js +0 -839
- package/dist/cpu-limit/limiter.js.map +0 -1
- package/dist/cpu-limit/use.js +0 -139
- package/dist/cpu-limit/use.js.map +0 -1
- package/dist/dashboard/agent-usage.js +0 -25
- package/dist/dashboard/agent-usage.js.map +0 -1
- package/dist/dashboard/dashboard.css +0 -134
- package/dist/dashboard/drilldown.js +0 -16
- package/dist/dashboard/drilldown.js.map +0 -1
- package/dist/dashboard/queue-lines.js +0 -44
- package/dist/dashboard/queue-lines.js.map +0 -1
- package/dist/dashboard/queue-table.js +0 -16
- package/dist/dashboard/queue-table.js.map +0 -1
- package/dist/dashboard/spending-words.js +0 -32
- package/dist/dashboard/spending-words.js.map +0 -1
- package/dist/failure.js +0 -35
- package/dist/failure.js.map +0 -1
- package/dist/keep-running.js +0 -77
- package/dist/keep-running.js.map +0 -1
- package/dist/outside-failure.js +0 -31
- package/dist/outside-failure.js.map +0 -1
- package/dist/pick-wakes.js +0 -125
- package/dist/pick-wakes.js.map +0 -1
- package/dist/project.js +0 -1
- package/dist/project.js.map +0 -1
- package/dist/queue-counts.js +0 -51
- package/dist/queue-counts.js.map +0 -1
- package/dist/reasons.js +0 -33
- package/dist/reasons.js.map +0 -1
- package/dist/spending-limit.js +0 -88
- package/dist/spending-limit.js.map +0 -1
- package/dist/step-files.js +0 -200
- package/dist/step-files.js.map +0 -1
- package/dist/step-meter.js +0 -97
- package/dist/step-meter.js.map +0 -1
- package/dist/step-usage.js +0 -19
- package/dist/step-usage.js.map +0 -1
- package/dist/steps.js +0 -920
- package/dist/steps.js.map +0 -1
- package/dist/storage/budgets.js +0 -85
- package/dist/storage/budgets.js.map +0 -1
- package/dist/storage/engine-records.js +0 -75
- package/dist/storage/engine-records.js.map +0 -1
- package/dist/storage/engine-storage.js +0 -67
- package/dist/storage/engine-storage.js.map +0 -1
- package/dist/storage/input-records.js +0 -12
- package/dist/storage/input-records.js.map +0 -1
- package/dist/storage/move-store.js +0 -251
- package/dist/storage/move-store.js.map +0 -1
- package/dist/storage/sqlite-store.js +0 -723
- package/dist/storage/sqlite-store.js.map +0 -1
- package/dist/storage/step-records.js +0 -11
- package/dist/storage/step-records.js.map +0 -1
- package/dist/storage/storage-error.js +0 -19
- package/dist/storage/storage-error.js.map +0 -1
- package/dist/storage/task-store.js +0 -24
- package/dist/storage/task-store.js.map +0 -1
- package/dist/tasks.js +0 -475
- package/dist/tasks.js.map +0 -1
- package/dist/views/format.js +0 -37
- package/dist/views/format.js.map +0 -1
- package/dist/views/runs-now.js +0 -75
- package/dist/views/runs-now.js.map +0 -1
- package/dist/views/step-funnel.js +0 -98
- package/dist/views/step-funnel.js.map +0 -1
- package/dist/views/step-graph.js +0 -34
- package/dist/views/step-graph.js.map +0 -1
- package/dist/views/workflow-flows.js +0 -53
- package/dist/views/workflow-flows.js.map +0 -1
- package/dist/views/workflows-view.js +0 -230
- package/dist/views/workflows-view.js.map +0 -1
- package/src/budget-states.ts +0 -55
- package/src/cpu-limit/limiter.ts +0 -935
- package/src/cpu-limit/use.ts +0 -166
- package/src/dashboard/agent-usage-line.tsx +0 -28
- package/src/dashboard/agent-usage.ts +0 -48
- package/src/dashboard/dashboard.css +0 -134
- package/src/dashboard/drilldown.ts +0 -43
- package/src/dashboard/index.tsx +0 -4
- package/src/dashboard/machine-controls.tsx +0 -53
- package/src/dashboard/queue-bar.tsx +0 -43
- package/src/dashboard/queue-chart.tsx +0 -150
- package/src/dashboard/queue-lines.ts +0 -87
- package/src/dashboard/queue-table.ts +0 -37
- package/src/dashboard/spending-limit-control.tsx +0 -50
- package/src/dashboard/spending-words.ts +0 -50
- package/src/dashboard/step-graph.tsx +0 -106
- package/src/dashboard/workflow-dag.tsx +0 -204
- package/src/dashboard/workflow-drilldown.tsx +0 -89
- package/src/dashboard/workflows-dashboard.tsx +0 -414
- package/src/failure.ts +0 -36
- package/src/keep-running.ts +0 -83
- package/src/outside-failure.ts +0 -39
- package/src/pick-wakes.ts +0 -182
- package/src/project.ts +0 -115
- package/src/queue-counts.ts +0 -64
- package/src/reasons.ts +0 -30
- package/src/spending-limit.ts +0 -156
- package/src/step-files.ts +0 -208
- package/src/step-meter.ts +0 -120
- package/src/step-usage.ts +0 -23
- package/src/steps.ts +0 -1239
- package/src/storage/budgets.ts +0 -113
- package/src/storage/engine-records.ts +0 -102
- package/src/storage/engine-storage.ts +0 -82
- package/src/storage/input-records.ts +0 -43
- package/src/storage/move-store.ts +0 -265
- package/src/storage/sqlite-store.ts +0 -829
- package/src/storage/step-records.ts +0 -306
- package/src/storage/storage-error.ts +0 -35
- package/src/storage/task-store.ts +0 -235
- package/src/tasks.ts +0 -561
- package/src/views/format.ts +0 -40
- package/src/views/runs-now.ts +0 -120
- package/src/views/step-funnel.ts +0 -163
- package/src/views/step-graph.ts +0 -68
- package/src/views/workflow-flows.ts +0 -97
- package/src/views/workflows-view.ts +0 -443
package/dist/keep-running.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* EACH WORKFLOW KEEPS THE RUNS GOING THAT ITS BUDGET SAYS, AND NOTHING ELSE DECIDES IT.
|
|
3
|
-
*
|
|
4
|
-
* Alex, 2026-11-06: "We simply have desire concurrent run rate per phase", then "move the concurrent run controls on the
|
|
5
|
-
* workflow level rather than on the phase level, then you can eliminate any logic that goes into decideing which workflows
|
|
6
|
-
* get the available runs". A workflow with an agent step and a list of work (`keptRunningByItsBudget`) is kept running by
|
|
7
|
-
* one trigger, with no code of its own: each turn it starts as many runs as the workflow's run limit keeps (`runLimit`) above
|
|
8
|
-
* the runs going, as soon as a run ends and otherwise on a fallback timer. There is no sharing between workflows, no order,
|
|
9
|
-
* no cap per item and no check of usage: a run with nothing to pick waits for an item (`steps.ts` `untilPicked`), and the
|
|
10
|
-
* blocking a Pick runs and the queue's order keep a run off what it cannot finish. A run limit of 0 holds one workflow.
|
|
11
|
-
*
|
|
12
|
-
* NO RUN STARTS THAT COULD TAKE NO WORK: while no agent can be had for a workflow and its Pick would pass over every task
|
|
13
|
-
* in its queue (`steps.ts` `whyNoRunCanTakeWork`), it starts none, and a run waiting in its Pick ends. Alex, relayed on 2026-11-20:
|
|
14
|
-
* "if the number of queued tasks that require agents is all of them, and if there is no remaining agentic budget or all
|
|
15
|
-
* agents are in use, then the workflow runner doesn't just continually cycle picking up tasks and moving them to the back
|
|
16
|
-
* of the queue again". The next turn after an agent can be had, a mark clears or new input lands starts runs again.
|
|
17
|
-
*/
|
|
18
|
-
import { keptRunningByItsBudget } from './steps';
|
|
19
|
-
import { runLimit } from './storage/budgets';
|
|
20
|
-
/** With no run ending to wake it, how often the trigger looks. */
|
|
21
|
-
export const KEEP_RUNNING_EVERY_SECONDS = 60;
|
|
22
|
-
/** How long one turn of the trigger may take, less than its minute; a turn past it is abandoned and the next one runs. */
|
|
23
|
-
export const TURN_LIMIT_MS = 50_000;
|
|
24
|
-
/** How long one run's start may take. */
|
|
25
|
-
export const START_LIMIT_SECONDS = 20;
|
|
26
|
-
/** The workflows this trigger keeps running, each with a budget. Pure. */
|
|
27
|
-
export const budgetedWorkflows = (declared) => declared.filter(keptRunningByItsBudget);
|
|
28
|
-
/**
|
|
29
|
-
* How many runs of one workflow to start now: the runs its run limit keeps above the runs going. Its agents' limit plays
|
|
30
|
-
* no part: at 0 agents its runs wait at their first agent step. Pure.
|
|
31
|
-
*/
|
|
32
|
-
export const runsToStart = (w) => Math.max(w.kept - w.running, 0);
|
|
33
|
-
/**
|
|
34
|
-
* One turn's plan: for each budgeted workflow, the runs going and how many to start; none where no run could take work
|
|
35
|
-
* (`noWork`, from `steps.ts` `whyNoRunCanTakeWork`), which says why. Pure but for the reads it is given.
|
|
36
|
-
*/
|
|
37
|
-
export const planRunStarts = (input) => budgetedWorkflows(input.declared).map((d) => {
|
|
38
|
-
const running = input.runningRuns(d.name);
|
|
39
|
-
const noWork = input.noWork(d.name);
|
|
40
|
-
return { declaration: d, running, noWork, start: noWork !== null ? 0 : runsToStart({ kept: runLimit(input.limitsOf(d.name)), running }) };
|
|
41
|
-
});
|
|
42
|
-
/**
|
|
43
|
-
* ONE TURN AT A TIME, AND NO TURN HOLDS THE NEXT UP FOR LONG. A call during a turn shares its result and asks for one more
|
|
44
|
-
* after it. A turn past `limitMs` fails, so nothing it hung on can leave the trigger shut, and `stillCurrent` turns false
|
|
45
|
-
* for it, so if it wakes later it starts nothing on figures that have gone old.
|
|
46
|
-
*/
|
|
47
|
-
export const oneTurnAtATime = (turn, limitMs) => {
|
|
48
|
-
let going = null;
|
|
49
|
-
let again = false;
|
|
50
|
-
let current = 0;
|
|
51
|
-
const trigger = () => {
|
|
52
|
-
if (going !== null) {
|
|
53
|
-
again = true;
|
|
54
|
-
return going;
|
|
55
|
-
}
|
|
56
|
-
current += 1;
|
|
57
|
-
const mine = current;
|
|
58
|
-
let timer;
|
|
59
|
-
const limit = new Promise((_, reject) => {
|
|
60
|
-
timer = setTimeout(() => reject(new Error(`a turn of the trigger was abandoned after ${limitMs / 1000} s`)), limitMs);
|
|
61
|
-
});
|
|
62
|
-
going = Promise.race([turn(() => current === mine), limit]).finally(() => {
|
|
63
|
-
clearTimeout(timer);
|
|
64
|
-
current += 1;
|
|
65
|
-
going = null;
|
|
66
|
-
if (again) {
|
|
67
|
-
again = false;
|
|
68
|
-
void trigger().catch(() => undefined);
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
return going;
|
|
72
|
-
};
|
|
73
|
-
return trigger;
|
|
74
|
-
};
|
|
75
|
-
/** A run's id: the time it was made, and a random tail so two made in one millisecond differ. */
|
|
76
|
-
export const newRunId = () => `${Date.now().toString(36)}${Math.floor(Math.random() * 1296).toString(36).padStart(2, '0')}`;
|
|
77
|
-
//# sourceMappingURL=keep-running.js.map
|
package/dist/keep-running.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1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AAC;IACf,CAAC,CAAC;IACF,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,iGAAiG;AACjG,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC"}
|
package/dist/outside-failure.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A RUN AN OUTSIDE SERVICE FAILED IS NO TRY. A task is blocked after `BLOCK_AFTER_TRIES` failed tries (`tasks.ts`), and
|
|
3
|
-
* only a run that did its work and ended without success is one. A run that failed because a service outside it could
|
|
4
|
-
* not do the work (a Claude usage limit, a model server that does not answer) says nothing about its item: counted, two
|
|
5
|
-
* weekly-limit failures took an item of skill-sync's skill refinement workflow from 9 tries to 11, and it was blocked
|
|
6
|
-
* for good once the limit reset (2026-11-25).
|
|
7
|
-
*
|
|
8
|
-
* A step says so by failing with `OutsideServiceUnavailable`. Claude's own usage-limit and rate-limit words are read the
|
|
9
|
-
* same way whatever error carries them, so outcomes recorded before this error existed count right too.
|
|
10
|
-
*
|
|
11
|
-
* The task store counts tries in SQL, from each outcome's text (`storage/sqlite-store.ts`): `OUTSIDE_FAILURE_PATTERNS`
|
|
12
|
-
* are its `LIKE` patterns, which SQLite matches without regard to ASCII case, and `isOutsideFailure` reads them the same
|
|
13
|
-
* way in code.
|
|
14
|
-
*/
|
|
15
|
-
import { Data } from 'effect';
|
|
16
|
-
/** What a step fails with when a service outside it could not do its work: its run's outcome is no try. */
|
|
17
|
-
export class OutsideServiceUnavailable extends Data.TaggedError('OutsideServiceUnavailable') {
|
|
18
|
-
}
|
|
19
|
-
/** The outcomes of runs an outside service failed, as SQL `LIKE` patterns on an outcome's text. */
|
|
20
|
-
export const OUTSIDE_FAILURE_PATTERNS = [
|
|
21
|
-
'failed: OutsideServiceUnavailable:%',
|
|
22
|
-
// Claude's own words: "You've hit your weekly limit · resets 6am (UTC)", "Claude usage limit reached", a 429's "rate limit".
|
|
23
|
-
'failed: %hit your % limit%',
|
|
24
|
-
'failed: %usage limit%',
|
|
25
|
-
'failed: %rate limit%',
|
|
26
|
-
];
|
|
27
|
-
const asRegExp = (pattern) => new RegExp(`^${pattern.split('%').map((part) => part.replace(/[.*+?^$()|[\]\\{}_]/g, (c) => (c === '_' ? '.' : `\\${c}`))).join('.*')}$`, 'is');
|
|
28
|
-
const OUTSIDE_FAILURES = OUTSIDE_FAILURE_PATTERNS.map(asRegExp);
|
|
29
|
-
/** Whether a run's outcome says an outside service failed it, as the task store reads it. */
|
|
30
|
-
export const isOutsideFailure = (outcome) => OUTSIDE_FAILURES.some((p) => p.test(outcome));
|
|
31
|
-
//# sourceMappingURL=outside-failure.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"outside-failure.js","sourceRoot":"","sources":["../../../src/outside-failure.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,2GAA2G;AAC3G,MAAM,OAAO,yBAA0B,SAAQ,IAAI,CAAC,WAAW,CAAC,2BAA2B,CAKzF;CAAG;AAEL,mGAAmG;AACnG,MAAM,CAAC,MAAM,wBAAwB,GAA0B;IAC7D,qCAAqC;IACrC,6HAA6H;IAC7H,4BAA4B;IAC5B,uBAAuB;IACvB,sBAAsB;CACvB,CAAC;AAEF,MAAM,QAAQ,GAAG,CAAC,OAAe,EAAU,EAAE,CAC3C,IAAI,MAAM,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AAClJ,MAAM,gBAAgB,GAAG,wBAAwB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAEhE,6FAA6F;AAC7F,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,OAAe,EAAW,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC"}
|
package/dist/pick-wakes.js
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WHAT WAKES A PICK THAT FOUND NOTHING IT CAN CLAIM (`steps.ts` `untilPicked`), never a timer. A wake is any event that can
|
|
3
|
-
* change what a Pick can claim: a note on one of its workflow's tasks (new input, a reopen, a release, a hold, an outcome:
|
|
4
|
-
* `tasks.ts`), an item new to its list (`recordListing`), its limits set (which also has the run planner plan
|
|
5
|
-
* again: `runPlanChanged`), or one of its runs ending, which lets that run's
|
|
6
|
-
* claim go. A claim held outside its workflow's runs ending, or a lease running out, wakes nothing: the next of these events
|
|
7
|
-
* re-checks it. Before 2026-11-11 a Pick with nothing picked again each minute, and at budget 0 it ended its run at once:
|
|
8
|
-
* the first project's main workflow then ran Pick and Finish about once a second, 17,844 times in 6 hours.
|
|
9
|
-
*
|
|
10
|
-
* EVERY WAKE NAMES ITS SOURCE, and each minute the log says, per workflow, how many wakes came from where and how many
|
|
11
|
-
* re-picks they cost (`[pick wakes]`): a waiting Pick that keeps picking again shows the event doing it (2026-11-12: the
|
|
12
|
-
* job runner spent 84-90% of its thread in re-picks, and nothing said what woke them).
|
|
13
|
-
*
|
|
14
|
-
* Wakes reach the Picks of the process that raised them: an event in another process wakes nothing here.
|
|
15
|
-
*/
|
|
16
|
-
import { Effect } from 'effect';
|
|
17
|
-
const SUMMARY_MS = 60_000;
|
|
18
|
-
export const makePickWakes = () => {
|
|
19
|
-
const waiters = new Set();
|
|
20
|
-
const wakesOfWorkflow = new Map();
|
|
21
|
-
let wakesOfEvery = 0;
|
|
22
|
-
/** This minute's wakes, by workflow and source, and the re-picks they cost. */
|
|
23
|
-
const wakesBySource = new Map();
|
|
24
|
-
const rePicks = new Map();
|
|
25
|
-
const countWake = (workflow, source) => {
|
|
26
|
-
const sources = wakesBySource.get(workflow) ?? new Map();
|
|
27
|
-
sources.set(source, (sources.get(source) ?? 0) + 1);
|
|
28
|
-
wakesBySource.set(workflow, sources);
|
|
29
|
-
};
|
|
30
|
-
setInterval(() => {
|
|
31
|
-
for (const workflow of new Set([...wakesBySource.keys(), ...rePicks.keys()])) {
|
|
32
|
-
const sources = [...(wakesBySource.get(workflow) ?? new Map())].map(([source, n]) => `${n} ${source}`).join(', ');
|
|
33
|
-
const picked = rePicks.get(workflow);
|
|
34
|
-
console.log(`[pick wakes] pid ${process.pid}, ${workflow} in the last minute: wakes ${sources === '' ? 'none' : sources}; ${picked === undefined ? 'no re-pick' : `${picked.count} re-picks taking ${Math.round(picked.ms)} ms`}`);
|
|
35
|
-
}
|
|
36
|
-
wakesBySource.clear();
|
|
37
|
-
rePicks.clear();
|
|
38
|
-
}, SUMMARY_MS).unref();
|
|
39
|
-
const pickWakesSoFar = (workflow) => (wakesOfWorkflow.get(workflow) ?? 0) + wakesOfEvery;
|
|
40
|
-
/**
|
|
41
|
-
* Wakes the waiting Picks after the code that called it has finished: a note written in a transaction is committed
|
|
42
|
-
* before any Pick reads the tasks again.
|
|
43
|
-
*/
|
|
44
|
-
const wake = (reaches) => {
|
|
45
|
-
queueMicrotask(() => {
|
|
46
|
-
for (const waiter of [...waiters])
|
|
47
|
-
if (reaches(waiter))
|
|
48
|
-
waiter.wake();
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
let relay = null;
|
|
52
|
-
const runPlanListeners = new Set();
|
|
53
|
-
const wakeListeners = new Set();
|
|
54
|
-
let released = false;
|
|
55
|
-
const wakeHere = (w) => {
|
|
56
|
-
for (const listener of wakeListeners)
|
|
57
|
-
queueMicrotask(() => listener(w));
|
|
58
|
-
if (w.runPlan === true)
|
|
59
|
-
for (const listener of runPlanListeners)
|
|
60
|
-
queueMicrotask(() => listener(w.workflow));
|
|
61
|
-
if (w.workflow === null) {
|
|
62
|
-
wakesOfEvery += 1;
|
|
63
|
-
countWake('every workflow', w.source);
|
|
64
|
-
wake(() => true);
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
const workflow = w.workflow;
|
|
68
|
-
wakesOfWorkflow.set(workflow, (wakesOfWorkflow.get(workflow) ?? 0) + 1);
|
|
69
|
-
countWake(workflow, w.source);
|
|
70
|
-
wake((waiter) => waiter.workflow === workflow);
|
|
71
|
-
};
|
|
72
|
-
const raise = (w) => {
|
|
73
|
-
wakeHere(w);
|
|
74
|
-
if (relay !== null)
|
|
75
|
-
relay(w);
|
|
76
|
-
};
|
|
77
|
-
return {
|
|
78
|
-
pickWakesSoFar,
|
|
79
|
-
wakePicksOf: (workflow, source) => raise({ workflow, source }),
|
|
80
|
-
wakeEveryPick: (source) => raise({ workflow: null, source }),
|
|
81
|
-
runPlanChanged: ({ workflow, source }) => raise({ workflow, source, runPlan: true }),
|
|
82
|
-
onRunPlanChanged: (listener) => {
|
|
83
|
-
runPlanListeners.add(listener);
|
|
84
|
-
},
|
|
85
|
-
onWake: (listener) => {
|
|
86
|
-
wakeListeners.add(listener);
|
|
87
|
-
},
|
|
88
|
-
relayTo: (send) => {
|
|
89
|
-
relay = send;
|
|
90
|
-
},
|
|
91
|
-
wake: wakeHere,
|
|
92
|
-
handingOver: () => released,
|
|
93
|
-
releaseWaiting: () => {
|
|
94
|
-
released = true;
|
|
95
|
-
for (const waiter of [...waiters])
|
|
96
|
-
waiter.release();
|
|
97
|
-
},
|
|
98
|
-
untilPickWoken: (input) => Effect.callback((resume) => {
|
|
99
|
-
if (released)
|
|
100
|
-
return resume(Effect.succeed('released'));
|
|
101
|
-
if (pickWakesSoFar(input.workflow) !== input.after)
|
|
102
|
-
return resume(Effect.succeed('woken'));
|
|
103
|
-
const waiter = {
|
|
104
|
-
workflow: input.workflow,
|
|
105
|
-
wake: () => {
|
|
106
|
-
waiters.delete(waiter);
|
|
107
|
-
resume(Effect.succeed('woken'));
|
|
108
|
-
},
|
|
109
|
-
release: () => {
|
|
110
|
-
waiters.delete(waiter);
|
|
111
|
-
resume(Effect.succeed('released'));
|
|
112
|
-
},
|
|
113
|
-
};
|
|
114
|
-
waiters.add(waiter);
|
|
115
|
-
return Effect.sync(() => {
|
|
116
|
-
waiters.delete(waiter);
|
|
117
|
-
});
|
|
118
|
-
}),
|
|
119
|
-
countRePick: (workflow, ms) => {
|
|
120
|
-
const was = rePicks.get(workflow) ?? { count: 0, ms: 0 };
|
|
121
|
-
rePicks.set(workflow, { count: was.count + 1, ms: was.ms + ms });
|
|
122
|
-
},
|
|
123
|
-
};
|
|
124
|
-
};
|
|
125
|
-
//# sourceMappingURL=pick-wakes.js.map
|
package/dist/pick-wakes.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pick-wakes.js","sourceRoot":"","sources":["../../../src/pick-wakes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AA0DhC,MAAM,UAAU,GAAG,MAAM,CAAC;AAE1B,MAAM,CAAC,MAAM,aAAa,GAAG,GAAc,EAAE;IAC3C,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,MAAM,eAAe,GAAG,IAAI,GAAG,EAAkB,CAAC;IAClD,IAAI,YAAY,GAAG,CAAC,CAAC;IACrB,+EAA+E;IAC/E,MAAM,aAAa,GAAG,IAAI,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E,EAAE,EAAE;YAC5B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC;YACzD,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,GAAG,CAAC,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QACnE,CAAC;KACF,CAAC;AACJ,CAAC,CAAC"}
|
package/dist/project.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=project.js.map
|
package/dist/project.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../../src/project.ts"],"names":[],"mappings":""}
|
package/dist/queue-counts.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* EACH QUEUE'S COUNTS, RECORDED WHEN ITS QUEUE MAY HAVE CHANGED (`queue_counts`), so a page reads the newest row and its
|
|
3
|
-
* history and never counts. A workflow's tasks by status are read from its tasks' notes (`tasks.ts` `taskSummaries`), once
|
|
4
|
-
* per change, in the one process that runs the project's workflows. A count only counts: blocking a task is its Pick's
|
|
5
|
-
* step, never a page's or this (`tasks.ts` `settleQueue`).
|
|
6
|
-
*
|
|
7
|
-
* WHAT COUNTS AS A CHANGE: every wake of a workflow's Picks (`pick-wakes.ts`: a note on one of its tasks, an item new to
|
|
8
|
-
* its list, one of its runs ending, a limit set), and a Pick claiming an item (`changed`). Every change within
|
|
9
|
-
* `COUNT_AFTER_MS` of the first is one count, taken at its end, so 25 short runs ending a minute cost 12 counts and each
|
|
10
|
-
* change shows within 5 seconds. A row is written only where a count moved.
|
|
11
|
-
*/
|
|
12
|
-
import { Effect } from 'effect';
|
|
13
|
-
import { statusCounts } from './tasks';
|
|
14
|
-
/** How long after a queue's first change it is counted: every change in that time is in the one count. */
|
|
15
|
-
export const COUNT_AFTER_MS = 5_000;
|
|
16
|
-
/**
|
|
17
|
-
* The count recorded beside the four statuses: how many queued tasks are marked as needing an agent (`tasks.ts`
|
|
18
|
-
* `TaskSummary.needsAgent`). Part of `queued`, never an addend of its own: a page shows it beside that row.
|
|
19
|
-
*/
|
|
20
|
-
export const QUEUED_NEEDING_AN_AGENT = 'queued, needing an agent';
|
|
21
|
-
export const makeQueueCounts = (deps) => {
|
|
22
|
-
/** Counts one workflow's queue now and records it. */
|
|
23
|
-
const count = (workflow) => Effect.gen(function* () {
|
|
24
|
-
const summaries = yield* deps.tasks.taskSummaries({ workflow });
|
|
25
|
-
const counts = { ...statusCounts(summaries), [QUEUED_NEEDING_AN_AGENT]: summaries.filter((t) => t.status === 'queued' && t.needsAgent !== null).length };
|
|
26
|
-
yield* deps.store.recordQueueCounts({ at: Date.now() / 1000, counts: Object.entries(counts).map(([bucket, tasks]) => ({ workflow, bucket, tasks })) });
|
|
27
|
-
});
|
|
28
|
-
let countSoon = () => undefined;
|
|
29
|
-
/**
|
|
30
|
-
* Starts recording: for the one process that runs the project's workflows, which gives `run`, how it runs an effect of
|
|
31
|
-
* theirs. Every queue is counted once at the start, then each on its changes.
|
|
32
|
-
*/
|
|
33
|
-
const record = (run) => {
|
|
34
|
-
const due = new Set();
|
|
35
|
-
countSoon = (workflow) => {
|
|
36
|
-
if (due.has(workflow) || !deps.withQueues().includes(workflow))
|
|
37
|
-
return;
|
|
38
|
-
due.add(workflow);
|
|
39
|
-
setTimeout(() => {
|
|
40
|
-
due.delete(workflow);
|
|
41
|
-
void run(count(workflow)).catch((e) => console.error(`[queue counts] ${workflow}: not counted: ${e instanceof Error ? e.message : String(e)}`));
|
|
42
|
-
}, deps.countAfterMs ?? COUNT_AFTER_MS).unref?.();
|
|
43
|
-
};
|
|
44
|
-
deps.wakes.onWake((wake) => { for (const workflow of wake.workflow === null ? deps.withQueues() : [wake.workflow])
|
|
45
|
-
countSoon(workflow); });
|
|
46
|
-
for (const workflow of deps.withQueues())
|
|
47
|
-
countSoon(workflow);
|
|
48
|
-
};
|
|
49
|
-
return { count, record, changed: (workflow) => countSoon(workflow) };
|
|
50
|
-
};
|
|
51
|
-
//# sourceMappingURL=queue-counts.js.map
|
package/dist/queue-counts.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"queue-counts.js","sourceRoot":"","sources":["../../../src/queue-counts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,OAAO,EAAE,YAAY,EAAc,MAAM,SAAS,CAAC;AAEnD,0GAA0G;AAC1G,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC;AAEpC;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,0BAA0B,CAAC;AAElE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,IAQ/B,EAAE,EAAE;IACH,sDAAsD;IACtD,MAAM,KAAK,GAAG,CAAC,QAAgB,EAAqC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QACzF,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;QAChE,MAAM,MAAM,GAAG,EAAE,GAAG,YAAY,CAAC,SAAS,CAAC,EAAE,CAAC,uBAAuB,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,QAAQ,IAAI,CAAC,CAAC,UAAU,KAAK,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;QACzJ,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,OAAO,C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AAC,IAAI,CAAC,QAAQ,CAAC;YAAE,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3I,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,UAAU,EAAE;YAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;IAChE,CAAC,CAAC;IAEF,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,QAAgB,EAAQ,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC;AACrF,CAAC,CAAC"}
|
package/dist/reasons.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WHY A STEP ENDED AS IT DID, IN A LINE, on every step record: what outcomes are counted by, per workflow and step. A step
|
|
3
|
-
* can say how its result gives its reason (`defineStep`'s `reason`); otherwise `standardReason` reads it from the result's
|
|
4
|
-
* own words. A failure's reason is its error's first line, and an interruption's is "interrupted". Dependency-free, so a
|
|
5
|
-
* page can import it.
|
|
6
|
-
*/
|
|
7
|
-
/** The most a reason keeps, so reasons compare and count. */
|
|
8
|
-
export const REASON_CHARACTERS = 160;
|
|
9
|
-
/** A text as one comparable line: its first line, cut short. Pure. */
|
|
10
|
-
export const oneLine = (text) => {
|
|
11
|
-
const first = text.trim().split('\n')[0].trim();
|
|
12
|
-
return first.length <= REASON_CHARACTERS ? first : `${first.slice(0, REASON_CHARACTERS - 1)}…`;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* A result's reason, read from its own words: a text is its own reason; an object gives its `reason`, `why` or `outcome`,
|
|
16
|
-
* the first that is a text; an empty `Option` or none found nothing; anything else succeeded with no words of its own. Pure.
|
|
17
|
-
*/
|
|
18
|
-
export const standardReason = (result) => {
|
|
19
|
-
if (typeof result === 'string')
|
|
20
|
-
return oneLine(result);
|
|
21
|
-
if (result === null || result === undefined)
|
|
22
|
-
return 'found nothing';
|
|
23
|
-
if (typeof result === 'object') {
|
|
24
|
-
const r = result;
|
|
25
|
-
for (const words of [r.reason, r.why, r.outcome])
|
|
26
|
-
if (typeof words === 'string' && words.trim() !== '')
|
|
27
|
-
return oneLine(words);
|
|
28
|
-
if (r._tag === 'None')
|
|
29
|
-
return 'found nothing';
|
|
30
|
-
}
|
|
31
|
-
return 'succeeded';
|
|
32
|
-
};
|
|
33
|
-
//# sourceMappingURL=reasons.js.map
|
package/dist/reasons.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reasons.js","sourceRoot":"","sources":["../../../src/reasons.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,6DAA6D;AAC7D,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAErC,sEAAsE;AACtE,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAAY,EAAU,EAAE;IAC9C,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAE,CAAC,IAAI,EAAE,CAAC;IACjD,OAAO,KAAK,CAAC,MAAM,IAAI,iBAAiB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,iBAAiB,GAAG,CAAC,CAAC,GAAG,CAAC;AACjG,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAe,EAAU,EAAE;IACxD,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;IACvD,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,eAAe,CAAC;IACpE,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,MAAM,CAAC,GAAG,MAAoH,CAAC;QAC/H,KAAK,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC;YAAE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE;gBAAE,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;QAC9H,IAAI,CAAC,CAAC,IAAI,KAAK,MAAM;YAAE,OAAO,eAAe,CAAC;IAChD,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC"}
|
package/dist/spending-limit.js
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* THE SPENDING LIMIT: ONE SETTING FOR THE WHOLE ACCOUNT, "AGENTS STOP AT X% OF THE WEEK". Alex, 2026-11-20: "ideally the
|
|
3
|
-
* workflow platform offers a configurable spending limit", and, of this design, "yes to building the spending limit".
|
|
4
|
-
*
|
|
5
|
-
* While the project's newest good reading of its week (`WorkflowProject.weekUsage`) is at or past X, every agent step of
|
|
6
|
-
* every workflow waits before its agent call, as it waits at an agents' limit of 0 (`steps.ts` `untilAgentSlot`), its record
|
|
7
|
-
* saying why in words (`spendingWait`). An agent call already going is never cut off. The steps go on by themselves once a
|
|
8
|
-
* reading is below X, which the week's reset brings: the project tells the platform of each reading it takes
|
|
9
|
-
* (`readingTaken`), and a verdict that changed wakes every waiting step. None is set: X is 95 (`DEFAULT_SPENDING_LIMIT_PERCENT`).
|
|
10
|
-
*
|
|
11
|
-
* IT JUDGES THE ACCOUNT'S WEEK, NOT A COUNT OF TOKENS, because the week is the one figure that also counts spending the
|
|
12
|
-
* platform cannot see: agent threads run by hand, outside any workflow, which no step record holds. They were 73% of the
|
|
13
|
-
* spending of the week that ran out on 2026-11-01, 57 hours before its reset (the first project's `usage/pace.ts`).
|
|
14
|
-
*
|
|
15
|
-
* A READING THAT FAILS OR GROWS OLD NEVER LIFTS IT. The rule judges the newest good reading, however old, so a hold stands
|
|
16
|
-
* until a good reading below X, and a page says the reading is stale and why. That holds past the reset the reading named
|
|
17
|
-
* too: with every read failing, agents wait until one succeeds, rather than spend on a week nobody can see. A reading that
|
|
18
|
-
* cannot be read at all holds every agent step, as limits that cannot be read hold their runs. With no good reading yet
|
|
19
|
-
* there is nothing to judge, and nothing is held. A project that reads no week has no spending limit.
|
|
20
|
-
*/
|
|
21
|
-
import { Effect, pipe, Result } from 'effect';
|
|
22
|
-
import { SET_SPENDING_LIMIT_SQL } from './storage/budgets';
|
|
23
|
-
import { percentCut } from './views/format';
|
|
24
|
-
/** The percent of the week at which agents stop where none is set. */
|
|
25
|
-
export const DEFAULT_SPENDING_LIMIT_PERCENT = 95;
|
|
26
|
-
/** What every agent step's record says while the limit holds it. */
|
|
27
|
-
export const spendingWait = (r) => `waits: the week's use is ${percentCut(r.usedPercent)}, at or past the spending limit of ${r.limitPercent}%`;
|
|
28
|
-
/** How every wait the spending limit gives starts, its unreadable one included. */
|
|
29
|
-
const SPENDING_WAIT_START = "waits: the week's use ";
|
|
30
|
-
/** Whether what a step waits on is the spending limit: what a page counts its waiting steps by. Pure. */
|
|
31
|
-
export const isSpendingLimitWait = (why) => why.startsWith(SPENDING_WAIT_START);
|
|
32
|
-
/** The limit against the week now. Pure. */
|
|
33
|
-
export const judgeSpending = (input) => {
|
|
34
|
-
const limitPercent = input.limit === null ? DEFAULT_SPENDING_LIMIT_PERCENT : input.limit.weekPercent;
|
|
35
|
-
const good = input.usage.good;
|
|
36
|
-
return {
|
|
37
|
-
limitPercent,
|
|
38
|
-
setAt: input.limit === null ? null : input.limit.changedAt,
|
|
39
|
-
reading: good,
|
|
40
|
-
failedSince: input.usage.failedSince,
|
|
41
|
-
stale: good !== null && (input.usage.failedSince !== null || input.now - good.readAt > input.staleAfterSeconds),
|
|
42
|
-
holds: good !== null && good.usedPercent >= limitPercent,
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
export const makeSpendingLimit = (deps) => {
|
|
46
|
-
const { usage } = deps;
|
|
47
|
-
const state = (now) => usage === null ? Effect.succeed(null) : Effect.map(Effect.all({ limit: deps.store.spendingLimit(), week: usage.now() }), ({ limit, week }) => judgeSpending({ limit, usage: week, staleAfterSeconds: usage.staleAfterSeconds, now }));
|
|
48
|
-
/** What the last reading told held, in this process; none before the first. */
|
|
49
|
-
let heldAtLastReading = null;
|
|
50
|
-
/** A step found the week unreadable since the last reading, so it waits for a wake that a changed verdict alone may not bring. */
|
|
51
|
-
let unreadSinceLastReading = false;
|
|
52
|
-
return {
|
|
53
|
-
holdsAgents: () => pipe(state(Date.now() / 1000), Effect.map((s) => (s === null || !s.holds || s.reading === null ? null : {
|
|
54
|
-
why: spendingWait({ usedPercent: s.reading.usedPercent, limitPercent: s.limitPercent }),
|
|
55
|
-
unavailable: `the week's use is ${percentCut(s.reading.usedPercent)}, at or past the spending limit of ${s.limitPercent}%`,
|
|
56
|
-
})), Effect.catchTag('StorageError', (e) => Effect.sync(() => {
|
|
57
|
-
unreadSinceLastReading = true;
|
|
58
|
-
return { why: `waits: the week's use could not be read (${e.reason}), so the spending limit holds every agent step`, unavailable: null };
|
|
59
|
-
}))),
|
|
60
|
-
state,
|
|
61
|
-
readingTaken: () => Effect.gen(function* () {
|
|
62
|
-
const judged = yield* Effect.result(state(Date.now() / 1000));
|
|
63
|
-
if (Result.isFailure(judged))
|
|
64
|
-
return yield* Effect.logError(`[spending limit] a reading was taken and could not be judged: ${judged.failure.reason}`);
|
|
65
|
-
const holds = judged.success !== null && judged.success.holds;
|
|
66
|
-
if (holds === heldAtLastReading && !unreadSinceLastReading)
|
|
67
|
-
return;
|
|
68
|
-
if (holds !== heldAtLastReading && judged.success !== null) {
|
|
69
|
-
yield* Effect.log(`[spending limit] ${holds ? 'holds every agent step' : 'holds nothing'}: the week's use is ${judged.success.reading === null ? 'not read yet' : percentCut(judged.success.reading.usedPercent)}, the limit ${judged.success.limitPercent}%`);
|
|
70
|
-
}
|
|
71
|
-
heldAtLastReading = holds;
|
|
72
|
-
unreadSinceLastReading = false;
|
|
73
|
-
// It changes whether any run can take work (`steps.ts` `whyNoRunCanTakeWork`): the run planner plans again too.
|
|
74
|
-
deps.wakes.runPlanChanged({ workflow: null, source: holds ? 'a reading at or past the spending limit' : 'a reading below the spending limit' });
|
|
75
|
-
}),
|
|
76
|
-
set: (r) => Effect.gen(function* () {
|
|
77
|
-
const weekPercent = r.weekPercent;
|
|
78
|
-
if (typeof weekPercent !== 'number' || !Number.isInteger(weekPercent) || weekPercent < 0 || weekPercent > 100) {
|
|
79
|
-
return { ok: false, error: 'weekPercent must be a whole number from 0 to 100' };
|
|
80
|
-
}
|
|
81
|
-
yield* r.write({ sql: SET_SPENDING_LIMIT_SQL, params: [weekPercent, Date.now() / 1000] });
|
|
82
|
-
deps.wakes.runPlanChanged({ workflow: null, source: 'the spending limit set' });
|
|
83
|
-
yield* Effect.log(`[spending limit] ${weekPercent}%, from ${r.from}`);
|
|
84
|
-
return { ok: true, weekPercent };
|
|
85
|
-
}),
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
//# sourceMappingURL=spending-limit.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spending-limit.js","sourceRoot":"","sources":["../../../src/spending-limit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAG9C,OAAO,EAAE,sBAAsB,EAA6C,MAAM,mBAAmB,CAAC;AAEtG,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,sEAAsE;AACtE,MAAM,CAAC,MAAM,8BAA8B,GAAG,EAAE,CAAC;AAkBjD,oEAAoE;AACpE,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAkE,EAAU,EAAE,CACzG,4BAA4B,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,sCAAsC,CAAC,CAAC,YAAY,GAAG,CAAC;AAE/G,mFAAmF;AACnF,MAAM,mBAAmB,GAAG,wBAAwB,CAAC;AAErD,yGAAyG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