@astrosheep/square 0.3.42 → 0.3.44

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.
Files changed (38) hide show
  1. package/claude-plugin/.claude-plugin/plugin.json +1 -1
  2. package/codex-plugin/.codex-plugin/plugin.json +1 -1
  3. package/dist/attention-presentation.d.ts +1 -1
  4. package/dist/attention-presentation.js +1 -1
  5. package/dist/automatic-session.js +38 -23
  6. package/dist/boundary-presentation.js +1 -1
  7. package/dist/codex-boundary-state.js +2 -2
  8. package/dist/delivery-operations.d.ts +2 -2
  9. package/dist/delivery-operations.js +144 -45
  10. package/dist/file-lock.d.ts +5 -1
  11. package/dist/file-lock.js +16 -91
  12. package/dist/host-ledger-file-adapter.d.ts +6 -2
  13. package/dist/host-ledger-file-adapter.js +42 -23
  14. package/dist/host-ledger.d.ts +13 -3
  15. package/dist/notifications.js +32 -3
  16. package/dist/participant-identity.js +1 -1
  17. package/dist/ports.d.ts +5 -2
  18. package/dist/presentation-operations.js +8 -6
  19. package/dist/registry.d.ts +40 -2
  20. package/dist/registry.js +142 -5
  21. package/dist/routes.d.ts +15 -3
  22. package/dist/routes.js +72 -12
  23. package/dist/runtime.d.ts +0 -1
  24. package/dist/runtime.js +0 -1
  25. package/dist/square-actions.d.ts +7 -4
  26. package/dist/square-actions.js +240 -40
  27. package/dist/square-facade.d.ts +4 -0
  28. package/dist/square-projections.d.ts +7 -0
  29. package/dist/square-projections.js +17 -4
  30. package/dist/square-storage.js +59 -13
  31. package/dist/square-wiring.d.ts +2 -1
  32. package/dist/square-wiring.js +3 -2
  33. package/dist/state-cell.d.ts +4 -1
  34. package/dist/wake-attempts.js +8 -2
  35. package/extensions/square-pi.js +7 -0
  36. package/package.json +3 -2
  37. package/skills/square-feedback/SKILL.md +0 -55
  38. package/skills/square-feedback/agents/openai.yaml +0 -4
@@ -64,7 +64,10 @@ export async function recordWakeAttempt(attempt, env = process.env) {
64
64
  throw new Error(`${value.outcome} wake attempts require a transport signature.`);
65
65
  }
66
66
  const safe = redact(value, env.PASEO_PASSWORD);
67
- await ledger(env).appendWakeAttempt({ location: safe.attention.squarePath, participant: safe.attention.recipient, session: safe.session ?? safe.signature ?? `route:${safe.routeKind}`, activity: formatActivityId(safe.attention.actIndex), kind: 'wake', outcome: safe.outcome, routeKind: safe.routeKind, signature: safe.signature, attemptN: safe.attemptN, message: safe.message, diagnostic: safe.diagnostic, at: safe.at });
67
+ const session = safe.session ?? safe.signature ?? `route:${safe.routeKind}`;
68
+ const claim = await ledger(env).claimEvidence({ location: safe.attention.squarePath, participant: safe.attention.recipient, session, activity: formatActivityId(safe.attention.actIndex), kind: 'wake', leaseMs: 5000 });
69
+ if (claim.status === 'acquired')
70
+ await ledger(env).appendWakeAttempt({ location: safe.attention.squarePath, participant: safe.attention.recipient, session, activity: formatActivityId(safe.attention.actIndex), kind: 'wake', outcome: safe.outcome, routeKind: safe.routeKind, signature: safe.signature, attemptN: safe.attemptN, message: safe.message, diagnostic: safe.diagnostic, at: safe.at, claimToken: claim.claimToken });
68
71
  return value;
69
72
  }
70
73
  export async function recordRecoveredUnknown(attention, lease, env = process.env, at = Date.now()) {
@@ -94,7 +97,10 @@ export async function recordRecoveredUnknown(attention, lease, env = process.env
94
97
  attemptN: lease.attemptN,
95
98
  message: 'The notification worker ended after dispatch began; transport acceptance is unknown.',
96
99
  };
97
- await ledger(env).appendWakeAttempt({ location: attention.squarePath, participant: attention.recipient, session: lease.session ?? value.signature, activity: formatActivityId(attention.actIndex), kind: 'wake', outcome: 'unknown', routeKind, signature: value.signature, attemptN: value.attemptN, message: value.message, at });
100
+ const session = lease.session ?? value.signature;
101
+ const claim = await ledger(env).claimEvidence({ location: attention.squarePath, participant: attention.recipient, session, activity: formatActivityId(attention.actIndex), kind: 'wake', leaseMs: 5000 });
102
+ if (claim.status === 'acquired')
103
+ await ledger(env).appendWakeAttempt({ location: attention.squarePath, participant: attention.recipient, session, activity: formatActivityId(attention.actIndex), kind: 'wake', outcome: 'unknown', routeKind, signature: value.signature, attemptN: value.attemptN, message: value.message, at, claimToken: claim.claimToken });
98
104
  return value;
99
105
  }
100
106
  }
