@astrosheep/square 0.3.86 → 0.3.88
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/artifact.d.ts +6 -1
- package/dist/artifact.js +79 -10
- package/dist/boundary-presentation.d.ts +5 -4
- package/dist/boundary-presentation.js +21 -25
- package/dist/catch-decisions.js +2 -1
- package/dist/claude-delivery-status.d.ts +8 -2
- package/dist/claude-delivery-status.js +26 -10
- package/dist/claude-delivery.d.ts +8 -4
- package/dist/claude-delivery.js +114 -104
- package/dist/claude-mcp-context.js +2 -2
- package/dist/claude-mod.js +119 -105
- package/dist/cli/context.d.ts +3 -1
- package/dist/cli/context.js +25 -1
- package/dist/cli/express-presentation.d.ts +3 -1
- package/dist/cli/express-presentation.js +14 -10
- package/dist/cli/mcp-server-command.js +2 -2
- package/dist/cli/observation-commands.js +1 -0
- package/dist/cli/registry.js +0 -2
- package/dist/cli/square-commands.d.ts +4 -2
- package/dist/cli/square-commands.js +21 -6
- package/dist/codex-hook.d.ts +3 -3
- package/dist/codex-hook.js +4 -4
- package/dist/codex-queue.d.ts +5 -6
- package/dist/codex-queue.js +9 -5
- package/dist/decisions.d.ts +3 -2
- package/dist/decisions.js +18 -6
- package/dist/delivery-health.d.ts +32 -2
- package/dist/delivery-health.js +108 -45
- package/dist/delivery-operations.d.ts +1 -2
- package/dist/delivery-operations.js +155 -196
- package/dist/delivery.d.ts +14 -23
- package/dist/delivery.js +48 -18
- package/dist/file-lock.d.ts +8 -1
- package/dist/file-lock.js +2 -0
- package/dist/help.js +8 -11
- package/dist/inbox.d.ts +35 -9
- package/dist/inbox.js +228 -144
- package/dist/index.d.ts +3 -4
- package/dist/index.js +1 -3
- package/dist/list.js +9 -4
- package/dist/mcp.js +12 -1
- package/dist/model.d.ts +39 -5
- package/dist/model.js +84 -0
- package/dist/notifications.d.ts +8 -6
- package/dist/notifications.js +56 -143
- package/dist/operation-presentation.js +7 -4
- package/dist/participant-identity.d.ts +0 -3
- package/dist/participant-identity.js +0 -31
- package/dist/paseo-delivery.d.ts +5 -6
- package/dist/paseo-delivery.js +13 -8
- package/dist/paseo.d.ts +1 -1
- package/dist/paseo.js +1 -1
- package/dist/plugins/opencode/delivery.d.ts +8 -3
- package/dist/plugins/opencode/delivery.js +187 -132
- package/dist/plugins/opencode/index.js +12 -38
- package/dist/ports.d.ts +112 -40
- package/dist/presentation-operations.d.ts +1 -1
- package/dist/presentation-operations.js +51 -35
- package/dist/presentation.js +8 -3
- package/dist/seats.d.ts +7 -0
- package/dist/seats.js +27 -0
- package/dist/session-lifecycle.d.ts +2 -2
- package/dist/session-lifecycle.js +10 -12
- package/dist/sqlite-square.d.ts +20 -9
- package/dist/sqlite-square.js +476 -341
- package/dist/square-api.d.ts +1 -0
- package/dist/square-api.js +3 -4
- package/dist/square-core.d.ts +3 -2
- package/dist/square-domain.d.ts +12 -5
- package/dist/square-domain.js +163 -7
- package/dist/square-facade.d.ts +16 -10
- package/dist/square-index.d.ts +24 -0
- package/dist/square-index.js +131 -0
- package/dist/square-legacy-framing.d.ts +9 -0
- package/dist/square-legacy-framing.js +56 -0
- package/dist/square-migration-host-ledger.d.ts +26 -0
- package/dist/square-migration-host-ledger.js +168 -0
- package/dist/square-migration.d.ts +5 -5
- package/dist/square-migration.js +373 -71
- package/dist/square-sqlite.d.ts +9 -9
- package/dist/square-sqlite.js +329 -79
- package/dist/square-stdio.d.ts +1 -1
- package/dist/square-stdio.js +12 -7
- package/dist/square-tools.d.ts +1 -1
- package/dist/square-tools.js +80 -27
- package/dist/stdio-server.js +4 -2
- package/dist/stream.d.ts +3 -2
- package/dist/stream.js +9 -10
- package/dist/views.d.ts +9 -14
- package/dist/views.js +52 -70
- package/dist/wakes.d.ts +6 -5
- package/dist/wakes.js +20 -17
- package/guides/application-facade-delivery-evidence.md +1 -1
- package/guides/claude-native.md +9 -9
- package/guides/mcp.md +2 -2
- package/guides/migration.md +107 -67
- package/guides/pi-tools.md +1 -1
- package/guides/row-storage-design.md +1 -1
- package/guides/square-api.md +61 -28
- package/package.json +1 -1
- package/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/plugins/claude/hooks/register.js +1 -1
- package/plugins/claude/skills/square/SKILL.md +4 -4
- package/plugins/claude/types.d.ts +1 -1
- package/plugins/codex/.codex-plugin/plugin.json +1 -1
- package/plugins/opencode/delivery.ts +170 -118
- package/plugins/opencode/index.ts +12 -30
- package/plugins/pi/square-pi.js +56 -18
- package/skills/square/SKILL.md +4 -4
- package/dist/cli/ledger-command.d.ts +0 -12
- package/dist/cli/ledger-command.js +0 -72
- package/dist/host-ledger-file-adapter.d.ts +0 -47
- package/dist/host-ledger-file-adapter.js +0 -384
- package/dist/host-ledger-migration.d.ts +0 -27
- package/dist/host-ledger-migration.js +0 -264
- package/dist/host-ledger-root.d.ts +0 -2
- package/dist/host-ledger-root.js +0 -9
- package/dist/host-ledger-sqlite.d.ts +0 -65
- package/dist/host-ledger-sqlite.js +0 -368
- package/dist/host-ledger.d.ts +0 -195
- package/dist/host-ledger.js +0 -1
- package/dist/ledger-maintenance.d.ts +0 -30
- package/dist/ledger-maintenance.js +0 -110
- package/dist/open-square.d.ts +0 -38
- package/dist/open-square.js +0 -81
- package/dist/participant-host.d.ts +0 -23
- package/dist/participant-host.js +0 -92
- package/dist/registry.d.ts +0 -55
- package/dist/registry.js +0 -123
- package/dist/routes.d.ts +0 -39
- package/dist/routes.js +0 -99
- package/dist/square-actions.d.ts +0 -56
- package/dist/square-actions.js +0 -353
- package/dist/square-projections.d.ts +0 -31
- package/dist/square-projections.js +0 -64
- package/dist/wake-attempts.d.ts +0 -10
- package/dist/wake-attempts.js +0 -39
- package/dist/wake-eligibility.d.ts +0 -53
- package/dist/wake-eligibility.js +0 -123
- package/dist/wake-evidence.d.ts +0 -33
- package/dist/wake-evidence.js +0 -32
- package/guides/host-ledger.md +0 -58
- package/guides/indexed-host-ledger-performance.md +0 -39
package/dist/delivery.js
CHANGED
|
@@ -1,4 +1,29 @@
|
|
|
1
|
+
import { renderAttentionPreview, renderSquareReminder } from './attention-presentation.js';
|
|
2
|
+
import { parseActivityId } from './square-core.js';
|
|
1
3
|
import { matchesCatchSelection } from './catch-selection.js';
|
|
4
|
+
/** Exact stored activity projection for transports that send an awareness reminder. */
|
|
5
|
+
export function wakePreview(facts, request) {
|
|
6
|
+
const index = parseActivityId(request.activity);
|
|
7
|
+
const head = index === undefined ? undefined : pendingHead(facts, request.participant, index);
|
|
8
|
+
const item = index === undefined ? undefined : facts.activity(index);
|
|
9
|
+
if (head === undefined || item?.kind !== 'say')
|
|
10
|
+
return undefined;
|
|
11
|
+
return renderSquareReminder([renderAttentionPreview({
|
|
12
|
+
squarePath: request.location, recipient: request.participant, actIndex: item.index,
|
|
13
|
+
actor: item.actor, route: head.route, body: item.body ?? '(structured activity)',
|
|
14
|
+
})]);
|
|
15
|
+
}
|
|
16
|
+
/** Presentation custody blocks a wake, independently of native wake acceptance. */
|
|
17
|
+
export function presentationBlocksWake(evidence, now) {
|
|
18
|
+
return evidence.some((row) => row.kind === 'presentation'
|
|
19
|
+
&& (row.outcome === 'presented' || row.outcome === 'clipped' || row.outcome === 'unknown'
|
|
20
|
+
|| row.outcome === 'dispatching' && (row.expiresAt === undefined || row.expiresAt > now)));
|
|
21
|
+
}
|
|
22
|
+
/** Preselection only: an expired wake dispatch is uncertain, never safe automatic replay. */
|
|
23
|
+
export function automaticWakeEligible(evidence, now) {
|
|
24
|
+
return !presentationBlocksWake(evidence, now) && !evidence.some((row) => row.kind === 'wake'
|
|
25
|
+
&& (row.outcome === 'accepted' || row.outcome === 'unknown' || row.outcome === 'dispatching'));
|
|
26
|
+
}
|
|
2
27
|
/** Notification pending is not cursor suffix or historical catch membership. */
|
|
3
28
|
export function pendingHead(facts, name, index) {
|
|
4
29
|
const participant = facts.participant(name);
|
|
@@ -6,8 +31,15 @@ export function pendingHead(facts, name, index) {
|
|
|
6
31
|
return undefined;
|
|
7
32
|
return facts.directedAt(participant.name, index);
|
|
8
33
|
}
|
|
9
|
-
/**
|
|
10
|
-
export function
|
|
34
|
+
/** One activity's landed recipients that still owe a wake; the rest of the roster is untouched. */
|
|
35
|
+
export function pendingRecipients(facts, index) {
|
|
36
|
+
return facts.audience(index).flatMap(({ recipient }) => {
|
|
37
|
+
const head = pendingHead(facts, recipient, index);
|
|
38
|
+
return head === undefined ? [] : [head];
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/** Still-pending directed heads for one recipient, oldest first. Bodies belong to presentation. */
|
|
42
|
+
export function pendingHeads(facts, name) {
|
|
11
43
|
const participant = facts.participant(name);
|
|
12
44
|
if (!participant?.joined)
|
|
13
45
|
return [];
|
|
@@ -20,9 +52,14 @@ export function pendingNotifications(facts, name) {
|
|
|
20
52
|
break;
|
|
21
53
|
afterIndex = page.items.at(-1).index;
|
|
22
54
|
}
|
|
55
|
+
return heads;
|
|
56
|
+
}
|
|
57
|
+
/** Complete recipient projection, assembled inside its one transaction. */
|
|
58
|
+
export function pendingNotifications(facts, name) {
|
|
59
|
+
const heads = pendingHeads(facts, name), recipient = heads[0]?.recipient ?? name;
|
|
23
60
|
const routes = new Map(heads.map((head) => [head.index, head.route]));
|
|
24
61
|
return facts.activities(heads.map((head) => head.index)).flatMap((item) => item.kind === 'say'
|
|
25
|
-
? [{ item, recipient
|
|
62
|
+
? [{ item, recipient, route: routes.get(item.index) }] : []);
|
|
26
63
|
}
|
|
27
64
|
export function capturePendingScan(facts) {
|
|
28
65
|
return { roster: facts.roster().filter((participant) => participant.joined), throughIndex: facts.header().lastActIndex };
|
|
@@ -53,23 +90,16 @@ export async function* pendingPages(artifact, scan, afterIndex = -1) {
|
|
|
53
90
|
/** A pass retains only its captured joins; routes and individual receipts are fresh. */
|
|
54
91
|
export function pendingFacts(facts, scan, heads) {
|
|
55
92
|
const joined = new Set(scan.roster.filter((participant) => sameJoin(facts, participant)).map((participant) => participant.name));
|
|
56
|
-
return {
|
|
93
|
+
return { pending: heads.filter((head) => joined.has(head.recipient)
|
|
57
94
|
&& pendingHead(facts, head.recipient, head.index) !== undefined) };
|
|
58
95
|
}
|
|
59
|
-
/** Global discovery alone
|
|
60
|
-
export async function collectPending(artifact
|
|
61
|
-
const { value:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}),
|
|
67
|
-
}));
|
|
68
|
-
const pending = [...initial.pending];
|
|
69
|
-
if (index === undefined)
|
|
70
|
-
for await (const page of pendingPages(artifact, initial.scan))
|
|
71
|
-
pending.push(...page);
|
|
72
|
-
const { value } = await artifact.read((facts) => ({ scan: initial.scan, ...pendingFacts(facts, initial.scan, pending) }));
|
|
96
|
+
/** Global discovery alone sweeps pendingAudience; exact dispatch uses pendingRecipients. */
|
|
97
|
+
export async function collectPending(artifact) {
|
|
98
|
+
const { value: scan } = await artifact.read(capturePendingScan);
|
|
99
|
+
const pending = [];
|
|
100
|
+
for await (const page of pendingPages(artifact, scan))
|
|
101
|
+
pending.push(...page);
|
|
102
|
+
const { value } = await artifact.read((facts) => ({ scan, ...pendingFacts(facts, scan, pending) }));
|
|
73
103
|
return value;
|
|
74
104
|
}
|
|
75
105
|
/** A live catch owns every matching notification, independent of its page size. */
|
package/dist/file-lock.d.ts
CHANGED
|
@@ -2,9 +2,16 @@ export interface FileLockOptions {
|
|
|
2
2
|
retryMs: number;
|
|
3
3
|
signal?: AbortSignal;
|
|
4
4
|
createParent?: boolean;
|
|
5
|
+
/** Optional discovery may skip a busy lock; ordinary lock users still wait. */
|
|
6
|
+
skipIfBusy?: boolean;
|
|
5
7
|
}
|
|
6
8
|
export declare class FileLockError extends Error {
|
|
7
9
|
readonly code: "not_a_database";
|
|
8
10
|
constructor(lockPath: string, cause?: unknown);
|
|
9
11
|
}
|
|
10
|
-
export declare function withFileLock<T>(lockPath: string, options: FileLockOptions
|
|
12
|
+
export declare function withFileLock<T>(lockPath: string, options: FileLockOptions & {
|
|
13
|
+
skipIfBusy: true;
|
|
14
|
+
}, fn: () => T | Promise<T>): Promise<T | undefined>;
|
|
15
|
+
export declare function withFileLock<T>(lockPath: string, options: FileLockOptions & {
|
|
16
|
+
skipIfBusy?: false;
|
|
17
|
+
}, fn: () => T | Promise<T>): Promise<T>;
|
package/dist/file-lock.js
CHANGED
package/dist/help.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const COMMANDS = [
|
|
2
2
|
{ names: ['help'], usage: 'help [command]', summary: 'Show the command index or help for one command.' },
|
|
3
3
|
{ names: ['version'], usage: 'version', summary: 'Print the installed version.', hiddenFromIndex: true },
|
|
4
|
-
{ names: ['mcp-server'], usage: 'mcp-server', summary: 'Start the MCP stdio server.', usesSquare: true, hiddenFromIndex: true, details: ['Set SQUARE_LOCATION or pass --location before the command.', 'Participant tools accept as on each call. Set the default with
|
|
4
|
+
{ names: ['mcp-server'], usage: 'mcp-server', summary: 'Start the MCP stdio server.', usesSquare: true, hiddenFromIndex: true, details: ['Set SQUARE_LOCATION or pass --location before the command.', 'Participant tools accept as on each call. Set the default with --as.', 'Session identity comes from request _meta.threadId (Codex) or _meta["ai.opencode/sessionID"] (OpenCode), falling back to the startup environment.'] },
|
|
5
5
|
{
|
|
6
6
|
names: ['build'], usage: 'build [--cap <N|unlimited>] [--template <name>] [--throttle N] [-f] < body.md', usesSquare: true, group: 'host',
|
|
7
7
|
summary: 'Create a square from Markdown on stdin.',
|
|
@@ -17,7 +17,7 @@ const COMMANDS = [
|
|
|
17
17
|
details: ['Options:', ' --last <N> Show the last N public activities (default 10, maximum 100).', ' --kick End the standing participant and reclaim the name for this session.'],
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
|
-
names: ['express'], usage: '--as <name> express [-f|--force] [--no-wait] [--mention <name>... | --bell] [--no-mention] [--reply <activity-id>] <activity |
|
|
20
|
+
names: ['express'], usage: '--as <name> express [-f|--force] [--no-wait] [--metadata <json>] [--mention <name>... | --bell] [--no-mention] [--reply <activity-id>] [<activity> | -]', usesSquare: true, group: 'participant',
|
|
21
21
|
summary: 'Speak, gesture, or do both.',
|
|
22
22
|
details: [
|
|
23
23
|
'Reach:',
|
|
@@ -32,6 +32,8 @@ const COMMANDS = [
|
|
|
32
32
|
'Options:',
|
|
33
33
|
' -f, --force Express without first catching unread activity or satisfying attention etiquette.',
|
|
34
34
|
' --no-wait If held or throttled, save a draft and return instead of waiting. A held wait gives up on its own after 10 minutes.',
|
|
35
|
+
' --metadata <json> Attach a bounded JSON object (at most 16 KiB UTF-8 and 256 nesting levels); it may be the only content.',
|
|
36
|
+
' Metadata is returned in structured activity results but is not shown in human text or searchable.',
|
|
35
37
|
],
|
|
36
38
|
},
|
|
37
39
|
{ names: ['listen'], usage: '--as <name> listen <participant>', usesSquare: true, group: 'participant', summary: 'Turn an ear toward one participant\'s future activity.' },
|
|
@@ -90,13 +92,8 @@ const COMMANDS = [
|
|
|
90
92
|
},
|
|
91
93
|
{
|
|
92
94
|
names: ['migrate'], usage: 'migrate', usesSquare: true, group: 'maintenance',
|
|
93
|
-
summary: 'Convert an existing version
|
|
94
|
-
details: ['For the selected .square artifact only.
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
names: ['ledger'], usage: 'ledger <verify|migrate|gc>', usesSquare: false, group: 'maintenance',
|
|
98
|
-
summary: 'Verify, convert, or reclaim the machine-local host ledger.',
|
|
99
|
-
details: ['verify: read-only SQLite integrity or full legacy readiness with accepted/ignored/rejected counts and source hashes; not-ready exits 2, an empty root stays empty. An older supported SQLite format requires explicit migration. Unsupported versions or invalid databases need diagnosis; migration is not a repair command.', 'migrate: stop agent sessions and MCP services using Square with this ledger first, then convert legacy NDJSON or upgrade supported SQLite version 1 in place. Keep them stopped, run square ledger verify afterward, then start them with the updated Square version. Sources, records, order and observer revisions are preserved; an existing current ledger is an untouched no-op.', 'gc [--dry-run]: reclaim old wake/presentation evidence only where the square artifact proves the recipient is closed — the activity reached them and catch receipted it or they later rejoined. Dispatching, lifecycle and unprovable rows are retained. Deleted rows free reusable pages, not file size (no VACUUM); retired Claude recognition tokens keep growing in total.', 'Run gc with --dry-run first: it reports eligible, retired, cas-miss and unreadable-artifact counts without writing. Eligible rows are candidates only: a changed record or an unusable Claude correlation is retained.', 'No participant or square location is required. Uses SQUARE_HOST_LEDGER_ROOT, then SQUARE_REGISTRY’s directory, then ~/.square/host-ledger.', 'These commands never stop, restart, install into or schedule hosts; conversion and schema upgrade are never automatic. No --force or repair.'],
|
|
95
|
+
summary: 'Convert an existing version 2 or 3 square to current format 4 in place.',
|
|
96
|
+
details: ['For the selected .square artifact only. Stop sessions using this artifact before conversion. Back up the stopped artifact, migrate it, then run square --location <path> doctor before starting updated clients.', 'A version 2 or 3 square is accepted; version 1, unrelated or unsupported artifacts are refused without a write. There is no --check, --backup or --force.'],
|
|
100
97
|
},
|
|
101
98
|
];
|
|
102
99
|
function definitionFor(command) {
|
|
@@ -109,7 +106,7 @@ export function renderGlobalHelp() {
|
|
|
109
106
|
const groups = [
|
|
110
107
|
{ key: 'participant', title: 'In the square:', order: ['join', 'express', 'listen', 'unlisten', 'ignore', 'listening', 'catch', 'history', 'status', 'hold', 'resume', 'done'] },
|
|
111
108
|
{ key: 'host', title: 'Prepare and manage:', order: ['build', 'list', 'participants'] },
|
|
112
|
-
{ key: 'maintenance', title: 'Setup:', order: ['install', 'uninstall', 'doctor', 'migrate'
|
|
109
|
+
{ key: 'maintenance', title: 'Setup:', order: ['install', 'uninstall', 'doctor', 'migrate'] },
|
|
113
110
|
];
|
|
114
111
|
const commandLines = groups.flatMap(({ key, title, order }) => [
|
|
115
112
|
title,
|
|
@@ -121,7 +118,7 @@ export function renderGlobalHelp() {
|
|
|
121
118
|
]);
|
|
122
119
|
return [
|
|
123
120
|
'Usage: square [--location <square>] [--as <name>] <command> [args...]',
|
|
124
|
-
'Environment: SQUARE_LOCATION sets the CLI location (local artifact path or stdio://name/key); square-accessing commands require it or --location.
|
|
121
|
+
'Environment: SQUARE_LOCATION sets the CLI location (local artifact path or stdio://name/key); square-accessing commands require it or --location. Use --as to select a participant.',
|
|
125
122
|
'Backends: SQUARE_BACKENDS_CONFIG selects {backends:{name:{command,args?,cwd?,env?}}}; default ~/.config/square/backends.json. See guides/backends.md.',
|
|
126
123
|
'CLI flags override environment values. Participants join explicitly; no square is joined automatically.',
|
|
127
124
|
'',
|
package/dist/inbox.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import type {
|
|
1
|
+
import { type Body, type LocatedSeat, type PendingMembership } from './model.js';
|
|
2
|
+
import type { SquareRead } from './ports.js';
|
|
3
3
|
export interface PendingWaitOptions {
|
|
4
4
|
signal?: AbortSignal;
|
|
5
5
|
/** Local delivery suppression, never persisted as evidence of receipt. */
|
|
@@ -8,7 +8,28 @@ export interface PendingWaitOptions {
|
|
|
8
8
|
skipImmediate?: boolean;
|
|
9
9
|
onChangeArmed?: (armed: boolean) => void;
|
|
10
10
|
}
|
|
11
|
-
export declare function
|
|
11
|
+
export declare function pendingKey(membership: LocatedSeat, actIndex: number): string;
|
|
12
|
+
export declare function pendingAtBoundary(inbox: readonly PendingMembership[]): PendingMembership[];
|
|
13
|
+
/** Revalidate a supplied batch immediately before the boundary's independent claim/send checks. */
|
|
14
|
+
export declare function projectBoundaryEligibility(inbox: readonly PendingMembership[]): Promise<PendingMembership[]>;
|
|
15
|
+
export interface SessionBindingCandidate {
|
|
16
|
+
readonly location: string;
|
|
17
|
+
readonly body: Body;
|
|
18
|
+
}
|
|
19
|
+
/** HOME is a candidate path index; current seats and delivery evidence live in the artifact. */
|
|
20
|
+
export declare function projectSessionCandidates(input: SessionSeatQuery): Promise<readonly SessionBindingCandidate[]>;
|
|
21
|
+
export interface SessionSeatQuery {
|
|
22
|
+
readonly body?: Body;
|
|
23
|
+
readonly sessionId?: string;
|
|
24
|
+
readonly channel?: string;
|
|
25
|
+
readonly agent?: string;
|
|
26
|
+
readonly location?: string;
|
|
27
|
+
readonly env?: NodeJS.ProcessEnv;
|
|
28
|
+
}
|
|
29
|
+
/** Lifecycle reads resolve seats and join times, never pending activity bodies. */
|
|
30
|
+
export declare function projectSessionSeats(input: SessionSeatQuery, signal?: AbortSignal): Promise<LocatedSeat[]>;
|
|
31
|
+
/** Public count boundary: one coherent read per artifact, without pending body hydration. */
|
|
32
|
+
export declare function sessionInboxCounts(input: SessionSeatQuery, signal?: AbortSignal): Promise<import('./square-facade.js').InboxMembershipSummary[]>;
|
|
12
33
|
export interface NativePendingPreview {
|
|
13
34
|
readonly payload: string;
|
|
14
35
|
readonly clipped: boolean;
|
|
@@ -18,7 +39,6 @@ export type NativePendingPreviewInput = {
|
|
|
18
39
|
readonly sessionId: string;
|
|
19
40
|
readonly participant: string;
|
|
20
41
|
readonly actIndex: number;
|
|
21
|
-
readonly epoch?: number;
|
|
22
42
|
readonly cancelledThrough?: number;
|
|
23
43
|
readonly now: number;
|
|
24
44
|
} & ({
|
|
@@ -32,14 +52,20 @@ export type NativePendingPreviewInput = {
|
|
|
32
52
|
readonly sessionId: string;
|
|
33
53
|
};
|
|
34
54
|
});
|
|
35
|
-
/** First matching
|
|
55
|
+
/** First matching current seat, exact body/generation/address and catch ownership. */
|
|
36
56
|
export declare function nativePendingPreview(facts: SquareRead, input: NativePendingPreviewInput): NativePendingPreview | undefined;
|
|
37
|
-
export
|
|
57
|
+
export interface SessionIdentityQuery {
|
|
58
|
+
readonly channel: string;
|
|
59
|
+
readonly session: string;
|
|
60
|
+
readonly allAgents?: true;
|
|
61
|
+
}
|
|
62
|
+
export type SessionIdentity = Body | SessionIdentityQuery;
|
|
63
|
+
export declare function sessionInbox(identity: SessionIdentity, env?: NodeJS.ProcessEnv, signal?: AbortSignal): Promise<PendingMembership[]>;
|
|
38
64
|
export interface SessionPendingObserver {
|
|
39
65
|
/** Read committed revisions before reusing content; filesystem hints are only for waiting. */
|
|
40
|
-
read(options?: Pick<PendingWaitOptions, 'signal' | 'excludeKeys'>): Promise<
|
|
41
|
-
wait(timeoutMs: number, options?: PendingWaitOptions): Promise<
|
|
66
|
+
read(options?: Pick<PendingWaitOptions, 'signal' | 'excludeKeys'>): Promise<PendingMembership[]>;
|
|
67
|
+
wait(timeoutMs: number, options?: PendingWaitOptions): Promise<PendingMembership[]>;
|
|
42
68
|
close(): void;
|
|
43
69
|
}
|
|
44
70
|
/** Session-scoped projection over process-shared storage change detectors. */
|
|
45
|
-
export declare function observeSessionPending(
|
|
71
|
+
export declare function observeSessionPending(identity: SessionIdentity, suppliedEnv?: NodeJS.ProcessEnv): Promise<SessionPendingObserver>;
|