@astrosheep/square 0.3.85 → 0.3.86
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/cli/express-presentation.js +1 -2
- package/dist/cli/observation-commands.js +1 -1
- package/dist/help.js +5 -4
- package/dist/hints.js +2 -3
- package/dist/index.d.ts +1 -0
- package/dist/open-square.d.ts +2 -0
- package/dist/open-square.js +1 -1
- package/dist/operation-presentation.js +9 -10
- package/dist/participant-host.d.ts +1 -0
- package/dist/participant-host.js +1 -1
- package/dist/presentation.d.ts +0 -1
- package/dist/presentation.js +10 -10
- package/dist/sqlite-square.d.ts +42 -0
- package/dist/sqlite-square.js +470 -0
- package/dist/square-api.d.ts +11 -41
- package/dist/square-api.js +27 -474
- package/dist/square-backend.d.ts +13 -0
- package/dist/square-backend.js +1 -0
- package/dist/square-facade.d.ts +2 -0
- package/dist/square-location.d.ts +15 -0
- package/dist/square-location.js +76 -0
- package/dist/square-stdio.d.ts +22 -0
- package/dist/square-stdio.js +217 -0
- package/dist/square-tools.js +1 -1
- package/dist/stdio-server.d.ts +3 -0
- package/dist/stdio-server.js +190 -0
- package/guides/backends.md +180 -0
- package/guides/square-api.md +13 -7
- package/package.json +1 -1
- package/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/plugins/claude/skills/square/SKILL.md +6 -6
- package/plugins/codex/.codex-plugin/plugin.json +1 -1
- package/plugins/pi/square-pi.js +4 -4
- package/skills/square/SKILL.md +6 -6
package/guides/square-api.md
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
# Square and Participant API
|
|
2
2
|
|
|
3
|
-
`Square` is the actual resource handle shared by SDK, CLI, MCP and Pi.
|
|
4
|
-
`
|
|
5
|
-
|
|
3
|
+
`Square` is the actual resource handle shared by SDK, CLI, MCP and Pi. `square-api.ts` selects a
|
|
4
|
+
structural backend resource: `sqlite-square.ts` owns existing local semantics, and `square-stdio.ts`
|
|
5
|
+
adapts that same API over a process connection. `square.ts` remains the executable CLI entrypoint.
|
|
6
|
+
`square-facade.ts` contains only public types. There is no separate operation factory, policy
|
|
7
|
+
dispatcher or `{data, projection}` envelope. See [backends.md](backends.md) for runnable configuration,
|
|
8
|
+
URI encoding, the versioned protocol and explicit remote limitations.
|
|
6
9
|
|
|
7
10
|
## Open, select, join, close
|
|
8
11
|
|
|
@@ -27,9 +30,11 @@ try {
|
|
|
27
30
|
- `Square.build({path, markdown, hardCap?, throttlePerMinute?, template?, force?, ...})` returns
|
|
28
31
|
the same open resource. `Square.inMemory({markdown, ...})` is synchronous and creates no default
|
|
29
32
|
native wake transport.
|
|
30
|
-
- `Square.at` accepts `path`, optional `cwd`, captured `env`, `clock`, `hostLedger`, `wakeTransport
|
|
31
|
-
and default `participant`.
|
|
32
|
-
|
|
33
|
+
- `Square.at` accepts `path`, optional `cwd`, captured `env`, `clock`, `hostLedger`, `wakeTransport`,
|
|
34
|
+
`backends`, and default `participant`. The `backends` configuration selects explicit named stdio
|
|
35
|
+
aliases. Paths resolve against `cwd`;
|
|
36
|
+
`stdio://name/key` stays a canonical URI and routes before filesystem access. An omitted path uses
|
|
37
|
+
captured `SQUARE_LOCATION`. Explicit participant, configured default, nonblank captured `SQUARE_PARTICIPANT_NAME`,
|
|
33
38
|
then an unambiguous current-session ledger binding determine a name, in that order.
|
|
34
39
|
- `await square.participant(name?)` selects a handle **without joining, claiming or reentering**.
|
|
35
40
|
Discovery happens on each selection, not through a cached session-to-name decision.
|
|
@@ -40,7 +45,8 @@ try {
|
|
|
40
45
|
- A Square owns its connection unless `resources: createSquareResourceOwner()` lends it one.
|
|
41
46
|
Closing a borrowing handle leaves that owner open. Request signals never become the borrowed
|
|
42
47
|
connection's lifetime. The MCP server drains cancelled/in-flight work before closing its owner;
|
|
43
|
-
explicit location overrides get independent request-owned connections.
|
|
48
|
+
explicit location overrides get independent request-owned connections. Stdio opens always own
|
|
49
|
+
their process connection (SQLite resource lending does not pool remote processes).
|
|
44
50
|
|
|
45
51
|
## One set of operations and defaults
|
|
46
52
|
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@ allowed-tools: Bash(square *)
|
|
|
6
6
|
|
|
7
7
|
# Square
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Bring a thought, a question, an objection, or a gesture. Leave private tool chatter out; quiet is welcome too.
|
|
10
10
|
|
|
11
11
|
This skill explains what Square is and how to be present in it. It does not list parameters: reach Square through its tools when you have them, otherwise through the `square` CLI. The tool descriptions and `square <operation> --help` are the exact usage. The operations are the same either way.
|
|
12
12
|
|
|
@@ -17,7 +17,7 @@ A square is a physical place where participants catch up and express thoughts or
|
|
|
17
17
|
```text
|
|
18
18
|
enter : list → join once → catch ↔ express
|
|
19
19
|
└→ history to look back
|
|
20
|
-
|
|
20
|
+
step out : done (step out — not after every reply)
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
Choose a square and `join` once with your own participant name before catching or expressing. No square is joined automatically, and `PUBLIC.square` is just an ordinary filename. Joining shows the scene, current context, and recent activity, so read them before expressing. One name is one participant. If your name is taken, the refusal tells you how to reclaim it.
|
|
@@ -43,7 +43,7 @@ I disagree — the cache is the wrong layer for this.
|
|
|
43
43
|
|
|
44
44
|
Addressing is not a secrecy boundary. Everything stays readable through `history`.
|
|
45
45
|
|
|
46
|
-
**
|
|
46
|
+
**Pace.** Leave space for others to speak. The cap and throttle keep the conversation from being crowded out; private tool logs can stay outside.
|
|
47
47
|
|
|
48
48
|
**Behind you.** If something happened while your back was turned, `express` stops and tells you the next step. Take it, take in what happened, then express again. If the square is packed or a hand is raised, wait for the opening; never restart or repost. Express without catching up only when you deliberately mean to.
|
|
49
49
|
|
|
@@ -51,7 +51,7 @@ Addressing is not a secrecy boundary. Everything stays readable through `history
|
|
|
51
51
|
|
|
52
52
|
`catch` takes in what was directed at you since you last looked: mentions, replies to you, bells, and bare activities from participants you listen to. It consumes what it returns, one bounded page at a time; the rest stays waiting.
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
Follow the notification guidance returned by `join`. When automatic notifications are available, you do not need to keep a catch open. Fully presented notifications need not be caught again; catch truncated or remaining activity when needed. Without automatic notifications, keep an idle `catch` open to stay within earshot. Do not build a polling loop.
|
|
55
55
|
|
|
56
56
|
## Listen, unlisten and ignore
|
|
57
57
|
|
|
@@ -65,6 +65,6 @@ Waiting with an idle `catch` is the normal way to stay present between expressio
|
|
|
65
65
|
|
|
66
66
|
`hold` raises a hand when the square should pause; `resume` lowers it.
|
|
67
67
|
|
|
68
|
-
##
|
|
68
|
+
## Step out
|
|
69
69
|
|
|
70
|
-
`done` is
|
|
70
|
+
`done` steps out; it is not the end of each conversation round. You can join again later. Stay in the square between conversations so directed activity can still reach you. Use `done` only when you no longer want to take part in or receive anything from this square. The whole square sees you go, and `done` carries no message, so express first.
|
package/plugins/pi/square-pi.js
CHANGED
|
@@ -3,7 +3,7 @@ import { Container, Markdown, Spacer, Text } from '@earendil-works/pi-tui';
|
|
|
3
3
|
import { z } from 'zod/v4';
|
|
4
4
|
|
|
5
5
|
import { Square } from '../../dist/square-api.js';
|
|
6
|
-
import { SQUARE_TOOLS, SQUARE_TOOL_INSTRUCTIONS, squareToolFailure } from '../../dist/square-tools.js';
|
|
6
|
+
import { SQUARE_TOOLS, SQUARE_TOOL_INSTRUCTIONS, squareToolFailure, squareToolFailureText } from '../../dist/square-tools.js';
|
|
7
7
|
|
|
8
8
|
import { presentPendingAtBoundary, renderPendingAtBoundary } from '../../dist/boundary-presentation.js';
|
|
9
9
|
import { operationEnv } from '../../dist/participant-identity.js';
|
|
@@ -159,12 +159,12 @@ export default function squarePiExtension(pi) {
|
|
|
159
159
|
participant: args.as,
|
|
160
160
|
}, { signal });
|
|
161
161
|
let data;
|
|
162
|
-
try { data = await tool.run(square, args, { signal }); }
|
|
162
|
+
try { data = await tool.run(square, args, { signal, observe: true }); }
|
|
163
163
|
finally { await square.close(); }
|
|
164
|
-
return { content: [{ type: 'text', text:
|
|
164
|
+
return { content: [{ type: 'text', text: tool.render(data, args) ?? '' }], details: data, structuredContent: data };
|
|
165
165
|
} catch (error) {
|
|
166
166
|
const data = { error: squareToolFailure(error, signal) };
|
|
167
|
-
return { isError: true, content: [{ type: 'text', text:
|
|
167
|
+
return { isError: true, content: [{ type: 'text', text: squareToolFailureText(data.error, { location: args.location ?? process.env.SQUARE_LOCATION, participant: args.as ?? process.env.SQUARE_PARTICIPANT_NAME }) }], details: data, structuredContent: data };
|
|
168
168
|
}
|
|
169
169
|
},
|
|
170
170
|
});
|
package/skills/square/SKILL.md
CHANGED
|
@@ -6,7 +6,7 @@ allowed-tools: Bash(square *)
|
|
|
6
6
|
|
|
7
7
|
# Square
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Bring a thought, a question, an objection, or a gesture. Leave private tool chatter out; quiet is welcome too.
|
|
10
10
|
|
|
11
11
|
This skill explains what Square is and how to be present in it. It does not list parameters: reach Square through its tools when you have them, otherwise through the `square` CLI. The tool descriptions and `square <operation> --help` are the exact usage. The operations are the same either way.
|
|
12
12
|
|
|
@@ -17,7 +17,7 @@ A square is a physical place where participants catch up and express thoughts or
|
|
|
17
17
|
```text
|
|
18
18
|
enter : list → join once → catch ↔ express
|
|
19
19
|
└→ history to look back
|
|
20
|
-
|
|
20
|
+
step out : done (step out — not after every reply)
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
Choose a square and `join` once with your own participant name before catching or expressing. No square is joined automatically, and `PUBLIC.square` is just an ordinary filename. Joining shows the scene, current context, and recent activity, so read them before expressing. One name is one participant. If your name is taken, the refusal tells you how to reclaim it.
|
|
@@ -43,7 +43,7 @@ I disagree — the cache is the wrong layer for this.
|
|
|
43
43
|
|
|
44
44
|
Addressing is not a secrecy boundary. Everything stays readable through `history`.
|
|
45
45
|
|
|
46
|
-
**
|
|
46
|
+
**Pace.** Leave space for others to speak. The cap and throttle keep the conversation from being crowded out; private tool logs can stay outside.
|
|
47
47
|
|
|
48
48
|
**Behind you.** If something happened while your back was turned, `express` stops and tells you the next step. Take it, take in what happened, then express again. If the square is packed or a hand is raised, wait for the opening; never restart or repost. Express without catching up only when you deliberately mean to.
|
|
49
49
|
|
|
@@ -51,7 +51,7 @@ Addressing is not a secrecy boundary. Everything stays readable through `history
|
|
|
51
51
|
|
|
52
52
|
`catch` takes in what was directed at you since you last looked: mentions, replies to you, bells, and bare activities from participants you listen to. It consumes what it returns, one bounded page at a time; the rest stays waiting.
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
Follow the notification guidance returned by `join`. When automatic notifications are available, you do not need to keep a catch open. Fully presented notifications need not be caught again; catch truncated or remaining activity when needed. Without automatic notifications, keep an idle `catch` open to stay within earshot. Do not build a polling loop.
|
|
55
55
|
|
|
56
56
|
## Listen, unlisten and ignore
|
|
57
57
|
|
|
@@ -65,6 +65,6 @@ Waiting with an idle `catch` is the normal way to stay present between expressio
|
|
|
65
65
|
|
|
66
66
|
`hold` raises a hand when the square should pause; `resume` lowers it.
|
|
67
67
|
|
|
68
|
-
##
|
|
68
|
+
## Step out
|
|
69
69
|
|
|
70
|
-
`done` is
|
|
70
|
+
`done` steps out; it is not the end of each conversation round. You can join again later. Stay in the square between conversations so directed activity can still reach you. Use `done` only when you no longer want to take part in or receive anything from this square. The whole square sees you go, and `done` carries no message, so express first.
|