@cleocode/core 2026.9.26 → 2026.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build-provenance.json +2 -2
- package/dist/cloud/nexus-attach.d.ts +94 -0
- package/dist/cloud/nexus-attach.d.ts.map +1 -0
- package/dist/cloud/nexus-attach.js +192 -0
- package/dist/cloud/nexus-attach.js.map +1 -0
- package/dist/cloud/nexus-auth.d.ts +15 -3
- package/dist/cloud/nexus-auth.d.ts.map +1 -1
- package/dist/cloud/nexus-auth.js +90 -6
- package/dist/cloud/nexus-auth.js.map +1 -1
- package/dist/cloud/nexus-cloud-status.d.ts +132 -0
- package/dist/cloud/nexus-cloud-status.d.ts.map +1 -0
- package/dist/cloud/nexus-cloud-status.js +440 -0
- package/dist/cloud/nexus-cloud-status.js.map +1 -0
- package/dist/cloud/nexus-cloud.d.ts +179 -0
- package/dist/cloud/nexus-cloud.d.ts.map +1 -0
- package/dist/cloud/nexus-cloud.js +296 -0
- package/dist/cloud/nexus-cloud.js.map +1 -0
- package/dist/cloud/nexus-device.d.ts +31 -6
- package/dist/cloud/nexus-device.d.ts.map +1 -1
- package/dist/cloud/nexus-device.js +54 -7
- package/dist/cloud/nexus-device.js.map +1 -1
- package/dist/cloud/nexus-enrol.d.ts +35 -4
- package/dist/cloud/nexus-enrol.d.ts.map +1 -1
- package/dist/cloud/nexus-enrol.js +187 -47
- package/dist/cloud/nexus-enrol.js.map +1 -1
- package/dist/cloud/nexus-link.d.ts +8 -1
- package/dist/cloud/nexus-link.d.ts.map +1 -1
- package/dist/cloud/nexus-link.js +138 -11
- package/dist/cloud/nexus-link.js.map +1 -1
- package/dist/cloud/nexus-logout.d.ts +114 -0
- package/dist/cloud/nexus-logout.d.ts.map +1 -0
- package/dist/cloud/nexus-logout.js +429 -0
- package/dist/cloud/nexus-logout.js.map +1 -0
- package/dist/docs/export-document.js +242 -37
- package/dist/docs/export-document.js.map +3 -3
- package/dist/llm/plugin-facade.js +343 -138
- package/dist/llm/plugin-facade.js.map +3 -3
- package/dist/selfimprove/fix-gen.js +347 -142
- package/dist/selfimprove/fix-gen.js.map +3 -3
- package/dist/setup/sections/nexus-account.d.ts +8 -6
- package/dist/setup/sections/nexus-account.d.ts.map +1 -1
- package/dist/setup/sections/nexus-account.js +53 -9
- package/dist/setup/sections/nexus-account.js.map +1 -1
- package/dist/store/sync/replica.d.ts +34 -3
- package/dist/store/sync/replica.d.ts.map +1 -1
- package/dist/store/sync/replica.js +39 -2
- package/dist/store/sync/replica.js.map +1 -1
- package/dist/store/sync/schema.d.ts +6 -3
- package/dist/store/sync/schema.d.ts.map +1 -1
- package/dist/store/sync/schema.js +6 -3
- package/dist/store/sync/schema.js.map +1 -1
- package/package.json +13 -13
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `cleo cloud status`: the agent's single verification call (cleo-nexus
|
|
3
|
+
* device contract v2.15, §4.4, E3 `GET /v1/status`, §3.7).
|
|
4
|
+
*
|
|
5
|
+
* It reads local facts first (the device credential, the project, its
|
|
6
|
+
* `.cleo/nexus-link.json` entry, the store's replica id), then asks E3, and
|
|
7
|
+
* returns `{ verdict, summary, local, remote, warnings }`:
|
|
8
|
+
*
|
|
9
|
+
* - no credential: verdict `not-signed-in`, and no network call is made;
|
|
10
|
+
* - the server's verdict is downgraded to `not-linked` when the current
|
|
11
|
+
* project has no local link entry or no bound replica;
|
|
12
|
+
* - unreachable: `E_NEXUS_UNREACHABLE`, its `publicDetails` (the envelope's `error.details`) carrying `local` and a
|
|
13
|
+
* summary whose remote fields are null ({@link NexusCloudOfflineError});
|
|
14
|
+
* - outside a project (or `--project` naming an unknown id) the device and
|
|
15
|
+
* account parts are still reported and the verdict comes from the device
|
|
16
|
+
* checks only.
|
|
17
|
+
*
|
|
18
|
+
* Every request is a GET. Getting the credential may still upgrade a 9.24
|
|
19
|
+
* session (E1) and retry unsettled logouts (E9/E10), as every device-credential
|
|
20
|
+
* command does (§3.4, §3.5). The replica id is read through
|
|
21
|
+
* `activeReplica(db, 'project')` on a read-only snapshot handle
|
|
22
|
+
* (`openCleoDbSnapshot`, no migrations, no pragmas): this command never binds
|
|
23
|
+
* a replica or writes `cleo.db`. When the store cannot be read that way,
|
|
24
|
+
* `replicaId` is `null` with `W_NEXUS_REPLICA_UNREADABLE` and the verdict is
|
|
25
|
+
* `attention`, never `not-linked`: unknown is not unbound.
|
|
26
|
+
*
|
|
27
|
+
* A server without E3 (404 `E_NOT_FOUND` on `/v1/status`) gets the same
|
|
28
|
+
* `NexusStatus` shape composed client-side from E2, E14 and E15 with the
|
|
29
|
+
* contract's check and verdict rules, plus a `W_NEXUS_STATUS_COMPOSED`
|
|
30
|
+
* warning.
|
|
31
|
+
*
|
|
32
|
+
* TODO(T12905): `cleo cloud status --report` (send presence before E3) is not
|
|
33
|
+
* implemented here; it is the one write this command will gain.
|
|
34
|
+
*
|
|
35
|
+
* @task T12871
|
|
36
|
+
* @epic T12323
|
|
37
|
+
*/
|
|
38
|
+
import { type CloudStatusOfflineDetails, type CloudStatusResult, type CloudWarning, type NexusCloudStatus, type NexusCloudStatusCheck } from '@cleocode/contracts';
|
|
39
|
+
import { NexusAccountError } from './nexus-auth.js';
|
|
40
|
+
import { type NexusCloudConnection, type NexusCloudOptions } from './nexus-cloud.js';
|
|
41
|
+
/** Warning: the server has no E3, so the status was composed from E2, E14 and E15. */
|
|
42
|
+
export declare const W_NEXUS_STATUS_COMPOSED = "W_NEXUS_STATUS_COMPOSED";
|
|
43
|
+
/** Warning: the current project has no `.cleo/nexus-link.json` entry for the origin. */
|
|
44
|
+
export declare const W_NEXUS_NOT_LINKED_LOCALLY = "W_NEXUS_NOT_LINKED_LOCALLY";
|
|
45
|
+
/** Warning: the current project's store has no bound replica (or none could be read). */
|
|
46
|
+
export declare const W_NEXUS_NO_REPLICA = "W_NEXUS_NO_REPLICA";
|
|
47
|
+
/** Warning: the store exists but could not be read read-only, so `replicaId` is null. */
|
|
48
|
+
export declare const W_NEXUS_REPLICA_UNREADABLE = "W_NEXUS_REPLICA_UNREADABLE";
|
|
49
|
+
/** Warning: `--project` names an id the server does not show; only the device was checked. */
|
|
50
|
+
export declare const W_NEXUS_PROJECT_UNKNOWN = "W_NEXUS_PROJECT_UNKNOWN";
|
|
51
|
+
/** Options for {@link getNexusCloudStatus}. */
|
|
52
|
+
export interface NexusCloudStatusOptions extends NexusCloudOptions {
|
|
53
|
+
/** `--project`: the project to check; defaults to the current project. */
|
|
54
|
+
projectId?: string;
|
|
55
|
+
/** Clock for presence freshness when the status is composed (tests). */
|
|
56
|
+
now?: () => Date;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* `E_NEXUS_UNREACHABLE` from `cleo cloud status`, carrying the local facts
|
|
60
|
+
* (§4.4 "Offline"). Holds no secret.
|
|
61
|
+
*/
|
|
62
|
+
export declare class NexusCloudOfflineError extends NexusAccountError {
|
|
63
|
+
/**
|
|
64
|
+
* Local state, a summary with every remote field null, and the warnings
|
|
65
|
+
* collected so far. Named `publicDetails`: the CLI forwards only this
|
|
66
|
+
* explicitly secret-free field into the error envelope.
|
|
67
|
+
*/
|
|
68
|
+
readonly publicDetails: CloudStatusOfflineDetails;
|
|
69
|
+
/**
|
|
70
|
+
* @param message - Human message.
|
|
71
|
+
* @param publicDetails - Local state, summary and warnings.
|
|
72
|
+
* @param fix - Remedy.
|
|
73
|
+
*/
|
|
74
|
+
constructor(message: string, publicDetails: CloudStatusOfflineDetails, fix?: string);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The verdict of a set of checks (E3 rules, §4.2): the first matching rule wins.
|
|
78
|
+
*
|
|
79
|
+
* @param checks - The checks that apply.
|
|
80
|
+
* @returns `not-registered`, `not-linked`, `attention` or `ok`.
|
|
81
|
+
*/
|
|
82
|
+
export declare function nexusStatusVerdict(checks: readonly NexusCloudStatusCheck[]): NexusCloudStatus['verdict'];
|
|
83
|
+
/** What {@link readNexusLocalReplicaId} learned about the store's replica. */
|
|
84
|
+
export interface NexusLocalReplicaRead {
|
|
85
|
+
/** The active replica id, or `null` (no store, no bound replica, or unreadable). */
|
|
86
|
+
readonly replicaId: string | null;
|
|
87
|
+
/**
|
|
88
|
+
* `true` when the store exists but could not be read: `replicaId: null` then
|
|
89
|
+
* means "unknown", not "unbound", so the caller must not conclude not-linked.
|
|
90
|
+
*/
|
|
91
|
+
readonly unreadable: boolean;
|
|
92
|
+
/** `W_NEXUS_REPLICA_UNREADABLE` when `unreadable`. */
|
|
93
|
+
readonly warning: CloudWarning | null;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* The active replica id of a project store, read-only: a snapshot handle with
|
|
97
|
+
* no migrations and no pragmas, closed before returning. Never binds and never
|
|
98
|
+
* writes a row.
|
|
99
|
+
*
|
|
100
|
+
* SQLite side effect: a read-only open of a WAL-mode store needs the `-wal`
|
|
101
|
+
* and `-shm` sidecars, and SQLite creates them (empty) when they are missing
|
|
102
|
+
* and the directory is writable. Run as another user (for example under
|
|
103
|
+
* `sudo`), those sidecars would be left owned by that user, so when the store
|
|
104
|
+
* has no `-wal` and the directory is not writable by the caller the open is
|
|
105
|
+
* skipped and the store reported unreadable instead.
|
|
106
|
+
*
|
|
107
|
+
* @param projectRoot - Project root.
|
|
108
|
+
* @returns The replica id, whether the store was unreadable, and a warning.
|
|
109
|
+
*/
|
|
110
|
+
export declare function readNexusLocalReplicaId(projectRoot: string): Promise<NexusLocalReplicaRead>;
|
|
111
|
+
/**
|
|
112
|
+
* The `NexusStatus` of E3, composed from E2, E14 and E15 with the contract's
|
|
113
|
+
* check rules (§4.2 E3), for a server without E3.
|
|
114
|
+
*
|
|
115
|
+
* @param conn - Connection.
|
|
116
|
+
* @param projectId - Project to check, or `null`.
|
|
117
|
+
* @param replicaId - Replica to check, or `null`.
|
|
118
|
+
* @param now - Clock for presence freshness.
|
|
119
|
+
* @returns The composed status.
|
|
120
|
+
*/
|
|
121
|
+
export declare function composeNexusStatus(conn: NexusCloudConnection, projectId: string | null, replicaId: string | null, now?: () => Date): Promise<NexusCloudStatus>;
|
|
122
|
+
/**
|
|
123
|
+
* `cleo cloud status [--project <id>]`.
|
|
124
|
+
*
|
|
125
|
+
* @param opts - Project, API URL, stores and test overrides.
|
|
126
|
+
* @returns The verdict, summary, local and remote facts, and warnings.
|
|
127
|
+
* @throws {NexusCloudOfflineError} `E_NEXUS_UNREACHABLE` when the server does not answer.
|
|
128
|
+
* @throws {NexusAccountError} `E_NEXUS_DEVICE_REQUIRED`, `E_NEXUS_ACCOUNT_AMBIGUOUS`,
|
|
129
|
+
* or a mapped API refusal (§4.0.4).
|
|
130
|
+
*/
|
|
131
|
+
export declare function getNexusCloudStatus(opts?: NexusCloudStatusOptions): Promise<CloudStatusResult>;
|
|
132
|
+
//# sourceMappingURL=nexus-cloud-status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nexus-cloud-status.d.ts","sourceRoot":"","sources":["../../src/cloud/nexus-cloud-status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAIH,OAAO,EAEL,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EAGtB,KAAK,YAAY,EAGjB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAK3B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,iBAAiB,EAAsB,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAKL,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EAGvB,MAAM,kBAAkB,CAAC;AAI1B,sFAAsF;AACtF,eAAO,MAAM,uBAAuB,4BAA4B,CAAC;AAEjE,wFAAwF;AACxF,eAAO,MAAM,0BAA0B,+BAA+B,CAAC;AAEvE,yFAAyF;AACzF,eAAO,MAAM,kBAAkB,uBAAuB,CAAC;AAEvD,yFAAyF;AACzF,eAAO,MAAM,0BAA0B,+BAA+B,CAAC;AAEvE,8FAA8F;AAC9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
@@ -0,0 +1,440 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `cleo cloud status`: the agent's single verification call (cleo-nexus
|
|
3
|
+
* device contract v2.15, §4.4, E3 `GET /v1/status`, §3.7).
|
|
4
|
+
*
|
|
5
|
+
* It reads local facts first (the device credential, the project, its
|
|
6
|
+
* `.cleo/nexus-link.json` entry, the store's replica id), then asks E3, and
|
|
7
|
+
* returns `{ verdict, summary, local, remote, warnings }`:
|
|
8
|
+
*
|
|
9
|
+
* - no credential: verdict `not-signed-in`, and no network call is made;
|
|
10
|
+
* - the server's verdict is downgraded to `not-linked` when the current
|
|
11
|
+
* project has no local link entry or no bound replica;
|
|
12
|
+
* - unreachable: `E_NEXUS_UNREACHABLE`, its `publicDetails` (the envelope's `error.details`) carrying `local` and a
|
|
13
|
+
* summary whose remote fields are null ({@link NexusCloudOfflineError});
|
|
14
|
+
* - outside a project (or `--project` naming an unknown id) the device and
|
|
15
|
+
* account parts are still reported and the verdict comes from the device
|
|
16
|
+
* checks only.
|
|
17
|
+
*
|
|
18
|
+
* Every request is a GET. Getting the credential may still upgrade a 9.24
|
|
19
|
+
* session (E1) and retry unsettled logouts (E9/E10), as every device-credential
|
|
20
|
+
* command does (§3.4, §3.5). The replica id is read through
|
|
21
|
+
* `activeReplica(db, 'project')` on a read-only snapshot handle
|
|
22
|
+
* (`openCleoDbSnapshot`, no migrations, no pragmas): this command never binds
|
|
23
|
+
* a replica or writes `cleo.db`. When the store cannot be read that way,
|
|
24
|
+
* `replicaId` is `null` with `W_NEXUS_REPLICA_UNREADABLE` and the verdict is
|
|
25
|
+
* `attention`, never `not-linked`: unknown is not unbound.
|
|
26
|
+
*
|
|
27
|
+
* A server without E3 (404 `E_NOT_FOUND` on `/v1/status`) gets the same
|
|
28
|
+
* `NexusStatus` shape composed client-side from E2, E14 and E15 with the
|
|
29
|
+
* contract's check and verdict rules, plus a `W_NEXUS_STATUS_COMPOSED`
|
|
30
|
+
* warning.
|
|
31
|
+
*
|
|
32
|
+
* TODO(T12905): `cleo cloud status --report` (send presence before E3) is not
|
|
33
|
+
* implemented here; it is the one write this command will gain.
|
|
34
|
+
*
|
|
35
|
+
* @task T12871
|
|
36
|
+
* @epic T12323
|
|
37
|
+
*/
|
|
38
|
+
import { accessSync, existsSync, constants as fsConstants } from 'node:fs';
|
|
39
|
+
import { join } from 'node:path';
|
|
40
|
+
import { NEXUS_PRESENCE_FRESH_SECONDS, nexusCloudProjectDetailSchema, nexusCloudStatusSchema, nexusCloudWhoamiSchema, } from '@cleocode/contracts';
|
|
41
|
+
import { resolveCleoDir } from '../paths.js';
|
|
42
|
+
import { NexusAccountError, resolveNexusApiUrl } from './nexus-auth.js';
|
|
43
|
+
import { assertNexusCloudDeviceMode, connectNexusCloud, currentNexusCloudProject, listNexusCloudReplicas, nexusQueryPath, } from './nexus-cloud.js';
|
|
44
|
+
import { FileNexusTokenStore, nexusOriginKey } from './nexus-credentials.js';
|
|
45
|
+
import { NexusDeviceStore, UnreadableNexusDevice } from './nexus-device.js';
|
|
46
|
+
/** Warning: the server has no E3, so the status was composed from E2, E14 and E15. */
|
|
47
|
+
export const W_NEXUS_STATUS_COMPOSED = 'W_NEXUS_STATUS_COMPOSED';
|
|
48
|
+
/** Warning: the current project has no `.cleo/nexus-link.json` entry for the origin. */
|
|
49
|
+
export const W_NEXUS_NOT_LINKED_LOCALLY = 'W_NEXUS_NOT_LINKED_LOCALLY';
|
|
50
|
+
/** Warning: the current project's store has no bound replica (or none could be read). */
|
|
51
|
+
export const W_NEXUS_NO_REPLICA = 'W_NEXUS_NO_REPLICA';
|
|
52
|
+
/** Warning: the store exists but could not be read read-only, so `replicaId` is null. */
|
|
53
|
+
export const W_NEXUS_REPLICA_UNREADABLE = 'W_NEXUS_REPLICA_UNREADABLE';
|
|
54
|
+
/** Warning: `--project` names an id the server does not show; only the device was checked. */
|
|
55
|
+
export const W_NEXUS_PROJECT_UNKNOWN = 'W_NEXUS_PROJECT_UNKNOWN';
|
|
56
|
+
/**
|
|
57
|
+
* `E_NEXUS_UNREACHABLE` from `cleo cloud status`, carrying the local facts
|
|
58
|
+
* (§4.4 "Offline"). Holds no secret.
|
|
59
|
+
*/
|
|
60
|
+
export class NexusCloudOfflineError extends NexusAccountError {
|
|
61
|
+
/**
|
|
62
|
+
* Local state, a summary with every remote field null, and the warnings
|
|
63
|
+
* collected so far. Named `publicDetails`: the CLI forwards only this
|
|
64
|
+
* explicitly secret-free field into the error envelope.
|
|
65
|
+
*/
|
|
66
|
+
publicDetails;
|
|
67
|
+
/**
|
|
68
|
+
* @param message - Human message.
|
|
69
|
+
* @param publicDetails - Local state, summary and warnings.
|
|
70
|
+
* @param fix - Remedy.
|
|
71
|
+
*/
|
|
72
|
+
constructor(message, publicDetails, fix) {
|
|
73
|
+
super('E_NEXUS_UNREACHABLE', message, fix);
|
|
74
|
+
this.name = 'NexusCloudOfflineError';
|
|
75
|
+
this.publicDetails = publicDetails;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* The verdict of a set of checks (E3 rules, §4.2): the first matching rule wins.
|
|
80
|
+
*
|
|
81
|
+
* @param checks - The checks that apply.
|
|
82
|
+
* @returns `not-registered`, `not-linked`, `attention` or `ok`.
|
|
83
|
+
*/
|
|
84
|
+
export function nexusStatusVerdict(checks) {
|
|
85
|
+
const failed = (id) => checks.some((c) => c.id === id && !c.ok);
|
|
86
|
+
if (failed('device.registered') || failed('device.active'))
|
|
87
|
+
return 'not-registered';
|
|
88
|
+
if (failed('project.registered') || failed('replica.attached'))
|
|
89
|
+
return 'not-linked';
|
|
90
|
+
if (checks.some((c) => c.required && !c.ok))
|
|
91
|
+
return 'attention';
|
|
92
|
+
return 'ok';
|
|
93
|
+
}
|
|
94
|
+
/** The device and credential checks only (for "outside a project"). */
|
|
95
|
+
function deviceOnly(checks) {
|
|
96
|
+
return checks.filter((c) => c.id.startsWith('credential.') || c.id.startsWith('device.'));
|
|
97
|
+
}
|
|
98
|
+
/** An unreadable-store result with its warning. */
|
|
99
|
+
function unreadableStore(reason) {
|
|
100
|
+
return {
|
|
101
|
+
replicaId: null,
|
|
102
|
+
unreadable: true,
|
|
103
|
+
warning: {
|
|
104
|
+
code: W_NEXUS_REPLICA_UNREADABLE,
|
|
105
|
+
message: `could not read the project store read-only, so the replica id is unknown: ${reason}`,
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* The active replica id of a project store, read-only: a snapshot handle with
|
|
111
|
+
* no migrations and no pragmas, closed before returning. Never binds and never
|
|
112
|
+
* writes a row.
|
|
113
|
+
*
|
|
114
|
+
* SQLite side effect: a read-only open of a WAL-mode store needs the `-wal`
|
|
115
|
+
* and `-shm` sidecars, and SQLite creates them (empty) when they are missing
|
|
116
|
+
* and the directory is writable. Run as another user (for example under
|
|
117
|
+
* `sudo`), those sidecars would be left owned by that user, so when the store
|
|
118
|
+
* has no `-wal` and the directory is not writable by the caller the open is
|
|
119
|
+
* skipped and the store reported unreadable instead.
|
|
120
|
+
*
|
|
121
|
+
* @param projectRoot - Project root.
|
|
122
|
+
* @returns The replica id, whether the store was unreadable, and a warning.
|
|
123
|
+
*/
|
|
124
|
+
export async function readNexusLocalReplicaId(projectRoot) {
|
|
125
|
+
// The project store path, as resolveDualScopeDbPath('project', root) builds it.
|
|
126
|
+
const dir = resolveCleoDir(projectRoot);
|
|
127
|
+
const path = join(dir, 'cleo.db');
|
|
128
|
+
if (!existsSync(path))
|
|
129
|
+
return { replicaId: null, unreadable: false, warning: null };
|
|
130
|
+
if (!existsSync(`${path}-wal`) && !isWritable(dir)) {
|
|
131
|
+
return unreadableStore('the store has no -wal file and its directory is not writable, so a read-only open would fail or leave sidecars behind');
|
|
132
|
+
}
|
|
133
|
+
const { openCleoDbSnapshot } = await import('../store/open-cleo-db.js');
|
|
134
|
+
const { activeReplica } = await import('../store/sync/replica.js');
|
|
135
|
+
let snap;
|
|
136
|
+
try {
|
|
137
|
+
snap = openCleoDbSnapshot(path, { readOnly: true, applyPragmas: false });
|
|
138
|
+
const replicaId = activeReplica(snap.db, 'project')?.replicaId ?? null;
|
|
139
|
+
return { replicaId, unreadable: false, warning: null };
|
|
140
|
+
}
|
|
141
|
+
catch (err) {
|
|
142
|
+
return unreadableStore(err instanceof Error ? err.message : String(err));
|
|
143
|
+
}
|
|
144
|
+
finally {
|
|
145
|
+
snap?.close();
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
/** True when the caller may write into `dir`. */
|
|
149
|
+
function isWritable(dir) {
|
|
150
|
+
try {
|
|
151
|
+
accessSync(dir, fsConstants.W_OK);
|
|
152
|
+
return true;
|
|
153
|
+
}
|
|
154
|
+
catch {
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
/** True when a device credential (or a 9.24 session to upgrade) is stored for the origin. */
|
|
159
|
+
async function hasLocalCredential(apiUrl, devices, sessions) {
|
|
160
|
+
const origin = nexusOriginKey(apiUrl);
|
|
161
|
+
for (const d of await devices.list()) {
|
|
162
|
+
if (d instanceof UnreadableNexusDevice || d.origin !== origin)
|
|
163
|
+
continue;
|
|
164
|
+
if (d.currentBearer() !== null || d.unseal().raceCandidate)
|
|
165
|
+
return true;
|
|
166
|
+
}
|
|
167
|
+
return (await sessions.get(apiUrl)) !== null;
|
|
168
|
+
}
|
|
169
|
+
/** A summary with no remote facts. */
|
|
170
|
+
function emptySummary(local) {
|
|
171
|
+
return {
|
|
172
|
+
signedIn: local.signedIn,
|
|
173
|
+
registered: false,
|
|
174
|
+
profile: local.profile,
|
|
175
|
+
linked: false,
|
|
176
|
+
replicaAttached: false,
|
|
177
|
+
devices: 0,
|
|
178
|
+
lastPresenceAt: null,
|
|
179
|
+
lastSyncAt: null,
|
|
180
|
+
headSeq: null,
|
|
181
|
+
openConflicts: null,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
/** One check. */
|
|
185
|
+
function check(id, ok, required, detail) {
|
|
186
|
+
return { id, ok, required, detail };
|
|
187
|
+
}
|
|
188
|
+
/** E2's device and credential checks. */
|
|
189
|
+
function deviceChecks(whoami) {
|
|
190
|
+
const d = whoami.device;
|
|
191
|
+
const out = [
|
|
192
|
+
check('credential.valid', true, true, `${whoami.credential.kind} credential accepted`),
|
|
193
|
+
check('device.registered', d !== null, true, d ? `device ${d.deviceId}` : 'no device'),
|
|
194
|
+
check('device.active', d?.state === 'active', true, `state ${d?.state ?? 'none'}`),
|
|
195
|
+
];
|
|
196
|
+
if (d && d.certificate !== undefined) {
|
|
197
|
+
out.push(check('device.certified', d.certificate !== null, false, 'device certificate'));
|
|
198
|
+
}
|
|
199
|
+
return out;
|
|
200
|
+
}
|
|
201
|
+
/** The replica row of `replicaId`, from E14's list or, when that was cut, from E15. */
|
|
202
|
+
async function findReplica(conn, projectId, replicaId, listed, truncated) {
|
|
203
|
+
const hit = listed.find((r) => r.replicaId === replicaId);
|
|
204
|
+
if (hit || !truncated)
|
|
205
|
+
return hit ?? null;
|
|
206
|
+
const all = await listNexusCloudReplicas(conn, projectId);
|
|
207
|
+
return all.replicas.find((r) => r.replicaId === replicaId) ?? null;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* The `NexusStatus` of E3, composed from E2, E14 and E15 with the contract's
|
|
211
|
+
* check rules (§4.2 E3), for a server without E3.
|
|
212
|
+
*
|
|
213
|
+
* @param conn - Connection.
|
|
214
|
+
* @param projectId - Project to check, or `null`.
|
|
215
|
+
* @param replicaId - Replica to check, or `null`.
|
|
216
|
+
* @param now - Clock for presence freshness.
|
|
217
|
+
* @returns The composed status.
|
|
218
|
+
*/
|
|
219
|
+
export async function composeNexusStatus(conn, projectId, replicaId, now = () => new Date()) {
|
|
220
|
+
const whoami = await conn.get('/v1/whoami', nexusCloudWhoamiSchema);
|
|
221
|
+
const checks = deviceChecks(whoami);
|
|
222
|
+
const base = { user: whoami.user, credential: whoami.credential, device: whoami.device };
|
|
223
|
+
if (projectId === null) {
|
|
224
|
+
return {
|
|
225
|
+
...base,
|
|
226
|
+
project: null,
|
|
227
|
+
replica: null,
|
|
228
|
+
stream: null,
|
|
229
|
+
checks,
|
|
230
|
+
verdict: nexusStatusVerdict(checks),
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
const detail = await conn.find(`/v1/projects/${encodeURIComponent(projectId)}`, nexusCloudProjectDetailSchema);
|
|
234
|
+
checks.push(check('project.registered', detail !== null, true, detail ? 'visible' : 'not visible'));
|
|
235
|
+
if (detail === null) {
|
|
236
|
+
const project = {
|
|
237
|
+
projectId,
|
|
238
|
+
registered: false,
|
|
239
|
+
organizationId: null,
|
|
240
|
+
organizationName: null,
|
|
241
|
+
role: null,
|
|
242
|
+
};
|
|
243
|
+
return {
|
|
244
|
+
...base,
|
|
245
|
+
project,
|
|
246
|
+
replica: null,
|
|
247
|
+
stream: null,
|
|
248
|
+
checks,
|
|
249
|
+
verdict: nexusStatusVerdict(checks),
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
const writable = detail.role === 'writer' || detail.role === 'owner';
|
|
253
|
+
const writeRequired = whoami.credential.kind === 'device' && whoami.credential.profile === 'device';
|
|
254
|
+
checks.push(check('project.writable', writable, writeRequired, `role ${detail.role}`));
|
|
255
|
+
let replica = null;
|
|
256
|
+
if (replicaId !== null) {
|
|
257
|
+
const row = await findReplica(conn, projectId, replicaId, detail.replicas, detail.truncated);
|
|
258
|
+
const mine = row !== null && row.deviceId === whoami.device?.deviceId;
|
|
259
|
+
replica = {
|
|
260
|
+
replicaId,
|
|
261
|
+
attached: mine,
|
|
262
|
+
attachedElsewhere: row !== null && !mine,
|
|
263
|
+
attachedAt: row?.attachedAt ?? null,
|
|
264
|
+
lastSyncAt: row?.lastSyncAt ?? null,
|
|
265
|
+
presenceAt: row?.presenceAt ?? null,
|
|
266
|
+
lastReplicaSeq: null,
|
|
267
|
+
};
|
|
268
|
+
const fresh = replica.presenceAt !== null &&
|
|
269
|
+
now().getTime() - Date.parse(replica.presenceAt) <= NEXUS_PRESENCE_FRESH_SECONDS * 1000;
|
|
270
|
+
const syncOn = row?.presence?.sync?.enabled === true;
|
|
271
|
+
checks.push(check('replica.attached', mine, true, mine ? 'attached from this device' : row ? 'attached from another device' : 'not attached'), check('presence.fresh', fresh, false, replica.presenceAt ?? 'no presence'), check('replica.synced', replica.lastSyncAt !== null, syncOn, replica.lastSyncAt ?? 'never synced'));
|
|
272
|
+
}
|
|
273
|
+
checks.push(check('conflicts.none', detail.openConflicts === 0, true, `${detail.openConflicts} open`));
|
|
274
|
+
return {
|
|
275
|
+
...base,
|
|
276
|
+
project: {
|
|
277
|
+
projectId,
|
|
278
|
+
registered: true,
|
|
279
|
+
organizationId: detail.project.organizationId,
|
|
280
|
+
organizationName: detail.project.organizationName ?? null,
|
|
281
|
+
role: detail.role,
|
|
282
|
+
},
|
|
283
|
+
replica,
|
|
284
|
+
stream: detail.stream
|
|
285
|
+
? { ...detail.stream, openConflicts: detail.openConflicts, devices: detail.devices }
|
|
286
|
+
: null,
|
|
287
|
+
checks,
|
|
288
|
+
verdict: nexusStatusVerdict(checks),
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
/** E3, or the composed status when the server has no E3. */
|
|
292
|
+
async function remoteStatus(conn, projectId, replicaId, now, warnings) {
|
|
293
|
+
const path = nexusQueryPath('/v1/status', {
|
|
294
|
+
projectId: projectId ?? undefined,
|
|
295
|
+
// E3 refuses a replicaId without a projectId.
|
|
296
|
+
replicaId: projectId !== null && replicaId !== null ? replicaId : undefined,
|
|
297
|
+
});
|
|
298
|
+
const status = await conn.find(path, nexusCloudStatusSchema);
|
|
299
|
+
if (status !== null)
|
|
300
|
+
return status;
|
|
301
|
+
warnings.push({
|
|
302
|
+
code: W_NEXUS_STATUS_COMPOSED,
|
|
303
|
+
message: 'the server has no GET /v1/status yet; the status was composed from /v1/whoami and the project reads',
|
|
304
|
+
});
|
|
305
|
+
return composeNexusStatus(conn, projectId, replicaId, now);
|
|
306
|
+
}
|
|
307
|
+
/** Apply the local downgrades (§4.4) to the remote verdict. */
|
|
308
|
+
function localVerdict(remote, project, isLocal, replica, warnings) {
|
|
309
|
+
if (remote.project !== null && !remote.project.registered && !isLocal) {
|
|
310
|
+
warnings.push({
|
|
311
|
+
code: W_NEXUS_PROJECT_UNKNOWN,
|
|
312
|
+
message: `project ${remote.project.projectId} is not registered or not visible; only the device was checked`,
|
|
313
|
+
});
|
|
314
|
+
return nexusStatusVerdict(deviceOnly(remote.checks));
|
|
315
|
+
}
|
|
316
|
+
if (!isLocal || project === null || (remote.verdict !== 'ok' && remote.verdict !== 'attention')) {
|
|
317
|
+
return remote.verdict;
|
|
318
|
+
}
|
|
319
|
+
if (project.link === null) {
|
|
320
|
+
warnings.push({
|
|
321
|
+
code: W_NEXUS_NOT_LINKED_LOCALLY,
|
|
322
|
+
message: 'this project has no .cleo/nexus-link.json entry for the origin; run `cleo project link`',
|
|
323
|
+
});
|
|
324
|
+
return 'not-linked';
|
|
325
|
+
}
|
|
326
|
+
if (replica.unreadable) {
|
|
327
|
+
// Unknown is not unbound: never conclude not-linked from an unreadable
|
|
328
|
+
// store (W_NEXUS_REPLICA_UNREADABLE already says why).
|
|
329
|
+
return 'attention';
|
|
330
|
+
}
|
|
331
|
+
if (replica.replicaId === null) {
|
|
332
|
+
warnings.push({
|
|
333
|
+
code: W_NEXUS_NO_REPLICA,
|
|
334
|
+
message: "this project's store has no bound replica; run `cleo project link`",
|
|
335
|
+
});
|
|
336
|
+
return 'not-linked';
|
|
337
|
+
}
|
|
338
|
+
return remote.verdict;
|
|
339
|
+
}
|
|
340
|
+
/** The summary of a remote status. */
|
|
341
|
+
function summaryOf(remote, local, project, isLocal) {
|
|
342
|
+
const ok = (id) => remote.checks.some((c) => c.id === id && c.ok);
|
|
343
|
+
const registeredRemotely = remote.project?.registered === true;
|
|
344
|
+
return {
|
|
345
|
+
signedIn: true,
|
|
346
|
+
registered: ok('device.registered') && ok('device.active'),
|
|
347
|
+
profile: remote.credential.profile ?? local.profile,
|
|
348
|
+
linked: registeredRemotely && (!isLocal || (project?.link ?? null) !== null),
|
|
349
|
+
replicaAttached: remote.replica?.attached === true,
|
|
350
|
+
devices: remote.stream?.devices.active ?? 0,
|
|
351
|
+
lastPresenceAt: remote.replica?.presenceAt ?? null,
|
|
352
|
+
lastSyncAt: remote.replica?.lastSyncAt ?? null,
|
|
353
|
+
headSeq: remote.stream?.headSeq ?? null,
|
|
354
|
+
openConflicts: remote.stream?.openConflicts ?? null,
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* `cleo cloud status [--project <id>]`.
|
|
359
|
+
*
|
|
360
|
+
* @param opts - Project, API URL, stores and test overrides.
|
|
361
|
+
* @returns The verdict, summary, local and remote facts, and warnings.
|
|
362
|
+
* @throws {NexusCloudOfflineError} `E_NEXUS_UNREACHABLE` when the server does not answer.
|
|
363
|
+
* @throws {NexusAccountError} `E_NEXUS_DEVICE_REQUIRED`, `E_NEXUS_ACCOUNT_AMBIGUOUS`,
|
|
364
|
+
* or a mapped API refusal (§4.0.4).
|
|
365
|
+
*/
|
|
366
|
+
export async function getNexusCloudStatus(opts = {}) {
|
|
367
|
+
assertNexusCloudDeviceMode();
|
|
368
|
+
const apiUrl = resolveNexusApiUrl(opts.apiUrl);
|
|
369
|
+
const devices = opts.deviceStore ?? new NexusDeviceStore();
|
|
370
|
+
const sessions = opts.store ?? new FileNexusTokenStore();
|
|
371
|
+
const warnings = [];
|
|
372
|
+
const project = currentNexusCloudProject(apiUrl, opts.projectRoot);
|
|
373
|
+
const projectHere = project ? (project.link?.remoteProjectId ?? project.projectId) : null;
|
|
374
|
+
const isLocal = project !== null &&
|
|
375
|
+
(opts.projectId === undefined ||
|
|
376
|
+
opts.projectId === project.projectId ||
|
|
377
|
+
opts.projectId === project.link?.remoteProjectId);
|
|
378
|
+
// The current project (bare, or named by its local or remote id) is asked
|
|
379
|
+
// about by its linked remote id, like the bare command.
|
|
380
|
+
const projectId = isLocal ? projectHere : (opts.projectId ?? null);
|
|
381
|
+
let replica = { replicaId: null, unreadable: false, warning: null };
|
|
382
|
+
if (isLocal && project !== null) {
|
|
383
|
+
replica = await readNexusLocalReplicaId(project.root);
|
|
384
|
+
if (replica.warning)
|
|
385
|
+
warnings.push(replica.warning);
|
|
386
|
+
}
|
|
387
|
+
const replicaId = replica.replicaId;
|
|
388
|
+
const local = {
|
|
389
|
+
apiUrl,
|
|
390
|
+
signedIn: false,
|
|
391
|
+
nexusDeviceId: null,
|
|
392
|
+
profile: null,
|
|
393
|
+
projectId,
|
|
394
|
+
replicaId,
|
|
395
|
+
linkPath: isLocal && project?.link ? project.linkPath : null,
|
|
396
|
+
credentialsPath: devices.location,
|
|
397
|
+
};
|
|
398
|
+
const notSignedIn = () => ({
|
|
399
|
+
verdict: 'not-signed-in',
|
|
400
|
+
summary: emptySummary(local),
|
|
401
|
+
local,
|
|
402
|
+
remote: null,
|
|
403
|
+
warnings,
|
|
404
|
+
});
|
|
405
|
+
if (!(await hasLocalCredential(apiUrl, devices, sessions)))
|
|
406
|
+
return notSignedIn();
|
|
407
|
+
try {
|
|
408
|
+
const conn = await connectNexusCloud({
|
|
409
|
+
...opts,
|
|
410
|
+
apiUrl,
|
|
411
|
+
deviceStore: devices,
|
|
412
|
+
store: sessions,
|
|
413
|
+
});
|
|
414
|
+
warnings.push(...conn.warnings);
|
|
415
|
+
local.signedIn = true;
|
|
416
|
+
local.nexusDeviceId = conn.device.deviceId;
|
|
417
|
+
local.profile = conn.device.unseal().current?.profile ?? null;
|
|
418
|
+
const remote = await remoteStatus(conn, projectId, replicaId, opts.now, warnings);
|
|
419
|
+
const verdict = localVerdict(remote, project, isLocal, replica, warnings);
|
|
420
|
+
return {
|
|
421
|
+
verdict,
|
|
422
|
+
summary: summaryOf(remote, local, project, isLocal),
|
|
423
|
+
local,
|
|
424
|
+
remote,
|
|
425
|
+
warnings,
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
catch (err) {
|
|
429
|
+
if (err instanceof NexusAccountError &&
|
|
430
|
+
err.code === 'E_NEXUS_NOT_SIGNED_IN' &&
|
|
431
|
+
!local.signedIn) {
|
|
432
|
+
return notSignedIn();
|
|
433
|
+
}
|
|
434
|
+
if (err instanceof NexusAccountError && err.code === 'E_NEXUS_UNREACHABLE') {
|
|
435
|
+
throw new NexusCloudOfflineError(err.message, { local, summary: emptySummary(local), warnings }, err.fix);
|
|
436
|
+
}
|
|
437
|
+
throw err;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
//# sourceMappingURL=nexus-cloud-status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nexus-cloud-status.js","sourceRoot":"","sources":["../../src/cloud/nexus-cloud-status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAOL,4BAA4B,EAK5B,6BAA6B,EAC7B,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EACL,0BAA0B,EAC1B,iBAAiB,EACjB,wBAAwB,EACxB,sBAAsB,EAItB,cAAc,GACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAwB,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACnG,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE5E,sFAAsF;AACtF,MAAM,CAAC,MAAM,uBAAuB,GAAG,yBAAyB,CAAC;AAEjE,wFAAwF;AACxF,MAAM,CAAC,MAAM,0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