@moxuli/moremote 0.1.7 → 0.1.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/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.7**); source entry: `bin/moremote-cli.js`.
6
+ **`@moxuli/moremote`** (release **0.1.8**); 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;
@@ -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
  }
@@ -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
+ }
@@ -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;
@@ -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(agent.title || '会话', 160, 480),
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) {
@@ -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
  }
@@ -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?: "permission" | "error" | "finished" | null | undefined;
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?: "permission" | "error" | "finished" | null | undefined;
180
+ attentionReason?: "error" | "permission" | "finished" | null | undefined;
179
181
  attentionTimestamp?: string | null | undefined;
180
182
  archivedAt?: string | null | undefined;
181
183
  providerUnavailable?: boolean | undefined;
@@ -127,7 +127,7 @@ export class OfficialClient {
127
127
  await this.subscription.ready;
128
128
  }
129
129
  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; }
130
+ 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
131
  info() { return this.sdk.getLastServerInfoMessage(); }
132
132
  emit(event) { if (Number.isSafeInteger(event.timestamp) && event.timestamp >= 0)
133
133
  for (const cb of this.callbacks)
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 = inspectResource(path, 'file', false, privateMode);
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 = inspectResource(path, 'file', false, privateMode);
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/docs/STATE.md CHANGED
@@ -1,6 +1,46 @@
1
1
  # Project state
2
2
 
3
- ## Remote activity delivery — 2026-11-15, unreleased
3
+ ## Release candidate0.1.8 — 2026-11-15
4
+
5
+ The owner authorized CLI publication of the accepted title-provenance correction.
6
+ Package/lock root versions are0.1.8, with unchanged dependencies and compatibility
7
+ tuple. Independent follow-up closed all4initial blockers and independently passed
8
+ 11CLI tests; this is an independent-context same-provider review after the other
9
+ provider's account hold, not a cross-provider approval. The first hosted candidate
10
+ exposed a private-pathname retirement race before tagging; the final read-only
11
+ correction and observed-mutation fence have two independent security-context
12
+ approvals and36/36resource tests. Fresh `npm ci` audits0; final default check passes
13
+ 279/279with types/build, and actual packaged upgrade/failure rollback/aliased
14
+ frontend/clean-stop smoke passes. Original test deadlines are unchanged. Release
15
+ identity validation passes. Final hosted CI/publication and receiver acceptance are pending;
16
+ no0.1.8public availability is claimed yet. See [[2026-11-15-title-provenance-release]].
17
+
18
+ ## Local title-provenance correction — unreleased
19
+
20
+ The activity endpoint accepts bounded encrypted source hints and resolves current
21
+ official workspace names through an active-only owned read subscription. A separate
22
+ private capability file preserves the exact legacy enrollment descriptor/tree and
23
+ rollback discovery. Targeted tests first reproduced rejected hints and missing
24
+ capability publication, then unknown-metadata, cross-owner ordering and cache
25
+ recovery failures. Final frozen checks pass types,267complete tests with zero
26
+ failures/skips and compilation;24focused tests also pass. Full tests use explicit
27
+ concurrency4 with all original timing assertions unchanged. Initial default
28
+ concurrency258tests had2runtime-deadline failures; both pass the final complete run.
29
+ See [[2026-11-15-live-activity-title-provenance]]. Source remains uncommitted;
30
+ no package release, service installation or physical device acceptance is implied.
31
+
32
+ ## Public0.1.7 — 2026-11-15
33
+
34
+ Reviewed sourceb6756ca is public as0.1.7. All3OS CI43645424293 and release
35
+ 43646031281 pass; anonymous registry download/install and exact frontend version
36
+ verify availability. Tested/npm/GitHub archive bytes and integrity match. Final
37
+ local250tests, types/build, packaged upgrade/rollback and audit0 pass. See
38
+ [[2026-11-15-informative-notifications-activity-release]]. No real host service
39
+ or physical APNs delivery is implied. Corresponding native/service rollout is
40
+ separately recorded; prior local-only checkpoints below remain historical.
41
+
42
+
43
+ ## Earlier local remote activity checkpoint — before0.1.7
4
44
 
5
45
  The owner-authorized v2 path shares CLI attention/activity event ingress and the
6
46
  existing APNs infrastructure. Native foreground-started activities receive encrypted
@@ -12,7 +52,7 @@ skips, App83, real system journeys2and unsigned Release all pass. See
12
52
 
13
53
  Updated: 2026-11-15
14
54
 
15
- ## Informative notification previews — local and unreleased
55
+ ## Earlier local notification preview checkpoint — before0.1.7
16
56
 
17
57
  Optional endpoint-encrypted session/host/current-content previews are implemented
18
58
  on `fix/notification-content-1115`, with unchanged action/route authority, exact
@@ -20,7 +60,7 @@ retries and original expiry. No new package, Worker or physical APNs acceptance
20
60
  is claimed. Final local checks and compatibility/review evidence:
21
61
  [[2026-11-15-informative-notifications-and-settings]].
22
62
 
23
- ## Current public release
63
+ ## Previous public release0.1.6
24
64
 
25
65
  `@moxuli/moremote@0.1.6` is independently available and installable. Source
26
66
  `c38e2b07adc88e6fd5f4e18ef9c41fb87b51f9b9`, immutable tagv0.1.6,
@@ -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,86 @@
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 platform checks/publication/receiver acceptance remain pending.
77
+
78
+ ## Publication boundary
79
+
80
+ The existing GitHub `Release` workflow and its scoped repository/environment
81
+ publishing authority perform npm publication and create the GitHub Release only
82
+ after npm accepts the exact tested tarball. A pushed tag or successful identity
83
+ check alone does not establish public availability. Independent anonymous registry
84
+ download, exact-version isolated installation and tarball/checksum equality are
85
+ required before recording publication as accepted. No real everyday service is
86
+ 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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moxuli/moremote",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "Optional encrypted notification and scoped-action companion for Paseo",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",