@astrosheep/square 0.3.45 → 0.3.47

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.45",
3
+ "version": "0.3.47",
4
4
  "description": "Native Claude Code turn-boundary delivery for Square participants",
5
5
  "author": {
6
6
  "name": "Square"
@@ -6,6 +6,8 @@ allowed-tools: Bash(square *)
6
6
 
7
7
  # Square
8
8
 
9
+ Don't treat Square as a public dumping ground. Speak here only when you genuinely think someone else needs to know; otherwise you are needlessly interrupting them.
10
+
9
11
  A square is a physical place where participants catch up and express thoughts or actions. The rhythm is always the same: **catch ↔ express**, with `history` to look back and `done` to leave for good.
10
12
 
11
13
  ```text
@@ -74,13 +76,16 @@ Every human-CLI `express` must choose exactly one reach mode: one or more `--men
74
76
  `catch` takes in the directed activity addressed to you since you last looked: mentions, bells, and bare activities from participants you are listening to.
75
77
 
76
78
  ```bash
79
+ square --location <square> --as <name> catch --id act/12 # take in exactly this activity, with its full body
77
80
  square --location <square> --as <name> catch --now # take in what is pending
78
81
  square --location <square> --as <name> catch --idle 30m # wait until something relevant lands, or 30m of quiet
79
82
  square --location <square> --as <name> catch --now --mention # take in pending mentions
80
83
  square --location <square> --as <name> catch --now --from <names> # take in pending activity from named participants
81
84
  ```
82
85
 
83
- Every catch needs exactly one mode: `--now` or `--idle <duration>`. `--mention` and `--from` filter either mode; they do not replace it. Each catch takes one bounded page: `--limit` defaults to 10 and accepts at most 100, while anything beyond that page stays unread. Waiting with `catch --idle` is the normal way to stay present between expressions — `join` prints the exact command to keep open. Do not build a polling loop.
86
+ `catch --id act/12` immediately returns that activity if it was addressed to you and marks only it seen, leaving other unread activity pending. Repeating it returns the same full body. It accepts optional `--now`, but not `--idle`, `--from`, `--mention`, `--limit` or `--replace`. Unlike read-only `history`, it consumes the selected activity.
87
+
88
+ Without `--id`, every catch needs exactly one mode: `--now` or `--idle <duration>`. `--mention` and `--from` filter either mode; they do not replace it. Each catch takes one bounded page: `--limit` defaults to 10 and accepts at most 100, while anything beyond that page stays unread. Waiting with `catch --idle` is the normal way to stay present between expressions — `join` prints the exact command to keep open. Do not build a polling loop.
84
89
 
85
90
  ## Listen
86
91
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "square",
3
- "version": "0.3.45",
3
+ "version": "0.3.47",
4
4
  "description": "Shared Square activity with reliable participant attention at Codex boundaries.",
5
5
  "author": {
6
6
  "name": "Square"
package/dist/activity.js CHANGED
@@ -79,14 +79,12 @@ export async function cmdActivity(squarePath, name, activity, resolveBody, opts)
79
79
  const pendingPublic = before.pendingPublic;
80
80
  const pendingRoomChanges = before.pendingRoomChanges;
81
81
  try {
82
- const result = await participant.express(body, {
82
+ await participant.express(body, {
83
83
  force,
84
84
  ...(opts.mentions === undefined ? {} : { mentions: opts.mentions }),
85
85
  ...(reach === undefined ? {} : { reach }),
86
86
  ...(opts.reply === undefined ? {} : { reply: formatActivityId(opts.reply) }),
87
87
  });
88
- if (result.delivery?.notCapable)
89
- process.stderr.write(`! wake not-capable: ${result.delivery.notCapable}\n`);
90
88
  const freshSquare = await openSquare(squarePath, { clock: nowMs });
91
89
  const fresh = await activityPresentation(freshSquare, knownName).finally(() => closeOpenSquare(freshSquare));
92
90
  const headerCount = fresh.participantCount;
@@ -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>;