@hearsay-tools/squawk 0.18.0-dev.7812 → 0.18.0-dev.7816
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ci-wait/controller.d.ts +42 -42
- package/dist/delegation/routes.d.ts +11 -11
- package/dist/delegation/transport.d.ts +69 -69
- package/dist/runs/ports.d.ts +38 -11
- package/dist/runs/run-archive.d.ts +1217 -0
- package/dist/runs/run-archive.js +332 -0
- package/dist/runs/run-archive.js.map +1 -0
- package/dist/runs/run-read-flags.d.ts +58 -0
- package/dist/runs/run-read-flags.js +87 -0
- package/dist/runs/run-read-flags.js.map +1 -0
- package/dist/runs/store.d.ts +7 -98
- package/dist/runs/store.js +37 -402
- package/dist/runs/store.js.map +1 -1
- package/dist/serve-boot.js +1 -1
- package/dist/serve-boot.js.map +1 -1
- package/dist/server/archive-on-merge.js +10 -10
- package/dist/server/archive-on-merge.js.map +1 -1
- package/dist/server/completion-actions.js +6 -6
- package/dist/server/completion-actions.js.map +1 -1
- package/dist/server/models-routes.d.ts +13 -13
- package/dist/server/project-context.js +2 -2
- package/dist/server/project-context.js.map +1 -1
- package/dist/server/provider-sign-in-routes.d.ts +2 -2
- package/dist/server/reports-api.d.ts +2 -2
- package/dist/server/runner-install-routes.d.ts +10 -10
- package/dist/server/server.d.ts +3733 -3733
- package/dist/server/server.js +6 -6
- package/dist/server/server.js.map +1 -1
- package/dist/server/workspace-live-routes.d.ts +6 -6
- package/dist/workflows/run/continuation-acceptance.js +1 -1
- package/dist/workflows/run/continuation-acceptance.js.map +1 -1
- package/package.json +4 -4
package/dist/runs/store.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { WorkerExecutionRecords, WorkerExecutions } from './ports.ts';
|
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
import { queuedMessageSchema } from '../contract/index.js';
|
|
7
7
|
import { type WaitRegistrationReceipt } from '../contract/index.js';
|
|
8
|
-
import type {
|
|
8
|
+
import type { ArchivedRunsResponse, ConversationState, AgentInput, InboxClaim, DelegationState, RunSummary, Wait, WorkerDestroyRetry } from '../contract/index.js';
|
|
9
9
|
import { type AutomationNames } from '../contract/index.js';
|
|
10
10
|
import { RunTranscriptFacts } from './transcript-facts-topic.ts';
|
|
11
11
|
import { workflowDefSchema } from '../workflows/types.ts';
|
|
@@ -23,6 +23,8 @@ import { type SpawnCapacityRefusal } from './owned-run-create.ts';
|
|
|
23
23
|
import { WorkerResultsTopic } from './worker-results.ts';
|
|
24
24
|
import { RunEventLogTopic } from './event-log.ts';
|
|
25
25
|
import { RunRedaction } from './run-redaction.ts';
|
|
26
|
+
import { RunArchiveTopic } from './run-archive.ts';
|
|
27
|
+
import { RunReadFlagsTopic } from './run-read-flags.ts';
|
|
26
28
|
/** Per-store persistence adapter; the second argument is the normal fenced transaction. */
|
|
27
29
|
export type RunStorePersistence = (changes: RunDatabaseChanges, transaction: RunDatabase['transaction']) => RunDatabaseCommit;
|
|
28
30
|
export type RunStatus = 'queued' | 'running' | 'waiting' | 'review' | 'done' | 'failed' | 'cancelled';
|
|
@@ -3302,8 +3304,10 @@ export declare class RunStore {
|
|
|
3302
3304
|
/** Rows whose `data` this store tried to decode and could not: left in the database untouched,
|
|
3303
3305
|
* and left out of the list rows from then on, as the cold reader leaves them out (run-index.ts). */
|
|
3304
3306
|
private readonly unreadable;
|
|
3305
|
-
/**
|
|
3306
|
-
|
|
3307
|
+
/** The archive flag, archive on merge, completion actions and the transcript compressor (hearsay-tools/squawk#4041). */
|
|
3308
|
+
readonly archive: RunArchiveTopic;
|
|
3309
|
+
/** The pinned and read flags (hearsay-tools/squawk#4041). */
|
|
3310
|
+
readonly readFlags: RunReadFlagsTopic;
|
|
3307
3311
|
/** What the transcript says about a run (hearsay-tools/squawk#4036). */
|
|
3308
3312
|
readonly transcriptFacts: RunTranscriptFacts;
|
|
3309
3313
|
/** Whether a run may go, and its deletion; the count-based archive (hearsay-tools/squawk#4037). */
|
|
@@ -3762,18 +3766,6 @@ export declare class RunStore {
|
|
|
3762
3766
|
* remains best-effort.
|
|
3763
3767
|
*/
|
|
3764
3768
|
private commitIndex;
|
|
3765
|
-
private completionArchiveBlocker;
|
|
3766
|
-
/** One archive write for manual actions, merge observations, completion, and sweeps.
|
|
3767
|
-
* Archiving files history away; it never stops a process or removes a worktree. */
|
|
3768
|
-
private stageArchive;
|
|
3769
|
-
/** A bounded persisted queue also covers projects without a live RunManager. */
|
|
3770
|
-
listCompletionCandidates(afterSeq?: number, limit?: number): Array<{
|
|
3771
|
-
id: string;
|
|
3772
|
-
seq: number;
|
|
3773
|
-
}>;
|
|
3774
|
-
canCompleteAction(id: string, token: string): boolean;
|
|
3775
|
-
claimCompletionAction(id: string, token: string): boolean;
|
|
3776
|
-
completeAction(id: string, token: string, phase: 'blocked' | 'complete', message?: string): boolean;
|
|
3777
3769
|
/**
|
|
3778
3770
|
* Refuse (throwing, with nothing changed) a commit that stages a quarantined run, or a run whose
|
|
3779
3771
|
* family this store does not claim and cannot take: another process owns it, or a dead process
|
|
@@ -3802,83 +3794,8 @@ export declare class RunStore {
|
|
|
3802
3794
|
/** Append a step to an existing run (used by "Continue" — spec 003). */
|
|
3803
3795
|
addStep(runId: string, step: Pick<StepState, 'id' | 'name' | 'kind' | 'synthetic' | 'continuesStepId'>): void;
|
|
3804
3796
|
updateStep(runId: string, stepId: string, patch: Partial<Omit<StepState, 'id'>>): void;
|
|
3805
|
-
listArchiveOnMergeCandidates(afterSeq?: number, limit?: number): Array<{
|
|
3806
|
-
id: string;
|
|
3807
|
-
seq: number;
|
|
3808
|
-
}>;
|
|
3809
|
-
/** Use unnormalized persisted evidence: cold reads must not turn interrupted work into safety. */
|
|
3810
|
-
private archiveFamily;
|
|
3811
|
-
/** Blockers are feedback, never archive authority or cleanup permission. */
|
|
3812
|
-
setArchiveBlocker(id: string, blocker: RunRecord['archiveBlocker']): void;
|
|
3813
|
-
archiveMergeBlocker(snapshot: ArchiveOnMergeSnapshot, missing: ArchivePullRequestIdentity, repoBase?: string): void;
|
|
3814
|
-
hasArchiveOnMergeAssociations(id: string): boolean;
|
|
3815
|
-
prepareArchiveOnMerge(id: string): Promise<void>;
|
|
3816
|
-
archiveOnMergeSnapshot(id: string, repoBase?: string, isActive?: (id: string) => boolean): ArchiveOnMergeSnapshot | undefined;
|
|
3817
|
-
private archiveSnapshot;
|
|
3818
|
-
/** No await between final revalidation and the fenced, all-or-nothing cascade. */
|
|
3819
|
-
archiveAfterMerge(snapshot: ArchiveOnMergeSnapshot, observations: readonly MergedPullRequest[], repoBase?: string, isActive?: (id: string) => boolean): boolean;
|
|
3820
|
-
setArchived(id: string, archived: boolean): RunRecord | undefined;
|
|
3821
|
-
/** Parent + owned workers; returns how many records flipped `archived`. */
|
|
3822
|
-
private applyArchivedCascade;
|
|
3823
|
-
private applyArchived;
|
|
3824
|
-
/** Transcript form follows `archived`: enqueue compression, or restore the plain file now. */
|
|
3825
|
-
private syncTranscriptForm;
|
|
3826
|
-
/**
|
|
3827
|
-
* Whether this store may compress `id`'s transcript: the run exists, is archived, is not in a
|
|
3828
|
-
* live status (queued/running/waiting), and this process holds the family's claim in `claimed`
|
|
3829
|
-
* (not merely `pendingClaims`). Two processes never both write a run (#779, #818 B1).
|
|
3830
|
-
*/
|
|
3831
|
-
private isHistoryCompressEligible;
|
|
3832
|
-
/** Take the family claim if free and require it to be in `this.claimed`, not only pending. */
|
|
3833
|
-
private holdsCompressClaim;
|
|
3834
|
-
/** Startup sweep: enqueue every archived non-live run that still has a plain transcript. */
|
|
3835
|
-
compressArchivedHistory(): void;
|
|
3836
|
-
/** Resolves when the transcript compressor is idle (tests, shutdown). */
|
|
3837
|
-
historyIdle(): Promise<void>;
|
|
3838
|
-
/** Pin one run to the top of this project's task list, or unpin it (#935). Mirrors
|
|
3839
|
-
* `setArchived`: sets the fields, then persists + broadcasts via `touch`, so the updated
|
|
3840
|
-
* record rides the existing `run` SSE with no new event. Idempotent — re-pinning a pinned
|
|
3841
|
-
* run just re-stamps `pinnedAt`.
|
|
3842
|
-
*
|
|
3843
|
-
* Every active status is pinnable. Archived requests clear stale metadata instead, so a
|
|
3844
|
-
* late click racing archive cannot leave a hidden pin that reappears on unarchive. */
|
|
3845
|
-
setPinned(id: string, pinned: boolean): RunRecord | undefined;
|
|
3846
|
-
/** Bulk-archive finished runs (#780). `isSweepable` decides which; `archived` counts every
|
|
3847
|
-
* record that flipped (cascaded workers included), `ids` lists the top-level runs picked and
|
|
3848
|
-
* `pinnedIds` the subset that carried a pin before `clearPin` dropped it. */
|
|
3849
|
-
archiveFinished(scope?: ArchiveFinishedScope, automation?: boolean): {
|
|
3850
|
-
archived: number;
|
|
3851
|
-
ids: string[];
|
|
3852
|
-
pinnedIds: string[];
|
|
3853
|
-
};
|
|
3854
|
-
/** Mark one run as read (#unread-done-items): stamp the read receipt now. Mirrors
|
|
3855
|
-
* `setArchived` — sets the field then persists + broadcasts via `touch`, so the
|
|
3856
|
-
* updated record rides the existing `run` SSE with no new event. Idempotent by
|
|
3857
|
-
* design: opening an already-read thread just re-stamps a later `seenAt`. */
|
|
3858
|
-
setRead(id: string): RunRecord | undefined;
|
|
3859
|
-
/** Mark one run as UNread (#775): drop the read receipt so the run rejoins the unread
|
|
3860
|
-
* list. The inverse of `setRead` and, like it, `touch`es so the updated record rides the
|
|
3861
|
-
* existing `run` SSE.
|
|
3862
|
-
*
|
|
3863
|
-
* Deleting the field rather than adding a "manually unread" flag is the whole point:
|
|
3864
|
-
* absent `seenAt` is ALREADY what every reader treats as unread (`isUnread` in the
|
|
3865
|
-
* cockpit's read-state.ts, and `markAllRead`'s clause-for-clause copy of it below), so
|
|
3866
|
-
* clearing needs no new state and writes a shape any older Squawk already parses.
|
|
3867
|
-
*
|
|
3868
|
-
* Deliberately unconditional: clearing a receipt is always a legal write, so this
|
|
3869
|
-
* succeeds for an already-unread run (idempotent) and for statuses that can never wear
|
|
3870
|
-
* the marker. WHETHER the action means anything for a given run is UI policy, and lives
|
|
3871
|
-
* in the cockpit's `runActionFlags` — the same split the rest of the store keeps. */
|
|
3872
|
-
setUnread(id: string): RunRecord | undefined;
|
|
3873
3797
|
/** A debounced write of the held record `id`: `apply` changes it in place, then `touch` saves it. */
|
|
3874
3798
|
private change;
|
|
3875
|
-
/**
|
|
3876
|
-
* Stamp unread finished runs in bulk and return the count. Keep the rule aligned with cockpit
|
|
3877
|
-
* isUnread: done/failed, finished since seen, not archived; cancelled and usage-limit waiting
|
|
3878
|
-
* runs are excluded. `automation` narrows it to one origin, as in `archiveFinished`
|
|
3879
|
-
* (hearsay-tools/cezarion#1616); absent stamps both.
|
|
3880
|
-
*/
|
|
3881
|
-
markAllRead(automation?: boolean): number;
|
|
3882
3799
|
/** Indexed family enumeration, including members not yet flushed to SQLite. */
|
|
3883
3800
|
listFamilyRunIds(rootId: string): string[];
|
|
3884
3801
|
/** Write the pending rows out now (used on shutdown). */
|
|
@@ -3891,8 +3808,6 @@ export declare class RunStore {
|
|
|
3891
3808
|
private imagesDir;
|
|
3892
3809
|
/** Save `run` debounced and publish it; `before` is the record at the write's entry (none: created). */
|
|
3893
3810
|
private touch;
|
|
3894
|
-
/** Form follows archived: a terminal archived run with a plain transcript is queued again. */
|
|
3895
|
-
private maybeEnqueueHistoryCompress;
|
|
3896
3811
|
/** The held record is gone; the next save or commit deletes its row, fenced by `family`'s claim
|
|
3897
3812
|
* and by the revision this store last saw (kept in `base` until the delete is written). */
|
|
3898
3813
|
private markDeleted;
|
|
@@ -3930,9 +3845,3 @@ export declare class RunStore {
|
|
|
3930
3845
|
*/
|
|
3931
3846
|
close(): void;
|
|
3932
3847
|
}
|
|
3933
|
-
export interface ArchiveOnMergeSnapshot {
|
|
3934
|
-
rootId: string;
|
|
3935
|
-
fingerprint: string;
|
|
3936
|
-
pullRequests: ArchivePullRequestIdentity[];
|
|
3937
|
-
token: string;
|
|
3938
|
-
}
|