@astrosheep/square 0.3.44 → 0.3.46

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "square",
3
- "version": "0.3.44",
3
+ "version": "0.3.46",
4
4
  "description": "Native Claude Code turn-boundary delivery for Square participants",
5
5
  "author": {
6
6
  "name": "Square"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "square",
3
- "version": "0.3.44",
3
+ "version": "0.3.46",
4
4
  "description": "Shared Square activity with reliable participant attention at Codex boundaries.",
5
5
  "author": {
6
6
  "name": "Square"
@@ -1,4 +1,5 @@
1
- import { type BuildOptions, type HardCap, type SquareState, type SquareRuntimeState } from './model.js';
1
+ import { type SquareState } from './model.js';
2
+ export { createSquareState, emptyRuntimeState } from './square-state.js';
2
3
  export interface DoctorProblem {
3
4
  kind: string;
4
5
  message: string;
@@ -8,12 +9,32 @@ export interface DiagnoseResult {
8
9
  problems: DoctorProblem[];
9
10
  state?: SquareState;
10
11
  }
11
- export declare function emptyRuntimeState(nextActIndex?: number): SquareRuntimeState;
12
- export declare function createSquareState(options: BuildOptions & {
13
- hardCap: HardCap;
14
- }, snippet: string): SquareState;
15
- export declare function encodeSquare(squareState: SquareState): Buffer;
16
- export declare function decodeSquare(bytes: Buffer): SquareState;
12
+ export interface SquareSnapshot {
13
+ readonly state: SquareState;
14
+ readonly revision: number;
15
+ }
16
+ /** Creates a new SQLite artifact only when its pathname did not already exist. */
17
+ export declare function createSquareFile(squarePath: string, state: SquareState): Promise<boolean>;
18
+ /**
19
+ * Reads a complete validated snapshot, yielding between transient SQLite lock
20
+ * conflicts. The URI remains create-disabled throughout the retry loop.
21
+ */
22
+ export declare function readSquareSnapshot(squarePath: string, signal?: AbortSignal): Promise<SquareSnapshot>;
23
+ export type SquareTransition<R> = (state: SquareState, revision: number) => {
24
+ state?: SquareState;
25
+ result: R;
26
+ };
27
+ /**
28
+ * Executes one synchronous SquareState transition under SQLite's write lock.
29
+ * A busy COMMIT retries on this same transaction, so fn is never replayed.
30
+ */
31
+ export declare function transactSquareSnapshot<R>(squarePath: string, fn: SquareTransition<R>, signal?: AbortSignal, forceCommit?: boolean): Promise<{
32
+ result: R;
33
+ revision: number;
34
+ changed: boolean;
35
+ }>;
36
+ /** Replaces an existing validated snapshot in place and always advances its revision. */
37
+ export declare function replaceSquareSnapshot(squarePath: string, state: SquareState): Promise<SquareSnapshot>;
17
38
  export declare function writeSquareFile(squarePath: string, squareState: SquareState): Promise<void>;
18
39
  export declare function loadSquare(squarePath: string): Promise<SquareState>;
19
40
  export declare function probeSquare(squarePath: string): Promise<SquareState | undefined>;