@bastani/atomic 0.9.44 → 0.9.45
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/CHANGELOG.md +34 -0
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/builtin/workflows/CHANGELOG.md +17 -0
- package/dist/builtin/workflows/package.json +1 -1
- package/dist/builtin/workflows/src/durable/journal/internal.d.ts +6 -37
- package/dist/builtin/workflows/src/durable/journal/resolution.d.ts +2 -0
- package/dist/builtin/workflows/src/durable/journal/sql-run-journal.d.ts +5 -4
- package/dist/builtin/workflows/src/durable/journal/types.d.ts +1 -1
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +40393 -40289
- package/dist/builtin/workflows/src/extension/local-worker-entry.mjs +55675 -55570
- package/dist/builtin/workflows/src/index.js +126 -22
- package/dist/builtin/workflows/src/local-worker-entry.mjs +55675 -55570
- package/dist/core/settings-schema.d.ts.map +1 -1
- package/dist/core/settings-schema.js +1 -1
- package/dist/core/settings-schema.js.map +1 -1
- package/dist/core/storage/provider.d.ts +6 -3
- package/dist/core/storage/provider.d.ts.map +1 -1
- package/dist/core/storage/provider.js +7 -5
- package/dist/core/storage/provider.js.map +1 -1
- package/dist/core/storage/run-journal.d.ts +34 -0
- package/dist/core/storage/run-journal.d.ts.map +1 -1
- package/dist/core/storage/run-journal.js.map +1 -1
- package/docs/settings.md +1 -1
- package/docs/storage.md +3 -1
- package/docs/workflows/api-reference.md +8 -1
- package/docs/workflows/operations.md +1 -1
- package/npm-shrinkwrap.json +32 -32
- package/package.json +3 -3
- package/schemas/settings.schema.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,40 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.9.45] - 2026-10-25
|
|
6
|
+
|
|
7
|
+
Custom storage adapters now plug into workflow journals as first-class citizens, and large local worker pools start reliably on busy machines.
|
|
8
|
+
|
|
9
|
+
- **Journal adapters that build on Atomic's own journal:** a storage adapter loaded by path can import `@bastani/atomic/workflows` and get the running Atomic's module, so `SqlRunJournal` subclasses and journal errors such as `StaleLeaseError` work instead of failing with `Storage unavailable` ([#3963](https://github.com/bastani-inc/atomic/issues/3963), [#3969](https://github.com/bastani-inc/atomic/pull/3969))
|
|
10
|
+
- **Fast status, resume and receipts for custom journals:** a run journal that implements the optional `changeToken()`, `runVersions()`, `snapshotTail()` and `appendMany()` members gets the same faster `/workflow status`, resume and batched delivery receipts as the built-in SQL journal ([#3964](https://github.com/bastani-inc/atomic/issues/3964), [#3968](https://github.com/bastani-inc/atomic/pull/3968))
|
|
11
|
+
- **Worker pools that start on small or busy machines:** without an explicit `workflows.localWorkers.startupTimeoutMs`, the startup deadline scales with pool size and machine load instead of failing after 30 s ([#3962](https://github.com/bastani-inc/atomic/issues/3962), [#3965](https://github.com/bastani-inc/atomic/pull/3965))
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- `StorageProvider` journal factories accept `hostModules`, and `loadStorageAdapter()` takes an optional third `hostModules` argument, to give adapter modules extra live host modules by specifier ([#3963](https://github.com/bastani-inc/atomic/issues/3963))
|
|
16
|
+
- The `RunJournal` interface in `@bastani/atomic/storage` has optional `changeToken()`, `runVersions()`, `snapshotTail()` and `appendMany()` members, with the `RunVersion`, `RunSnapshotTail` and `RunJournalBatchAppend` types. A run journal from a storage adapter, or any custom `RunJournal`, that implements them gets the same faster `/workflow status`, resume and batched delivery receipts as the built-in SQL journal, and `registerRunJournalConformance` checks them when present ([#3964](https://github.com/bastani-inc/atomic/issues/3964))
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- A journal adapter loaded by path (`ATOMIC_WORKFLOWS_JOURNAL`, `workflows.journal`, or a run's `journal: { adapter }`) can now import `@bastani/atomic/workflows`. It gets the workflows module of the running Atomic that opened the journal, so an `openRunJournal` hook can build on `SqlRunJournal` and its errors, such as `StaleLeaseError`, pass Atomic's `instanceof` checks. Before, the import resolved to a path inside `dist/index.js` and the journal failed with `Storage unavailable` ([#3963](https://github.com/bastani-inc/atomic/issues/3963))
|
|
21
|
+
|
|
22
|
+
## [0.9.45-alpha.1] - 2026-10-25
|
|
23
|
+
|
|
24
|
+
Custom storage adapters now plug into workflow journals as first-class citizens, and large local worker pools start reliably on busy machines.
|
|
25
|
+
|
|
26
|
+
- **Journal adapters that build on Atomic's own journal:** a storage adapter loaded by path can import `@bastani/atomic/workflows` and get the running Atomic's module, so `SqlRunJournal` subclasses and journal errors such as `StaleLeaseError` work instead of failing with `Storage unavailable` ([#3963](https://github.com/bastani-inc/atomic/issues/3963), [#3969](https://github.com/bastani-inc/atomic/pull/3969))
|
|
27
|
+
- **Fast status, resume and receipts for custom journals:** a run journal that implements the optional `changeToken()`, `runVersions()`, `snapshotTail()` and `appendMany()` members gets the same faster `/workflow status`, resume and batched delivery receipts as the built-in SQL journal ([#3964](https://github.com/bastani-inc/atomic/issues/3964), [#3968](https://github.com/bastani-inc/atomic/pull/3968))
|
|
28
|
+
- **Worker pools that start on small or busy machines:** without an explicit `workflows.localWorkers.startupTimeoutMs`, the startup deadline scales with pool size and machine load instead of failing after 30 s ([#3962](https://github.com/bastani-inc/atomic/issues/3962), [#3965](https://github.com/bastani-inc/atomic/pull/3965))
|
|
29
|
+
|
|
30
|
+
### Added
|
|
31
|
+
|
|
32
|
+
- `StorageProvider` journal factories accept `hostModules`, and `loadStorageAdapter()` takes an optional third `hostModules` argument, to give adapter modules extra live host modules by specifier ([#3963](https://github.com/bastani-inc/atomic/issues/3963))
|
|
33
|
+
- The `RunJournal` interface in `@bastani/atomic/storage` has optional `changeToken()`, `runVersions()`, `snapshotTail()` and `appendMany()` members, with the `RunVersion`, `RunSnapshotTail` and `RunJournalBatchAppend` types. A storage adapter's run journal that implements them gets the same faster `/workflow status`, resume and batched delivery receipts as the built-in SQL journal ([#3964](https://github.com/bastani-inc/atomic/issues/3964))
|
|
34
|
+
|
|
35
|
+
### Fixed
|
|
36
|
+
|
|
37
|
+
- A storage adapter loaded by path to open a workflow journal can now import `@bastani/atomic/workflows`. It gets the running Atomic's workflows module, so an `openRunJournal` hook can build on `SqlRunJournal` and its errors, such as `StaleLeaseError`, pass Atomic's `instanceof` checks. Before, the import resolved to a path inside `dist/index.js` and the journal failed with `Storage unavailable` ([#3963](https://github.com/bastani-inc/atomic/issues/3963))
|
|
38
|
+
|
|
5
39
|
## [0.9.44] - 2026-10-25
|
|
6
40
|
|
|
7
41
|
Large agent swarms and pooled workflow fan-outs now run for hours without freezing the TUI, dropping messages or slowing down, and recover cleanly from a crash.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/intercom",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.45",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Atomic extension providing a private coordination channel between parent and child agent sessions. Fork of: https://github.com/nicobailon/pi-intercom",
|
|
6
6
|
"contributors": [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/web-access",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.45",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Atomic extension for web search, URL fetching, GitHub repo cloning, PDF/video extraction. Fork of: https://github.com/nicobailon/pi-web-access",
|
|
6
6
|
"contributors": [
|
|
@@ -6,6 +6,23 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.9.45] - 2026-10-25
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- A large local worker pool no longer fails at startup with `Local worker startup timed out after 30000 ms` on a small or busy machine. When `localWorkers.startupTimeoutMs` is not set, the readiness deadline now scales with the number of workers and the 1-minute load average per CPU core, from 30000 ms up to 600000 ms; on an idle machine with spare cores it stays 30000 ms. If workers still miss the deadline, the error now says they were too slow to start and names `workflows.localWorkers.startupTimeoutMs` ([#3962](https://github.com/bastani-inc/atomic/issues/3962))
|
|
14
|
+
|
|
15
|
+
## [0.9.45-alpha.1] - 2026-10-25
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- A run journal from a storage adapter, or any custom `RunJournal`, can now opt into the faster `/workflow status`, resume and batched delivery receipts that the built-in SQL journal uses, by implementing the optional `changeToken()`, `runVersions()`, `snapshotTail()` and `appendMany()` members. `registerRunJournalConformance` checks them when present ([#3964](https://github.com/bastani-inc/atomic/issues/3964))
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- Journal adapters loaded by path (`ATOMIC_WORKFLOWS_JOURNAL`, `workflows.journal`, or a run's `journal: { adapter }`) can import `@bastani/atomic/workflows` and receive the workflows module that opened the journal, including its `SqlRunJournal` and journal error classes ([#3963](https://github.com/bastani-inc/atomic/issues/3963))
|
|
24
|
+
- A large local worker pool no longer fails at startup with `Local worker startup timed out after 30000 ms` on a small or busy machine. When `localWorkers.startupTimeoutMs` is not set, the readiness deadline now scales with the number of workers and the 1-minute load average per CPU core, from 30000 ms up to 600000 ms; on an idle machine with spare cores it stays 30000 ms. If workers still miss the deadline, the error now says they were too slow to start and names `workflows.localWorkers.startupTimeoutMs` ([#3962](https://github.com/bastani-inc/atomic/issues/3962))
|
|
25
|
+
|
|
9
26
|
## [0.9.44] - 2026-10-25
|
|
10
27
|
|
|
11
28
|
### Fixed
|
|
@@ -1,50 +1,19 @@
|
|
|
1
1
|
import type { SqliteExecutor } from "@bastani/atomic/storage";
|
|
2
|
-
import { type AppendOutcome, type
|
|
2
|
+
import { type AppendOutcome, type Lease, type RunJournal, type RunJournalBatchAppend, type RunSnapshotTail, type RunVersion } from "./types.js";
|
|
3
|
+
export type { RunJournalBatchAppend as JournalBatchAppend, RunSnapshotTail, RunVersion } from "./types.js";
|
|
3
4
|
export declare const JOURNAL_READ_PAGE_SIZE = 256;
|
|
4
5
|
/** Event types the durable backend folds without replacing the run's handle; every other event carries it. */
|
|
5
6
|
export declare const NON_SNAPSHOT_EVENT_TYPES: readonly ["CheckpointRecorded", "MessageSettled", "MessageDelivered"];
|
|
6
|
-
/**
|
|
7
|
-
export interface RunVersion {
|
|
8
|
-
readonly seq: number;
|
|
9
|
-
readonly at: number;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* A run's latest snapshot event (one carrying the run's handle) and the checkpoints recorded after it: enough to
|
|
13
|
-
* list the run in a catalog without reading its history.
|
|
14
|
-
*/
|
|
15
|
-
export interface RunSnapshotTail {
|
|
16
|
-
/** The run's latest event of any type. */
|
|
17
|
-
readonly version: RunVersion;
|
|
18
|
-
readonly snapshot: JournalEntry;
|
|
19
|
-
readonly laterCheckpoints: number;
|
|
20
|
-
/** `completedAt` of the last of `laterCheckpoints`. */
|
|
21
|
-
readonly lastCheckpointAt?: number;
|
|
22
|
-
}
|
|
23
|
-
/** Lets a durable backend re-read only the runs that changed; kept off the public journal shape. */
|
|
7
|
+
/** Lets a durable backend re-read only the runs that changed. */
|
|
24
8
|
export interface RunJournalVersions {
|
|
25
|
-
/** Moves whenever any connection, in this process or another, commits a change to the journal's store. */
|
|
26
9
|
changeToken(): Promise<string>;
|
|
27
|
-
/** Every listed run with its latest event; a run with no events has version `{ seq: 0, at: 0 }`. */
|
|
28
10
|
runVersions(): Promise<ReadonlyMap<string, RunVersion>>;
|
|
29
|
-
/** Undefined for a run with no snapshot event. */
|
|
30
11
|
snapshotTail(runId: string): Promise<RunSnapshotTail | undefined>;
|
|
31
12
|
}
|
|
32
|
-
|
|
33
|
-
/** Change tracking for a journal that registered it; other journals are re-read in full. */
|
|
13
|
+
/** Change tracking for a journal that implements all three members; other journals are re-read in full. */
|
|
34
14
|
export declare function runJournalVersions(journal: RunJournal): RunJournalVersions | undefined;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
* not the batch's, decides the append's pool append guard.
|
|
38
|
-
*/
|
|
39
|
-
export interface JournalBatchAppend {
|
|
40
|
-
readonly event: RunEvent;
|
|
41
|
-
readonly key?: string;
|
|
42
|
-
readonly context: <R>(action: () => R) => R;
|
|
43
|
-
}
|
|
44
|
-
/** Appends to one run in one transaction; each append is settled on its own. Kept off the public journal shape. */
|
|
45
|
-
export type RunJournalAppendMany = (lease: Lease, appends: readonly JournalBatchAppend[]) => Promise<readonly PromiseSettledResult<AppendOutcome>[]>;
|
|
46
|
-
export declare function registerRunJournalAppendMany(journal: RunJournal, appendMany: RunJournalAppendMany): void;
|
|
47
|
-
/** Batched appends for a journal that registered them; other journals append one event at a time. */
|
|
15
|
+
export type RunJournalAppendMany = (lease: Lease, appends: readonly RunJournalBatchAppend[]) => Promise<readonly PromiseSettledResult<AppendOutcome>[]>;
|
|
16
|
+
/** Batched appends for a journal that implements them; other journals append one event at a time. */
|
|
48
17
|
export declare function runJournalAppendMany(journal: RunJournal): RunJournalAppendMany | undefined;
|
|
49
18
|
export type JournalAppendGuard = (tx: SqliteExecutor, runId: string) => Promise<void>;
|
|
50
19
|
export interface SqlPoolStorage {
|
|
@@ -9,6 +9,8 @@ export interface RunJournalSettings {
|
|
|
9
9
|
};
|
|
10
10
|
storage?: StorageSettingsSelection;
|
|
11
11
|
}
|
|
12
|
+
/** Sets the live modules a journal adapter imports by specifier; the workflows entry modules provide themselves. */
|
|
13
|
+
export declare function provideRunJournalHostModules(modules: Readonly<Record<string, object>>): void;
|
|
12
14
|
export interface RunJournalResolutionOptions {
|
|
13
15
|
journal?: RunJournalOption;
|
|
14
16
|
settings?: RunJournalSettings;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type SqliteDatabase, type StorageDescriptor } from "@bastani/atomic/storage";
|
|
2
|
+
import { type JournalBatchAppend, type RunSnapshotTail, type RunVersion } from "./internal.js";
|
|
2
3
|
import { type AppendOutcome, type JournalEntry, type Lease, type LeaseOutcome, type LeaseState, type RunEvent, type RunHeader, type RunJournal, type RunSummary } from "./types.js";
|
|
3
4
|
export { JOURNAL_READ_PAGE_SIZE } from "./internal.js";
|
|
4
5
|
export declare class SqlRunJournal implements RunJournal {
|
|
@@ -27,13 +28,13 @@ export declare class SqlRunJournal implements RunJournal {
|
|
|
27
28
|
* `data_version` moves when another connection commits and `total_changes()` when this one writes; the
|
|
28
29
|
* table aggregates also catch run changes if the adapter does not serve every statement from one connection.
|
|
29
30
|
*/
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
changeToken(): Promise<string>;
|
|
32
|
+
runVersions(): Promise<ReadonlyMap<string, RunVersion>>;
|
|
32
33
|
/**
|
|
33
34
|
* The latest snapshot event is found by walking the run's `(run_id, seq)` key back from its last event, so
|
|
34
35
|
* only the events after it are visited and only its payload is read.
|
|
35
36
|
*/
|
|
36
|
-
|
|
37
|
+
snapshotTail(runId: string): Promise<RunSnapshotTail | undefined>;
|
|
37
38
|
private requireRun;
|
|
38
39
|
/** Whether this run exists only in the legacy tables, whose events are then read in place. */
|
|
39
40
|
private isUnconvertedLegacyRun;
|
|
@@ -58,7 +59,7 @@ export declare class SqlRunJournal implements RunJournal {
|
|
|
58
59
|
* one append's guard or payload failure is reported for it alone and the rest still commit. A lease or storage
|
|
59
60
|
* failure rejects the whole batch, with nothing written.
|
|
60
61
|
*/
|
|
61
|
-
|
|
62
|
+
appendMany(lease: Lease, appends: readonly JournalBatchAppend[]): Promise<readonly PromiseSettledResult<AppendOutcome>[]>;
|
|
62
63
|
/** Validate an append outside any transaction; its payload error is raised where `append` always raised it. */
|
|
63
64
|
private prepare;
|
|
64
65
|
private insert;
|
|
@@ -37,7 +37,7 @@ export declare const JOURNAL_LEASE: {
|
|
|
37
37
|
readonly absentEpoch: 0;
|
|
38
38
|
};
|
|
39
39
|
export type JournalLeaseSemantics = typeof JOURNAL_LEASE;
|
|
40
|
-
export type { AppendOutcome, JournalEntry, Lease, LeaseOutcome, LeaseState, RunEvent, RunEventType, RunHeader, RunJournal, RunSummary, } from "@bastani/atomic/storage";
|
|
40
|
+
export type { AppendOutcome, JournalEntry, Lease, LeaseOutcome, LeaseState, RunEvent, RunEventType, RunHeader, RunJournal, RunJournalBatchAppend, RunSnapshotTail, RunSummary, RunVersion, } from "@bastani/atomic/storage";
|
|
41
41
|
export { RUN_EVENT_TYPES } from "@bastani/atomic/storage";
|
|
42
42
|
export interface JournalLeaseRow {
|
|
43
43
|
[JOURNAL_COLUMNS.holderId]: string | null;
|