@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.
- package/claude-plugin/.claude-plugin/plugin.json +1 -1
- package/claude-plugin/skills/square/SKILL.md +6 -1
- package/codex-plugin/.codex-plugin/plugin.json +1 -1
- package/dist/activity.js +1 -3
- package/dist/artifact.d.ts +28 -7
- package/dist/artifact.js +294 -253
- package/dist/catch-decisions.d.ts +2 -6
- package/dist/catch-decisions.js +27 -12
- package/dist/cli/observation-commands.js +19 -3
- package/dist/cli/square-commands.js +2 -0
- package/dist/delivery.js +8 -18
- package/dist/help.js +3 -3
- package/dist/host-ledger-file-adapter.js +14 -1
- package/dist/model.d.ts +2 -1
- package/dist/participant-host.d.ts +19 -0
- package/dist/participant-host.js +78 -0
- package/dist/perception-projection.d.ts +15 -0
- package/dist/perception-projection.js +28 -0
- package/dist/ports.d.ts +1 -4
- package/dist/presence.d.ts +0 -4
- package/dist/presence.js +0 -13
- package/dist/routes.js +2 -1
- package/dist/square-actions.d.ts +4 -8
- package/dist/square-actions.js +3 -83
- package/dist/square-facade.d.ts +1 -0
- package/dist/square-file-adapter.js +9 -8
- package/dist/square-state.d.ts +6 -0
- package/dist/square-state.js +141 -0
- package/dist/square-storage.d.ts +7 -10
- package/dist/square-storage.js +83 -114
- package/dist/state-cell.d.ts +1 -4
- package/dist/watch.js +1 -0
- package/extensions/square-pi.js +27 -6
- package/guides/participant-ownership.md +3 -3
- package/package.json +2 -2
- package/skills/square/SKILL.md +6 -1
- package/dist/landing.d.ts +0 -26
- package/dist/landing.js +0 -42
|
@@ -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
|
-
|
|
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
|
|
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
|
-
|
|
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;
|
package/dist/artifact.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type
|
|
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
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export declare function
|
|
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>;
|