@moxuli/moremote 0.1.7 → 0.1.9
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/README.md +1 -1
- package/dist/activity-capabilities.d.ts +21 -0
- package/dist/activity-capabilities.js +107 -0
- package/dist/enrollment-files.d.ts +1 -0
- package/dist/enrollment-files.js +7 -0
- package/dist/event-publication.d.ts +1 -1
- package/dist/event-publication.js +6 -2
- package/dist/live-activity-titles.d.ts +20 -0
- package/dist/live-activity-titles.js +34 -0
- package/dist/live-activity.d.ts +4 -0
- package/dist/live-activity.js +16 -4
- package/dist/live-directory.d.ts +3 -0
- package/dist/live-directory.js +10 -1
- package/dist/live-workspaces.d.ts +26 -0
- package/dist/live-workspaces.js +217 -0
- package/dist/official-client.d.ts +4 -2
- package/dist/official-client.js +8 -1
- package/dist/projection.js +1 -1
- package/dist/resources.js +20 -2
- package/dist/runtime.js +4 -1
- package/docs/STATE.md +45 -3
- package/docs/configuration.md +21 -0
- package/docs/journal/2026-11-15-informative-notifications-activity-release.md +31 -0
- package/docs/journal/2026-11-15-live-activity-title-provenance.md +88 -0
- package/docs/journal/2026-11-15-title-provenance-release.md +120 -0
- package/docs/specs/01-architecture.md +12 -0
- package/docs/specs/02-encrypted-delivery.md +19 -0
- package/docs/specs/03-api-contract.md +7 -0
- package/docs/specs/04-control-and-receipt-lifecycle.md +5 -0
- package/docs/specs/05-endpoint-and-lifecycle.md +19 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Optional, independent Apache-2.0 computer companion for MoRemote and an **unmodified Paseo 0.15.3** daemon. Existing official-only clients keep working without this project or its cloud.
|
|
4
4
|
|
|
5
5
|
Canonical repository/command: `moremote-cli`; public npm package:
|
|
6
|
-
**`@moxuli/moremote`** (release **0.1.
|
|
6
|
+
**`@moxuli/moremote`** (release **0.1.9**); source entry: `bin/moremote-cli.js`.
|
|
7
7
|
There is no unscoped npm alias or automatic adoption of foreign/old state.
|
|
8
8
|
|
|
9
9
|
## Install the published package
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface ActivityCapabilities {
|
|
2
|
+
version: 1;
|
|
3
|
+
daemonServerId: string;
|
|
4
|
+
instanceId: string;
|
|
5
|
+
measuredAt: number;
|
|
6
|
+
expiresAt: number;
|
|
7
|
+
titleHints: 1;
|
|
8
|
+
}
|
|
9
|
+
export declare function activityCapabilitiesDirectory(home: string, daemon: string): string;
|
|
10
|
+
/** Called only while the enrollment runtime owns its existing exclusive daemon lock. */
|
|
11
|
+
export declare class ActivityCapabilityFiles {
|
|
12
|
+
private home;
|
|
13
|
+
private stateDirectory;
|
|
14
|
+
private daemon;
|
|
15
|
+
private instanceId;
|
|
16
|
+
private path?;
|
|
17
|
+
constructor(home: string, stateDirectory: string, daemon: string, instanceId: string);
|
|
18
|
+
private hostMarker;
|
|
19
|
+
publish(now: number): void;
|
|
20
|
+
close(): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
2
|
+
import { mkdirSync, readdirSync, renameSync, openSync, closeSync, fsyncSync, constants } from 'node:fs';
|
|
3
|
+
import { join, resolve, dirname } from 'node:path';
|
|
4
|
+
import { createPrivateFile, hasCode, inspectResource, readPrivateText, removeOwnedResource, sameResource } from './resources.js';
|
|
5
|
+
import { exact, object, UUID } from './limits.js';
|
|
6
|
+
import { descriptorLifetime } from './enrollment-protocol.js';
|
|
7
|
+
const marker = '.moremote-cli-owner';
|
|
8
|
+
export function activityCapabilitiesDirectory(home, daemon) {
|
|
9
|
+
return join(resolve(home), '.moremote-cli-activity', createHash('sha256').update(daemon, 'utf8').digest('hex'));
|
|
10
|
+
}
|
|
11
|
+
function directory(path, owner, create = true) {
|
|
12
|
+
if (create)
|
|
13
|
+
try {
|
|
14
|
+
mkdirSync(path, { mode: 0o700 });
|
|
15
|
+
createPrivateFile(join(path, marker), owner);
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
if (!hasCode(error, 'EEXIST'))
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
inspectResource(path, 'directory');
|
|
22
|
+
if (readPrivateText(join(path, marker), 2048).text !== owner)
|
|
23
|
+
throw Error('FOREIGN_ACTIVITY_CAPABILITIES_DIRECTORY');
|
|
24
|
+
}
|
|
25
|
+
function document(path, daemon) {
|
|
26
|
+
const file = readPrivateText(path, 4096), value = object(JSON.parse(file.text));
|
|
27
|
+
exact(value, ['version', 'daemonServerId', 'instanceId', 'measuredAt', 'expiresAt', 'titleHints']);
|
|
28
|
+
if (value.version !== 1 || value.daemonServerId !== daemon || typeof value.instanceId !== 'string' || !UUID.test(value.instanceId)
|
|
29
|
+
|| value.titleHints !== 1 || !Number.isSafeInteger(value.measuredAt) || Number(value.measuredAt) < 0
|
|
30
|
+
|| !Number.isSafeInteger(value.expiresAt) || Number(value.expiresAt) !== Number(value.measuredAt) + descriptorLifetime)
|
|
31
|
+
throw Error('FOREIGN_ACTIVITY_CAPABILITIES');
|
|
32
|
+
return { value: value, identity: file.identity };
|
|
33
|
+
}
|
|
34
|
+
/** Called only while the enrollment runtime owns its existing exclusive daemon lock. */
|
|
35
|
+
export class ActivityCapabilityFiles {
|
|
36
|
+
home;
|
|
37
|
+
stateDirectory;
|
|
38
|
+
daemon;
|
|
39
|
+
instanceId;
|
|
40
|
+
path;
|
|
41
|
+
constructor(home, stateDirectory, daemon, instanceId) {
|
|
42
|
+
this.home = home;
|
|
43
|
+
this.stateDirectory = stateDirectory;
|
|
44
|
+
this.daemon = daemon;
|
|
45
|
+
this.instanceId = instanceId;
|
|
46
|
+
}
|
|
47
|
+
hostMarker() { return JSON.stringify({ owner: 'MoRemote CLI activity capabilities host', version: 1, daemonServerId: this.daemon, stateDirectory: resolve(this.stateDirectory) }) + '\n'; }
|
|
48
|
+
publish(now) {
|
|
49
|
+
const root = join(resolve(this.home), '.moremote-cli-activity'), path = activityCapabilitiesDirectory(this.home, this.daemon);
|
|
50
|
+
directory(root, 'MoRemote CLI activity capabilities v1\n');
|
|
51
|
+
for (const name of readdirSync(root)) {
|
|
52
|
+
if (name === marker)
|
|
53
|
+
continue;
|
|
54
|
+
if (!/^[0-9a-f]{64}$/.test(name))
|
|
55
|
+
throw Error('FOREIGN_ACTIVITY_CAPABILITIES_DIRECTORY');
|
|
56
|
+
inspectResource(join(root, name), 'directory');
|
|
57
|
+
}
|
|
58
|
+
directory(path, this.hostMarker());
|
|
59
|
+
for (const name of readdirSync(path)) {
|
|
60
|
+
if (name === marker || name === 'capabilities.json')
|
|
61
|
+
continue;
|
|
62
|
+
const match = /^capabilities\.json\.([0-9a-f-]{36})\.tmp$/.exec(name);
|
|
63
|
+
if (!match || !UUID.test(match[1]))
|
|
64
|
+
throw Error('FOREIGN_ACTIVITY_CAPABILITIES_RESOURCE');
|
|
65
|
+
const stage = join(path, name), file = document(stage, this.daemon);
|
|
66
|
+
if (!removeOwnedResource(stage, file.identity))
|
|
67
|
+
throw Error('DISCOVERY_RESOURCE_CHANGED');
|
|
68
|
+
}
|
|
69
|
+
this.path = join(path, 'capabilities.json');
|
|
70
|
+
const before = inspectResource(this.path, 'file', true);
|
|
71
|
+
if (before)
|
|
72
|
+
document(this.path, this.daemon);
|
|
73
|
+
const value = { version: 1, daemonServerId: this.daemon, instanceId: this.instanceId, measuredAt: now, expiresAt: now + descriptorLifetime, titleHints: 1 };
|
|
74
|
+
const temporary = this.path + '.' + randomUUID() + '.tmp', identity = createPrivateFile(temporary, JSON.stringify(value));
|
|
75
|
+
try {
|
|
76
|
+
const current = inspectResource(this.path, 'file', true);
|
|
77
|
+
if (before ? (!current || !sameResource(before, current)) : current !== null)
|
|
78
|
+
throw Error('DISCOVERY_RESOURCE_CHANGED');
|
|
79
|
+
renameSync(temporary, this.path);
|
|
80
|
+
if (process.platform !== 'win32') {
|
|
81
|
+
const fd = openSync(dirname(this.path), constants.O_RDONLY | constants.O_DIRECTORY | constants.O_NOFOLLOW);
|
|
82
|
+
try {
|
|
83
|
+
fsyncSync(fd);
|
|
84
|
+
}
|
|
85
|
+
finally {
|
|
86
|
+
closeSync(fd);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
finally {
|
|
91
|
+
removeOwnedResource(temporary, identity);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
close() {
|
|
95
|
+
if (!this.path)
|
|
96
|
+
return;
|
|
97
|
+
directory(join(resolve(this.home), '.moremote-cli-activity'), 'MoRemote CLI activity capabilities v1\n', false);
|
|
98
|
+
directory(dirname(this.path), this.hostMarker(), false);
|
|
99
|
+
if (!inspectResource(this.path, 'file', true))
|
|
100
|
+
return;
|
|
101
|
+
const file = document(this.path, this.daemon);
|
|
102
|
+
if (file.value.instanceId !== this.instanceId)
|
|
103
|
+
return;
|
|
104
|
+
if (!removeOwnedResource(this.path, file.identity))
|
|
105
|
+
throw Error('DISCOVERY_RESOURCE_CHANGED');
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -16,6 +16,7 @@ export declare class EnrollmentFiles {
|
|
|
16
16
|
private measuredAt;
|
|
17
17
|
private enabled;
|
|
18
18
|
private readonly hostMarker;
|
|
19
|
+
private readonly activityCapabilities;
|
|
19
20
|
constructor(options: DiscoveryOptions);
|
|
20
21
|
open(records?: EnrollmentRecord[]): void;
|
|
21
22
|
private assertOwner;
|
package/dist/enrollment-files.js
CHANGED
|
@@ -5,6 +5,7 @@ import { createPrivateFile, hasCode, inspectResource, readPrivateText, removeOwn
|
|
|
5
5
|
import { object, exact, UUID } from './limits.js';
|
|
6
6
|
import { DISCOVERY_NAME, descriptorLifetime, descriptorRenewal } from './enrollment-protocol.js';
|
|
7
7
|
import { validateOrigin } from './config.js';
|
|
8
|
+
import { ActivityCapabilityFiles } from './activity-capabilities.js';
|
|
8
9
|
const marker = '.moremote-cli-owner';
|
|
9
10
|
const rootMarker = 'MoRemote CLI discovery v1\n';
|
|
10
11
|
function alive(pid) { try {
|
|
@@ -74,10 +75,12 @@ export class EnrollmentFiles {
|
|
|
74
75
|
measuredAt = -Infinity;
|
|
75
76
|
enabled;
|
|
76
77
|
hostMarker;
|
|
78
|
+
activityCapabilities;
|
|
77
79
|
constructor(options) {
|
|
78
80
|
this.options = options;
|
|
79
81
|
this.instanceId = options.instanceId ?? randomUUID();
|
|
80
82
|
this.path = discoveryDirectory(options.home, options.daemonServerId);
|
|
83
|
+
this.activityCapabilities = new ActivityCapabilityFiles(options.home, options.stateDirectory, options.daemonServerId, this.instanceId);
|
|
81
84
|
this.hostMarker = JSON.stringify({ owner: 'MoRemote CLI discovery host', version: 1, daemonServerId: options.daemonServerId, stateDirectory: resolve(options.stateDirectory) }) + '\n';
|
|
82
85
|
}
|
|
83
86
|
open(records = []) {
|
|
@@ -169,6 +172,7 @@ export class EnrollmentFiles {
|
|
|
169
172
|
validateDescriptor(path, this.options.daemonServerId);
|
|
170
173
|
const descriptor = { version: 1, daemonServerId: this.options.daemonServerId, instanceId: this.instanceId, apiOrigin, enabled, measuredAt: now, expiresAt: now + descriptorLifetime };
|
|
171
174
|
atomic(path, descriptor, 4096);
|
|
175
|
+
this.activityCapabilities.publish(now);
|
|
172
176
|
this.measuredAt = now;
|
|
173
177
|
this.enabled = enabled;
|
|
174
178
|
}
|
|
@@ -206,6 +210,7 @@ export class EnrollmentFiles {
|
|
|
206
210
|
return;
|
|
207
211
|
this.assertOwner();
|
|
208
212
|
try {
|
|
213
|
+
this.activityCapabilities.close();
|
|
209
214
|
for (const record of records)
|
|
210
215
|
this.removeResponse(record);
|
|
211
216
|
const descriptor = join(this.path, 'descriptor.json');
|
|
@@ -220,6 +225,8 @@ export class EnrollmentFiles {
|
|
|
220
225
|
if (!removeOwnedResource(join(this.path, 'runtime.lock'), this.lock))
|
|
221
226
|
throw Error('DISCOVERY_RESOURCE_CHANGED');
|
|
222
227
|
this.lock = undefined;
|
|
228
|
+
this.measuredAt = -Infinity;
|
|
229
|
+
this.enabled = undefined;
|
|
223
230
|
}
|
|
224
231
|
}
|
|
225
232
|
}
|
|
@@ -3,4 +3,4 @@ import { CloudClient } from './cloud-client.js';
|
|
|
3
3
|
import type { OperationJournal } from './journal.js';
|
|
4
4
|
import { LiveActivityPublisher, type LiveSnapshot } from './live-activity.js';
|
|
5
5
|
/** Independent durable acknowledgements sharing one transport request. */
|
|
6
|
-
export declare function publishEvents(pair: Pair, cloud: CloudClient, journal: OperationJournal, publisher: LiveActivityPublisher, snapshot: LiveSnapshot | null, detailsCurrent: boolean): Promise<void>;
|
|
6
|
+
export declare function publishEvents(pair: Pair, cloud: CloudClient, journal: OperationJournal, publisher: LiveActivityPublisher, snapshot: LiveSnapshot | null, detailsCurrent: boolean, allowUngatedRequests?: boolean): Promise<void>;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { LIMITS } from './limits.js';
|
|
2
2
|
/** Independent durable acknowledgements sharing one transport request. */
|
|
3
|
-
export async function publishEvents(pair, cloud, journal, publisher, snapshot, detailsCurrent) {
|
|
4
|
-
const
|
|
3
|
+
export async function publishEvents(pair, cloud, journal, publisher, snapshot, detailsCurrent, allowUngatedRequests = false) {
|
|
4
|
+
const now = Date.now();
|
|
5
|
+
// Never starve question/permission alerts forever when optional quick-reply
|
|
6
|
+
// state hydration exceeds capacity or fails transiently.
|
|
7
|
+
const pending = journal.attention(pair.pairId, now).filter(item => detailsCurrent || allowUngatedRequests || !['question', 'permission'].includes(item.body.kind)
|
|
8
|
+
|| (typeof item.body.envelope?.issuedAt === 'number' && now - item.body.envelope.issuedAt >= 15000));
|
|
5
9
|
if (!cloud.liveActivityV2) {
|
|
6
10
|
for (const item of pending) {
|
|
7
11
|
await cloud.attention(item.body);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface LiveTitleHint {
|
|
2
|
+
agentId: string;
|
|
3
|
+
workspaceId: string;
|
|
4
|
+
source: 'conversation' | 'workspace';
|
|
5
|
+
}
|
|
6
|
+
export interface LiveWorkspace {
|
|
7
|
+
id: string;
|
|
8
|
+
title?: string | null;
|
|
9
|
+
}
|
|
10
|
+
interface TitleAgent {
|
|
11
|
+
id: string;
|
|
12
|
+
title: string | null;
|
|
13
|
+
workspaceId?: string;
|
|
14
|
+
labels?: Record<string, string>;
|
|
15
|
+
}
|
|
16
|
+
export declare function liveIdentifier(value: unknown): value is string;
|
|
17
|
+
export declare function parseLiveTitleHints(value: unknown): LiveTitleHint[];
|
|
18
|
+
/** A partial directory may disprove a workspace hint, never manufacture one. */
|
|
19
|
+
export declare function liveTitle(agent: TitleAgent, hints: readonly LiveTitleHint[], agents: readonly TitleAgent[], workspaces: readonly LiveWorkspace[]): string | undefined;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { exact, object } from './limits.js';
|
|
2
|
+
export function liveIdentifier(value) {
|
|
3
|
+
return typeof value === 'string' && value.length > 0 && Buffer.byteLength(value) <= 512 && !/[\s/\\\x00-\x1f]/u.test(value);
|
|
4
|
+
}
|
|
5
|
+
export function parseLiveTitleHints(value) {
|
|
6
|
+
if (value === undefined)
|
|
7
|
+
return [];
|
|
8
|
+
if (!Array.isArray(value) || value.length > 32 || Buffer.byteLength(JSON.stringify(value)) > 4000)
|
|
9
|
+
throw Error('INVALID_LIVE_ACTIVITY_TITLE_HINTS');
|
|
10
|
+
const seen = new Set();
|
|
11
|
+
return value.map(raw => {
|
|
12
|
+
const hint = object(raw);
|
|
13
|
+
exact(hint, ['agentId', 'workspaceId', 'source']);
|
|
14
|
+
if (!liveIdentifier(hint.agentId) || !liveIdentifier(hint.workspaceId) || (hint.source !== 'conversation' && hint.source !== 'workspace') || seen.has(hint.agentId))
|
|
15
|
+
throw Error('INVALID_LIVE_ACTIVITY_TITLE_HINTS');
|
|
16
|
+
seen.add(hint.agentId);
|
|
17
|
+
return hint;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
/** A partial directory may disprove a workspace hint, never manufacture one. */
|
|
21
|
+
export function liveTitle(agent, hints, agents, workspaces) {
|
|
22
|
+
const hint = hints.find(value => value.agentId === agent.id && value.workspaceId === agent.workspaceId);
|
|
23
|
+
if (hint?.source === 'workspace') {
|
|
24
|
+
const roots = new Set(agents.filter(value => value.workspaceId === hint.workspaceId && !value.labels?.['paseo.parent-agent-id']?.trim()).map(value => value.id));
|
|
25
|
+
const workspace = workspaces.find(value => value.id === hint.workspaceId);
|
|
26
|
+
if (roots.size <= 1) {
|
|
27
|
+
if (!workspace || workspace.title === undefined)
|
|
28
|
+
return;
|
|
29
|
+
if (workspace.title?.trim())
|
|
30
|
+
return workspace.title.trim();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return agent.title || '会话';
|
|
34
|
+
}
|
package/dist/live-activity.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { Pair } from './config.js';
|
|
2
2
|
import { type Envelope } from './crypto.js';
|
|
3
3
|
import { type OperationJournal } from './journal.js';
|
|
4
|
+
import { type LiveWorkspace } from './live-activity-titles.js';
|
|
4
5
|
export interface LiveAgent {
|
|
5
6
|
id: string;
|
|
6
7
|
title: string | null;
|
|
8
|
+
workspaceId?: string;
|
|
7
9
|
status: string;
|
|
8
10
|
createdAt: string;
|
|
9
11
|
lastUserMessageAt: string | null;
|
|
@@ -26,6 +28,8 @@ export interface LiveSnapshot {
|
|
|
26
28
|
daemonServerId: string;
|
|
27
29
|
hostName: string;
|
|
28
30
|
agents: LiveAgent[];
|
|
31
|
+
workspaces?: LiveWorkspace[];
|
|
32
|
+
requestWorkspace?: (id: string) => void;
|
|
29
33
|
}
|
|
30
34
|
export interface LiveInterest {
|
|
31
35
|
registrationId: string;
|
package/dist/live-activity.js
CHANGED
|
@@ -2,6 +2,7 @@ import { createHmac, randomBytes, randomUUID, webcrypto } from 'node:crypto';
|
|
|
2
2
|
import { decode, openEnvelope, presenceTopic, validateEnvelope } from './crypto.js';
|
|
3
3
|
import { canonical } from './journal.js';
|
|
4
4
|
import { LIMITS, UUID, exact, object } from './limits.js';
|
|
5
|
+
import { liveIdentifier as identifier, liveTitle, parseLiveTitleHints } from './live-activity-titles.js';
|
|
5
6
|
/** Durable display publication only. No command execution or remote tracking authority. */
|
|
6
7
|
export class LiveActivityPublisher {
|
|
7
8
|
journal;
|
|
@@ -14,7 +15,8 @@ export class LiveActivityPublisher {
|
|
|
14
15
|
|| raw.interest.channel !== 'activityInterest')
|
|
15
16
|
throw Error('INVALID_LIVE_ACTIVITY_SOURCE');
|
|
16
17
|
const value = object(await openEnvelope(decode(pair.rootKey, 32), raw.interest, now));
|
|
17
|
-
exact(value, ['version', 'subscriptionId', 'generation', 'hostID', 'hostLifetime', 'daemonServerId', 'displayKey', 'createdAt', 'deadline', 'hostName']);
|
|
18
|
+
exact(value, ['version', 'subscriptionId', 'generation', 'hostID', 'hostLifetime', 'daemonServerId', 'displayKey', 'createdAt', 'deadline', 'hostName', 'titleHints']);
|
|
19
|
+
const titleHints = parseLiveTitleHints(value.titleHints);
|
|
18
20
|
if (value.version !== 2 || value.subscriptionId !== raw.interest.id || !UUID.test(String(value.generation))
|
|
19
21
|
|| !UUID.test(String(value.hostLifetime)) || !identifier(value.hostID) || !identifier(value.daemonServerId)
|
|
20
22
|
|| value.daemonServerId !== snapshot.daemonServerId || pair.daemonServerId && value.daemonServerId !== pair.daemonServerId
|
|
@@ -36,8 +38,19 @@ export class LiveActivityPublisher {
|
|
|
36
38
|
throw Error('DUPLICATE_LIVE_ACTIVITY_TARGET');
|
|
37
39
|
if (agents.length > 100)
|
|
38
40
|
throw Error('LIVE_ACTIVITY_CANDIDATE_LIMIT');
|
|
41
|
+
for (const hint of titleHints) {
|
|
42
|
+
if (hint.source === 'workspace' && agents.some(agent => agent.id === hint.agentId && agent.workspaceId === hint.workspaceId)) {
|
|
43
|
+
try {
|
|
44
|
+
snapshot.requestWorkspace?.(hint.workspaceId);
|
|
45
|
+
}
|
|
46
|
+
catch { /* Metadata reads cannot block attention publication. */ }
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const titles = agents.map(agent => liveTitle(agent, titleHints, snapshot.agents, snapshot.workspaces ?? []));
|
|
50
|
+
if (titles.some(title => title === undefined))
|
|
51
|
+
return;
|
|
39
52
|
const cycles = {};
|
|
40
|
-
const projected = await Promise.all(agents.map(async (agent) => {
|
|
53
|
+
const projected = await Promise.all(agents.map(async (agent, index) => {
|
|
41
54
|
if (!identifier(agent.id) || (time(agent.lastUserMessageAt) ?? 0) > now)
|
|
42
55
|
throw Error('INVALID_LIVE_ACTIVITY_TARGET');
|
|
43
56
|
const lastUserAt = time(agent.lastUserMessageAt) ?? time(agent.createdAt) ?? 0;
|
|
@@ -51,7 +64,7 @@ export class LiveActivityPublisher {
|
|
|
51
64
|
? tag(key, [cycle, phase, phase === 'waiting' ? canonical(agent.pendingPermissions) : agent.attentionTimestamp ?? '']) : undefined;
|
|
52
65
|
return { topic, cycle, phase, lastUserAt, ...(eventId ? { eventId } : {}),
|
|
53
66
|
state: { version: 1, subscriptionId: interest.subscriptionId, daemonServerId: snapshot.daemonServerId,
|
|
54
|
-
agentId: agent.id, title: bounded(
|
|
67
|
+
agentId: agent.id, title: bounded(titles[index], 160, 480),
|
|
55
68
|
hostName: bounded(interest.hostName ?? snapshot.hostName, 80, 240), phase, startedAt: null,
|
|
56
69
|
requiresAttention: phase === 'waiting', isTerminal: phase === 'finished' || phase === 'error' } };
|
|
57
70
|
}));
|
|
@@ -93,7 +106,6 @@ export class LiveActivityPublisher {
|
|
|
93
106
|
this.journal.saveLivePublication(pairId, publication.deadline, publication);
|
|
94
107
|
}
|
|
95
108
|
}
|
|
96
|
-
function identifier(value) { return typeof value === 'string' && value.length > 0 && Buffer.byteLength(value) <= 512 && !/[\s/\\\x00-\x1f]/u.test(value); }
|
|
97
109
|
function time(value) { const parsed = value ? Date.parse(value) : NaN; return Number.isSafeInteger(parsed) && parsed >= 0 ? parsed : null; }
|
|
98
110
|
function tag(key, value) { return createHmac('sha256', key).update(JSON.stringify(value)).digest('base64url'); }
|
|
99
111
|
function phaseFor(agent, now) {
|
package/dist/live-directory.d.ts
CHANGED
|
@@ -9,8 +9,11 @@ export declare class LiveDirectory {
|
|
|
9
9
|
private ready;
|
|
10
10
|
private generation?;
|
|
11
11
|
private head;
|
|
12
|
+
private workspaceDirectory;
|
|
12
13
|
constructor(sdk: DaemonClient);
|
|
13
14
|
setEnabled(enabled: boolean): void;
|
|
14
15
|
snapshot(): AgentSnapshotPayload[] | null;
|
|
16
|
+
workspaces(): import("./live-activity-titles.js").LiveWorkspace[];
|
|
17
|
+
requestWorkspace(id: string): void;
|
|
15
18
|
stop(): void;
|
|
16
19
|
}
|
package/dist/live-directory.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LiveWorkspaces } from './live-workspaces.js';
|
|
1
2
|
/** A separately owned read interest, acquired only for an active phone activity. */
|
|
2
3
|
export class LiveDirectory {
|
|
3
4
|
sdk;
|
|
@@ -7,16 +8,20 @@ export class LiveDirectory {
|
|
|
7
8
|
ready = false;
|
|
8
9
|
generation;
|
|
9
10
|
head = -1;
|
|
11
|
+
workspaceDirectory;
|
|
10
12
|
constructor(sdk) {
|
|
11
13
|
this.sdk = sdk;
|
|
14
|
+
this.workspaceDirectory = new LiveWorkspaces(sdk);
|
|
12
15
|
}
|
|
13
16
|
setEnabled(enabled) {
|
|
14
17
|
if (!enabled) {
|
|
15
18
|
this.stop();
|
|
16
19
|
return;
|
|
17
20
|
}
|
|
18
|
-
if (this.owner)
|
|
21
|
+
if (this.owner) {
|
|
22
|
+
this.workspaceDirectory.setEnabled(true);
|
|
19
23
|
return;
|
|
24
|
+
}
|
|
20
25
|
const owner = this.sdk.observeAgents({ page: { limit: 100 }, filter: { includeArchived: false, includeInternal: false },
|
|
21
26
|
sort: [{ key: 'updated_at', direction: 'desc' }], timeout: 15000 });
|
|
22
27
|
this.owner = owner;
|
|
@@ -61,9 +66,13 @@ export class LiveDirectory {
|
|
|
61
66
|
});
|
|
62
67
|
void owner.ready.catch(() => { if (this.owner === owner)
|
|
63
68
|
this.stop(); });
|
|
69
|
+
this.workspaceDirectory.setEnabled(true);
|
|
64
70
|
}
|
|
65
71
|
snapshot() { return this.ready ? structuredClone([...this.agents.values()]) : null; }
|
|
72
|
+
workspaces() { return this.workspaceDirectory.snapshot(); }
|
|
73
|
+
requestWorkspace(id) { this.workspaceDirectory.request(id); }
|
|
66
74
|
stop() {
|
|
75
|
+
this.workspaceDirectory.stop();
|
|
67
76
|
const owner = this.owner;
|
|
68
77
|
this.owner = undefined;
|
|
69
78
|
this.detach?.();
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { DaemonClient } from '@getpaseo/client/internal/daemon-client';
|
|
2
|
+
import { type LiveWorkspace } from './live-activity-titles.js';
|
|
3
|
+
/** Unknown metadata is distinct from an authoritative empty title. */
|
|
4
|
+
export declare class LiveWorkspaces {
|
|
5
|
+
private sdk;
|
|
6
|
+
private enabled;
|
|
7
|
+
private page?;
|
|
8
|
+
private exact;
|
|
9
|
+
private pageIDs;
|
|
10
|
+
private titles;
|
|
11
|
+
private readOrder;
|
|
12
|
+
private generation?;
|
|
13
|
+
private generationOrder;
|
|
14
|
+
private retiredGenerations;
|
|
15
|
+
constructor(sdk: DaemonClient);
|
|
16
|
+
setEnabled(enabled: boolean): void;
|
|
17
|
+
snapshot(): LiveWorkspace[];
|
|
18
|
+
request(id: string): void;
|
|
19
|
+
private observeExact;
|
|
20
|
+
private observe;
|
|
21
|
+
private acceptGeneration;
|
|
22
|
+
private remember;
|
|
23
|
+
private store;
|
|
24
|
+
private release;
|
|
25
|
+
stop(): void;
|
|
26
|
+
}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { liveIdentifier } from './live-activity-titles.js';
|
|
2
|
+
/** Unknown metadata is distinct from an authoritative empty title. */
|
|
3
|
+
export class LiveWorkspaces {
|
|
4
|
+
sdk;
|
|
5
|
+
enabled = false;
|
|
6
|
+
page;
|
|
7
|
+
exact = new Map();
|
|
8
|
+
pageIDs = new Set();
|
|
9
|
+
titles = new Map();
|
|
10
|
+
readOrder = 0;
|
|
11
|
+
generation;
|
|
12
|
+
generationOrder = -1;
|
|
13
|
+
retiredGenerations = new Set();
|
|
14
|
+
constructor(sdk) {
|
|
15
|
+
this.sdk = sdk;
|
|
16
|
+
}
|
|
17
|
+
setEnabled(enabled) {
|
|
18
|
+
if (!enabled) {
|
|
19
|
+
this.stop();
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
this.enabled = true;
|
|
23
|
+
if (!this.page?.owner)
|
|
24
|
+
this.observe();
|
|
25
|
+
for (const [id, read] of this.exact)
|
|
26
|
+
if (!read.owner && !read.pending && !read.complete)
|
|
27
|
+
this.observeExact(id);
|
|
28
|
+
}
|
|
29
|
+
snapshot() { return structuredClone([...this.titles.values()].map(row => row.value).filter(value => value.title !== undefined)); }
|
|
30
|
+
request(id) {
|
|
31
|
+
if (!this.enabled || !liveIdentifier(id))
|
|
32
|
+
return;
|
|
33
|
+
if (this.pageIDs.has(id) && this.titles.get(id)?.value.title !== undefined)
|
|
34
|
+
return;
|
|
35
|
+
const previous = this.exact.get(id);
|
|
36
|
+
if (previous) {
|
|
37
|
+
this.exact.delete(id);
|
|
38
|
+
this.exact.set(id, previous);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (this.exact.size >= 32) {
|
|
42
|
+
const oldest = this.exact.keys().next().value;
|
|
43
|
+
this.release(this.exact.get(oldest));
|
|
44
|
+
this.exact.delete(oldest);
|
|
45
|
+
}
|
|
46
|
+
this.observeExact(id);
|
|
47
|
+
}
|
|
48
|
+
observeExact(id) {
|
|
49
|
+
if (this.sdk.getLastServerInfoMessage()?.features?.ownedSubscriptions === true) {
|
|
50
|
+
this.observe(id);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
// Legacy directory subscriptions share one last-query-wins server slot.
|
|
54
|
+
// A non-subscribing seed preserves the broad stream for every target.
|
|
55
|
+
const read = { order: ++this.readOrder, priority: 0, ready: false, head: -1, pending: true, abort: new AbortController() }, page = this.page, previous = this.titles.get(id);
|
|
56
|
+
this.exact.set(id, read);
|
|
57
|
+
void this.sdk.fetchWorkspaces({ page: { limit: 1 }, filter: { idPrefix: id, includeInternal: false, includeBackground: false }, signal: read.abort.signal })
|
|
58
|
+
.then(value => {
|
|
59
|
+
if (!this.enabled || this.exact.get(id) !== read || this.page !== page)
|
|
60
|
+
return;
|
|
61
|
+
read.generation = value.sync?.generation;
|
|
62
|
+
read.head = value.sync?.headSeq ?? -1;
|
|
63
|
+
if (this.titles.get(id) === previous && this.acceptGeneration(read)) {
|
|
64
|
+
for (const workspace of value.entries.slice(0, 1))
|
|
65
|
+
if (workspace.id === id)
|
|
66
|
+
this.remember(workspace, read, read.head, true);
|
|
67
|
+
}
|
|
68
|
+
read.complete = true;
|
|
69
|
+
}).catch(() => { }).finally(() => { read.pending = false; });
|
|
70
|
+
}
|
|
71
|
+
observe(id) {
|
|
72
|
+
const owner = this.sdk.observeWorkspaces({ page: { limit: id ? 1 : 100 }, filter: { includeInternal: false, includeBackground: false, ...(id ? { idPrefix: id } : {}) } });
|
|
73
|
+
const read = { order: ++this.readOrder, priority: id ? 2 : 1, owner, ready: false, head: -1 };
|
|
74
|
+
if (id)
|
|
75
|
+
this.exact.set(id, read);
|
|
76
|
+
else
|
|
77
|
+
this.page = read;
|
|
78
|
+
const current = () => this.enabled && read.owner === owner && (id ? this.exact.get(id) === read : this.page === read);
|
|
79
|
+
// Subscription snapshots arrive asynchronously; publishing never awaits their RPC.
|
|
80
|
+
read.detach = owner.subscribe({
|
|
81
|
+
snapshot: value => {
|
|
82
|
+
if (!current())
|
|
83
|
+
return;
|
|
84
|
+
read.generation = value.sync?.generation;
|
|
85
|
+
read.head = value.sync?.headSeq ?? -1;
|
|
86
|
+
read.ready = true;
|
|
87
|
+
if (!this.acceptGeneration(read)) {
|
|
88
|
+
this.release(read);
|
|
89
|
+
if (!id)
|
|
90
|
+
this.pageIDs.clear();
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const entries = value.entries.slice(0, id ? 1 : 100).filter(workspace => !id || workspace.id === id);
|
|
94
|
+
if (!id) {
|
|
95
|
+
this.pageIDs = new Set(entries.map(workspace => workspace.id));
|
|
96
|
+
for (const exact of this.exact.values())
|
|
97
|
+
exact.complete = false;
|
|
98
|
+
}
|
|
99
|
+
for (const workspace of entries)
|
|
100
|
+
this.remember(workspace, read, read.head);
|
|
101
|
+
},
|
|
102
|
+
update: message => {
|
|
103
|
+
if (!current() || !read.ready || message.type !== 'workspace_update')
|
|
104
|
+
return;
|
|
105
|
+
const value = message.payload;
|
|
106
|
+
if (read.generation && value.generation && read.generation !== value.generation) {
|
|
107
|
+
this.release(read);
|
|
108
|
+
if (!id)
|
|
109
|
+
this.pageIDs.clear();
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
if (value.generation)
|
|
113
|
+
read.generation = value.generation;
|
|
114
|
+
if (value.seq !== undefined && value.seq <= read.head)
|
|
115
|
+
return;
|
|
116
|
+
if (value.seq !== undefined)
|
|
117
|
+
read.head = value.seq;
|
|
118
|
+
if (!this.acceptGeneration(read)) {
|
|
119
|
+
this.release(read);
|
|
120
|
+
if (!id)
|
|
121
|
+
this.pageIDs.clear();
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
const workspaceID = value.kind === 'remove' ? value.id : value.workspace.id;
|
|
125
|
+
if (id && workspaceID !== id)
|
|
126
|
+
return;
|
|
127
|
+
if (value.kind === 'remove') {
|
|
128
|
+
this.store({ id: workspaceID }, read, value.seq ?? -1);
|
|
129
|
+
this.pageIDs.delete(workspaceID);
|
|
130
|
+
}
|
|
131
|
+
else
|
|
132
|
+
this.remember(value.workspace, read, value.seq ?? -1);
|
|
133
|
+
},
|
|
134
|
+
error: () => { if (current()) {
|
|
135
|
+
this.release(read);
|
|
136
|
+
if (!id)
|
|
137
|
+
this.pageIDs.clear();
|
|
138
|
+
} },
|
|
139
|
+
});
|
|
140
|
+
void owner.ready.catch(() => { if (current()) {
|
|
141
|
+
this.release(read);
|
|
142
|
+
if (!id)
|
|
143
|
+
this.pageIDs.clear();
|
|
144
|
+
} });
|
|
145
|
+
return read;
|
|
146
|
+
}
|
|
147
|
+
acceptGeneration(read) {
|
|
148
|
+
if (!read.generation)
|
|
149
|
+
return true;
|
|
150
|
+
if (read.generation === this.generation) {
|
|
151
|
+
this.generationOrder = Math.max(this.generationOrder, read.order);
|
|
152
|
+
return true;
|
|
153
|
+
}
|
|
154
|
+
if (this.retiredGenerations.has(read.generation) || read.order < this.generationOrder)
|
|
155
|
+
return false;
|
|
156
|
+
if (this.generation)
|
|
157
|
+
this.retiredGenerations.add(this.generation);
|
|
158
|
+
while (this.retiredGenerations.size > 32)
|
|
159
|
+
this.retiredGenerations.delete(this.retiredGenerations.values().next().value);
|
|
160
|
+
this.generation = read.generation;
|
|
161
|
+
this.generationOrder = read.order;
|
|
162
|
+
return true;
|
|
163
|
+
}
|
|
164
|
+
remember(workspace, read, head, seed = false) {
|
|
165
|
+
const value = workspace.internal || workspace.background ? { id: workspace.id } : { id: workspace.id, title: workspace.title ?? null };
|
|
166
|
+
this.store(value, read, head, seed);
|
|
167
|
+
}
|
|
168
|
+
store(value, read, head, seed = false) {
|
|
169
|
+
const previous = this.titles.get(value.id);
|
|
170
|
+
if (previous) {
|
|
171
|
+
if (previous.generation && !read.generation)
|
|
172
|
+
return;
|
|
173
|
+
const sameGeneration = previous.generation === read.generation;
|
|
174
|
+
if (sameGeneration && head >= 0 && previous.head >= 0) {
|
|
175
|
+
if (head <= previous.head)
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
else if (sameGeneration && !seed && previous.read !== read) {
|
|
179
|
+
if (previous.read.priority > read.priority && (previous.read.owner || previous.read.order >= read.order)
|
|
180
|
+
|| previous.read.priority === read.priority && previous.read.order > read.order)
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
this.titles.delete(value.id);
|
|
185
|
+
this.titles.set(value.id, { value, read, generation: read.generation, head });
|
|
186
|
+
// Retained recovery rows and exact targets share a fixed memory budget.
|
|
187
|
+
while (this.titles.size > 132) {
|
|
188
|
+
const oldest = [...this.titles.keys()].find(id => !this.exact.has(id));
|
|
189
|
+
if (oldest === undefined)
|
|
190
|
+
break;
|
|
191
|
+
this.titles.delete(oldest);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
release(read) {
|
|
195
|
+
const owner = read.owner;
|
|
196
|
+
read.owner = undefined;
|
|
197
|
+
read.detach?.();
|
|
198
|
+
read.detach = undefined;
|
|
199
|
+
read.ready = false;
|
|
200
|
+
read.abort?.abort();
|
|
201
|
+
void owner?.release().catch(() => { });
|
|
202
|
+
}
|
|
203
|
+
stop() {
|
|
204
|
+
this.enabled = false;
|
|
205
|
+
if (this.page)
|
|
206
|
+
this.release(this.page);
|
|
207
|
+
this.page = undefined;
|
|
208
|
+
for (const read of this.exact.values())
|
|
209
|
+
this.release(read);
|
|
210
|
+
this.exact.clear();
|
|
211
|
+
this.pageIDs.clear();
|
|
212
|
+
this.titles.clear();
|
|
213
|
+
this.generation = undefined;
|
|
214
|
+
this.generationOrder = -1;
|
|
215
|
+
this.retiredGenerations.clear();
|
|
216
|
+
}
|
|
217
|
+
}
|
|
@@ -99,12 +99,14 @@ export declare class OfficialClient implements OfficialOperations {
|
|
|
99
99
|
lastUsage?: import("@getpaseo/protocol/agent-types").AgentUsage | undefined;
|
|
100
100
|
lastError?: string | undefined;
|
|
101
101
|
requiresAttention?: boolean | undefined;
|
|
102
|
-
attentionReason?: "
|
|
102
|
+
attentionReason?: "error" | "permission" | "finished" | null | undefined;
|
|
103
103
|
attentionTimestamp?: string | null | undefined;
|
|
104
104
|
archivedAt?: string | null | undefined;
|
|
105
105
|
providerUnavailable?: boolean | undefined;
|
|
106
106
|
internal?: boolean | undefined;
|
|
107
107
|
}[];
|
|
108
|
+
workspaces: import("./live-activity-titles.js").LiveWorkspace[];
|
|
109
|
+
requestWorkspace: (id: string) => void;
|
|
108
110
|
} | null;
|
|
109
111
|
info(): ServerInfoStatusPayload | null;
|
|
110
112
|
private emit;
|
|
@@ -175,7 +177,7 @@ export declare class OfficialClient implements OfficialOperations {
|
|
|
175
177
|
lastUsage?: import("@getpaseo/protocol/agent-types").AgentUsage | undefined;
|
|
176
178
|
lastError?: string | undefined;
|
|
177
179
|
requiresAttention?: boolean | undefined;
|
|
178
|
-
attentionReason?: "
|
|
180
|
+
attentionReason?: "error" | "permission" | "finished" | null | undefined;
|
|
179
181
|
attentionTimestamp?: string | null | undefined;
|
|
180
182
|
archivedAt?: string | null | undefined;
|
|
181
183
|
providerUnavailable?: boolean | undefined;
|
package/dist/official-client.js
CHANGED
|
@@ -104,6 +104,13 @@ export class OfficialClient {
|
|
|
104
104
|
else
|
|
105
105
|
this.readTerminal(event);
|
|
106
106
|
}
|
|
107
|
+
else {
|
|
108
|
+
// Recover pending question/permission prompts immediately when agent_attention_required
|
|
109
|
+
// arrives without a preceding agent_permission_request.
|
|
110
|
+
this.fenceRequestReads(p.agentId, ++this.observationOrder);
|
|
111
|
+
void this.readCurrent(p.agentId, agent => { for (const r of agent?.pendingPermissions || [])
|
|
112
|
+
this.emitRequest(p.agentId, r); }).catch(() => { });
|
|
113
|
+
}
|
|
107
114
|
}
|
|
108
115
|
if (message.type === 'agent_permission_request') {
|
|
109
116
|
const p = message.payload;
|
|
@@ -127,7 +134,7 @@ export class OfficialClient {
|
|
|
127
134
|
await this.subscription.ready;
|
|
128
135
|
}
|
|
129
136
|
setLiveActivityEnabled(enabled) { this.liveDirectory.setEnabled(enabled); }
|
|
130
|
-
liveActivitySnapshot() { const agents = this.liveDirectory.snapshot(); return agents ? { daemonServerId: this.serverId, hostName: this.info()?.hostname || hostname(), agents } : null; }
|
|
137
|
+
liveActivitySnapshot() { const agents = this.liveDirectory.snapshot(); return agents ? { daemonServerId: this.serverId, hostName: this.info()?.hostname || hostname(), agents, workspaces: this.liveDirectory.workspaces(), requestWorkspace: (id) => this.liveDirectory.requestWorkspace(id) } : null; }
|
|
131
138
|
info() { return this.sdk.getLastServerInfoMessage(); }
|
|
132
139
|
emit(event) { if (Number.isSafeInteger(event.timestamp) && event.timestamp >= 0)
|
|
133
140
|
for (const cb of this.callbacks)
|
package/dist/projection.js
CHANGED
|
@@ -9,7 +9,7 @@ export async function projectSnapshot(source, pair, journal, generation) {
|
|
|
9
9
|
const occurrence = journal.currentOccurrence(source.daemonServerId, task.agentId, pending.requestId);
|
|
10
10
|
if (!occurrence || occurrence.generation !== generation || occurrence.fingerprint !== digest(canonical(pending.request)))
|
|
11
11
|
continue;
|
|
12
|
-
if (Buffer.byteLength(task.agentId) > 256 || Buffer.byteLength(pending.requestId) > 256 || Buffer.byteLength(JSON.stringify(pending.request)) >
|
|
12
|
+
if (Buffer.byteLength(task.agentId) > 256 || Buffer.byteLength(pending.requestId) > 256 || Buffer.byteLength(JSON.stringify(pending.request)) > 24576)
|
|
13
13
|
throw Error('NOTIFICATION_REQUEST_LIMIT');
|
|
14
14
|
const requestBinding = await occurrenceBinding(pair, occurrence);
|
|
15
15
|
if (journal.isCurrent(occurrence))
|
package/dist/resources.js
CHANGED
|
@@ -32,9 +32,25 @@ export function inspectResource(path, kind, optional = false, privateMode = true
|
|
|
32
32
|
assertResource(stat, kind, privateMode);
|
|
33
33
|
return stat;
|
|
34
34
|
}
|
|
35
|
+
function inspectReadPath(path, privateMode, opened) {
|
|
36
|
+
const observed = lstatSync(path);
|
|
37
|
+
assertResource(observed, 'file', privateMode, true);
|
|
38
|
+
if (opened && sameResource(opened, observed) && (opened.size !== observed.size || opened.mtimeMs !== observed.mtimeMs))
|
|
39
|
+
throw Error('FOREIGN_RESOURCE_CHANGED');
|
|
40
|
+
if (observed.nlink !== 0)
|
|
41
|
+
return observed;
|
|
42
|
+
// POSIX pathname lookup can retain the old inode while rename retires it.
|
|
43
|
+
// Only a different, strictly validated owned replacement permits reopening.
|
|
44
|
+
const replacement = inspectResource(path, 'file', false, privateMode);
|
|
45
|
+
if (!replacement || sameResource(observed, replacement))
|
|
46
|
+
throw Error('FOREIGN_RESOURCE_CHANGED');
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
35
49
|
export function readPrivateText(path, limit, encoding = 'utf8', privateMode = true) {
|
|
36
50
|
for (let attempt = 0; attempt < 3; attempt++) {
|
|
37
|
-
const before =
|
|
51
|
+
const before = inspectReadPath(path, privateMode);
|
|
52
|
+
if (!before)
|
|
53
|
+
continue;
|
|
38
54
|
const fd = openSync(path, constants.O_RDONLY | constants.O_NOFOLLOW | constants.O_NONBLOCK);
|
|
39
55
|
try {
|
|
40
56
|
const opened = fstatSync(fd);
|
|
@@ -67,7 +83,9 @@ export function readPrivateText(path, limit, encoding = 'utf8', privateMode = tr
|
|
|
67
83
|
// later atomic replacement would otherwise permit reopening the pathname.
|
|
68
84
|
if (opened.size !== size || opened.size !== finished.size || opened.mtimeMs !== finished.mtimeMs)
|
|
69
85
|
throw Error('FOREIGN_RESOURCE_CHANGED');
|
|
70
|
-
const after =
|
|
86
|
+
const after = inspectReadPath(path, privateMode, opened);
|
|
87
|
+
if (!after)
|
|
88
|
+
continue;
|
|
71
89
|
// Only an ordinary owned replacement permits another read. Linked, foreign
|
|
72
90
|
// or insecure paths fail inspection, and in-place mutation is never retried.
|
|
73
91
|
if (after && !sameResource(opened, after))
|
package/dist/runtime.js
CHANGED
|
@@ -320,11 +320,14 @@ export async function runRuntime(dir, version) {
|
|
|
320
320
|
if (!active)
|
|
321
321
|
continue;
|
|
322
322
|
let detailsCurrent = false;
|
|
323
|
+
let allowUngatedRequests = false;
|
|
323
324
|
try {
|
|
324
325
|
const payload = await projectSnapshot({ ...official.notificationSnapshot(), hostName: snapshot.hostName, measuredAt: snapshot.measuredAt }, pair, journal, official.generation);
|
|
325
326
|
detailsCurrent = await statePublisher.publish(pair, cloud, payload);
|
|
326
327
|
}
|
|
327
328
|
catch (error) {
|
|
329
|
+
if (error instanceof Error && (error.message === 'NOTIFICATION_REQUEST_LIMIT' || error.message === 'NOTIFICATION_STATE_LIMIT'))
|
|
330
|
+
allowUngatedRequests = true;
|
|
328
331
|
failure = error;
|
|
329
332
|
if (await observeRelayRetirement(config, dir, pair, cloud, error))
|
|
330
333
|
continue;
|
|
@@ -336,7 +339,7 @@ export async function runRuntime(dir, version) {
|
|
|
336
339
|
failure = error;
|
|
337
340
|
}
|
|
338
341
|
try {
|
|
339
|
-
await publishEvents(pair, cloud, journal, livePublisher, official.liveActivitySnapshot(), detailsCurrent);
|
|
342
|
+
await publishEvents(pair, cloud, journal, livePublisher, official.liveActivitySnapshot(), detailsCurrent, allowUngatedRequests);
|
|
340
343
|
}
|
|
341
344
|
catch (error) {
|
|
342
345
|
failure = error;
|
package/docs/STATE.md
CHANGED
|
@@ -1,6 +1,48 @@
|
|
|
1
1
|
# Project state
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Public0.1.8 — 2026-11-15
|
|
4
|
+
|
|
5
|
+
Reviewed sourced545c23 is public as0.1.8. All3OS CI43718667202 and release
|
|
6
|
+
43719303096 pass, including actual packaged upgrade/rollback. POSIX checks pass
|
|
7
|
+
279/279; Windows passes246with33explicit platform skips and zero failures.
|
|
8
|
+
Final resource security regressions pass36/36with two independent same-provider
|
|
9
|
+
security contexts; unavailable cross-provider review is not claimed as approval.
|
|
10
|
+
|
|
11
|
+
Anonymous registry read reports latest0.1.8; an exact-version install with empty
|
|
12
|
+
npm credential configuration and isolated HOME prints0.1.8. Its106package files
|
|
13
|
+
equal the archive bytes. Local tested/npm/GitHub tarballs and SHA256SUMS match:
|
|
14
|
+
`2ce3f482208d8f5b8d8cbe3a34cacead401ec278d2f4b6e11ec4b0de81f66179`.
|
|
15
|
+
The public archive is170832bytes. Initial failed CI/RED evidence and npm processing
|
|
16
|
+
delay are preserved in [[2026-11-15-title-provenance-release]]. Dependencies and
|
|
17
|
+
compatibility tuple remain unchanged. No everyday service or real provider
|
|
18
|
+
session was modified by release/receiver acceptance. Do not republish or retag0.1.8.
|
|
19
|
+
|
|
20
|
+
## Earlier local title-provenance checkpoint — before0.1.8
|
|
21
|
+
|
|
22
|
+
The activity endpoint accepts bounded encrypted source hints and resolves current
|
|
23
|
+
official workspace names through an active-only owned read subscription. A separate
|
|
24
|
+
private capability file preserves the exact legacy enrollment descriptor/tree and
|
|
25
|
+
rollback discovery. Targeted tests first reproduced rejected hints and missing
|
|
26
|
+
capability publication, then unknown-metadata, cross-owner ordering and cache
|
|
27
|
+
recovery failures. Final frozen checks pass types,267complete tests with zero
|
|
28
|
+
failures/skips and compilation;24focused tests also pass. Full tests use explicit
|
|
29
|
+
concurrency4 with all original timing assertions unchanged. Initial default
|
|
30
|
+
concurrency258tests had2runtime-deadline failures; both pass the final complete run.
|
|
31
|
+
See [[2026-11-15-live-activity-title-provenance]]. Source remains uncommitted;
|
|
32
|
+
no package release, service installation or physical device acceptance is implied.
|
|
33
|
+
|
|
34
|
+
## Public0.1.7 — 2026-11-15
|
|
35
|
+
|
|
36
|
+
Reviewed sourceb6756ca is public as0.1.7. All3OS CI43645424293 and release
|
|
37
|
+
43646031281 pass; anonymous registry download/install and exact frontend version
|
|
38
|
+
verify availability. Tested/npm/GitHub archive bytes and integrity match. Final
|
|
39
|
+
local250tests, types/build, packaged upgrade/rollback and audit0 pass. See
|
|
40
|
+
[[2026-11-15-informative-notifications-activity-release]]. No real host service
|
|
41
|
+
or physical APNs delivery is implied. Corresponding native/service rollout is
|
|
42
|
+
separately recorded; prior local-only checkpoints below remain historical.
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
## Earlier local remote activity checkpoint — before0.1.7
|
|
4
46
|
|
|
5
47
|
The owner-authorized v2 path shares CLI attention/activity event ingress and the
|
|
6
48
|
existing APNs infrastructure. Native foreground-started activities receive encrypted
|
|
@@ -12,7 +54,7 @@ skips, App83, real system journeys2and unsigned Release all pass. See
|
|
|
12
54
|
|
|
13
55
|
Updated: 2026-11-15
|
|
14
56
|
|
|
15
|
-
##
|
|
57
|
+
## Earlier local notification preview checkpoint — before0.1.7
|
|
16
58
|
|
|
17
59
|
Optional endpoint-encrypted session/host/current-content previews are implemented
|
|
18
60
|
on `fix/notification-content-1115`, with unchanged action/route authority, exact
|
|
@@ -20,7 +62,7 @@ retries and original expiry. No new package, Worker or physical APNs acceptance
|
|
|
20
62
|
is claimed. Final local checks and compatibility/review evidence:
|
|
21
63
|
[[2026-11-15-informative-notifications-and-settings]].
|
|
22
64
|
|
|
23
|
-
##
|
|
65
|
+
## Previous public release0.1.6
|
|
24
66
|
|
|
25
67
|
`@moxuli/moremote@0.1.6` is independently available and installable. Source
|
|
26
68
|
`c38e2b07adc88e6fd5f4e18ef9c41fb87b51f9b9`, immutable tagv0.1.6,
|
package/docs/configuration.md
CHANGED
|
@@ -47,6 +47,11 @@ bound, including the serialized trailing newline. This accommodates16 maximum
|
|
|
47
47
|
serialization. Oversize writes fail before replacing any config. Fresh `run`
|
|
48
48
|
initializes config only after acquiring runtime ownership; duplicate `run`
|
|
49
49
|
refuses without rewriting a live enrollment snapshot.
|
|
50
|
+
Private text reads allow at most3attempts across atomic replacements. A POSIX
|
|
51
|
+
pathname lookup returning a retired inode with link count0 permits reopening
|
|
52
|
+
only after a different ordinary owned replacement passes strict validation.
|
|
53
|
+
No retired handle bytes are returned; linked/foreign/insecure resources and
|
|
54
|
+
observed in-place mutation remain failures. Mutation-path ownership is unchanged.
|
|
50
55
|
|
|
51
56
|
The private tree is `<home>/.moremote-cli-connect/<sha256(UTF8 daemonServerId)>/`;
|
|
52
57
|
its parent/host/request/response directories have owned markers and POSIX0700.
|
|
@@ -113,6 +118,22 @@ activity/widget provider registration or discovery command remains.
|
|
|
113
118
|
|
|
114
119
|
## Service resources
|
|
115
120
|
|
|
121
|
+
Activity title support has no new config toggle. While existing local enrollment
|
|
122
|
+
owns its daemon lock, it publishes a nonsecret private file at
|
|
123
|
+
`<home>/.moremote-cli-activity/<sha256(UTF8 daemonServerId)>/capabilities.json`.
|
|
124
|
+
The exact version1 capability contains daemon/instance identity, the current
|
|
125
|
+
descriptor's measuredAt/expiresAt and `titleHints:1`; it renews with that90s/30s
|
|
126
|
+
descriptor lease and is removed only by the matching instance. This independent
|
|
127
|
+
marked0700/0600 tree leaves legacy discovery and rollback layouts unchanged.
|
|
128
|
+
Only an active activity acquires the additional bounded100-workspace official
|
|
129
|
+
read subscription. Targets omitted from that page acquire at most32 exact owned
|
|
130
|
+
reads, with exact-ID checks on prefix-query responses. Legacy hosts use one-time
|
|
131
|
+
non-subscribing seeds and retain the broad stream, preserving their connection-wide
|
|
132
|
+
subscription slot. Recovery metadata shares a132-row cap; every stop releases
|
|
133
|
+
owners and fences late responses. Phone source hints are at most32 entries and
|
|
134
|
+
4000 UTF-8 JSON bytes, contain IDs/source only, and do not change config, authority
|
|
135
|
+
or cloud cadence. Unknown metadata delays activity only; notifications keep flowing.
|
|
136
|
+
|
|
116
137
|
macOS: user Library/LaunchAgents/com.moremote.cli.plist. Linux: XDG_CONFIG_HOME/systemd/user/moremote-cli.service (fallback user .config). Windows: current-user task MoRemoteCLI and UTF-16 XML in CLI state, InteractiveToken/LeastPrivilege; built-in PowerShell checks exact existing task ownership before schtasks mutation. Marker binds the data-directory hash; manager registration/file ownership mismatch fails closed. A private CLI root marker refuses nonempty foreign directories and gates purge. No official Paseo service/resource is altered. Missing managers fail honestly.
|
|
117
138
|
|
|
118
139
|
## Update source
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Informative notifications and remote activity release — 0.1.7
|
|
2
|
+
|
|
3
|
+
Owner-authorized sourceb6756ca861ad8dc56728eae6896a91fbf7331bcf is merged and
|
|
4
|
+
pushed to main. Three-platform CI43645424293 passes complete checks and real
|
|
5
|
+
packaged upgrade/rollback on macOS15, Ubuntu24.04 and Windows2025. The exact
|
|
6
|
+
v0.1.7 tag triggers successful release43646031281, repeating full checks,
|
|
7
|
+
upgrade/rollback and deterministic packing before npm provenance publication and
|
|
8
|
+
the corresponding GitHub Release. Existing scoped publishing authority is reused.
|
|
9
|
+
|
|
10
|
+
An independent anonymous exact-version registry download and isolated-prefix
|
|
11
|
+
install verify0.1.7. Actual frontend --version reports0.1.7 under an isolated
|
|
12
|
+
empty CLI/Paseo state, without a service or official connection. Local tested,
|
|
13
|
+
GitHub Release and npm archives are byte-identical; npm integrity matches.
|
|
14
|
+
SHA256: `af959601bc92f71680aee07329932551924990b6b436bc71bcd6df2eaa6c7495`.
|
|
15
|
+
Archive size:158646bytes. Initial public404 after the accepted publish is retained;
|
|
16
|
+
public availability is established only by the later successful receiver.
|
|
17
|
+
The first isolated npm helper reused one file as both global/user config; npm
|
|
18
|
+
rejected this before installation. Separate empty configs correct the helper,
|
|
19
|
+
without any product, credential, package or tag change.
|
|
20
|
+
|
|
21
|
+
Fresh final local checks pass250tests, types/build, real isolated packaged
|
|
22
|
+
upgrade/rollback, deterministic packing and npm audit with zero vulnerabilities.
|
|
23
|
+
The release audit caught existing ws8.20.0 advisory ranges; the manifest/lock now
|
|
24
|
+
pin8.21.0 while Node24.13.0 and official Paseo SDK/protocol pins stay unchanged.
|
|
25
|
+
Upstream primary advisories: GHSA-96hv-2xvq-fx4p and GHSA-58qx-3vcg-4xpx.
|
|
26
|
+
No real user service was installed/restarted as publication acceptance.
|
|
27
|
+
|
|
28
|
+
Informative previews and optional remote update/end need their corresponding
|
|
29
|
+
App/service rollout. Widgets remain direct Paseo clients. Physical APNs display,
|
|
30
|
+
background OS scheduling and general native action acceptance remain separate.
|
|
31
|
+
Private evidence: moremote-release-20261115-8ed079_h under MoRemoteAcceptance.
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Live Activity title provenance — local, unreleased
|
|
2
|
+
|
|
3
|
+
## Root cause and correction
|
|
4
|
+
|
|
5
|
+
The notification path already resolves App-authorized workspace names, while the
|
|
6
|
+
companion activity path projected the raw provider agent title. Blindly replacing
|
|
7
|
+
that encrypted title with App catalog text would let stale cached names replace
|
|
8
|
+
fresh remote renames. Inferring workspace authority from a partial recent agent
|
|
9
|
+
page would also regress imported or shared-root conversations.
|
|
10
|
+
|
|
11
|
+
Encrypted activity interests may now carry at most32 exact source hints whose
|
|
12
|
+
complete UTF-8 JSON array is at most4000bytes. They contain only agent/workspace
|
|
13
|
+
IDs and conversation/workspace provenance. Matching workspace hints authorize
|
|
14
|
+
fresh official workspace metadata; conversation/mismatched/missing hints retain
|
|
15
|
+
fresh agent text. Visible independent roots can disprove workspace authority,
|
|
16
|
+
never manufacture it. Managed children do not become roots.
|
|
17
|
+
|
|
18
|
+
An active activity owns a bounded100-workspace read subscription. Missing targets
|
|
19
|
+
acquire at most32 exact reads with exact-ID response checks and a132-row shared
|
|
20
|
+
cache. Owned-subscription hosts use separate target owners. Legacy hosts use
|
|
21
|
+
non-subscribing seeds, preserving their connection-wide broad subscription slot.
|
|
22
|
+
Stop releases owners and fences late read results. No Worker poll is added.
|
|
23
|
+
|
|
24
|
+
Unknown metadata delays activity publication independently of attention delivery.
|
|
25
|
+
Read errors and page omissions retain confirmed names; a full official entry
|
|
26
|
+
without a title normalizes to null, while a removed record stays unknown. Shared
|
|
27
|
+
rows compare generation/sequence across observers; retired generations and
|
|
28
|
+
released ownership cannot restore older names. Unversioned owned exact reads
|
|
29
|
+
conservatively outrank broad reads, and legacy seeds cannot overwrite newer
|
|
30
|
+
stream observations. Page membership skips a targeted read only while known
|
|
31
|
+
metadata remains cached. Original unacknowledged publications retain exact bytes.
|
|
32
|
+
|
|
33
|
+
## Rolling compatibility
|
|
34
|
+
|
|
35
|
+
The legacy enrollment descriptor is exact-field validated by older App versions;
|
|
36
|
+
the legacy discovery directory also rejects unknown resources. Neither changes.
|
|
37
|
+
Capability support is published separately at
|
|
38
|
+
`<home>/.moremote-cli-activity/<sha256(UTF8 daemonServerId)>/capabilities.json`.
|
|
39
|
+
The exact version1 document contains daemon/instance identity, descriptor lease
|
|
40
|
+
clocks and `titleHints:1`, with no title text or keys. Its independent marked
|
|
41
|
+
private tree follows existing enrollment lock ownership and matching-instance
|
|
42
|
+
cleanup. Old-runtime rollback ignores that directory; old capability files fail
|
|
43
|
+
fresh descriptor instance/expiry checks. Config and cloud HTTP shapes are unchanged.
|
|
44
|
+
|
|
45
|
+
## Verification and review
|
|
46
|
+
|
|
47
|
+
New capability/strict-interest tests first failed with missing files/rejected
|
|
48
|
+
hints. The initial owner test then failed without workspace observation. Later
|
|
49
|
+
regressions reproduced raw-title publication before metadata readiness, loss of
|
|
50
|
+
confirmed names during recovery, legacy seed races, cross-owner sequence rollback,
|
|
51
|
+
unversioned observer precedence, missing-title confusion and cache-eviction stalls.
|
|
52
|
+
Each behavioral correction was preceded by its failing regression.
|
|
53
|
+
|
|
54
|
+
The initial complete default-concurrency run reported258tests,256passes and2
|
|
55
|
+
runtime-deadline failures (`REPAIRED_RUNTIME_COULD_NOT_ACQUIRE` and
|
|
56
|
+
`RECEIPT_OR_STATE_BLOCKED_COMMANDS`). Deadlines and production timeouts were not
|
|
57
|
+
weakened. Intermediate complete concurrency4 runs passed265/265and267/267.
|
|
58
|
+
After the final cache-membership fix, the frozen complete check passes types,
|
|
59
|
+
267tests with zero failures/skips, and compilation. Final focused regressions
|
|
60
|
+
pass24/24. The accepted command is the complete check sequence with explicit
|
|
61
|
+
test concurrency4:
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
npm run typecheck
|
|
65
|
+
node --import tsx --test --test-concurrency=4 tests/*.test.ts
|
|
66
|
+
npm run build
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Both legacy and owned real-SDK wire fixtures cover workspace bootstrap arriving
|
|
70
|
+
after agents, current rename, exact target metadata, non-subscribing legacy wire
|
|
71
|
+
behavior and late response after release. The independent notification consumer
|
|
72
|
+
proves unknown title metadata does not block its attention outbox. Existing
|
|
73
|
+
immutable activity retry and real runtime acquisition/receipt tests remain green.
|
|
74
|
+
|
|
75
|
+
Independent-context review found the cross-subscription ordering blocker, which
|
|
76
|
+
now has an explicit RED/GREEN regression. Parent review additionally identified
|
|
77
|
+
unknown metadata, full-entry title semantics and cache membership edges; those
|
|
78
|
+
are covered. External-provider attempts yielded no usable review because of
|
|
79
|
+
account/transport availability; no cross-vendor approval is claimed. Actual final
|
|
80
|
+
logs and clearly labeled early output excerpts are in this run's local CLI
|
|
81
|
+
acceptance bundle. Source remained uncommitted at handoff.
|
|
82
|
+
|
|
83
|
+
## Boundary
|
|
84
|
+
|
|
85
|
+
Only CLI code/tests/contracts changed. There was no package/tag publication,
|
|
86
|
+
deployment, service installation, dependency upgrade or real provider-session
|
|
87
|
+
mutation. Native/Cloud changes and physical APNs display remain independently
|
|
88
|
+
owned acceptance scopes.
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# Title provenance release0.1.8
|
|
2
|
+
|
|
3
|
+
## Authorized scope and preflight
|
|
4
|
+
|
|
5
|
+
The owner explicitly authorized0.1.8publication alongside the related App update.
|
|
6
|
+
The reviewed title-provenance implementation is unchanged from the accepted
|
|
7
|
+
source snapshot. Initial preparation changes package/lock root versions, README
|
|
8
|
+
and release records; dependencies and compatibility tuple remain pinned.
|
|
9
|
+
The original seven-field enrollment descriptor and rollback discovery layout
|
|
10
|
+
remain unchanged. Source behavior and historical failed-check evidence are in
|
|
11
|
+
[[2026-11-15-live-activity-title-provenance]].
|
|
12
|
+
|
|
13
|
+
Fresh Node24.13.0 `npm ci --ignore-scripts` installs the pinned lock and audits
|
|
14
|
+
zero vulnerabilities. Default `npm run check` passes267tests with zero failures
|
|
15
|
+
or skips, plus typecheck/build. Actual `npm run smoke:upgrade` accepts compatible
|
|
16
|
+
activation, failed-candidate rollback, retained bootstrap/previous, aliased
|
|
17
|
+
frontend selection and clean stop. It uses disposable private prefixes and owned
|
|
18
|
+
test processes; no native login service or real provider session is touched.
|
|
19
|
+
`node scripts/release.mjs validate v0.1.8` passes. Deterministic pack and hosted
|
|
20
|
+
publication/receiver results are recorded separately after their actual completion.
|
|
21
|
+
|
|
22
|
+
Independent same-provider follow-up `run-20261115121907-cdb3164c` closes all4
|
|
23
|
+
initial blockers and independently passes11CLI tests. The earlier external
|
|
24
|
+
provider account hold yielded no review; this is an independent-context fallback,
|
|
25
|
+
not a cross-vendor approval. The previously accepted complete267/267and focused
|
|
26
|
+
24/24results remain preserved alongside this fresh release gate.
|
|
27
|
+
|
|
28
|
+
## Hosted pathname-read race found before tagging
|
|
29
|
+
|
|
30
|
+
Candidate541715e's first hosted CI exposed `FOREIGN_RESOURCE_LINKS` in the real
|
|
31
|
+
local-enrollment consumer's config read on Ubuntu. The tag was withheld. Initial
|
|
32
|
+
and final pathname lookup can observe a valid owned inode whose link count has
|
|
33
|
+
already become0during atomic rename, before the stat result reaches the caller.
|
|
34
|
+
The previous reader handled that retirement only after opening a file descriptor.
|
|
35
|
+
|
|
36
|
+
Two deterministic regressions hold the real old inode, rename its replacement,
|
|
37
|
+
and return that inode's actual retired fstat as the pathname lookup result; both
|
|
38
|
+
failed with the hosted stack's error before the fix. The minimal private-reader
|
|
39
|
+
helper recognizes only retired0, strictly validates a different ordinary owned
|
|
40
|
+
replacement and reopens within the original3attempts. General inspect/write/delete
|
|
41
|
+
paths remain strict. Eight additional retirement-to-foreign replacement cases
|
|
42
|
+
retain symlink/hardlink/mode/limit rejection. Original observed-mutation and
|
|
43
|
+
continuous-replacement tests remain intact. The resource suites pass34/34locally;
|
|
44
|
+
the10POSIX retirement-specific cases are explicitly unsupported on Windows.
|
|
45
|
+
Original candidate bytes/checksum, hosted failure and actual RED/GREEN logs are
|
|
46
|
+
retained separately rather than overwritten or described as a successful release.
|
|
47
|
+
|
|
48
|
+
Independent Codex review then found an integrity gap: final pathname lookup could
|
|
49
|
+
observe size/mtime changes made after the final handle fstat, yet the retired0
|
|
50
|
+
branch discarded that observation. Two actual-fd truncate/equal-size regressions
|
|
51
|
+
first failed. The final helper receives the opened snapshot and rejects observed
|
|
52
|
+
same-inode size/mtime differences before any retirement retry; retirement's own
|
|
53
|
+
ctime change is not treated as a content write. Resource suites now pass36/36.
|
|
54
|
+
The first independent reviewer re-ran36/36and closed its P2 in follow-up
|
|
55
|
+
`run-20261115131303-ff270ab1`; a second independent static security context matched
|
|
56
|
+
the frozen source/test hashes and confirmed the corrected final-read fence.
|
|
57
|
+
Both are same-provider fallbacks, not cross-provider approvals. Wrong-uid, fd-close
|
|
58
|
+
counts and no-read-on-retired-handle are verified by control flow rather than
|
|
59
|
+
new direct counters in these regressions.
|
|
60
|
+
|
|
61
|
+
The obsolete initial CI retained its Ubuntu failure and macOS success. Windows
|
|
62
|
+
was canceled after its real enrollment consumer missed the original15s admission
|
|
63
|
+
deadline; its stalled teardown made the job linger. That failure is not described
|
|
64
|
+
as a proven consequence of the POSIX lookup race. The fixture now reports only
|
|
65
|
+
allowlisted stage/error codes and synthetic request counts, and stops its own
|
|
66
|
+
child before server teardown on failures/abort. Original15s/20sassertions remain
|
|
67
|
+
unchanged. A new complete source/test check and all3hosted platforms are required
|
|
68
|
+
for the final candidate; the initial CI is not accepted as the release gate.
|
|
69
|
+
|
|
70
|
+
The final frozen production guard and diagnostic fixture pass a fresh default
|
|
71
|
+
complete279/279check with types/build and the actual packaged upgrade/rollback
|
|
72
|
+
smoke. The focused real enrollment consumer passes1/1. A separate temporary
|
|
73
|
+
failure probe disables its synthetic claim and deliberately uses a1500msprobe
|
|
74
|
+
admission deadline; it retains the failure and exits with owned-child/server
|
|
75
|
+
teardown in2.685s. That probe does not alter the repository's15s/20sassertions.
|
|
76
|
+
Final hosted and receiver results follow below.
|
|
77
|
+
|
|
78
|
+
## Public release and independent receiver acceptance
|
|
79
|
+
|
|
80
|
+
Source `d545c23a9dfcbd6c9b1983a907488d61cbcad785` is the immutablev0.1.8tag.
|
|
81
|
+
CI43718667202 succeeds on Ubuntu24.04, macOS15 and Windows2025, including actual
|
|
82
|
+
packaged upgrade/rollback. POSIX suites pass279/279with zero skips; Windows
|
|
83
|
+
passes246and explicitly skips33platform-specific cases, with zero failures.
|
|
84
|
+
Release43719303096 repeats the complete Linux check/upgrade smoke and produces
|
|
85
|
+
byte-deterministic validated archives before accepting npm publication and
|
|
86
|
+
creating the public GitHub Release. No initial failed candidate was tagged.
|
|
87
|
+
|
|
88
|
+
The first anonymous npm exact-version read remained404while npm explicitly
|
|
89
|
+
reported background processing; acceptance waited without republishing. At
|
|
90
|
+
2026-11-15T13:39Z the anonymous registry exposes0.1.8and latest0.1.8. An exact
|
|
91
|
+
public install uses empty user/global npm configuration, no npm authentication
|
|
92
|
+
environment and temporary HOME/prefix/cache; the real frontend prints0.1.8.
|
|
93
|
+
All106installed package files match the public archive. No native service or
|
|
94
|
+
real provider session is installed, restarted or upgraded by this acceptance.
|
|
95
|
+
|
|
96
|
+
Anonymous npm and GitHub downloads equal the original tested local archive and
|
|
97
|
+
the GitHub SHA256SUMS attachment. The170832-byte archive SHA256 is:
|
|
98
|
+
|
|
99
|
+
`2ce3f482208d8f5b8d8cbe3a34cacead401ec278d2f4b6e11ec4b0de81f66179`.
|
|
100
|
+
|
|
101
|
+
The npm integrity/SHA1 values also match independently calculated archive hashes.
|
|
102
|
+
GitHub's anonymous API was rate-limited; existing authenticated CLI readback
|
|
103
|
+
confirms non-draft/non-prerelease metadata, while asset downloads remain anonymous.
|
|
104
|
+
No credential/account configuration was changed. Public release:
|
|
105
|
+
[v0.1.8](https://github.com/moxuli/moremote-cli/releases/tag/v0.1.8).
|
|
106
|
+
|
|
107
|
+
Local acceptance evidence retains public metadata, final job logs, anonymous
|
|
108
|
+
installation output, archive bytes/checksums, reviewed source hashes, the exact
|
|
109
|
+
initial failed candidate and all stated RED/GREEN/review records. Publication is
|
|
110
|
+
complete;0.1.8must never be republished or retagged to include later documentation.
|
|
111
|
+
|
|
112
|
+
## Publication boundary
|
|
113
|
+
|
|
114
|
+
The existing GitHub `Release` workflow and its scoped repository/environment
|
|
115
|
+
publishing authority perform npm publication and create the GitHub Release only
|
|
116
|
+
after npm accepts the exact tested tarball. A pushed tag or successful identity
|
|
117
|
+
check alone does not establish public availability. Independent anonymous registry
|
|
118
|
+
download, exact-version isolated installation and tarball/checksum equality are
|
|
119
|
+
required before recording publication as accepted. No real everyday service is
|
|
120
|
+
restarted or upgraded by this release procedure.
|
|
@@ -114,3 +114,15 @@ clears the last resolved request. Unknown acknowledgements retain immutable byte
|
|
|
114
114
|
No activity interests, WidgetKit registrations or dedicated surface APNs calls
|
|
115
115
|
remain. Notification control, explicit reply/approval execution, immutable action
|
|
116
116
|
journals and outcome reconciliation retain their original safeguards.
|
|
117
|
+
|
|
118
|
+
## Optional activity title provenance — unreleased November 15
|
|
119
|
+
|
|
120
|
+
An active phone activity separately owns bounded official agent and workspace
|
|
121
|
+
read subscriptions. The phone may authorize an exact agent/workspace title source;
|
|
122
|
+
the companion resolves current official text, never a cached phone title. Missing
|
|
123
|
+
provenance cannot be inferred from a partial recent directory. Visible shared roots
|
|
124
|
+
deny workspace projection; managed children do not count as independent roots.
|
|
125
|
+
Workspace updates enter the existing semantic event fingerprint, not another
|
|
126
|
+
Worker poll. Unknown workspace metadata delays only activity publication; explicit
|
|
127
|
+
empty official titles fall back to agent text. Same-daemon read recovery retains
|
|
128
|
+
confirmed names until new authority arrives. Disabling releases every read interest.
|
|
@@ -211,6 +211,25 @@ localized fallback; an authenticated legacy route may use cached local labels.
|
|
|
211
211
|
|
|
212
212
|
## Required evidence
|
|
213
213
|
|
|
214
|
+
An optional v2 `activityInterest` plaintext may contain `titleHints`, at most32
|
|
215
|
+
exact `{agentId,workspaceId,source:"conversation"|"workspace"}` objects whose full
|
|
216
|
+
UTF-8 JSON array is at most4000bytes. IDs are nonempty, at most512 UTF-8 bytes,
|
|
217
|
+
and exclude whitespace, slashes, backslashes and control characters. Duplicate
|
|
218
|
+
agent IDs, unknown fields, cached title text and other source values reject.
|
|
219
|
+
Existing host/daemon/lifetime and encrypted interest expiry bind every hint.
|
|
220
|
+
Only a matching workspace hint permits current official workspace text; conversation,
|
|
221
|
+
missing/mismatched hints or visible multiple roots retain current agent text.
|
|
222
|
+
The relay sees only the existing opaque envelope. Unknown publications keep
|
|
223
|
+
their exact original ciphertext, even if names or hints change before acknowledgement.
|
|
224
|
+
Missing workspace metadata is unknown, not an empty title: optional activity
|
|
225
|
+
publication waits without delaying notifications. A full official workspace entry
|
|
226
|
+
with a missing/null/blank title permits agent fallback; a removal is unknown.
|
|
227
|
+
Read failures and bounded-page omissions retain
|
|
228
|
+
confirmed metadata. One workspace shares generation/sequence ordering across
|
|
229
|
+
subscriptions; older same-generation snapshots cannot replace newer updates.
|
|
230
|
+
Without sequence evidence, an active exact owned read outranks a broad read;
|
|
231
|
+
legacy exact seeds cannot overwrite stream changes observed during their request.
|
|
232
|
+
|
|
214
233
|
Cross-runtime vectors cover exact encryption/decryption and authenticated metadata;
|
|
215
234
|
wrong keys, modified routing, expired envelopes and unsupported versions fail.
|
|
216
235
|
State-machine tests cover conflicting reuse, restart at each execution boundary,
|
|
@@ -451,3 +451,10 @@ for routine updates/10for attention or end, ordered epoch-second timestamps,
|
|
|
451
451
|
stale-date and immediate end dismissal. Apple4KiB limits are checked after final
|
|
452
452
|
serialization. Registration, exact retries, revocation and end never authorize
|
|
453
453
|
commands. Legacy activity/widget routes remain410. No push-to-start is implemented.
|
|
454
|
+
|
|
455
|
+
Optional title provenance changes only encrypted endpoint plaintext, not any
|
|
456
|
+
HTTP request/response shape or routing authority. Capable companions accept
|
|
457
|
+
the bounded `titleHints` extension specified in02; phones send it only after
|
|
458
|
+
matching a fresh official-file capability to the current enrollment descriptor.
|
|
459
|
+
Older companions receive the unchanged interest shape. No cloud capability
|
|
460
|
+
probe, title plaintext, additional event route or Worker poll is introduced.
|
|
@@ -173,6 +173,11 @@ claim a local resolve API erases a notification already displayed by iOS.
|
|
|
173
173
|
|
|
174
174
|
## Required regression cases
|
|
175
175
|
|
|
176
|
+
Activity title-source hints are presentation-only: they cannot select a command
|
|
177
|
+
target, approve a request, clear attention or change any operation/receipt identity.
|
|
178
|
+
Resolving a rename preserves all exact unknown-publication bytes and existing
|
|
179
|
+
dispatch, revocation and expiry checks.
|
|
180
|
+
|
|
176
181
|
- Lost/withheld revoke reaches cloud but not companion: no endpoint-confirmed UI.
|
|
177
182
|
- Revoke/cancel persisted locally survives restart and blocks later dispatch;
|
|
178
183
|
already-dispatched cancellation is tooLate, not falsely cancelled.
|
|
@@ -50,6 +50,20 @@ over the already authenticated official file channel. Descriptor lifetime is90s,
|
|
|
50
50
|
renewed no faster than30s; disablement can remove resources or publish disabled
|
|
51
51
|
without granting a new enabled lease. This is not a cloud heartbeat.
|
|
52
52
|
|
|
53
|
+
Optional activity title support is published outside that legacy tree at
|
|
54
|
+
`<home>/.moremote-cli-activity/<sha256(UTF8 daemonServerId)>/capabilities.json`.
|
|
55
|
+
Its exact bounded object is `{version:1,daemonServerId,instanceId,measuredAt,
|
|
56
|
+
expiresAt,titleHints:1}`. It contains no title text or keys. The independent
|
|
57
|
+
marked0700 directories bind to the same state directory; the0600 document uses
|
|
58
|
+
the descriptor's exact instance/clock/90s expiry and30s renewal, while the existing
|
|
59
|
+
enrollment runtime holds its exclusive lock. Matching-instance stop removes it;
|
|
60
|
+
foreign files/markers/symlinks are never overwritten or deleted. Phones require
|
|
61
|
+
a fresh matching enabled descriptor and capability before sending title hints.
|
|
62
|
+
The old descriptor fields/tree stay unchanged, so an older runtime rollback
|
|
63
|
+
ignores the separate tree; a retained file loses authority on instance mismatch
|
|
64
|
+
or expiry. A later capable runtime can replace a valid old-instance document
|
|
65
|
+
only after acquiring the normal enrollment runtime lock.
|
|
66
|
+
|
|
53
67
|
After validating the original authenticated host/session/generation and fresh
|
|
54
68
|
descriptor, the app durably retains one exact immutable UTF-8 request before
|
|
55
69
|
official create/read-revision/write. Empty files are unfinished creates, not
|
|
@@ -114,6 +128,11 @@ Config/resource readers and atomic writers use the same524288-byte serialized
|
|
|
114
128
|
bound, preserving full original request bytes. Oversize writes reject before
|
|
115
129
|
replacement. Only acquired runtime ownership initializes fresh config; duplicate
|
|
116
130
|
`run` never writes an old loaded config over live enrollment.
|
|
131
|
+
Private reads retain their3-attempt bound when a POSIX pathname lookup itself
|
|
132
|
+
returns an inode retired by rename. Reopening requires a different strictly
|
|
133
|
+
owned regular replacement; no retired bytes may be returned. Hardlinks, symlinks,
|
|
134
|
+
foreign owners/modes and observed in-place mutation still reject, and mutation
|
|
135
|
+
operations do not gain this read-only retry permission.
|
|
117
136
|
|
|
118
137
|
## Expert-only manual enrollment offer v1
|
|
119
138
|
|