@astrosheep/square 0.3.3 → 0.3.5
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 +1 -1
- package/dist/activity.js +15 -13
- package/dist/cli/context.js +143 -0
- package/dist/cli/harness-command.js +50 -0
- package/dist/cli/maintenance-commands.js +92 -0
- package/dist/cli/meta-commands.js +31 -0
- package/dist/cli/observation-commands.js +461 -0
- package/dist/cli/program.js +48 -0
- package/dist/cli/registry.js +40 -0
- package/dist/cli/square-commands.js +221 -0
- package/dist/compact.js +5 -18
- package/dist/harness-claude.js +275 -0
- package/dist/harness-codex.js +653 -0
- package/dist/harness-lifecycle.js +102 -0
- package/dist/harness-links.js +123 -0
- package/dist/harness.js +97 -572
- package/dist/help.js +2 -1
- package/dist/identity.js +27 -0
- package/dist/index.js +45 -32
- package/dist/runtime.js +0 -54
- package/dist/square-application.js +259 -0
- package/dist/square-store.js +111 -0
- package/dist/square.js +5 -1362
- package/dist/watch.js +17 -19
- package/package.json +3 -1
- package/skills/square/.claude-plugin/plugin.json +1 -1
package/dist/watch.js
CHANGED
|
@@ -2,11 +2,13 @@ import { setTimeout as sleep } from 'node:timers/promises';
|
|
|
2
2
|
import { loadSquare } from './artifact.js';
|
|
3
3
|
import { SquareError, nameKey, } from './model.js';
|
|
4
4
|
import { deriveDeliveryModel } from './delivery.js';
|
|
5
|
-
import { SLEEP_MS, STALE_MS, WATCH_HEARTBEAT_MS, WATCH_STALE_MS, countSays, currentHold, doneNames, freshWatchLease, hasQuorum, inSquareCount, markDeliveredMentions, nowMs, readCursor, touchPresenceCursor,
|
|
5
|
+
import { SLEEP_MS, STALE_MS, WATCH_HEARTBEAT_MS, WATCH_STALE_MS, countSays, currentHold, doneNames, freshWatchLease, hasQuorum, inSquareCount, markDeliveredMentions, nowMs, readCursor, touchPresenceCursor, } from './runtime.js';
|
|
6
|
+
import { withSquareLock, writeSquareDoc } from './square-store.js';
|
|
6
7
|
import { renderWatchForceTakeover, renderWatchAlreadyActive, renderWatchInterrupted, renderWatchOutput, renderWatchReplaced, renderWatchStatus, participantCommandPrefix, withPathOutput, withWatchNextOutput, } from './presentation.js';
|
|
7
8
|
import { ackPeerDelta, filteredPeerActivities, filteredRoomChanges, indexedDelta, matchesFeedFilter, peerPublicActs, peerRoomChanges, } from './activity-feed.js';
|
|
8
9
|
import { coreParticipants, resolveKnownName } from './decisions.js';
|
|
9
10
|
import { hasAutomaticDeliveryIdentity } from './registry.js';
|
|
11
|
+
import { execute } from './square-application.js';
|
|
10
12
|
/** Notification receipts are stronger than the public-feed cursor, which self activity may advance. */
|
|
11
13
|
function catchDelta(doc, name) {
|
|
12
14
|
const items = indexedDelta(doc.acts, readCursor(doc, name));
|
|
@@ -95,29 +97,25 @@ function writeWatchOutput(squarePath, name, stdout, status, idleMs) {
|
|
|
95
97
|
process.stdout.write(withWatchNextOutput(squarePath, [stdout.trimEnd(), fallback].filter(Boolean).join('\n\n'), headerOpts));
|
|
96
98
|
}
|
|
97
99
|
async function beginWatch(squarePath, name, opts) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
return { type: 'started', leaseId: id, replaced: active !== undefined, heartbeatAt: at };
|
|
100
|
+
const at = nowMs();
|
|
101
|
+
const id = leaseId();
|
|
102
|
+
const committed = await execute(squarePath, {
|
|
103
|
+
type: 'lease',
|
|
104
|
+
name,
|
|
105
|
+
leaseId: id,
|
|
106
|
+
at,
|
|
107
|
+
expiresAt: at + WATCH_STALE_MS,
|
|
108
|
+
force: opts.force,
|
|
109
|
+
filter: leaseFilter(opts),
|
|
109
110
|
});
|
|
111
|
+
if (committed.result.type === 'active')
|
|
112
|
+
return committed.result;
|
|
113
|
+
return { type: 'started', leaseId: id, replaced: committed.result.replaced, heartbeatAt: at };
|
|
110
114
|
}
|
|
111
115
|
async function endWatch(squarePath, name, id) {
|
|
112
116
|
if (id === undefined)
|
|
113
117
|
return;
|
|
114
|
-
await
|
|
115
|
-
const doc = loadSquare(squarePath);
|
|
116
|
-
if (doc.runtime.leases[name]?.leaseId !== id)
|
|
117
|
-
return;
|
|
118
|
-
delete doc.runtime.leases[name];
|
|
119
|
-
writeSquareDoc(squarePath, doc);
|
|
120
|
-
});
|
|
118
|
+
await execute(squarePath, { type: 'release-lease', name, leaseId: id });
|
|
121
119
|
}
|
|
122
120
|
function installWatchInterruptHandler(squarePath, name, currentLeaseId) {
|
|
123
121
|
const onInterrupt = () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrosheep/square",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"description": "Multi-agent brainstorming through a shared file. Agents join, talk, watch, and mark themselves done.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
"scripts": {
|
|
19
19
|
"clean": "node --input-type=module -e \"import fs from 'node:fs'; fs.rmSync('dist',{recursive:true,force:true})\"",
|
|
20
20
|
"build": "npm run clean && tsc && node --input-type=module -e \"import fs from 'node:fs'; fs.chmodSync('dist/square.js',0o755)\"",
|
|
21
|
+
"verify-release": "node test/release.test.js",
|
|
22
|
+
"prepublishOnly": "npm run build && npm run verify-release",
|
|
21
23
|
"test": "npm run build && node --test test/*.test.js"
|
|
22
24
|
},
|
|
23
25
|
"keywords": [
|