@astrosheep/square 0.4.6 → 0.4.8
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/card-format.d.ts +2 -0
- package/dist/card-format.js +2 -0
- package/dist/claude-mcp-context.d.ts +0 -1
- package/dist/claude-mcp-context.js +0 -10
- package/dist/claude-mod.d.ts +2 -0
- package/dist/claude-mod.js +211 -0
- package/dist/cli/context.d.ts +2 -2
- package/dist/cli/context.js +14 -16
- package/dist/cli/express-presentation.js +12 -53
- package/dist/cli/json.js +2 -2
- package/dist/cli/observation-commands.d.ts +2 -7
- package/dist/cli/observation-commands.js +31 -97
- package/dist/cli/registry.js +3 -6
- package/dist/cli/square-commands.d.ts +2 -3
- package/dist/cli/square-commands.js +12 -22
- package/dist/decisions.js +5 -4
- package/dist/harness-claude.js +3 -3
- package/dist/help.js +9 -16
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp.d.ts +1 -0
- package/dist/mcp.js +7 -18
- package/dist/model.d.ts +1 -1
- package/dist/neutral.d.ts +15 -3
- package/dist/notifications.d.ts +1 -3
- package/dist/notifications.js +21 -23
- package/dist/operation-control.d.ts +0 -1
- package/dist/operation-control.js +0 -11
- package/dist/operation-presentation.d.ts +28 -21
- package/dist/operation-presentation.js +90 -87
- package/dist/packages/agent-delivery/src/index.d.ts +4 -9
- package/dist/packages/agent-delivery/src/index.js +0 -9
- package/dist/packages/agent-delivery/src/local-endpoint.d.ts +2 -12
- package/dist/packages/agent-delivery/src/local-endpoint.js +4 -48
- package/dist/packages/agent-delivery/src/pi-client.js +0 -2
- package/dist/packages/agent-delivery/src/types.d.ts +3 -37
- package/dist/participant-identity.d.ts +0 -2
- package/dist/participant-identity.js +0 -13
- package/dist/plugins/paseo/shared/card-format.d.ts +6 -0
- package/dist/plugins/paseo/shared/card-format.js +38 -0
- package/dist/plugins/paseo/shared/card-presentation.d.ts +3 -1
- package/dist/plugins/paseo/shared/card-presentation.js +3 -1
- package/dist/presentation.d.ts +5 -22
- package/dist/presentation.js +25 -58
- package/dist/runtime.d.ts +6 -6
- package/dist/runtime.js +5 -15
- package/dist/sqlite-square.d.ts +4 -5
- package/dist/sqlite-square.js +29 -32
- package/dist/square-api.d.ts +1 -1
- package/dist/square-api.js +1 -1
- package/dist/square-facade.d.ts +5 -14
- package/dist/square-location.d.ts +0 -1
- package/dist/square-posting.d.ts +4 -4
- package/dist/square-posting.js +14 -16
- package/dist/square-tools.d.ts +4 -17
- package/dist/square-tools.js +52 -119
- package/dist/square-values.d.ts +1 -1
- package/dist/square-values.js +1 -1
- package/dist/time.d.ts +1 -0
- package/dist/time.js +10 -0
- package/dist/views.d.ts +1 -1
- package/dist/views.js +2 -2
- package/dist/wake-transports.d.ts +2 -2
- package/dist/wake-transports.js +7 -9
- package/dist/wakes.js +1 -1
- package/examples/symmetric-domains.mjs +1 -2
- package/guides/catch-cold-path-optimization.md +1 -1
- package/guides/claude-native.md +37 -7
- package/guides/delivery-primitives.md +2 -1
- package/guides/mcp.md +3 -3
- package/guides/pi-native-delivery.md +10 -2
- package/guides/pi-tools.md +1 -3
- package/guides/row-storage-design.md +1 -1
- package/package.json +1 -1
- package/plugins/claude/.claude-plugin/plugin.json +3 -2
- package/plugins/claude/README.md +9 -0
- package/plugins/claude/hooks/hooks.json +1 -9
- package/plugins/claude/hooks/register.js +178 -0
- package/plugins/claude/skills/square/SKILL.md +2 -2
- package/plugins/codex/.codex-plugin/plugin.json +1 -1
- package/plugins/paseo/OVERVIEW.md +1 -1
- package/plugins/paseo/README.md +20 -23
- package/plugins/paseo/client/markdown.tsx +88 -95
- package/plugins/paseo/client/palette.ts +37 -12
- package/plugins/paseo/client/square-message.tsx +52 -76
- package/plugins/paseo/client/transform.ts +4 -6
- package/plugins/paseo/shared/card-format.ts +37 -0
- package/plugins/paseo/shared/card-presentation.ts +6 -2
- package/plugins/paseo/shared/message.ts +1 -6
- package/plugins/pi/square-pi.js +76 -60
- package/skills/square/SKILL.md +2 -2
- package/dist/claude-boundary-state.d.ts +0 -20
- package/dist/claude-boundary-state.js +0 -84
- package/dist/claude-hook.d.ts +0 -2
- package/dist/claude-hook.js +0 -232
- package/dist/packages/agent-delivery/src/claude-auth.d.ts +0 -13
- package/dist/packages/agent-delivery/src/claude-auth.js +0 -75
- package/dist/packages/agent-delivery/src/claude-native.d.ts +0 -30
- package/dist/packages/agent-delivery/src/claude-native.js +0 -75
- package/dist/packages/agent-delivery/src/claude.d.ts +0 -5
- package/dist/packages/agent-delivery/src/claude.js +0 -66
|
@@ -1,35 +1,20 @@
|
|
|
1
1
|
import net from 'node:net';
|
|
2
2
|
import { resolve } from 'node:path';
|
|
3
|
-
/**
|
|
4
|
-
const PIPE = /^[\\/]{2}[.?][\\/]pipe[\\/](?:(LOCAL)[\\/])?([^\\/]+)$/i;
|
|
5
|
-
/**
|
|
6
|
-
* A local endpoint is either a Windows named pipe or an absolute Unix socket
|
|
7
|
-
* path. There is no `stat().isSocket()` check: connecting is the existence check.
|
|
8
|
-
*/
|
|
3
|
+
/** An absolute Unix socket path; connecting is the existence check. */
|
|
9
4
|
export function parseLocalEndpoint(raw) {
|
|
10
|
-
if (typeof raw !== 'string' || raw.includes('\0'))
|
|
11
|
-
throw new Error('Invalid local endpoint.');
|
|
12
|
-
const pipe = PIPE.exec(raw);
|
|
13
|
-
if (pipe) {
|
|
14
|
-
const canonical = `\\\\.\\pipe\\${pipe[2].toLowerCase()}`;
|
|
15
|
-
return { kind: 'pipe', path: canonical, canonical };
|
|
16
|
-
}
|
|
17
|
-
if (!(process.platform === 'win32' ? /^[A-Za-z]:[\\/]/.test(raw) : raw.startsWith('/')))
|
|
5
|
+
if (typeof raw !== 'string' || raw.includes('\0') || !raw.startsWith('/'))
|
|
18
6
|
throw new Error('Invalid local endpoint.');
|
|
19
7
|
const limit = process.platform === 'darwin' ? 103 : process.platform === 'linux' ? 107 : undefined;
|
|
20
8
|
if (limit !== undefined && Buffer.byteLength(raw) > limit)
|
|
21
9
|
throw new Error('Invalid local endpoint.');
|
|
22
|
-
|
|
23
|
-
return { kind: 'unix', path: canonical, canonical };
|
|
10
|
+
return { path: resolve(raw) };
|
|
24
11
|
}
|
|
25
12
|
export class LocalEndpointError extends Error {
|
|
26
13
|
code;
|
|
27
|
-
|
|
28
|
-
constructor(code, maybeDelivered = false) {
|
|
14
|
+
constructor(code) {
|
|
29
15
|
super(code);
|
|
30
16
|
this.name = 'LocalEndpointError';
|
|
31
17
|
this.code = code;
|
|
32
|
-
this.maybeDelivered = maybeDelivered;
|
|
33
18
|
}
|
|
34
19
|
}
|
|
35
20
|
function errnoCode(error) {
|
|
@@ -83,32 +68,3 @@ export function connectLocal(endpoint, scope = {}) {
|
|
|
83
68
|
}
|
|
84
69
|
});
|
|
85
70
|
}
|
|
86
|
-
/** LF-delimited JSON frames. Any failure here is past the uncertainty boundary. */
|
|
87
|
-
export function writeFrames(socket, frames) {
|
|
88
|
-
const payload = frames.map((frame) => JSON.stringify(frame)).join('\n') + '\n';
|
|
89
|
-
return new Promise((resolveWrite, reject) => {
|
|
90
|
-
let settled = false;
|
|
91
|
-
// Error/close handlers stay attached past settling, so a later I/O failure is
|
|
92
|
-
// swallowed here instead of surfacing as an unhandled socket event.
|
|
93
|
-
const finish = (error) => {
|
|
94
|
-
if (settled)
|
|
95
|
-
return;
|
|
96
|
-
settled = true;
|
|
97
|
-
if (error) {
|
|
98
|
-
reject(error);
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
resolveWrite();
|
|
102
|
-
};
|
|
103
|
-
const failed = (error) => finish(new LocalEndpointError(errnoCode(error), true));
|
|
104
|
-
socket.once('error', failed);
|
|
105
|
-
socket.once('close', () => finish(new LocalEndpointError('transport', true)));
|
|
106
|
-
socket.end(payload, 'utf8', (error) => {
|
|
107
|
-
if (error) {
|
|
108
|
-
failed(error);
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
finish();
|
|
112
|
-
});
|
|
113
|
-
});
|
|
114
|
-
}
|
|
@@ -55,8 +55,6 @@ export async function connectPi(options) {
|
|
|
55
55
|
}
|
|
56
56
|
if (process.platform !== 'darwin')
|
|
57
57
|
throw new ConnectionError('unsupported_platform');
|
|
58
|
-
if (endpoint.kind !== 'unix')
|
|
59
|
-
throw new ConnectionError('invalid_arguments');
|
|
60
58
|
const answer = await request(endpoint, { protocol: VERSION, harness: 'pi', op: 'hello', sessionId: options.sessionId }, options.timeoutMs, options.signal);
|
|
61
59
|
if (answer.code !== undefined)
|
|
62
60
|
throw new ConnectionError(answer.code === 'transport' ? 'service_unavailable' : answer.code);
|
|
@@ -5,11 +5,6 @@ export interface OpenCodeTarget {
|
|
|
5
5
|
readonly sessionId: string;
|
|
6
6
|
readonly [targetBrand]: true;
|
|
7
7
|
}
|
|
8
|
-
export interface ClaudeTarget {
|
|
9
|
-
readonly harness: 'claude';
|
|
10
|
-
readonly sessionId: string;
|
|
11
|
-
readonly [targetBrand]: true;
|
|
12
|
-
}
|
|
13
8
|
export interface PiTarget {
|
|
14
9
|
readonly harness: 'pi';
|
|
15
10
|
readonly sessionId: string;
|
|
@@ -25,7 +20,7 @@ export interface CodexTarget {
|
|
|
25
20
|
readonly sessionId: string;
|
|
26
21
|
readonly [targetBrand]: true;
|
|
27
22
|
}
|
|
28
|
-
export type Target = OpenCodeTarget |
|
|
23
|
+
export type Target = OpenCodeTarget | PiTarget | PaseoTarget | CodexTarget;
|
|
29
24
|
export type Delivery = 'steer' | 'queue';
|
|
30
25
|
export interface OpenCodeSendTextOptions {
|
|
31
26
|
readonly delivery?: Delivery;
|
|
@@ -33,12 +28,6 @@ export interface OpenCodeSendTextOptions {
|
|
|
33
28
|
readonly timeoutMs?: number;
|
|
34
29
|
readonly signal?: AbortSignal;
|
|
35
30
|
}
|
|
36
|
-
export interface ClaudeSendTextOptions {
|
|
37
|
-
readonly delivery?: 'steer';
|
|
38
|
-
readonly inputId?: never;
|
|
39
|
-
readonly timeoutMs?: number;
|
|
40
|
-
readonly signal?: AbortSignal;
|
|
41
|
-
}
|
|
42
31
|
export interface PiSendTextOptions {
|
|
43
32
|
readonly delivery?: Delivery;
|
|
44
33
|
readonly inputId?: never;
|
|
@@ -58,7 +47,7 @@ export interface CodexSendTextOptions {
|
|
|
58
47
|
readonly timeoutMs?: number;
|
|
59
48
|
readonly signal?: AbortSignal;
|
|
60
49
|
}
|
|
61
|
-
export type SendTextOptions = OpenCodeSendTextOptions |
|
|
50
|
+
export type SendTextOptions = OpenCodeSendTextOptions | PiSendTextOptions | PaseoSendTextOptions | CodexSendTextOptions;
|
|
62
51
|
export interface OpenCodeConnectOptions {
|
|
63
52
|
readonly harness: 'opencode';
|
|
64
53
|
readonly sessionId: string;
|
|
@@ -74,15 +63,6 @@ export interface OpenCodeConnectOptions {
|
|
|
74
63
|
readonly timeoutMs?: number;
|
|
75
64
|
readonly signal?: AbortSignal;
|
|
76
65
|
}
|
|
77
|
-
export interface ClaudeConnectOptions {
|
|
78
|
-
readonly harness: 'claude';
|
|
79
|
-
readonly sessionId: string;
|
|
80
|
-
readonly endpoint: string;
|
|
81
|
-
readonly token?: string;
|
|
82
|
-
readonly claudeHome?: string;
|
|
83
|
-
readonly timeoutMs?: number;
|
|
84
|
-
readonly signal?: AbortSignal;
|
|
85
|
-
}
|
|
86
66
|
export interface PiConnectOptions {
|
|
87
67
|
readonly harness: 'pi';
|
|
88
68
|
readonly sessionId: string;
|
|
@@ -147,20 +127,6 @@ export type OpenCodeDeliveryResult = (OpenCodeAttempt & {
|
|
|
147
127
|
readonly state: 'unavailable';
|
|
148
128
|
readonly code: 'aborted' | 'timeout';
|
|
149
129
|
});
|
|
150
|
-
interface ClaudeAttempt {
|
|
151
|
-
readonly harness: 'claude';
|
|
152
|
-
readonly sessionId: string;
|
|
153
|
-
}
|
|
154
|
-
export type ClaudeDeliveryResult = (ClaudeAttempt & {
|
|
155
|
-
readonly state: 'written';
|
|
156
|
-
readonly messageId: string;
|
|
157
|
-
}) | (ClaudeAttempt & {
|
|
158
|
-
readonly state: 'unknown';
|
|
159
|
-
readonly code: 'timeout' | 'aborted' | 'transport';
|
|
160
|
-
}) | (ClaudeAttempt & {
|
|
161
|
-
readonly state: 'unavailable';
|
|
162
|
-
readonly code: 'aborted' | 'timeout' | 'endpoint_unavailable' | 'authentication_failed';
|
|
163
|
-
});
|
|
164
130
|
interface PiAttempt {
|
|
165
131
|
readonly harness: 'pi';
|
|
166
132
|
readonly sessionId: string;
|
|
@@ -214,5 +180,5 @@ export type CodexDeliveryResult = (CodexAttempt & {
|
|
|
214
180
|
readonly state: 'rejected';
|
|
215
181
|
readonly code: 'not_found' | 'refused' | 'unsupported_version';
|
|
216
182
|
});
|
|
217
|
-
export type DeliveryResult = OpenCodeDeliveryResult |
|
|
183
|
+
export type DeliveryResult = OpenCodeDeliveryResult | PiDeliveryResult | PaseoDeliveryResult | CodexDeliveryResult;
|
|
218
184
|
export {};
|
|
@@ -14,8 +14,6 @@ export interface HarnessSessionSource {
|
|
|
14
14
|
readonly childVariable?: 'CLAUDE_CODE_CHILD_SESSION';
|
|
15
15
|
}
|
|
16
16
|
export declare const harnessSessionSources: readonly HarnessSessionSource[];
|
|
17
|
-
/** Scope a native call without changing the harness-owned process environment. */
|
|
18
|
-
export declare function operationEnv(provider: AutomaticProvider, sessionId: string, env: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
19
17
|
/** Raw nonempty harness session ids in table order. Duplicates are preserved, never collapsed. */
|
|
20
18
|
export declare function sessionIdsFromEnvironment(env?: NodeJS.ProcessEnv): readonly string[];
|
|
21
19
|
/** The first nonempty harness coordinate in table order, or undefined when none is set. */
|
|
@@ -8,19 +8,6 @@ export const harnessSessionSources = [
|
|
|
8
8
|
{ variable: 'PI_SESSION_ID', channel: 'pi', provider: 'pi' },
|
|
9
9
|
{ variable: 'PASEO_AGENT_ID', channel: 'paseo' },
|
|
10
10
|
];
|
|
11
|
-
/** Scope a native call without changing the harness-owned process environment. */
|
|
12
|
-
export function operationEnv(provider, sessionId, env) {
|
|
13
|
-
const scoped = { ...env };
|
|
14
|
-
// Clear other native coordinates (and the Claude child flag); PASEO_AGENT_ID stays as it is.
|
|
15
|
-
for (const source of harnessSessionSources) {
|
|
16
|
-
if (source.provider === undefined)
|
|
17
|
-
continue;
|
|
18
|
-
scoped[source.variable] = source.provider === provider ? sessionId : '';
|
|
19
|
-
if (source.childVariable !== undefined)
|
|
20
|
-
scoped[source.childVariable] = '';
|
|
21
|
-
}
|
|
22
|
-
return scoped;
|
|
23
|
-
}
|
|
24
11
|
/** Raw nonempty harness session ids in table order. Duplicates are preserved, never collapsed. */
|
|
25
12
|
export function sessionIdsFromEnvironment(env = process.env) {
|
|
26
13
|
return harnessSessionSources
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CardPresentation } from "./card-presentation.ts";
|
|
2
|
+
export declare function reachLabel(reach?: CardPresentation["reach"]): string | undefined;
|
|
3
|
+
/** Calendar days, rather than elapsed hours, keep yesterday correct across DST. */
|
|
4
|
+
export declare function timeLabel(at: number, now?: number, compact?: boolean): string;
|
|
5
|
+
/** Only adjacent references from the same origin can form a range. */
|
|
6
|
+
export declare function cardReferences(items: readonly CardPresentation[], originLabel?: (origin: string) => string): string;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export function reachLabel(reach) {
|
|
2
|
+
return reach === "mention" ? "@you" : reach === "attention" ? undefined : reach;
|
|
3
|
+
}
|
|
4
|
+
/** Calendar days, rather than elapsed hours, keep yesterday correct across DST. */
|
|
5
|
+
export function timeLabel(at, now = Date.now(), compact = false) {
|
|
6
|
+
const date = new Date(at), today = new Date(now);
|
|
7
|
+
const day = (value) => `${value.getFullYear()}-${value.getMonth()}-${value.getDate()}`;
|
|
8
|
+
const clock = `${String(date.getHours()).padStart(2, "0")}:${String(date.getMinutes()).padStart(2, "0")}`;
|
|
9
|
+
if (day(date) === day(today))
|
|
10
|
+
return clock;
|
|
11
|
+
const yesterday = new Date(today);
|
|
12
|
+
yesterday.setDate(today.getDate() - 1);
|
|
13
|
+
if (day(date) === day(yesterday))
|
|
14
|
+
return `${compact ? "yest" : "yesterday"} ${clock}`;
|
|
15
|
+
const shortDate = compact
|
|
16
|
+
? `${String(date.getMonth() + 1).padStart(2, "0")}/${String(date.getDate()).padStart(2, "0")}`
|
|
17
|
+
: date.toLocaleDateString("en-US", { month: "short", day: "numeric" });
|
|
18
|
+
return `${shortDate} ${clock}`;
|
|
19
|
+
}
|
|
20
|
+
/** Only adjacent references from the same origin can form a range. */
|
|
21
|
+
export function cardReferences(items, originLabel = origin => origin) {
|
|
22
|
+
const multipleOrigins = new Set(items.map(item => item.origin)).size > 1;
|
|
23
|
+
const runs = [];
|
|
24
|
+
for (const item of items) {
|
|
25
|
+
if (item.ref === undefined)
|
|
26
|
+
continue;
|
|
27
|
+
const match = /^act\/(\d+)$/.exec(item.ref);
|
|
28
|
+
const index = match ? Number(match[1]) : undefined;
|
|
29
|
+
const previous = runs.at(-1);
|
|
30
|
+
if (index !== undefined && previous?.origin === item.origin && previous.last !== undefined && previous.last + 1 === index) {
|
|
31
|
+
previous.last = index;
|
|
32
|
+
}
|
|
33
|
+
else
|
|
34
|
+
runs.push({ origin: item.origin, ref: item.ref, first: index, last: index });
|
|
35
|
+
}
|
|
36
|
+
return runs.map(run => `${multipleOrigins ? `${originLabel(run.origin)} ` : ""}${run.first !== run.last
|
|
37
|
+
? `act/${run.first}–${run.last}` : run.ref}`).join(", ");
|
|
38
|
+
}
|
|
@@ -4,7 +4,9 @@ export type CardPresentation = {
|
|
|
4
4
|
readonly origin: string;
|
|
5
5
|
readonly author?: string;
|
|
6
6
|
readonly ref?: string;
|
|
7
|
-
|
|
7
|
+
/** Absent on cards produced before landing time and reach were recorded. */
|
|
8
|
+
readonly at?: number;
|
|
9
|
+
readonly reach?: 'mention' | 'reply' | 'attention' | 'bell';
|
|
8
10
|
readonly body: string;
|
|
9
11
|
};
|
|
10
12
|
export declare function isCardPresentation(value: unknown): value is CardPresentation;
|
|
@@ -3,5 +3,7 @@ export function isCardPresentation(value) {
|
|
|
3
3
|
return false;
|
|
4
4
|
const item = value;
|
|
5
5
|
return item.kind === 'presentation' && typeof item.origin === 'string' && typeof item.body === 'string'
|
|
6
|
-
&&
|
|
6
|
+
&& (item.at === undefined || (typeof item.at === 'number' && Number.isFinite(item.at)))
|
|
7
|
+
&& (item.reach === undefined || ['mention', 'reply', 'attention', 'bell'].includes(item.reach))
|
|
8
|
+
&& ['author', 'ref'].every(key => item[key] === undefined || typeof item[key] === 'string');
|
|
7
9
|
}
|
package/dist/presentation.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { type HydratedAct, type RoomChangeAct } from './model.js';
|
|
|
2
2
|
export { participantIdentity } from './participant-identity.js';
|
|
3
3
|
import { type Perception } from './square-core.js';
|
|
4
4
|
import type { Activity, UnreadActivitySummary, ParticipantSummary } from './square-facade.js';
|
|
5
|
+
export type PresentationSurface = 'cli' | 'tool';
|
|
6
|
+
export declare function formatToolAction(tool: string, args?: Readonly<Record<string, unknown>>): string;
|
|
5
7
|
export type WatchStatus = 'idle' | 'drained' | 'quorum' | 'capped';
|
|
6
8
|
interface HeaderOptions {
|
|
7
9
|
participantCount?: number;
|
|
@@ -9,31 +11,16 @@ interface HeaderOptions {
|
|
|
9
11
|
plain?: boolean;
|
|
10
12
|
}
|
|
11
13
|
interface ParticipantOutputOptions {
|
|
14
|
+
surface?: PresentationSurface;
|
|
12
15
|
owner?: string;
|
|
13
16
|
squarePath: string;
|
|
14
17
|
name: string;
|
|
15
18
|
participantCount?: number;
|
|
16
19
|
}
|
|
17
|
-
interface ActivityLimitOptions extends ParticipantOutputOptions {
|
|
18
|
-
count?: number;
|
|
19
|
-
hardCap?: number;
|
|
20
|
-
draftPath?: string;
|
|
21
|
-
}
|
|
22
|
-
interface ActivityBlockedOptions extends ParticipantOutputOptions {
|
|
23
|
-
retryCommand: string;
|
|
24
|
-
activitySummaries: readonly UnreadActivitySummary[];
|
|
25
|
-
draftPath?: string;
|
|
26
|
-
}
|
|
27
20
|
interface ExpressWaitingOptions {
|
|
28
21
|
reason: 'throttled';
|
|
29
22
|
delayMs?: number;
|
|
30
23
|
}
|
|
31
|
-
interface ExpressNoWaitOptions extends ParticipantOutputOptions {
|
|
32
|
-
reason: 'throttled';
|
|
33
|
-
retryCommand: string;
|
|
34
|
-
delayMs?: number;
|
|
35
|
-
draftPath?: string;
|
|
36
|
-
}
|
|
37
24
|
interface WatchStatusOptions extends ParticipantOutputOptions {
|
|
38
25
|
status: WatchStatus;
|
|
39
26
|
idleMs?: number;
|
|
@@ -51,7 +38,6 @@ export declare function withPathOutput(squarePath: string, body?: string, opts?:
|
|
|
51
38
|
export declare function formatRefusal(squarePath: string, bodyLines: string[], opts?: {
|
|
52
39
|
participantCount?: number;
|
|
53
40
|
}): string;
|
|
54
|
-
export declare function refusalText(error: unknown): string;
|
|
55
41
|
export declare function quoteShell(value: string): string;
|
|
56
42
|
export declare function commandPrefix(squarePath: string): string;
|
|
57
43
|
export declare function participantCommandPrefix(squarePath: string, name: string, owner?: string): string;
|
|
@@ -59,7 +45,6 @@ export declare function participantCommandPrefix(squarePath: string, name: strin
|
|
|
59
45
|
export declare function joinRecoveryCommand(squarePath: string, name: string, owner?: string): string;
|
|
60
46
|
/** Taking a name is an explicit recovery choice, never an automatic retry. */
|
|
61
47
|
export declare function takeoverRecoveryLines(squarePath: string, name: string, owner?: string): string[];
|
|
62
|
-
export declare function participantsRecoveryCommand(squarePath: string): string;
|
|
63
48
|
export declare function renderPresenceLines(recent: readonly ParticipantSummary[], now: number, limit?: number): string[];
|
|
64
49
|
export declare function truncateChars(body: string, maxChars: number): {
|
|
65
50
|
text: string;
|
|
@@ -91,7 +76,7 @@ export declare function renderAmbientEvent(event: HydratedAct | Activity, viewer
|
|
|
91
76
|
mention?: string;
|
|
92
77
|
perception?: Perception;
|
|
93
78
|
}): string;
|
|
94
|
-
export declare function
|
|
79
|
+
export declare function renderUnreadSummary(activitySummaries: readonly UnreadActivitySummary[]): string[];
|
|
95
80
|
/** An indeterminate or already-committed send only points to inspection, never resend. */
|
|
96
81
|
export declare function renderActivityUncertain(opts: ParticipantOutputOptions & {
|
|
97
82
|
draftPath: string;
|
|
@@ -99,10 +84,8 @@ export declare function renderActivityUncertain(opts: ParticipantOutputOptions &
|
|
|
99
84
|
detail?: string;
|
|
100
85
|
}): string;
|
|
101
86
|
export declare function renderExpressWaiting(opts: ExpressWaitingOptions): string;
|
|
102
|
-
export declare function renderExpressNoWait(opts: ExpressNoWaitOptions): string;
|
|
103
87
|
export declare function renderPresenceAnchor(names: readonly string[]): string;
|
|
104
|
-
export declare function renderGrepActivitiesView(visible: readonly HydratedAct[], totalMatches: number,
|
|
105
|
-
export declare function renderActivityLimit(opts: ActivityLimitOptions): string;
|
|
88
|
+
export declare function renderGrepActivitiesView(visible: readonly HydratedAct[], totalMatches: number, full: boolean | undefined, squarePath: string, pattern: string, fixed?: boolean, perception?: (act: HydratedAct) => Perception, surface?: PresentationSurface): string;
|
|
106
89
|
export declare function renderWatchAlreadyActive(opts: ParticipantOutputOptions): string;
|
|
107
90
|
export declare function renderWatchForceTakeover(_opts: ParticipantOutputOptions): string;
|
|
108
91
|
export declare function renderWatchReplaceMissing(_opts: ParticipantOutputOptions): string;
|
package/dist/presentation.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { sameName
|
|
1
|
+
import { sameName } from './model.js';
|
|
2
2
|
import fs from 'node:fs';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { participantIdentity } from './participant-identity.js';
|
|
@@ -7,6 +7,10 @@ import { formatActivityId, MAX_IDENTITY_SET_SIZE } from './square-core.js';
|
|
|
7
7
|
import { formatDuration, formatRelativeTime, formatTimestamp } from './time.js';
|
|
8
8
|
import { grepSnippet } from './search.js';
|
|
9
9
|
import { style } from './tty-style.js';
|
|
10
|
+
export function formatToolAction(tool, args = {}) {
|
|
11
|
+
const clean = Object.fromEntries(Object.entries(args).filter(([, value]) => value !== undefined));
|
|
12
|
+
return Object.keys(clean).length === 0 ? tool : `${tool} ${JSON.stringify(clean)}`;
|
|
13
|
+
}
|
|
10
14
|
export function displayPath(squarePath, cwd = process.cwd()) {
|
|
11
15
|
if (/^[A-Za-z][A-Za-z0-9+.-]*:/.test(squarePath))
|
|
12
16
|
return squarePath;
|
|
@@ -37,11 +41,6 @@ export function formatRefusal(squarePath, bodyLines, opts = {}) {
|
|
|
37
41
|
return body === '' ? '' : `${body}\n`;
|
|
38
42
|
return withPathOutput(squarePath, body, { ...opts, plain: true });
|
|
39
43
|
}
|
|
40
|
-
export function refusalText(error) {
|
|
41
|
-
const text = error instanceof Error ? error.message : String(error);
|
|
42
|
-
const marked = isSquareError(error) && ['never_joined', 'not_standing'].includes(error.facts?.reason ?? '');
|
|
43
|
-
return marked ? text.split('\n').map((line) => `✕ ${line}`).join('\n') : text;
|
|
44
|
-
}
|
|
45
44
|
export function quoteShell(value) {
|
|
46
45
|
return `'${value.replace(/'/g, `'\\''`)}'`;
|
|
47
46
|
}
|
|
@@ -58,13 +57,10 @@ export function joinRecoveryCommand(squarePath, name, owner) {
|
|
|
58
57
|
/** Taking a name is an explicit recovery choice, never an automatic retry. */
|
|
59
58
|
export function takeoverRecoveryLines(squarePath, name, owner) {
|
|
60
59
|
return [
|
|
61
|
-
'If this is your name to reclaim, --
|
|
62
|
-
`${participantCommandPrefix(squarePath, name, owner)} join --
|
|
60
|
+
'If this is your name to reclaim, --takeover banishes the one standing here so you can step in:',
|
|
61
|
+
`${participantCommandPrefix(squarePath, name, owner)} join --takeover`,
|
|
63
62
|
];
|
|
64
63
|
}
|
|
65
|
-
export function participantsRecoveryCommand(squarePath) {
|
|
66
|
-
return `${commandPrefix(squarePath)} participants`;
|
|
67
|
-
}
|
|
68
64
|
function formatAge(ms) {
|
|
69
65
|
if (ms === undefined)
|
|
70
66
|
return '(none)';
|
|
@@ -218,17 +214,14 @@ export function renderAmbientEvent(event, viewer, opts = {}) {
|
|
|
218
214
|
function draftSavedLines(draftPath) {
|
|
219
215
|
return draftPath === undefined ? [] : [style('dim', `· draft kept: ${draftPath}`)];
|
|
220
216
|
}
|
|
221
|
-
function
|
|
222
|
-
return draftPath === undefined ? command : `${command} < ${quoteShell(draftPath)}`;
|
|
223
|
-
}
|
|
224
|
-
function renderUnreadSummary(activitySummaries) {
|
|
217
|
+
export function renderUnreadSummary(activitySummaries) {
|
|
225
218
|
const visibleSummaries = activitySummaries.slice(0, MAX_IDENTITY_SET_SIZE);
|
|
226
219
|
const remainingSummaries = activitySummaries.length - visibleSummaries.length;
|
|
227
220
|
return [
|
|
228
221
|
...visibleSummaries.map((item) => {
|
|
229
222
|
const compact = (item.preview.body ?? '').replace(/\s+/g, ' ').trim();
|
|
230
223
|
const bodyPreview = compact === ''
|
|
231
|
-
? { text: item.preview.
|
|
224
|
+
? { text: item.preview.structured ? '(structured activity)' : '(empty)', remaining: 0 }
|
|
232
225
|
: truncateChars(compact, UNREAD_PREVIEW_CHARS);
|
|
233
226
|
const bodyText = bodyPreview.remaining === 0 ? bodyPreview.text : `${bodyPreview.text}${style('dim', `… (+${bodyPreview.remaining} chars)`)}`;
|
|
234
227
|
return style('dim', ` · ${participantIdentity(item.name)} spoke — ${formatAge(item.latestActivityAgeMs)} ago · "${bodyText}"`);
|
|
@@ -236,17 +229,6 @@ function renderUnreadSummary(activitySummaries) {
|
|
|
236
229
|
...(remainingSummaries === 0 ? [] : [style('dim', ` · ${remainingSummaries} more participants have unread activity`)]),
|
|
237
230
|
];
|
|
238
231
|
}
|
|
239
|
-
export function renderActivityBlocked(opts) {
|
|
240
|
-
const readNowCommand = `${participantCommandPrefix(opts.squarePath, opts.name, opts.owner)} perceive`;
|
|
241
|
-
return withPathOutput(opts.squarePath, [
|
|
242
|
-
`${style('blocked', '✕')} your activity hasn't landed — someone spoke while you were away`,
|
|
243
|
-
...renderUnreadSummary(opts.activitySummaries),
|
|
244
|
-
...draftSavedLines(opts.draftPath),
|
|
245
|
-
`${readNowCommand}`,
|
|
246
|
-
' · take it in, then retry:',
|
|
247
|
-
withDraftInput(opts.retryCommand, opts.draftPath),
|
|
248
|
-
].join('\n'), { participantCount: opts.participantCount });
|
|
249
|
-
}
|
|
250
232
|
/** An indeterminate or already-committed send only points to inspection, never resend. */
|
|
251
233
|
export function renderActivityUncertain(opts) {
|
|
252
234
|
return formatRefusal(opts.squarePath, [
|
|
@@ -256,7 +238,7 @@ export function renderActivityUncertain(opts) {
|
|
|
256
238
|
...(opts.detail === undefined ? [] : [` · ${truncateExternalDiagnostic(opts.detail)}`]),
|
|
257
239
|
...draftSavedLines(opts.draftPath),
|
|
258
240
|
' · the draft is a saved copy; sending it again could repeat your activity',
|
|
259
|
-
`${commandPrefix(opts.squarePath)} history${opts.landedId === undefined ? ' --limit 10' : ` --at ${opts.landedId}`} --
|
|
241
|
+
`${commandPrefix(opts.squarePath)} history${opts.landedId === undefined ? ' --limit 10' : ` --at ${opts.landedId}`} --full`,
|
|
260
242
|
], opts);
|
|
261
243
|
}
|
|
262
244
|
export function renderExpressWaiting(opts) {
|
|
@@ -266,16 +248,6 @@ export function renderExpressWaiting(opts) {
|
|
|
266
248
|
' · --no-wait saves a draft and returns now',
|
|
267
249
|
].join('\n');
|
|
268
250
|
}
|
|
269
|
-
export function renderExpressNoWait(opts) {
|
|
270
|
-
const retryCommand = opts.retryCommand;
|
|
271
|
-
const lines = [
|
|
272
|
-
`${style('blocked', '✕')} the square is packed — shoulder to shoulder`,
|
|
273
|
-
` · a lull opens in ${formatDuration(opts.delayMs)}`,
|
|
274
|
-
...draftSavedLines(opts.draftPath),
|
|
275
|
-
`${withDraftInput(retryCommand, opts.draftPath)}`,
|
|
276
|
-
];
|
|
277
|
-
return withPathOutput(opts.squarePath, lines.join('\n'), { participantCount: opts.participantCount });
|
|
278
|
-
}
|
|
279
251
|
export function renderPresenceAnchor(names) {
|
|
280
252
|
const visibleNames = names.slice(0, MAX_IDENTITY_SET_SIZE);
|
|
281
253
|
const participants = visibleNames.map((name) => participantIdentity(name)).join(', ');
|
|
@@ -284,7 +256,7 @@ export function renderPresenceAnchor(names) {
|
|
|
284
256
|
return style('dim', names.length === 1 ? `→ ${participants} was here` : `→ ${participants}${suffix} were here`);
|
|
285
257
|
}
|
|
286
258
|
const GREP_PREVIEW_CHARS = 160;
|
|
287
|
-
export function renderGrepActivitiesView(visible, totalMatches,
|
|
259
|
+
export function renderGrepActivitiesView(visible, totalMatches, full, squarePath, pattern, fixed = false, perception, surface = 'cli') {
|
|
288
260
|
const publicVisible = visible.filter((act) => act.kind === 'say' || act.kind === 'done');
|
|
289
261
|
if (totalMatches === 0)
|
|
290
262
|
return `○ no activity matched ${quoteShell(pattern)}`;
|
|
@@ -298,7 +270,7 @@ export function renderGrepActivitiesView(visible, totalMatches, noTruncate, squa
|
|
|
298
270
|
chunks.push(header);
|
|
299
271
|
continue;
|
|
300
272
|
}
|
|
301
|
-
if (
|
|
273
|
+
if (full === true) {
|
|
302
274
|
const body = rawBody.split('\n').map((line) => ` ${line}`).join('\n');
|
|
303
275
|
chunks.push(`${header}\n${body}`);
|
|
304
276
|
continue;
|
|
@@ -319,30 +291,25 @@ export function renderGrepActivitiesView(visible, totalMatches, noTruncate, squa
|
|
|
319
291
|
chunks.push(`${header}\n ${text.trim()}${omitted}`);
|
|
320
292
|
}
|
|
321
293
|
if (publicVisible.length === 1) {
|
|
322
|
-
chunks.push(
|
|
294
|
+
chunks.push(surface === 'tool'
|
|
295
|
+
? formatToolAction('history', { location: displayPath(squarePath), at: [formatActivityId(publicVisible[0].index)], context: 2, ...(truncated ? { full: true } : {}) })
|
|
296
|
+
: `${commandPrefix(squarePath)} history --at ${formatActivityId(publicVisible[0].index)} -C 2${truncated ? ' --full' : ''}`);
|
|
323
297
|
}
|
|
324
298
|
else if (truncated && publicVisible.length > 1) {
|
|
325
|
-
chunks.push(
|
|
299
|
+
chunks.push(surface === 'tool'
|
|
300
|
+
? formatToolAction('history', { location: displayPath(squarePath), at: [formatActivityId(publicVisible[0].index)], context: 2, full: true })
|
|
301
|
+
: `${commandPrefix(squarePath)} history --at ${formatActivityId(publicVisible[0].index)} -C 2 --full`);
|
|
326
302
|
}
|
|
327
303
|
return chunks.join('\n\n');
|
|
328
304
|
}
|
|
329
|
-
export function renderActivityLimit(opts) {
|
|
330
|
-
// The cap wording lives inside the count: the speaker is simply spent.
|
|
331
|
-
const spoken = opts.count !== undefined && opts.hardCap !== undefined ? ` — ${opts.count}/${opts.hardCap} spoken` : '';
|
|
332
|
-
const doneCommand = `${participantCommandPrefix(opts.squarePath, opts.name, opts.owner)} done`;
|
|
333
|
-
return withPathOutput(opts.squarePath, [
|
|
334
|
-
`${style('blocked', '✕')} you’ve reached your speaking cap${spoken}`,
|
|
335
|
-
...draftSavedLines(opts.draftPath),
|
|
336
|
-
' · your draft stays unsent; done only steps out',
|
|
337
|
-
doneCommand,
|
|
338
|
-
].join('\n'), { participantCount: opts.participantCount });
|
|
339
|
-
}
|
|
340
305
|
export function renderWatchAlreadyActive(opts) {
|
|
341
306
|
return [
|
|
342
307
|
`${style('blocked', '✕')} you are already perceiving`,
|
|
343
308
|
` · an active perceive is already running for ${participantIdentity(opts.name)}`,
|
|
344
|
-
|
|
345
|
-
|
|
309
|
+
` · ${opts.surface === 'tool' ? 'takeover' : '--takeover'} lets a new perceive take over`,
|
|
310
|
+
opts.surface === 'tool'
|
|
311
|
+
? formatToolAction('perceive', { location: displayPath(opts.squarePath), as: opts.name, idle: '30m', takeover: true })
|
|
312
|
+
: `${participantCommandPrefix(opts.squarePath, opts.name, opts.owner)} perceive --idle 30m --takeover`,
|
|
346
313
|
].join('\n');
|
|
347
314
|
}
|
|
348
315
|
export function renderWatchForceTakeover(_opts) {
|
|
@@ -373,7 +340,7 @@ export function renderWatchStatus(opts) {
|
|
|
373
340
|
? style('dim', `○ dust settles on the flagstones — ${formatDuration(idleMs)} of quiet`)
|
|
374
341
|
: style('dim', '○ only footsteps in the square — nothing new for you');
|
|
375
342
|
// The quiet report never repeats the perceive just run.
|
|
376
|
-
const hints = [`${prefix} perceive --idle 30m`];
|
|
343
|
+
const hints = [opts.surface === 'tool' ? formatToolAction('perceive', { location: displayPath(opts.squarePath), as: opts.name, idle: '30m' }) : `${prefix} perceive --idle 30m`];
|
|
377
344
|
return [
|
|
378
345
|
quiet,
|
|
379
346
|
...(opts.showPerceiveHint === false ? [] : hints),
|
|
@@ -381,12 +348,12 @@ export function renderWatchStatus(opts) {
|
|
|
381
348
|
].join('\n');
|
|
382
349
|
}
|
|
383
350
|
case 'quorum':
|
|
384
|
-
return [`${style('release', '✓')} everyone else has left — the square is yours alone`, `${participantCommandPrefix(opts.squarePath, opts.name, opts.owner)} done`].join('\n');
|
|
351
|
+
return [`${style('release', '✓')} everyone else has left — the square is yours alone`, opts.surface === 'tool' ? formatToolAction('done', { location: displayPath(opts.squarePath), as: opts.name }) : `${participantCommandPrefix(opts.squarePath, opts.name, opts.owner)} done`].join('\n');
|
|
385
352
|
case 'capped': {
|
|
386
353
|
const spoken = opts.hardCap === undefined || opts.hardCap === null
|
|
387
354
|
? ''
|
|
388
355
|
: ` — ${opts.ownActivityCount ?? 0}/${opts.hardCap} spoken`;
|
|
389
|
-
return [`${style('blocked', '✕')} you’ve reached your speaking cap${spoken}`, `${participantCommandPrefix(opts.squarePath, opts.name, opts.owner)} done`].join('\n');
|
|
356
|
+
return [`${style('blocked', '✕')} you’ve reached your speaking cap${spoken}`, opts.surface === 'tool' ? formatToolAction('done', { location: displayPath(opts.squarePath), as: opts.name }) : `${participantCommandPrefix(opts.squarePath, opts.name, opts.owner)} done`].join('\n');
|
|
390
357
|
}
|
|
391
358
|
}
|
|
392
359
|
}
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { WatchLease } from './model.js';
|
|
2
2
|
import type { ParticipantCounts, ParticipantFact, SquareRead } from './ports.js';
|
|
3
|
-
export declare const WATCH_HEARTBEAT_MS
|
|
4
|
-
export declare const WATCH_STALE_MS
|
|
5
|
-
export declare const THROTTLE_WINDOW_MS
|
|
6
|
-
export declare const UNREAD_BLOCK_GRACE_MS
|
|
3
|
+
export declare const WATCH_HEARTBEAT_MS = 60000;
|
|
4
|
+
export declare const WATCH_STALE_MS = 180000;
|
|
5
|
+
export declare const THROTTLE_WINDOW_MS = 60000;
|
|
6
|
+
export declare const UNREAD_BLOCK_GRACE_MS = 90000;
|
|
7
7
|
export declare const FACT_PAGE_SIZE = 100;
|
|
8
8
|
export declare function inSquareCount(facts: SquareRead): number;
|
|
9
9
|
export declare function terminalStatusFor(current: ParticipantFact | undefined, hardCap: number | null, counts: ParticipantCounts): 'capped' | 'quorum' | undefined;
|
|
@@ -12,4 +12,4 @@ export declare function watchTerminalStatus(facts: SquareRead, name: string): 'c
|
|
|
12
12
|
export declare function readCursor(facts: SquareRead, name: string): number;
|
|
13
13
|
/** Presence rides on own activity or exact receipts, not nonaddressed cursor progress. */
|
|
14
14
|
export declare function presenceAnchor(facts: SquareRead, name: string): number;
|
|
15
|
-
export declare function freshWatchLease(facts: SquareRead, name: string, at
|
|
15
|
+
export declare function freshWatchLease(facts: SquareRead, name: string, at: number): WatchLease | undefined;
|
package/dist/runtime.js
CHANGED
|
@@ -1,17 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
return fallback;
|
|
6
|
-
const value = parseInt(raw, 10);
|
|
7
|
-
if (!Number.isFinite(value) || value <= 0)
|
|
8
|
-
throw new SquareError('invalid_args', `Invalid ${name}: expected a positive integer.`);
|
|
9
|
-
return value;
|
|
10
|
-
}
|
|
11
|
-
export const WATCH_HEARTBEAT_MS = parseIntegerEnv('SQUARE_WATCH_HEARTBEAT_MS', 60000);
|
|
12
|
-
export const WATCH_STALE_MS = parseIntegerEnv('SQUARE_WATCH_STALE_MS', 180000);
|
|
13
|
-
export const THROTTLE_WINDOW_MS = parseIntegerEnv('SQUARE_THROTTLE_WINDOW_MS', 60000);
|
|
14
|
-
export const UNREAD_BLOCK_GRACE_MS = parseIntegerEnv('SQUARE_UNREAD_BLOCK_GRACE_MS', 90000);
|
|
1
|
+
export const WATCH_HEARTBEAT_MS = 60000;
|
|
2
|
+
export const WATCH_STALE_MS = 180000;
|
|
3
|
+
export const THROTTLE_WINDOW_MS = 60000;
|
|
4
|
+
export const UNREAD_BLOCK_GRACE_MS = 90000;
|
|
15
5
|
export const FACT_PAGE_SIZE = 100;
|
|
16
6
|
export function inSquareCount(facts) { return facts.participantCounts().joined; }
|
|
17
7
|
export function terminalStatusFor(current, hardCap, counts) {
|
|
@@ -46,7 +36,7 @@ export function presenceAnchor(facts, name) {
|
|
|
46
36
|
const evidence = Math.max(boundary, own ?? boundary, facts.receiptFacts(name, boundary).latestActorActivityIndex ?? boundary);
|
|
47
37
|
return facts.activityHeads({ afterIndex: boundary, throughIndex: evidence, kinds: ['say', 'done'] }, { edge: 'newest', limit: 1 }).items[0]?.index ?? -1;
|
|
48
38
|
}
|
|
49
|
-
export function freshWatchLease(facts, name, at
|
|
39
|
+
export function freshWatchLease(facts, name, at) {
|
|
50
40
|
const lease = facts.lease(name);
|
|
51
41
|
return lease === undefined || lease.expiresAt <= at || at - lease.heartbeatAt > WATCH_STALE_MS ? undefined : lease;
|
|
52
42
|
}
|
package/dist/sqlite-square.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type Owner } from './model.js';
|
|
2
2
|
import type { HistoryQuery, HistoryResult, JoinOptions, JoinResult, ObservationOptions, OperationControl, Participant, SquareAtInput, SquareBuildInput, SquareLocation, StatusOptions, StatusResult, ParticipantsResult, RecoveryResult, DiscoveryOptions, InboxOptions, InboxResult, StreamOptions, StreamRecord, Activity, PerceivedActivity, SendInput, SendResult } from './square-facade.js';
|
|
3
3
|
export type * from './square-facade.js';
|
|
4
|
-
export { squareClock } from './operation-control.js';
|
|
5
4
|
export { formatActivityId, parseActivityId, MAX_IDENTITY_SET_SIZE } from './square-core.js';
|
|
6
5
|
export { PERCEIVE_DEFAULT_LIMIT, PERCEIVE_MAX_LIMIT } from './perceive-decisions.js';
|
|
7
6
|
export { HISTORY_DEFAULT_LIMIT, HISTORY_MAX_LIMIT } from './views.js';
|
|
@@ -11,8 +10,8 @@ export declare class SqliteSquare {
|
|
|
11
10
|
readonly location: string;
|
|
12
11
|
private readonly artifact;
|
|
13
12
|
private readonly clock;
|
|
14
|
-
private readonly
|
|
15
|
-
private readonly
|
|
13
|
+
private readonly canonicalLocation;
|
|
14
|
+
private readonly ledgerLocation?;
|
|
16
15
|
private constructor();
|
|
17
16
|
private reconcile;
|
|
18
17
|
private flush;
|
|
@@ -51,5 +50,5 @@ export declare class SqliteSquare {
|
|
|
51
50
|
close(): Promise<void>;
|
|
52
51
|
}
|
|
53
52
|
export declare function diagnoseSquare(input: SquareLocation, control?: OperationControl): Promise<import("./artifact.js").DiagnoseResult>;
|
|
54
|
-
export declare function discover(input:
|
|
55
|
-
export declare function inbox(input:
|
|
53
|
+
export declare function discover(input: SquareLocation, options?: DiscoveryOptions, control?: OperationControl): Promise<import("./square-facade.js").DiscoveryResult>;
|
|
54
|
+
export declare function inbox(input: SquareLocation, owner: Owner, options?: InboxOptions, control?: OperationControl): Promise<InboxResult>;
|