@astrosheep/square 0.3.5 → 0.3.7
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/codex-plugin/.codex-plugin/plugin.json +3 -2
- package/codex-plugin/hooks/hooks.json +3 -14
- package/dist/activity-feed.js +26 -18
- package/dist/activity.js +10 -10
- package/dist/artifact.js +138 -203
- package/dist/boundary-presentation.js +77 -0
- package/dist/claude-hook.js +4 -94
- package/dist/cli/context.js +7 -7
- package/dist/cli/maintenance-commands.js +10 -26
- package/dist/cli/meta-commands.js +3 -6
- package/dist/cli/observation-commands.js +48 -53
- package/dist/cli/program.js +4 -4
- package/dist/cli/registry.js +5 -5
- package/dist/cli/square-commands.js +27 -20
- package/dist/cmd/notify-once.js +23 -21
- package/dist/codex-hook.js +22 -0
- package/dist/compact.js +1 -1
- package/dist/decisions.js +61 -88
- package/dist/delivery-health.js +104 -210
- package/dist/delivery.js +68 -18
- package/dist/doctor.js +9 -8
- package/dist/harness-claude.js +38 -245
- package/dist/harness-codex.js +82 -616
- package/dist/harness-stage.js +36 -0
- package/dist/harness.js +3 -5
- package/dist/help.js +43 -35
- package/dist/inbox.js +12 -11
- package/dist/index.js +10 -121
- package/dist/list.js +1 -1
- package/dist/model.js +0 -6
- package/dist/notification-failures.js +54 -0
- package/dist/notifications.js +47 -62
- package/dist/paseo-delivery.js +160 -0
- package/dist/paseo-state.js +31 -0
- package/dist/paseo-timeline.js +58 -188
- package/dist/presentation.js +57 -64
- package/dist/presented.js +9 -8
- package/dist/registry.js +55 -45
- package/dist/runtime.js +27 -84
- package/dist/square-application.js +135 -130
- package/dist/square-core.js +3 -11
- package/dist/stream.js +27 -126
- package/dist/wake-sink.js +3 -214
- package/dist/watch.js +65 -122
- package/extensions/square-opencode.js +8 -73
- package/extensions/square-pi.js +8 -132
- package/guides/architect.md +3 -3
- package/guides/participant.md +25 -16
- package/package.json +2 -2
- package/skills/brainstorm/SKILL.md +25 -32
- package/skills/square/.claude-plugin/plugin.json +1 -1
- package/skills/square/SKILL.md +39 -107
- package/skills/square/hooks/hooks.json +2 -13
- package/skills/square-feedback/SKILL.md +4 -4
- package/dist/harness-lifecycle.js +0 -102
- package/dist/square-store.js +0 -111
- package/dist/terminal.js +0 -125
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "square",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
4
4
|
"description": "Shared Square activity with reliable participant attention at Codex boundaries.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Square"
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
"interface": {
|
|
16
16
|
"displayName": "Square",
|
|
17
17
|
"shortDescription": "Join and coordinate through a shared square",
|
|
18
|
-
"longDescription": "Participate in a shared
|
|
18
|
+
"longDescription": "Participate in a shared square and receive addressed activity at Codex boundaries.",
|
|
19
|
+
"defaultPrompt": "Use Square to join other agents, catch their activity, express in words or embodied action, and step out when done.",
|
|
19
20
|
"developerName": "Square",
|
|
20
21
|
"category": "Developer Tools",
|
|
21
22
|
"capabilities": [
|
|
@@ -1,25 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"hooks": {
|
|
3
|
-
"
|
|
3
|
+
"PostToolUse": [
|
|
4
4
|
{
|
|
5
5
|
"hooks": [
|
|
6
6
|
{
|
|
7
7
|
"type": "command",
|
|
8
8
|
"command": "square codex-hook",
|
|
9
9
|
"timeout": 5,
|
|
10
|
-
"statusMessage": "square-codex-hook"
|
|
11
|
-
|
|
12
|
-
]
|
|
13
|
-
}
|
|
14
|
-
],
|
|
15
|
-
"Stop": [
|
|
16
|
-
{
|
|
17
|
-
"hooks": [
|
|
18
|
-
{
|
|
19
|
-
"type": "command",
|
|
20
|
-
"command": "square codex-hook",
|
|
21
|
-
"timeout": 5,
|
|
22
|
-
"statusMessage": "square-codex-hook"
|
|
10
|
+
"statusMessage": "square-codex-hook",
|
|
11
|
+
"additionalContextLimit": 1200
|
|
23
12
|
}
|
|
24
13
|
]
|
|
25
14
|
}
|
package/dist/activity-feed.js
CHANGED
|
@@ -1,36 +1,44 @@
|
|
|
1
1
|
import { sameName } from './model.js';
|
|
2
|
-
import {
|
|
3
|
-
import { matchesCatchFilter } from './delivery.js';
|
|
4
|
-
export function
|
|
5
|
-
return acts
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import { advanceCursor, latestActIndex, readCursor } from './runtime.js';
|
|
3
|
+
import { deriveDeliveryModel, matchesCatchFilter } from './delivery.js';
|
|
4
|
+
export function actDelta(acts, cursor) {
|
|
5
|
+
return acts.filter((act) => act.index > cursor);
|
|
6
|
+
}
|
|
7
|
+
/** Public cursor changes plus directed receipts that remain pending behind it. */
|
|
8
|
+
export function deliveryDelta(doc, name) {
|
|
9
|
+
const items = actDelta(doc.acts, readCursor(doc, name));
|
|
10
|
+
const seen = new Set(items.map((act) => act.index));
|
|
11
|
+
for (const notification of deriveDeliveryModel(doc).pendingFor(name)) {
|
|
12
|
+
if (!seen.has(notification.item.index))
|
|
13
|
+
items.push(notification.item);
|
|
14
|
+
}
|
|
15
|
+
return items.sort((a, b) => a.index - b.index);
|
|
8
16
|
}
|
|
9
17
|
export function peerRoomChanges(delta, name) {
|
|
10
|
-
return delta.filter((
|
|
18
|
+
return delta.filter((act) => act.actor !== undefined && !sameName(act.actor, name) && act.kind !== 'say' && act.kind !== 'read');
|
|
11
19
|
}
|
|
12
20
|
export function peerPublicActs(delta, name) {
|
|
13
|
-
return delta.filter((
|
|
21
|
+
return delta.filter((act) => act.actor !== undefined && !sameName(act.actor, name) && (act.kind === 'say' || act.kind === 'done'));
|
|
14
22
|
}
|
|
15
|
-
function matchesParticipants(
|
|
16
|
-
return participants === undefined || (
|
|
23
|
+
function matchesParticipants(act, participants) {
|
|
24
|
+
return participants === undefined || (act.actor !== undefined && participants.some((participant) => sameName(participant, act.actor)));
|
|
17
25
|
}
|
|
18
|
-
export function matchesFeedFilter(
|
|
19
|
-
if (
|
|
20
|
-
return matchesCatchFilter({ actor:
|
|
26
|
+
export function matchesFeedFilter(act, filter) {
|
|
27
|
+
if (act.kind === 'say') {
|
|
28
|
+
return matchesCatchFilter({ actor: act.actor, body: act.body, reach: act.reach }, filter);
|
|
21
29
|
}
|
|
22
|
-
return filter.mention === undefined && matchesParticipants(
|
|
30
|
+
return filter.mention === undefined && matchesParticipants(act, filter.participants);
|
|
23
31
|
}
|
|
24
32
|
export function filteredPeerActivities(delta, name, filter) {
|
|
25
33
|
return peerPublicActs(delta, name)
|
|
26
|
-
.filter((
|
|
27
|
-
.filter((
|
|
34
|
+
.filter((act) => act.kind === 'say')
|
|
35
|
+
.filter((act) => matchesFeedFilter(act, filter));
|
|
28
36
|
}
|
|
29
37
|
export function filteredRoomChanges(delta, name, filter) {
|
|
30
38
|
if (filter.mention !== undefined)
|
|
31
39
|
return [];
|
|
32
|
-
return peerRoomChanges(delta, name).filter((
|
|
40
|
+
return peerRoomChanges(delta, name).filter((act) => matchesParticipants(act, filter.participants));
|
|
33
41
|
}
|
|
34
42
|
export function ackPeerDelta(doc, name, delta) {
|
|
35
|
-
return advanceCursor(doc, name,
|
|
43
|
+
return advanceCursor(doc, name, latestActIndex([...peerPublicActs(delta, name), ...peerRoomChanges(delta, name)]));
|
|
36
44
|
}
|
package/dist/activity.js
CHANGED
|
@@ -4,7 +4,7 @@ import path from 'node:path';
|
|
|
4
4
|
import { setTimeout as sleep } from 'node:timers/promises';
|
|
5
5
|
import { loadSquare } from './artifact.js';
|
|
6
6
|
import { SquareError, validateName } from './model.js';
|
|
7
|
-
import {
|
|
7
|
+
import { expressHintLine, renderActivityBlocked, renderActivityLimit, renderExpressNoWait, renderExpressWaiting, renderPendingFeed, withPathOutput, } from './presentation.js';
|
|
8
8
|
import { currentHold, inSquareCount, nowMs, SLEEP_MS, resolveRosterName } from './runtime.js';
|
|
9
9
|
import { resolveKnownName } from './decisions.js';
|
|
10
10
|
import { execute } from './square-application.js';
|
|
@@ -75,19 +75,19 @@ export async function cmdActivity(squarePath, name, activity, resolveBody, opts)
|
|
|
75
75
|
force,
|
|
76
76
|
now: nowMs(),
|
|
77
77
|
...(reach === undefined ? {} : { reach }),
|
|
78
|
+
...(opts.reply === undefined ? {} : { reply: opts.reply }),
|
|
78
79
|
});
|
|
79
80
|
const decision = committed.result;
|
|
80
|
-
const sent = committed.acts[0];
|
|
81
81
|
const freshDoc = loadSquare(squarePath);
|
|
82
82
|
const headerCount = inSquareCount(freshDoc);
|
|
83
83
|
const held = currentHold(freshDoc.acts).active;
|
|
84
84
|
switch (decision.type) {
|
|
85
85
|
case 'sent': {
|
|
86
86
|
const hasPending = decision.pendingPublic.length > 0 || decision.pendingRoomChanges.length > 0;
|
|
87
|
-
const pending = hasPending ? `\n\n${renderPendingFeed(decision.pendingPublic, decision.pendingRoomChanges)}` : '';
|
|
88
|
-
const hint =
|
|
87
|
+
const pending = hasPending ? `\n\n${renderPendingFeed(freshDoc.acts, decision.pendingPublic, decision.pendingRoomChanges)}` : '';
|
|
88
|
+
const hint = expressHintLine(decision.ownActCount);
|
|
89
89
|
const withHint = hint ? `${decision.confirmation}\n${hint}` : decision.confirmation;
|
|
90
|
-
process.stdout.write(
|
|
90
|
+
process.stdout.write(withPathOutput(squarePath, withHint + pending, { participantCount: headerCount, held }));
|
|
91
91
|
return;
|
|
92
92
|
}
|
|
93
93
|
case 'blocked': {
|
|
@@ -121,11 +121,11 @@ export async function cmdActivity(squarePath, name, activity, resolveBody, opts)
|
|
|
121
121
|
case 'throttled': {
|
|
122
122
|
if (noWait) {
|
|
123
123
|
const draftPath = saveActivityDraft(squarePath, name, rawInput);
|
|
124
|
-
process.stdout.write(
|
|
124
|
+
process.stdout.write(renderExpressNoWait({ squarePath, name: knownName, reason: 'throttled', delayMs: decision.delayMs, draftPath, participantCount: headerCount, held }));
|
|
125
125
|
process.exit(1);
|
|
126
126
|
}
|
|
127
127
|
if (announcedWait !== 'throttled') {
|
|
128
|
-
process.stdout.write(
|
|
128
|
+
process.stdout.write(renderExpressWaiting({ reason: 'throttled', delayMs: decision.delayMs }) + '\n');
|
|
129
129
|
announcedWait = 'throttled';
|
|
130
130
|
}
|
|
131
131
|
await sleep(decision.delayMs);
|
|
@@ -134,18 +134,18 @@ export async function cmdActivity(squarePath, name, activity, resolveBody, opts)
|
|
|
134
134
|
case 'held': {
|
|
135
135
|
if (noWait) {
|
|
136
136
|
const draftPath = saveActivityDraft(squarePath, name, rawInput);
|
|
137
|
-
process.stdout.write(
|
|
137
|
+
process.stdout.write(renderExpressNoWait({ squarePath, name: knownName, reason: 'held', holdReason: decision.reason, draftPath, participantCount: headerCount, held }));
|
|
138
138
|
process.exit(1);
|
|
139
139
|
}
|
|
140
140
|
if (announcedWait !== 'held') {
|
|
141
|
-
process.stdout.write(
|
|
141
|
+
process.stdout.write(renderExpressWaiting({ reason: 'held' }) + '\n');
|
|
142
142
|
announcedWait = 'held';
|
|
143
143
|
}
|
|
144
144
|
await sleep(SLEEP_MS);
|
|
145
145
|
break;
|
|
146
146
|
}
|
|
147
147
|
case 'bell_quota': {
|
|
148
|
-
process.stdout.write(
|
|
148
|
+
process.stdout.write(withPathOutput(squarePath, [`✕ the bell stays quiet for now`, ` · you can ring it again at ${formatTimestamp(decision.nextAt)}`].join('\n'), { participantCount: headerCount, held }));
|
|
149
149
|
process.exit(1);
|
|
150
150
|
}
|
|
151
151
|
}
|