@astrosheep/square 0.3.31 → 0.3.33
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/codex-plugin/.codex-plugin/plugin.json +1 -1
- package/dist/activity.js +7 -6
- package/dist/artifact.js +4 -2
- package/dist/automatic-session.js +19 -1
- package/dist/claude-hook.d.ts +2 -1
- package/dist/claude-hook.js +6 -2
- package/dist/cli/square-commands.js +4 -5
- package/dist/codex-hook.d.ts +2 -1
- package/dist/codex-hook.js +6 -2
- package/dist/codex-queue.d.ts +1 -1
- package/dist/codex-queue.js +9 -3
- package/dist/delivery-operations.js +112 -16
- package/dist/delivery.d.ts +2 -1
- package/dist/host-ledger-file-adapter.js +2 -11
- package/dist/model.d.ts +3 -0
- package/dist/model.js +2 -2
- package/dist/notifications.d.ts +7 -0
- package/dist/notifications.js +84 -16
- package/dist/open-square.d.ts +2 -1
- package/dist/paseo-delivery.d.ts +1 -1
- package/dist/paseo-delivery.js +23 -4
- package/dist/paseo-state.d.ts +1 -1
- package/dist/paseo-state.js +2 -2
- package/dist/ports.d.ts +11 -0
- package/dist/presence.js +1 -1
- package/dist/registry.js +9 -10
- package/dist/routes.d.ts +25 -1
- package/dist/routes.js +107 -6
- package/dist/square-actions.d.ts +1 -0
- package/dist/square-actions.js +38 -1
- package/dist/square-facade.d.ts +4 -1
- package/dist/square-file-adapter.d.ts +2 -1
- package/dist/square-file-adapter.js +2 -1
- package/dist/square-projections.js +10 -5
- package/dist/wake-port.js +1 -1
- package/package.json +1 -1
|
@@ -39,6 +39,7 @@ export async function openSquare(squarePath, options = {}) {
|
|
|
39
39
|
userPath: env.SQUARE_HOST_LEDGER_USER ?? ledgerRoot,
|
|
40
40
|
localPath: env.SQUARE_HOST_LEDGER_LOCAL ?? ledgerRoot,
|
|
41
41
|
}),
|
|
42
|
+
wakeTransport: options.wakeTransport,
|
|
42
43
|
};
|
|
43
44
|
}
|
|
44
45
|
catch (error) {
|
|
@@ -77,7 +78,7 @@ export function buildMemorySquare(options) {
|
|
|
77
78
|
hardCap: options.hardCap ?? null,
|
|
78
79
|
...(options.throttlePerMinute === undefined ? {} : { throttlePerMinute: options.throttlePerMinute }),
|
|
79
80
|
}, options.markdown);
|
|
80
|
-
return { artifact: memoryArtifact(createMemoryCell(squareState)), clock: options.clock ?? Date.now, location: 'memory', hostLedger: options.hostLedger };
|
|
81
|
+
return { artifact: memoryArtifact(createMemoryCell(squareState)), clock: options.clock ?? Date.now, location: 'memory', hostLedger: options.hostLedger, wakeTransport: options.wakeTransport };
|
|
81
82
|
}
|
|
82
83
|
function memoryArtifact(cell) {
|
|
83
84
|
return { read: () => cell.read(), transact: (fn) => cell.transact(fn), changed: (since, timeout) => cell.changed(since, timeout), close: () => cell.close() };
|
|
@@ -2,6 +2,7 @@ import { formatActivityId, parseActivityId } from './square-core.js';
|
|
|
2
2
|
import { nameKey } from './model.js';
|
|
3
3
|
import { deriveDeliveryModel } from './delivery.js';
|
|
4
4
|
import { freshWatchLease } from './runtime.js';
|
|
5
|
+
import { canonicalRouteLocation } from './routes.js';
|
|
5
6
|
function bindingProjection(record) {
|
|
6
7
|
return {
|
|
7
8
|
location: record.location,
|
|
@@ -53,14 +54,18 @@ export function terminalWakeEvidence(attempts) { return attempts.findLast((attem
|
|
|
53
54
|
export function isWakeRouteAttemptable(route, attempts) {
|
|
54
55
|
if (terminalWakeEvidence(attempts) !== undefined)
|
|
55
56
|
return false;
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
if (attempts.some((attempt) => attempt.routeKind === route.kind && attempt.outcome === 'unknown'))
|
|
58
|
+
return false;
|
|
59
|
+
return true;
|
|
58
60
|
}
|
|
59
61
|
export function hasAttemptableWakeRoute(routes, attempts) { return routes.some((route) => isWakeRouteAttemptable(route, attempts)); }
|
|
60
62
|
export async function projectWakeEvidenceFromState(input) {
|
|
63
|
+
const canonicalLocation = await canonicalRouteLocation(input.location);
|
|
61
64
|
const delivery = input.delivery ?? deriveDeliveryModel(input.state);
|
|
62
|
-
const bindings = (
|
|
63
|
-
|
|
65
|
+
const bindings = (input.state.routes ?? [])
|
|
66
|
+
.filter((route) => route.location === canonicalLocation || route.location === input.location)
|
|
67
|
+
.map((route) => ({ location: route.location, participant: route.participant, sessionId: route.sessionId, channel: route.channel, route: { ...route, address: { ...route.address } }, updatedAt: route.updatedAt }));
|
|
68
|
+
const wakeRecords = await input.hostLedger.listEvidence({ location: canonicalLocation, kind: 'wake', now: input.now });
|
|
64
69
|
const attemptsByBinding = new Map();
|
|
65
70
|
for (const record of wakeRecords) {
|
|
66
71
|
const actIndex = parseActivityId(record.activity);
|
|
@@ -72,7 +77,7 @@ export async function projectWakeEvidenceFromState(input) {
|
|
|
72
77
|
existing.push(attempt);
|
|
73
78
|
attemptsByBinding.set(key, existing);
|
|
74
79
|
}
|
|
75
|
-
const presentedRows = await projectPresentationEvidence({ hostLedger: input.hostLedger, location:
|
|
80
|
+
const presentedRows = await projectPresentationEvidence({ hostLedger: input.hostLedger, location: canonicalLocation, now: input.now });
|
|
76
81
|
return {
|
|
77
82
|
evidence(recipient, actIndex) {
|
|
78
83
|
const recipientBindings = bindings.filter((binding) => nameKey(binding.participant) === nameKey(recipient));
|
package/dist/wake-port.js
CHANGED