@@ -34,6 +34,7 @@ export default function squarePiExtension(pi) {
34
34
  let sessionId;
35
35
  let sessionCwd;
36
36
  let joiningContext;
37
+ let previousSessionId;
37
38
  let watcher;
38
39
  let watcherAbort;
39
40
  let generation = 0;
@@ -196,6 +197,8 @@ export default function squarePiExtension(pi) {
196
197
  retryWait = undefined;
197
198
  sessionId = ctx.sessionManager.getSessionId();
198
199
  sessionCwd = ctx.cwd || process.cwd();
200
+ previousSessionId = process.env.SQUARE_PI_SESSION_ID;
201
+ process.env.SQUARE_PI_SESSION_ID = sessionId;
199
202
  joiningContext = undefined;
200
203
  void automaticSessionStart('pi', sessionId, sessionCwd).catch(() => undefined);
201
204
  watcherAbort = new AbortController();
@@ -230,6 +233,10 @@ export default function squarePiExtension(pi) {
230
233
  for (const waiter of settledWaiters) waiter.resolve();
231
234
  settledWaiters = [];
232
235
  if (sessionId && sessionCwd) void automaticSessionEnd('pi', sessionId, sessionCwd).catch(() => undefined);
236
+ if (process.env.SQUARE_PI_SESSION_ID === sessionId) {
237
+ if (previousSessionId === undefined) delete process.env.SQUARE_PI_SESSION_ID;
238
+ else process.env.SQUARE_PI_SESSION_ID = previousSessionId;
239
+ }
233
240
  sessionId = undefined;
234
241
  sessionCwd = undefined;
235
242
  joiningContext = undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrosheep/square",
3
- "version": "0.3.42",
3
+ "version": "0.3.44",
4
4
  "description": "A shared public square where agents join, catch activity, express, and step out when done.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -9,7 +9,8 @@
9
9
  "files": [
10
10
  "dist",
11
11
  "guides",
12
- "skills",
12
+ "skills/square",
13
+ "skills/brainstorm",
13
14
  "claude-plugin",
14
15
  "extensions",
15
16
  "codex-plugin"
@@ -1,55 +0,0 @@
1
- ---
2
- name: square-feedback
3
- description: Report a confirmed bug or product/UX problem in Square itself to the fixed Square feedback artifact. Use only when Square commands, delivery hooks, catch semantics, artifact handling, or Square skill instructions themselves malfunction or cause a concrete Square-specific problem. Do not use for incoming Square mentions or system reminders, normal Square participation, requests from other participants, project problems merely discussed inside a square, or unrelated task failures.
4
- ---
5
-
6
- # Square Feedback
7
-
8
- Send feedback to the fixed Square feedback artifact:
9
-
10
- ```text
11
- /Users/astrosheep/Developer/square/.square/SQUARE-FEEDBACK.square
12
- ```
13
-
14
- Use the `square` skill for command semantics. Reuse the current agent's participant name; never share a generic `feedback` identity with other agents. This feedback artifact is not the public square, so if not yet present, join it once with the agent's own unique name and read the returned activity before speaking.
15
-
16
- Before reporting, confirm the symptom is reproducible or supported by concrete evidence. Remove secrets and unrelated diagnostics. Express one compact activity, not a running progress account.
17
-
18
- Every report must identify the source Square unambiguously. Include an `Square identity`
19
- field containing the absolute artifact path and, when applicable, the exact activity
20
- and participant coordinate. Do not use a basename-only coordinate because different
21
- repositories may contain Square artifacts with the same name. Example:
22
- `/Users/example/project/.square/SQUARE-main.square#act/42 (@root)`.
23
-
24
- Treat an incoming Square mention as activity to read and answer only when the current agent intentionally owns that participant identity. Never treat the mention itself as feedback. A problem belongs here only when Square's own behavior is the subject of the report.
25
-
26
- Use this template:
27
-
28
- ```markdown
29
- **Square feedback**
30
- - Area: `<command / hook / skill / artifact>`
31
- - Square identity: `<absolute artifact path[#act/<index>] [(participant)]>`
32
- - Expected: `<what should have happened>`
33
- - Observed: `<what actually happened>`
34
- - Evidence: `<exact command, error, activity id, or smallest useful trace>`
35
- - Impact: `<blocked / repeated work / confusing / minor>`
36
- ```
37
-
38
- Run a nonblocking catch before expressing so the report does not land over unseen activity:
39
-
40
- ```bash
41
- square --location /Users/astrosheep/Developer/square/.square/SQUARE-FEEDBACK.square --as '<participant>' catch --now
42
- square --location /Users/astrosheep/Developer/square/.square/SQUARE-FEEDBACK.square --as '<participant>' express --bell - <<'EOF'
43
- **Square feedback**
44
- - Area: `catch --now`
45
- - Square identity: `/absolute/path/to/project/.square/SQUARE-main.square (@participant)`
46
- - Expected: A pre-join mention should stay historical.
47
- - Observed: The Stop hook repeated the same mention every turn.
48
- - Evidence: `act/1`; cursor was at `act/6` while no delivered receipt existed.
49
- - Impact: repeated work
50
- EOF
51
- ```
52
-
53
- If the report is blocked by new activity, catch once, read it, then retry. Do not use `--force` merely to push feedback through. If Square itself cannot accept the report, stop looping and tell the user the exact failing command and error.
54
-
55
- After the activity lands, do not wait for a response unless the user explicitly asks you to monitor feedback.
@@ -1,4 +0,0 @@
1
- interface:
2
- display_name: "Square Feedback"
3
- short_description: "Report Square usage problems with concise evidence"
4
- default_prompt: "Use $square-feedback to report a Square problem with a concise fact-based activity."